- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
<?php
define('_IN_JOHNCMS', 1);
require_once ('../incfiles/core.php');
require_once ('../incfiles/ban.php');
require_once ('../incfiles/head.php');
//TODO: Написать Амнистию
////////////////////////////////////////////////////////////
// Список нарушителей //
////////////////////////////////////////////////////////////
echo '<div class="phdr">Список нарушителей</div>';
$sort = isset ($_GET['count']) ? 'bancount' : 'bantime';
$req = mysql_query("SELECT `user_id` FROM `cms_ban_users` GROUP BY `user_id`");
$total = mysql_num_rows($req);
$req = mysql_query("SELECT COUNT(`cms_ban_users`.`user_id`) AS `bancount`, MAX(`cms_ban_users`.`ban_time`) AS `bantime`, MAX(`cms_ban_users`.`ban_while`) AS banwhile, `users`.*
FROM `cms_ban_users` LEFT JOIN `users` ON `cms_ban_users`.`user_id` = `users`.`id`
GROUP BY `user_id`
ORDER BY `$sort` DESC
LIMIT $start, $kmess");
if (mysql_num_rows($req)) {
while ($res = mysql_fetch_array($req)) {
$ban_type = ($res['bantime'] - $res['banwhile'] > 60 * 20) ? 'r' : 'i';
echo '<div class="' . ($res['bantime'] > $realtime ? $ban_type : '') . 'menu">';
echo show_user($res, 0, 2, ' [' . $res['bancount'] . '] <a href="../str/users_ban.php?id='.$res['id'].'">>></a>');
echo '</div>';
}
}
else {
echo '<div class="menu"><p>Список пуст</p></div>';
}
echo '<div class="phdr">Всего: ' . $total . '</div>';
if ($total > $kmess) {
echo '<div class="pagenumb">' . pagenav('usr_ban.php?', $start, $total, $kmess) . '</div>';
}
require_once ("../incfiles/end.php");
?>