View file admin/ban.php

File size: 849B
<?php
include '../inc/db.php';
include '../inc/1.php';
if (($user['moder']==0) && ($user['admin']==0)){header("Location: /index.php");
exit;}
if (isset($_GET['del']))
{
mysql_query("DELETE FROM `ban` WHERE `id` = '".intval($_GET['del'])."'");
msg('Бан снят.');
}
echo "<div class='t2'>Бан-лист</div>";
$q=mysql_query("SELECT * FROM `ban` ORDER BY `id` DESC");
$b=1;
while ($f=mysql_fetch_assoc($q)){
$p=($b%2);
$ank=mysql_fetch_assoc(mysql_query("SELECT `id`, `name` FROM `user` WHERE `id` = '$f[user]'"));
echo "<div class='p$p'>".im($ank['id'])." <a href='/ank.php?id=$f[user]'>$ank[name]</a><br><b>Причина</b>: ".out($f['why'])."<br /><b>Конец</b>: ".vremja($f['time'])."<br /><a href='?del=$f[id]'>[<font color='red'>x</font>] Удалить</a></div>";
$b++;
}
include '../inc/foot.php';
?>