• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_checkbox_style函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了get_checkbox_style函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: graph


//.........这里部分代码省略.........
    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\n\t\tCOUNT(graph_templates_graph.id)\n\t\tFROM (graph_local,graph_templates_graph)\n\t\tLEFT JOIN graph_templates ON (graph_local.graph_template_id=graph_templates.id)\n\t\tWHERE graph_local.id=graph_templates_graph.local_graph_id\n\t\t{$sql_where}");
    $graph_list = db_fetch_assoc("SELECT\n\t\tgraph_templates_graph.id,\n\t\tgraph_templates_graph.local_graph_id,\n\t\tgraph_templates_graph.height,\n\t\tgraph_templates_graph.width,\n\t\tgraph_templates_graph.title_cache,\n\t\tgraph_templates.name,\n\t\tgraph_local.host_id\n\t\tFROM (graph_local,graph_templates_graph)\n\t\tLEFT JOIN graph_templates ON (graph_local.graph_template_id=graph_templates.id)\n\t\tWHERE graph_local.id=graph_templates_graph.local_graph_id\n\t\t{$sql_where}\n\t\tORDER BY " . $_REQUEST['sort_column'] . " " . $_REQUEST['sort_direction'] . " 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"] . "'>\n\t\t\t<td colspan='4'>\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>&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>\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_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}]\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_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>\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("title_cache" => array("Graph Title", "ASC"), "name" => array("Template Name", "ASC"), "height" => array("Size", "ASC"));
    html_header_sort_checkbox($display_text, $_REQUEST["sort_column"], $_REQUEST["sort_direction"]);
    $i = 0;
    if (sizeof($graph_list) > 0) {
        foreach ($graph_list as $graph) {
            $template_name = empty($graph["name"]) ? "<em>None</em>" : $graph["name"];
            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"];
            ?>
" title="<?php 
            print htmlspecialchars($graph["title_cache"]);
            ?>
"><?php 
            if ($_REQUEST["filter"] != "") {
                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")));
            } else {
                print title_trim($graph["title_cache"], read_config_option("max_title_graph"));
            }
            ?>
</a>
				</td>
				<td>
					<?php 
            if ($_REQUEST["filter"] != "") {
                print eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $template_name);
            } else {
                print $template_name;
            }
            ?>
</a>
				</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"];
            ?>
">
				</td>
			</tr>
			<?php 
        }
        /* put the nav bar on the bottom as well */
        print $nav;
    } else {
        print "<tr><td><em>No Graphs Found</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($graph_actions);
    print "</form>\n";
}
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:graphs.php


示例2: get_checkbox_style

			print "<td><strong><a href='graph.php?local_graph_id=" . $graph["local_graph_id"] . "&rra_id=all'>" . $graph["title_cache"] . "</a></strong></td>\n";
			print "<td>" . $graph["height"] . "x" . $graph["width"] . "</td>\n";
			print "</tr>";

			$i++;
		}
	}

	?>
	<tr bgcolor='#6d88ad'>
		<td colspan='3'>
			<table width='100%' cellspacing='0' cellpadding='3' border='0'>
				<tr>
					<?php
					print "<td width='1%' align='right' class='textHeaderDark' style='" . get_checkbox_style() . "'><input type='checkbox' style='margin: 0px;' name='all' title='Select All' onClick='SelectAllGraphs(\"graph_\",this.checked)'></td><td bgcolor='#6D88AD'><strong>Select All</strong></td>\n";
					?>
				</tr>
			</table>
		</td>
	</tr>
	</table>
	<table align='center' width='100%'>
		<tr>
			<td width='1'><img src='images/arrow.gif' alt='' align='absmiddle'>&nbsp;</td>
			<td><input type='image' src='images/button_view.gif' alt='View'></td>
		</tr>
	</table>
	<input type='hidden' name='page' value='1'>
	<input type='hidden' name='style' value='selective'>
	<input type='hidden' name='action' value='preview'>
