Файл: wap-ads.ru/admin/banlist.php
Строк: 108
<?
$title='Банлист';
include_once 'h.php';
$time=time();
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `ban`"),0);
if ($k_post==0)
{
echo "<div class='list_item busis'><span class='minor'>Пусто...</span></div>";
}
$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` ORDER BY `id` DESC LIMIT $start,$set[p_str]");
while($ban=mysql_fetch_assoc($xx)){
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` = '".intval($_GET['unban'])."'");
header("Location:?admin=banlist");
}
if(isset($_GET['unizg']) && ($user['status']==1 || $user['status']==3) && 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` = '".intval($_GET['unizg'])."'");
header("Location:?admin=banlist");
}
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:?admin=banlist");
}
echo "<div class='list_item busis'><span class='minor'>Бан №$ban[id]".($user['status']==3?"<span style='float:right;'><img src='/images/icons/delete.png'> <a href='?admin=banlist&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><img src='images/icons/arrow.png'> <a href='?user=$ban[id_user]&bans'>Список нарушений</a> ".(($user['status']==1 || $user['status']==3) && $ban['izg']==1?"<img src='/images/block.png'> <a href='?admin=banlist&unizg=$ban[id]'>Снять изгнание</a>":null)."".($user['status']>0 && $ban['time']>$time?"<img src='/images/icons/ban.png'> <a href='?admin=banlist&unban=$ban[id]'>Снять бан</a>":null)."</span></div>";
}
if ($k_page>1)str("?admin=banlist&",$k_page,$page); // Вывод страниц
include_once 'foot.php';
?>