本文整理汇总了PHP中html_nav_bar函数的典型用法代码示例。如果您正苦于以下问题:PHP html_nav_bar函数的具体用法?PHP html_nav_bar怎么用?PHP html_nav_bar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了html_nav_bar函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: mikrotik_view_graphs
function mikrotik_view_graphs()
{
global $current_user, $colors, $config, $host_template_hashes, $graph_template_hashes;
include './lib/timespan_settings.php';
include './lib/html_graph.php';
html_graph_validate_preview_request_vars();
/* include graph view filter selector */
html_start_box('<strong>Graph Preview Filters</strong>' . (isset($_REQUEST['style']) && strlen($_REQUEST['style']) ? ' [ Custom Graph List Applied - Filtering from List ]' : ''), '100%', '', '3', 'center', '');
html_graph_preview_filter('mikrotik.php', 'graphs', 'ht.hash IN ("' . implode('","', $host_template_hashes) . '")', 'gt.hash IN ("' . implode('","', $graph_template_hashes) . '")');
html_end_box();
/* the user select a bunch of graphs of the 'list' view and wants them displayed here */
$sql_or = '';
if (isset($_REQUEST['style'])) {
if (get_request_var_request('style') == 'selective') {
/* process selected graphs */
if (!empty($_REQUEST['graph_list'])) {
foreach (explode(',', $_REQUEST['graph_list']) as $item) {
$graph_list[$item] = 1;
}
} else {
$graph_list = array();
}
if (!empty($_REQUEST['graph_add'])) {
foreach (explode(',', $_REQUEST['graph_add']) as $item) {
$graph_list[$item] = 1;
}
}
/* remove items */
if (!empty($_REQUEST['graph_remove'])) {
foreach (explode(',', $_REQUEST['graph_remove']) as $item) {
unset($graph_list[$item]);
}
}
$i = 0;
foreach ($graph_list as $item => $value) {
$graph_array[$i] = $item;
$i++;
}
if (isset($graph_array) && sizeof($graph_array) > 0) {
/* build sql string including each graph the user checked */
$sql_or = array_to_sql_or($graph_array, 'gtg.local_graph_id');
$set_rra_id = empty($rra_id) ? read_graph_config_option('default_rra_id') : get_request_var_request('rra_id');
}
}
}
$total_graphs = 0;
// Filter sql_where
$sql_where = strlen($_REQUEST['filter']) ? "gtg.title_cache LIKE '%" . get_request_var_request('filter') . "%'" : '';
$sql_where .= (strlen($sql_or) && strlen($sql_where) ? ' AND ' : '') . $sql_or;
// Host Id sql_where
if ($_REQUEST['host_id'] > 0) {
$sql_where .= (strlen($sql_where) ? ' AND' : '') . ' gl.host_id=' . $_REQUEST['host_id'];
} else {
$host_ids = mikrotik_host_ids_from_hashes($host_template_hashes);
if (sizeof($host_ids)) {
$sql_where .= (strlen($sql_where) ? ' AND' : '') . ' gl.host_id IN (' . implode(',', $host_ids) . ')';
} else {
$sql_where .= (strlen($sql_where) ? ' AND' : '') . ' 1=0';
}
}
// Graph Template Id sql_where
if ($_REQUEST['graph_template_id'] > 0) {
$sql_where .= (strlen($sql_where) ? ' AND' : '') . ' gl.graph_template_id=' . $_REQUEST['graph_template_id'];
} else {
$graph_template_ids = mikrotik_graph_templates_from_hashes($graph_template_hashes);
if (sizeof($graph_template_ids)) {
$sql_where .= (strlen($sql_where) ? ' AND' : '') . ' gl.graph_template_id IN (' . implode(',', $graph_template_ids) . ')';
} else {
$sql_where .= (strlen($sql_where) ? ' AND' : '') . ' 1=0';
}
}
$limit = $_REQUEST['graphs'] * ($_REQUEST['page'] - 1) . ',' . $_REQUEST['graphs'];
$order = 'gtg.title_cache';
$graphs = get_allowed_graphs($sql_where, $order, $limit, $total_graphs);
/* do some fancy navigation url construction so we don't have to try and rebuild the url string */
if (preg_match('/page=[0-9]+/', basename($_SERVER['QUERY_STRING']))) {
$nav_url = str_replace('&page=' . get_request_var_request('page'), '', get_browser_query_string());
} else {
$nav_url = get_browser_query_string() . '&host_id=' . get_request_var_request('host_id');
}
$nav_url = preg_replace('/((\\?|&)host_id=[0-9]+|(\\?|&)filter=[a-zA-Z0-9]*)/', '', $nav_url);
html_start_box('', '100%', '', '3', 'center', '');
$nav = html_nav_bar($nav_url, MAX_DISPLAY_PAGES, get_request_var_request('page'), get_request_var_request('graphs'), $total_graphs, get_request_var_request('columns'), 'Graphs', 'page', 'main');
print $nav;
if (get_request_var_request('thumbnails') == 'true') {
html_graph_thumbnail_area($graphs, '', 'graph_start=' . get_current_graph_start() . '&graph_end=' . get_current_graph_end(), '', get_request_var_request('columns'));
} else {
html_graph_area($graphs, '', 'graph_start=' . get_current_graph_start() . '&graph_end=' . get_current_graph_end(), '', get_request_var_request('columns'));
}
if ($total_graphs > 0) {
print $nav;
}
html_end_box();
bottom_footer();
}
开发者ID:TFyre,项目名称:plugin_mikrotik_new,代码行数:95,代码来源:mikrotik.php
示例2: host
//.........这里部分代码省略.........
</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();
/* form the 'where' clause for our main sql query */
if (strlen(get_request_var_request('filter'))) {
$sql_where = "where (host.hostname like '%%" . get_request_var_request('filter') . "%%' OR host.description like '%%" . get_request_var_request('filter') . "%%')";
} else {
$sql_where = '';
}
if (get_request_var_request('host_status') == '-1') {
/* Show all items */
} elseif (get_request_var_request('host_status') == '-2') {
$sql_where .= strlen($sql_where) ? " AND host.disabled='on'" : " WHERE host.disabled='on'";
} elseif (get_request_var_request('host_status') == '-3') {
$sql_where .= strlen($sql_where) ? " AND host.disabled=''" : " WHERE host.disabled=''";
} elseif (get_request_var_request('host_status') == '-4') {
$sql_where .= strlen($sql_where) ? " AND (host.status!='3' OR host.disabled='on')" : " WHERE (host.status!='3' OR host.disabled='on')";
} else {
$sql_where .= strlen($sql_where) ? ' AND (host.status=' . get_request_var_request('host_status') . " AND host.disabled = '')" : 'where (host.status=' . get_request_var_request('host_status') . " AND host.disabled = '')";
}
if (get_request_var_request('host_template_id') == '-1') {
/* Show all items */
} elseif (get_request_var_request('host_template_id') == '0') {
$sql_where .= strlen($sql_where) ? ' AND host.host_template_id=0' : ' WHERE host.host_template_id=0';
} elseif (!empty($_REQUEST['host_template_id'])) {
$sql_where .= strlen($sql_where) ? ' AND host.host_template_id=' . get_request_var_request('host_template_id') : ' WHERE host.host_template_id=' . get_request_var_request('host_template_id');
}
/* print checkbox form for validation */
print "<form name='chk' method='post' action='host.php'>\n";
html_start_box('', '100%', '', '3', 'center', '');
$total_rows = db_fetch_cell("SELECT\n\t\tCOUNT(host.id)\n\t\tFROM host\n\t\t{$sql_where}");
$sortby = get_request_var_request('sort_column');
if ($sortby == 'hostname') {
$sortby = 'INET_ATON(hostname)';
}
$sql_query = "SELECT host.*, graphs, data_sources\n\t\tFROM host\n\t\tLEFT JOIN (SELECT host_id, COUNT(*) AS graphs FROM graph_local GROUP BY host_id) AS gl\n\t\tON host.id=gl.host_id\n\t\tLEFT JOIN (SELECT host_id, COUNT(*) AS data_sources FROM data_local GROUP BY host_id) AS dl\n\t\tON host.id=dl.host_id\n\t\t{$sql_where}\n\t\tGROUP BY host.id\n\t\tORDER BY " . $sortby . ' ' . get_request_var_request('sort_direction') . '
LIMIT ' . get_request_var_request('rows') * (get_request_var_request('page') - 1) . ',' . get_request_var_request('rows');
$hosts = db_fetch_assoc($sql_query);
$nav = html_nav_bar('host.php?filter=' . get_request_var_request('filter') . '&host_template_id=' . get_request_var_request('host_template_id') . '&host_status=' . get_request_var_request('host_status'), MAX_DISPLAY_PAGES, get_request_var_request('page'), get_request_var_request('rows'), $total_rows, 13, 'Devices', 'page', 'main');
print $nav;
$display_text = array('description' => array('display' => 'Device Description', 'align' => 'left', 'sort' => 'ASC', 'tip' => 'The name by which this Device will be referred to.'), 'hostname' => array('display' => 'Hostname', 'align' => 'left', 'sort' => 'ASC', 'tip' => 'Either an IP address, or hostname. If a hostname, it must be resolvable by either DNS, or from your hosts file.'), 'id' => array('display' => 'ID', 'align' => 'right', 'sort' => 'ASC', 'tip' => 'The internal database ID for this Device. Useful when performing automation or debugging.'), 'graphs' => array('display' => 'Graphs', 'align' => 'right', 'sort' => 'ASC', 'tip' => 'The total number of Graphs generated from this Device.'), 'data_sources' => array('display' => 'Data Sources', 'align' => 'right', 'sort' => 'ASC', 'tip' => 'The total number of Data Sources generated from this Device.'), 'status' => array('display' => 'Status', 'align' => 'center', 'sort' => 'ASC', 'tip' => 'The monitoring status of the Device based upon ping results. If this Device is a special type Device, by using the hostname "localhost", or due to the setting to not perform an Availability Check, it will always remain Up. When using cmd.php data collector, a Device with no Graphs, is not pinged by the data collector and will remain in an "Unknown" state.'), 'status_rec_date' => array('display' => 'In State', 'align' => 'right', 'sort' => 'ASC', 'tip' => 'The amount of time that this Device has been in its current state.'), 'snmp_sysUpTimeInstance' => array('display' => 'Uptime', 'align' => 'right', 'sort' => 'ASC', 'tip' => 'The current amount of time that the host has been up.'), 'polling_time' => array('display' => 'Poll Time', 'align' => 'right', 'sort' => 'ASC', 'tip' => 'The the amount of time it takes to collect data from this Device.'), 'cur_time' => array('display' => 'Current (ms)', 'align' => 'right', 'sort' => 'DESC', 'tip' => 'The current ping time in milliseconds to reach the Device.'), 'avg_time' => array('display' => 'Average (ms)', 'align' => 'right', 'sort' => 'DESC', 'tip' => 'The average ping time in milliseconds to reach the Device since the counters were cleared for this Device.'), 'availability' => array('display' => 'Availability', 'align' => 'right', 'sort' => 'ASC', 'tip' => 'The availability percentage based upon ping results insce the counters were cleared for this Device.'));
html_header_sort_checkbox($display_text, get_request_var_request('sort_column'), get_request_var_request('sort_direction'), false);
$i = 0;
if (sizeof($hosts) > 0) {
foreach ($hosts as $host) {
if ($host['disabled'] == '' && ($host['status'] == HOST_RECOVERING || $host['status'] == HOST_UP) && ($host['availability_method'] != AVAIL_NONE && $host['availability_method'] != AVAIL_PING)) {
$snmp_uptime = $host['snmp_sysUpTimeInstance'];
$days = intval($snmp_uptime / (60 * 60 * 24 * 100));
$remainder = $snmp_uptime % (60 * 60 * 24 * 100);
$hours = intval($remainder / (60 * 60 * 100));
$remainder = $remainder % (60 * 60 * 100);
$minutes = intval($remainder / (60 * 100));
$uptime = "{$days} d {$hours} h {$minutes} m";
} else {
$uptime = "N/A";
}
form_alternate_row('line' . $host['id'], true);
form_selectable_cell("<a class='linkEditMain' href='" . htmlspecialchars('host.php?action=edit&id=' . $host['id']) . "'>" . (strlen(get_request_var_request('filter')) ? preg_replace('/(' . preg_quote(get_request_var_request('filter'), '/') . ')/i', "<span class='filteredValue'>\\1</span>", htmlspecialchars($host['description'])) : htmlspecialchars($host['description'])) . '</a>', $host['id']);
form_selectable_cell(strlen(get_request_var_request('filter')) ? preg_replace('/(' . preg_quote(get_request_var_request('filter'), '/') . ')/i', "<span class='filteredValue'>\\1</span>", htmlspecialchars($host['hostname'])) : htmlspecialchars($host['hostname']), $host['id']);
form_selectable_cell($host['id'], $host['id'], '', 'text-align:right');
form_selectable_cell(number_format($host['graphs']), $host['id'], '', 'text-align:right');
form_selectable_cell(number_format($host['data_sources']), $host['id'], '', 'text-align:right');
form_selectable_cell(get_colored_device_status($host['disabled'] == 'on' ? true : false, $host['status']), $host['id'], '', 'text-align:center');
form_selectable_cell(get_timeinstate($host), $host['id'], '', 'text-align:right');
form_selectable_cell($uptime, $host['id'], '', 'text-align:right');
form_selectable_cell(round($host['polling_time'], 2), $host['id'], '', 'text-align:right');
form_selectable_cell(round($host['cur_time'], 2), $host['id'], '', 'text-align:right');
form_selectable_cell(round($host['avg_time'], 2), $host['id'], '', 'text-align:right');
form_selectable_cell(round($host['availability'], 2) . ' %', $host['id'], '', 'text-align:right');
form_checkbox_cell($host['description'], $host['id']);
form_end_row();
}
/* put the nav bar on the bottom as well */
print $nav;
} else {
print "<tr class='tableRow'><td colspan='11'><em>No Devices</em></td></tr>";
}
html_end_box(false);
/* add a list of tree names to the actions dropdown */
add_tree_names_to_actions_array();
/* draw the dropdown containing a list of available actions for this form */
draw_actions_dropdown($device_actions);
print "</form>\n";
}
开发者ID:MrWnn,项目名称:cacti,代码行数:101,代码来源:host.php
示例3: graphs
//.........这里部分代码省略.........
} else {
$sql_order = '';
}
/* get the unique field values from the database */
$field_names = db_fetch_assoc_prepared('SELECT DISTINCT field_name
FROM host_snmp_cache
WHERE host_id = ?
AND snmp_query_id = ?', array($host['id'], $snmp_query['id']));
/* build magic query */
$sql_query = 'SELECT host_id, snmp_query_id, snmp_index';
$num_visible_fields = sizeof($field_names);
$i = 0;
if (sizeof($field_names) > 0) {
foreach ($field_names as $column) {
$field_name = $column['field_name'];
$sql_query .= ", MAX(CASE WHEN field_name='{$field_name}' THEN field_value ELSE NULL END) AS '{$field_name}'";
$i++;
}
}
$sql_query .= ' FROM host_snmp_cache
WHERE host_id=' . $host['id'] . '
AND snmp_query_id=' . $snmp_query['id'] . "\n\t\t\t\t\t\t{$sql_where}\n\t\t\t\t\t\tGROUP BY host_id, snmp_query_id, snmp_index\n\t\t\t\t\t\t{$sql_order}\n\t\t\t\t\t\tLIMIT " . $row_limit * ($page - 1) . ',' . $row_limit;
$rows_query = 'SELECT host_id, snmp_query_id, snmp_index
FROM host_snmp_cache
WHERE host_id=' . $host['id'] . '
AND snmp_query_id=' . $snmp_query['id'] . "\n\t\t\t\t\t\t{$sql_where}\n\t\t\t\t\t\tGROUP BY host_id, snmp_query_id, snmp_index";
$snmp_query_indexes = db_fetch_assoc($sql_query);
$total_rows = sizeof(db_fetch_assoc($rows_query));
if (($page - 1) * $row_limit > $total_rows) {
$page = 1;
$_REQUEST['page' . $query['id']] = $page;
load_current_session_value('page' . $query['id'], 'sess_graphs_new_page' . $query['id'], '1');
}
$nav = html_nav_bar('graphs_new.php', MAX_DISPLAY_PAGES, $page, $row_limit, $total_rows, 15, 'Items', 'page' . $snmp_query['id']);
print $nav;
while (list($field_name, $field_array) = each($xml_array['fields'])) {
if ($field_array['direction'] == 'input' && sizeof($field_names)) {
foreach ($field_names as $row) {
if ($row['field_name'] == $field_name) {
$html_dq_header .= "<td class='tableSubHeaderColumn'>" . $field_array['name'] . "</td>\n";
break;
}
}
}
}
if (!sizeof($snmp_query_indexes)) {
print "<tr class='odd'><td>This Data Query returned 0 rows, perhaps there was a problem executing this\n\t\t\t\t\t\t\tData Query. You can <a href='" . htmlspecialchars('host.php?action=query_verbose&id=' . $snmp_query['id'] . '&host_id=' . $host['id']) . "'>run this Data Query in debug mode</a> to get more information.</td></tr>\n";
} else {
print "<tr class='tableHeader'>\n\t\t\t\t\t\t\t\t{$html_dq_header}\n\t\t\t\t\t\t\t\t<td width='1%' align='center' class='tableSubHeaderCheckbox' style='" . get_checkbox_style() . "'><input type='checkbox' style='margin: 0px;' name='all_" . $snmp_query['id'] . "' title='Select All' onClick='SelectAll(\"sg_" . $snmp_query['id'] . "\",this.checked)'></td>\n\n\t\t\t\t\t\t\t</tr>\n";
}
$row_counter = 0;
$column_counter = 0;
$fields = array_rekey($field_names, 'field_name', 'field_name');
if (sizeof($snmp_query_indexes) > 0) {
foreach ($snmp_query_indexes as $row) {
$query_row = $snmp_query['id'] . '_' . encode_data_query_index($row['snmp_index']);
print "<tr id='line{$query_row}' class='selectable " . ($row_counter % 2 == 0 ? 'odd' : 'even') . "'>";
$i++;
$column_counter = 0;
reset($xml_array['fields']);
while (list($field_name, $field_array) = each($xml_array['fields'])) {
if ($field_array['direction'] == 'input') {
if (in_array($field_name, $fields)) {
if (isset($row[$field_name])) {
print "<td><span id='text{$query_row}" . '_' . $column_counter . "'>" . (strlen($_REQUEST['filter']) ? preg_replace('/(' . preg_quote($_REQUEST['filter']) . ')/i', "<span class='filteredValue'>\\1</span>", $row[$field_name]) : $row[$field_name]) . '</span></td>';
} else {
开发者ID:MrWnn,项目名称:cacti,代码行数:67,代码来源:graphs_new.php
示例4: snmpagent_utilities_run_eventlog
//.........这里部分代码省略.........
" onChange='applyFilter()'>
</td>
<td>
Rows:
</td>
<td>
<select id='rows' name="rows" onChange="applyFilter()">
<option value="-1"<?php
if (get_request_var_request("rows") == "-1") {
?>
selected<?php
}
?>
>Default</option>
<?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="submit" id="refresh" name="go" value="Go" title="Set/Refresh Filters">
<input type="submit" id="clear" name="clear_x" value="Clear" title="Clear Filters">
<input type="submit" id="purge" name="purge_x" value="Purge" title="Purge Notification Log">
</td>
</tr>
</table>
<input type='hidden' id='page' name='page' value='<?php
print $_REQUEST['page'];
?>
'>
</form>
</td>
</tr>
<?php
html_end_box();
$sql_where = " 1";
/* filter by severity */
if (get_request_var_request("receiver") != "-1") {
$sql_where .= " AND snmpagent_notifications_log.manager_id='" . get_request_var_request("receiver") . "'";
}
/* filter by severity */
if (get_request_var_request("severity") == "-1") {
/* Show all items */
} elseif (!empty($_REQUEST["severity"])) {
$sql_where .= " AND snmpagent_notifications_log.severity='" . get_request_var_request("severity") . "'";
}
/* filter by search string */
if (get_request_var_request("filter") != "") {
$sql_where .= " AND (`varbinds` LIKE '%%" . get_request_var_request("filter") . "%%')";
}
$sql_where .= ' ORDER by `time` DESC';
$sql_query = "SELECT snmpagent_notifications_log.*, snmpagent_managers.hostname, snmpagent_cache.description FROM snmpagent_notifications_log\n\t\t\t\t\t INNER JOIN snmpagent_managers ON snmpagent_managers.id = snmpagent_notifications_log.manager_id\n\t\t\t\t\t LEFT JOIN snmpagent_cache ON snmpagent_cache.name = snmpagent_notifications_log.notification\n\t\t\t\t\t WHERE {$sql_where} LIMIT " . read_config_option("num_rows_data_source") * (get_request_var_request("page") - 1) . "," . read_config_option("num_rows_data_source");
/* print checkbox form for validation */
print "<form name='chk' method='post' action='managers.php'>\n";
html_start_box("", "100%", "", "3", "center", "");
$total_rows = db_fetch_cell("SELECT COUNT(*) FROM snmpagent_notifications_log WHERE {$sql_where}");
$logs = db_fetch_assoc($sql_query);
/* generate page list */
$nav = html_nav_bar("utilities.php?action=view_snmpagent_events&severity=" . get_request_var_request("severity") . "&receiver=" . get_request_var_request("receiver") . "&filter=" . get_request_var_request("filter"), MAX_DISPLAY_PAGES, get_request_var_request("page"), get_request_var_request("rows"), $total_rows, 11, '', 'page', 'main');
print $nav;
html_header(array(" ", "Time", "Receiver", "Notification", "Varbinds"));
if (sizeof($logs) > 0) {
foreach ($logs as $item) {
$varbinds = strlen(get_request_var_request("filter")) ? preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["varbinds"]) : $item["varbinds"];
form_alternate_row('line' . $item["id"], false);
print "<td title='Severity Level: " . $severity_levels[$item["severity"]] . "' style='width:10px;background-color: " . $severity_colors[$item["severity"]] . ";border-top:1px solid white;border-bottom:1px solid white;'></td>";
print "<td style='white-space: nowrap;'>" . date("Y/m/d H:i:s", $item["time"]) . "</td>";
print "<td>" . $item["hostname"] . "</td>";
if ($item["description"]) {
print '<td><a href="#" title="<div class=\'header\'>' . $item["notification"] . '</div><div class=\'content preformatted\'>' . $item["description"] . '</div>" class="tooltip">' . $item["notification"] . '</a></td>';
} else {
print "<td>{$item["notification"]}</td>";
}
print "<td>{$varbinds}</td>";
form_end_row();
}
print $nav;
} else {
print "<tr><td><em>No SNMP Notification Log Entries</em></td></tr>";
}
html_end_box();
?>
<script language="javascript" type="text/javascript" >
$('.tooltip').tooltip({
track: true,
position: { collision: "flipfit" },
content: function() { return $(this).attr('title'); }
});
</script>
<?php
}
开发者ID:MrWnn,项目名称:cacti,代码行数:101,代码来源:utilities.php
示例5: mactrack_site
function mactrack_site()
{
global $site_actions, $config, $item_rows;
mactrack_site_validate_req_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 Site Filters'), '100%', '', '3', 'center', 'mactrack_sites.php?action=edit');
mactrack_site_filter();
html_end_box();
$sql_where = '';
$sites = mactrack_site_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 = db_fetch_cell("SELECT count(*)\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");
}
if (get_request_var('detail') == 'false') {
$nav = html_nav_bar('mactrack_sites.php?filter=' . get_request_var('filter'), MAX_DISPLAY_PAGES, get_filter_request_var('page'), $row_limit, $total_rows, 9, __('Sites'));
print $nav;
html_start_box('', '100%', '', '3', 'center', '');
$display_text = array('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_checkbox($display_text, get_request_var('sort_column'), get_request_var('sort_direction'));
$i = 0;
if (sizeof($sites)) {
foreach ($sites as $site) {
form_alternate_row('line' . $site['site_id'], true);
form_selectable_cell("<a class='linkEditMain' href='mactrack_sites.php?action=edit&site_id=" . $site['site_id'] . "'>" . (get_request_var('filter') != '' ? preg_replace('/(' . preg_quote(get_request_var('filter')) . ')/i', "<span class='filteredValue'>\\1</span>", $site['site_name']) : $site['site_name']) . '</a>', $site['site_id']);
form_selectable_cell(number_format_i18n($site['total_devices']), $site['site_id']);
form_selectable_cell(number_format_i18n($site['total_ips']), $site['site_id']);
form_selectable_cell(number_format_i18n($site['total_user_ports']), $site['site_id']);
form_selectable_cell(number_format_i18n($site['total_oper_ports']), $site['site_id']);
form_selectable_cell(number_format_i18n($site['total_macs']), $site['site_id']);
form_selectable_cell($site['total_device_errors'], $site['site_id']);
form_checkbox_cell($site['site_name'], $site['site_id']);
form_end_row();
}
} else {
print '<tr><td><em>' . __('No MacTrack Sites') . '</em></td></tr>';
}
html_end_box(false);
if (sizeof($sites)) {
print $nav;
}
} else {
$nav = html_nav_bar('mactrack_sites.php?filter=' . get_request_var('filter'), MAX_DISPLAY_PAGES, get_filter_request_var('page'), $row_limit, $total_rows, 10, __('Sites'));
print $nav;
html_start_box('', '100%', '', '3', 'center', '');
$display_text = array('site_name' => array(__('Site Name'), 'ASC'), 'vendor' => array(__('Vendor'), 'ASC'), 'description' => array(__('Device Type'), 'DESC'), 'total_devices' => array(__('Total Devices'), 'DESC'), 'sum_ips_total' => array(__('Total IP\'s'), 'DESC'), 'sum_ports_total' => array(__('Total User Ports'), 'DESC'), 'sum_ports_active' => array(__('Total Oper Ports'), 'DESC'), 'sum_ports_trunk' => array(__('Total Trunks'), 'DESC'), 'sum_macs_active' => array(__('MACS Found'), 'DESC'));
html_header_sort($display_text, get_request_var('sort_column'), get_request_var('sort_direction'));
if (sizeof($sites)) {
foreach ($sites as $site) {
form_alternate_row();
?>
<td width=200>
<a class='linkEditMain' href='mactrack_sites.php?action=edit&site_id=<?php
print $site['site_id'];
?>
'><?php
print get_request_var('filter') != '' ? preg_replace('/(' . preg_quote(get_request_var('filter')) . ')/i', "<span class='filteredValue'>\\1</span>", $site['site_name']) : $site['site_name'];
?>
</a>
</td>
<td><?php
print get_request_var('filter') != '' ? preg_replace('/(' . preg_quote(get_request_var('filter')) . ')/i', "<span class='filteredValue'>\\1</span>", $site['vendor']) : $site['vendor'];
?>
</td>
<td><?php
print get_request_var('filter') != '' ? preg_replace('/(' . preg_quote(get_request_var('filter')) . ')/i', "<span class='filteredValue'>\\1</span>", $site['description']) : $site['description'];
?>
</td>
<td><?php
print number_format_i18n($site['total_devices']);
?>
</td>
<td><?php
print number_format_i18n($site['sum_ips_total']);
?>
</td>
<td><?php
print number_format_i18n($site['sum_ports_total']);
?>
</td>
<td><?php
print number_format_i18n($site['sum_ports_active']);
?>
</td>
<td><?php
print number_format_i18n($site['sum_ports_trunk']);
?>
</td>
<td><?php
print number_format_i18n($site['sum_macs_active']);
?>
</td>
</tr>
//.........这里部分代码省略.........
开发者ID:Cacti,项目名称:plugin_mactrack,代码行数:101,代码来源:mactrack_sites.php
示例6: 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";
}
开发者ID:teddywen,项目名称:cacti,代码行数:101,代码来源:plugins.php
示例7: basename
}else{
$nav_url = basename($_SERVER["PHP_SELF"]) . "?" . $_SERVER["QUERY_STRING"] . "&page=<PAGE>&host_id=" . $_REQUEST["host_id"];
}
$nav_url = ereg_replace("((\?|&)host_id=[0-9]+|(\?|&)filter=[a-zA-Z0-9]*)", "", $nav_url);
html_graph_start_box(1, true);
html_nav_bar($colors["header_panel"], read_graph_config_option("num_columns"), $_REQUEST["page"], ROWS_PER_PAGE, $total_rows, $nav_url);
if (read_graph_config_option("thumbnail_section_preview") == "on") {
html_graph_thumbnail_area($graphs, "","graph_start=" . get_current_graph_start() . "&graph_end=" . get_current_graph_end());
}else{
html_graph_area($graphs, "", "graph_start=" . get_current_graph_start() . "&graph_end=" . get_current_graph_end());
}
html_nav_bar($colors["header_panel"], read_graph_config_option("num_columns"), $_REQUEST["page"], ROWS_PER_PAGE, $total_rows, $nav_url);
html_graph_end_box();
print "<br><br>";
break;
case 'list':
define("ROWS_PER_PAGE", read_graph_config_option("list_graphs_per_page"));
if ((read_config_option("auth_method") != 0) && (empty($current_user["show_list"]))) {
print "<strong><font size='+1' color='FF0000'>YOU DO NOT HAVE RIGHTS FOR LIST VIEW</font></strong>"; exit;
}
开发者ID:songchin,项目名称:Cacti,代码行数:31,代码来源:graph_view.php
示例8: data_query
//.........这里部分代码省略.........
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>
<script type='text/javascript'>
function applyFilter() {
strURL = 'data_queries.php?filter='+$('#filter').val()+'&rows='+$('#rows').val()+'&page='+$('#page').val()+'&header=false';
$.get(strURL, function(data) {
$('#main').html(data);
applySkin();
});
}
function clearFilter() {
strURL = 'data_queries.php?clear_x=1&header=false';
$.get(strURL, function(data) {
$('#main').html(data);
applySkin();
});
}
$(function() {
$('#refresh').click(function() {
applyFilter();
});
$('#clear').click(function() {
clearFilter();
});
$('#form_data_queries').submit(function(event) {
event.preventDefault();
applyFilter();
});
});
</script>
</td>
</tr>
<?php
html_end_box();
/* print checkbox form for validation */
print "<form name='chk' method='post' action='data_queries.php'>\n";
html_start_box('', '100%', '', '3', 'center', '');
/* form the 'where' clause for our main sql query */
if (strlen(get_request_var_request('filter'))) {
$sql_where = "WHERE (sq.name like '%%" . get_request_var_request('filter') . "%%' OR di.name like '%%" . get_request_var_request('filter') . "%%')";
} else {
$sql_where = '';
}
$total_rows = db_fetch_cell("SELECT\n\t\tCOUNT(*)\n\t\tFROM snmp_query AS sq\n\t\tINNER JOIN data_input AS di\n\t\tON (sq.data_input_id=di.id)\n\t\t{$sql_where}");
$snmp_queries = db_fetch_assoc("SELECT sq.id, sq.name,\n\t\tdi.name AS data_input_method, \n\t\tCOUNT(DISTINCT gl.id) AS graphs,\n\t\tCOUNT(DISTINCT sqg.graph_template_id) AS templates\n\t\tFROM snmp_query AS sq\n\t\tLEFT JOIN snmp_query_graph AS sqg\n\t\tON sq.id=sqg.snmp_query_id\n\t\tLEFT JOIN data_input AS di\n\t\tON (sq.data_input_id=di.id)\n\t\tLEFT JOIN graph_local AS gl\n\t\tON gl.snmp_query_id=sq.id\n\t\t{$sql_where}\n\t\tGROUP BY sq.id\n\t\tORDER BY " . get_request_var_request('sort_column') . ' ' . get_request_var_request('sort_direction') . '
LIMIT ' . get_request_var_request('rows') * (get_request_var_request('page') - 1) . ',' . get_request_var_request('rows'));
$nav = html_nav_bar('data_queries.php?filter=' . get_request_var_request('filter'), MAX_DISPLAY_PAGES, get_request_var_request('page'), get_request_var_request('rows'), $total_rows, 7, 'Data Queries', 'page', 'main');
print $nav;
$display_text = array('name' => array('display' => 'Data Query Name', 'align' => 'left', 'sort' => 'ASC', 'tip' => 'The name of this Data Query.'), 'nosort' => array('display' => 'Deletable', 'align' => 'right', 'tip' => 'Data Queries that are in use can not be Deleted. In use is defined as being referenced by either a Graph or a Graph Template.'), 'graphs' => array('display' => 'Graphs Using', 'align' => 'right', 'sort' => 'DESC', 'tip' => 'The number of Graphs using this Data Query.'), 'templates' => array('display' => 'Templates Using', 'align' => 'right', 'sort' => 'DESC', 'tip' => 'The number of Graphs Templates using this Data Query.'), 'data_input_method' => array('display' => 'Data Input Method', 'align' => 'left', 'sort' => 'ASC', 'tip' => 'The Data Input Method used to collect data for Data Sources associated with this Data Query.'), 'id' => array('display' => 'ID', 'align' => 'right', 'sort' => 'ASC', 'tip' => 'The internal ID for this Graph Template. Useful when performing automation or debugging.'));
html_header_sort_checkbox($display_text, get_request_var_request('sort_column'), get_request_var_request('sort_direction'), false);
$i = 0;
if (sizeof($snmp_queries) > 0) {
foreach ($snmp_queries as $snmp_query) {
if ($snmp_query['graphs'] == 0 && $snmp_query['templates'] == 0) {
$disabled = false;
} else {
$disabled = true;
}
form_alternate_row('line' . $snmp_query['id'], true, $disabled);
form_selectable_cell("<a class='linkEditMain' href='" . htmlspecialchars('data_queries.php?action=edit&id=' . $snmp_query['id']) . "'>" . (strlen(get_request_var_request('filter')) ? preg_replace('/(' . preg_quote(get_request_var_request('filter'), '/') . ')/i', "<span class='filteredValue'>\\1</span>", htmlspecialchars($snmp_query['name'])) : htmlspecialchars($snmp_query['name'])) . '</a>', $snmp_query['id']);
form_selectable_cell($disabled ? 'No' : 'Yes', $snmp_query['id'], '', 'text-align:right');
form_selectable_cell(number_format($snmp_query['graphs']), $snmp_query['id'], '', 'text-align:right');
form_selectable_cell(number_format($snmp_query['templates']), $snmp_query['id'], '', 'text-align:right');
form_selectable_cell(strlen(get_request_var_request('filter')) ? preg_replace('/(' . preg_quote(get_request_var_request('filter'), '/') . ')/i', "<span class='filteredValue'>\\1</span>", $snmp_query['data_input_method']) : $snmp_query['data_input_method'], $snmp_query['id']);
form_selectable_cell($snmp_query['id'], $snmp_query['id'], '', 'text-align:right;');
form_checkbox_cell($snmp_query['name'], $snmp_query['id'], $disabled);
form_end_row();
}
print $nav;
} else {
print "<tr class='tableRow'><td colspan='5'><em>No Data Queries</em></td></tr>";
}
html_end_box(false);
/* draw the dropdown containing a list of available actions for this form */
draw_actions_dropdown($dq_actions);
}
开发者ID:MrWnn,项目名称:cacti,代码行数:101,代码来源:data_queries.php
示例9: domains
//.........这里部分代码省略.........
print "<option value='" . $key . "'";
if (get_request_var_request('rows') == $key) {
print ' selected';
}
print '>' . htmlspecialchars($value) . "</option>\n";
}
}
?>
</select>
</td>
<td>
<input id='refresh' type='button' value='Go' title='Set/Refresh Filters'>
</td>
<td>
<input id='clear' type='button' name='clear_x' value='Clear' title='Clear Filters'>
</td>
</tr>
</table>
<input type='hidden' name='page' value='<?php
print $_REQUEST['page'];
?>
'>
</form>
<script type='text/javascript'>
function applyFilter() {
strURL = 'user_domains.php?rows=' + $('#rows').val();
strURL = strURL + '&filter=' + $('#filter').val();
strURL = strURL + '&page=' + $('#page').val();
strURL = strURL + '&header=false';
$.get(strURL, function(data) {
$('#main').html(data);
applySkin();
});
}
function clearFilter() {
strURL = 'user_domains.php?clear_x=1&header=false';
$.get(strURL, function(data) {
$('#main').html(data);
applySkin();
});
}
$(function(data) {
$('#refresh').click(function() {
applyFilter();
});
$('#clear').click(function() {
clearFilter();
});
$('#form_domains').submit(function(event) {
event.preventDefault();
applyFilter();
});
});
</script>
</td>
</tr>
<?php
html_end_box();
/* print checkbox form for validation */
print "<form name='chk' method='post' action='user_domains.php'>\n";
html_start_box('', '100%', '', '3', 'center', '');
/* form the 'where' clause for our main sql query */
if ($_REQUEST['filter'] != '') {
$sql_where = "WHERE (domain_name LIKE '%%" . get_request_var_request('filter') . "%%') ||\n\t\t\t(type LIKE '%%" . get_request_var_request('filter') . "%%')";
} else {
$sql_where = '';
}
$total_rows = db_fetch_cell("SELECT\n\t\tcount(*)\n\t\tFROM user_domains\n\t\t{$sql_where}");
$domains = db_fetch_assoc("SELECT *\n\t\tFROM user_domains\n\t\t{$sql_where}\n\t\tORDER BY " . get_request_var_request('sort_column') . ' ' . get_request_var_request('sort_direction') . '
LIMIT ' . get_request_var_request('rows') * (get_request_var_request('page') - 1) . ',' . get_request_var_request('rows'));
$nav = html_nav_bar('user_user_domains.php?filter=' . get_request_var_request('filter'), MAX_DISPLAY_PAGES, get_request_var_request('page'), get_request_var_request('rows'), $total_rows, 6, 'User Domains', 'page', 'main');
print $nav;
$display_text = array('domain_name' => array('Domain Name', 'ASC'), 'type' => array('Domain Type', 'ASC'), 'defdomain' => array('Default', 'ASC'), 'user_id' => array('Effective User', 'ASC'), 'enabled' => array('Enabled', 'ASC'));
html_header_sort_checkbox($display_text, get_request_var_request('sort_column'), get_request_var_request('sort_direction'), false);
$i = 0;
if (sizeof($domains) > 0) {
foreach ($domains as $domain) {
/* hide system types */
form_alternate_row('line' . $domain['domain_id'], true);
form_selectable_cell("<a class='linkEditMain' href='" . htmlspecialchars('user_domains.php?action=edit&domain_id=' . $domain['domain_id']) . "'>" . (strlen(get_request_var_request('filter')) ? eregi_replace('(' . preg_quote(get_request_var_request('filter')) . ')', "<span class='filteredValue>\\1</span>", $domain['domain_name']) : $domain['domain_name']) . '</a>', $domain['domain_id']);
form_selectable_cell($domain_types[$domain['type']], $domain['domain_id']);
form_selectable_cell($domain['defdomain'] == '0' ? '--' : 'Yes', $domain['domain_id']);
form_selectable_cell($domain['user_id'] == '0' ? 'None Selected' : db_fetch_cell_prepared('SELECT username FROM user_auth WHERE id = ?', array($domain['user_id'])), $domain['domain_id']);
form_selectable_cell($domain['enabled'] == 'on' ? 'Yes' : 'No', $domain['domain_id']);
form_checkbox_c
|
请发表评论