开发者ID:songchin,项目名称:Cacti,代码行数:30,代码来源:graph_view.php


示例3: graphs

function graphs()
{
    global $colors;
    /* use the first host in the list as the default */
    if (!isset($_SESSION["sess_graphs_new_host_id"]) && empty($_REQUEST["host_id"])) {
        $_REQUEST["host_id"] = db_fetch_cell("select id from host order by description,hostname limit 1");
    }
    /* remember these search fields in session vars so we don't have to keep passing them around */
    if (isset($_REQUEST["host_id"])) {
        $_SESSION["sess_graphs_new_host_id"] = $_REQUEST["host_id"];
    } else {
        $_REQUEST["host_id"] = $_SESSION["sess_graphs_new_host_id"];
    }
    $host = db_fetch_row("select id,description,hostname,host_template_id from host where id=" . $_REQUEST["host_id"]);
    ?>

	<table width="98%" align="center">
		<form name="form_graph_id">
		<tr>
			<td class="textInfo" colspan="2">
				<?php 
    print $host["description"];
    ?>
 (<?php 
    print $host["hostname"];
    ?>
)
			</td>
			<td align="right" class="textInfo" style="color: #aaaaaa;">
				<?php 
    if (!empty($host["host_template_id"])) {
        print db_fetch_cell("select name from host_template where id=" . $host["host_template_id"]);
    }
    ?>
			</td>
		</tr>
		<tr>
			<td>
			</td>
		</tr>

		<tr>
			<td class="textArea" style="padding: 3px;" width="300" nowrap>
				<?php 
    echo _("Create new graphs for the following host:");
    ?>
			</td>
			<td class="textInfo" rowspan="2" valign="top">
				<span style="color: #c16921;">*</span><a href="devices.php?action=edit&id=<?php 
    print $_REQUEST["host_id"];
    ?>
"><?php 
    echo _("Edit this Host");
    ?>
</a><br>
				<span style="color: #c16921;">*</span><a href="devices.php?action=edit"><?php 
    echo _("Create New Host");
    ?>
</a>
			</td>
		</tr>
			<td>
				<select name="cbo_graph_id" onChange="window.location=document.form_graph_id.cbo_graph_id.options[document.form_graph_id.cbo_graph_id.selectedIndex].value">
					<?php 
    $hosts = db_fetch_assoc("select id,CONCAT_WS('',description,' (',hostname,')') as name from host order by description,hostname");
    if (sizeof($hosts) > 0) {
        foreach ($hosts as $item) {
            print "<option value='graphs_new.php?host_id=" . $item["id"] . "'";
            if ($_REQUEST["host_id"] == $item["id"]) {
                print " selected";
            }
            print ">" . $item["name"] . "</option>\n";
        }
    }
    ?>
				</select>
			</td>
		</tr>
		</form>
	</table>

	<br>

	<form name="chk" method="post" action="graphs_new.php">
	<?php 
    $total_rows = sizeof(db_fetch_assoc("select graph_template_id from host_graph where host_id=" . $_REQUEST["host_id"]));
    /* we give users the option to turn off the javascript features for data queries with lots of rows */
    if (read_config_option("max_data_query_javascript_rows") >= $total_rows) {
        $use_javascript = true;
    } else {
        $use_javascript = false;
    }
    /* ==================== Box: Graph Templates ==================== */
    html_start_box("<strong>" . _("Graph Templates") . "</strong>", "98%", $colors["header_background"], "3", "center", "");
    print "\t<tr bgcolor='#" . $colors["header_panel"] . "'>\n\t\t\t<td class='textSubHeaderDark'>" . _("Name") . "</td>\n\t\t\t<td width='1%' align='center' bgcolor='#819bc0' style='" . get_checkbox_style() . "'><input type='checkbox' style='margin: 0px;' name='all_cg' title='" . _("Select All") . "' onClick='SelectAll(\"cg\",this.checked);gt_update_selection_indicators();'></td>\n\n\t\t</tr>\n";
    $ht_graph_templates = db_fetch_assoc("select\n\t\tgraph_template.id,\n\t\tgraph_template.template_name\n\t\tfrom host_graph,graph_template\n\t\twhere host_graph.graph_template_id=graph_template.id\n\t\tand host_graph.host_id = " . $_REQUEST["host_id"] . "\n\t\torder by graph_template.template_name");
    $ht_created_graph_templates = db_fetch_assoc("select\n\t\tgraph.graph_template_id\n\t\tfrom graph,host_graph\n\t\twhere graph.graph_template_id=host_graph.graph_template_id\n\t\tand graph.host_id = " . $host["id"] . "\n\t\tgroup by graph.graph_template_id");
    print "<script type='text/javascript'>\nvar gt_created_graphs = new Array()\n</script>\n";
    if (sizeof($ht_created_graph_templates) > 0 && $use_javascript == true) {
        print "<script type='text/javascript'>\n<!--\n";
//.........这里部分代码省略.........
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:graphs_new.php


示例4: html_header_checkbox

function html_header_checkbox($header_items, $form_action = "") {
	global $colors;

	/* default to the 'current' file */
	if ($form_action == "") { $form_action = basename($_SERVER["PHP_SELF"]); }

	print "<tr bgcolor='#" . $colors["header_panel"] . "'>\n";

	for ($i=0; $i<count($header_items); $i++) {
		print "<td class='textSubHeaderDark'>" . $header_items[$i] . "</td>\n";
	}

	print "<td width='1%' align='right' bgcolor='#819bc0' style='" . get_checkbox_style() . "'><input type='checkbox' style='margin: 0px;' name='all' title='Select All' onClick='SelectAll(\"chk_\",this.checked)'></td>\n<form name='chk' method='post' action='$form_action'>\n";
	print "</tr>\n";
}
开发者ID:songchin,项目名称:Cacti,代码行数:15,代码来源:html.php


示例5: form_checkbox_cell

function form_checkbox_cell($title, $id)
{
    print "\t<td onClick='select_line(\"{$id}\", true)' style='" . get_checkbox_style() . "' width='1%' align='right'>\n";
    print "\t\t<input type='checkbox' style='margin: 0px;' id='chk_" . $id . "' name='chk_" . $id . "'>\n";
    print "\t</td>\n";
}
开发者ID:teddywen,项目名称:cacti,代码行数:6,代码来源:html_utility.php


示例6: graphs

function graphs() {
	global $colors;

	/* ================= input validation ================= */
	input_validate_input_number(get_request_var_request("host_id"));
	/* ==================================================== */

	/* use the first host in the list as the default */
	if ((!isset($_SESSION["sess_graphs_new_host_id"])) && (empty($_REQUEST["host_id"]))) {
		$_REQUEST["host_id"] = db_fetch_cell("select id from host order by description,hostname limit 1");
	}

	/* remember these search fields in session vars so we don't have to keep passing them around */
	if (isset($_REQUEST["host_id"])) { $_SESSION["sess_graphs_new_host_id"] = $_REQUEST["host_id"]; }else{ $_REQUEST["host_id"] = $_SESSION["sess_graphs_new_host_id"]; }

	$host = db_fetch_row("select id,description,hostname,host_template_id from host where id=" . $_REQUEST["host_id"]);

	$debug_log = debug_log_return("new_graphs");

	if (!empty($debug_log)) {
		debug_log_clear("new_graphs");
		?>
		<table width='98%' style='background-color: #f5f5f5; border: 1px solid #bbbbbb;' align='center'>
			<tr bgcolor="<?php print $colors["light"];?>">
				<td style="padding: 3px; font-family: monospace;">
					<?php print $debug_log;?>
				</td>
			</tr>
		</table>
		<br>
		<?php
	}
	?>

	<form name="form_graph_id">
	<table width="98%" align="center">
		<tr>
			<td class="textInfo" colspan="2">
				<?php print $host["description"];?> (<?php print $host["hostname"];?>)
			</td>
			<td align="right" class="textInfo" style="color: #aaaaaa;">
				<?php
				if (!empty($host["host_template_id"])) {
					print db_fetch_cell("select name from host_template where id=" . $host["host_template_id"]);
				}
				?>
			</td>
		</tr>
		<tr>
			<td>
			</td>
		</tr>

		<tr>
			<td class="textArea" style="padding: 3px;" width="300" nowrap>
				Create new graphs for the following host:
			</td>
			<td class="textInfo" rowspan="2" valign="top">
				<span style="color: #c16921;">*</span><a href="host.php?action=edit&id=<?php print $_REQUEST["host_id"];?>">Edit this Host</a><br>
				<span style="color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a>
			</td>
		</tr>
			<td>
				<select name="cbo_graph_id" onChange="window.location=document.form_graph_id.cbo_graph_id.options[document.form_graph_id.cbo_graph_id.selectedIndex].value">
					<?php
					$hosts = db_fetch_assoc("select id,CONCAT_WS('',description,' (',hostname,')') as name from host order by description,hostname");

					if (sizeof($hosts) > 0) {
					foreach ($hosts as $item) {
						print "<option value='graphs_new.php?host_id=" . $item["id"] . "'"; if ($_REQUEST["host_id"] == $item["id"]) { print " selected"; } print ">" . $item["name"] . "</option>\n";
					}
					}
					?>
				</select>
			</td>
		</tr>
	</table>


	</form>
	<form name="chk" method="post" action="graphs_new.php">
	<?php
	$total_rows = sizeof(db_fetch_assoc("select graph_template_id from host_graph where host_id=" . $_REQUEST["host_id"]));

	/* we give users the option to turn off the javascript features for data queries with lots of rows */
	if (read_config_option("max_data_query_javascript_rows") >= $total_rows) {
		$use_javascript = true;
	}else{
		$use_javascript = false;
	}

	html_start_box("<strong>Graph Templates</strong>", "98%", $colors["header"], "3", "center", "");

	print "	<tr bgcolor='#" . $colors["header_panel"] . "'>
			<td class='textSubHeaderDark'>Graph Template Name</td>
			<td width='1%' align='center' bgcolor='#819bc0' style='" . get_checkbox_style() . "'><input type='checkbox' style='margin: 0px;' name='all_cg' title='Select All' onClick='SelectAll(\"cg\",this.checked);gt_update_selection_indicators();'></td>\n
		</tr>\n";

	$graph_templates = db_fetch_assoc("select
		graph_templates.id as graph_template_id,
//.........这里部分代码省略.........
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:graphs_new.php


示例7: graphs


//.........这里部分代码省略.........
    ?>
	</table>
	</form>
	</td>
	</tr>

	<?php 
    html_end_box();
    ?>

	<form name="chk" method="post" action="graphs_new.php">
	<?php 
    $total_rows = sizeof(db_fetch_assoc("select graph_template_id from host_graph where host_id=" . $_REQUEST["host_id"]));
    $i = 0;
    if ($changed) {
        foreach ($snmp_queries as $query) {
            kill_session_var("sess_graphs_new_page" . $query["id"]);
            unset($_REQUEST["page" . $query["id"]]);
            load_current_session_value("page" . $query["id"], "sess_graphs_new_page" . $query["id"], "1");
        }
    }
    if ($_REQUEST["graph_type"] > 0) {
        load_current_session_value("page" . $_REQUEST["graph_type"], "sess_graphs_new_page" . $_REQUEST["graph_type"], "1");
    } else {
        if ($_REQUEST["graph_type"] == -2) {
            foreach ($snmp_queries as $query) {
                load_current_session_value("page" . $query["id"], "sess_graphs_new_page" . $query["id"], "1");
            }
        }
    }
    $script = "<script type='text/javascript'>\nvar gt_created_graphs = new Array();\nvar created_graphs = new Array()\n";
    if ($_REQUEST["graph_type"] < 0) {
        html_start_box("<strong>Graph Templates</strong>", "100%", "", "3", "center", "");
        print "<tr class='tableHeader'>\n\t\t\t\t<td class='tableSubHeaderColumn'>Graph Template Name</td>\n\t\t\t\t<td width='1%' align='center' class='tableSubHeaderCheckbox' style='" . get_checkbox_style() . "'><input type='checkbox' style='margin: 0px;' name='all_cg' title='Select All' onClick='SelectAll(\"cg\",this.checked);gt_update_selection_indicators();'></td>\n\n\t\t\t</tr>\n";
        $graph_templates = db_fetch_assoc("SELECT\n\t\t\tgraph_templates.id AS graph_template_id,\n\t\t\tgraph_templates.name AS graph_template_name\n\t\t\tFROM (host_graph,graph_templates)\n\t\t\tWHERE host_graph.graph_template_id=graph_templates.id\n\t\t\tAND host_graph.host_id=" . $_REQUEST["host_id"] . "\n\t\t\tORDER BY graph_templates.name");
        $template_graphs = db_fetch_assoc("SELECT\n\t\t\tgraph_local.graph_template_id\n\t\t\tFROM (graph_local,host_graph)\n\t\t\tWHERE graph_local.graph_template_id=host_graph.graph_template_id\n\t\t\tAND graph_local.host_id=host_graph.host_id\n\t\t\tAND graph_local.host_id=" . $host["id"] . "\n\t\t\tGROUP BY graph_local.graph_template_id");
        if (sizeof($template_graphs) > 0) {
            $script .= "var gt_created_graphs = new Array(";
            $cg_ctr = 0;
            foreach ($template_graphs as $template_graph) {
                $script .= ($cg_ctr > 0 ? "," : "") . "'" . $template_graph["graph_template_id"] . "'";
                $cg_ctr++;
            }
            $script .= ")\n";
        }
        /* create a row for each graph template associated with the host template */
        if (sizeof($graph_templates) > 0) {
            foreach ($graph_templates as $graph_template) {
                $query_row = $graph_template["graph_template_id"];
                print "<tr id='gt_line{$query_row}' class='" . ($i % 2 == 0 ? "odd" : "even") . "'>";
                $i++;
                print "\t\t<td onClick='gt_select_line(" . $graph_template["graph_template_id"] . ");'>\n\t\t\t\t\t\t<span id='gt_text{$query_row}" . "_0'><strong>Create:</strong> " . htmlspecialchars($graph_template["graph_template_name"]) . "</span>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\t<input type='checkbox' name='cg_{$query_row}' id='cg_{$query_row}' onClick='gt_update_selection_indicators();'>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>";
            }
        }
        $script .= "gt_update_deps(1);\n";
        $available_graph_templates = db_fetch_assoc("SELECT\n\t\t\tgraph_templates.id, graph_templates.name\n\t\t\tFROM snmp_query_graph RIGHT JOIN graph_templates\n\t\t\tON (snmp_query_graph.graph_template_id = graph_templates.id)\n\t\t\tWHERE (((snmp_query_graph.name) Is Null)) ORDER BY graph_templates.name");
        /* create a row at the bottom that lets the user create any graph they choose */
        print "\t<tr class='" . ($i % 2 == 0 ? "odd" : "even") . "'>\n\t\t\t\t<td colspan='2' width='60' nowrap>\n\t\t\t\t\t<strong>Create:</strong>&nbsp;";
        form_dropdown("cg_g", $available_graph_templates, "name", "id", "", "(Select a graph type to create)", "", "textArea");
        print "\t\t</td>\n\t\t\t</tr>";
        html_end_box();
    }
    if ($_REQUEST["graph_type"] != -1) {
        $snmp_queries = db_fetch_assoc("SELECT\n\t\t\tsnmp_query.id,\n\t\t\tsnmp_query.name,\n\t\t\tsnmp_query.xml_path\n\t\t\tFROM (snmp_query,host_snmp_query)\n\t\t\tWHERE host_snmp_query.snmp_query_id=snmp_query.id\n\t\t\tAND host_snmp_query.host_id=" . $host["id"] . ($_REQUEST["graph_type"] != -2 ? " AND snmp_query.id=" . $_REQUEST["graph_type"] : '') . "\n\t\t\tORDER BY snmp_query.name");
        if (sizeof($snmp_queries) > 0) {
            foreach ($snmp_queries as $snmp_query) {
开发者ID:teddywen,项目名称:cacti,代码行数:67,代码来源:graphs_new.php


示例8: html_header_checkbox

function html_header_checkbox($header_items, $include_form = true, $form_action = "")
{
    /* default to the 'current' file */
    if ($form_action == "") {
        $form_action = basename($_SERVER["PHP_SELF"]);
    }
    print "<tr class='tableHeader'>\n";
    for ($i = 0; $i < count($header_items); $i++) {
        print "<th>" . $header_items[$i] . "</th>\n";
    }
    print "<th width='1%' class='tdSelectAll' align='right' bgcolor='#819bc0' style='" . get_checkbox_style() . "'><input type='checkbox' style='margin: 0px;' name='all' title='Select All' onClick='SelectAll(\"chk_\",this.checked)'></th>\n" . ($include_form ? "<th style='display:none;'><form name='chk' method='post' action='{$form_action}'></th>\n" : "");
    print "</tr>\n";
}
开发者ID:khoimt,项目名称:cacti-sample,代码行数:13,代码来源:html.php


示例9: form_checkbox_cell

function form_checkbox_cell($title, $id)
{
    print "<td style='" . get_checkbox_style() . "' width='1%' align='right'>\n\t\t\t\t\t<input type='checkbox' style='margin: 0px;' id='chk_" . $id . "' name='chk_" . $id . "'>\n\t</td>";
}
开发者ID:BackupTheBerlios,项目名称:odp-svn,代码行数:4,代码来源:html_utility.php


示例10: graphs_new


//.........这里部分代码省略.........
			ORDER BY graph_templates.name");

		$template_graphs = db_fetch_assoc("SELECT
			graph_local.graph_template_id
			FROM (graph_local,device_graph)
			WHERE graph_local.graph_template_id=device_graph.graph_template_id
			AND graph_local.device_id=device_graph.device_id
			AND graph_local.device_id=" . $device["id"] . "
			GROUP BY graph_local.graph_template_id");

		if (sizeof($template_graphs) > 0) {
			print "<script type='text/javascript'>\n<!--\n";
			print "var gt_created_graphs = new Array(";

			$cg_ctr = 0;
			foreach ($template_graphs as $template_graph) {
				print (($cg_ctr > 0) ? "," : "") . "'" . $template_graph["graph_template_id"] . "'";

				$cg_ctr++;
			}

			print ")\n";
			print "//-->\n</script>\n";
		} else {
			print "<script type='text/javascript'>\nvar gt_created_graphs = new Array()\n</script>\n";
		}

		print "<script type='text/javascript'>gt_update_deps(1);</script>\n";
		print "<script type='text/javascript'>\nvar created_graphs = new Array()\n</script>\n";

		html_start_box("<strong>" . __("Graph Templates") . "</strong>", "100", $colors["header"], "3", "center", "");
		print "	<tr class='rowSubHeader'>
				<td class='textSubHeaderDark'>" . __("Graph Template Name") . "</td>
				<td class='rowSubHeader' width='1%' align='center' style='" . get_checkbox_style() . "'><input type='checkbox' style='margin: 0px;' name='all_cg' title='" . __("Select All") . "' onClick='SelectAll(\"cg\",this.checked);gt_update_selection_indicators();'></td>\n
			</tr>\n";

		/* create a row for each graph template associated with the device template */
		if (sizeof($graph_templates) > 0) {
		foreach ($graph_templates as $graph_template) {
			$query_row = $graph_template["graph_template_id"];

			print "<tr id='gt_line$query_row' bgcolor='#" . (($i % 2 == 0) ? "ffffff" : $colors["light"]) . "'>"; $i++;

			print "		<td onClick='gt_select_line(" . $graph_template["graph_template_id"] . ");'><span id='gt_text$query_row" . "_0'>
						<strong>" . __("Create:") . "</strong> " . $graph_template["graph_template_name"] . "</span>
					</td>
					<td align='right'>
						<input type='checkbox' name='cg_$query_row' id='cg_$query_row' onClick='gt_update_selection_indicators();'>
					</td>
				</tr>";
		}
		}

		$available_graph_templates = db_fetch_assoc("SELECT
			graph_templates.id, graph_templates.name
			FROM snmp_query_graph RIGHT JOIN graph_templates
			ON (snmp_query_graph.graph_template_id = graph_templates.id)
			WHERE (((snmp_query_graph.name) Is Null)) ORDER BY graph_templates.name");

		/* create a row at the bottom that lets the user create any graph they choose */
		print "	<tr bgcolor='#" . (($i % 2 == 0) ? "ffffff" : $colors["light"]) . "'>
				<td colspan='2' width='60' nowrap>
					<strong>" . __("Create:") . "</strong>&nbsp;";
					form_dropdown("cg_g", $available_graph_templates, "name", "id", "", "(Select a graph type to create)", "", "textArea");
		print "		</td>
			</tr>";
开发者ID:songchin,项目名称:Cacti,代码行数:67,代码来源:graphs_new_form.php


示例11: html_header_checkbox

function html_header_checkbox($header_items, $include_form = true, $form_action = "", $resizable = true)
{
    /* default to the 'current' file */
    if ($form_action == "") {
        $form_action = basename($_SERVER["PHP_SELF"]);
    }
    print "<tr class='tableHeader " . (!$resizable ? 'tableFixed' : '') . "'>\n";
    for ($i = 0; $i < count($header_items); $i++) {
        if (is_array($header_items[$i])) {
            print "<th style='text-align:" . $header_items[$i]['align'] . ";'>" . $header_items[$i]['display'] . "</td>";
        } else {
            print "<th style='text-align:left;'>" . $header_items[$i] . "</th>\n";
        }
    }
    print "<th width='1%' class='tableSubHeaderCheckbox' align='right' style='" . get_checkbox_style() . "'><input type='checkbox' style='margin: 0px;' name='all' title='Select All Rows' onClick='SelectAll(\"chk_\",this.checked)'></th>\n" . ($include_form ? "<th style='display:none;'><form name='chk' method='post' action='{$form_action}'></th>\n" : "");
    print "</tr>\n";
}
开发者ID:MrWnn,项目名称:cacti,代码行数:17,代码来源:html.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: user_realms_edit

function user_realms_edit()
{
    global $colors, $user_auth_realms;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var("id"));
    /* ==================================================== */
    ?>
	<table width='100%' align='center' cellpadding="5">
		<tr>
			<td>
				<span style='font-size: 12px; font-weight: bold;'>Realm permissions control which sections of Cacti this user will have access to.</span>
			</td>
		</tr>
	</table>
	<?php 
    html_start_box("", "100%", $colors["header"], "3", "center", "");
    print "\t<tr bgcolor='#" . $colors["header"] . "'>\n\t\t\t<td class='textHeaderDark'><strong>Realm Permissions</strong></td>\n\t\t\t<td width='1%' align='center' bgcolor='#819bc0' style='" . get_checkbox_style() . "'><input type='checkbox' style='margin: 0px;' name='all' title='Select All' onClick='SelectAll(\"section\",this.checked)'></td>\n\n\t\t</tr>\n";
    ?>

	<tr>
		<td colspan="2" width="100%">
			<table width="100%">
				<tr>
					<td align="top" width="50%">
						<?php 
    $i = 0;
    while (list($realm_id, $realm_name) = each($user_auth_realms)) {
        if (sizeof(db_fetch_assoc("SELECT realm_id FROM user_auth_realm WHERE user_id = " . get_request_var("id", 0) . " AND realm_id = " . $realm_id)) > 0) {
            $old_value = "on";
        } else {
            $old_value = "";
        }
        $column1 = floor(sizeof($user_auth_realms) / 2 + sizeof($user_auth_realms) % 2);
        if ($i == $column1) {
            print "</td><td valign='top' width='50%'>";
        }
        form_checkbox("section" . $realm_id, $old_value, $realm_name, "", "", "", !empty($_GET["id"]) ? 1 : 0);
        print "<br>";
        $i++;
    }
    ?>
					</td>
				</tr>
			</table>
		</td>
	</tr>

	<?php 
    html_end_box();
    form_hidden_box("save_component_realm_perms", "1", "");
}
开发者ID:songchin,项目名称:Cacti,代码行数:51,代码来源:user_admin.php


示例14: host


//.........这里部分代码省略.........
    } else {
        $sql_where .= " and (host.status=" . $_REQUEST["host_status"] . " AND host.disabled = '')";
    }
    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\n\t\tCOUNT(host.id)\n\t\tfrom host\n\t\t{$sql_where}");
    $sortby = $_REQUEST["sort_column"];
    if ($sortby == "hostname") {
        $sortby = "INET_ATON(hostname)";
    }
    $hosts = db_fetch_assoc("SELECT\n\t\thost.id,\n\t\thost.disabled,\n\t\thost.status,\n\t\thost.hostname,\n\t\thost.description,\n\t\thost.min_time,\n\t\thost.max_time,\n\t\thost.cur_time,\n\t\thost.avg_time,\n\t\thost.availability\n\t\tFROM host\n\t\t{$sql_where}\n\t\tORDER BY " . $sortby . " " . $_REQUEST["sort_direction"] . "\n\t\tLIMIT " . 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"] . "&host_status=" . $_REQUEST["host_status"]);
    $nav = "<tr bgcolor='#" . $colors["header"] . "'>\n\t\t\t<td colspan='7'>\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>&lt;&lt; ";
    if ($_REQUEST["page"] > 1) {
        $nav .= "<a class='linkOverDark' href='host.php?filter=" . $_REQUEST["filter"] . "&host_template_id=" . $_REQUEST["host_template_id"] . "&host_status=" . $_REQUEST["host_status"] . "&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_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}]\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_device") < $total_rows) {
        $nav .= "<a class='linkOverDark' href='host.php?filter=" . $_REQUEST["filter"] . "&host_template_id=" . $_REQUEST["host_template_id"] . "&host_status=" . $_REQUEST["host_status"] . "&page=" . ($_REQUEST["page"] + 1) . "'>";
    }
    $nav .= "Next";
    if ($_REQUEST["page"] * read_config_option("num_rows_device") < $total_rows) {
        $nav .= "</a>";
    }
    $nav .= " &gt;&gt;</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"), "status" => array("Status", "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, $_REQUEST["sort_column"], $_REQUEST["sort_direction"]);
    $i = 0;
    if (sizeof($hosts) > 0) {
        foreach ($hosts as $host) {
            form_alternate_row_color($colors["alternate"], $colors["light"], $i);
            $i++;
            ?>
				<td width=250>
					<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 eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $host["hostname"]);
            ?>
</td>
				<td><?php 
            print round($host["cur_time"], 2);
            ?>
</td>
				<td><?php 
            print round($host["avg_time"], 2);
            ?>
</td>
				<td><?php 
            print round($host["availability"], 2);
            ?>
%</td>
				<td style="<?php 
            print get_checkbox_style();
            ?>
" width="1%" align="right">
					<input type='checkbox' style='margin: 0px;' name='chk_<?php 
            print $host["id"];
            ?>
' title="<?php 
            print $host["description"];
            ?>
">
				</td>
			</tr>
			<?php 
        }
        /* 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);
}
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:host.php


示例15: template

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_checked函数代码示例发布时间:2022-05-15
下一篇:
PHP get_charset函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap