View file ä󿪫¬/panel/site/banlist.php

File size: 1.98Kb
<?php

foreach (array('start', 'compress', 'sess', 'settings', 'db_connect', 'ipua', 'fnc', 'adm_check', 'user') as $inc) {
    require_once "../../sys/inc/{$inc}.php";
}

$set['title'] = lang('Список забаненных');
require_once H . 'sys/inc/thead.php';
aut();

$access = $pdo->query(("SELECT COUNT(*) FROM `promotion_access` WHERE `id_user` = '$user[id]'"),0)->fetchColumn();
if (access('adm_info') || $access){ 

#Навигация
echo "<div class='card-header'>";
echo "<a href='/' data-toggle='tooltip' data-placement='right' title='" . lang('На главную') . "'><i class='fa fa-home fa-lg'></i></a> <i class='fa fa-angle-right fa-fw'></i> ";
echo "<a href='/panel/'>" . lang('Админ кабинет') . "</a> <i class='fa fa-angle-right fa-fw'></i> ";
echo lang('Список забаненных');
echo "</div>";


$k_post = $pdo->query(("SELECT COUNT(*) FROM `ban` WHERE `time` > '$time'"), 0)->fetchColumn();
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
$q = $pdo->query("SELECT * FROM `ban` WHERE `time` > '$time' ORDER BY `id` DESC LIMIT $start, $set[p_str]");

if ($k_post == 0) {
    $doc->NoResult();
}
while ($ban = $q->fetch(PDO::FETCH_ASSOC)) {
    $ank = get_user($ban['id_user']);
    echo "<table class='list-group-item' style='margin-top: 2px;margin-bottom: 2px;'><tr><td class='icon14'>";
    avatar($ank['id'], '48', 'border-radius: 2px;');
    echo "</td><td class='null'>";
    echo "<font color='grey' style='float: right;'><small>" . date::time($ban['time']) . "</small></font>";

    user($ank['id']);
    echo "<br />";
    $user_ban = get_user($ban['id_ban']);

    echo toOutput($ban['prich']) . " ($user_ban[nick])<br />";
    echo "</td></tr></table>";
}

if ($k_page > 1) {
    echo "<div class='list-group-item'>";
    str("?", $k_page, $page);
    echo "</div>";
}

}else{
header('location: /index.php');
$_SESSION['err'] = 'Ошибка доступа';
}

require_once H . 'sys/inc/tfoot.php';