本文整理汇总了PHP中form_selectable_cell函数的典型用法代码示例。如果您正苦于以下问题:PHP form_selectable_cell函数的具体用法?PHP form_selectable_cell怎么用?PHP form_selectable_cell使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了form_selectable_cell函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: templates
function templates()
{
global $config, $colors, $ds_actions;
html_start_box('<strong>GPS Templates</strong>', '100%', $colors['header'], '3', 'center', 'gpstemplates.php?action=add');
html_header_checkbox(array('Host Template', 'Up Image', 'Recovering Image', 'Down Image', 'Is AP'));
$template_list = db_fetch_assoc('SELECT * FROM gpsmap_templates ORDER BY templateID');
$i = 0;
if (sizeof($template_list) > 0) {
foreach ($template_list as $template) {
if ($template['AP']) {
$isAP = "True";
} else {
$isAP = "False";
}
form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $template["templateID"]);
$i++;
form_selectable_cell($template['templateName'], $template["templateID"]);
form_selectable_cell($template['upimage'], $template["templateID"]);
form_selectable_cell($template['recoverimage'], $template["templateID"]);
form_selectable_cell($template['downimage'], $template["templateID"]);
form_selectable_cell($isAP, $template["templateID"]);
form_checkbox_cell($template['templateID'], $template["templateID"]);
form_end_row();
}
} else {
print "<tr><td><em>No Data Templates</em></td></tr>\n";
}
html_end_box(false);
/* draw the dropdown containing a list of available actions for this form */
draw_actions_dropdown($ds_actions);
print "</form>\n";
}
示例2: 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_cell($domain['domain_name'], $domain['domain_id']);
form_end_row();
}
print $nav;
} else {
print '<tr><td><em>No User Domains Defined</em></td></tr>';
}
html_end_box(false);
/* draw the dropdown containing a list of available actions for this form */
draw_actions_dropdown($actions);
print "</form>\n";
}
示例3: template
function template()
{
global $ds_actions;
/* ================= input validation ================= */
input_validate_input_number(get_request_var_request("page"));
/* ==================================================== */
/* clean up search string */
if (isset($_REQUEST["filter"])) {
$_REQUEST["filter"] = sanitize_search_string(get_request_var("filter"));
}
/* clean up sort_column string */
if (isset($_REQUEST["sort_column"])) {
$_REQUEST["sort_column"] = sanitize_search_string(get_request_var("sort_column"));
}
/* clean up sort_direction string */
if (isset($_REQUEST["sort_direction"])) {
$_REQUEST["sort_direction"] = sanitize_search_string(get_request_var("sort_direction"));
}
/* if the user pushed the 'clear' button */
if (isset($_REQUEST["clear_x"])) {
kill_session_var("sess_data_template_current_page");
kill_session_var("sess_data_template_filter");
kill_session_var("sess_data_template_sort_column");
kill_session_var("sess_data_template_sort_direction");
unset($_REQUEST["page"]);
unset($_REQUEST["filter"]);
unset($_REQUEST["sort_column"]);
unset($_REQUEST["sort_direction"]);
}
/* remember these search fields in session vars so we don't have to keep passing them around */
load_current_session_value("page", "sess_data_template_current_page", "1");
load_current_session_value("filter", "sess_data_template_filter", "");
load_current_session_value("sort_column", "sess_data_template_sort_column", "name");
load_current_session_value("sort_direction", "sess_data_template_sort_direction", "ASC");
html_start_box("<strong>Data Templates</strong>", "100%", "", "3", "center", "data_templates.php?action=template_edit");
?>
<tr class='even noprint'>
<td>
<form name="form_data_template" action="data_templates.php">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<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" 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'>
</form>
</td>
</tr>
<?php
html_end_box();
/* form the 'where' clause for our main sql query */
$sql_where = "WHERE data_template.id=data_template_data.data_template_id AND data_template_data.local_data_id=0";
$rows_where = "";
if (strlen($_REQUEST['filter'])) {
$sql_where .= " AND (data_template.name like '%%" . get_request_var_request("filter") . "%%')";
$rows_where = "WHERE (data_template.name like '%%" . get_request_var_request("filter") . "%%')";
}
/* print checkbox form for validation */
print "<form name='chk' method='post' action='data_templates.php'>\n";
html_start_box("", "100%", "", "3", "center", "");
$total_rows = db_fetch_cell("SELECT\n\t\tCOUNT(data_template.id)\n\t\tFROM data_template\n\t\t{$rows_where}");
$template_list = db_fetch_assoc("SELECT\n\t\tdata_template.id,\n\t\tdata_template.name,\n\t\tdata_input.name AS data_input_method,\n\t\tdata_template_data.active AS active\n\t\tFROM (data_template,data_template_data)\n\t\tLEFT JOIN data_input\n\t\tON (data_template_data.data_input_id = data_input.id)\n\t\t{$sql_where}\n\t\tGROUP BY data_template.id\n\t\tORDER BY " . get_request_var_request("sort_column") . " " . get_request_var_request("sort_direction") . " LIMIT " . read_config_option("num_rows_device") * (get_request_var_request("page") - 1) . "," . read_config_option("num_rows_device"));
$nav = html_nav_bar("data_templates.php?filter=" . get_request_var_request("filter"), MAX_DISPLAY_PAGES, get_request_var_request("page"), read_config_option("num_rows_device"), $total_rows, 5);
print $nav;
$display_text = array("name" => array("Template Name", "ASC"), "id" => array("ID", "ASC"), "data_input_method" => array("Data Input Method", "ASC"), "active" => array("Status", "ASC"));
html_header_sort_checkbox($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction"), false);
if (sizeof($template_list) > 0) {
foreach ($template_list as $template) {
form_alternate_row('line' . $template["id"], true);
form_selectable_cell("<a class='linkEditMain' href='" . htmlspecialchars("data_templates.php?action=template_edit&id=" . $template["id"]) . "'>" . (strlen(get_request_var_request("filter")) ? preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", htmlspecialchars($template["name"])) : htmlspecialchars($template["name"])) . "</a>", $template["id"]);
form_selectable_cell($template['id'], $template["id"]);
form_selectable_cell(empty($template["data_input_method"]) ? "<em>None</em>" : htmlspecialchars($template["data_input_method"]), $template["id"]);
form_selectable_cell($template["active"] == "on" ? "Active" : "Disabled", $template["id"]);
form_checkbox_cell($template["name"], $template["id"]);
form_end_row();
}
/* put the nav bar on the bottom as well */
print $nav;
} else {
print "<tr><td><em>No Data Templates</em></td></tr>\n";
}
html_end_box(false);
/* draw the dropdown containing a list of available actions for this form */
draw_actions_dropdown($ds_actions);
print "</form>\n";
}
示例4: template
//.........这里部分代码省略.........
>
</td>
<td>
<label for='has_hosts' style='white-space:nowrap;'>Has Devices</label>
</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>
<script type='text/javascript'>
function applyFilter() {
strURL = 'host_templates.php?filter='+$('#filter').val()+'&rows='+$('#rows').val()+'&page='+$('#page').val()+'&has_hosts='+$('#has_hosts').is(':checked')+'&header=false';
$.get(strURL, function(data) {
$('#main').html(data);
applySkin();
});
}
function clearFilter() {
strURL = 'host_templates.php?clear_x=1&header=false';
$.get(strURL, function(data) {
$('#main').html(data);
applySkin();
});
}
$(function() {
$('#refresh, #has_hosts').click(function() {
applyFilter();
});
$('#clear').click(function() {
clearFilter();
});
$('#form_host_template').submit(function(event) {
event.preventDefault();
applyFilter();
});
});
</script>
</tr>
<?php
html_end_box();
/* form the 'where' clause for our main sql query */
if (strlen($_REQUEST['filter'])) {
$sql_where = "WHERE (host_template.name LIKE '%%" . get_request_var_request('filter') . "%%')";
} else {
$sql_where = '';
}
/* print checkbox form for validation */
print "<form name='chk' method='post' action='host_templates.php'>\n";
html_start_box('', '100%', '', '3', 'center', '');
if ($_REQUEST['has_hosts'] == 'true') {
$sql_having = 'HAVING hosts>0';
} else {
$sql_having = '';
}
$total_rows = db_fetch_cell("SELECT COUNT(rows)\n\t\tFROM (\n\t\t\tSELECT\n\t\t\tCOUNT(host_template.id) AS rows, COUNT(DISTINCT host.id) AS hosts\n\t\t\tFROM host_template\n\t\t\tLEFT JOIN host ON host.host_template_id=host_template.id\n\t\t\t{$sql_where}\n\t\t\tGROUP BY host_template.id\n\t\t\t{$sql_having}\n\t\t) AS rs");
$template_list = db_fetch_assoc("SELECT\n\t\thost_template.id,host_template.name, COUNT(DISTINCT host.id) AS hosts\n\t\tFROM host_template\n\t\tLEFT JOIN host ON host.host_template_id=host_template.id\n\t\t{$sql_where}\n\t\tGROUP BY host_template.id\n\t\t{$sql_having}\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('host_templates.php?filter=' . get_request_var_request('filter'), MAX_DISPLAY_PAGES, get_request_var_request('page'), get_request_var_request('rows'), $total_rows, 5, 'Device Templates', 'page', 'main');
print $nav;
$display_text = array('name' => array('display' => 'Device Template Name', 'align' => 'left', 'sort' => 'ASC', 'tip' => 'The name of this Device Template.'), "nosort" => array('display' => 'Deletable', 'align' => 'right', 'sort' => '', 'tip' => 'Device Templates in use can not be Deleted. In use is defined as being referenced by a Device.'), 'hosts' => array('display' => 'Devices Using', 'align' => 'right', 'sort' => 'DESC', 'tip' => 'The number of Devices using this Device Template.'), 'host_template.id' => array('display' => 'ID', 'align' => 'right', 'sort' => 'ASC', 'tip' => 'The internal database ID for this Device 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($template_list) > 0) {
foreach ($template_list as $template) {
if ($template['hosts'] > 0) {
$disabled = true;
} else {
$disabled = false;
}
form_alternate_row('line' . $template['id'], true, $disabled);
form_selectable_cell("<a class='linkEditMain' href='" . htmlspecialchars('host_templates.php?action=edit&id=' . $template['id']) . "'>" . (strlen(get_request_var_request('filter')) ? preg_replace('/(' . preg_quote(get_request_var_request('filter'), '/') . ')/i', "<span class='filteredValue'>\\1</span>", htmlspecialchars($template['name'])) : htmlspecialchars($template['name'])) . '</a>', $template['id']);
form_selectable_cell($disabled ? 'No' : 'Yes', $template['id'], '', 'text-align:right');
form_selectable_cell(number_format($template['hosts']), $template['id'], '', 'text-align:right');
form_selectable_cell($template['id'], $template['id'], '', 'text-align:right');
form_checkbox_cell($template['name'], $template['id'], $disabled);
form_end_row();
}
/* put the nav bar on the bottom as well */
print $nav;
} else {
print "<tr class='tableRow'><td colspan='4'><em>No Device Templates</em></td></tr>\n";
}
html_end_box(false);
/* draw the dropdown containing a list of available actions for this form */
draw_actions_dropdown($host_actions);
print "</form>\n";
}
示例5: snmpagent_utilities_run_cache
//.........这里部分代码省略.........
?>
" 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="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();
$sql_where = "";
/* filter by host */
if (get_request_var_request("mib") == "-1") {
/* Show all items */
} elseif (!empty($_REQUEST["mib"])) {
$sql_where .= " AND snmpagent_cache.mib='" . get_request_var_request("mib") . "'";
}
/* filter by search string */
if (get_request_var_request("filter") != "") {
$sql_where .= " AND (`oid` LIKE '%%" . get_request_var_request("filter") . "%%'\n\t\t\tOR `name` LIKE '%%" . get_request_var_request("filter") . "%%'\n\t\t\tOR `mib` LIKE '%%" . get_request_var_request("filter") . "%%'\n\t\t\tOR `max-access` LIKE '%%" . get_request_var_request("filter") . "%%')";
}
$sql_where .= ' ORDER by `oid`';
html_start_box("", "100%", "", "3", "center", "");
$total_rows = db_fetch_cell("SELECT COUNT(*) FROM snmpagent_cache WHERE 1 {$sql_where}");
$snmp_cache_sql = "SELECT * FROM snmpagent_cache WHERE 1 {$sql_where} LIMIT " . get_request_var_request("rows") * (get_request_var_request("page") - 1) . "," . get_request_var_request("rows");
$snmp_cache = db_fetch_assoc($snmp_cache_sql);
/* generate page list */
$nav = html_nav_bar("utilities.php?action=view_snmpagent_cache&mib=" . get_request_var_request("mib") . "&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("OID", "Name", "MIB", "Kind", "Max-Access", "Value"));
if (sizeof($snmp_cache) > 0) {
foreach ($snmp_cache as $item) {
$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["oid"]) : $item["oid"];
$name = 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"]) : $item["name"];
$mib = strlen(get_request_var_request("filter")) ? preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["mib"]) : $item["mib"];
$max_access = strlen(get_request_var_request("filter")) ? preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["max-access"]) : $item["max-access"];
form_alternate_row('line' . $item["oid"], false);
form_selectable_cell($oid, $item["oid"]);
if ($item["description"]) {
print '<td><a href="#" title="<div class=\'header\'>' . $name . '</div><div class=\'content preformatted\'>' . $item["description"] . '</div>" class="tooltip">' . $name . '</a></td>';
} else {
print "<td>{$name}</td>";
}
form_selectable_cell($mib, $item["oid"]);
form_selectable_cell($item["kind"], $item["oid"]);
form_selectable_cell($max_access, $item["oid"]);
form_selectable_cell(in_array($item["kind"], array("Scalar", "Column Data")) ? $item["value"] : "n/a", $item["oid"]);
form_end_row();
}
}
print $nav;
html_end_box();
?>
<script language="javascript" type="text/javascript" >
$('.tooltip').tooltip({
track: true,
show: 250,
hide: 250,
position: { collision: "flipfit" },
content: function() { return $(this).attr('title'); }
});
</script>
<?php
}
示例6: webseer_urls
//.........这里部分代码省略.........
</td>
<td>
<label for='associated'><?php
print __('Associated');
?>
</label>
</td>
<td>
<input type='button' value='<?php
print __('Go');
?>
' onClick='applyFilter()' title='<?php
print __('Set/Refresh Filters');
?>
'>
</td>
<td>
<input type='button' name='clear' value='<?php
print __('Clear');
?>
' onClick='clearFilter()' title='<?php
print __('Clear Filters');
?>
'>
</td>
</tr>
</table>
<input type='hidden' name='page' value='<?php
print get_request_var('page');
?>
'>
<input type='hidden' name='id' value='<?php
print get_request_var('id');
?>
'>
</form>
</td>
</tr>
<?php
html_end_box();
/* form the 'where' clause for our main sql query */
if (strlen(get_request_var('filter'))) {
$sql_where = "WHERE ((u.url LIKE '%" . get_request_var('filter') . "%') \n\t\t\tOR (u.display_name LIKE '%" . get_request_var('filter') . "%') \n\t\t\tOR (u.ip LIKE '%" . get_request_var('filter') . "%'))";
} else {
$sql_where = '';
}
if (get_request_var('associated') == 'false') {
$sql_where .= (strlen($sql_where) ? ' AND ' : 'WHERE ') . ' (pmh.type=2 OR pmh.type IS NULL)';
} else {
$sql_where .= (strlen($sql_where) ? ' AND ' : 'WHERE ') . ' pmh.type=2 AND pmh.schedule=' . get_request_var('id');
}
$total_rows = db_fetch_cell("SELECT\n\t\tCOUNT(*)\n\t\tFROM plugin_webseer_urls AS u\n\t\tLEFT JOIN plugin_maint_hosts AS pmh\n\t\tON u.id=pmh.host\n\t\t{$sql_where}");
$sql_query = "SELECT u.*, pmh.host AS associated, pmh.type AS maint_type\n\t\tFROM plugin_webseer_urls AS u\n\t\tLEFT JOIN plugin_maint_hosts AS pmh\n\t\tON u.id=pmh.host\n\t\t{$sql_where} \n\t\tLIMIT " . $rows * (get_request_var('page') - 1) . ',' . $rows;
$urls = db_fetch_assoc($sql_query);
$nav = html_nav_bar('notify_lists.php?action=edit&id=' . get_request_var('id'), MAX_DISPLAY_PAGES, get_request_var('page'), $rows, $total_rows, 13, __('Lists'), 'page', 'main');
form_start('maint.php', 'chk');
print $nav;
html_start_box('', '100%', '', '3', 'center', '');
$display_text = array(__('Description'), __('ID'), __('Associated Schedules'), __('Enabled'), __('Hostname'), __('URL'));
html_header_checkbox($display_text);
if (sizeof($urls)) {
foreach ($urls as $url) {
form_alternate_row('line' . $url['id']);
form_selectable_cell(strlen(get_request_var('filter')) ? preg_replace('/(' . preg_quote(get_request_var('filter')) . ')/i', "<span class='filteredValue'>\\1</span>", htmlspecialchars($url['display_name'])) : htmlspecialchars($url['display_name']), $url['id'], 250);
form_selectable_cell(round($url['id'], 2), $url['id']);
if ($url['associated'] != '' && $url['maint_type'] == '2') {
form_selectable_cell('<span class="deviceUp">' . __('Current Schedule') . '</span>', $url['id']);
} else {
if (sizeof($lists = db_fetch_assoc('SELECT name FROM plugin_maint_schedules INNER JOIN plugin_maint_hosts ON plugin_maint_schedules.id=plugin_maint_hosts.schedule WHERE type=2 AND host=' . $url['id']))) {
$names = '';
foreach ($lists['name'] as $name) {
$names .= (strlen($names) ? ', ' : '') . "<span class='deviceRecovering'>{$name}</span>";
}
form_selectable_cell($names, $url['id']);
} else {
form_selectable_cell('<span class="deviceUnknown">' . __('No Schedules') . '</span>', $url['id']);
}
}
form_selectable_cell($url['enabled'] == 'on' ? __('Enabled') : __('Disabled'), $url['id']);
if (empty($url['ip'])) {
$url['ip'] = __('USING DNS');
}
form_selectable_cell(strlen(get_request_var('filter')) ? preg_replace('/(' . preg_quote(get_request_var('filter')) . ')/i', "<span class='filteredValue'>\\1</span>", '<i>' . htmlspecialchars($url['ip'])) . '</i>' : '<i>' . htmlspecialchars($url['ip']) . '</i>', $url['id']);
form_selectable_cell(strlen(get_request_var('filter')) ? preg_replace('/(' . preg_quote(get_request_var('filter')) . ')/i', "<span class='filteredValue'>\\1</span>", htmlspecialchars($url['url'])) : htmlspecialchars($url['url']), $url['id']);
form_checkbox_cell($url['display_name'], $url['id']);
form_end_row();
}
} else {
print "<tr><td><em>" . __('No Associated WebSeer URL\'s Found') . "</em></td></tr>";
}
html_end_box(false);
if (sizeof($urls)) {
print $nav;
}
form_hidden_box('id', get_request_var('id'), '');
form_hidden_box('save_webseer', '1', '');
/* draw the dropdown containing a list of available actions for this form */
draw_actions_dropdown($assoc_actions);
form_end();
}
示例7: data_query
//.........这里部分代码省略.........
html_start_box("<strong>Data Queries</strong>", "100%", $colors["header"], "3", "center", "data_queries.php?action=edit");
?>
<tr bgcolor="<?php print $colors["panel"];?>" class="noprint">
<form name="form_graph_id" method="get">
<td class="noprint">
<table width="100%" cellpadding="0" cellspacing="0">
<tr class="noprint">
<td nowrap style='white-space: nowrap;' width="50">
Search:
</td>
<td width="1">
<input type="text" name="filter" size="40" value="<?php print get_request_var_request("filter");?>">
</td>
<td nowrap style='white-space: nowrap;'>
<input type="image" src="images/button_go.gif" alt="Go" border="0" align="absmiddle">
<input type="image" src="images/button_clear.gif" name="clear" alt="Clear" border="0" align="absmiddle">
</td>
</tr>
</table>
</td>
<input type='hidden' name='page' value='1'>
</form>
</tr>
<?php
html_end_box();
html_start_box("", "100%", $colors["header"], "3", "center", "");
/* form the 'where' clause for our main sql query */
if (strlen(get_request_var_request("filter"))) {
$sql_where = "where (snmp_query.name like '%%" . get_request_var_request("filter") . "%%' OR data_input.name like '%%" . get_request_var_request("filter") . "%%')";
}else{
$sql_where = "";
}
$total_rows = db_fetch_cell("SELECT
count(*)
FROM snmp_query INNER JOIN data_input ON (snmp_query.data_input_id=data_input.id)
$sql_where");
$snmp_queries = db_fetch_assoc("SELECT
snmp_query.id,
snmp_query.name,
data_input.name AS data_input_method
FROM snmp_query INNER JOIN data_input ON (snmp_query.data_input_id=data_input.id)
$sql_where
ORDER BY " . get_request_var_request("sort_column") . " " . get_request_var_request("sort_direction") . "
LIMIT " . (read_config_option("num_rows_device")*(get_request_var_request("page")-1)) . "," . read_config_option("num_rows_device"));
/* generate page list */
$url_page_select = get_page_list(get_request_var_request("page"), MAX_DISPLAY_PAGES, read_config_option("num_rows_device"), $total_rows, "data_queries.php?filter=" . get_request_var_request("filter"));
$nav = "<tr bgcolor='#" . $colors["header"] . "'>
<td colspan='7'>
<table width='100%' cellspacing='0' cellpadding='0' border='0'>
<tr>
<td align='left' class='textHeaderDark'>
<strong><< "; if (get_request_var_request("page") > 1) { $nav .= "<a class='linkOverDark' href='data_queries.php?filter=" . get_request_var_request("filter") . "&page=" . (get_request_var_request("page")-1) . "'>"; } $nav .= "Previous"; if (get_request_var_request("page") > 1) { $nav .= "</a>"; } $nav .= "</strong>
</td>\n
<td align='center' class='textHeaderDark'>
Showing Rows " . ((read_config_option("num_rows_device")*(get_request_var_request("page")-1))+1) . " to " . ((($total_rows < read_config_option("num_rows_device")) || ($total_rows < (read_config_option("num_rows_device")*get_request_var_request("page")))) ? $total_rows : (read_config_option("num_rows_device")*get_request_var_request("page"))) . " of $total_rows [$url_page_select]
</td>\n
<td align='right' class='textHeaderDark'>
<strong>"; if ((get_request_var_request("page") * read_config_option("num_rows_device")) < $total_rows) { $nav .= "<a class='linkOverDark' href='data_queries.php?filter=" . get_request_var_request("filter") . "&page=" . (get_request_var_request("page")+1) . "'>"; } $nav .= "Next"; if ((get_request_var_request("page") * read_config_option("num_rows_device")) < $total_rows) { $nav .= "</a>"; } $nav .= " >></strong>
</td>\n
</tr>
</table>
</td>
</tr>\n";
print $nav;
$display_text = array(
"name" => array("Name", "ASC"),
"data_input_method" => array("Data Input Method", "ASC"));
html_header_sort_checkbox($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction"));
$i = 0;
if (sizeof($snmp_queries) > 0) {
foreach ($snmp_queries as $snmp_query) {
form_alternate_row_color($colors["alternate"],$colors["light"],$i, 'line' . $snmp_query["id"]); $i++;
form_selectable_cell("<a class='linkEditMain' href='data_queries.php?action=edit&id=" . $snmp_query["id"] . "'>" . (strlen(get_request_var_request("filter")) ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $snmp_query["name"]) : $snmp_query["name"]) . "</a>", $snmp_query["id"]);
form_selectable_cell((strlen(get_request_var_request("filter")) ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $snmp_query["data_input_method"]) : $snmp_query["data_input_method"]), $snmp_query["id"]);
form_checkbox_cell($snmp_query["name"], $snmp_query["id"]);
form_end_row();
}
print $nav;
}else{
print "<tr><td><em>No Data Queries</em></td></tr>";
}
html_end_box();
/* draw the dropdown containing a list of available actions for this form */
draw_actions_dropdown($dq_actions);
}
示例8: template
function template()
{
global $colors, $graph_actions;
/* ================= input validation ================= */
input_validate_input_number(get_request_var_request("page"));
/* ==================================================== */
/* clean up search string */
if (isset($_REQUEST["filter"])) {
$_REQUEST["filter"] = sanitize_search_string(get_request_var("filter"));
}
/* clean up sort_column string */
if (isset($_REQUEST["sort_column"])) {
$_REQUEST["sort_column"] = sanitize_search_string(get_request_var("sort_column"));
}
/* clean up sort_direction string */
if (isset($_REQUEST["sort_direction"])) {
$_REQUEST["sort_direction"] = sanitize_search_string(get_request_var("sort_direction"));
}
/* if the user pushed the 'clear' button */
if (isset($_REQUEST["clear_x"])) {
kill_session_var("sess_graph_template_current_page");
kill_session_var("sess_graph_template_filter");
kill_session_var("sess_graph_template_sort_column");
kill_session_var("sess_graph_template_sort_direction");
unset($_REQUEST["page"]);
unset($_REQUEST["filter"]);
unset($_REQUEST["sort_column"]);
unset($_REQUEST["sort_direction"]);
}
/* remember these search fields in session vars so we don't have to keep passing them around */
load_current_session_value("page", "sess_graph_template_current_page", "1");
load_current_session_value("filter", "sess_graph_template_filter", "");
load_current_session_value("sort_column", "sess_graph_template_sort_column", "name");
load_current_session_value("sort_direction", "sess_graph_template_sort_direction", "ASC");
html_start_box("<strong>Graph Templates</strong>", "100%", $colors["header"], "3", "center", "graph_templates.php?action=template_edit");
?>
<tr bgcolor="<?php
print $colors["panel"];
?>
">
<form name="form_host_template">
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td nowrap style='white-space: nowrap;' width="50">
Search:
</td>
<td width="1">
<input type="text" name="filter" size="40" value="<?php
print get_request_var_request("filter");
?>
">
</td>
<td nowrap style='white-space: nowrap;'>
<input type="image" src="images/button_go.gif" alt="Go" border="0" align="absmiddle">
<input type="image" src="images/button_clear.gif" name="clear" alt="Clear" border="0" align="absmiddle">
</td>
</tr>
</table>
</td>
<input type='hidden' name='page' value='1'>
</form>
</tr>
<?php
html_end_box();
/* form the 'where' clause for our main sql query */
$sql_where = "WHERE (graph_templates.name LIKE '%%" . get_request_var_request("filter") . "%%')";
html_start_box("", "100%", $colors["header"], "3", "center", "");
$total_rows = db_fetch_cell("SELECT\n\t\tCOUNT(graph_templates.id)\n\t\tFROM graph_templates\n\t\t{$sql_where}");
$template_list = db_fetch_assoc("SELECT\n\t\tgraph_templates.id,graph_templates.name\n\t\tFROM graph_templates\n\t\t{$sql_where}\n\t\tORDER BY " . get_request_var_request("sort_column") . " " . get_request_var_request("sort_direction") . " LIMIT " . read_config_option("num_rows_device") * (get_request_var_request("page") - 1) . "," . read_config_option("num_rows_device"));
/* generate page list */
$url_page_select = get_page_list(get_request_var_request("page"), MAX_DISPLAY_PAGES, read_config_option("num_rows_device"), $total_rows, "graph_templates.php?filter=" . get_request_var_request("filter"));
$nav = "<tr bgcolor='#" . $colors["header"] . "'>\n\t\t<td colspan='7'>\n\t\t\t<table width='100%' cellspacing='0' cellpadding='0' border='0'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='left' class='textHeaderDark'>\n\t\t\t\t\t\t<strong><< ";
if (get_request_var_request("page") > 1) {
$nav .= "<a class='linkOverDark' href='graph_templates.php?filter=" . get_request_var_request("filter") . "&page=" . (get_request_var_request("page") - 1) . "'>";
}
$nav .= "Previous";
if (get_request_var_request("page") > 1) {
$nav .= "</a>";
}
$nav .= "</strong>\n\t\t\t\t\t</td>\n\n\t\t\t\t\t<td align='center' class='textHeaderDark'>\n\t\t\t\t\t\tShowing Rows " . (read_config_option("num_rows_device") * (get_request_var_request("page") - 1) + 1) . " to " . ($total_rows < read_config_option("num_rows_device") || $total_rows < read_config_option("num_rows_device") * get_request_var_request("page") ? $total_rows : read_config_option("num_rows_device") * get_request_var_request("page")) . " of {$total_rows} [{$url_page_select}]\n\t\t\t\t\t</td>\n\n\t\t\t\t\t<td align='right' class='textHeaderDark'>\n\t\t\t\t\t\t<strong>";
if (get_request_var_request("page") * read_config_option("num_rows_device") < $total_rows) {
$nav .= "<a class='linkOverDark' href='graph_templates.php?filter=" . get_request_var_request("filter") . "&page=" . (get_request_var_request("page") + 1) . "'>";
}
$nav .= "Next";
if (get_request_var_request("page") * read_config_option("num_rows_device") < $total_rows) {
$nav .= "</a>";
}
$nav .= " >></strong>\n\t\t\t\t\t</td>\n\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t\t</tr>\n";
print $nav;
$display_text = array("name" => array("Template Title", "ASC"));
html_header_sort_checkbox($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction"));
$i = 0;
if (sizeof($template_list) > 0) {
foreach ($template_list as $template) {
form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $template["id"]);
$i++;
form_selectable_cell("<a class='linkEditMain' href='graph_templates.php?action=template_edit&id=" . $template["id"] . "'>" . (strlen(get_request_var_request("filter")) ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $template["name"]) : $template["name"]) . "</a>", $template["id"]);
form_checkbox_cell($template["name"], $template["id"]);
form_end_row();
//.........这里部分代码省略.........
示例9: site
//.........这里部分代码省略.........
if (get_request_var_request("detail") == "false") {
$total_rows = db_fetch_cell("SELECT
COUNT(sites.id)
FROM sites
$sql_where");
}else{
$total_rows = sizeof(db_fetch_assoc("SELECT
device_template.id, sites.name
FROM (device_template
RIGHT JOIN device ON (device_template.id=device.device_template_id))
RIGHT JOIN sites ON (device.site_id=sites.id)
$sql_where
GROUP BY sites.name, device_template.id"));
}
/* generate page list */
$url_page_select = str_replace("&page", "?page", get_page_list($_REQUEST["page"], MAX_DISPLAY_PAGES, $rows, $total_rows, "sites.php"));
if (get_request_var_request("detail") == "false") {
/* generate page list navigation */
$nav = html_create_nav($_REQUEST["page"], MAX_DISPLAY_PAGES, read_config_option("num_rows_device"), $total_rows, 6, "sites.php");
print $nav;
html_end_box(false);
$display_text = array(
"name" => array(__("Site Name"), "ASC"),
"address1" => array(__("Address"), "ASC"),
"city" => array(__("City"), "ASC"),
"state" => array(__("State"), "DESC"),
"country" => array(__("Country"), "DESC"));
html_header_sort_checkbox($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction"));
if (sizeof($sites) > 0) {
foreach ($sites as $site) {
form_alternate_row_color('line' . $site["id"], true);
form_selectable_cell("<a class='linkEditMain' href='" . htmlspecialchars("sites.php?action=edit&id=" . $site["id"]) . "'>" .
(strlen($_REQUEST["filter"]) ? preg_replace("/(" . preg_quote($_REQUEST["filter"]) . ")/i", "<span class=\"filter\">\\1</span>", $site["name"]) : $site["name"]) . "</a>", $site["id"], "20%");
form_selectable_cell($site["address1"], $site["id"]);
form_selectable_cell($site["city"], $site["id"]);
form_selectable_cell($site["state"], $site["id"]);
form_selectable_cell($site["country"], $site["id"]);
form_checkbox_cell($site["name"], $site["id"]);
form_end_row();
}
form_end_table();
/* put the nav bar on the bottom as well */
print $nav;
}else{
print "<tr><td><em>" . __("No Sites") . "</em></td></tr>";
}
print "</table>\n"; # end table of html_header_sort_checkbox
}else{
$nav = html_create_nav($_REQUEST["page"], MAX_DISPLAY_PAGES, read_config_option("num_rows_device"), $total_rows, 10, "sites.php");
print $nav;
html_end_box(false);
$display_text = array(
"name" => array(__("Site Name"), "ASC"),
"device_template_name" => array(__("Device Type"), "ASC"),
"total_devices" => array(__("Devices"), "DESC"),
"address1" => array(__("Address"), "ASC"),
"city" => array(__("City"), "ASC"),
"state" => array(__("State"), "DESC"),
"country" => array(__("Country"), "DESC"));
html_header_sort_checkbox($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction"));
$i = 0;
if (sizeof($sites) > 0) {
foreach ($sites as $site) {
form_alternate_row_color($site["id"], true); $i++;
form_selectable_cell("<a class='linkEditMain' href='sites.php?action=edit&id=" . $site["id"] . "'>" .
(strlen($_REQUEST["filter"]) ? preg_replace("/(" . preg_quote($_REQUEST["filter"]) . ")/i", "<span class=\"filter\">\\1</span>", $site["name"]) : $site["name"]) . "</a>", $site["id"], "20%");
form_selectable_cell(preg_replace("/(" . preg_quote($_REQUEST["filter"]) . ")/i", "<span class=\"filter\">\\1</span>", $site["device_template_name"]), $site["id"]);
form_selectable_cell($site["total_devices"], $site["id"]);
form_selectable_cell($site["address1"], $site["id"]);
form_selectable_cell($site["city"], $site["id"]);
form_selectable_cell($site["state"], $site["id"]);
form_selectable_cell($site["country"], $site["id"]);
form_checkbox_cell($site["name"], $site["id"]);
form_end_row();
}
/* put the nav bar on the bottom as well */
print $nav;
}else{
print "<tr><td><em>" . __("No Sites") . "</em></td></tr>";
}
print "</table>\n"; # end table of html_header_sort_checkbox
}
/* draw the dropdown containing a list of available actions for this form */
draw_actions_dropdown($site_actions);
print "</form>\n"; # end form of html_header_sort_checkbox
}
示例10: mikrotik_user
//.........这里部分代码省略.........
strURL = 'mikrotik_users.php?clear=1';
strURL += '&header=false';
loadPageNoHeader(strURL);
}
</script>
<?php
html_start_box('<strong>MikroTik Users</strong>', '100%', '', '3', 'center', '');
?>
<tr class='even'>
<td>
<form name='users' action='mikrotik_users.php'>
<table class='filterTable'>
<tr>
<td>
Search
</td>
<td>
<input type='text' id='filter' size='25' value='<?php
print htmlspecialchars(get_request_var_request('filter'));
?>
'>
</td>
<td>
Users
</td>
<td>
<select id='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='button' value='Go' title='Set/Refresh Filters' onClick='applyFilter()'>
</td>
<td>
<input type='button' name='clear_x' value='Clear' title='Clear Filters' onClick='clearFilter()'>
</td>
</tr>
</table>
<input type='hidden' name='page' value='1'>
</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 (name LIKE '%%" . get_request_var_request('filter') . "%%') AND name!=''";
} else {
$sql_where = "WHERE name!=''";
}
/* print checkbox form for validation */
print "<form name='chk' method='post' action='mikrotik_users.php'>\n";
html_start_box('', '100%', '', '3', 'center', '');
$total_rows = db_fetch_cell("SELECT \n\t\tCOUNT(DISTINCT name)\n\t\tFROM plugin_mikrotik_users\n\t\t{$sql_where}");
$sortby = get_request_var_request('sort_column');
$sql_query = "SELECT name, domain, MAX(last_seen) AS last_seen, MAX(present) AS present\n\t\tFROM plugin_mikrotik_users\n\t\t{$sql_where}\n\t\tGROUP BY name, domain\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');
$users = db_fetch_assoc($sql_query);
$nav = html_nav_bar('mikrotik_users.php?filter=' . get_request_var_request('filter'), MAX_DISPLAY_PAGES, get_request_var_request('page'), get_request_var_request('rows'), $total_rows, 5, 'Users', 'page', 'main');
print $nav;
$display_text = array('name' => array('User Name', 'ASC'), 'domain' => array('Domain', 'ASC'), 'last_seen' => array('Last Seen', 'ASC'), 'present' => array('Active', 'ASC'));
html_header_sort_checkbox($display_text, get_request_var_request('sort_column'), get_request_var_request('sort_direction'), false);
$i = 0;
if (sizeof($users) > 0) {
foreach ($users as $user) {
form_alternate_row_color($colors['alternate'], $colors['light'], $i, 'line' . $user['name']);
$i++;
form_selectable_cell("<a class='linkEditMain' href='" . htmlspecialchars('user.php?action=edit&id=' . $user['id']) . "'>" . (strlen(get_request_var_request('filter')) ? eregi_replace('(' . preg_quote(get_request_var_request('filter')) . ')', "<span class='filteredValue'>\\1</span>", htmlspecialchars($user['name'])) : htmlspecialchars($user['name'])) . '</a>', $user['name'], 250);
form_selectable_cell($user['domain'] != '' ? $user['domain'] : 'Not Set', $user['name']);
form_selectable_cell($user['last_seen'], $user['name']);
form_selectable_cell($user['present'] == 0 ? '<b><i>Inactive</i></b>' : '<b><i>Active</i></b>', $user['name']);
form_checkbox_cell($user['name'], $user['name']);
form_end_row();
}
print $nav;
} else {
print '<tr><td><em>No Users Found</em></td></tr>';
}
html_end_box(false);
/* draw the dropdown containing a list of available actions for this form */
draw_actions_dropdown($user_actions);
print "</form>\n";
}
示例11: htmlspecialchars
?>
<form name='chk' id='chk' action='graph_view.php' method='get' onSubmit='form_graph(document.chk,document.chk)'>
<?php
$nav = "<tr bgcolor='#" . $colors["header"] . "'>\r\n\t\t<td colspan='3'>\r\n\t\t\t<table width='100%' cellspacing='0' cellpadding='3' border='0'>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align='left' class='textHeaderDark'>\r\n\t\t\t\t\t\t<strong><< " . (get_request_var_request("page") > 1 ? "<a class='linkOverDark' href='" . htmlspecialchars(str_replace("<PAGE>", get_request_var_request("page") - 1, $nav_url)) . "' onClick='return url_go(url_graph(\"" . str_replace("<PAGE>", get_request_var_request("page") - 1, $nav_url) . "\"))'>" : "") . "Previous" . (get_request_var_request("page") > 1 ? "</a>" : "") . "</strong>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align='center' class='textHeaderDark'>\r\n\t\t\t\t\t\tShowing Rows " . ($_REQUEST["rows"] * (get_request_var_request("page") - 1) + 1) . " to " . ($total_rows < $_REQUEST["rows"] || $total_rows < $_REQUEST["rows"] * get_request_var_request("page") ? $total_rows : $_REQUEST["rows"] * get_request_var_request("page")) . " of " . $total_rows . "\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align='right' class='textHeaderDark'>\r\n\t\t\t\t\t\t<strong>" . (get_request_var_request("page") * $_REQUEST["rows"] < $total_rows ? "<a class='linkOverDark' href='" . htmlspecialchars(str_replace("<PAGE>", get_request_var_request("page") + 1, $nav_url)) . "' onClick='return url_go(url_graph(\"" . str_replace("<PAGE>", get_request_var_request("page") + 1, $nav_url) . "\"))'>" : "") . "Next" . (get_request_var_request("page") * $_REQUEST["rows"] < $total_rows ? "</a>" : "") . " >></strong>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t</td>\r\n\t</tr>";
html_start_box("", "100%", $colors["header"], "1", "center", "");
print $nav;
html_header_checkbox(array("Graph Title", "Graph Size"), false);
$i = 0;
if (sizeof($graphs)) {
foreach ($graphs as $graph) {
form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $graph["local_graph_id"]);
$i++;
form_selectable_cell("<strong><a href='" . htmlspecialchars("graph.php?local_graph_id=" . $graph["local_graph_id"] . "&rra_id=all") . "'>" . htmlspecialchars($graph["title_cache"]) . "</a></strong>", $graph["local_graph_id"]);
form_selectable_cell($graph["height"] . "x" . $graph["width"], $graph["local_graph_id"]);
form_checkbox_cell($graph["title_cache"], $graph["local_graph_id"]);
form_end_row();
}
}
print $nav;
html_end_box();
?>
<table align='right'>
<tr>
<td align='right'><img src='images/arrow.gif' alt=''> </td>
<td align='right'><input type='submit' value='View' title='View Graphs'></td>
</tr>
</table>
<input type='hidden' name='style' value='selective'>
<input type='hidden' name='action' value='preview'>
示例12: show_devices
function show_devices()
{
global $action, $expire_arr, $rotation_arr, $version_arr, $nesting_arr;
global $config, $flow_actions;
/* ================= input validation and session storage ================= */
$filters = array('page' => array('filter' => FILTER_VALIDATE_INT, 'default' => '1'), 'filter' => array('filter' => FILTER_CALLBACK, 'pageset' => true, 'default' => '', 'options' => array('options' => 'sanitize_search_string')), 'sort_column' => array('filter' => FILTER_CALLBACK, 'default' => 'name', 'options' => array('options' => 'sanitize_search_string')), 'sort_direction' => array('filter' => FILTER_CALLBACK, 'default' => 'ASC', 'options' => array('options' => 'sanitize_search_string')));
validate_store_request_vars($filters, 'sess_fvd');
/* ================= input validation ================= */
$sql_where = get_request_var('filter') != '' ? "name LIKE '%" . get_request_var('filter') . "%'" : '';
$num_rows = read_config_option('num_rows_table');
$sql = "SELECT * \n\t\tFROM plugin_flowview_devices \n\t\t{$sql_where}\n\t\tORDER BY " . get_request_var('sort_column') . ' ' . get_request_var('sort_direction') . ' LIMIT ' . ($num_rows * (get_request_var('page') - 1) . ',' . $num_rows);
$result = db_fetch_assoc($sql);
$total_rows = db_fetch_cell("SELECT COUNT(*) FROM plugin_flowview_devices {$sql_where}");
html_start_box('FlowView Listeners', '100%', '', '4', 'center', 'flowview_devices.php?action=edit');
?>
<tr class='even'>
<td>
<form name='listeners' action='flowview_devices.php'>
<table class='fitlerTable'>
<tr>
<td>
Search
</td>
<td>
<input type='text' id='filter' size='40' value='<?php
print htmlspecialchars(get_request_var('filter'));
?>
'>
</td>
<td>
<input id='refresh' type='button' value='Go' title='Set/Refresh Filters'>
</td>
<td>
<input id='clear' type='button' name='clear' value='Clear' title='Clear Filters'>
</td>
</tr>
</table>
<input type='hidden' name='page' value='<?php
print get_request_var('page');
?>
'>
</form>
</td>
</tr>
<?php
html_end_box();
$nav = html_nav_bar('flowview_devices.php', MAX_DISPLAY_PAGES, get_request_var('page'), $num_rows, $total_rows, 10, 'Listeners', 'page', 'main');
form_start('flowview_devices.php', 'chk');
print $nav;
html_start_box('', '100%', '', '4', 'center', '');
$display_array = array('name' => array('Name', 'ASC'), 'folder' => array('Directory', 'ASC'), 'nexting' => array('Nesting', 'ASC'), 'allowfrom' => array('Allowed From', 'ASC'), 'port' => array('Port', 'ASC'), 'version' => array('Version', 'ASC'), 'compression' => array('Compression', 'ASC'), 'rotation' => array('Rotation', 'ASC'), 'expire' => array('Expire', 'ASC'));
html_header_sort_checkbox($display_array, get_request_var('sort_column'), get_request_var('sort_direction'), false);
if (count($result)) {
foreach ($result as $row) {
form_alternate_row('line' . $row['id'], true);
form_selectable_cell('<a class="linkEditMain" href="flowview_devices.php?&tab=listeners&action=edit&id=' . $row['id'] . '">' . $row['name'] . '</a>', $row['id']);
form_selectable_cell($row['folder'], $row['id']);
form_selectable_cell($nesting_arr[$row['nesting']], $row['id']);
form_selectable_cell($row['allowfrom'], $row['id']);
form_selectable_cell($row['port'], $row['id']);
form_selectable_cell($version_arr[$row['version']], $row['id']);
form_selectable_cell($row['compression'], $row['id']);
form_selectable_cell($rotation_arr[$row['rotation']], $row['id']);
form_selectable_cell($expire_arr[$row['expire']], $row['id']);
form_checkbox_cell($row['name'], $row['id']);
form_end_row();
}
} else {
print "<tr class='even'><td colspan=10><center>No Devices</center></td></tr>\n";
}
html_end_box(false);
if (count($result)) {
print $nav;
}
draw_actions_dropdown($flow_actions);
form_end();
}
示例13: template
function template() {
global $colors, $graph_actions;
/* ================= input validation ================= */
input_validate_input_number(get_request_var_request("page"));
/* ==================================================== */
/* clean up search string */
if (isset($_REQUEST["filter"])) {
$_REQUEST["filter"] = sanitize_search_string(get_request_var("filter"));
}
/* clean up sort_column string */
if (isset($_REQUEST["sort_column"])) {
$_REQUEST["sort_column"] = sanitize_search_string(get_request_var("sort_column"));
}
/* clean up sort_direction string */
if (isset($_REQUEST["sort_direction"])) {
$_REQUEST["sort_direction"] = sanitize_search_string(get_request_var("sort_direction"));
}
/* if the user pushed the 'clear' button */
if (isset($_REQUEST["clear_x"])) {
kill_session_var("sess_graph_template_current_page");
kill_session_var("sess_graph_template_filter");
kill_session_var("sess_graph_template_sort_column");
kill_session_var("sess_graph_template_sort_direction");
unset($_REQUEST["page"]);
unset($_REQUEST["filter"]);
unset($_REQUEST["sort_column"]);
unset($_REQUEST["sort_direction"]);
}
/* remember these search fields in session vars so we don't have to keep passing them around */
load_current_session_value("page", "sess_graph_template_current_page", "1");
load_current_session_value("filter", "sess_graph_template_filter", "");
load_current_session_value("sort_column", "sess_graph_template_sort_column", "name");
load_current_session_value("sort_direction", "sess_graph_template_sort_direction", "ASC");
html_start_box("<strong>Graph Templates</strong>", "100%", $colors["header"], "3", "center", "graph_templates.php?action=template_edit");
include("./include/html/inc_graph_template_filter_table.php");
html_end_box();
/* form the 'where' clause for our main sql query */
$sql_where = "WHERE (graph_templates.name LIKE '%%" . $_REQUEST["filter"] . "%%')";
html_start_box("", "100%", $colors["header"], "3", "center", "");
$total_rows = db_fetch_cell("SELECT
COUNT(graph_templates.id)
FROM graph_templates
$sql_where");
$template_list = db_fetch_assoc("SELECT
graph_templates.id,graph_templates.name
FROM graph_templates
$sql_where
ORDER BY " . $_REQUEST['sort_column'] . " " . $_REQUEST['sort_direction'],
read_config_option("num_rows_device"),(read_config_option("num_rows_device")*($_REQUEST["page"]-1)));
/* generate page list */
$url_page_select = get_page_list($_REQUEST["page"], MAX_DISPLAY_PAGES, read_config_option("num_rows_device"), $total_rows, "graph_templates.php?filter=" . $_REQUEST["filter"]);
$nav = "<tr bgcolor='#" . $colors["header"] . "'>
<td colspan='7'>
<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='graph_templates.php?filter=" . $_REQUEST["filter"] . "&page=" . ($_REQUEST["page"]-1) . "'>"; } $nav .= "Previous"; if ($_REQUEST["page"] > 1) { $nav .= "</a>"; } $nav .= "</strong>
</td>\n
<td align='center' class='textHeaderDark'>
Showing Rows " . ((read_config_option("num_rows_device")*($_REQUEST["page"]-1))+1) . " to " . ((($total_rows < read_config_option("num_rows_device")) || ($total_rows < (read_config_option("num_rows_device")*$_REQUEST["page"]))) ? $total_rows : (read_config_option("num_rows_device")*$_REQUEST["page"])) . " of $total_rows [$url_page_select]
</td>\n
<td align='right' class='textHeaderDark'>
<strong>"; if (($_REQUEST["page"] * read_config_option("num_rows_device")) < $total_rows) { $nav .= "<a class='linkOverDark' href='graph_templates.php?filter=" . $_REQUEST["filter"] . "&page=" . ($_REQUEST["page"]+1) . "'>"; } $nav .= "Next"; if (($_REQUEST["page"] * read_config_option("num_rows_device")) < $total_rows) { $nav .= "</a>"; } $nav .= " >></strong>
</td>\n
</tr>
</table>
</td>
</tr>\n";
print $nav;
$display_text = array(
"name" => array("Template Title", "ASC"));
html_header_sort_checkbox($display_text, $_REQUEST["sort_column"], $_REQUEST["sort_direction"]);
$i = 0;
if (sizeof($template_list) > 0) {
foreach ($template_list as $template) {
form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $template["id"]);$i++;
form_selectable_cell("<a class='linkEditMain' href='graph_templates.php?action=template_edit&id=" . $template["id"] . "'>" . (strlen($_REQUEST["filter"]) ? eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $template["name"]) : $template["name"]) . "</a>", $template["id"]);
form_checkbox_cell($template["name"], $template["id"]);
form_end_row();
//.........这里部分代码省略.........
示例14: html_start_box
<form name='chk' id='chk' action='graph_view.php' method='get' onSubmit='form_graph(document.chk,document.chk)'>
<?php
html_start_box('', '100%', '', '3', 'center', '');
$nav = html_nav_bar("graph_view.php?action=list", MAX_DISPLAY_PAGES, get_request_var_request("page"), get_request_var_request("rows"), $total_rows, 5, "Graphs");
print $nav;
html_header_checkbox(array('Graph Title', 'Host', 'Graph Template', 'Graph Size'), false);
$i = 0;
if (sizeof($graphs)) {
foreach ($graphs as $graph) {
form_alternate_row('line' . $graph['local_graph_id'], true);
form_selectable_cell("<strong><a href='" . htmlspecialchars('graph.php?local_graph_id=' . $graph['local_graph_id'] . '&rra_id=all') . "'>" . htmlspecialchars($graph['title_cache']) . '</a></strong>', $graph['local_graph_id'], '30%');
form_selectable_cell($graph['description'], $graph['local_graph_id']);
form_selectable_cell($graph['template_name'], $graph['local_graph_id']);
form_selectable_cell($graph['height'] . 'x' . $graph['width'], $graph['local_graph_id']);
form_checkbox_cell($graph['title_cache'], $graph['local_graph_id']);
form_end_row();
}
print $nav;
}
html_end_box();
?>
<table align='right'>
<tr>
<td align='right'><img src='images/arrow.gif' alt=''> </td>
<td align='right'><input type='submit' value='View' title='View Graphs'></td>
</tr>
</table>
<input type='hidden' name='style' value='selective'>
<input type='hidden' name='action' value='preview'>
示例15: syslog_removal
function syslog_removal()
{
global $syslog_actions, $message_types, $config;
include dirname(__FILE__) . '/config.php';
/* ================= input validation and session storage ================= */
$filters = array('rows' => array('filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1'), 'page' => array('filter' => FILTER_VALIDATE_INT, 'default' => '1'), 'id' => array('filter' => FILTER_VALIDATE_INT, 'default' => '1'), 'enabled' => array('filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1'), 'filter' => array('filter' => FILTER_CALLBACK, 'pageset' => true, 'default' => '', 'options' => array('options' => 'sanitize_search_string')), 'sort_column' => array('filter' => FILTER_CALLBACK, 'default' => 'name', 'options' => array('options' => 'sanitize_search_string')), 'sort_direction' => array('filter' => FILTER_CALLBACK, 'default' => 'ASC', 'options' => array('options' => 'sanitize_search_string')));
validate_store_request_vars($filters, 'sess_syslogr');
/* ================= input validation ================= */
html_start_box(__('Syslog Removal Rule Filters'), '100%', '', '3', 'center', 'syslog_removal.php?action=edit&type=1');
syslog_filter();
html_end_box();
$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');
}
$removals = syslog_get_removal_records($sql_where, $row_limit);
$rows_query_string = "SELECT COUNT(*)\n\t\tFROM `" . $syslogdb_default . "`.`syslog_remove`\n\t\t{$sql_where}";
$total_rows = syslog_db_fetch_cell($rows_query_string);
$nav = html_nav_bar('syslog_removal.php?filter=' . get_request_var('filter'), MAX_DISPLAY_PAGES, get_request_var('page'), $row_limit, $total_rows, 13, 'Rules', 'page', 'main');
form_start('syslog_removal.php', 'chk');
print $nav;
html_start_box('', '100%', '', '3', 'center', '');
$display_text = array('name' => array(__('Removal Name'), 'ASC'), 'enabled' => array(__('Enabled'), 'ASC'), 'type' => array(__('Match Type'), 'ASC'), 'message' => array(__('Search String'), 'ASC'), 'method' => array(__('Method'), 'DESC'), 'date' => array(__('Last Modified'), 'ASC'), 'user' => array(__('By User'), 'DESC'));
html_header_sort_checkbox($display_text, get_request_var('sort_column'), get_request_var('sort_direction'));
if (sizeof($removals)) {
foreach ($removals as $removal) {
form_alternate_row('line' . $removal['id'], true);
form_selectable_cell(filter_value(title_trim($removal['name'], read_config_option('max_title_length')), get_request_var('filter'), $config['url_path'] . 'plugins/syslog/syslog_removal.php?action=edit&id=' . $removal['id']), $removal['id']);
form_selectable_cell($removal['enabled'] == 'on' ? __('Yes') : __('No'), $removal['id']);
form_selectable_cell($message_types[$removal['type']], $removal['id']);
form_selectable_cell($removal['message'], $removal['id']);
form_selectable_cell($removal['method'] == 'del' ? __('Deletion') : __('Transfer'), $removal['id']);
form_selectable_cell(date('Y-m-d H:i:s', $removal['date']), $removal['id']);
form_selectable_cell($removal['user'], $removal['id']);
form_checkbox_cell($removal['name'], $removal['id']);
form_end_row();
}
} else {
print "<tr><td colspan='4'><em>" . __('No Syslog Removal Rules Defined') . "</em></td></tr>";
}
html_end_box(false);
if (sizeof($removals)) {
print $nav;
}
draw_actions_dropdown($syslog_actions);
form_end();
}