function ReverseClearArrays() { foreach ($_POST as $key => $value) { $_POST[$key] = ReverseEscapeString($value); } foreach ($_GET as $key => $value) { $_GET[$key] = ReverseEscapeString($value); } foreach ($_REQUEST as $key => $value) { $_REQUEST[$key] = ReverseEscapeString($value); } foreach ($_COOKIE as $key => $value) { $_COOKIE[$key] = ReverseEscapeString($value); } }
} print "Типы сообщений: <select name=\"levels[]\" size=\"6\" multiple style=\"margin-left: 10px; margin-right: 5px; vertical-align: top;\"\n onchange=\"document.LogsForm.submit();\">"; foreach ($allLevels as $lev) { $sel = in_array($lev, $levels) ? ' selected="selected"' : ''; print "<option value=\"{$lev}\"{$sel}>{$lev}</option>\n"; } print "</select>\n\n"; // фильтруем кол-во ошибок и печатаем селект $limit = mmb_validateInt($_REQUEST, 'num_rec', 100); print 'Количество: <select name="num_rec" style="margin-left: 10px; margin-right: 5px;" onchange="document.LogsForm.submit();">'; foreach (array(100, 500, 1000, 5000) as $lim) { $sel = $lim == $limit ? ' selected="selected"' : ''; print "<option value=\"{$lim}\"{$sel}>{$lim}</option>\n"; } print "</select>\n"; $searchVal = ReverseEscapeString(mmb_validate($_REQUEST, 'search', '')); print "<input type=\"text\" placeholder=\"Искать\" name=\"search\" onchange=\"document.LogsForm.submit()\" style=\"margin-left: 2em;\" value='" . CMmbUI::toHtml($searchVal) . "'/>"; print "</div>\n"; $cond = count($levels) == 0 ? 'true' : "logs_level in ('" . implode("', '", $levels) . "')"; if ($searchVal == '') { $searchCond = 'true'; } else { $search = array("%", "_", "[", "]"); $replace = array("\\%", "\\_", "\\[", "\\]"); $searchVal = str_replace($search, $replace, $searchVal); $searchCond = "logs_message like(" . CSql::quote("%{$searchVal}%") . ")"; } $sql = "select logs_id, logs_level, user_id, logs_operation, logs_message, logs_dt, logs_duration from Logs \n where {$cond} and {$searchCond} \n order by logs_id desc \n limit {$limit}"; $Result = MySqlQuery($sql); print "<table class='std'>\n"; print "<tr class='gray head'><th>#</th><th width='50'>id</th><th>Время</th><th>Уровень</th><th>Пользователь</th><th>Операция</th><th>Сообщение</th><th>Длительность</th></tr>\n";