function admin_warnings() { $q = new syslogs(); if (isset($_GET["delete"])) { $q->delete_warnings($_GET["delete"]); } $header_top = "\n\t<div style='text-align:right'>\n\t<input type='button' value='{delete_all_events}' OnClick=\"javascript:AdminDeleteAllSqlEvents();\">\n\t</div>\n\t<br>\n\t\n\t"; $tpl = new templates(); $r = $q->get_warnings(); $count = 0; $style = "style='border-bottom:1px dotted #CCCCCC'"; $html = "<input type='hidden' id='switch' value='{$_GET["main"]}'>"; while ($ligne = @mysql_fetch_array($r, MYSQL_ASSOC)) { $ligne["event_text"] = htmlentities($ligne["event_text"]); $ligne["event_text"] = str_replace('{', '<br><p class=caption>{', $ligne["event_text"]); $ligne["event_text"] = str_replace('}', '}</p>', $ligne["event_text"]); $div = "<table style='width:100%'>\n\t\t<tr><td colspan=2 align='right'>" . imgtootltip('ed_delete.gif', '{delete}', "DeleteWarning('{$ligne["zMD5"]}')") . "</td></tr>\n\t\t<tr>\n\t\t<td nowrap align='right'><strong>{service}:</strong></td>\n\t\t<td><strong>{$ligne["daemon"]}</td></strong>\n\t\t</tr>\n\t\t<tr><td colspan=2><hr></td></tr>\n\t\t<td nowrap align='right' valign='top'><strong>{notification}:</strong></td>\n\t\t<td style='font-size:11px;font-weight:bold;padding:3px;margin:3px;border:1px dotted #CCCCCC'>{$ligne["event_text"]}</td>\n\t\t</tr>\n\t\t</table>"; $html = $html . RoundedLightGrey($div) . "<br>"; } $tpl = new templates(); $html = $tpl->_ENGINE_parse_body("{$header_top}<center><div style='width:490px'>{$html}</div></center>") . "<br>"; echo $html; }
function syslogs() { if ($_GET["lines"] == null) { $_GET["lines"] = 50; } $users->syslogng_installed = false; $users = new usersMenus(); if (!$users->syslogng_installed) { if ($users->EnableMysqlFeatures == 0) { echo graph(); exit; } } $q = new syslogs(); $q->BuildNecessaryTables(); $q->q_daemons = $_GET["q_daemons"]; $q->limit_end = $_GET["q_lines"]; $q->q_search = $_GET["q_search"]; $daemon = Field_array_Hash($q->GetDaemons(), 'q_daemons', $_GET["q_daemons"], 'sysevents_query()'); $form = "<table style=\"width:100%\">\n\t<tr>\n\t<td align='right'><strong>Daemon:</strong></td>\n\t<td>{$daemon}</td>\n\t<td align='right'><strong>{search}:</strong></td>\n\t<td>" . Field_text('q_search', $_GET["q_search"], 'width:150px', null, 'sysevents_query()') . "</td>\t\n\t<td align='right'><strong>{lines_number}:</strong></td>\n\t<td>" . Field_text('q_lines', $_GET["q_lines"], 'width:40px', null, 'sysevents_query()') . "</td>\n\t<td>" . imgtootltip('icon_refresh-20.gif', '{refresh}', 'sysevents_query()') . "</td>\n\t\t\n\t</tr>\n\t</table>"; $form = "<br>" . RoundedLightGrey($form); $html = "\n\t<input type='hidden' id='switch' value='{$_GET["main"]}'>\n\t\n\t\n\t<table style=\"width:100%\">\n\t\n\t"; $tpl = new templates(); $r = $q->build_query(); $count = 0; $style = "style='border-bottom:1px dotted #CCCCCC'"; while ($ligne = @mysql_fetch_array($r, MYSQL_ASSOC)) { $ligne["msg"] = htmlentities($ligne["msg"]); $html = $html . "<tr " . CellRollOver_jaune() . ">\n\t\t<td width=1% valign='top' {$style}><img src='img/fw_bold.gif'></td>\n\t\t<td width=1% nowrap valign='top' {$style}>{$ligne["date"]}</td>\n\t\t<td {$style}>{$ligne["msg"]}</td>\n\t\t<td width=1% nowrap valign='top' {$style}>{$ligne["program"]}</td>\n\t\t</tr>"; $count = $count + 1; if ($count > 500) { $error = "\n\t\t\t<tr>\n\t\t\t\t<td width=1% valign='top' styme='border-bottom:1px dotted red'><img src='img/fw_bold.gif'></td>\n\t\t\t\t<td colspan=3 style='color:red;font-weight:bold;border-bottom:1px dotted red'>{too_many_lines_exceed}:500</td>\n\t\t\t</tr>"; $html = $tpl->_ENGINE_parse_body($error) . $html; break; } } $html = $html . "</table>"; $html = $tpl->_ENGINE_parse_body($form) . "<br>{$html}"; echo $html; }