defined('AntiBK') or die("Доступ запрещен!"); $date = (isset($_POST['date']) && eregi("^[0-9]+\.[0-9]+", $_POST['date'])) ?utf8_substr(htmlspecialchars($_POST['date']), 0, 5) :date('m.y'); $split = split('\.', $date); $first_time = mktime(0, 0, 0, $split[0], 01, $split[1]); $second_time = mktime(0, 0, 0, $split[0], date("t", $first_time), $split[1]); $rows = $adb->select("SELECT `action`, `date`, `ip`, `city`, `comment` FROM `history_auth` WHERE `date` <= ?d and `date` >= ?d and `guid` = ?d ORDER BY `id`;", $second_time ,$first_time ,$guid); ?>
Отчет системы безопасности за$reports = ''; foreach ($rows as $auth) { list($action, $date_a, $ip, $city, $comment) = array_values($auth); $date_a = date('d.m.y H:i', $date_a); if (!$reports || (isset($e_city) && $e_city != $city)) $reports .= "".$char->city->getCity($city, 'name').""; switch ($action) { case 1: $reports .= "$date_a Входит \"$login\" $ip."; break; case 0: switch ($comment) { case 'wrong_password': $reports .= "$date_a Неверный пароль, $ip "; break; case 'blocked': $reports .= "$date_a Персонаж заблокирован, $ip "; break; } break; } $e_city = $city; } echo $reports; ?> |