2018-01-28 16:40:49 +00:00
< ? php
2021-02-01 14:39:48 +00:00
use Battles\Template ;
2018-01-28 16:40:49 +00:00
ob_start ( " ob_gzhandler " );
session_start ();
2020-09-30 12:30:00 +00:00
require_once " functions.php " ;
2018-01-28 16:40:49 +00:00
$errkom = '' ;
2020-10-29 23:30:05 +00:00
mysql_query ( 'DELETE FROM `laba_zv` WHERE `time` < "' . ( time () - 1 * 60 * 60 ) . '"' );
$var = mysql_fetch_array ( mysql_query ( 'SELECT `id`, `vals` FROM `actions` WHERE `vals` > "' . time () . '" AND `uid` = "' . $user [ 'id' ] . '" AND `vars` = "go_labirint" LIMIT 1' ));
$zv = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `laba_zv` WHERE `uid1` = "' . $user [ 'id' ] . '" OR `uid2` = "' . $user [ 'id' ] . '" OR `uid3` = "' . $user [ 'id' ] . '" OR `uid4` = "' . $user [ 'id' ] . '" LIMIT 1' ));
$re = '' ;
if ( isset ( $_GET [ 'exitlaba' ])) {
if ( isset ( $zv [ 'id' ])) {
$re = 'Подали заявку и убегаем? Н е хорошо!' ;
} else {
mysql_query ( " UPDATE `users`, `online` SET `users`.`room` = '2601', `online`.`room` = '2601' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ' { $user [ 'id' ] } ' " );
header ( 'Location: city.php' );
}
} elseif ( isset ( $_GET [ 'pz1' ])) {
if ( isset ( $zv [ 'id' ])) {
$re = 'Вы уже подали заявку...' ;
} else {
if ( $user [ 'level' ] < 4 ) {
$re = 'Персонажам до 4-г о уровня запрещается посещать лабиринт!' ;
} elseif ( isset ( $var [ 'id' ])) {
$tm = timeOut ( $var [ 'vals' ] - time ());
$re = 'Следующий поход через: ' . $tm ;
2020-09-30 19:12:34 +00:00
} else {
2020-10-29 23:30:05 +00:00
$_POST [ 'type_gors' ] = ( int ) $_POST [ 'type_gors' ];
if ( $_POST [ 'type_gors' ] == 0 && $user [ 'level' ] > 6 ) {
$re = 'Лабиринт для новичков доступен для 4-6 уровней!' ;
} elseif ( $_POST [ 'type_gors' ] == 1 && $user [ 'level' ] < 7 ) {
$re = 'Лабиринт для опытных доступен с 7 уровня!' ;
} elseif ( $_POST [ 'type_gors' ] == 2 && ( $user [ 'level' ] < 9 || $user [ 'rep_laba' ] < 20000 )) {
$re = 'Легендарный Лабиринт доступен с 9 уровня!<br />Так-же требуется 20000 репутации Лабиринтов! У В а с : ' . $user [ 'rep_laba' ] . ' репутации Лабиринтов.' ;
2020-09-30 19:12:34 +00:00
} else {
2020-10-29 23:30:05 +00:00
mysql_query ( 'INSERT INTO `laba_zv` (`uid1`, `time`, `com`, `pass`, `type`, `level`) VALUES ("' . $user [ 'id' ] . '", "' . time () . '", "' . mysql_real_escape_string ( htmlspecialchars ( $_POST [ 'text' ])) . '", "' . mysql_real_escape_string ( $_POST [ 'text' ]) . '", "' . mysql_real_escape_string ( $_POST [ 'type_gors' ]) . '", "' . $user [ 'level' ] . '")' );
header ( 'Location: lab_enter.php' );
2020-09-30 19:12:34 +00:00
}
}
2020-10-29 23:30:05 +00:00
}
} elseif ( isset ( $_GET [ 'cancelzv' ])) {
if ( ! isset ( $zv [ 'id' ])) {
$re = 'Вы не участвуете ни в одной из заявок!<br />' ;
} else {
$i = 1 ;
$j = 4 ;
$k = 0 ;
$h = 0 ;
while ( $i <= 4 ) {
if ( $k == 0 && $zv [ 'uid' . $i ] != $user [ 'id' ]) {
$k = $zv [ 'uid' . $i ];
$h = $i ;
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
$i ++ ;
}
$i = 1 ;
while ( $i <= 4 ) {
if ( $zv [ 'uid' . $i ] == $user [ 'id' ]) {
if ( $i > 1 ) {
$zv [ 'uid' . $i ] = 0 ;
} else {
$zv [ 'uid' . $i ] = $k ;
$zv [ 'uid' . $h ] = 0 ;
2020-09-30 19:12:34 +00:00
}
}
2020-10-29 23:30:05 +00:00
if ( $zv [ 'uid' . $i ] == 0 ) {
$j -- ;
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
$i ++ ;
}
if ( $j < 1 ) {
mysql_query ( 'DELETE FROM `laba_zv` WHERE `id` = "' . $zv [ 'id' ] . '" LIMIT 1' );
} else {
mysql_query ( 'UPDATE `laba_zv` SET `uid1` = "' . $zv [ 'uid1' ] . '", `uid2` = "' . $zv [ 'uid2' ] . '", `uid3` = "' . $zv [ 'uid3' ] . '", `uid4` = "' . $zv [ 'uid4' ] . '" WHERE `id` = "' . $zv [ 'id' ] . '" lIMIT 1' );
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
$re = 'Заявка успешно отменена!<br />' ;
unset ( $zv );
}
} elseif ( isset ( $_GET [ 'priemzv' ])) {
if ( isset ( $zv [ 'id' ])) {
$re = 'Вы уже состоите в одной из заявок!' ;
} else {
$tozv = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `laba_zv` WHERE `id` = "' . mysql_real_escape_string ( $_GET [ 'priemzv' ]) . '" LIMIT 1' ));
if ( ! isset ( $tozv [ 'id' ])) {
$re = 'Заявка не найдена!' ;
} elseif ( isset ( $var [ 'id' ])) {
$tm = timeOut ( $var [ 'vals' ] - time ());
$re = 'Следующий поход через: ' . $tm ;
2020-09-30 19:12:34 +00:00
} else {
2020-10-29 23:30:05 +00:00
if ( $tozv [ 'uid1' ] > 0 && $tozv [ 'uid2' ] > 0 && $tozv [ 'uid3' ] > 0 && $tozv [ 'uid4' ] > 0 ) {
$re = 'В заявке нет свободных мест!' ;
2020-09-30 19:12:34 +00:00
} else {
2020-10-29 23:30:05 +00:00
$i = 1 ;
$j = 0 ;
while ( $i <= 4 ) {
if ( $tozv [ 'uid' . $i ] == 0 && $j == 0 ) {
$j = $i ;
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
$i ++ ;
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
mysql_query ( 'UPDATE `laba_zv` SET `uid' . $j . '` = "' . $user [ 'id' ] . '" WHERE `id` = "' . $tozv [ 'id' ] . '" LIMIT 1' );
header ( 'Location: lab_enter.php' );
2020-09-30 19:12:34 +00:00
}
}
2020-10-29 23:30:05 +00:00
}
} elseif ( isset ( $_GET [ 'startzv' ])) {
if ( ! isset ( $zv [ 'id' ])) {
$re = 'Вы должны сначала подать заявку!' ;
} elseif ( $zv [ 'uid1' ] != $user [ 'id' ]) {
$re = 'Вы должны являться лидером группы!' ;
} else {
if ( $zv [ 'type' ] == 0 ) {
$level = 5 ;
} elseif ( $zv [ 'type' ] == 1 ) {
$level = 8 ;
} elseif ( $zv [ 'type' ] == 2 ) {
$level = 10 ;
}
2018-01-28 16:40:49 +00:00
2020-10-29 23:30:05 +00:00
$k = floor ( 2.5 * $level );
$s = $k * 2 + 3 ;
$r = 10 ;
$count = 1 ;
$a = [];
for ( $y = 0 ; $y < $s ; $y ++ ) {
2020-09-30 19:12:34 +00:00
for ( $x = 0 ; $x < $s ; $x ++ ) {
2020-10-29 23:30:05 +00:00
$a [ $y ][ $x ] = 1 ;
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
}
for ( $x = 0 ; $x < $s ; $x ++ ) {
$a [ 0 ][ $x ] = 0 ;
$a [ $s - 1 ][ $x ] = 0 ;
$a [ $x ][ 0 ] = 0 ;
$a [ $x ][ $s - 1 ] = 0 ;
}
$x = $y = ( $k - 1 ) >> 1 ;
$a [ $y * 2 + 2 ][ $x * 2 + 2 ] = 0 ;
while ( 1 ) {
do {
$d = rand ( 0 , 3 );
for ( $i = 0 ; $i < 4 ; $i ++ ) {
if ( $d == 0 && $a [ $y * 2 + 2 ][ $x * 2 + 4 ]) {
$a [ $y * 2 + 2 ][ $x ++ * 2 + 3 ] = 0 ;
$a [ $y * 2 + 2 ][ $x * 2 + 2 ] = 0 ;
$i = 5 ;
$count ++ ;
break ;
} elseif ( $d == 1 && $a [ $y * 2 ][ $x * 2 + 2 ]) {
$a [ $y -- * 2 + 1 ][ $x * 2 + 2 ] = 0 ;
$a [ $y * 2 + 2 ][ $x * 2 + 2 ] = 0 ;
$i = 5 ;
$count ++ ;
break ;
} elseif ( $d == 2 && $a [ $y * 2 + 2 ][ $x * 2 ]) {
$a [ $y * 2 + 2 ][ $x -- * 2 + 1 ] = 0 ;
$a [ $y * 2 + 2 ][ $x * 2 + 2 ] = 0 ;
$i = 5 ;
$count ++ ;
break ;
} elseif ( $d == 3 && $a [ $y * 2 + 4 ][ $x * 2 + 2 ]) {
$a [ $y ++ * 2 + 3 ][ $x * 2 + 2 ] = 0 ;
$a [ $y * 2 + 2 ][ $x * 2 + 2 ] = 0 ;
$i = 5 ;
$count ++ ;
break ;
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
$d = ( $d + 1 ) % 4 ;
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
} while ( $i != 4 );
if ( $count >= $k * $k ) {
break ;
}
$x = rand ( 0 , $k - 1 );
$y = rand ( 0 , $k - 1 );
while ( $a [ $y * 2 + 2 ][ $x * 2 + 2 ] || ! $a [ $y * 2 + 2 ][ $x * 2 + 4 ] && ! $a [ $y * 2 ][ $x * 2 + 2 ] && ! $a [ $y * 2 + 2 ][ $x * 2 ] && ! $a [ $y * 2 + 4 ][ $x * 2 + 2 ]) {
if ( ++ $x >= $k ) {
$x = 0 ;
if ( ++ $y >= $k ) {
$y = 0 ;
2020-09-30 19:12:34 +00:00
}
}
}
2020-10-29 23:30:05 +00:00
}
$rnds = [ rand ( 1 , 3 ), rand ( 1 , 3 )];
$srg = [];
$objects = [];
if ( $rnds [ 0 ] == 1 ) {
$a [ 2 ][ 1 ] = 0 ;
$a [ 2 ][ 2 ] = 0 ;
$srg = [ 2 , 1 ];
$objects [ 2 ][ 1 ] = '<div title="Вход в подземелье" class="ddpStart"></div>' ;
} elseif ( $rnds [ 0 ] == 2 ) {
$a [ $k ][ 1 ] = 0 ;
$a [ $k ][ 2 ] = 0 ;
$srg = [ $k , 1 ];
$objects [ $k ][ 1 ] = '<div title="Вход в подземелье" class="ddpStart"></div>' ;
} elseif ( $rnds [ 0 ] == 3 ) {
$a [ $k * 2 ][ 1 ] = 0 ;
$a [ $k * 2 ][ 2 ] = 0 ;
$srg = [ $k * 2 , 1 ];
$objects [ $k * 2 ][ 1 ] = '<div title="Вход в подземелье" class="ddpStart"></div>' ;
}
2018-01-28 16:40:49 +00:00
2020-10-29 23:30:05 +00:00
if ( $rnds [ 1 ] == 1 ) {
$a [ 2 ][ $k * 2 + 1 ] = 0 ;
$a [ 2 ][ $k * 2 ] = 0 ;
$objects [ 2 ][ $k * 2 + 1 ] = '<div title="Выход из подземелье" class="ddpExit"></div>' ;
} elseif ( $rnds [ 1 ] == 2 ) {
$a [ $k ][ $k * 2 + 1 ] = 0 ;
$a [ $k ][ $k * 2 ] = 0 ;
$objects [ $k ][ $k * 2 + 1 ] = '<div title="Выход из подземелье" class="ddpExit"></div>' ;
} elseif ( $rnds [ 1 ] == 3 ) {
$a [ $k * 2 ][ $k * 2 + 1 ] = 0 ;
$a [ $k * 2 ][ $k * 2 ] = 0 ;
$objects [ $k * 2 ][ $k * 2 + 1 ] = '<div title="Выход из подземелье" class="ddpExit"></div>' ;
}
2018-01-28 16:40:49 +00:00
2020-10-29 23:30:05 +00:00
$map = [];
$i = 1 ;
while ( $i < count ( $a ) - 1 ) {
$j = 1 ;
while ( $j < count ( $a [ $i ]) - 1 ) {
if ( $a [ $i ][ $j ] == 0 && $i > 1 && $j > 1 && $i <= $k * 2 && $j <= $k * 2 ) {
$map [] = [ $i , $j ];
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
$j ++ ;
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
$i ++ ;
}
$proc1 = round ( 1.7 * $level ); //Сколько % занимают сундуки
$proc2 = round ( 2.5 * $level ); //Сколько % занимают монстры
$proc3 = round ( 1.35 * $level ); //Сколько % занимают хилки
$proc4 = round ( 0.5 * $level ); //Сколько % занимают ловушки
$proc5 = round ( 0.1 * $level ); //Сколько % занимают пандоры
$proc6 = round ( 0.2 * $level ); // Сколько занимает Антидот
2018-01-28 16:40:49 +00:00
2020-10-29 23:30:05 +00:00
$proc1 = round ( $proc1 / 2 );
$proc1 = round ( count ( $map ) / 100 * $proc1 );
$proc2 = round ( $proc2 / 2 );
$proc2 = round ( count ( $map ) / 100 * $proc2 );
$proc3 = round ( $proc3 / 2 );
$proc3 = round ( count ( $map ) / 100 * $proc3 );
$proc4 = round ( $proc4 / 2 );
$proc4 = round ( count ( $map ) / 100 * $proc4 );
$proc5 = round ( $proc5 / 2 );
$proc5 = round ( count ( $map ) / 100 * $proc5 );
$proc6 = round ( $proc6 / 2 );
$proc6 = round ( count ( $map ) / 100 * $proc6 );
2018-01-28 16:40:49 +00:00
2020-10-29 23:30:05 +00:00
$usi = 0 ;
mysql_query ( 'INSERT INTO `laba_now` (`time`, `uid`, `users`, `map_id`, `end`, `type`) VALUES ("' . time () . '", "' . $user [ 'id' ] . '", "-1", "0", "0", "' . $zv [ 'type' ] . '")' );
$ding = mysql_insert_id ();
$i = 1 ;
while ( $i <= 4 ) {
if ( $zv [ 'uid' . $i ] > 0 ) {
$plu = mysql_fetch_array ( mysql_query ( 'SELECT `id` FROM `users` WHERE `id` = "' . $zv [ 'uid' . $i ] . '" LIMIT 1' ));
if ( isset ( $plu [ 'id' ])) {
mysql_query ( " UPDATE `users`, `online` SET `users`.`room` = '1052', `online`.`room` = '1052', `users`.`x` = ' " . $srg [ 0 ] . " ', `users`.`y` = ' " . $srg [ 1 ] . " ', `users`.`xf` = ' " . $srg [ 0 ] . " ', `users`.`yr` = ' " . $srg [ 1 ] . " ', `users`.`laba` = ' " . $ding . " ' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ' " . $plu [ 'id' ] . " ' " );
$usi ++ ;
2020-09-30 19:12:34 +00:00
}
}
2020-10-29 23:30:05 +00:00
$i ++ ;
}
mysql_query ( 'UPDATE `laba_now` SET `users` = "' . $usi . '" WHERE `id` = "' . $ding . '" LIMIT 1' );
mysql_query ( 'INSERT INTO `laba_map` (`id`, `data`, `update`) VALUES ("' . $ding . '", "' . json_encode ( $a ) . '", "' . time () . '")' );
mysql_query ( 'DELETE FROM `laba_zv` WHERE `id` = "' . $zv [ 'id' ] . '" LIMIT 1' );
2018-01-28 16:40:49 +00:00
2020-10-29 23:30:05 +00:00
$i = 1 ;
while ( $i <= 6 ) {
if ( $ { 'proc' . $i } > 0 ) {
$j = 0 ;
while ( $j < $ { 'proc' . $i }) {
$cord = $map [ rand ( 0 , count ( $map ) - 1 )];
$obj = '' ;
if ( $i == 1 ) {
$obj = 'ddp1s' ;
} elseif ( $i == 2 ) {
$obj = 'ddp1m' ;
} elseif ( $i == 3 ) {
$obj = 'ddp1h' ;
} elseif ( $i == 4 ) {
$obj = 'ddp1l' ;
} elseif ( $i == 5 ) {
$obj = 'ddp1p' ;
} elseif ( $i == 6 ) {
$obj = 'ddp1a' ;
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
mysql_query ( 'INSERT INTO `laba_obj` (`lib`, `x`, `y`, `type`, `img`, `name`, `time`, `use`) VALUES ("' . $ding . '", "' . $cord [ 0 ] . '", "' . $cord [ 1 ] . '", "' . $i . '", "' . $obj . '", "{standart}", "' . time () . '", "0")' );
$j ++ ;
2020-09-30 19:12:34 +00:00
}
}
2020-10-29 23:30:05 +00:00
$i ++ ;
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
mysql_query ( 'DELETE FROM `laba_zv` WHERE `id` = "' . $zv [ 'id' ] . '" LIMIT 1' );
header ( 'Location: labirint.php' );
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
}
2021-02-01 14:39:48 +00:00
Template :: header ( 'Вход в Лабиринты' );
2020-10-29 23:30:05 +00:00
?>
2020-09-30 19:12:34 +00:00
< div style = " float: right; " >
< input type = " button " onclick = " location.href='lab_enter.php'; " value = " Обновить " >
< input type = " button " onclick = " location.href='?exitlaba=1'; " value = " Покинуть вход " >
</ div >
< div style = " padding-left: 0; " align = " center " >
< h3 > Вход в Лабиринты </ h3 >
</ div >
2020-10-29 23:30:05 +00:00
< ?
if ( isset ( $_GET [ 'del_com' ])) {
2021-02-01 19:20:23 +00:00
if ( $user -> getAdmin ()) {
2020-10-29 23:30:05 +00:00
mysql_query ( 'UPDATE `laba_zv` SET `com` = "" WHERE `id` = "' . ( int ) $_GET [ 'del_com' ] . '" LIMIT 1' );
$re = 'Комментарий удалён' ;
} else {
$re = 'Вы не можете удалять комментарии.' ;
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
}
2018-01-28 16:40:49 +00:00
2020-10-29 23:30:05 +00:00
if ( $user [ 'level' ] >= 4 ) {
if ( isset ( $_GET [ 'quest' ])) {
$q2 = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `qst_user` WHERE `uid` = "' . $user [ 'id' ] . '" AND `cancel` = "0" AND `finish` = "0" LIMIT 1' ));
if ( ! isset ( $q2 [ 'id' ])) {
$q3 = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `qst_user` WHERE `uid` = "' . $user [ 'id' ] . '" AND (`cancel` > "' . time () . '" OR `finish` > "' . time () . '") LIMIT 1' ));
if ( isset ( $q3 [ 'id' ])) {
if ( $q3 [ 'cancel' ] > time ()) {
$tm = timeOut ( $q3 [ 'cancel' ] - time ());
2020-09-30 19:12:34 +00:00
} else {
2020-10-29 23:30:05 +00:00
$tm = timeOut ( $q3 [ 'finish' ] - time ());
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
$re = 'Нельзя брать задания так часто, разрешенный лимит: Один раз в 12 часов.<br /> Следующее задание можно взять через : ' . $tm ;
2020-09-30 19:12:34 +00:00
} else {
2020-10-29 23:30:05 +00:00
$rand = [];
$sp = mysql_query ( 'SELECT `id`, `name` FROM `qst` WHERE `level` = "' . $user [ 'level' ] . '"' );
while ( $pl = mysql_fetch_array ( $sp )) {
$rand [] = $pl ;
}
$rand = $rand [ rand ( 0 , count ( $rand ) - 1 )];
if ( $rand [ 'id' ] > 0 ) {
$re = 'Вы успешно взяли задание "' . $rand [ 'name' ] . '"!<br />' ;
mysql_query ( 'INSERT INTO `qst_user` (`uid`, `time`, `qid`) VALUES ("' . $user [ 'id' ] . '", "' . time () . '", "' . $rand [ 'id' ] . '")' );
} else {
$re = 'Неудалось взять задание, нет подходящих заданий у Хранителя Лабиринта<br />' ;
}
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
} else {
$re = 'У вас уже есть задание.' ;
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
}
2018-01-28 16:40:49 +00:00
2020-10-29 23:30:05 +00:00
$q2 = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `qst_user` WHERE `uid` = "' . $user [ 'id' ] . '" AND `cancel` = "0" AND `finish` = "0" LIMIT 1' ));
$q1 = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `qst` WHERE `id` = "' . $q2 [ 'qid' ] . '" LIMIT 1' ));
2018-01-28 16:40:49 +00:00
2020-10-29 23:30:05 +00:00
if ( isset ( $q2 [ 'id' ]) && isset ( $_GET [ 'cancelqst' ])) {
mysql_query ( 'UPDATE `qst_user` SET `cancel` = "' . ( time () + 6 * 3600 ) . '" WHERE `id` = "' . $q2 [ 'id' ] . '" LIMIT 1' );
unset ( $q1 , $q2 );
$re = 'Вы успешно отказались от задания...<br />' ;
}
2018-01-28 16:40:49 +00:00
2020-10-29 23:30:05 +00:00
if ( isset ( $q1 [ 'id' ])) {
$re .= '<br /><b>Задание : </b> ' . $q1 [ 'name' ] . ' [' . $q2 [ 'val' ] . '/' . $q1 [ 'obj_val' ] . ']<br /><a href="?cancelqst=1">• Отказаться (Следующее можно будет взять через 12 часов)</a><br />' ;
if ( $q2 [ 'val' ] >= $q1 [ 'obj_val' ]) {
if ( isset ( $_GET [ 'finishqst' ])) {
$re = 'Вы успешно завершили задание и получили: ' ;
if ( $q1 [ 'cr' ] > 0 ) {
$re .= ' ' . $q1 [ 'cr' ] . ' кр. ' ;
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
if ( $q1 [ 'rep' ] > 0 ) {
$re .= ' ' . $q1 [ 'rep' ] . ' репутации. ' ;
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
$re .= '<br />' ;
$user [ 'money' ] += $q1 [ 'cr' ];
$user [ 'doblest' ] += $q1 [ 'rep' ];
$user [ 'rep_laba' ] += $q1 [ 'rep' ];
mysql_query ( 'UPDATE `users` SET `money` = "' . $user [ 'money' ] . '", `doblest` = "' . $user [ 'doblest' ] . '", `rep_laba` = "' . $user [ 'rep_laba' ] . '" WHERE `id` = "' . $user [ 'id' ] . '" LIMIT 1' );
mysql_query ( 'UPDATE `qst_user` SET `finish` = "' . ( time () + 60 * 60 * 12 ) . '" WHERE `id` = "' . $q2 [ 'id' ] . '" AND `uid` = "' . $user [ 'id' ] . '" LIMIT 1' );
unset ( $q1 , $q2 );
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
$re .= ' <a href="?finishqst=1">• Завершить задание и получить награду!</a>' ;
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
} else {
?>
< input onclick = " location.href='lab_enter.php?quest=1' " type = " submit " name = " quest "
value = 'Взять квестовое задание' style = " background-color:#A9AFC0 " />
< ? }
} ?>
< ?
$sp = mysql_query ( 'SELECT * FROM `laba_zv` ORDER BY `id` DESC' );
$typez = [ 0 => 'Для новичков' , 1 => 'Для опытных' , 2 => 'Для легендарных' ];
while ( $pl = mysql_fetch_array ( $sp )) {
$userszv = '' ;
$i = 1 ;
while ( $i <= 4 ) {
if ( $pl [ 'uid' . $i ] > 0 ) {
$plu = mysql_fetch_array ( mysql_query ( 'SELECT `id`, `align`, `login`, `level` FROM `users` WHERE `id` = "' . $pl [ 'uid' . $i ] . '" LIMIT 1' ));
if ( isset ( $plu [ 'id' ])) {
$userszv .= ', <img src="i/align_' . $plu [ 'align' ] . '.gif"><b>' . $plu [ 'login' ] . '</b> [' . $plu [ 'level' ] . ']' ;
2020-09-30 19:12:34 +00:00
}
}
2020-10-29 23:30:05 +00:00
$i ++ ;
}
$userszv = ltrim ( $userszv , ', ' );
if ( $pl [ 'com' ] != '' ) {
2021-02-01 19:20:23 +00:00
if ( $user -> getAdmin ()) {
2020-10-29 23:30:05 +00:00
$del = ' <a href=\'lab_enter.php?del_com=' . $pl [ 'id' ] . '\'>Удалить комментарий</a>' ;
} else {
$del = '' ;
2020-09-30 19:12:34 +00:00
}
2020-10-29 23:30:05 +00:00
$userszv .= ' (Комментарий: ' . $pl [ 'com' ] . '' . $del . ')' ;
}
if ( ! isset ( $zv [ 'id' ])) {
$userszv .= ' <input onclick="location.href=\'?priemzv=' . $pl [ 'id' ] . '\'" type="button" value="Принять">' ;
2018-01-28 16:40:49 +00:00
}
2020-10-29 23:30:05 +00:00
echo '<div><span class=date>' . date ( 'H:i' , $pl [ 'time' ]) . '</span> Тип : <b>' . $typez [ $pl [ 'type' ]] . '</b> | ' . $userszv . '</div>' ;
}
?>
2020-09-30 19:12:34 +00:00
< hr >
2020-10-29 23:30:05 +00:00
< ? if ( ! isset ( $zv [ 'id' ])) { ?>
< table width = " 350 " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >
< tr >
< td valign = " top " >
< form id = " from " autocomplete = " off " name = " from "
action = " lab_enter.php?pz1=<? echo mt_rand(1000000, 99999999); ?> " method = " post " >
2021-02-01 14:39:48 +00:00
< fieldset style = 'padding-left: 5px; width=50%' >
2020-10-29 23:30:05 +00:00
< legend >< b > Группа </ b ></ legend >
Тип похода :
< select name = " type_gors " style = " margin-left:7px; " id = " type_gors " >
< option value = " 0 " > Новичок </ option >
< option value = " 1 " > Опытный </ option >
< option value = " 2 " > Легендарный </ option >
</ select >
< br />
Комментарий
< input type = " text " name = " text " maxlength = " 40 " size = " 40 " />
< br />
< input type = " submit " name = " add " value = " Создать группу " />
& nbsp ; < br />
</ fieldset >
</ form >
</ td >
</ tr >
</ table >
< ? } else { ?>
< ? if ( $zv [ 'uid1' ] == $user [ 'id' ]) { ?>
< input type = " button " onclick = " location.href='lab_enter.php?startzv=1'; " value = " Начать поход " >
2020-09-30 19:12:34 +00:00
< ? } ?>
2020-10-29 23:30:05 +00:00
< input type = " button " onclick = " location.href='lab_enter.php?cancelzv=1'; " value = " Отозвать заявку " >
< ? } ?>
< ? if ( $re != '' ) {
echo '<br /><font color=red>' . $re . '</font>' ;
2020-09-30 19:12:34 +00:00
}