File size: 2.1Kb
<?
include('../core/core.php');
include(BASEDIR.INC.'func.php');
include(BASEDIR.INC.'session.php');
include(BASEDIR.INC.'session_user.php');
include(BASEDIR.INC.'head.php');
show_title('Список забаненых');
if (is_admin(array(101, 102, 103))) {
$users = mysql_query('SELECT * FROM users WHERE login = "'.$_COOKIE['login'].'"');
$users = mysql_fetch_assoc($users);
$admin = $users['status'];
if($admin == 101 || $admin == 102){ echo'<div class="razdel">Админ-панель</div>'; }
if($admin == 103){ echo'<div class="razdel">Модер-панель</div>'; }
$act = '<img src="'.BASEDIR.''.IMG.'act.png">';
//--------------------//
define('TOPAGE',5);
$page=(int)$_GET['page'];
$q=mysql_result(mysql_query("SELECT COUNT(*) FROM `ban`"),0);
$total = intval(($q - 1) / TOPAGE) + 1;
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * TOPAGE -TOPAGE;
$g=mysql_query("SELECT * FROM `ban` ORDER BY `id` DESC LIMIT $start,".TOPAGE."");
while($u=mysql_fetch_array($g)){
if($u['ip'] == NULL){
echo'<div class="menu">';
echo '<strong>'.$u['login'].'</strong><br />';
$b = mysql_query('SELECT * FROM history_ban WHERE login = "'.$u['login'].'" ORDER BY `id` DESC LIMIT 1');
$b = mysql_fetch_assoc($b);
$time = $u['time'] - time();
if($time < 0){ $time = 0; } else { $time = $time; }
echo'До окончания бана осталось '.formattime($time).'<br />';
echo 'Причина: '.$b['pri'].'<hr>';
echo 'Забанил: '.$b['status'].'<br />';
echo '<a href="zaban.php?mode=edit&uz='.$u['login'].'">Редактировать</a></div>';
echo'</div>';} }
if ($page != $total) $nextpage = ' <a href="?page='. ($page + 1) .'">Далее</a>';
if($page - 1 > 0) $pageback = '<a href="?page='. ($page - 1) .'">Назад</a> ';
echo''.$pageback.' '.$nextpage.'';
//-----------------//
echo'<div class="menu"><a href="/">На главную</a></div>';
} else {header ('location: /index.php?mode=index'); }
include(BASEDIR.INC.'foot.php');
?>