本文整理汇总了PHP中form_checkbox_cell函数的典型用法代码示例。如果您正苦于以下问题:PHP form_checkbox_cell函数的具体用法?PHP form_checkbox_cell怎么用?PHP form_checkbox_cell使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了form_checkbox_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: data_source
//.........这里部分代码省略.........
}else {
$sql_where1 .= " AND data_template_data.data_input_id=" . $_REQUEST["method_id"];
$sql_where2 .= " AND data_template_data.data_input_id=" . $_REQUEST["method_id"];
}
if (get_request_var_request("rows") == "-1") {
$rows = read_config_option("num_rows_data_source");
}else{
$rows = get_request_var_request("rows");
}
$total_rows = sizeof(db_fetch_assoc("SELECT
data_local.id
FROM (data_local,data_template_data)
LEFT JOIN data_input
ON (data_input.id=data_template_data.data_input_id)
LEFT JOIN data_template
ON (data_local.data_template_id=data_template.id)
WHERE data_local.id=data_template_data.local_data_id
$sql_where1"));
$poller_intervals = array_rekey(db_fetch_assoc("SELECT data_template_data.local_data_id AS id,
Min(data_template_data.rrd_step*rra.steps) AS poller_interval
FROM data_template
INNER JOIN (data_local
INNER JOIN ((data_template_data_rra
INNER JOIN data_template_data ON data_template_data_rra.data_template_data_id=data_template_data.id)
INNER JOIN rra ON data_template_data_rra.rra_id = rra.id) ON data_local.id = data_template_data.local_data_id) ON data_template.id = data_template_data.data_template_id
$sql_where2
GROUP BY data_template_data.local_data_id"), "id", "poller_interval");
$dssql = "SELECT
data_template_data.local_data_id,
data_template_data.name_cache,
data_template_data.active,
data_input.name as data_input_name,
data_template.name as data_template_name,
data_local.device_id
FROM (data_local,data_template_data)
LEFT JOIN data_input
ON (data_input.id=data_template_data.data_input_id)
LEFT JOIN data_template
ON (data_local.data_template_id=data_template.id)
WHERE data_local.id=data_template_data.local_data_id
$sql_where1
ORDER BY ". get_request_var_request('sort_column') . " " . get_request_var_request('sort_direction') .
" LIMIT " . ($rows*(get_request_var_request("page")-1)) . "," . $rows;
$data_sources = db_fetch_assoc($dssql);
html_start_box("", "100", $colors["header"], "0", "center", "");
/* generate page list navigation */
$nav = html_create_nav($_REQUEST["page"], MAX_DISPLAY_PAGES, $rows, $total_rows, 7, "data_sources.php");
print $nav;
html_end_box(false);
$display_text = array(
"name_cache" => array(__("Name"), "ASC"),
"local_data_id" => array(__("ID"),"ASC"),
"data_input_name" => array(__("Data Input Method"), "ASC"),
"nosort" => array(__("Poller Interval"), "ASC"),
"active" => array(__("Active"), "ASC"),
"data_template_name" => array(__("Template Name"), "ASC"));
html_header_sort_checkbox($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction"));
if (sizeof($data_sources) > 0) {
foreach ($data_sources as $data_source) {
$data_source = api_plugin_hook_function('data_sources_table', $data_source);
$data_template_name = ((empty($data_source["data_template_name"])) ? "<em>" . __("None") . "</em>" : $data_source["data_template_name"]);
$data_input_name = ((empty($data_source["data_input_name"])) ? "<em>" . __("External") . "</em>" : $data_source["data_input_name"]);
$poller_interval = ((isset($poller_intervals[$data_source["local_data_id"]])) ? $poller_intervals[$data_source["local_data_id"]] : 0);
form_alternate_row_color('line' . $data_source["local_data_id"], true);
form_selectable_cell("<a class='linkEditMain' href='" . htmlspecialchars("data_sources.php?action=data_source_edit&id=" . $data_source["local_data_id"]) . "' title='" . htmlspecialchars($data_source["name_cache"]) . "'>" . (($_REQUEST["filter"] != "") ? preg_replace("/(" . preg_quote($_REQUEST["filter"]) . ")/i", "<span class=\"filter\">\\1</span>", title_trim(htmlentities($data_source["name_cache"], ENT_NOQUOTES, "UTF-8"), read_config_option("max_title_data_source"))) : title_trim(htmlentities($data_source["name_cache"], ENT_NOQUOTES, "UTF-8"), read_config_option("max_title_data_source"))) . "</a>", $data_source["local_data_id"]);
form_selectable_cell($data_source['local_data_id'], $data_source['local_data_id']);
form_selectable_cell((($_REQUEST["filter"] != "") ? preg_replace("/(" . preg_quote($_REQUEST["filter"]) . ")/i", "<span class=\"filter\">\\1</span>", $data_input_name) : $data_input_name), $data_source["local_data_id"]);
form_selectable_cell(get_poller_interval($poller_interval), $data_source["local_data_id"]);
form_selectable_cell(($data_source['active'] == CHECKED ? "Yes" : "No"), $data_source["local_data_id"]);
form_selectable_cell((($_REQUEST["filter"] != "") ? preg_replace("/(" . preg_quote($_REQUEST["filter"]) . ")/i", "<span class=\"filter\">\\1</span>", $data_source['data_template_name']) : $data_source['data_template_name']), $data_source["local_data_id"]);
form_checkbox_cell($data_source["name_cache"], $data_source["local_data_id"]);
form_end_row();
}
form_end_table();
/* put the nav bar on the bottom as well */
print $nav;
}else{
print "<tr><td><em>" . __("No Data Sources") . "</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($ds_actions);
print "</form>\n"; # end form of html_header_sort_checkbox
}
示例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: ds
function ds()
{
global $colors, $ds_actions;
/* ================= input validation ================= */
input_validate_input_number(get_request_var_request("host_id"));
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_ds_current_page");
kill_session_var("sess_ds_filter");
kill_session_var("sess_ds_sort_column");
kill_session_var("sess_ds_sort_direction");
kill_session_var("sess_ds_host_id");
unset($_REQUEST["page"]);
unset($_REQUEST["filter"]);
unset($_REQUEST["sort_column"]);
unset($_REQUEST["sort_direction"]);
unset($_REQUEST["host_id"]);
}
/* remember these search fields in session vars so we don't have to keep passing them around */
load_current_session_value("page", "sess_ds_current_page", "1");
load_current_session_value("filter", "sess_ds_filter", "");
load_current_session_value("sort_column", "sess_ds_sort_column", "name_cache");
load_current_session_value("sort_direction", "sess_ds_sort_direction", "ASC");
load_current_session_value("host_id", "sess_ds_host_id", "-1");
$host = db_fetch_row("select hostname from host where id=" . $_REQUEST["host_id"]);
html_start_box("<strong>Data Sources</strong> [host: " . (empty($host["hostname"]) ? "No Host" : $host["hostname"]) . "]", "100%", $colors["header"], "3", "center", "data_sources.php?action=ds_edit&host_id=" . $_REQUEST["host_id"]);
include "./include/html/inc_data_source_filter_table.php";
html_end_box();
/* form the 'where' clause for our main sql query */
if (strlen($_REQUEST["filter"])) {
$sql_where = "AND (data_template_data.name_cache like '%%" . $_REQUEST["filter"] . "%%'" . " OR data_template.name like '%%" . $_REQUEST["filter"] . "%%'" . " OR data_input.name like '%%" . $_REQUEST["filter"] . "%%')";
} else {
$sql_where = "";
}
if ($_REQUEST["host_id"] == "-1") {
/* Show all items */
} elseif ($_REQUEST["host_id"] == "0") {
$sql_where .= " AND data_local.host_id=0";
} elseif (!empty($_REQUEST["host_id"])) {
$sql_where .= " AND data_local.host_id=" . $_REQUEST["host_id"];
}
$total_rows = sizeof(db_fetch_assoc("SELECT\n\t\tdata_local.id\n\t\tFROM (data_local,data_template_data)\n\t\tLEFT JOIN data_input\n\t\tON (data_input.id=data_template_data.data_input_id)\n\t\tLEFT JOIN data_template\n\t\tON (data_local.data_template_id=data_template.id)\n\t\tWHERE data_local.id=data_template_data.local_data_id\n\t\t{$sql_where}"));
$poller_intervals = array_rekey(db_fetch_assoc("SELECT data_template_data.local_data_id AS id,\n\t\tMin(data_template_data.rrd_step*rra.steps) AS poller_interval\n\t\tFROM data_template\n\t\tINNER JOIN (data_local\n\t\tINNER JOIN ((data_template_data_rra\n\t\tINNER JOIN data_template_data ON data_template_data_rra.data_template_data_id=data_template_data.id)\n\t\tINNER JOIN rra ON data_template_data_rra.rra_id = rra.id) ON data_local.id = data_template_data.local_data_id) ON data_template.id = data_template_data.data_template_id\n\t\t{$sql_where}\n\t\tGROUP BY data_template_data.local_data_id"), "id", "poller_interval");
$data_sources = db_fetch_assoc("SELECT\n\t\tdata_template_data.local_data_id,\n\t\tdata_template_data.name_cache,\n\t\tdata_template_data.active,\n\t\tdata_input.name as data_input_name,\n\t\tdata_template.name as data_template_name,\n\t\tdata_local.host_id\n\t\tFROM (data_local,data_template_data)\n\t\tLEFT JOIN data_input\n\t\tON (data_input.id=data_template_data.data_input_id)\n\t\tLEFT JOIN data_template\n\t\tON (data_local.data_template_id=data_template.id)\n\t\tWHERE data_local.id=data_template_data.local_data_id\n\t\t{$sql_where}\n\t\tORDER BY " . $_REQUEST['sort_column'] . " " . $_REQUEST['sort_direction'] . " LIMIT " . read_config_option("num_rows_data_source") * ($_REQUEST["page"] - 1) . "," . read_config_option("num_rows_data_source"));
html_start_box("", "100%", $colors["header"], "3", "center", "");
/* generate page list */
$url_page_select = get_page_list($_REQUEST["page"], MAX_DISPLAY_PAGES, read_config_option("num_rows_data_source"), $total_rows, "data_sources.php?filter=" . $_REQUEST["filter"] . "&host_id=" . $_REQUEST["host_id"]);
$nav = "<tr bgcolor='#" . $colors["header"] . "'>\n\t\t\t<td colspan='6'>\n\t\t\t\t<table width='100%' cellspacing='0' cellpadding='0' border='0'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align='left' class='textHeaderDark'>\n\t\t\t\t\t\t\t<strong><< ";
if ($_REQUEST["page"] > 1) {
$nav .= "<a class='linkOverDark' href='data_sources.php?filter=" . $_REQUEST["filter"] . "&host_id=" . $_REQUEST["host_id"] . "&page=" . ($_REQUEST["page"] - 1) . "'>";
}
$nav .= "Previous";
if ($_REQUEST["page"] > 1) {
$nav .= "</a>";
}
$nav .= "</strong>\n\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t<td align='center' class='textHeaderDark'>\n\t\t\t\t\t\t\tShowing Rows " . (read_config_option("num_rows_data_source") * ($_REQUEST["page"] - 1) + 1) . " to " . ($total_rows < read_config_option("num_rows_data_source") || $total_rows < read_config_option("num_rows_data_source") * $_REQUEST["page"] ? $total_rows : read_config_option("num_rows_data_source") * $_REQUEST["page"]) . " of {$total_rows} [{$url_page_select}]\n\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t<td align='right' class='textHeaderDark'>\n\t\t\t\t\t\t\t<strong>";
if ($_REQUEST["page"] * read_config_option("num_rows_data_source") < $total_rows) {
$nav .= "<a class='linkOverDark' href='data_sources.php?filter=" . $_REQUEST["filter"] . "&host_id=" . $_REQUEST["host_id"] . "&page=" . ($_REQUEST["page"] + 1) . "'>";
}
$nav .= "Next";
if ($_REQUEST["page"] * read_config_option("num_rows_data_source") < $total_rows) {
$nav .= "</a>";
}
$nav .= " >></strong>\n\t\t\t\t\t\t</td>\n\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n";
print $nav;
$display_text = array("name_cache" => array("Name", "ASC"), "data_input_name" => array("Data Input Method", "ASC"), "nosort" => array("Poller<br>Interval", "ASC"), "active" => array("Active", "ASC"), "data_template_name" => array("Template Name", "ASC"));
html_header_sort_checkbox($display_text, $_REQUEST["sort_column"], $_REQUEST["sort_direction"]);
$i = 0;
if (sizeof($data_sources) > 0) {
foreach ($data_sources as $data_source) {
$data_template_name = empty($data_source["data_template_name"]) ? "<em>None</em>" : $data_source["data_template_name"];
$data_input_name = empty($data_source["data_input_name"]) ? "<em>External</em>" : $data_source["data_input_name"];
$poller_interval = isset($poller_intervals[$data_source["local_data_id"]]) ? $poller_intervals[$data_source["local_data_id"]] : 0;
form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $data_source["local_data_id"]);
$i++;
form_selectable_cell("<a class='linkEditMain' href='data_sources.php?action=ds_edit&id=" . $data_source["local_data_id"] . "'>" . ($_REQUEST["filter"] != "" ? eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", title_trim(htmlentities($data_source["name_cache"]), read_config_option("max_title_data_source"))) : title_trim(htmlentities($data_source["name_cache"]), read_config_option("max_title_data_source"))) . "</a>", $data_source["local_data_id"]);
form_selectable_cell(($_REQUEST["filter"] != "" ? eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $data_input_name) : $data_input_name) . "</a>", $data_source["local_data_id"]);
form_selectable_cell(get_poller_interval($poller_interval), $data_source["local_data_id"]);
form_selectable_cell($data_source['active'], $data_source["local_data_id"]);
form_selectable_cell(($_REQUEST["filter"] != "" ? eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $data_source['data_template_name']) : $data_source['data_template_name']) . "</a>", $data_source["local_data_id"]);
form_checkbox_cell($data_source["name_cache"], $data_source["local_data_id"]);
form_end_row();
}
/* put the nav bar on the bottom as well */
print $nav;
} else {
//.........这里部分代码省略.........
示例6: syslog_alerts
//.........这里部分代码省略.........
unset($_REQUEST["rows"]);
unset($_REQUEST["sort_column"]);
unset($_REQUEST["sort_direction"]);
} else {
/* if any of the settings changed, reset the page number */
$changed = 0;
$changed += syslog_check_changed("filter", "sess_syslog_alerts_filter");
$changed += syslog_check_changed("enabled", "sess_syslog_alerts_enabled");
$changed += syslog_check_changed("rows", "sess_syslog_alerts_rows");
$changed += syslog_check_changed("sort_column", "sess_syslog_alerts_sort_column");
$changed += syslog_check_changed("sort_direction", "sess_syslog_alerts_sort_direction");
if ($changed) {
$_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_syslog_alerts_paage", "1");
load_current_session_value("rows", "sess_syslog_alerts_rows", "-1");
load_current_session_value("enabled", "sess_syslog_alerts_enabled", "-1");
load_current_session_value("filter", "sess_syslog_alerts_filter", "");
load_current_session_value("sort_column", "sess_syslog_alerts_sort_column", "name");
load_current_session_value("sort_direction", "sess_syslog_alerts_sort_direction", "ASC");
html_start_box("<strong>Syslog Alert Filters</strong>", "100%", $colors["header"], "3", "center", "syslog_alerts.php?action=edit");
syslog_filter();
html_end_box();
html_start_box("", "100%", $colors["header"], "3", "center", "");
$sql_where = "";
if ($_REQUEST["rows"] == "-1") {
$row_limit = read_config_option("num_rows_syslog");
} elseif ($_REQUEST["rows"] == -2) {
$row_limit = 999999;
} else {
$row_limit = $_REQUEST["rows"];
}
$alerts = syslog_get_alert_records($sql_where, $row_limit);
$rows_query_string = "SELECT COUNT(*)\n\t\tFROM `" . $syslogdb_default . "`.`syslog_alert`\n\t\t{$sql_where}";
$total_rows = syslog_db_fetch_cell($rows_query_string);
?>
<script type="text/javascript">
<!--
function applyChange(objForm) {
strURL = '?enabled=' + objForm.enabled.value;
strURL = strURL + '&filter=' + objForm.filter.value;
strURL = strURL + '&rows=' + objForm.rows.value;
document.location = strURL;
}
-->
</script>
<?php
/* generate page list */
$url_page_select = get_page_list($_REQUEST["page"], MAX_DISPLAY_PAGES, $row_limit, $total_rows, "syslog_alerts.php?filter=" . $_REQUEST["filter"]);
if ($total_rows > 0) {
$nav = "<tr bgcolor='#" . $colors["header"] . "'>\n\t\t\t\t\t<td colspan='13'>\n\t\t\t\t\t\t<table width='100%' cellspacing='0' cellpadding='0' border='0'>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align='left' class='textHeaderDark'>\n\t\t\t\t\t\t\t\t\t<strong><< ";
if ($_REQUEST["page"] > 1) {
$nav .= "<a class='linkOverDark' href='syslog_alerts.php?report=arp&page=" . ($_REQUEST["page"] - 1) . "'>";
}
$nav .= "Previous";
if ($_REQUEST["page"] > 1) {
$nav .= "</a>";
}
$nav .= "</strong>\n\t\t\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t\t\t<td align='center' class='textHeaderDark'>\n\t\t\t\t\t\t\t\t\tShowing Rows " . ($total_rows == 0 ? "None" : $row_limit * ($_REQUEST["page"] - 1) + 1 . " to " . ($total_rows < $row_limit || $total_rows < $row_limit * $_REQUEST["page"] ? $total_rows : $row_limit * $_REQUEST["page"]) . " of {$total_rows} [{$url_page_select}]") . "\n\t\t\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t\t\t<td align='right' class='textHeaderDark'>\n\t\t\t\t\t\t\t\t\t<strong>";
if ($_REQUEST["page"] * $row_limit < $total_rows) {
$nav .= "<a class='linkOverDark' href='syslog_alerts.php?report=arp&page=" . ($_REQUEST["page"] + 1) . "'>";
}
$nav .= "Next";
if ($_REQUEST["page"] * $row_limit < $total_rows) {
$nav .= "</a>";
}
$nav .= " >></strong>\n\t\t\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n";
} else {
$nav = "<tr bgcolor='#" . $colors["header"] . "' class='noprint'>\n\t\t\t\t\t<td colspan='22'>\n\t\t\t\t\t\t<table width='100%' cellspacing='0' cellpadding='0' border='0'>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align='center' class='textHeaderDark'>\n\t\t\t\t\t\t\t\t\tNo Rows Found\n\t\t\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n";
}
print $nav;
$display_text = array("name" => array("Alert<br>Name", "ASC"), "severity" => array("<br>Severity", "ASC"), "method" => array("<br>Method", "ASC"), "num" => array("Threshold<br>Count", "ASC"), "enabled" => array("<br>Enabled", "ASC"), "type" => array("Match<br>Type", "ASC"), "message" => array("Search<br>String", "ASC"), "email" => array("E-Mail<br>Addresses", "DESC"), "date" => array("Last<br>Modified", "ASC"), "user" => array("By<br>User", "DESC"));
html_header_sort_checkbox($display_text, $_REQUEST["sort_column"], $_REQUEST["sort_direction"]);
$i = 0;
if (sizeof($alerts) > 0) {
foreach ($alerts as $alert) {
form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $alert["id"]);
$i++;
form_selectable_cell("<a class='linkEditMain' href='" . $config['url_path'] . "plugins/syslog/syslog_alerts.php?action=edit&id=" . $alert["id"] . "'>" . ($_REQUEST["filter"] != "" ? eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $alert["name"]) : $alert["name"]) . "</a>", $alert["id"]);
form_selectable_cell($severities[$alert["severity"]], $alert["id"]);
form_selectable_cell($alert["method"] == 1 ? "Threshold" : "Individual", $alert["id"]);
form_selectable_cell($alert["method"] == 1 ? $alert["num"] : "N/A", $alert["id"]);
form_selectable_cell($alert["enabled"] == "on" ? "Yes" : "No", $alert["id"]);
form_selectable_cell($message_types[$alert["type"]], $alert["id"]);
form_selectable_cell(title_trim($alert["message"], 60), $alert["id"]);
form_selectable_cell(substr_count($alert["email"], ",") ? "Multiple" : $alert["email"], $alert["id"]);
form_selectable_cell(date("Y-m-d H:i:s", $alert["date"]), $alert["id"]);
form_selectable_cell($alert["user"], $alert["id"]);
form_checkbox_cell($alert["name"], $alert["id"]);
form_end_row();
}
} else {
print "<tr><td colspan='4'><em>No Syslog Alerts Defined</em></td></tr>";
}
html_end_box(false);
/* draw the dropdown containing a list of available actions for this form */
draw_actions_dropdown($syslog_actions);
}
示例7: host
//.........这里部分代码省略.........
</select>
</td>
<td 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 */
if (strlen(get_request_var_request("filter"))) {
$sql_where = "where (host.hostname like '%%" . get_request_var_request("filter") . "%%' OR host.description like '%%" . get_request_var_request("filter") . "%%')";
} else {
$sql_where = "";
}
if (get_request_var_request("host_status") == "-1") {
/* Show all items */
} elseif (get_request_var_request("host_status") == "-2") {
$sql_where .= strlen($sql_where) ? " and host.disabled='on'" : "where host.disabled='on'";
} elseif (get_request_var_request("host_status") == "-3") {
$sql_where .= strlen($sql_where) ? " and host.disabled=''" : "where host.disabled=''";
} elseif (get_request_var_request("host_status") == "-4") {
$sql_where .= strlen($sql_where) ? " and (host.status!='3' or host.disabled='on')" : "where (host.status!='3' or host.disabled='on')";
} else {
$sql_where .= strlen($sql_where) ? " and (host.status=" . get_request_var_request("host_status") . " AND host.disabled = '')" : "where (host.status=" . get_request_var_request("host_status") . " AND host.disabled = '')";
}
if (get_request_var_request("host_template_id") == "-1") {
/* Show all items */
} elseif (get_request_var_request("host_template_id") == "0") {
$sql_where .= strlen($sql_where) ? " and host.host_template_id=0" : "where host.host_template_id=0";
} elseif (!empty($_REQUEST["host_template_id"])) {
$sql_where .= strlen($sql_where) ? " and host.host_template_id=" . get_request_var_request("host_template_id") : "where host.host_template_id=" . get_request_var_request("host_template_id");
}
html_start_box("", "100%", $colors["header"], "3", "center", "");
$total_rows = db_fetch_cell("select\n\t\tCOUNT(host.id)\n\t\tfrom host\n\t\t{$sql_where}");
$sortby = get_request_var_request("sort_column");
if ($sortby == "hostname") {
$sortby = "INET_ATON(hostname)";
}
$host_graphs = array_rekey(db_fetch_assoc("SELECT host_id, count(*) as graphs FROM graph_local GROUP BY host_id"), "host_id", "graphs");
$host_data_sources = array_rekey(db_fetch_assoc("SELECT host_id, count(*) as data_sources FROM data_local GROUP BY host_id"), "host_id", "data_sources");
$sql_query = "SELECT *\n\t\tFROM host\n\t\t{$sql_where}\n\t\tORDER BY " . $sortby . " " . get_request_var_request("sort_direction") . "\n\t\tLIMIT " . get_request_var_request("host_rows") * (get_request_var_request("page") - 1) . "," . get_request_var_request("host_rows");
$hosts = db_fetch_assoc($sql_query);
/* generate page list */
$url_page_select = get_page_list(get_request_var_request("page"), MAX_DISPLAY_PAGES, get_request_var_request("host_rows"), $total_rows, "host.php?filter=" . get_request_var_request("filter") . "&host_template_id=" . get_request_var_request("host_template_id") . "&host_status=" . get_request_var_request("host_status"));
$nav = "<tr bgcolor='#" . $colors["header"] . "'>\n\t\t\t<td colspan='11'>\n\t\t\t\t<table width='100%' cellspacing='0' cellpadding='0' border='0'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align='left' class='textHeaderDark'>\n\t\t\t\t\t\t\t<strong><< ";
if (get_request_var_request("page") > 1) {
$nav .= "<a class='linkOverDark' href='host.php?filter=" . get_request_var_request("filter") . "&host_template_id=" . get_request_var_request("host_template_id") . "&host_status=" . get_request_var_request("host_status") . "&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\t</td>\n\n\t\t\t\t\t\t<td align='center' class='textHeaderDark'>\n\t\t\t\t\t\t\tShowing Rows " . (get_request_var_request("host_rows") * (get_request_var_request("page") - 1) + 1) . " to " . ($total_rows < read_config_option("num_rows_device") || $total_rows < get_request_var_request("host_rows") * get_request_var_request("page") ? $total_rows : get_request_var_request("host_rows") * get_request_var_request("page")) . " of {$total_rows} [{$url_page_select}]\n\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t<td align='right' class='textHeaderDark'>\n\t\t\t\t\t\t\t<strong>";
if (get_request_var_request("page") * get_request_var_request("host_rows") < $total_rows) {
$nav .= "<a class='linkOverDark' href='host.php?filter=" . get_request_var_request("filter") . "&host_template_id=" . get_request_var_request("host_template_id") . "&host_status=" . get_request_var_request("host_status") . "&page=" . (get_request_var_request("page") + 1) . "'>";
}
$nav .= "Next";
if (get_request_var_request("page") * get_request_var_request("host_rows") < $total_rows) {
$nav .= "</a>";
}
$nav .= " >></strong>\n\t\t\t\t\t\t</td>\n\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n";
print $nav;
$display_text = array("description" => array("Description", "ASC"), "id" => array("ID", "ASC"), "nosort1" => array("Graphs", "ASC"), "nosort2" => array("Data Sources", "ASC"), "status" => array("Status", "ASC"), "status_event_count" => array("Event Count", "ASC"), "hostname" => array("Hostname", "ASC"), "cur_time" => array("Current (ms)", "DESC"), "avg_time" => array("Average (ms)", "DESC"), "availability" => array("Availability", "ASC"));
html_header_sort_checkbox($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction"));
$i = 0;
if (sizeof($hosts) > 0) {
foreach ($hosts as $host) {
form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $host["id"]);
$i++;
form_selectable_cell("<a class='linkEditMain' href='host.php?action=edit&id=" . $host["id"] . "'>" . (strlen(get_request_var_request("filter")) ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $host["description"]) : $host["description"]) . "</a>", $host["id"], 250);
form_selectable_cell(round($host["id"], 2), $host["id"]);
form_selectable_cell(isset($host_graphs[$host["id"]]) ? $host_graphs[$host["id"]] : 0, $host["id"]);
form_selectable_cell(isset($host_data_sources[$host["id"]]) ? $host_data_sources[$host["id"]] : 0, $host["id"]);
form_selectable_cell(get_colored_device_status($host["disabled"] == "on" ? true : false, $host["status"]), $host["id"]);
form_selectable_cell(round($host["status_event_count"], 2), $host["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>", $host["hostname"]) : $host["hostname"], $host["id"]);
form_selectable_cell(round($host["cur_time"], 2), $host["id"]);
form_selectable_cell(round($host["avg_time"], 2), $host["id"]);
form_selectable_cell(round($host["availability"], 2), $host["id"]);
form_checkbox_cell($host["description"], $host["id"]);
form_end_row();
}
/* put the nav bar on the bottom as well */
print $nav;
} else {
print "<tr><td><em>No Hosts</em></td></tr>";
}
html_end_box(false);
/* add a list of tree names to the actions dropdown */
add_tree_names_to_actions_array();
/* draw the dropdown containing a list of available actions for this form */
draw_actions_dropdown($device_actions);
print "</form>\n";
}
示例8: poller
//.........这里部分代码省略.........
</td>
<td class="w1">
<select name="rows" onChange="applyFilterChange(document.form_pollers)">
<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 ">" . $value . "</option>\n";
}
}
?>
</select>
</td>
<td class="nw120">
<input type="submit" Value="<?php print __("Go");?>" name="go" align="middle">
<input type="submit" Value="<?php print __("Clear");?>" name="clear_x" align="middle">
</td>
</tr>
</table>
<div><input type='hidden' name='page' value='1'></div>
</form>
</td>
</tr>
<?php
html_end_box(false);
/* form the 'where' clause for our main sql query */
if ($_REQUEST["filter"] != "") {
$sql_where = "WHERE (p.description LIKE '%%" . $_REQUEST["filter"] . "%%')";
}else{
$sql_where = "";
}
html_start_box("", "100", $colors["header"], "0", "center", "");
$total_rows = db_fetch_cell("SELECT
COUNT(*)
FROM poller
$sql_where");
if (get_request_var_request("rows") == "-1") {
$rows = read_config_option("num_rows_device");
}else{
$rows = get_request_var_request("rows");
}
$poller_list = db_fetch_assoc("SELECT p.*,
sum(CASE WHEN h.poller_id IS NOT NULL THEN 1 ELSE NULL END) AS total_devices
FROM poller AS p
LEFT JOIN device AS h ON h.poller_id=p.id
$sql_where
GROUP BY p.id
ORDER BY " . get_request_var_request('sort_column') . " " . get_request_var_request('sort_direction') .
" LIMIT " . ($rows*(get_request_var_request("page")-1)) . "," . $rows);
/* generate page list navigation */
$nav = html_create_nav($_REQUEST["page"], MAX_DISPLAY_PAGES, $rows, $total_rows, 7, "pollers.php");
print $nav;
html_end_box(false);
$display_text = array(
"description" => array(__("Description"), "ASC"),
"id" => array(__("ID"), "ASC"),
"total_devices" => array(__("Devices"), "DESC"),
"nosort2" => array(__("Poller Items"), "DESC"),
"hostname" => array(__("Hostname"), "ASC"),
"nosort1" => array(__("Status"), ""),
"last_update" => array(__("Last Updated"), "ASC"));
html_header_sort_checkbox($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction"));
if (sizeof($poller_list) > 0) {
foreach ($poller_list as $poller) {
form_alternate_row_color('line' . $poller["id"], true);
form_selectable_cell("<a class='linkEditMain' href='" . htmlspecialchars("pollers.php?action=edit&id=" . $poller["id"]) . "'>" . (strlen($_REQUEST["filter"]) ? preg_replace("/(" . preg_quote($_REQUEST["filter"]) . ")/i", "<span class=\"filter\">\\1</span>", $poller["description"]) : $poller["description"]) . "</a>", $poller["id"]);
form_selectable_cell($poller["id"], $poller["id"]);
form_selectable_cell($poller["total_devices"], $poller["id"]);
form_selectable_cell(db_fetch_cell("SELECT count(*) FROM poller_item WHERE poller_id=" . $poller["id"]), $poller["id"]);
form_selectable_cell($poller["hostname"], $poller["id"]);
form_selectable_cell(get_colored_poller_status(($poller["disabled"] == CHECKED ? true : false), $poller["last_update"]), $poller["id"]);
form_selectable_cell($poller["last_update"], $poller["id"]);
form_checkbox_cell($poller["description"], $poller["id"]);
form_end_row();
}
form_end_table();
/* put the nav bar on the bottom as well */
print $nav;
}else{
print "<tr><td><em>" . __("No Pollers Defined") . "</em></td></tr>\n";
}
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($poller_actions);
print "</form>\n"; # end form of html_header_sort_checkbox
}
示例9: 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";
}
示例10: 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'>
<input type='hidden' name='graph_list' value='<?php
示例11: 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();
}
示例12: 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();
//.........这里部分代码省略.........
示例13: 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'>
<input type='hidden' id='graph_list' name='graph_list' value='<?php
示例14: 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();
}
示例15: 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";
}