Файл: wap-ads.ru/bans.php
Строк: 120
<?
$title=$ank['nick'].' | Нарушения';
include_once 'h.php';
$time=time();
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$ank[id]'"),0);
if ($k_post==0)
{
echo "<div class='list_item busis'><span class='minor'>Зафиксированных нарушений нет...</span></div>";
}
$num=0;
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$xx=mysql_query("SELECT * FROM `ban` WHERE `id_user` = '$ank[id]' ORDER BY `id` DESC LIMIT $start,$set[p_str]");
while($ban=mysql_fetch_assoc($xx)){
$num++;
if(isset($_GET['unban']) && $user['status']>0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id` = '".intval($_GET['unban'])."'"),0)!=0){
mysql_query("UPDATE `ban` SET `time` = '".(time()-1)."', `id_who2` = '$user[id]' WHERE `id_user` = '$ank[id]' AND `id` = '".intval($_GET['unban'])."'");
header("Location:?user=$ban[id_user]&bans");
}
if(isset($_GET['unizg']) && ($user['status']==4 || $user['status']==5) && mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id` = '".intval($_GET['unizg'])."'"),0)!=0){
mysql_query("UPDATE `ban` SET `izg` = '0', `time` = '".(time()-1)."', `id_who2` = '$user[id]' WHERE `id_user` = '$ank[id]' AND `id` = '".intval($_GET['unizg'])."'");
header("Location:?user=$ban[id_user]&bans");
}
if(isset($_GET['deletej']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id` = '".intval($_GET['deletej'])."'"),0)!=0){
mysql_query("DELETE FROM `ban` WHERE `id` = '".intval($_GET['deletej'])."'");
header("Location:?user=$ban[id_user]&bans");
}
echo "<div class='list_item busis'><span class='minor'>$num. Бан №$ban[id]".($user['status']==3?"<span style='float:right;'><img src='/images/icons/delete.png'> <a href='?user=$ban[id_user]&bans&deletej=$ban[id]'>Удалить</a></span>":null)."<br>";
echo iconka($ban['id_user']);
echo "<a href='?user=$ban[id_user]'>".nc($ban['id_user'])."</a><br>".output_text($ban['msg'], $ban['id_who'])."<br>Забанил: ";
echo iconka($ban['id_who']);
echo " <a href='?user=$ban[id_who]'>".nc($ban['id_who'])."</a><br>Бан до: ".($ban['izg2']==0?"".vremja($ban['time2'])."".($ban['time']!=$ban['time2']?"<br>Бан снял: ".iconka($ban['id_who2'])." <a href='?user=$ban[id_who2]'>".nc($ban['id_who2'])."</a> (".vremja($ban['time']).")":null)."":"Навсегда".($ban['izg']!=$ban['izg2']?"<br>Изгнание снял: ".iconka($ban['id_who2'])." <a href='?user=$ban[id_who2]'>".nc($ban['id_who2'])."</a> (".vremja($ban['time']).")":null)."")."<br>".(($user['status']==4 || $user['status']==5) && $ban['izg']==1?"<img src='/images/block.png'> <a href='?user=$ban[id_user]&bans&unizg=$ban[id]'>Снять изгнание</a>":null)."".($user['status']>0 && $ban['time']>$time?"<img src='/images/ban.png'> <a href='?user=$ban[id_user]&bans&unban=$ban[id]'>Снять бан</a>":null)."</span></div>";
}
if ($k_page>1)
{
echo "<div class='list_item busis'>";
str("?user=$ban[id_user]&bans&",$k_page,$page); // Вывод страниц
echo "</div>";
}
if(($user['id']==1 || $user['status']>0) && $user['id']!=$ank['id'])echo "<div class='list_item busis'><img src='/images/ban.png'> <a href='?user=$ank[id]&ban'>Бан</a>";
if(($user['id']==1 || $user['status']==4 || $user['status']=5) && $user['id']!=$ank['id'])echo " | <img src='/images/block.png'> <a href='?user=$ank[id]&izg'>Блок</a>";
echo "</div>";
include_once 'foot.php';
?>