Файл: l2ps_v5/term.php
Строк: 63
<?php
include_once("files/zag.php");
include_once("files/ini.php");
$polz=mysql_query("SELECT * FROM `users` WHERE `udata0`='$log' AND `udata1`='$pas' LIMIT 1");
if(mysql_num_rows($polz)==0){
header ("Location: index.php?error");
}else{
switch($_GET[mod]){
default:
echo "<center><b>Их игра окончена, т.к. они нарушили правила игры</b></center>";
echo "<hr>";
$time=time();
if ($_GET[page] == "" || $_GET[page] < 0 || $_GET[page] == "0")
{
$_GET[page] = 0;
}
$next = $_GET[page] + 1;
$back = $_GET[page] - 1;
$num = $_GET[page] * 10;
if($_GET[page] == "0")
{$i = 1;}
else{$i = ($_GET[page]*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT usr FROM ban"));
$puslap = floor($viso/10);
$times = date("H:i");
$req = mysql_query("SELECT * FROM `ban` WHERE `ban_time`>'$time' ORDER BY id DESC LIMIT $num,10");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
While($mag = mysql_fetch_array($req))
{
echo"<a href="search.php?nick=$mag[usr]&go=go">$mag[usr]</a> - <a href="term.php?mod=1&id=$mag[id]">Подробнее</a><br/>";
}
echo "<hr>";
if ($_GET[page] > 0)
{
echo "<a href="term.php?page=$back">назад</a>";
}
elseif ($_GET[page] == 0)
{
echo "назад";
}
echo"|";
if($_GET[page] < $puslap || $_GET[page] == "" || $_GET[page] == 0)
{echo "<a href="term.php?page=$next">дальше</a>";}
else
{echo "дальше";}
}else{
echo"Нет персонажей!<br/>";
}
break;
case '1':
if(empty($_GET[id])){
echo"Нет такого позорника!";
include ("vuvod/foot.php");
exit;
}
$req = mysql_query("SELECT * FROM `ban` WHERE `id` = '".mysql_real_escape_string($_GET['id'])."' LIMIT 1");
// //////////////////////////
$avto = mysql_num_rows($req);
if ($avto == 1) {
$ban = mysql_fetch_array($req);
if($ban[ban_time]<$t){
mysql_query("DELETE FROM `ban` WHERE `usr` = '$nick'");
}else{
echo"Персонаж: <b>$ban[usr]</b> находится в тюрьме! <br>По причине: $ban[text]!<br> Осталось: ";
$ban[ban_time]=$ban[ban_time]-time();
if($ban[ban_time]<60){
echo "$ban[ban_time] сек.<br/>";
}elseif($ban[ban_time]>60 and $ban[ban_time]<3600){
$ban[ban_time]=round($ban[ban_time]/60);
echo "$ban[ban_time] мин.<br/>";
}else{
$ban[ban_time]=round($ban[ban_time]/3600);
echo "$ban[ban_time] часов</font><br/>";
}
}
}else{
echo"Нет такого позорника";
}
break;
}
}
include_once"files/down.php";
?>