当前位置: 首页>>代码示例>>PHP>>正文


PHP html_header_checkbox函数代码示例

本文整理汇总了PHP中html_header_checkbox函数的典型用法代码示例。如果您正苦于以下问题:PHP html_header_checkbox函数的具体用法?PHP html_header_checkbox怎么用?PHP html_header_checkbox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了html_header_checkbox函数的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";
}
开发者ID:tinchobsas,项目名称:cacti-gpsmaps,代码行数:32,代码来源:gpstemplates.php

示例2: graph

function graph() {
	global $colors, $graph_actions;

	/* if the user pushed the 'clear' button */
	if (isset($_REQUEST["clear_x"])) {
		kill_session_var("sess_graph_current_page");
		kill_session_var("sess_graph_filter");
		kill_session_var("sess_graph_host_id");

		unset($_REQUEST["page"]);
		unset($_REQUEST["filter"]);
		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_graph_current_page", "1");
	load_current_session_value("filter", "sess_graph_filter", "");
	load_current_session_value("host_id", "sess_graph_host_id", "-1");

	html_start_box("<strong>Graph Management</strong>", "98%", $colors["header"], "3", "center", "graphs.php?action=graph_edit&host_id=" . $_REQUEST["host_id"]);

	include("./include/html/inc_graph_filter_table.php");

	html_end_box();

	/* form the 'where' clause for our main sql query */
	$sql_where = "and graph_templates_graph.title_cache like '%%" . $_REQUEST["filter"] . "%%'";

	if ($_REQUEST["host_id"] == "-1") {
		/* Show all items */
	}elseif ($_REQUEST["host_id"] == "0") {
		$sql_where .= " and graph_local.host_id=0";
	}elseif (!empty($_REQUEST["host_id"])) {
		$sql_where .= " and graph_local.host_id=" . $_REQUEST["host_id"];
	}

	html_start_box("", "98%", $colors["header"], "3", "center", "");

	$total_rows = db_fetch_cell("select
		COUNT(graph_templates_graph.id)
		from graph_local,graph_templates_graph
		where graph_local.id=graph_templates_graph.local_graph_id
		$sql_where");

	$graph_list = db_fetch_assoc("select
		graph_templates_graph.id,
		graph_templates_graph.local_graph_id,
		graph_templates_graph.height,
		graph_templates_graph.width,
		graph_templates_graph.title_cache,
		graph_templates.name,
		graph_local.host_id
		from graph_local,graph_templates_graph
		left join graph_templates on graph_local.graph_template_id=graph_templates.id
		where graph_local.id=graph_templates_graph.local_graph_id
		$sql_where
		order by graph_templates_graph.title_cache,graph_local.host_id
		limit " . (read_config_option("num_rows_graph")*($_REQUEST["page"]-1)) . "," . read_config_option("num_rows_graph"));

	/* generate page list */
	$url_page_select = get_page_list($_REQUEST["page"], MAX_DISPLAY_PAGES, read_config_option("num_rows_graph"), $total_rows, "graphs.php?filter=" . $_REQUEST["filter"] . "&host_id=" . $_REQUEST["host_id"]);

	$nav = "<tr bgcolor='#" . $colors["header"] . "'>
			<td colspan='4'>
				<table width='100%' cellspacing='0' cellpadding='0' border='0'>
					<tr>
						<td align='left' class='textHeaderDark'>
							<strong>&lt;&lt; "; if ($_REQUEST["page"] > 1) { $nav .= "<a class='linkOverDark' href='graphs.php?filter=" . $_REQUEST["filter"] . "&host_id=" . $_REQUEST["host_id"] . "&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_graph")*($_REQUEST["page"]-1))+1) . " to " . ((($total_rows < read_config_option("num_rows_graph")) || ($total_rows < (read_config_option("num_rows_graph")*$_REQUEST["page"]))) ? $total_rows : (read_config_option("num_rows_graph")*$_REQUEST["page"])) . " of $total_rows [$url_page_select]
						</td>\n
						<td align='right' class='textHeaderDark'>
							<strong>"; if (($_REQUEST["page"] * read_config_option("num_rows_graph")) < $total_rows) { $nav .= "<a class='linkOverDark' href='graphs.php?filter=" . $_REQUEST["filter"] . "&host_id=" . $_REQUEST["host_id"] . "&page=" . ($_REQUEST["page"]+1) . "'>"; } $nav .= "Next"; if (($_REQUEST["page"] * read_config_option("num_rows_graph")) < $total_rows) { $nav .= "</a>"; } $nav .= " &gt;&gt;</strong>
						</td>\n
					</tr>
				</table>
			</td>
		</tr>\n";

	print $nav;

	html_header_checkbox(array("Graph Title", "Template Name", "Size"));

	$i = 0;
	if (sizeof($graph_list) > 0) {
		foreach ($graph_list as $graph) {
			form_alternate_row_color($colors["alternate"],$colors["light"],$i); $i++;
				?>
				<td>
					<a class="linkEditMain" href="graphs.php?action=graph_edit&id=<?php print $graph["local_graph_id"];?>"><?php print eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", title_trim($graph["title_cache"], read_config_option("max_title_graph")));?></a>
				</td>
				<td>
					<?php print ((empty($graph["name"])) ? "<em>None</em>" : $graph["name"]); ?>
				</td>
				<td>
					<?php print $graph["height"];?>x<?php print $graph["width"];?>
				</td>
				<td style="<?php print get_checkbox_style();?>" width="1%" align="right">
					<input type='checkbox' style='margin: 0px;' name='chk_<?php print $graph["local_graph_id"];?>' title="<?php print $graph["title_cache"];?>">
//.........这里部分代码省略.........
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:graphs.php

示例3: tholds_old


//.........这里部分代码省略.........
'>
		</form>
		</td>
	</tr>
	<?php 
    html_end_box();
    /* form the 'where' clause for our main sql query */
    if (strlen(get_request_var_request("filter"))) {
        $sql_where = "WHERE (host.hostname LIKE '%%" . get_request_var_request("filter") . "%%' OR host.description LIKE '%%" . get_request_var_request("filter") . "%%')";
    } else {
        $sql_where = "";
    }
    if (get_request_var_request("host_template_id") == "-1") {
        /* Show all items */
    } elseif (get_request_var_request("host_template_id") == "0") {
        $sql_where .= (strlen($sql_where) ? " AND " : "WHERE ") . " host.host_template_id=0";
    } elseif (!empty($_REQUEST["host_template_id"])) {
        $sql_where .= (strlen($sql_where) ? " AND " : "WHERE ") . " host.host_template_id=" . get_request_var_request("host_template_id");
    }
    if (get_request_var_request("associated") == "false") {
        /* Show all items */
    } else {
        $sql_where .= (strlen($sql_where) ? " AND " : "WHERE ") . " (host.thold_send_email>1 AND host.thold_host_email=" . get_request_var_request("id") . ")";
    }
    /* print checkbox form for validation */
    print "<form name='chk' method='post' action='notify_lists.php?action=edit&tab=hosts&id=" . get_request_var_request("id") . "'>\n";
    html_start_box("", "100%", $colors["header"], "3", "center", "");
    $total_rows = db_fetch_cell("SELECT\n\t\tCOUNT(*)\n\t\tFROM host\n\t\t{$sql_where}");
    $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 {$sql_where} \n\t\tLIMIT " . get_request_var_request("rows") * (get_request_var_request("page") - 1) . "," . get_request_var_request("rows");
    $hosts = db_fetch_assoc($sql_query);
    /* generate page list */
    if ($total_rows > 0) {
        $url_page_select = get_page_list(get_request_var_request("page"), MAX_DISPLAY_PAGES, get_request_var_request("rows"), $total_rows, "notify_lists.php?action=edit&tab=hosts&id=" . get_request_var_request('id'));
        $nav = "<tr bgcolor='#" . $colors["header"] . "'>\n\t\t\t\t<td colspan='8'>\n\t\t\t\t\t<table width='100%' cellspacing='0' cellpadding='0' border='0'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='left' class='textHeaderDark'>\n\t\t\t\t\t\t\t\t<strong>&lt;&lt; ";
        if (get_request_var_request("page") > 1) {
            $nav .= "<a class='linkOverDark' href='" . htmlspecialchars("notify_lists.php?action=edit&id=" . get_request_var_request("id") . "&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\t</td>\n\n\t\t\t\t\t\t\t<td align='center' class='textHeaderDark'>\n\t\t\t\t\t\t\t\tShowing Rows " . (get_request_var_request("rows") * (get_request_var_request("page") - 1) + 1) . " to " . ($total_rows < read_config_option("num_rows_device") || $total_rows < get_request_var_request("rows") * get_request_var_request("page") ? $total_rows : get_request_var_request("rows") * get_request_var_request("page")) . " of {$total_rows} [{$url_page_select}]\n\t\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t\t<td align='right' class='textHeaderDark'>\n\t\t\t\t\t\t\t\t\t\t<strong>";
        if (get_request_var_request("page") * get_request_var_request("rows") < $total_rows) {
            $nav .= "<a class='linkOverDark' href='" . htmlspecialchars("notify_lists.php?action=edit&id=" . get_request_var_request("id") . "&page=" . (get_request_var_request("page") + 1)) . "'>";
        }
        $nav .= "Next";
        if (get_request_var_request("page") * get_request_var_request("rows") < $total_rows) {
            $nav .= "</a>";
        }
        $nav .= " &gt;&gt;</strong>\n\t\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n";
    } else {
        $nav = "<tr bgcolor='#" . $colors["header"] . "'>\n\t\t\t\t<td colspan='8'>\n\t\t\t\t\t<table width='100%' cellspacing='0' cellpadding='0' border='0'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='center' class='textHeaderDark'>\n\t\t\t\t\t\t\t\tNo Rows Found\n\t\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n";
    }
    print $nav;
    $display_text = array("Description", "ID", "Associated Lists", "Graphs", "Data Sources", "Status", "Hostname");
    html_header_checkbox($display_text);
    $i = 0;
    if (sizeof($hosts)) {
        foreach ($hosts as $host) {
            form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $host["id"]);
            $i++;
            form_selectable_cell(strlen(get_request_var_request("filter")) ? preg_replace("/(" . preg_quote(get_request_var_request("filter")) . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", htmlspecialchars($host["description"])) : htmlspecialchars($host["description"]), $host["id"], 250);
            form_selectable_cell(round($host["id"], 2), $host["id"]);
            if ($host['thold_send_email'] == 0) {
                form_selectable_cell('<span style="color:blue;font-weight:bold;">Disabled</span>', $host['id']);
            } elseif ($host['thold_send_email'] == 1) {
                form_selectable_cell('<span style="color:purple;font-weight:bold;">Global List</span>', $host['id']);
            } elseif ($host['thold_host_email'] == get_request_var_request('id')) {
                if ($host['thold_send_email'] == 2) {
                    form_selectable_cell('<span style="color:green;font-weight:bold;">Current List Only</span>', $host['id']);
                } else {
                    form_selectable_cell('<span style="color:green;font-weight:bold;">Current and Global List(s)</span>', $host['id']);
                }
            } elseif ($host['thold_host_email'] == '0') {
                form_selectable_cell('<span style="color:green;font-weight:bold;">None</span>', $host['id']);
            } else {
                form_selectable_cell('<span style="color:red;font-weight:bold;">' . db_fetch_cell("SELECT name FROM plugin_notification_lists WHERE id=" . get_request_var_request('id')) . '</span>', $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(strlen(get_request_var_request("filter")) ? preg_replace("/(" . preg_quote(get_request_var_request("filter")) . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", htmlspecialchars($host["hostname"])) : htmlspecialchars($host["hostname"]), $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 Associated Hosts Found</em></td></tr>";
    }
    html_end_box(false);
    form_hidden_box("action", "edit");
    form_hidden_box("id", get_request_var_request("id"));
    form_hidden_box("save_associate", "1");
    /* draw the dropdown containing a list of available actions for this form */
    draw_actions_dropdown($assoc_actions);
    print "</form>\n";
}
开发者ID:caiorasec,项目名称:thold,代码行数:101,代码来源:notify_lists.php

示例4: template

function template() {
	global $colors, $ds_actions;

	html_start_box("<strong>Data Templates</strong>", "98%", $colors["header"], "3", "center", "data_templates.php?action=template_edit");

	html_header_checkbox(array("Template Name", "Data Input Method", "Status"));

	$template_list = db_fetch_assoc("select
		data_template.id,
		data_template.name,
		data_input.name as data_input_method,
		data_template_data.active as active
		from data_template,data_template_data
		left join data_input on data_template_data.data_input_id = data_input.id
		where data_template.id = data_template_data.data_template_id
		and data_template_data.local_data_id = 0
		order by data_template.name");

	$i = 0;
	if (sizeof($template_list) > 0) {
	foreach ($template_list as $template) {
		form_alternate_row_color($colors["alternate"],$colors["light"],$i);
			?>
			<td>
				<a class="linkEditMain" href="data_templates.php?action=template_edit&id=<?php print $template["id"];?>"><?php print $template["name"];?></a>
			</td>
			<td>
				<?php print (empty($template["data_input_method"]) ? "<em>None</em>": $template["data_input_method"]);?>
			</td>
			<td>
				<?php if ($template["active"] == "on") print "Active"; else print "Disabled";?>
			</td>
			<td style="<?php print get_checkbox_style();?>" width="1%" align="right">
				<input type='checkbox' style='margin: 0px;' name='chk_<?php print $template["id"];?>' title="<?php print $template["name"];?>">
			</td>
		</tr>
		<?php
		$i++;
	}
	}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:songchin,项目名称:Cacti,代码行数:49,代码来源:data_templates.php

示例5: graph_perms_edit


//.........这里部分代码省略.........
                $sql_join .= 'LEFT JOIN user_auth_' . ($policy['type'] == 'user' ? '' : 'group_') . "perms AS uap{$i} ON (gl.id=uap{$i}.item_id AND uap{$i}.type=1) ";
                $sql_select .= (strlen($sql_select) ? ', ' : '') . "uap{$i}." . $policy['type'] . "_id AS user{$i}";
                $i++;
                if (get_request_var_request('associated') == 'false') {
                    if ($policy['policy_hosts'] == 1) {
                        $sql_having .= " OR (user{$i} IS NULL";
                    } else {
                        $sql_having .= " OR (user{$i}=" . $policy['id'];
                    }
                }
                $sql_join .= 'LEFT JOIN user_auth_' . ($policy['type'] == 'user' ? '' : 'group_') . "perms AS uap{$i} ON (gl.host_id=uap{$i}.item_id AND uap{$i}.type=3) ";
                $sql_select .= (strlen($sql_select) ? ', ' : '') . "uap{$i}." . $policy['type'] . "_id AS user{$i}";
                $i++;
                if (get_request_var_request('associated') == 'false') {
                    if ($policy['policy_graph_templates'] == 1) {
                        $sql_having .= " {$sql_operator} user{$i} IS NULL))";
                    } else {
                        $sql_having .= " {$sql_operator} user{$i}=" . $policy['id'] . '))';
                    }
                }
                $sql_join .= 'LEFT JOIN user_auth_' . ($policy['type'] == 'user' ? '' : 'group_') . "perms AS uap{$i} ON (gl.graph_template_id=uap{$i}.item_id AND uap{$i}.type=4) ";
                $sql_select .= (strlen($sql_select) ? ', ' : '') . "uap{$i}." . $policy['type'] . "_id AS user{$i}";
                $i++;
            }
            if (strlen($sql_having)) {
                $sql_having = 'HAVING ' . $sql_having;
            }
            $graphs = db_fetch_assoc("SELECT gtg.local_graph_id, h.description, gt.name AS template_name, \n\t\t\tgtg.title_cache, gtg.width, gtg.height, gl.snmp_index, gl.snmp_query_id,\n\t\t\t{$sql_select}\n\t\t\tFROM graph_templates_graph AS gtg \n\t\t\tINNER JOIN graph_local AS gl \n\t\t\tON gl.id = gtg.local_graph_id \n\t\t\tLEFT JOIN graph_templates AS gt \n\t\t\tON gt.id = gl.graph_template_id \n\t\t\tLEFT JOIN host AS h \n\t\t\tON h.id = gl.host_id \n\t\t\t{$sql_join}\n\t\t\t{$sql_where}\n\t\t\t{$sql_having}\n\t\t\tORDER BY gtg.title_cache\n\t\t\t{$limit}");
            $total_rows = db_fetch_cell("SELECT COUNT(*)\n\t\t\tFROM (\n\t\t\t\tSELECT {$sql_select}\n\t\t\t\tFROM graph_templates_graph AS gtg \n\t\t\t\tINNER JOIN graph_local AS gl \n\t\t\t\tON gl.id = gtg.local_graph_id \n\t\t\t\tLEFT JOIN graph_templates AS gt \n\t\t\t\tON gt.id = gl.graph_template_id \n\t\t\t\tLEFT JOIN host AS h \n\t\t\t\tON h.id = gl.host_id \n\t\t\t\t{$sql_join}\n\t\t\t\t{$sql_where}\n\t\t\t\t{$sql_having}\n\t\t\t) AS rows");
            //print '<pre>';print_r($graphs);print '</pre>';
            $nav = html_nav_bar('user_admin.php?action=user_edit&tab=permsg&id=' . get_request_var_request('id'), MAX_DISPLAY_PAGES, get_request_var_request('page'), $rows, $total_rows, 11, 'Graphs', 'page', 'main');
            print $nav;
            $display_text = array('Graph Title', 'ID', 'Effective Policy');
            html_header_checkbox($display_text, false);
            if (sizeof($graphs)) {
                foreach ($graphs as $g) {
                    form_alternate_row('line' . $g['local_graph_id'], true);
                    form_selectable_cell(strlen(get_request_var_request('filter')) ? preg_replace('/(' . preg_quote(get_request_var_request('filter')) . ')/i', "<span class='filteredValue'>\\1</span>", htmlspecialchars($g['title_cache'])) : htmlspecialchars($g['title_cache']), $g['local_graph_id']);
                    form_selectable_cell($g['local_graph_id'], $g['local_graph_id']);
                    form_selectable_cell(get_permission_string($g, $policies), $g['local_graph_id']);
                    form_checkbox_cell($g['title_cache'], $g['local_graph_id']);
                    form_end_row();
                }
                /* put the nav bar on the bottom as well */
                print $nav;
            } else {
                print '<tr><td><em>No Matching Graphs Found</em></td></tr>';
            }
            html_end_box(false);
            form_hidden_box('action', 'user_edit', '');
            form_hidden_box('tab', $tab, '');
            form_hidden_box('id', get_request_var_request('id'), '');
            form_hidden_box('associate_graph', '1', '');
            if ($policy['policy_graphs'] == 1) {
                $assoc_actions = array(1 => 'Revoke Access', 2 => 'Grant Access');
            } else {
                $assoc_actions = array(1 => 'Grant Access', 2 => 'Revoke Access');
            }
            /* draw the dropdown containing a list of available actions for this form */
            draw_actions_dropdown($assoc_actions);
            print '</form>';
            break;
        case 'permsgr':
            process_group_request_vars();
            group_filter($header_label);
            /* if the number of rows is -1, set it to the default */
开发者ID:MrWnn,项目名称:cacti,代码行数:67,代码来源:user_admin.php

示例6: template

function template()
{
    $menu_items = array("remove" => "Remove", "duplicate" => "Duplicate");
    $filter_array = array();
    /* search field: filter (searches template name) */
    if (isset_get_var("search_filter")) {
        $filter_array["template_name"] = get_get_var("search_filter");
    }
    /* get a list of all data templates on this page */
    $data_templates = api_data_template_list($filter_array);
    /* get a list of data input types for display in the data sources list */
    $data_input_types = api_data_source_input_type_list();
    form_start("data_templates.php");
    $box_id = "1";
    html_start_box("<strong>" . _("Data Templates") . "</strong>", "data_templates.php?action=edit");
    html_header_checkbox(array(_("Template Name"), _("Data Input Type"), _("Status")), $box_id);
    $i = 0;
    if (sizeof($data_templates) > 0) {
        foreach ($data_templates as $data_template) {
            ?>
			<tr class="item" id="box-<?php 
            echo $box_id;
            ?>
-row-<?php 
            echo $data_template["id"];
            ?>
" onClick="display_row_select('<?php 
            echo $box_id;
            ?>
',document.forms[0],'box-<?php 
            echo $box_id;
            ?>
-row-<?php 
            echo $data_template["id"];
            ?>
', 'box-<?php 
            echo $box_id;
            ?>
-chk-<?php 
            echo $data_template["id"];
            ?>
')" onMouseOver="display_row_hover('box-<?php 
            echo $box_id;
            ?>
-row-<?php 
            echo $data_template["id"];
            ?>
')" onMouseOut="display_row_clear('box-<?php 
            echo $box_id;
            ?>
-row-<?php 
            echo $data_template["id"];
            ?>
')">
				<td class="title">
					<a onClick="display_row_block('box-<?php 
            echo $box_id;
            ?>
-row-<?php 
            echo $data_template["id"];
            ?>
')" href="data_templates.php?action=edit&id=<?php 
            echo $data_template["id"];
            ?>
"><span id="box-<?php 
            echo $box_id;
            ?>
-text-<?php 
            echo $data_template["id"];
            ?>
"><?php 
            echo html_highlight_words(get_get_var("search_filter"), $data_template["template_name"]);
            ?>
</span></a>
				</td>
				<td>
					<?php 
            echo $data_input_types[$data_template["data_input_type"]];
            ?>
				</td>
				<td>
					<?php 
            if ($data_template["active"] == "1") {
                echo _("Active");
            } else {
                echo _("Disabled");
            }
            ?>
				</td>
				<td class="checkbox" align="center">
					<input type='checkbox' name='box-<?php 
            echo $box_id;
            ?>
-chk-<?php 
            echo $data_template["id"];
            ?>
' id='box-<?php 
            echo $box_id;
            ?>
-chk-<?php 
//.........这里部分代码省略.........
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:data_templates.php

示例7: host

function host() {
	global $colors, $device_actions;

	/* if the user pushed the 'clear' button */
	if (isset($_REQUEST["clear_x"])) {
		kill_session_var("sess_device_current_page");
		kill_session_var("sess_device_filter");
		kill_session_var("sess_device_host_template_id");

		unset($_REQUEST["page"]);
		unset($_REQUEST["filter"]);
		unset($_REQUEST["host_template_id"]);
	}

	/* remember these search fields in session vars so we don't have to keep passing them around */
	load_current_session_value("page", "sess_device_current_page", "1");
	load_current_session_value("filter", "sess_device_filter", "");
	load_current_session_value("host_template_id", "sess_device_host_template_id", "-1");

	html_start_box("<strong>Devices</strong>", "98%", $colors["header"], "3", "center", "host.php?action=edit&host_template_id=" . $_REQUEST["host_template_id"]);

	include("./include/html/inc_device_filter_table.php");

	html_end_box();

	/* form the 'where' clause for our main sql query */
	$sql_where = "where host.description like '%%" . $_REQUEST["filter"] . "%%'";

	if ($_REQUEST["host_template_id"] == "-1") {
		/* Show all items */
	}elseif ($_REQUEST["host_template_id"] == "0") {
		$sql_where .= " and host.host_template_id=0";
	}elseif (!empty($_REQUEST["host_template_id"])) {
		$sql_where .= " and host.host_template_id=" . $_REQUEST["host_template_id"];
	}

	html_start_box("", "98%", $colors["header"], "3", "center", "");

	$total_rows = db_fetch_cell("select
		COUNT(host.id)
		from host
		$sql_where");

	$hosts = db_fetch_assoc("select
		host.id,
		host.disabled,
		host.status,
		host.hostname,
		host.description,
		host.min_time,
		host.max_time,
		host.cur_time,
		host.avg_time,
		host.availability
		from host
		$sql_where
		order by host.description
		limit " . (read_config_option("num_rows_device")*($_REQUEST["page"]-1)) . "," . read_config_option("num_rows_device"));

	/* generate page list */
	$url_page_select = get_page_list($_REQUEST["page"], MAX_DISPLAY_PAGES, read_config_option("num_rows_device"), $total_rows, "host.php?filter=" . $_REQUEST["filter"] . "&host_template_id=" . $_REQUEST["host_template_id"]);

	$nav = "<tr bgcolor='#" . $colors["header"] . "'>
			<td colspan='7'>
				<table width='100%' cellspacing='0' cellpadding='0' border='0'>
					<tr>
						<td align='left' class='textHeaderDark'>
							<strong>&lt;&lt; "; if ($_REQUEST["page"] > 1) { $nav .= "<a class='linkOverDark' href='host.php?filter=" . $_REQUEST["filter"] . "&host_template_id=" . $_REQUEST["host_template_id"] . "&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='host.php?filter=" . $_REQUEST["filter"] . "&host_template_id=" . $_REQUEST["host_template_id"] . "&page=" . ($_REQUEST["page"]+1) . "'>"; } $nav .= "Next"; if (($_REQUEST["page"] * read_config_option("num_rows_device")) < $total_rows) { $nav .= "</a>"; } $nav .= " &gt;&gt;</strong>
						</td>\n
					</tr>
				</table>
			</td>
		</tr>\n";

	print $nav;

	html_header_checkbox(array("Description", "Status", "Hostname", "Current (ms)", "Average (ms)", "Availability"));

	$i = 0;
	if (sizeof($hosts) > 0) {
		foreach ($hosts as $host) {
			form_alternate_row_color($colors["alternate"],$colors["light"],$i); $i++;
				?>
				<td width=200>
					<a class="linkEditMain" href="host.php?action=edit&id=<?php print $host["id"];?>"><?php print eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $host["description"]);?></a>
				</td>
				<td>
					<?php print get_colored_device_status(($host["disabled"] == "on" ? true : false), $host["status"]);?>
				</td>
				<td>
					<?php print $host["hostname"];?>
				</td>
				<td>
					<?php print round(($host["cur_time"]), 2);?>
//.........这里部分代码省略.........
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:host.php

示例8: template

function template() {
	global $colors, $graph_actions;

	html_start_box("<strong>Graph Templates</strong>", "98%", $colors["header"], "3", "center", "graph_templates.php?action=template_edit");

	html_header_checkbox(array("Template Title"));

	$template_list = db_fetch_assoc("select
		graph_templates.id,graph_templates.name
		from graph_templates
		order by name");

	$i = 0;
	if (sizeof($template_list) > 0) {
	foreach ($template_list as $template) {
		form_alternate_row_color($colors["alternate"],$colors["light"],$i);
			?>
			<td>
				<a class="linkEditMain" href="graph_templates.php?action=template_edit&id=<?php print $template["id"];?>"><?php print $template["name"];?></a>
			</td>
			<td style="<?php print get_checkbox_style();?>" width="1%" align="right">
				<input type='checkbox' style='margin: 0px;' name='chk_<?php print $template["id"];?>' title="<?php print $template["name"];?>">
			</td>
		</tr>
		<?php
		$i++;
	}
	}else{
		print "<tr><td><em>No Graph Templates</em></td></tr>\n";
	}
	html_end_box(false);

	/* draw the dropdown containing a list of available actions for this form */
	draw_actions_dropdown($graph_actions);

	print "</form>\n";
}
开发者ID:songchin,项目名称:Cacti,代码行数:37,代码来源:graph_templates.php

示例9: user

function user() {
	global $user_actions, $colors, $auth_realms;

	html_start_box("<strong>" . _("User Management") . "</strong>", "98%", $colors["header_background"], "3", "center", "user_admin.php?action=user_edit");

	html_header_checkbox(array(_("User Name"), _("Full Name"), _("Status"),_("Realm"), _("Default Graph Policy"), _("Last Login"), _("Last Login From"),_("Last Password Change")));

	$user_list = api_user_list( array( "1" => "username" ) );

	$i = 0;
	if (sizeof($user_list) > 0) {
	foreach ($user_list as $user_list_values) {
		$user = api_user_info( array( "id" => $user_list_values["id"] ) );
		form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],$i);
			?>
			<td>
				<a class="linkEditMain" href="user_admin.php?action=user_edit&id=<?php print $user["id"];?>"><?php print $user["username"];?></a>
			</td>
			<td>
				<?php print $user["full_name"];?>
			</td>
			<td>
				<?php if ($user["enabled"] == "1") { print _("Enabled"); }else{ print _("Disabled"); }?>
			</td>
			<td>
				<?php print $auth_realms[$user["realm"]];?>
			</td>
			<td>
				<?php if ($user["policy_graphs"] == "1") { print _("ALLOW"); }else{ print _("DENY"); }?>
			</td>
			<td>
				<?php print $user["last_login_formatted"];?>
			</td>
			<td>
				<?php print $user["last_login_ip"];?>
			</td>
			<td>
				<?php
				if ($user["realm"] != "0") {
					print _("N/A");
				}else{
					if ($user["password_change_last"] == "0000-00-00 00:00:00") {
						print _("Never");
					}else{
						print $user["password_change_last_formatted"];
					}
				} ?>
			</td>


			<td style="<?php print get_checkbox_style();?>" width="1%" align="right">
				<input type='checkbox' style='margin: 0px;' name='chk_<?php print $user["id"];?>' title="<?php print $user["username"];?>">
			</td>
		</tr>
	<?php
	$i++;
	}
	}
	html_end_box(false);

	/* draw the dropdown containing a list of available actions for this form */
	draw_actions_dropdown($user_actions);

}
开发者ID:songchin,项目名称:Cacti,代码行数:64,代码来源:user_admin.php

示例10: host

function host()
{
    $current_page = get_get_var_number("page", "1");
    $menu_items = array("remove" => "Remove", "duplicate" => "Duplicate", "enable" => "Enable", "disable" => "Disable", "clear_stats" => "Clear Statistics", "change_snmp_opts" => "Change SNMP Options", "change_avail_opts" => "Change Availability Options", "change_poller" => "Change Poller");
    $filter_array = array();
    /* search field: device template */
    if (isset_get_var("search_device_template")) {
        $filter_array["=host_template_id"] = get_get_var("search_device_template");
    }
    /* search field: device status */
    if (isset_get_var("search_status")) {
        $filter_array["=status"] = get_get_var("search_status");
    }
    /* search field: filter (searches device description and hostname) */
    if (isset_get_var("search_filter")) {
        $filter_array["%filter"] = array("hostname" => get_get_var("search_filter"), "description" => get_get_var("search_filter"));
    }
    /* get a list of all devices on this page */
    $devices = api_device_list($filter_array, "description", "asc", read_config_option("num_rows_device") * ($current_page - 1), read_config_option("num_rows_device"));
    /* get the total number of devices on all pages */
    $total_rows = api_device_total_get($filter_array);
    /* generate page list */
    $url_string = build_get_url_string(array("search_device_template", "search_status", "search_filter"));
    $url_page_select = get_page_list($current_page, MAX_DISPLAY_PAGES, read_config_option("num_rows_device"), $total_rows, "devices.php" . $url_string . ($url_string == "" ? "?" : "&") . "page=|PAGE_NUM|");
    form_start("devices.php");
    $box_id = "1";
    html_start_box("<strong>" . _("Devices") . "</strong>", "devices.php?action=edit", $url_page_select);
    html_header_checkbox(array(_("Description"), _("Status"), _("Hostname"), _("Current (ms)"), _("Average (ms)"), _("Availability")), $box_id);
    $i = 0;
    if (sizeof($devices) > 0) {
        foreach ($devices as $host) {
            ?>
			<tr class="item" id="box-<?php 
            echo $box_id;
            ?>
-row-<?php 
            echo $host["id"];
            ?>
" onClick="display_row_select('<?php 
            echo $box_id;
            ?>
',document.forms[0],'box-<?php 
            echo $box_id;
            ?>
-row-<?php 
            echo $host["id"];
            ?>
', 'box-<?php 
            echo $box_id;
            ?>
-chk-<?php 
            echo $host["id"];
            ?>
')" onMouseOver="display_row_hover('box-<?php 
            echo $box_id;
            ?>
-row-<?php 
            echo $host["id"];
            ?>
')" onMouseOut="display_row_clear('box-<?php 
            echo $box_id;
            ?>
-row-<?php 
            echo $host["id"];
            ?>
')">
				<td class="title">
					<a onClick="display_row_block('box-<?php 
            echo $box_id;
            ?>
-row-<?php 
            echo $host["id"];
            ?>
')" href="devices.php?action=edit&id=<?php 
            echo $host["id"];
            ?>
"><span id="box-<?php 
            echo $box_id;
            ?>
-text-<?php 
            echo $host["id"];
            ?>
"><?php 
            echo html_highlight_words(get_get_var("search_filter"), $host["description"]);
            ?>
</span></a>
				</td>
				<td>
					<?php 
            echo get_colored_device_status($host["disabled"] == "on" ? true : false, $host["status"]);
            ?>
				</td>
				<td>
					<?php 
            echo html_highlight_words(get_get_var("search_filter"), $host["hostname"]);
            ?>
				</td>
				<td>
					<?php 
            echo round($host["cur_time"], 2);
//.........这里部分代码省略.........
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:devices.php

示例11: view_users

function view_users()
{
    $current_page = get_get_var_number("page", "1");
    /* setup action menu */
    $menu_items = array("remove" => "Remove", "duplicate" => "Duplicate", "enable" => "Enable", "disable" => "Disable", "passwdexpire" => "Password Expire");
    /* search field: filter (searchs device description and hostname) */
    $filter_array = array();
    $filter_url = "";
    if (isset_get_var("search_filter")) {
        $filter_array["name"] = get_get_var("search_filter");
        $filter_url .= ($filter_url == "" ? "" : "&") . "search_filter=" . urlencode(get_get_var("search_filter"));
    }
    if (isset_get_var("search_name")) {
        $filter_array["name"] = get_get_var("search_name");
        $filter_url .= ($filter_url == "" ? "" : "&") . "search_name=" . urlencode(get_get_var("search_name"));
    }
    if (isset_get_var("search_description")) {
        $filter_array["description"] = get_get_var("search_description");
        $filter_url .= ($filter_url == "" ? "" : "&") . "search_description=" . urlencode(get_get_var("search_description"));
    }
    if (isset_get_var("search_enabled")) {
        $filter_array["enabled"] = get_get_var("search_enabled");
        $filter_url .= ($filter_url == "" ? "" : "&") . "search_enabled=" . urlencode(get_get_var("search_enabled"));
    }
    /* get log entires */
    $users = api_auth_control_list(AUTH_CONTROL_OBJECT_TYPE_USER, $filter_array, read_config_option("num_rows_page"), read_config_option("num_rows_page") * ($current_page - 1));
    $total_rows = api_auth_control_total_get($filter_array);
    /* generate page list */
    $url_string = build_get_url_string(array("search_filter", "search_name", "search_description"));
    $url_page_select = get_page_list($current_page, MAX_DISPLAY_PAGES, read_config_option("num_rows_page"), $total_rows, "auth_user.php" . $url_string . ($url_string == "" ? "?" : "&") . "page=|PAGE_NUM|");
    /* Output html */
    $box_id = 1;
    form_start("auth_user.php");
    html_start_box("<strong>" . _("Users") . "</strong>", "auth_user.php?action=add", $url_page_select);
    html_header_checkbox(array(_("Username"), _("Full Name"), _("Enabled"), _("Last Login"), _("Last Login IP")), $box_id);
    $i = 0;
    if (is_array($users) && sizeof($users) > 0) {
        foreach ($users as $user) {
            $user_info = api_auth_control_get(AUTH_CONTROL_OBJECT_TYPE_USER, $user["id"]);
            ?>
			<tr class="item" id="box-<?php 
            echo $box_id;
            ?>
-row-<?php 
            echo $user["id"];
            ?>
" onClick="display_row_select('<?php 
            echo $box_id;
            ?>
',document.forms[0],'box-<?php 
            echo $box_id;
            ?>
-row-<?php 
            echo $user["id"];
            ?>
', 'box-<?php 
            echo $box_id;
            ?>
-chk-<?php 
            echo $user["id"];
            ?>
')" onMouseOver="display_row_hover('box-<?php 
            echo $box_id;
            ?>
-row-<?php 
            echo $user["id"];
            ?>
')" onMouseOut="display_row_clear('box-<?php 
            echo $box_id;
            ?>
-row-<?php 
            echo $user["id"];
            ?>
')">
				<td class="title">
					<a  onClick="display_row_block('box-<?php 
            echo $box_id;
            ?>
-row-<?php 
            echo $user["id"];
            ?>
')" href="auth_user.php?action=edit&id=<?php 
            echo $user["id"];
            ?>
"><span id="box-<?php 
            echo $box_id;
            ?>
-text-<?php 
            echo $user["id"];
            ?>
"><?php 
            echo html_highlight_words(get_get_var("search_filter"), $user["name"]);
            ?>
</span></a>
				</td>
				<td>
					<?php 
            echo $user["description"];
            ?>
				</td>
//.........这里部分代码省略.........
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:auth_user.php

示例12: template

function template()
{
    global $colors, $host_actions;
    display_output_messages();
    html_start_box("<strong>" . _("Device Templates") . "</strong>", "98%", $colors["header_background"], "3", "center", "device_templates.php?action=edit");
    html_header_checkbox(array("Template Title"));
    $host_templates = db_fetch_assoc("select * from host_template order by name");
    $i = 0;
    if (sizeof($host_templates) > 0) {
        foreach ($host_templates as $host_template) {
            form_alternate_row_color($colors["form_alternate1"], $colors["form_alternate2"], $i);
            $i++;
            ?>
			<td>
				<a class="linkEditMain" href="device_templates.php?action=edit&id=<?php 
            print $host_template["id"];
            ?>
"><?php 
            print $host_template["name"];
            ?>
</a>
			</td>
			<td style="<?php 
            print get_checkbox_style();
            ?>
" width="1%" align="right">
				<input type='checkbox' style='margin: 0px;' name='chk_<?php 
            print $host_template["id"];
            ?>
' title="<?php 
            print $host_template["name"];
            ?>
">
			</td>
		</tr>
	<?php 
        }
    } else {
        print "<tr><td bgcolor='#" . $colors["form_alternate1"] . "' colspan=7><em>" . _("No Device Templates") . "</em></td></tr>";
    }
    html_end_box(false);
    /* draw the dropdown containing a list of available actions for this form */
    draw_actions_dropdown($host_actions);
    print "</form>\n";
}
开发者ID:songchin,项目名称:Cacti,代码行数:45,代码来源:device_templates.php

示例13: manager_notifications


//.........这里部分代码省略.........
    if (sizeof($mibs) > 0) {
        foreach ($mibs as $mib) {
            print "<option value='" . $mib["mib"] . "'";
            if (get_request_var_request("mib") == $mib["mib"]) {
                print " selected";
            }
            print ">" . $mib["mib"] . "</option>\n";
        }
    }
    ?>
							</select>
						</td>
						<td>
							Search:
						</td>
						<td>
							<input id='filter' type="text" name="filter" size="25" value="<?php 
    print htmlspecialchars(get_request_var_request("filter"));
    ?>
" onChange='applyFilter()'>
						</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='1'>
				
			</form>
			</td>
		</tr>
		<?php 
    html_end_box();
    $sql_where = " AND `kind` = 'Notification'";
    /* filter by host */
    if (get_request_var_request("mib") == "-1") {
        /* Show all items */
    } elseif (!empty($_REQUEST["mib"])) {
        $sql_where .= " AND snmpagent_cache.mib='" . get_request_var_request("mib") . "'";
    }
    /* filter by search string */
    if (get_request_var_request("filter") != "") {
        $sql_where .= " AND (`oid` LIKE '%%" . get_request_var_request("filter") . "%%'\n\t\t\tOR `name` LIKE '%%" . get_request_var_request("filter") . "%%'\n\t\t\tOR `mib` LIKE '%%" . get_request_var_request("filter") . "%%')";
    }
    $sql_where .= ' ORDER by `oid`';
    /* print checkbox form for validation */
    print "<form name='chk' method='post' action='managers.php'>\n";
    html_start_box("", "100%", $colors["header"], "3", "center", "");
    $rows = read_config_option('num_rows_table');
    $total_rows = db_fetch_cell("SELECT COUNT(*) FROM snmpagent_cache WHERE 1 {$sql_where}");
    $snmp_cache_sql = "SELECT * FROM snmpagent_cache WHERE 1 {$sql_where} LIMIT " . $rows * (get_request_var_request("page") - 1) . "," . $rows;
    $snmp_cache = db_fetch_assoc($snmp_cache_sql);
    $registered_notifications = db_fetch_assoc("SELECT notification, mib from snmpagent_managers_notifications WHERE manager_id = {$id}");
    $notifications = array();
    if ($registered_notifications && sizeof($registered_notifications) > 0) {
        foreach ($registered_notifications as $registered_notification) {
            $notifications[$registered_notification["mib"]][$registered_notification["notification"]] = 1;
        }
    }
    /* generate page list */
    $nav = html_nav_bar("managers.php?action=edit&id=" . $id . "&tab=notifications&mib=" . get_request_var_request("mib") . "&filter=" . get_request_var_request("filter"), MAX_DISPLAY_PAGES, get_request_var_request("page"), $rows, $total_rows, 11, '', 'page', 'main');
    print $nav;
    html_header_checkbox(array("Name", "OID", "MIB", "Kind", "Max-Access", "Monitored"), true, "managers.php?action=edit&tab=notifications&id=" . $id);
    if (sizeof($snmp_cache) > 0) {
        foreach ($snmp_cache as $item) {
            $row_id = $item["mib"] . '__' . $item["name"];
            $oid = strlen(get_request_var_request("filter")) ? preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["oid"]) : $item["oid"];
            $name = strlen(get_request_var_request("filter")) ? preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["name"]) : $item["name"];
            $mib = strlen(get_request_var_request("filter")) ? preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["mib"]) : $item["mib"];
            form_alternate_row('line' . $row_id, false);
            if ($item["description"]) {
                print '<td><a href="#" title="<div class=\'header\'>' . $name . '</div><div class=\'content preformatted\'>' . $item["description"] . '</div>" class="tooltip">' . $name . '</a></td>';
            } else {
                form_selectable_cell($name, $row_id);
            }
            form_selectable_cell($oid, $row_id);
            form_selectable_cell($mib, $row_id);
            form_selectable_cell($item["kind"], $row_id);
            form_selectable_cell($item["max-access"], $row_id);
            form_selectable_cell(isset($notifications[$item["mib"]]) && isset($notifications[$item["mib"]][$item["name"]]) ? "Enabled" : "Disabled", $row_id);
            form_checkbox_cell($item["oid"], $row_id);
            form_end_row();
        }
        print $nav;
    } else {
        print "<tr><td><em>No SNMP Notifications</em></td></tr>";
    }
    ?>
	<input type='hidden' name='page' value='1'>
	<input type='hidden' name='action' value='edit'>
	<input type='hidden' name='tab' value='notifications'>
	<input type='hidden' name='id' value='<?php 
    print $_REQUEST["id"];
    ?>
'>
	<?php 
}
开发者ID:MrWnn,项目名称:cacti,代码行数:101,代码来源:managers.php

示例14: view_rra

function view_rra() {
	$menu_items = array(
		"remove" => "Remove",
		"duplicate" => "Duplicate"
		);

	$rras = api_data_preset_rra_list();

	form_start("presets_rra.php");

	$box_id = "1";
	html_start_box("<strong>" . _("RRA Presets") . "</strong>", "presets_rra.php?action=edit", "", "", false);
	html_header_checkbox(array(_("Name")), $box_id);

	if (sizeof($rras) > 0) {
		foreach ($rras as $rra) {
			?>
			<tr class="item" id="box-<?php echo $box_id;?>-row-<?php echo $rra["id"];?>" onClick="display_row_select('<?php echo $box_id;?>',document.forms[0],'box-<?php echo $box_id;?>-row-<?php echo $rra["id"];?>', 'box-<?php echo $box_id;?>-chk-<?php echo $rra["id"];?>')" onMouseOver="display_row_hover('box-<?php echo $box_id;?>-row-<?php echo $rra["id"];?>')" onMouseOut="display_row_clear('box-<?php echo $box_id;?>-row-<?php echo $rra["id"];?>')">
				<td class="title">
					<a onClick="display_row_block('box-<?php echo $box_id;?>-row-<?php echo $rra["id"];?>')" href="presets_rra.php?action=edit&id=<?php echo $rra["id"];?>"><span id="box-<?php echo $box_id;?>-text-<?php echo $rra["id"];?>"><?php echo $rra["name"];?></span></a>
				</td>
				<td class="checkbox" align="center">
					<input type='checkbox' name='box-<?php echo $box_id;?>-chk-<?php echo $rra["id"];?>' id='box-<?php echo $box_id;?>-chk-<?php echo $rra["id"];?>' title="<?php echo $rra["name"];?>">
				</td>
			</tr>
			<?php
		}

		html_box_toolbar_draw($box_id, "0", "1");
	}else{
		?>
		<tr class="empty">
			<td colspan="1">
				No RRA presets found.
			</td>
		</tr>
		<?php
	}

	html_end_box(false);

	html_box_actions_menu_draw($box_id, "0", $menu_items);
	html_box_actions_area_create($box_id);

	form_end();
	?>

	<script language="JavaScript">
	<!--
	function action_area_handle_type(box_id, type, parent_div, parent_form) {
		if (type == 'remove') {
			parent_div.appendChild(document.createTextNode('Are you sure you want to remove these RRA presets?'));
			parent_div.appendChild(action_area_generate_selected_rows(box_id));

			action_area_update_header_caption(box_id, 'Remove RRA Presets');
			action_area_update_submit_caption(box_id, 'Remove');
			action_area_update_selected_rows(box_id, parent_form);
		}else if (type == 'duplicate') {
			parent_div.appendChild(document.createTextNode('Are you sure you want to duplicate these RRA presets?'));
			parent_div.appendChild(action_area_generate_selected_rows(box_id));
			parent_div.appendChild(action_area_generate_input('text', 'box-' + box_id + '-action-area-txt1', ''));

			action_area_update_header_caption(box_id, 'Duplicate RRA Presets');
			action_area_update_submit_caption(box_id, 'Duplicate');
			action_area_update_selected_rows(box_id, parent_form);
		}
	}
	-->
	</script>

	<?php
}
开发者ID:songchin,项目名称:Cacti,代码行数:72,代码来源:presets.php

示例15: count

            $sql_where = '';
            $sql_join = '';
        }
        $sql_base = "from (graph_templates_graph,graph_local)\n\t\t{$sql_join}\n\t\t{$sql_where}\n\t\t" . (empty($sql_where) ? 'where' : 'and') . " graph_templates_graph.local_graph_id > 0\n\t\tand graph_templates_graph.local_graph_id=graph_local.id\n\t\tand graph_templates_graph.title_cache like '%" . $_REQUEST['filter'] . "%'\n\t\t" . (empty($_REQUEST['host_id']) ? '' : ' and graph_local.host_id=' . $_REQUEST['host_id']) . '
		' . (empty($_REQUEST['graph_template_id']) ? '' : ' and graph_local.graph_template_id=' . $_REQUEST['graph_template_id']);
        $total_rows = count(db_fetch_assoc("select\n\t\tgraph_templates_graph.local_graph_id\n\t\t{$sql_base}"));
        $graphs = db_fetch_assoc("select\n\t\tgraph_templates_graph.local_graph_id,\n\t\thost.description,\n\t\tgraph_templates.name AS template_name,\n\t\tgraph_templates_graph.title_cache,\n\t\tgraph_templates_graph.height,\n\t\tgraph_templates_graph.width\n\t\t{$sql_base}\n\t\tgroup by graph_templates_graph.local_graph_id\n\t\torder by graph_templates_graph.title_cache\n\t\tlimit " . $_REQUEST['rows'] * ($_REQUEST['page'] - 1) . ',' . $_REQUEST['rows']);
        ?>

	<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();
        ?>
开发者ID:teddywen,项目名称:cacti,代码行数:31,代码来源:graph_view.php


注:本文中的html_header_checkbox函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。