2018-01-28 16:40:49 +00:00
< ? php
ob_start ( " ob_gzhandler " );
session_start ();
2020-09-30 12:58:44 +00:00
if ( empty ( $_SESSION [ 'uid' ])) { header ( " Location: index.php " ); }
2020-09-30 12:30:00 +00:00
require_once " functions.php " ;
2018-01-28 16:40:49 +00:00
header ( " Cache-Control: no-cache " );
$errkom = '' ;
2020-09-30 12:01:33 +00:00
if ( $user -> room == 1051 ) {
2018-01-28 16:40:49 +00:00
$aligns = array ( 2.99 );
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 ;
} else {
$_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' ] . ' репутации Лабиринтов.' ;
} else {
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' );
}
}
}
} 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 ;
}
$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 ;
}
}
if ( $zv [ 'uid' . $i ] == 0 ) {
$j -- ;
}
$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' );
}
$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 ;
} else {
if ( $tozv [ 'uid1' ] > 0 && $tozv [ 'uid2' ] > 0 && $tozv [ 'uid3' ] > 0 && $tozv [ 'uid4' ] > 0 ) {
$re = 'В заявке нет свободных мест!' ;
} else {
$i = 1 ; $j = 0 ;
while ( $i <= 4 ) {
if ( $tozv [ 'uid' . $i ] == 0 && $j == 0 ) {
$j = $i ;
}
$i ++ ;
}
mysql_query ( 'UPDATE `laba_zv` SET `uid' . $j . '` = "' . $user [ 'id' ] . '" WHERE `id` = "' . $tozv [ 'id' ] . '" LIMIT 1' );
header ( 'Location: lab_enter.php' );
}
}
}
} 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 ;
}
$k = floor ( 2.5 * $level ); $s = $k * 2 + 3 ; $r = 10 ; $count = 1 ;
$a = array ();
for ( $y = 0 ; $y < $s ; $y ++ ) {
for ( $x = 0 ; $x < $s ; $x ++ ) {
$a [ $y ][ $x ] = 1 ;
}
}
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 ;
}
$d = ( $d + 1 ) % 4 ;
}
} 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 ;
}
}
}
}
$rnds = array ( rand ( 1 , 3 ), rand ( 1 , 3 ));
$srg = array ();
$objects = array ();
if ( $rnds [ 0 ] == 1 ) {
$a [ 2 ][ 1 ] = 0 ; $a [ 2 ][ 2 ] = 0 ;
$srg = array ( 2 , 1 ); $objects [ 2 ][ 1 ] = '<div title="Вход в подземелье" class="ddpStart"></div>' ;
} elseif ( $rnds [ 0 ] == 2 ) {
$a [ $k ][ 1 ] = 0 ; $a [ $k ][ 2 ] = 0 ;
$srg = array ( $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 = array ( $k * 2 , 1 ); $objects [ $k * 2 ][ 1 ] = '<div title="Вход в подземелье" class="ddpStart"></div>' ;
}
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>' ;
}
$map = array ();
$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 [] = array ( $i , $j );
}
$j ++ ;
}
$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 ); // Сколько занимает Антидот
$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 );
$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 ++ ;
}
}
$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' );
$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' ;
}
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 ++ ;
}
}
$i ++ ;
}
mysql_query ( 'DELETE FROM `laba_zv` WHERE `id` = "' . $zv [ 'id' ] . '" LIMIT 1' );
header ( 'Location: labirint.php' );
}
}
?>
<! DOCTYPE HTML PUBLIC " -//W3C//DTD HTML 4.01 Transitional//EN " " http://www.w3.org/TR/html4/loose.dtd " >
< HTML >
< HEAD >
< link rel = stylesheet type = " text/css " href = " css/main.css " >
< style type = " text/css " >
body { margin - left : 5 px ; margin - top : 5 px ; margin - right : 5 px ; margin - bottom : 5 px ; }
. ddp0 { display : inline - block ; width : 15 px ; height : 15 px ; background - image : url ( " /combats-1/i/laba/bg/o.gif " ); }
. ddp1 { display : inline - block ; width : 15 px ; height : 15 px ; background - image : url ( " /combats-1/i/laba/bg/m.gif " ); }
. ddpStart { display : inline - block ; width : 15 px ; height : 15 px ; background - image : url ( " /combats-1/i/laba/bg/os.gif " ); }
. ddpExit { display : inline - block ; width : 15 px ; height : 15 px ; background - image : url ( " /combats-1/i/laba/bg/of.gif " ); }
. ddp1s {
display : inline - block ;
width : 15 px ;
height : 15 px ;
background - image : url ( " /combats-1/i/laba/bg/s.gif " );
}
. ddp1m {
display : inline - block ;
width : 15 px ;
height : 15 px ;
background - image : url ( " /combats-1/i/laba/bg/r.gif " );
}
. ddp1h {
display : inline - block ;
width : 15 px ;
height : 15 px ;
background - image : url ( " /combats-1/i/laba/bg/h.gif " );
}
. ddp1l {
display : inline - block ;
width : 15 px ;
height : 15 px ;
background - image : url ( " /combats-1/i/laba/bg/b.gif " );
}
. ddp1p {
display : inline - block ;
width : 15 px ;
height : 15 px ;
background - image : url ( " /combats-1/i/laba/bg/p.gif " );
}
</ style >
< meta content = " text/html; charset=utf-8 " http - equiv = Content - Type >
< META Http - Equiv = Cache - Control Content = " no-cache, max-age=0, must-revalidate, no-store " >
< meta http - equiv = PRAGMA content = NO - CACHE >
< META Http - Equiv = Expires Content = 0 >
</ head >
< body bgcolor = #e2e0e0 >
< div style = " float: right; " >
< input type = " button " onclick = " location.href='lab_enter.php'; " value = " Обновить " /> & nbsp ; < input type = " button " onclick = " location.href='?exitlaba=1'; " value = " Покинуть вход " /></ div >
2019-01-16 17:45:30 +00:00
< div style = " padding-left: 0; " align = " center " >
2018-01-28 16:40:49 +00:00
< h3 > Вход в Лабиринты </ h3 >
</ div >
< ?
if ( isset ( $_GET [ 'del_com' ])) {
if ( in_array ( $user [ 'align' ], $aligns )) {
mysql_query ( 'UPDATE `laba_zv` SET `com` = "" WHERE `id` = "' . ( int ) $_GET [ 'del_com' ] . '" LIMIT 1' );
$re = 'Комментарий удалён' ;
} else {
$re = 'Вы не можете удалять комментарии.' ;
}
}
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 ()); } else { $tm = timeOut ( $q3 [ 'finish' ] - time ()); }
$re = 'Нельзя брать задания так часто, разрешенный лимит: Один раз в 12 часов.<br /> Следующее задание можно взять через : ' . $tm ;
} else {
$rand = array ();
$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 />' ;
}
}
} else {
$re = 'У вас уже есть задание.' ;
}
}
$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' ));
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 />' ;
}
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' ] . ' кр. ' ;
}
if ( $q1 [ 'rep' ] > 0 ) {
$re .= ' ' . $q1 [ 'rep' ] . ' репутации. ' ;
}
$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 );
}
$re .= ' <a href="?finishqst=1">• Завершить задание и получить награду!</a>' ;
}
} 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 = array ( 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' ] . ']' ;
}
}
$i ++ ;
}
$userszv = ltrim ( $userszv , ', ' );
if ( $pl [ 'com' ] != '' ) {
if ( in_array ( $user [ 'align' ], $aligns )) {
$del = ' <a href=\'lab_enter.php?del_com=' . $pl [ 'id' ] . '\'>Удалить комментарий</a>' ;
} else {
$del = '' ;
}
$userszv .= ' (Комментарий: ' . $pl [ 'com' ] . '' . $del . ')' ;
}
if ( ! isset ( $zv [ 'id' ])) {
$userszv .= ' <input onclick="location.href=\'?priemzv=' . $pl [ 'id' ] . '\'" type="button" value="Принять">' ;
}
echo '<div><span class=date>' . date ( 'H:i' , $pl [ 'time' ]) . '</span> Тип : <b>' . $typez [ $pl [ 'type' ]] . '</b> | ' . $userszv . '</div>' ;
}
?>
< hr >
< ? 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 " >
< fieldset style = 'padding-left: 5; width=50%' >
< 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="Начать поход" /> <? } ?><input type="button" onclick="location.href='lab_enter.php?cancelzv=1';" value="Отозвать заявку" />
< ? } ?>
< ? if ( $re != '' ) { echo '<br /><font color=red>' . $re . '</font>' ; } ?>
</ body >
</ html >
< ? } ?>