本文整理汇总了PHP中get_request_var函数的典型用法代码示例。如果您正苦于以下问题:PHP get_request_var函数的具体用法?PHP get_request_var怎么用?PHP get_request_var使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_request_var函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: openpne_execute
/**
* 初期実行 index.php から呼ばれる
*/
function openpne_execute()
{
$module = '';
$type = '';
$action = '';
if (!($module = get_request_var('m'))) {
// モジュール名の自動設定
if (!db_admin_user_exists()) {
$module = 'setup';
} elseif (isKtaiUserAgent()) {
$module = 'ktai';
} else {
$module = 'pc';
}
}
$types = array('page', 'do');
if ($a = get_request_var('a')) {
$arr = explode('_', $a, 2);
if (!empty($arr[1]) && in_array($arr[0], $types)) {
$type = $arr[0];
$action = $arr[1];
}
}
openpne_forward($module, $type, $action);
}
开发者ID:KimuraYoichi,项目名称:PukiWiki,代码行数:28,代码来源:controller.php
示例2: plugin_syslog_install
function plugin_syslog_install()
{
global $config, $syslog_upgrade;
static $bg_inprocess = false;
include dirname(__FILE__) . "/config.php";
syslog_connect();
$syslog_exists = sizeof(syslog_db_fetch_row("SHOW TABLES FROM `" . $syslogdb_default . "` LIKE 'syslog'"));
$db_version = syslog_get_mysql_version("syslog");
/* ================= input validation ================= */
input_validate_input_number(get_request_var("days"));
/* ==================================================== */
api_plugin_register_hook('syslog', 'config_arrays', 'syslog_config_arrays', 'setup.php');
api_plugin_register_hook('syslog', 'draw_navigation_text', 'syslog_draw_navigation_text', 'setup.php');
api_plugin_register_hook('syslog', 'config_settings', 'syslog_config_settings', 'setup.php');
api_plugin_register_hook('syslog', 'top_header_tabs', 'syslog_show_tab', 'setup.php');
api_plugin_register_hook('syslog', 'top_graph_header_tabs', 'syslog_show_tab', 'setup.php');
api_plugin_register_hook('syslog', 'top_graph_refresh', 'syslog_top_graph_refresh', 'setup.php');
api_plugin_register_hook('syslog', 'poller_bottom', 'syslog_poller_bottom', 'setup.php');
api_plugin_register_hook('syslog', 'graph_buttons', 'syslog_graph_buttons', 'setup.php');
api_plugin_register_hook('syslog', 'config_insert', 'syslog_config_insert', 'setup.php');
api_plugin_register_realm('syslog', 'syslog.php', 'Plugin -> Syslog User', 1);
api_plugin_register_realm('syslog', 'syslog_alerts.php,syslog_removal.php,syslog_reports.php', 'Plugin -> Syslog Administration', 1);
//print "<pre>";print_r($_GET);print "</pre>";
if (isset($_GET["install"]) || isset($_GET["return"]) || isset($_GET["cancel"])) {
if (!$bg_inprocess) {
syslog_execute_update($syslog_exists, $_GET);
$bg_inprocess = true;
}
} else {
syslog_install_advisor($syslog_exists, $db_version);
exit;
}
}
开发者ID:khoimt,项目名称:cacti-sample,代码行数:33,代码来源:setup.php
示例3: save_settings
function save_settings()
{
validate_request_vars();
if (sizeof($_REQUEST)) {
foreach ($_REQUEST as $var => $value) {
switch ($var) {
case 'timespan':
set_user_setting('cycle_timespan', get_request_var('timespan'));
break;
case 'refresh':
set_user_setting('cycle_delay', get_request_var('refresh'));
break;
case 'graphs':
set_user_setting('cycle_graphs', get_request_var('graphs'));
break;
case 'cols':
set_user_setting('cycle_columns', get_request_var('cols'));
break;
case 'height':
set_user_setting('cycle_height', get_request_var('height'));
break;
case 'width':
set_user_setting('cycle_width', get_request_var('width'));
break;
case 'legend':
set_user_setting('cycle_legend', get_request_var('legend'));
break;
case 'filter':
set_user_setting('cycle_filter', get_request_var('filter'));
break;
}
}
}
validate_request_vars(true);
}
开发者ID:Cacti,项目名称:plugin_cycle,代码行数:35,代码来源:functions.php
示例4: color_edit
function color_edit()
{
global $colors, $fields_color_edit;
/* ================= input validation ================= */
input_validate_input_number(get_request_var("id"));
/* ==================================================== */
if (!empty($_GET["id"])) {
$color = db_fetch_row("select * from colors where id=" . $_GET["id"]);
$header_label = "[edit: " . $color["hex"] . "]";
} else {
$header_label = "[new]";
}
html_start_box("<strong>Colors</strong> {$header_label}", "100%", $colors["header"], "3", "center", "");
draw_edit_form(array("config" => array(), "fields" => inject_form_variables($fields_color_edit, isset($color) ? $color : array())));
html_end_box();
form_save_button("color.php");
}
开发者ID:songchin,项目名称:Cacti,代码行数:17,代码来源:color.php
示例5: chdir
| GNU General Public License for more details. |
+-------------------------------------------------------------------------+
| Cacti: The Complete RRDTool-based Graphing Solution |
+-------------------------------------------------------------------------+
| This code is designed, written, and maintained by the Cacti Group. See |
| about.php and/or the AUTHORS file for specific developer information. |
+-------------------------------------------------------------------------+
| http://www.cacti.net/ |
+-------------------------------------------------------------------------+
*/
chdir('../../../');
require_once('./include/auth.php');
/* ================= Input validation ================= */
input_validate_input_number(get_request_var("id"));
if(!isset($_REQUEST['graph_item']) || !is_array($_REQUEST['graph_item'])) exit;
/* graph_item table contains one row defined as "nodrag&nodrop" */
unset($_REQUEST['graph_item'][0]);
/* delivered graph_item ids has to be exactly the same like we have stored */
$old_order = array();
$new_order = $_REQUEST['graph_item'];
$sql = "SELECT id, sequence FROM graph_templates_item WHERE local_graph_id = " . $_GET['id'] . " and graph_template_id=0";
$graph_templates_items = db_fetch_assoc($sql);
if(sizeof($graph_templates_items)>0) {
foreach($graph_templates_items as $item) {
$old_order[$item['sequence']] = $item['id'];
开发者ID:songchin,项目名称:Cacti,代码行数:31,代码来源:graphs_item.ajax.php
示例6: utilities_view_poller_cache
function utilities_view_poller_cache()
{
global $poller_actions;
define("MAX_DISPLAY_PAGES", 21);
/* ================= input validation ================= */
input_validate_input_number(get_request_var_request("host_id"));
input_validate_input_number(get_request_var_request("page"));
input_validate_input_number(get_request_var_request("poller_action"));
/* ==================================================== */
/* clean up search filter */
if (isset($_REQUEST["filter"])) {
$_REQUEST["filter"] = sanitize_search_string(get_request_var("filter"));
}
/* clean up sort_column */
if (isset($_REQUEST["sort_column"])) {
$_REQUEST["sort_column"] = sanitize_search_string(get_request_var("sort_column"));
}
/* clean up sort direction */
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_poller_current_page");
kill_session_var("sess_poller_host_id");
kill_session_var("sess_poller_poller_action");
kill_session_var("sess_poller_filter");
unset($_REQUEST["page"]);
unset($_REQUEST["filter"]);
unset($_REQUEST["host_id"]);
unset($_REQUEST["poller_action"]);
}
if (!empty($_SESSION["sess_poller_action"]) && !empty($_REQUEST["poller_action"])) {
if ($_SESSION["sess_poller_poller_action"] != $_REQUEST["poller_action"]) {
$_REQUEST["page"] = 1;
}
}
/* remember these search fields in session vars so we don't have to keep passing them around */
load_current_session_value("page", "sess_poller_current_page", "1");
load_current_session_value("host_id", "sess_poller_host_id", "-1");
load_current_session_value("poller_action", "sess_poller_poller_action", "-1");
load_current_session_value("filter", "sess_poller_filter", "");
load_current_session_value("sort_column", "sess_poller_sort_column", "data_template_data.name_cache");
load_current_session_value("sort_direction", "sess_poller_sort_direction", "ASC");
$_REQUEST['page_referrer'] = 'view_poller_cache';
load_current_session_value('page_referrer', 'page_referrer', 'view_poller_cache');
?>
<script type="text/javascript">
<!--
function applyPItemFilterChange(objForm) {
strURL = '?poller_action=' + objForm.poller_action.value;
strURL = strURL + '&host_id=' + objForm.host_id.value;
strURL = strURL + '&filter=' + objForm.filter.value;
strURL = strURL + '&action=view_poller_cache';
document.location = strURL;
}
-->
</script>
<?php
html_start_box("<strong>Poller Cache Items</strong>", "100%", "", "3", "center", "");
?>
<tr class='even noprint'>
<td>
<form name="form_pollercache" action="utilities.php">
<table cellpadding="0" cellspacing="0">
<tr>
<td nowrap style='white-space: nowrap;' width="50">
Host:
</td>
<td width="1">
<select name="host_id" onChange="applyPItemFilterChange(document.form_pollercache)">
<option value="-1"<?php
if (get_request_var_request("host_id") == "-1") {
?>
selected<?php
}
?>
>Any</option>
<option value="0"<?php
if (get_request_var_request("host_id") == "0") {
?>
selected<?php
}
?>
>None</option>
<?php
$hosts = db_fetch_assoc("select id,description,hostname from host order by description");
if (sizeof($hosts) > 0) {
foreach ($hosts as $host) {
print "<option value='" . $host["id"] . "'";
if (get_request_var_request("host_id") == $host["id"]) {
print " selected";
}
print ">" . $host["description"] . "</option>\n";
}
}
?>
</select>
//.........这里部分代码省略.........
开发者ID:nexusvista,项目名称:cacti,代码行数:101,代码来源:utilities.php
示例7: empty
$json->type = empty($msgOk) ? "error" : "success";
$json->message = empty($msgOk) ? $msgErr : $msgOk;
$php_error = error_get_last();
if ($php_error !== null) {
$json->php_error = $php_error;
}
print json_encode($json);
exit(0);
}
////////////////////////////////////////////////////////////////////////////////
// Set administrator.
////////////////////////////////////////////////////////////////////////////////
if (check_request_var("setadmin") || $show_setadmin) {
// Assign the Administrator role.
if (check_request_var("saveadmin")) {
$selusers = get_request_var("selected_users");
$oU = new \svnadmin\core\entities\User();
$oU->name = $selusers[0];
$oR = new \svnadmin\core\entities\Role();
$oR->name = "Administrator";
// Set selected user as Administrator.
try {
$b = $appEngine->getAclManager()->assignUserToRole($oU, $oR);
if (!$b) {
throw new Exception("ERROR: Can not assign user to role.");
}
$b = $appEngine->getAclManager()->save();
if (!$b) {
throw new Exception("ERROR: Can not save ACL changes.");
}
$appEngine->addMessage(tr("The user has been defined as admin. You can <a href=\"login.php\">login</a> now."));
开发者ID:zeus911,项目名称:salt-cntv,代码行数:31,代码来源:settings.php
示例8: 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";
}
开发者ID:teddywen,项目名称:cacti,代码行数:98,代码来源:data_templates.php
示例9: mactrack_device_action_execute
/**
* perform mactrack_device execute action
* @arg $action action to be performed
* return -
* */
function mactrack_device_action_execute($action)
{
global $config;
# it's our turn
if ($action == 'plugin_mactrack_device') {
/* mactrack */
/* find out which (if any) hosts have been checked, so we can tell the user */
if (isset_request_var('selected_items')) {
$selected_items = sanitize_unserialize_selected_items(get_nfilter_request_var('selected_items'));
if ($selected_items != false) {
/* work on all selected hosts */
for ($i = 0; $i < count($selected_items); $i++) {
# fetch row from host table
$device = db_fetch_row_prepared('SELECT * from host WHERE id = ?', array($selected_items[$i]));
# now fetch the related device from mac_track_devices, if any
$mt_device = db_fetch_row_prepared('SELECT * from mac_track_devices WHERE host_id = ?', array($device['id']));
if (is_array($device)) {
# update mac_track_device
$device_id = api_mactrack_device_save(isset($mt_device['device_id']) ? $mt_device['device_id'] : '0', $device['id'], get_request_var('site_id'), $device['hostname'], $device['description'], get_request_var('scan_type'), get_request_var('snmp_options'), $device['snmp_community'], $device['snmp_version'], $device['snmp_username'], $device['snmp_password'], $device['snmp_auth_protocol'], $device['snmp_priv_passphrase'], $device['snmp_priv_protocol'], $device['snmp_context'], $device['snmp_engine_id'], $device['snmp_port'], $device['snmp_timeout'], get_request_var('snmp_retries'), $device['max_oids'], get_request_var('ignorePorts'), $device['notes'], get_request_var('user_name'), get_request_var('user_password'), get_request_var('term_type'), get_request_var('private_key_path'), isset_request_var('disabled') ? get_request_var('disabled') : '');
}
}
}
}
}
return $action;
}
开发者ID:Cacti,项目名称:plugin_mactrack,代码行数:31,代码来源:mactrack_actions.php
示例10: mactrack_view_sites
function mactrack_view_sites()
{
global $title, $config, $item_rows;
mactrack_sites_request_validation();
if (get_request_var('rows') == -1) {
$row_limit = read_config_option('num_rows_table');
} elseif (get_request_var('rows') == -2) {
$row_limit = 999999;
} else {
$row_limit = get_request_var('rows');
}
$webroot = $config['url_path'] . '/plugins/mactrack/';
mactrack_tabs();
html_start_box($title, '100%', '', '3', 'center', '');
mactrack_site_filter('mactrack_view_sites.php');
html_end_box();
$sql_where = '';
$sites = mactrack_view_get_site_records($sql_where, $row_limit);
if (get_request_var('detail') == 'false') {
$total_rows = db_fetch_cell("SELECT\n\t\t\tCOUNT(mac_track_sites.site_id)\n\t\t\tFROM mac_track_sites\n\t\t\t{$sql_where}");
} else {
$total_rows = sizeof(db_fetch_assoc("SELECT\n\t\t\tmac_track_device_types.device_type_id, mac_track_sites.site_name\n\t\t\tFROM (mac_track_device_types\n\t\t\tRIGHT JOIN mac_track_devices ON (mac_track_device_types.device_type_id = mac_track_devices.device_type_id))\n\t\t\tRIGHT JOIN mac_track_sites ON (mac_track_devices.site_id = mac_track_sites.site_id)\n\t\t\t{$sql_where}\n\t\t\tGROUP BY mac_track_sites.site_name, mac_track_device_types.device_type_id"));
}
$nav = html_nav_bar('mactrack_view_sites.php', MAX_DISPLAY_PAGES, get_request_var('page'), $row_limit, $total_rows, 11, __('Sites'));
print $nav;
html_start_box('', '100%', '', '3', 'center', '');
if (get_request_var('detail') == 'false') {
$display_text = array('nosort' => array(__('Actions'), ''), 'site_name' => array(__('Site Name'), 'ASC'), 'total_devices' => array(__('Devices'), 'DESC'), 'total_ips' => array(__('Total IP\'s'), 'DESC'), 'total_user_ports' => array(__('User Ports'), 'DESC'), 'total_oper_ports' => array(__('User Ports Up'), 'DESC'), 'total_macs' => array(__('MACS Found'), 'DESC'), 'total_device_errors' => array(__('Device Errors'), 'DESC'));
html_header_sort($display_text, get_request_var('sort_column'), get_request_var('sort_direction'));
if (sizeof($sites) > 0) {
foreach ($sites as $site) {
form_alternate_row('row_' . $site['site_id'], true);
?>
<td width=140>
<?php
if (api_user_realm_auth('mactrack_sites.php')) {
echo "<a href='" . htmlspecialchars($webroot . 'mactrack_sites.php?action=edit&site_id=' . $site['site_id']) . "' title='" . __('Edit Site') . "'><img border='0' src='" . $webroot . "images/edit_object.png'></a>";
echo "<a href='#'><img id='r_" . $site['site_id'] . "' src='" . $webroot . "images/rescan_site.gif' alt='' onClick='site_scan(" . $site['site_id'] . ")' title='" . __('Rescan Site') . "' border='0'></a>";
}
?>
<a href='<?php
print htmlspecialchars($webroot . 'mactrack_view_devices.php?report=devices&reset&site_id=' . $site['site_id']);
?>
' title='<?php
print __('View Devices');
?>
'><img border='0' src='<?php
print $webroot;
?>
images/view_devices.gif'></a>
<a href='<?php
print htmlspecialchars($webroot . 'mactrack_view_ips.php?report=ips&reset&site_id=' . $site['site_id']);
?>
' title='<?php
print __('View IP Ranges');
?>
'><img border='0' src='<?php
print $webroot;
?>
images/view_networks.gif'></a>
<a href='<?php
print htmlspecialchars($webroot . 'plugins/mactrack/mactrack_view_arp.php?report=arp&reset&site_id=' . $site['site_id']);
?>
' title='<?php
print __('View IP Addresses');
?>
'><img border='0' src='<?php
print $webroot;
?>
images/view_ipaddresses.gif'></a>
<a href='<?php
print htmlspecialchars($webroot . 'plugins/mactrack/mactrack_view_macs.php?report=macs&reset&device_id=-1&scan_date=3&site_id=' . $site['site_id']);
?>
' title='<?php
print __('View MAC Addresses');
?>
'><img border='0' src='<?php
print $webroot;
?>
images/view_macs.gif'></a>
<a href='<?php
print htmlspecialchars($webroot . 'mactrack_view_interfaces.php?report=interfaces&reset&site=' . $site['site_id']);
?>
' title='<?php
print __('View Interfaces');
?>
'><img border='0' src='<?php
print $webroot;
?>
images/view_interfaces.gif'></a>
</td>
<td class='hyperLink'>
<?php
print filter_value($site['site_name'], get_request_var('filter'));
?>
</td>
<td><?php
print number_format_i18n($site['total_devices']);
?>
</td>
//.........这里部分代码省略.........
开发者ID:Cacti,项目名称:plugin_mactrack,代码行数:101,代码来源:mactrack_view_sites.php
示例11: 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();
//.........这里部分代码省略.........
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:graph_templates.php
示例12: input_validate_input_number
| about.php and/or the AUTHORS file for specific developer information. |
+-------------------------------------------------------------------------+
| http://www.cacti.net/ |
+-------------------------------------------------------------------------+
*/
/* ================= input validation ================= */
input_validate_input_number(get_request_var_request("predefined_timespan"));
input_validate_input_number(get_request_var_request("predefined_timeshift"));
/* ==================================================== */
/* clean up date1 string */
if (isset($_REQUEST["date1"])) {
$_REQUEST["date1"] = sanitize_search_string(get_request_var("date1"));
}
/* clean up date2 string */
if (isset($_REQUEST["date2"])) {
$_REQUEST["date2"] = sanitize_search_string(get_request_var("date2"));
}
include_once $config["base_path"] . "/lib/time.php";
/* initialize the timespan array */
$timespan = array();
/* set variables for first time use */
initialize_timespan($timespan);
$timeshift = set_timeshift();
/* if the user does not want to see timespan selectors */
if (read_graph_config_option("timespan_sel") == "") {
set_preset_timespan($timespan);
/* the user does want to see them */
} else {
process_html_variables();
process_user_input($timespan, $timeshift);
}
开发者ID:songchin,项目名称:Cacti,代码行数:31,代码来源:timespan_settings.php
示例13: utilities_view_poller_cache
function utilities_view_poller_cache() {
global $colors, $poller_actions;
define("MAX_DISPLAY_PAGES", 21);
/* ================= input validation ================= */
input_validate_input_number(get_request_var_request("host_id"));
input_validate_input_number(get_request_var_request("page"));
input_validate_input_number(get_request_var_request("poller_action"));
/* ==================================================== */
/* clean up search filter */
if (isset($_REQUEST["filter"])) {
$_REQUEST["filter"] = sanitize_search_string(get_request_var("filter"));
}
/* clean up sort_column */
if (isset($_REQUEST["sort_column"])) {
$_REQUEST["sort_column"] = sanitize_search_string(get_request_var("sort_column"));
}
/* clean up sort direction */
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_poller_current_page");
kill_session_var("sess_poller_host_id");
kill_session_var("sess_poller_poller_action");
kill_session_var("sess_poller_filter");
unset($_REQUEST["page"]);
unset($_REQUEST["filter"]);
unset($_REQUEST["host_id"]);
unset($_REQUEST["poller_action"]);
}
if ((!empty($_SESSION["sess_poller_action"])) && (!empty($_REQUEST["poller_action"]))) {
if ($_SESSION["sess_poller_poller_action"] != $_REQUEST["poller_action"]) {
$_REQUEST["page"] = 1;
}
}
/* remember these search fields in session vars so we don't have to keep passing them around */
load_current_session_value("page", "sess_poller_current_page", "1");
load_current_session_value("host_id", "sess_poller_host_id", "-1");
load_current_session_value("poller_action", "sess_poller_poller_action", "-1");
load_current_session_value("filter", "sess_poller_filter", "");
load_current_session_value("sort_column", "sess_poller_sort_column", "data_template_data.name_cache");
load_current_session_value("sort_direction", "sess_poller_sort_direction", "ASC");
$_REQUEST['page_referrer'] = 'view_poller_cache';
load_current_session_value('page_referrer', 'page_referrer', 'view_poller_cache');
?>
<script type="text/javascript">
<!--
function applyPItemFilterChange(objForm) {
strURL = '?poller_action=' + objForm.poller_action.value;
strURL = strURL + '&host_id=' + objForm.host_id.value;
strURL = strURL + '&filter=' + objForm.filter.value;
strURL = strURL + '&action=view_poller_cache';
document.location = strURL;
}
-->
</script>
<?php
html_start_box("<strong>Poller Cache Items</strong>", "100%", $colors["header"], "3", "center", "");
?>
<tr bgcolor="<?php print $colors["panel"];?>">
<form name="form_pollercache">
<td>
<table cellpadding="0" cellspacing="0">
<tr>
<td nowrap style='white-space: nowrap;' width="50">
Host:
</td>
<td width="1">
<select name="host_id" onChange="applyPItemFilterChange(document.form_pollercache)">
<option value="-1"<?php if (get_request_var_request("host_id") == "-1") {?> selected<?php }?>>Any</option>
<option value="0"<?php if (get_request_var_request("host_id") == "0") {?> selected<?php }?>>None</option>
<?php
$hosts = db_fetch_assoc("select id,description,hostname from host order by description");
if (sizeof($hosts) > 0) {
foreach ($hosts as $host) {
print "<option value='" . $host["id"] . "'"; if (get_request_var_request("host_id") == $host["id"]) { print " selected"; } print ">" . $host["description"] . "</option>\n";
}
}
?>
</select>
</td>
<td nowrap style='white-space: nowrap;' width="50">
Action:
//.........这里部分代码省略.........
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:utilities.php
示例14: mactrack_view_sites
function mactrack_view_sites() {
global $title, $colors, $config, $item_rows;
/* ================= input validation ================= */
input_validate_input_number(get_request_var_request("site_id"));
input_validate_input_number(get_request_var_request("device_id"));
input_validate_input_number(get_request_var_request("page"));
input_validate_input_number(get_request_var_request("rows"));
/* ==================================================== */
/* clean up search string */
if (isset($_REQUEST["detail"])) {
$_REQUEST["detail"] = sanitize_search_string(get_request_var("detail"));
}
/* clean up search string */
if (isset($_REQUEST["filter"])) {
$_REQUEST["filter"] = sanitize_search_string(get_request_var("filter"));
}
/* clean up sort_column */
if (isset($_REQUEST["sort_column"])) {
$_REQUEST["sort_column"] = sanitize_search_string(get_request_var("sort_column"));
}
/* clean up search string */
if (isset($_REQUEST["sort_direction"])) {
$_REQUEST["sort_direction"] = sanitize_search_string(get_request_var("sort_direction"));
}
/* if the user pushed the 'clear' button */
if (isset($_REQUEST["clear_x"]) || isset($_REQUEST["reset"])) {
kill_session_var("sess_mactrack_view_sites_current_page");
kill_session_var("sess_mactrack_view_sites_detail");
kill_session_var("sess_mactrack_view_sites_device_type_id");
kill_session_var("sess_mactrack_view_sites_site_id");
kill_session_var("sess_mactrack_view_sites_filter");
kill_session_var("sess_mactrack_view_sites_rows");
kill_session_var("sess_mactrack_view_sites_sort_column");
kill_session_var("sess_mactrack_view_sites_sort_direction");
$_REQUEST["page"] = 1;
if (isset($_REQUEST["clear_x"])) {
unset($_REQUEST["filter"]);
unset($_REQUEST["rows"]);
unset($_REQUEST["device_type_id"]);
unset($_REQUEST["site_id"]);
unset($_REQUEST["detail"]);
unset($_REQUEST["sort_column"]);
unset($_REQUEST["sort_direction"]);
}
}else{
/* if any of the settings changed, reset the page number */
$changed = 0;
$changed += mactrack_check_changed("device
|
请发表评论