本文整理汇总了PHP中html_header_sort函数的典型用法代码示例。如果您正苦于以下问题:PHP html_header_sort函数的具体用法?PHP html_header_sort怎么用?PHP html_header_sort使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了html_header_sort函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mactrack_view_ip_ranges
function mactrack_view_ip_ranges()
{
global $title, $config, $item_rows;
mactrack_view_ips_validate_request_vars();
if (get_request_var('rows') == -1) {
$row_limit = read_config_option('num_rows_table');
} elseif (get_request_var('rows') == -2) {
$row_limit = 999999;
} else {
$row_limit = get_request_var('rows');
}
$webroot = $config['url_path'] . 'plugins/mactrack/';
mactrack_tabs();
html_start_box($title, '100%', '', '3', 'center', '');
mactrack_ips_filter();
html_end_box();
$sql_where = '';
$ip_ranges = mactrack_view_get_ip_range_records($sql_where, $row_limit);
$total_rows = db_fetch_cell("SELECT\n\t\tCOUNT(mac_track_ip_ranges.ip_range)\n\t\tFROM mac_track_ip_ranges\n\t\tINNER JOIN mac_track_sites ON (mac_track_ip_ranges.site_id=mac_track_sites.site_id)\n\t\t{$sql_where}");
$nav = html_nav_bar('mactrack_view_ips.php', MAX_DISPLAY_PAGES, get_request_var('page'), $row_limit, $total_rows, 7, __('IP Address Ranges'));
print $nav;
html_start_box('', '100%', '', '3', 'center', '');
$display_text = array('nosort' => array(__('Actions'), ''), 'site_name' => array(__('Site Name'), 'ASC'), 'ip_range' => array(__('IP Range'), 'ASC'), 'ips_current' => array(__('Current IP Addresses'), 'DESC'), 'ips_current_date' => array(__('Current Date'), 'DESC'), 'ips_max' => array(__('Maximum IP Addresses'), 'DESC'), 'ips_max_date' => array(__('Maximum Date'), 'DESC'));
html_header_sort($display_text, get_request_var('sort_column'), get_request_var('sort_direction'));
if (sizeof($ip_ranges)) {
foreach ($ip_ranges as $ip_range) {
form_alternate_row();
?>
<td width=80>
<a href='<?php
print htmlspecialchars($webroot . 'mactrack_sites.php?action=edit&site_id=' . $ip_range['site_id']);
?>
' title='Edit Site'><img border='0' src='<?php
print $webroot;
?>
images/edit_object.png'></a>
<a href='<?php
print htmlspecialchars($webroot . 'mactrack_view_macs.php?report=macs&reset&ip_filter_type_id=3&ip_filter=' . $ip_range['ip_range'] . '&device_id=-1&scan_date=3&site_id=' . $ip_range['site_id']);
?>
' title='View MAC Addresses'><img border='0' src='<?php
print $webroot;
?>
images/view_macs.gif'></a>
<a href='<?php
print htmlspecialchars($webroot . 'mactrack_view_arp.php?report=arp&reset&ip_filter_type_id=3&ip_filter=' . $ip_range['ip_range'] . '.' . '&device_id=-1&scan_date=3&site_id=' . $ip_range['site_id']);
?>
' title='View IP Addresses'><img border='0' src='<?php
print $webroot;
?>
images/view_ipaddresses.gif'></a>
</td>
<td class='hyperLink'>
<?php
print $ip_range['site_name'];
?>
</td>
<td><?php
print $ip_range['ip_range'] . '.*';
?>
</td>
<td><?php
print number_format_i18n($ip_range['ips_current']);
?>
</td>
<td><?php
print $ip_range['ips_current_date'];
?>
</td>
<td><?php
print number_format_i18n($ip_range['ips_max']);
?>
</td>
<td><?php
print $ip_range['ips_max_date'];
?>
</td>
</tr>
<?php
}
} else {
print '<tr><td colspan="10"><em>' . __('No MacTrack Site IP Ranges Found') . '</em></td></tr>';
}
html_end_box(false);
if (sizeof($ip_ranges)) {
print $nav;
mactrack_display_stats();
}
}
示例2: mactrack_view_sites
function mactrack_view_sites()
{
global $title, $config, $item_rows;
mactrack_sites_request_validation();
if (get_request_var('rows') == -1) {
$row_limit = read_config_option('num_rows_table');
} elseif (get_request_var('rows') == -2) {
$row_limit = 999999;
} else {
$row_limit = get_request_var('rows');
}
$webroot = $config['url_path'] . '/plugins/mactrack/';
mactrack_tabs();
html_start_box($title, '100%', '', '3', 'center', '');
mactrack_site_filter('mactrack_view_sites.php');
html_end_box();
$sql_where = '';
$sites = mactrack_view_get_site_records($sql_where, $row_limit);
if (get_request_var('detail') == 'false') {
$total_rows = db_fetch_cell("SELECT\n\t\t\tCOUNT(mac_track_sites.site_id)\n\t\t\tFROM mac_track_sites\n\t\t\t{$sql_where}");
} else {
$total_rows = sizeof(db_fetch_assoc("SELECT\n\t\t\tmac_track_device_types.device_type_id, mac_track_sites.site_name\n\t\t\tFROM (mac_track_device_types\n\t\t\tRIGHT JOIN mac_track_devices ON (mac_track_device_types.device_type_id = mac_track_devices.device_type_id))\n\t\t\tRIGHT JOIN mac_track_sites ON (mac_track_devices.site_id = mac_track_sites.site_id)\n\t\t\t{$sql_where}\n\t\t\tGROUP BY mac_track_sites.site_name, mac_track_device_types.device_type_id"));
}
$nav = html_nav_bar('mactrack_view_sites.php', MAX_DISPLAY_PAGES, get_request_var('page'), $row_limit, $total_rows, 11, __('Sites'));
print $nav;
html_start_box('', '100%', '', '3', 'center', '');
if (get_request_var('detail') == 'false') {
$display_text = array('nosort' => array(__('Actions'), ''), 'site_name' => array(__('Site Name'), 'ASC'), 'total_devices' => array(__('Devices'), 'DESC'), 'total_ips' => array(__('Total IP\'s'), 'DESC'), 'total_user_ports' => array(__('User Ports'), 'DESC'), 'total_oper_ports' => array(__('User Ports Up'), 'DESC'), 'total_macs' => array(__('MACS Found'), 'DESC'), 'total_device_errors' => array(__('Device Errors'), 'DESC'));
html_header_sort($display_text, get_request_var('sort_column'), get_request_var('sort_direction'));
if (sizeof($sites) > 0) {
foreach ($sites as $site) {
form_alternate_row('row_' . $site['site_id'], true);
?>
<td width=140>
<?php
if (api_user_realm_auth('mactrack_sites.php')) {
echo "<a href='" . htmlspecialchars($webroot . 'mactrack_sites.php?action=edit&site_id=' . $site['site_id']) . "' title='" . __('Edit Site') . "'><img border='0' src='" . $webroot . "images/edit_object.png'></a>";
echo "<a href='#'><img id='r_" . $site['site_id'] . "' src='" . $webroot . "images/rescan_site.gif' alt='' onClick='site_scan(" . $site['site_id'] . ")' title='" . __('Rescan Site') . "' border='0'></a>";
}
?>
<a href='<?php
print htmlspecialchars($webroot . 'mactrack_view_devices.php?report=devices&reset&site_id=' . $site['site_id']);
?>
' title='<?php
print __('View Devices');
?>
'><img border='0' src='<?php
print $webroot;
?>
images/view_devices.gif'></a>
<a href='<?php
print htmlspecialchars($webroot . 'mactrack_view_ips.php?report=ips&reset&site_id=' . $site['site_id']);
?>
' title='<?php
print __('View IP Ranges');
?>
'><img border='0' src='<?php
print $webroot;
?>
images/view_networks.gif'></a>
<a href='<?php
print htmlspecialchars($webroot . 'plugins/mactrack/mactrack_view_arp.php?report=arp&reset&site_id=' . $site['site_id']);
?>
' title='<?php
print __('View IP Addresses');
?>
'><img border='0' src='<?php
print $webroot;
?>
images/view_ipaddresses.gif'></a>
<a href='<?php
print htmlspecialchars($webroot . 'plugins/mactrack/mactrack_view_macs.php?report=macs&reset&device_id=-1&scan_date=3&site_id=' . $site['site_id']);
?>
' title='<?php
print __('View MAC Addresses');
?>
'><img border='0' src='<?php
print $webroot;
?>
images/view_macs.gif'></a>
<a href='<?php
print htmlspecialchars($webroot . 'mactrack_view_interfaces.php?report=interfaces&reset&site=' . $site['site_id']);
?>
' title='<?php
print __('View Interfaces');
?>
'><img border='0' src='<?php
print $webroot;
?>
images/view_interfaces.gif'></a>
</td>
<td class='hyperLink'>
<?php
print filter_value($site['site_name'], get_request_var('filter'));
?>
</td>
<td><?php
print number_format_i18n($site['total_devices']);
?>
</td>
//.........这里部分代码省略.........
示例3: utilities_view_poller_cache
//.........这里部分代码省略.........
}
?>
>Script Server</option>
</select>
</td>
<td nowrap style='white-space: nowrap;' width="50">
Search:
</td>
<td width="1">
<input type="text" name="filter" size="40" value="<?php
print htmlspecialchars(get_request_var_request("filter"));
?>
">
</td>
<td nowrap style='white-space: nowrap;'>
<input type="submit" name="go" value="Go" title="Set/Refresh Filters">
<input type="submit" name="clear_x" value="Clear" title="Clear Filters">
</td>
</tr>
</table>
<input type='hidden' name='page' value='1'>
<input type='hidden' name='action' value='view_poller_cache'>
</form>
</td>
</tr>
<?php
html_end_box();
/* form the 'where' clause for our main sql query */
$sql_where = "WHERE poller_item.local_data_id=data_template_data.local_data_id";
if (get_request_var_request("poller_action") != "-1") {
$sql_where .= " AND poller_item.action='" . get_request_var_request("poller_action") . "'";
}
if (get_request_var_request("host_id") == "-1") {
/* Show all items */
} elseif (get_request_var_request("host_id") == "0") {
$sql_where .= " AND poller_item.host_id=0";
} elseif (!empty($_REQUEST["host_id"])) {
$sql_where .= " AND poller_item.host_id=" . get_request_var_request("host_id");
}
if (strlen(get_request_var_request("filter"))) {
$sql_where .= " AND (data_template_data.name_cache LIKE '%%" . get_request_var_request("filter") . "%%'\n\t\t\tOR host.description LIKE '%%" . get_request_var_request("filter") . "%%'\n\t\t\tOR poller_item.arg1 LIKE '%%" . get_request_var_request("filter") . "%%'\n\t\t\tOR poller_item.hostname LIKE '%%" . get_request_var_request("filter") . "%%'\n\t\t\tOR poller_item.rrd_path LIKE '%%" . get_request_var_request("filter") . "%%')";
}
html_start_box("", "100%", "", "3", "center", "");
$total_rows = db_fetch_cell("SELECT\n\t\tCOUNT(*)\n\t\tFROM data_template_data\n\t\tRIGHT JOIN (poller_item\n\t\tLEFT JOIN host\n\t\tON poller_item.host_id=host.id)\n\t\tON data_template_data.local_data_id=poller_item.local_data_id\n\t\t{$sql_where}");
$poller_sql = "SELECT\n\t\tpoller_item.*,\n\t\tdata_template_data.name_cache,\n\t\thost.description\n\t\tFROM data_template_data\n\t\tRIGHT JOIN (poller_item\n\t\tLEFT JOIN host\n\t\tON poller_item.host_id=host.id)\n\t\tON data_template_data.local_data_id=poller_item.local_data_id\n\t\t{$sql_where}\n\t\tORDER BY " . get_request_var_request("sort_column") . " " . get_request_var_request("sort_direction") . ", action ASC\n\t\tLIMIT " . read_config_option("num_rows_data_source") * (get_request_var_request("page") - 1) . "," . read_config_option("num_rows_data_source");
$poller_cache = db_fetch_assoc($poller_sql);
$nav = html_nav_bar("utilities.php?action=view_poller_cache&host_id=" . get_request_var_request("host_id") . "&poller_action=" . get_request_var_request("poller_action"), MAX_DISPLAY_PAGES, get_request_var_request("page"), read_config_option("num_rows_data_source"), $total_rows, 3);
print $nav;
$display_text = array("data_template_data.name_cache" => array("Data Source Name", "ASC"), "nosort" => array("Details", "ASC"));
html_header_sort($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction"));
$i = 0;
if (sizeof($poller_cache) > 0) {
foreach ($poller_cache as $item) {
form_alternate_row();
?>
<td width="375">
<a class="linkEditMain" href="<?php
print htmlspecialchars("data_sources.php?action=ds_edit&id=" . $item["local_data_id"]);
?>
"><?php
print strlen(get_request_var_request("filter")) ? preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["name_cache"]) : $item["name_cache"];
?>
</a>
</td>
<td>
<?php
if ($item["action"] == 0) {
if ($item["snmp_version"] != 3) {
$details = "SNMP Version: " . $item["snmp_version"] . ", " . "Community: " . $item["snmp_community"] . ", " . "OID: " . (strlen(get_request_var_request("filter")) ? preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["arg1"]) : $item["arg1"]);
} else {
$details = "SNMP Version: " . $item["snmp_version"] . ", " . "User: " . $item["snmp_username"] . ", OID: " . $item["arg1"];
}
} elseif ($item["action"] == 1) {
$details = "Script: " . (strlen(get_request_var_request("filter")) ? preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["arg1"]) : $item["arg1"]);
} else {
$details = "Script Server: " . (strlen(get_request_var_request("filter")) ? preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["arg1"]) : $item["arg1"]);
}
print $details;
?>
</td>
</tr>
<?php
form_alternate_row();
?>
<td>
</td>
<td>
RRD: <?php
print $item["rrd_path"];
?>
</td>
</tr>
<?php
$i++;
}
}
print $nav;
html_end_box();
}
示例4: mactrack_view_sites
//.........这里部分代码省略.........
</table>
</td>
</tr>\n";
}else{
$nav = "<tr bgcolor='#" . $colors["header"] . "' class='noprint'>
<td colspan='22'>
<table width='100%' cellspacing='0' cellpadding='0' border='0'>
<tr>
<td align='center' class='textHeaderDark'>
No Rows Found
</td>\n
</tr>
</table>
</td>
</tr>\n";
}
}else{
$nav = html_create_nav($_REQUEST["page"], MAX_DISPLAY_PAGES, $row_limit, $total_rows, 11, "mactrack_view_sites.php");
}
print $nav;
if ($_REQUEST["detail"] == "false") {
$display_text = array(
"nosort" => array("Actions", ""),
"site_name" => array("Site Name", "ASC"),
"total_devices" => array("Devices", "DESC"),
"total_ips" => array("Total IP's", "DESC"),
"total_user_ports" => array("User Ports", "DESC"),
"total_oper_ports" => array("User Ports Up", "DESC"),
"total_macs" => array("MACS Found", "DESC"),
"total_device_errors" => array("Device Errors", "DESC"));
html_header_sort($display_text, $_REQUEST["sort_column"], $_REQUEST["sort_direction"]);
$i = 0;
if (sizeof($sites) > 0) {
foreach ($sites as $site) {
form_alternate_row_color($colors["alternate"],$colors["light"],$i,'row_' . $site["site_id"]); $i++;
?>
<td width=140>
<?php
if (mactrack_authorized(2121)) {
echo "<a href='" . $webroot . "plugins/mactrack/mactrack_sites.php?action=edit&site_id=" . $site['site_id'] . "' title='Edit Site'><img border='0' src='" . $webroot . "plugins/mactrack/images/edit_object.png'></a>";
echo "<a href='#'><img id='r_" . $site["site_id"] . "' src='" . $config['url_path'] . "plugins/mactrack/images/rescan_site.gif' alt='' onMouseOver='style.cursor=\"pointer\"' onClick='site_scan(" . $site["site_id"] . ")' title='Rescan Site' border='0'></a>";
}
?>
<a href='<?php print $webroot . "plugins/mactrack/mactrack_view_devices.php?report=devices&reset&site_id=" . $site['site_id'];?>' title='View Devices'><img border='0' src='<?php print $webroot;?>plugins/mactrack/images/view_devices.gif'></a>
<a href='<?php print $webroot . "plugins/mactrack/mactrack_view_ips.php?report=ips&reset&site_id=" . $site['site_id'];?>' title='View IP Ranges'><img border='0' src='<?php print $webroot;?>plugins/mactrack/images/view_networks.gif'></a>
<a href='<?php print $webroot . "plugins/mactrack/mactrack_view_arp.php?report=arp&reset&site_id=" . $site['site_id'];?>' title='View IP Addresses'><img border='0' src='<?php print $webroot;?>plugins/mactrack/images/view_ipaddresses.gif'></a>
<a href='<?php print $webroot . "plugins/mactrack/mactrack_view_macs.php?report=macs&reset&device_id=-1&scan_date=3&site_id=" . $site['site_id'];?>' title='View MAC Addresses'><img border='0' src='<?php print $webroot;?>plugins/mactrack/images/view_macs.gif'></a>
<a href='<?php print $webroot . "plugins/mactrack/mactrack_view_interfaces.php?report=interfaces&reset&site=" . $site['site_id'];?>' title='View Interfaces'><img border='0' src='<?php print $webroot;?>plugins/mactrack/images/view_interfaces.gif'></a>
</td>
<td width=200>
<?php print "<strong>" . (strlen($_REQUEST["filter"]) ? preg_replace("/(" . preg_quote($_REQUEST["filter"]) . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $site["site_name"]) : $site["site_name"]) . "</strong>";?>
</td>
<td><?php print number_format($site["total_devices"]);?></td>
<td><?php print number_format($site["total_ips"]);?></td>
<td><?php print number_format($site["total_user_ports"]);?></td>
<td><?php print number_format($site["total_oper_ports"]);?></td>
<td><?php print number_format($site["total_macs"]);?></td>
<td><?php print ($site["total_device_errors"]);?></td>
</tr>
<?php
}
}else{
示例5: syslog_messages
/** function syslog_messages()
* This is the main page display function in Syslog. Displays all the
* syslog messages that are relevant to Syslog.
*/
function syslog_messages($tab = "syslog")
{
global $colors, $sql_where, $hostfilter, $severities;
global $config, $syslog_incoming_config, $reset_multi, $syslog_levels;
include "./include/global_arrays.php";
/* force the initial timespan to be 30 minutes for performance reasons */
if (!isset($_SESSION["sess_syslog_init"])) {
$_SESSION["sess_current_timespan"] = 1;
$_SESSION["sess_syslog_init"] = 1;
}
if (file_exists("./lib/timespan_settings.php")) {
include "./lib/timespan_settings.php";
} else {
include "./include/html/inc_timespan_settings.php";
}
include dirname(__FILE__) . "/config.php";
/* create the custom css and javascript for the page */
generate_syslog_cssjs();
$url_curr_page = get_browser_query_string();
$sql_where = "";
if ($_REQUEST["rows"] == -1) {
$row_limit = read_config_option("num_rows_syslog");
} elseif ($_REQUEST["rows"] == -2) {
$row_limit = 999999;
} else {
$row_limit = $_REQUEST["rows"];
}
$syslog_messages = get_syslog_messages($sql_where, $row_limit, $tab);
$total_rows = syslog_filter($sql_where, $tab);
/* generate page list */
$url_page_select = get_page_list($_REQUEST["page"], MAX_DISPLAY_PAGES, $row_limit, $total_rows, "syslog.php?tab={$tab}");
if ($total_rows > 0) {
$nav = "<tr bgcolor='#" . $colors["header"] . "'>\n\t\t\t\t\t<td colspan='13'>\n\t\t\t\t\t\t<table width='100%' cellspacing='0' cellpadding='0' border='0'>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align='left' class='textHeaderDark'>\n\t\t\t\t\t\t\t\t\t<strong><< ";
if ($_REQUEST["page"] > 1) {
$nav .= "<a class='linkOverDark' href='syslog.php?tab={$tab}&page=" . ($_REQUEST["page"] - 1) . "'>";
}
$nav .= "Previous";
if ($_REQUEST["page"] > 1) {
$nav .= "</a>";
}
$nav .= "</strong>\n\t\t\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t\t\t<td align='center' class='textHeaderDark'>\n\t\t\t\t\t\t\t\t\tShowing Rows " . ($total_rows == 0 ? "None" : $row_limit * ($_REQUEST["page"] - 1) + 1 . " to " . ($total_rows < $row_limit || $total_rows < $row_limit * $_REQUEST["page"] ? $total_rows : $row_limit * $_REQUEST["page"]) . " of {$total_rows} [{$url_page_select}]") . "\n\t\t\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t\t\t<td align='right' class='textHeaderDark'>\n\t\t\t\t\t\t\t\t\t<strong>";
if ($_REQUEST["page"] * $row_limit < $total_rows) {
$nav .= "<a class='linkOverDark' href='syslog.php?tab={$tab}&page=" . ($_REQUEST["page"] + 1) . "'>";
}
$nav .= "Next";
if ($_REQUEST["page"] * $row_limit < $total_rows) {
$nav .= "</a>";
}
$nav .= " >></strong>\n\t\t\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n";
} else {
$nav = "<tr bgcolor='#" . $colors["header"] . "' class='noprint'>\n\t\t\t\t\t<td colspan='22'>\n\t\t\t\t\t\t<table width='100%' cellspacing='0' cellpadding='0' border='0'>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align='center' class='textHeaderDark'>\n\t\t\t\t\t\t\t\t\tNo Rows Found\n\t\t\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n";
}
print $nav;
if ($tab == "syslog") {
if (api_plugin_user_realm_auth('syslog_alerts.php')) {
$display_text = array("nosortt" => array("Actions", "ASC"), "host_id" => array("Host", "ASC"), "logtime" => array("Date", "ASC"), "message" => array("Message", "ASC"), "facility_id" => array("Facility", "ASC"), "priority_id" => array("Priority", "ASC"));
} else {
$display_text = array("host_id" => array("Host", "ASC"), "logtime" => array("Date", "ASC"), "message" => array("Message", "ASC"), "facility_id" => array("Facility", "ASC"), "priority_id" => array("Priority", "ASC"));
}
html_header_sort($display_text, $_REQUEST["sort_column"], $_REQUEST["sort_direction"]);
$hosts = array_rekey(syslog_db_fetch_assoc("SELECT host_id, host FROM `" . $syslogdb_default . "`.`syslog_hosts`"), "host_id", "host");
$facilities = array_rekey(syslog_db_fetch_assoc("SELECT facility_id, facility FROM `" . $syslogdb_default . "`.`syslog_facilities`"), "facility_id", "facility");
$priorities = array_rekey(syslog_db_fetch_assoc("SELECT priority_id, priority FROM `" . $syslogdb_default . "`.`syslog_priorities`"), "priority_id", "priority");
$i = 0;
if (sizeof($syslog_messages) > 0) {
foreach ($syslog_messages as $syslog_message) {
$title = "'" . str_replace("\"", "", str_replace("'", "", $syslog_message["message"])) . "'";
$tip_options = "CLICKCLOSE, 'true', WIDTH, '40', DELAY, '500', FOLLOWMOUSE, 'true', FADEIN, 450, FADEOUT, 450, BGCOLOR, '#F9FDAF', STICKY, 'true', SHADOWCOLOR, '#797C6E', TITLE, 'Message'";
syslog_row_color($colors["alternate"], $colors["light"], $i, $priorities[$syslog_message["priority_id"]], $title);
$i++;
if (api_plugin_user_realm_auth('syslog_alerts.php')) {
print "<td style='whitspace-nowrap;width:1%;'>";
if ($syslog_message['mtype'] == 'main') {
print "<a href='syslog_alerts.php?id=" . $syslog_message[$syslog_incoming_config["id"]] . "&date=" . $syslog_message["logtime"] . "&action=newedit&type=0'><img src='images/green.gif' align='absmiddle' border=0></a>\n\t\t\t\t\t\t<a href='syslog_removal.php?id=" . $syslog_message[$syslog_incoming_config["id"]] . "&date=" . $syslog_message["logtime"] . "&action=newedit&type=new&type=0'><img src='images/red.gif' align='absmiddle' border=0></a>\n";
}
print "</td>\n";
}
print "<td>" . $hosts[$syslog_message["host_id"]] . "</td>\n";
print "<td>" . $syslog_message["logtime"] . "</td>\n";
print "<td>" . (strlen($_REQUEST["filter"]) ? eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", title_trim($syslog_message[$syslog_incoming_config["textField"]], get_request_var_request("trimval"))) : title_trim($syslog_message[$syslog_incoming_config["textField"]], get_request_var_request("trimval"))) . "</td>\n";
print "<td>" . ucfirst($facilities[$syslog_message["facility_id"]]) . "</td>\n";
print "<td>" . ucfirst($priorities[$syslog_message["priority_id"]]) . "</td>\n";
}
} else {
print "<tr><td><em>No Messages</em></td></tr>";
}
print $nav;
html_end_box(false);
syslog_syslog_legend();
} else {
$display_text = array("name" => array("Alert Name", "ASC"), "severity" => array("Severity", "ASC"), "count" => array("Count", "ASC"), "logtime" => array("Date", "ASC"), "logmsg" => array("Message", "ASC"), "slhost" => array("Host", "ASC"), "facility" => array("Facility", "ASC"), "priority" => array("Priority", "ASC"));
html_header_sort($display_text, $_REQUEST["sort_column"], $_REQUEST["sort_direction"]);
$i = 0;
if (sizeof($syslog_messages) > 0) {
foreach ($syslog_messages as $log) {
$title = "'" . str_replace("\"", "", str_replace("'", "", $log["logmsg"])) . "'";
//.........这里部分代码省略.........
示例6: rra
function rra()
{
/* clean up sort_column */
if (isset($_REQUEST["sort_column"])) {
$_REQUEST["sort_column"] = sanitize_search_string(get_request_var("sort_column"));
}
/* clean up search string */
if (isset($_REQUEST["sort_direction"])) {
$_REQUEST["sort_direction"] = sanitize_search_string(get_request_var("sort_direction"));
}
/* remember these search fields in session vars so we don't have to keep passing them around */
load_current_session_value("sort_column", "sess_rra_sort_column", "timespan");
load_current_session_value("sort_direction", "sess_rra_sort_direction", "ASC");
html_start_box("<strong>Round Robin Archives</strong>", "100%", "", "3", "center", "rra.php?action=edit");
$display_text = array("name" => array("Name", "ASC"), "steps" => array("Steps", "ASC"), "rows" => array("Rows", "ASC"), "timespan" => array("Timespan", "ASC"));
html_header_sort($display_text, $_REQUEST["sort_column"], $_REQUEST["sort_direction"], 4);
$rras = db_fetch_assoc("SELECT\n\t\tid,\n\t\tname,\n\t\trows,\n\t\tsteps,\n\t\ttimespan\n\t\tFROM rra\n\t\tORDER BY " . $_REQUEST['sort_column'] . " " . $_REQUEST['sort_direction']);
$i = 0;
if (sizeof($rras) > 0) {
foreach ($rras as $rra) {
form_alternate_row('', true);
?>
<td>
<a class="linkEditMain" href="<?php
print htmlspecialchars("rra.php?action=edit&id=" . $rra["id"]);
?>
"><?php
print htmlspecialchars($rra["name"]);
?>
</a>
</td>
<td>
<?php
print $rra["steps"];
?>
</td>
<td>
<?php
print $rra["rows"];
?>
</td>
<td>
<?php
print $rra["timespan"];
?>
</td>
<td align="right">
<a href="<?php
print htmlspecialchars("rra.php?action=remove&id=" . $rra["id"]);
?>
"><img src="images/delete_icon.gif" style="height:10px;width:10px;" border="0" alt="Delete"></a>
</td>
</tr>
<?php
}
}
html_end_box();
}
示例7: update_show_current
//.........这里部分代码省略.........
<?php
if (sizeof($item_rows) > 0) {
foreach ($item_rows as $key => $value) {
print "<option value='" . $key . "'";
if (get_request_var_request("rows") == $key) {
print " selected";
}
print ">" . htmlspecialchars($value) . "</option>\n";
}
}
?>
</select>
</td>
<td nowrap style='white-space: nowrap;'>
<input type="submit" value="Go" title="Set/Refresh Filters">
</td>
<td nowrap style='white-space: nowrap;'>
<input type="submit" name="clear_x" value="Clear" title="Clear Filters">
</td>
</tr>
</table>
<input type='hidden' name='page' value='1'>
</form>
</td>
</tr>
<?php
html_end_box();
/* print checkbox form for validation */
print "<form name='chk' method='post' action='plugins.php'>\n";
html_start_box("", "100%", "", "3", "center", "");
/* form the 'where' clause for our main sql query */
$sql_where = "WHERE ({$table}.name LIKE '%%" . get_request_var_request("filter") . "%%')";
if (get_request_var_request("sort_column") == "version") {
$sortc = "version+0";
} else {
$sortc = get_request_var_request("sort_column");
}
if (get_request_var_request("sort_column") == "id") {
$sortd = "ASC";
} else {
$sortd = get_request_var_request("sort_direction");
}
if ($_REQUEST['rows'] == '-1') {
$rows = read_config_option('num_rows_device');
} else {
$rows = get_request_var_request('rows');
}
$total_rows = db_fetch_cell("SELECT\n\t\tcount(*)\n\t\tFROM {$table}\n\t\t{$sql_where}");
$plugins = db_fetch_assoc("SELECT *\n\t\tFROM {$table}\n\t\t{$sql_where}\n\t\tORDER BY " . $sortc . " " . $sortd . "\n\t\tLIMIT " . $rows * (get_request_var_request("page") - 1) . "," . $rows);
db_execute("DROP TABLE {$table}");
$nav = html_nav_bar("plugins.php?filter=" . get_request_var_request("filter"), MAX_DISPLAY_PAGES, get_request_var_request("page"), $rows, $total_rows, 8);
print $nav;
$display_text = array("nosort" => array("Actions", ""), "directory" => array("Name", "ASC"), "version" => array("Version", "ASC"), "id" => array("Load Order", "ASC"), "name" => array("Description", "ASC"), "nosort1" => array("Type", "ASC"), "status" => array("Status", "ASC"), "author" => array("Author", "ASC"));
html_header_sort($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction"), 1);
$i = 0;
if (sizeof($plugins)) {
if (get_request_var_request("sort_column") == "id") {
$inst_system_plugins = get_system_plugins($plugins);
if (sizeof($inst_system_plugins)) {
foreach ($inst_system_plugins as $plugin) {
form_alternate_row('', true);
print format_plugin_row($plugin, false, false, true);
}
}
}
$j = 0;
foreach ($plugins as $plugin) {
if (isset($plugins[$j + 1]) && $plugins[$j + 1]['status'] < 0 || !isset($plugins[$j + 1])) {
$last_plugin = true;
} else {
$last_plugin = false;
}
if ($plugin['status'] <= 0 || is_system_plugin($plugin) || get_request_var_request('sort_column') != 'id') {
$load_ordering = false;
} else {
$load_ordering = true;
}
if (get_request_var_request("sort_column") == "id") {
if (!is_system_plugin($plugin)) {
form_alternate_row('', true);
print format_plugin_row($plugin, $last_plugin, $load_ordering, false);
$i++;
}
} else {
form_alternate_row('', true);
print format_plugin_row($plugin, $last_plugin, $load_ordering, is_system_plugin($plugin));
$i++;
}
$j++;
}
print $nav;
} else {
print "<tr><td><em>No Plugins Found</em></td></tr>";
}
html_end_box(false);
html_start_box("", "100%", "", "3", "center", "");
echo "<tr><td colspan=10><strong>NOTE:</strong> Please sort by 'Load Order' to change plugin load ordering.<br><strong>NOTE:</strong> SYSTEM plugins can not be ordered.</td></tr>";
html_end_box();
print "</form>\n";
}
示例8: mactrack_vmacs
function mactrack_vmacs()
{
global $site_actions, $config, $item_rows;
mactrack_vmacs_validate_request_vars();
if (get_request_var('rows') == -1) {
$row_limit = read_config_option('num_rows_table');
} elseif (get_request_var('rows') == -2) {
$row_limit = 999999;
} else {
$row_limit = get_request_var('rows');
}
html_start_box(__('MacTrack Vendor Mac Filter'), '100%', '', '3', 'center', '');
mactrack_vmac_filter();
html_end_box();
$sql_where = '';
$vmacs = mactrack_vmacs_get_vmac_records($sql_where, $row_limit);
$total_rows = db_fetch_cell("SELECT\n\t\tCOUNT(*)\n\t\tFROM mac_track_oui_database\n\t\t{$sql_where}");
$nav = html_nav_bar('mactrack_vendormacs.php', MAX_DISPLAY_PAGES, get_request_var('page'), $row_limit, $total_rows, 9, __('Vendor Macs'));
print $nav;
html_start_box('', '100%', '', '3', 'center', '');
$display_text = array('vendor_mac' => array(__('Vendor MAC'), 'ASC'), 'vendor_name' => array(__('Corporation'), 'ASC'), 'vendor_address' => array(__('Address'), 'ASC'));
html_header_sort($display_text, get_request_var('sort_column'), get_request_var('sort_direction'));
if (sizeof($vmacs)) {
foreach ($vmacs as $vmac) {
form_alternate_row();
?>
<td class='linkEditMain'><?php
print $vmac['vendor_mac'];
?>
</td>
<td><?php
print get_request_var('filter') != '' ? preg_replace('/(' . preg_quote(get_request_var('filter')) . ')/i', "<span class='filteredValue'>\\1</span>", $vmac['vendor_name']) : $vmac['vendor_name'];
?>
</td>
<td><?php
print get_request_var('filter') != '' ? preg_replace('/(' . preg_quote(get_request_var('filter')) . ')/i', "<span class='filteredValue'>\\1</span>", $vmac['vendor_address']) : $vmac['vendor_address'];
?>
</td>
</tr>
<?php
}
} else {
print '<tr><td><em>' . __('No MacTrack Vendor MACS') . '</em></td></tr>';
}
html_end_box(false);
if (sizeof($vmacs)) {
print $nav;
}
}
示例9: hmib_summary
//.........这里部分代码省略.........
if (!isset($_SESSION['sess_hmib_host_top'])) {
$limit = 'LIMIT ' . read_config_option('hmib_top_types');
} elseif ($_SESSION['sess_hmib_host_top'] == '-1') {
$limit = '';
} else {
$limit = 'LIMIT ' . $_SESSION['sess_hmib_host_top'];
}
$sql = 'SELECT
hrst.id AS id,
hrst.name AS name,
hrst.version AS version,
hrs.host_type AS host_type,
SUM(CASE WHEN host_status=3 THEN 1 ELSE 0 END) AS upHosts,
SUM(CASE WHEN host_status=2 THEN 1 ELSE 0 END) AS recHosts,
SUM(CASE WHEN host_status=1 THEN 1 ELSE 0 END) AS downHosts,
SUM(CASE WHEN host_status=0 THEN 1 ELSE 0 END) AS disabledHosts,
SUM(users) AS users,
SUM(numCpus) AS cpus,
AVG(memUsed) AS avgMem,
MAX(memUsed) AS maxMem,
AVG(swapUsed) AS avgSwap,
MAX(swapUsed) AS maxSwap,
AVG(cpuPercent) AS avgCpuPercent,
MAX(cpuPercent) AS maxCpuPercent,
AVG(processes) AS avgProcesses,
MAX(processes) AS maxProcesses
FROM plugin_hmib_hrSystem AS hrs
LEFT JOIN plugin_hmib_hrSystemTypes AS hrst
ON hrs.host_type=hrst.id
GROUP BY name, version
ORDER BY ' . $_SESSION['sess_hmib_host_sort_column'] . ' ' . $_SESSION['sess_hmib_host_sort_direction'] . ' ' . $limit;
$rows = db_fetch_assoc($sql);
$display_text = array('nosort' => array('display' => __('Actions'), 'sort' => 'ASC', 'align' => 'left'), 'name' => array('display' => __('Type'), 'sort' => 'ASC', 'align' => 'left'), '(version/1)' => array('display' => __('Version'), 'sort' => 'ASC', 'align' => 'right'), 'upHosts' => array('display' => __('Up'), 'sort' => 'DESC', 'align' => 'right'), 'recHosts' => array('display' => __('Recovering'), 'sort' => 'DESC', 'align' => 'right'), 'downHosts' => array('display' => __('Down'), 'sort' => 'DESC', 'align' => 'right'), 'disabledHosts' => array('display' => __('Disabled'), 'sort' => 'DESC', 'align' => 'right'), 'users' => array('display' => __('Logins'), 'sort' => 'DESC', 'align' => 'right'), 'cpus' => array('display' => __('CPUS'), 'sort' => 'DESC', 'align' => 'right'), 'avgCpuPercent' => array('display' => __('Avg CPU'), 'sort' => 'DESC', 'align' => 'right'), 'maxCpuPercent' => array('display' => __('Max CPU'), 'sort' => 'DESC', 'align' => 'right'), 'avgMem' => array('display' => __('Avg Mem'), 'sort' => 'DESC', 'align' => 'right'), 'maxMem' => array('display' => __('Max Mem'), 'sort' => 'DESC', 'align' => 'right'), 'avgSwap' => array('display' => __('Avg Swap'), 'sort' => 'DESC', 'align' => 'right'), 'maxSwap' => array('display' => __('Max Swap'), 'sort' => 'DESC', 'align' => 'right'), 'avgProcesses' => array('display' => __('Avg Proc'), 'sort' => 'DESC', 'align' => 'right'), 'maxProcesses' => array('display' => __('Max Proc'), 'sort' => 'DESC', 'align' => 'right'));
html_header_sort($display_text, $_SESSION['sess_hmib_host_sort_column'], $_SESSION['sess_hmib_host_sort_direction'], false, 'hmib.php?action=summary&area=hosts');
if (sizeof($rows)) {
foreach ($rows as $row) {
if (!$templates_missing) {
$host_id = db_fetch_cell("SELECT id FROM host WHERE host_template_id={$htsd}");
$graph_url = hmib_get_graph_url($htdq, 0, $host_id, $row['id']);
$graph_ncpu = hmib_get_graph_url($hcpudq, $row['id'], 0, '', $row['cpus'], false);
$graph_acpu = hmib_get_graph_url($hcpudq, $row['id'], 0, '', round($row['avgCpuPercent'], 2), false);
$graph_mcpu = hmib_get_graph_url($hcpudq, $row['id'], 0, '', round($row['maxCpuPercent'], 2), false);
$graph_users = hmib_get_graph_template_url($hugt, $row['id'], 0, $row['users'], false);
$graph_aproc = hmib_get_graph_template_url($hpgt, $row['id'], 0, number_format_i18n($row['avgProcesses'], 0), false);
$graph_mproc = hmib_get_graph_template_url($hpgt, $row['id'], 0, number_format_i18n($row['maxProcesses'], 0), false);
} else {
$graph_url = '';
$graph_ncpu = '';
$graph_acpu = '';
$graph_mcpu = '';
$graph_users = '';
$graph_aproc = '';
$graph_mproc = '';
}
form_alternate_row();
echo "<td style='white-space:nowrap;' width='120'>";
echo "<a style='padding:1px;' href='" . htmlspecialchars("{$url}?reset=1&action=devices&type=" . $row['id']) . "'><img src='{$host}' title='" . __('View Devices') . "' align='absmiddle' alt=''></a>";
echo "<a style='padding:1px;' href='" . htmlspecialchars("{$url}?reset=1&action=storage&ostype=" . $row['id']) . "'><img src='{$storage}' title='" . __('View Storage') . "' align='absmiddle' alt=''></a>";
echo "<a style='padding:1px;' href='" . htmlspecialchars("{$url}?reset=1&action=hardware&ostype=" . $row['id']) . "'><img src='{$hardw}' title='" . __('View Hardware') . "' align='absmiddle' alt=''></a>";
echo "<a style='padding:1px;' href='" . htmlspecialchars("{$url}?reset=1&action=running&type=" . $row['id']) . "'><img src='{$proc}' title='" . __('View Processes') . "' align='absmiddle' alt=''></a>";
echo "<a style='padding:1px;' href='" . htmlspecialchars("{$url}?reset=1&action=software&ostype=" . $row['id']) . "'><img src='{$inven}' title='" . __('View Software Inventory') . "' align='absmiddle' alt=''></a>";
echo $graph_url;
echo '</td>';
$upHosts = hmib_get_device_status_url($row['upHosts'], $row['host_type'], 3);
$recHosts = hmib_get_device_status_url($row['recHosts'], $row['host_type'], 2);
$downHosts = hmib_get_device_status_url($row['downHosts'], $row['host_type'], 1);
示例10: update_show_current
//.........这里部分代码省略.........
</td>
<td>
Plugins
</td>
<td>
<select id='rows' name="rows" onChange="applyFilter()">
<?php
if (sizeof($item_rows) > 0) {
foreach ($item_rows as $key => $value) {
print "<option value='" . $key . "'";
if (get_request_var_request('rows') == $key) {
print ' selected';
}
print '>' . htmlspecialchars($value) . "</option>\n";
}
}
?>
</select>
</td>
<td>
<input type="button" id='refresh' value="Go" title="Set/Refresh Filters">
</td>
<td>
<input type="button" id='clear' name="clear_x" value="Clear" title="Clear Filters">
</td>
</tr>
</table>
<input type='hidden' id='page' name='page' value='<?php
print $_REQUEST['page'];
?>
'>
</form>
</td>
</tr>
<?php
html_end_box();
/* print checkbox form for validation */
print "<form name='chk' method='post' action='plugins.php'>\n";
html_start_box('', '100%', '', '3', 'center', '');
$sql_where = '';
/* form the 'where' clause for our main sql query */
if (strlen($_REQUEST['filter'])) {
$sql_where = "WHERE ({$table}.name LIKE '%%" . get_request_var_request('filter') . "%%')";
}
if ($_REQUEST['state'] > -3) {
if ($_REQUEST['state'] == 5) {
$sql_where .= (strlen($sql_where) ? ' AND ' : 'WHERE ') . ' status IN(1,4)';
} else {
$sql_where .= (strlen($sql_where) ? ' AND ' : 'WHERE ') . ' status=' . $_REQUEST['state'];
}
}
if (get_request_var_request('sort_column') == 'version') {
$sortc = 'version+0';
} else {
$sortc = get_request_var_request('sort_column');
}
if (get_request_var_request('sort_column') == 'id') {
$sortd = 'ASC';
} else {
$sortd = get_request_var_request('sort_direction');
}
if ($_REQUEST['rows'] == '-1') {
$rows = read_config_option('num_rows_table');
} else {
$rows = get_request_var_request('rows');
}
$total_rows = db_fetch_cell("SELECT\n\t\tcount(*)\n\t\tFROM {$table}\n\t\t{$sql_where}");
$plugins = db_fetch_assoc("SELECT *\n\t\tFROM {$table}\n\t\t{$sql_where}\n\t\tORDER BY " . $sortc . ' ' . $sortd . '
LIMIT ' . $rows * (get_request_var_request('page') - 1) . ',' . $rows);
db_execute("DROP TABLE {$table}");
$nav = html_nav_bar('plugins.php?filter=' . get_request_var_request('filter'), MAX_DISPLAY_PAGES, get_request_var_request('page'), $rows, $total_rows, 8, 'Plugins', 'page', 'main');
print $nav;
$display_text = array('nosort' => array('display' => 'Actions', 'align' => 'left', 'sort' => '', 'tip' => 'Actions available include "Install", "Activate", "Disable", "Enable", "Uninstall".'), 'directory' => array('display' => 'Plugin Name', 'align' => 'left', 'sort' => 'ASC', 'tip' => 'The name for this Plugin. The name is controlled by the direcotry it resides in.'), 'id' => array('display' => 'Load Order', 'align' => 'left', 'sort' => 'ASC', 'tip' => 'The load order of the Plugin. You can change the load order by first sorting by it, then moving a Plugin either up or down.'), 'name' => array('display' => 'Plugin Description', 'align' => 'left', 'sort' => 'ASC', 'tip' => 'A description that the Plugins author has given to the Plugin.'), 'version' => array('display' => 'Version', 'align' => 'left', 'sort' => 'ASC', 'tip' => 'The version of this Plugin.'), 'status' => array('display' => 'Status', 'align' => 'left', 'sort' => 'ASC', 'tip' => 'The status of this Plugin.'), 'author' => array('display' => 'Author', 'align' => 'left', 'sort' => 'ASC', 'tip' => 'The author of this Plugin.'));
html_header_sort($display_text, get_request_var_request('sort_column'), get_request_var_request('sort_direction'), 1);
$i = 0;
if (sizeof($plugins)) {
$j = 0;
foreach ($plugins as $plugin) {
if (isset($plugins[$j + 1]) && $plugins[$j + 1]['status'] < 0 || !isset($plugins[$j + 1])) {
$last_plugin = true;
} else {
$last_plugin = false;
}
if ($plugin['status'] <= 0 || get_request_var_request('sort_column') != 'id') {
$load_ordering = false;
} else {
$load_ordering = true;
}
form_alternate_row('', true);
print format_plugin_row($plugin, $last_plugin, $load_ordering);
$i++;
$j++;
}
print $nav;
} else {
print '<tr><td><em>No Plugins Found</em></td></tr>';
}
html_end_box(false);
print "</form>\n";
}
示例11: mactrack_view_ip_ranges
//.........这里部分代码省略.........
mactrack_tabs();
mactrack_view_header();
mactrack_ips_filter();
mactrack_view_footer();
html_start_box("", "100%", $colors["header"], "3", "center", "");
$sql_where = "";
$ip_ranges = mactrack_view_get_ip_range_records($sql_where, $row_limit);
$total_rows = db_fetch_cell("SELECT
COUNT(mac_track_ip_ranges.ip_range)
FROM mac_track_ip_ranges
INNER JOIN mac_track_sites ON (mac_track_ip_ranges.site_id=mac_track_sites.site_id)
$sql_where");
/* generate page list */
$url_page_select = str_replace("&page", "?page", get_page_list($_REQUEST["page"], MAX_DISPLAY_PAGES, $row_limit, $total_rows, "mactrack_view_ips.php"));
if (isset($config["base_path"])) {
if ($total_rows > 0) {
$nav = "<tr bgcolor='#" . $colors["header"] . "'>
<td colspan='13'>
<table width='100%' cellspacing='0' cellpadding='0' border='0'>
<tr>
<td align='left' class='textHeaderDark'>
<strong><< "; if ($_REQUEST["page"] > 1) { $nav .= "<a class='linkOverDark' href='mactrack_view_ips.php?page=" . ($_REQUEST["page"]-1) . "'>"; } $nav .= "Previous"; if ($_REQUEST["page"] > 1) { $nav .= "</a>"; } $nav .= "</strong>
</td>\n
<td align='center' class='textHeaderDark'>
Showing Rows " . ($total_rows == 0 ? "None" : (($row_limit*($_REQUEST["page"]-1))+1) . " to " . ((($total_rows < $row_limit) || ($total_rows < ($row_limit*$_REQUEST["page"]))) ? $total_rows : ($row_limit*$_REQUEST["page"])) . " of $total_rows [$url_page_select]") . "
</td>\n
<td align='right' class='textHeaderDark'>
<strong>"; if (($_REQUEST["page"] * $row_limit) < $total_rows) { $nav .= "<a class='linkOverDark' href='mactrack_view_ips.php?page=" . ($_REQUEST["page"]+1) . "'>"; } $nav .= "Next"; if (($_REQUEST["page"] * $row_limit) < $total_rows) { $nav .= "</a>"; } $nav .= " >></strong>
</td>\n
</tr>
</table>
</td>
</tr>\n";
}else{
$nav = "<tr bgcolor='#" . $colors["header"] . "' class='noprint'>
<td colspan='22'>
<table width='100%' cellspacing='0' cellpadding='0' border='0'>
<tr>
<td align='center' class='textHeaderDark'>
No Rows Found
</td>\n
</tr>
</table>
</td>
</tr>\n";
}
}else{
$nav = html_create_nav($_REQUEST["page"], MAX_DISPLAY_PAGES, $row_limit, $total_rows, 13, "mactrack_view_sites.php");
}
print $nav;
$display_text = array(
"nosort" => array("Actions", ""),
"site_name" => array("Site Name", "ASC"),
"ip_range" => array("IP Range", "ASC"),
"ips_current" => array("Current IP Addresses", "DESC"),
"ips_current_date" => array("Current Date", "DESC"),
"ips_max" => array("Maximum IP Addresses", "DESC"),
"ips_max_date" => array("Maximum Date", "DESC"));
html_header_sort($display_text, $_REQUEST["sort_column"], $_REQUEST["sort_direction"]);
$i = 0;
if (sizeof($ip_ranges) > 0) {
foreach ($ip_ranges as $ip_range) {
form_alternate_row_color($colors["alternate"],$colors["light"],$i); $i++;
?>
<td width=80>
<a href='<?php print htmlspecialchars($webroot . "plugins/mactrack/mactrack_sites.php?action=edit&site_id=" . $ip_range['site_id']);?>' title='Edit Site'><img border='0' src='<?php print $webroot;?>plugins/mactrack/images/edit_object.png'></a>
<a href='<?php print htmlspecialchars($webroot . "plugins/mactrack/mactrack_view_macs.php?report=macs&reset&ip_filter_type_id=3&ip_filter=" . $ip_range["ip_range"] . "." . "&device_id=-1&scan_date=3&site_id=" . $ip_range['site_id']);?>' title='View MAC Addresses'><img border='0' src='<?php print $webroot;?>plugins/mactrack/images/view_macs.gif'></a>
<a href='<?php print htmlspecialchars($webroot . "plugins/mactrack/mactrack_view_arp.php?report=arp&reset&ip_filter_type_id=3&ip_filter=" . $ip_range["ip_range"] . "." . "&device_id=-1&scan_date=3&site_id=" . $ip_range['site_id']);?>' title='View IP Addresses'><img border='0' src='<?php print $webroot;?>plugins/mactrack/images/view_ipaddresses.gif'></a>
</td>
<td width=200>
<?php print "<strong>" . $ip_range["site_name"] . "</strong>";?>
</td>
<td><?php print $ip_range["ip_range"] . ".*";?></td>
<td><?php print number_format($ip_range["ips_current"]);?></td>
<td><?php print $ip_range["ips_current_date"];?></td>
<td><?php print number_format($ip_range["ips_max"]);?></td>
<td><?php print $ip_range["ips_max_date"];?></td>
</tr>
<?php
}
}else{
print "<tr><td colspan='10'><em>No MacTrack Site IP Ranges Found</em></td></tr>";
}
print $nav;
html_end_box(false);
mactrack_display_stats();
}
示例12: syslog_messages
/** function syslog_messages()
* This is the main page display function in Syslog. Displays all the
* syslog messages that are relevant to Syslog.
*/
function syslog_messages($tab = 'syslog')
{
global $sql_where, $hostfilter, $severities;
global $config, $syslog_incoming_config, $reset_multi, $syslog_levels;
include dirname(__FILE__) . '/config.php';
include './include/global_arrays.php';
/* force the initial timespan to be 30 minutes for performance reasons */
if (!isset($_SESSION['sess_syslog_init'])) {
$_SESSION['sess_current_timespan'] = 1;
$_SESSION['sess_syslog_init'] = 1;
}
$url_curr_page = get_browser_query_string();
$sql_where = '';
if (get_request_var('rows') == -1) {
$row_limit = read_config_option('num_rows_table');
} elseif (get_request_var('rows') == -2) {
$row_limit = 999999;
} else {
$row_limit = get_request_var('rows');
}
$syslog_messages = get_syslog_messages($sql_where, $row_limit, $tab);
syslog_filter($sql_where, $tab);
if ($tab == 'syslog') {
if (get_request_var('removal') == 1) {
$total_rows = syslog_db_fetch_cell("SELECT SUM(totals)\n\t\t\t\tFROM (\n\t\t\t\t\tSELECT count(*) AS totals\n\t\t\t\t\tFROM `" . $syslogdb_default . "`.`syslog` AS syslog\n\t\t\t\t\t{$sql_where}\n\t\t\t\t\tUNION\n\t\t\t\t\tSELECT count(*) AS totals\n\t\t\t\t\tFROM `" . $syslogdb_default . "`.`syslog_removed` AS syslog\n\t\t\t\t\t{$sql_where}\n\t\t\t\t) AS rowcount");
} elseif (get_request_var("removal") == -1) {
$total_rows = syslog_db_fetch_cell("SELECT count(*) \n\t\t\t\tFROM `" . $syslogdb_default . "`.`syslog` AS syslog\n\t\t\t\t{$sql_where}");
} else {
$total_rows = syslog_db_fetch_cell("SELECT count(*) \n\t\t\t\tFROM `" . $syslogdb_default . "`.`syslog_removed` AS syslog\n\t\t\t\t{$sql_where}");
}
} else {
$total_rows = syslog_db_fetch_cell("SELECT count(*)\n\t\t\tFROM `" . $syslogdb_default . "`.`syslog_logs` AS syslog\n\t\t\tLEFT JOIN `" . $syslogdb_default . "`.`syslog_facilities` AS sf\n\t\t\tON syslog.facility_id=sf.facility_id \n\t\t\tLEFT JOIN `" . $syslogdb_default . "`.`syslog_priorities` AS sp\n\t\t\tON syslog.priority_id=sp.priority_id \n\t\t\tLEFT JOIN `" . $syslogdb_default . "`.`syslog_alert` AS sa\n\t\t\tON syslog.alert_id=sa.id \n\t\t\tLEFT JOIN `" . $syslogdb_default . "`.`syslog_programs` AS spr\n\t\t\tON syslog.program_id=spr.program_id " . $sql_where);
}
if ($tab == 'syslog') {
$nav = html_nav_bar("syslog.php?tab={$tab}", MAX_DISPLAY_PAGES, get_request_var_request('page'), $row_limit, $total_rows, 7, 'Messages', 'page', 'main');
if (api_plugin_user_realm_auth('syslog_alerts.php')) {
$display_text = array('nosortt' => array(__('Actions'), 'ASC'), 'logtime' => array(__('Date'), 'ASC'), 'host_id' => array(__('Host'), 'ASC'), 'program' => array(__('Program'), 'ASC'), 'message' => array(__('Message'), 'ASC'), 'facility_id' => array(__('Facility'), 'ASC'), 'priority_id' => array(__('Priority'), 'ASC'));
} else {
$display_text = array('logtime' => array(__('Date'), 'ASC'), 'host_id' => array(__('Host'), 'ASC'), 'program' => array(__('Program'), 'ASC'), 'message' => array(__('Message'), 'ASC'), 'facility_id' => array(__('Facility'), 'ASC'), 'priority_id' => array(__('Priority'), 'ASC'));
}
print $nav;
html_start_box('', '100%', '', '3', 'center', '');
html_header_sort($display_text, get_request_var('sort_column'), get_request_var('sort_direction'));
$hosts = array_rekey(syslog_db_fetch_assoc('SELECT host_id, host FROM `' . $syslogdb_default . '`.`syslog_hosts`'), 'host_id', 'host');
$facilities = array_rekey(syslog_db_fetch_assoc('SELECT facility_id, facility FROM `' . $syslogdb_default . '`.`syslog_facilities`'), 'facility_id', 'facility');
$priorities = array_rekey(syslog_db_fetch_assoc('SELECT priority_id, priority FROM `' . $syslogdb_default . '`.`syslog_priorities`'), 'priority_id', 'priority');
if (sizeof($syslog_messages)) {
foreach ($syslog_messages as $syslog_message) {
$title = htmlspecialchars($syslog_message['message'], ENT_QUOTES);
syslog_row_color($syslog_message['priority_id'], $title);
if (api_plugin_user_realm_auth('syslog_alerts.php')) {
print "<td class='nowrap left' style='width:1%:padding:1px !important;'>";
if ($syslog_message['mtype'] == 'main') {
print "<a style='padding:1px' href='" . htmlspecialchars('syslog_alerts.php?id=' . $syslog_message[$syslog_incoming_config['id']] . '&action=newedit&type=0') . "'><img src='images/add.png' border='0'></a>\n\t\t\t\t\t\t<a style='padding:1px' href='" . htmlspecialchars('syslog_removal.php?id=' . $syslog_message[$syslog_incoming_config['id']] . '&action=newedit&type=new&type=0') . "'><img src='images/delete.png' border='0'></a>\n";
}
print "</td>\n";
}
print '<td class="left nowrap">' . $syslog_message['logtime'] . "</td>\n";
print '<td class="left nowrap">' . $hosts[$syslog_message['host_id']] . "</td>\n";
print '<td class="left nowrap">' . $syslog_message['program'] . "</td>\n";
print '<td class="left syslogMessage">' . filter_value(title_trim($syslog_message[$syslog_incoming_config['textField']], get_request_var_request('trimval')), get_request_var('filter')) . "</td>\n";
print '<td class="left nowrap">' . ucfirst($facilities[$syslog_message['facility_id']]) . "</td>\n";
print '<td class="left nowrap">' . ucfirst($priorities[$syslog_message['priority_id']]) . "</td>\n";
}
} else {
print "<tr><td class='center' colspan='7'><em>" . __('No Syslog Messages') . "</em></td></tr>";
}
html_end_box(false);
if (sizeof($syslog_messages)) {
print $nav;
}
syslog_syslog_legend();
print "<script type='text/javascript'>\$(function() { \$('button').tooltip({ closed: true }).on('focus', function() { \$('#filter').tooltip('close') }).on('click', function() { \$(this).tooltip('close'); }); })</script>\n";
} else {
$nav = html_nav_bar("syslog.php?tab={$tab}", MAX_DISPLAY_PAGES, get_request_var_request('page'), $row_limit, $total_rows, 8, 'Alert Log Rows', 'page', 'main');
print $nav;
$display_text = array('name' => array('display' => __('Alert Name'), 'sort' => 'ASC', 'align' => 'left'), 'severity' => array('display' => __('Severity'), 'sort' => 'ASC', 'align' => 'left'), 'logtime' => array('display' => __('Date'), 'sort' => 'ASC', 'align' => 'left'), 'logmsg' => array('display' => __('Message'), 'sort' => 'ASC', 'align' => 'left'), 'count' => array('display' => __('Count'), 'sort' => 'ASC', 'align' => 'right'), 'host' => array('display' => __('Host'), 'sort' => 'ASC', 'align' => 'right'), 'facility_id' => array('display' => __('Facility'), 'sort' => 'ASC', 'align' => 'right'), 'priority_id' => array('display' => __('Priority'), 'sort' => 'ASC', 'align' => 'right'));
html_start_box('', '100%', '', '3', 'center', '');
html_header_sort($display_text, get_request_var('sort_column'), get_request_var('sort_direction'));
if (sizeof($syslog_messages)) {
foreach ($syslog_messages as $log) {
$title = htmlspecialchars($log['logmsg'], ENT_QUOTES);
syslog_row_color($log['severity'], $title);
print "<td class='left'><a class='linkEditMain' href='" . htmlspecialchars($config['url_path'] . 'plugins/syslog/syslog.php?id=' . $log['seq'] . '&tab=current') . "'>" . (strlen($log['name']) ? $log['name'] : 'Alert Removed') . "</a></td>\n";
print '<td class="left nowrap">' . (isset($severities[$log['severity']]) ? $severities[$log['severity']] : 'Unknown') . "</td>\n";
print '<td class="left nowrap">' . $log['logtime'] . "</td>\n";
print '<td class="left syslogMessage">' . filter_value(title_trim($log['logmsg'], get_request_var_request('trimval')), get_request_var('filter')) . "</td>\n";
print '<td class="right nowrap">' . $log['count'] . "</td>\n";
print '<td class="right nowrap">' . $log['host'] . "</td>\n";
print '<td class="right nowrap">' . ucfirst($log['facility']) . "</td>\n";
print '<td class="right nowrap">' . ucfirst($log['priority']) . "</td>\n";
print "</tr>\n";
}
} else {
print "<tr><td colspan='11'><em>" . __('No Alert Log Messages') . "</em></td></tr>";
}
//.........这里部分代码省略.........
示例13: mactrack_view
function mactrack_view()
{
global $title, $mactrack_rows, $config;
mactrack_interfaces_request_validation();
general_header();
$sql_where = '';
if (get_request_var('rows') == -1) {
$row_limit = read_config_option('num_rows_table');
} elseif (get_request_var('rows') == -2) {
$row_limit = 99999999;
} else {
$row_limit = get_request_var('rows');
}
$stats = mactrack_get_records($sql_where, TRUE, $row_limit);
mactrack_tabs();
html_start_box($title, '100%', '', '3', 'center', '');
mactrack_filter_table();
html_end_box();
$rows_query_string = "SELECT COUNT(*)\n\t\tFROM mac_track_interfaces\n\t\tINNER JOIN mac_track_devices\n\t\tON mac_track_interfaces.device_id=mac_track_devices.device_id\n\t\tINNER JOIN mac_track_device_types\n\t\tON mac_track_device_types.device_type_id=mac_track_devices.device_type_id\n\t\t{$sql_where}";
$total_rows = db_fetch_cell($rows_query_string);
$nav = html_nav_bar('mactrack_view_interfaces.php?report=interfaces', MAX_DISPLAY_PAGES, get_request_var('page'), $row_limit, $total_rows, 22, __('Interfaces'));
print $nav;
html_start_box('', '100%', '', '3', 'center', '');
$display_text = mactrack_display_array();
html_header_sort($display_text, get_request_var('sort_column'), get_request_var('sort_direction'));
$i = 0;
if (sizeof($stats)) {
foreach ($stats as $stat) {
/* find the background color and enclose it */
$class = mactrack_int_row_class($stat);
if ($bgc) {
print "<tr id='row_" . $stat['device_id'] . '_' . $stat['ifName'] . "' class='{$class}'>\n";
$i++;
} else {
if ($i % 2 == 1) {
$class = 'odd';
} else {
$class = 'even';
}
print "<tr id='row_" . $stat['device_id'] . "' class='{$class}'>\n";
$i++;
}
print mactrack_format_interface_row($stat);
}
} else {
print '<tr><td colspan="7"><em>' . __('No MacTrack Interfaces Found') . '</em></td></tr>';
}
html_end_box(false);
if (sizeof($stats)) {
print $nav;
}
print '<div class="center" style="position:fixed;left:0;bottom:0;display:table;margin-left:auto;margin-right:auto;width:100%;">';
html_start_box('', '100%', '', '3', 'center', '');
print '<tr>';
mactrack_legend_row('int_up', 'Interface Up');
mactrack_legend_row('int_up_wo_alias', 'No Alias');
mactrack_legend_row('int_errors', 'Errors Present');
mactrack_legend_row('int_discards', 'Discards Present');
mactrack_legend_row('int_no_graph', 'No Graphs');
mactrack_legend_row('int_down', 'Interface Down');
print '</tr>';
html_end_box(false);
print '</div>';
if (sizeof($stats)) {
mactrack_display_stats();
}
print '<div id="response"></div>';
bottom_footer();
}
示例14: mactrack_view_devices
function mactrack_view_devices()
{
global $title, $report, $mactrack_search_types, $mactrack_device_types, $rows_selector, $config, $item_rows;
mactrack_device_request_validation();
if (get_request_var('rows') == -1) {
$row_limit = read_config_option('num_rows_table');
} elseif (get_request_var('rows') == -2) {
$row_limit = 999999;
} else {
$row_limit = get_request_var('rows');
}
$webroot = $config['url_path'] . '/plugins/mactrack/';
mactrack_tabs();
html_start_box($title, '100%', '', '3', 'center', '');
mactrack_device_filter2();
html_end_box();
$sql_where = '';
$devices = mactrack_view_get_device_records($sql_where, $row_limit);
$total_rows = db_fetch_cell("SELECT\n\t\tCOUNT(mac_track_devices.device_id)\n\t\tFROM mac_track_sites\n\t\tRIGHT JOIN mac_track_devices ON mac_track_devices.site_id = mac_track_sites.site_id\n\t\tLEFT JOIN mac_track_device_types ON (mac_track_device_types.device_type_id=mac_track_devices.device_type_id)\n\t\t{$sql_where}");
$nav = html_nav_bar('mactrack_view_devices.php?report=devices', MAX_DISPLAY_PAGES, get_request_var('page'), $row_limit, $total_rows, 13, __('Devices'));
print $nav;
html_start_box('', '100%', '', '3', 'center', '');
$display_text = array('nosort' => array(__('Actions'), ''), 'device_name' => array(__('Device Name'), 'ASC'), 'site_name' => array(__('Site Name'), 'ASC'), 'snmp_status' => array(__('Status'), 'ASC'), 'hostname' => array(__('Hostname'), 'ASC'), 'device_type' => array(__('Device Type'), 'ASC'), 'ips_total' => array(__('Total IP\'s'), 'DESC'), 'ports_total' => array(__('User Ports'), 'DESC'), 'ports_active' => array(__('User Ports Up'), 'DESC'), 'ports_trunk' => array(__('Trunk Ports'), 'DESC'), 'macs_active' => array(__('Active Macs'), 'DESC'), 'vlans_total' => array(__('Total VLAN\'s'), 'DESC'), 'last_runduration' => array(__('Last Duration'), 'DESC'));
html_header_sort($display_text, get_request_var('sort_column'), get_request_var('sort_direction'));
$i = 0;
if (sizeof($devices) > 0) {
foreach ($devices as $device) {
$hostinfo['hostname'] = $device['hostname'];
$hostinfo['user'] = $device['user_name'];
switch ($device['term_type']) {
case 0:
$hostinfo['transport'] = 'none';
break;
case 1:
$hostinfo['transport'] = 'telnet';
break;
case 2:
$hostinfo['transport'] = 'ssh';
break;
case 3:
$hostinfo['transport'] = 'http';
break;
case 4:
$hostinfo['transport'] = 'https';
break;
}
form_alternate_row();
?>
<td width=100>
<?php
if (api_user_realm_auth('mactrack_sites.php')) {
?>
<a href='<?php
print htmlspecialchars($webroot . 'mactrack_devices.php?action=edit&device_id=' . $device['device_id']);
?>
' title='<?php
print __('Edit Device');
?>
'><img border='0' src='<?php
print $webroot;
?>
images/edit_object.png'></a>
<?php
api_plugin_hook_function('remote_link', $hostinfo);
}
?>
<?php
if ($device['host_id'] > 0) {
?>
<a href='<?php
print htmlspecialchars($webroot . 'mactrack_view_graphs.php?action=preview&report=graphs&style=selective&graph_list=&host=' . $device['host_id'] . '&graph_template_id=0&filter=');
?>
' title='<?php
print __('View Graphs');
?>
'><img border='0' src='<?php
print $webroot;
?>
images/view_graphs.gif'></a>
<?php
} else {
?>
<img title='<?php
print __('Device Not Mapped to Cacti Device');
?>
' border='0' src='<?php
print $webroot;
?>
images/view_graphs_disabled.gif'>
<?php
}
?>
<a href='<?php
print htmlspecialchars($webroot . 'mactrack_view_macs.php?report=macs&reset&device_id=-1&scan_date=3&site_id=' . get_request_var('site_id') . '&device_id=' . $device['device_id']);
?>
' title='<?php
print __('View MAC Addresses');
?>
'><img border='0' src='<?php
print $webroot;
//.........这里部分代码省略.........
示例15: mactrack_vmacs
//.........这里部分代码省略.........
/* remember these search fields in session vars so we don't have to keep passing them around */
load_current_session_value("page", "sess_mactrack_vmacs_current_page", "1");
load_current_session_value("filter", "sess_mactrack_vmacs_filter", "");
load_current_session_value("rows", "sess_mactrack_vmacs_rows", "-1");
load_current_session_value("sort_column", "sess_mactrack_vmacs_sort_column", "vendor_mac");
load_current_session_value("sort_direction", "sess_mactrack_vmacs_sort_direction", "ASC");
if ($_REQUEST["rows"] == -1) {
$row_limit = read_config_option("num_rows_mactrack");
}elseif ($_REQUEST["rows"] == -2) {
$row_limit = 999999;
}else{
$row_limit = $_REQUEST["rows"];
}
html_start_box("<strong>MacTrack Vendor Mac Filter</strong>", "100%", $colors["header"], "3", "center", "");
mactrack_vmac_filter();
html_end_box();
html_start_box("", "100%", $colors["header"], "3", "center", "");
$sql_where = "";
$vmacs = mactrack_vmacs_get_vmac_records($sql_where, $row_limit);
$total_rows = db_fetch_cell("SELECT
COUNT(*)
FROM mac_track_oui_database
$sql_where");
/* generate page list */
$url_page_select = str_replace("&page", "?page", get_page_list($_REQUEST["page"], MAX_DISPLAY_PAGES, $row_limit, $total_rows, "mactrack_vendormacs.php"));
if (defined("CACTI_VERSION")) {
/* generate page list navigation */
$nav = html_create_nav($_REQUEST["page"], MAX_DISPLAY_PAGES, $row_limit, $total_rows, 11, "mactrack_vendormacs.php?filter=" . $_REQUEST["filter"]);
}else{
if ($total_rows > 0) {
$nav = "<tr bgcolor='#" . $colors["header"] . "'>
<td colspan='9'>
<table width='100%' cellspacing='0' cellpadding='0' border='0'>
<tr>
<td align='left' class='textHeaderDark'>
<strong><< "; if ($_REQUEST["page"] > 1) { $nav .= "<a class='linkOverDark' href='mactrack_vendormacs.php?page=" . ($_REQUEST["page"]-1) . "'>"; } $nav .= "Previous"; if ($_REQUEST["page"] > 1) { $nav .= "</a>"; } $nav .= "</strong>
</td>\n
<td align='center' class='textHeaderDark'>
Showing Rows " . (($row_limit*($_REQUEST["page"]-1))+1) . " to " . ((($total_rows < $row_limit) || ($total_rows < ($row_limit*$_REQUEST["page"]))) ? $total_rows : ($row_limit*$_REQUEST["page"])) . " of $total_rows [$url_page_select]
</td>\n
<td align='right' class='textHeaderDark'>
<strong>"; if (($_REQUEST["page"] * $row_limit) < $total_rows) { $nav .= "<a class='linkOverDark' href='mactrack_vendormacs.php?page=" . ($_REQUEST["page"]+1) . "'>"; } $nav .= "Next"; if (($_REQUEST["page"] * $row_limit) < $total_rows) { $nav .= "</a>"; } $nav .= " >></strong>
</td>\n
</tr>
</table>
</td>
</tr>\n";
}else{
$nav = "<tr bgcolor='#" . $colors["header"] . "' class='noprint'>
<td colspan='22'>
<table width='100%' cellspacing='0' cellpadding='0' border='0'>
<tr>
<td align='center' class='textHeaderDark'>
No Rows Found
</td>\n
</tr>
</table>
</td>
</tr>\n";
}
}
if ($total_rows) {
print $nav;
}
$display_text = array(
"vendor_mac" => array("Vendor MAC", "ASC"),
"vendor_name" => array("Name", "ASC"),
"vendor_address" => array("Address", "ASC"));
html_header_sort($display_text, $_REQUEST["sort_column"], $_REQUEST["sort_direction"]);
$i = 0;
if (sizeof($vmacs) > 0) {
foreach ($vmacs as $vmac) {
form_alternate_row_color($colors["alternate"],$colors["light"],$i); $i++;
?>
<td class="linkEditMain"><?php print $vmac["vendor_mac"];?></td>
<td><?php print (strlen($_REQUEST["filter"]) ? preg_replace("/(" . preg_quote($_REQUEST["filter"]) . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $vmac["vendor_name"]) : $vmac["vendor_name"]);?></td>
<td><?php print (strlen($_REQUEST["filter"]) ? preg_replace("/(" . preg_quote($_REQUEST["filter"]) . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $vmac["vendor_address"]) : $vmac["vendor_address"]);?></td>
</tr>
<?php
}
/* put the nav bar on the bottom as well */
print $nav;
}else{
print "<tr><td><em>No MacTrack Vendor MACS</em></td></tr>";
}
html_end_box(false);
}