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

PHP html_graph_start_box函数代码示例

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

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



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

示例1: if

					}
				}
			}
		}
		strAdd = strAdd.substring(0,strAdd.length - 1);
		strDel = strDel.substring(0,strDel.length - 1);
		objFormSubmit.graph_add.value = strAdd;
		objFormSubmit.graph_remove.value = strDel;
	}
	-->
	</script>
	<form name='graphs' id='graphs' action='graph_view.php' method='get' onSubmit='form_graph(document.graphs,document.graphs)'>

	<?php

	html_graph_start_box(1, true);
	?>
	<tr bgcolor='#<?php print $colors["header_panel"];?>'>
		<td colspan='3'>
			<table width='100%' cellspacing='0' cellpadding='3' border='0'>
				<tr>
					<td align='left' class='textHeaderDark'>
						<strong>&lt;&lt; <?php if ($_REQUEST["page"] > 1) { print "<a class='linkOverDark' href='" . str_replace("<PAGE>", ($_REQUEST["page"]-1), $nav_url) . "' onClick='return url_go(url_graph(\"" . str_replace("<PAGE>", ($_REQUEST["page"]-1), $nav_url) . "\"))'>"; } print "Previous"; if ($_REQUEST["page"] > 1) { print "</a>"; } ?></strong>
					</td>
					<td align='center' class='textHeaderDark'>
						Showing Rows <?php print ((ROWS_PER_PAGE*($_REQUEST["page"]-1))+1);?> to <?php print ((($total_rows < ROWS_PER_PAGE) || ($total_rows < (ROWS_PER_PAGE*$_REQUEST["page"]))) ? $total_rows : (ROWS_PER_PAGE*$_REQUEST["page"]));?> of <?php print $total_rows;?>
					</td>
					<td align='right' class='textHeaderDark'>
						<strong><?php if (($_REQUEST["page"] * ROWS_PER_PAGE) < $total_rows) { print "<a class='linkOverDark' href='" . str_replace("<PAGE>", ($_REQUEST["page"]+1), $nav_url) . "' onClick='return url_go(url_graph(\"" . str_replace("<PAGE>", ($_REQUEST["page"]+1), $nav_url) . "\"))'>"; } print "Next"; if (($_REQUEST["page"] * ROWS_PER_PAGE) < $total_rows) { print "</a>"; } ?> &gt;&gt;</strong>
					</td>
				</tr>
开发者ID:songchin,项目名称:Cacti,代码行数:31,代码来源:graph_view.php


示例2: settings

function settings() {
	global $colors, $tabs_graphs, $settings_graphs, $current_user, $graph_views, $current_user, $graph_tree_views;

	/* you cannot have per-user graph settings if cacti's user management is not turned on */
	if (read_config_option("auth_method") == 0) {
		raise_message(6);
		display_output_messages();
		return;
	}

	/* Find out whether this user has right here */
	if($current_user["graph_settings"] == "") {
		print "<strong><font size='+1' color='#FF0000'>YOU DO NOT HAVE RIGHTS TO CHANGE GRAPH SETTINGS</font></strong>";
		include_once("./include/bottom_footer.php");
		exit;
	}

	if (read_config_option("auth_method") != 0) {
		if ($current_user["policy_graphs"] == "1") {
			$sql_where = "where user_auth_tree.user_id is null";
		}elseif ($current_user["policy_graphs"] == "2") {
			$sql_where = "where user_auth_tree.user_id is not null";
		}

		$settings_graphs["tree"]["default_tree_id"]["sql"] = get_graph_tree_array(true);
	}

	print "<form method='post' action='graph_settings.php'>\n";

	html_graph_start_box(1, true);

	print "<tr bgcolor='#" . $colors["header"] . "'><td colspan='3'><table cellspacing='0' cellpadding='3' width='100%'><tr><td class='textHeaderDark'><strong>Graph Settings</strong></td></tr></table></td></tr>";

	while (list($tab_short_name, $tab_fields) = each($settings_graphs)) {
		?>
		<tr bgcolor='<?php print $colors["header_panel"];?>'>
			<td colspan='2' class='textSubHeaderDark' style='padding: 3px;'>
				<?php print $tabs_graphs[$tab_short_name];?>
			</td>
		</tr>
		<?php

		$form_array = array();

		while (list($field_name, $field_array) = each($tab_fields)) {
			$form_array += array($field_name => $tab_fields[$field_name]);

			if ((isset($field_array["items"])) && (is_array($field_array["items"]))) {
				while (list($sub_field_name, $sub_field_array) = each($field_array["items"])) {
					if (graph_config_value_exists($sub_field_name, $_SESSION["sess_user_id"])) {
						$form_array[$field_name]["items"][$sub_field_name]["form_id"] = 1;
					}

					$form_array[$field_name]["items"][$sub_field_name]["value"] =  db_fetch_cell("select value from settings_graphs where name='$sub_field_name' and user_id=" . $_SESSION["sess_user_id"]);
				}
			}else{
				if (graph_config_value_exists($field_name, $_SESSION["sess_user_id"])) {
					$form_array[$field_name]["form_id"] = 1;
				}

				$form_array[$field_name]["value"] = db_fetch_cell("select value from settings_graphs where name='$field_name' and user_id=" . $_SESSION["sess_user_id"]);
			}
		}

		draw_edit_form(
			array(
				"config" => array(
					"no_form_tag" => true
					),
				"fields" => $form_array
				)
			);
	}

	html_graph_end_box();

	print "<br>";

	if (isset($_SERVER["HTTP_REFERER"])) {
		$timespan_sel_pos = strpos($_SERVER["HTTP_REFERER"],"&predefined_timespan");
		if ($timespan_sel_pos) {
		   $_SERVER["HTTP_REFERER"] = substr($_SERVER["HTTP_REFERER"],0,$timespan_sel_pos);
		}
	}

	form_hidden_box("referer",(isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : ""),"");
	form_hidden_box("save_component_graph_config","1","");
	form_save_button("graph_settings.php", "save");
}
开发者ID:songchin,项目名称:Cacti,代码行数:89,代码来源:graph_settings.php


示例3: grow_right_pane_tree

function grow_right_pane_tree($tree_id, $leaf_id, $host_group_data) {
	global $current_user, $colors, $config;

	include($config["include_path"] . "/config_arrays.php");
	include_once($config["library_path"] . "/data_query.php");
	include_once($config["library_path"] . "/tree.php");
	include_once($config["library_path"] . "/html_utility.php");

	if (empty($tree_id)) { return; }

	$sql_where = "";
	$sql_join = "";
	$title = "";
	$title_delimeter = "";
	$search_key = "";

	$leaf = db_fetch_row("select order_key,title,host_id,host_grouping_type from graph_tree_items where id=$leaf_id");
	$leaf_type = get_tree_item_type($leaf_id);

	/* get the "starting leaf" if the user clicked on a specific branch */
	if (!empty($leaf_id)) {
		$search_key = substr($leaf["order_key"], 0, (tree_tier($leaf["order_key"]) * CHARS_PER_TIER));
	}

	/* graph permissions */
	if (read_config_option("global_auth") == "on") {
		/* get policy information for the sql where clause */
		$sql_where = get_graph_permissions_sql($current_user["policy_graphs"], $current_user["policy_hosts"], $current_user["policy_graph_templates"]);
		$sql_where = (empty($sql_where) ? "" : "and $sql_where");
		$sql_join = "
			left join host on (host.id=graph_local.host_id)
			left join graph_templates on (graph_templates.id=graph_local.graph_template_id)
			left join user_auth_perms on ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . "))";
	}

	/* get information for the headers */
	if (!empty($tree_id)) { $tree_name = db_fetch_cell("select name from graph_tree where id=$tree_id"); }
	if (!empty($leaf_id)) { $leaf_name = $leaf["title"]; }
	if (!empty($leaf_id)) { $host_name = db_fetch_cell("select host.description from (graph_tree_items,host) where graph_tree_items.host_id=host.id and graph_tree_items.id=$leaf_id"); }

	$host_group_data_array = explode(":", $host_group_data);

	if ($host_group_data_array[0] == "graph_template") {
		$host_group_data_name = "<strong>Graph Template:</strong> " . db_fetch_cell("select name from graph_templates where id=" . $host_group_data_array[1]);
		$graph_template_id = $host_group_data_array[1];
	}elseif ($host_group_data_array[0] == "data_query") {
		$host_group_data_name = "<strong>Data Query:</strong> " . (empty($host_group_data_array[1]) ? "(Non Indexed)" : db_fetch_cell("select name from snmp_query where id=" . $host_group_data_array[1]));
		$data_query_id = $host_group_data_array[1];
	}elseif ($host_group_data_array[0] == "data_query_index") {
		$host_group_data_name = "<strong>Data Query:</strong> " . (empty($host_group_data_array[1]) ? "(Non Indexed) " : db_fetch_cell("select name from snmp_query where id=" . $host_group_data_array[1])) . "-> " . (empty($host_group_data_array[2]) ? "Unknown Index" : get_formatted_data_query_index($leaf["host_id"], $host_group_data_array[1], $host_group_data_array[2]));
		$data_query_id = $host_group_data_array[1];
		$data_query_index = $host_group_data_array[2];
	}

	if (!empty($tree_name)) { $title .= $title_delimeter . "<strong>Tree:</strong> $tree_name"; $title_delimeter = "-> "; }
	if (!empty($leaf_name)) { $title .= $title_delimeter . "<strong>Leaf:</strong> $leaf_name"; $title_delimeter = "-> "; }
	if (!empty($host_name)) { $title .= $title_delimeter . "<strong>Host:</strong> $host_name"; $title_delimeter = "-> "; }
	if (!empty($host_group_data_name)) { $title .= $title_delimeter . " $host_group_data_name"; $title_delimeter = "-> "; }

	print "<table width='98%' align='center' cellpadding='3'>";

	/* include time span selector */
	if (read_graph_config_option("timespan_sel") == "on") {
		html_graph_start_box(3, false);
		include("./include/html/inc_timespan_selector.php");
		html_graph_end_box();
		print "<br>";
	}

	/* start graph display */
	html_graph_start_box(3, false);
	print "<tr bgcolor='#" . $colors["header_panel"] . "'><td width='390' colspan='3' class='textHeaderDark'>$title</td></tr>";

	if (($leaf_type == "header") || (empty($leaf_id))) {
		$heirarchy = db_fetch_assoc("select
			graph_tree_items.id,
			graph_tree_items.title,
			graph_tree_items.local_graph_id,
			graph_tree_items.rra_id,
			graph_tree_items.order_key,
			graph_templates_graph.title_cache as title_cache
			from (graph_tree_items,graph_local)
			left join graph_templates_graph on (graph_tree_items.local_graph_id=graph_templates_graph.local_graph_id and graph_tree_items.local_graph_id>0)
			$sql_join
			where graph_tree_items.graph_tree_id=$tree_id
			and graph_local.id=graph_templates_graph.local_graph_id
			and graph_tree_items.order_key like '$search_key" . str_repeat('_', CHARS_PER_TIER) . str_repeat('0', (MAX_TREE_DEPTH * CHARS_PER_TIER) - (strlen($search_key) + CHARS_PER_TIER)) . "'
			and graph_tree_items.local_graph_id>0
			$sql_where
			group by graph_tree_items.id
			order by graph_tree_items.order_key");

		if (read_graph_config_option("thumbnail_section_tree_2") == "on") {
			html_graph_thumbnail_area($heirarchy, "", "view_type=tree&graph_start=" . get_current_graph_start() . "&graph_end=" . get_current_graph_end());
		}else{
			html_graph_area($heirarchy, "", "view_type=tree&graph_start=" . get_current_graph_start() . "&graph_end=" . get_current_graph_end());
		}
	}elseif ($leaf_type == "host") {
		/* graph template grouping */
		if ($leaf["host_grouping_type"] == HOST_GROUPING_GRAPH_TEMPLATE) {
//.........这里部分代码省略.........
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:html_tree.php


示例4: weathermap_mapselector

function weathermap_mapselector($current_id = 0)
{
    global $colors;
    $show_selector = intval(read_config_option("weathermap_map_selector"));
    if ($show_selector == 0) {
        return false;
    }
    $userid = isset($_SESSION["sess_user_id"]) ? intval($_SESSION["sess_user_id"]) : 1;
    $maps = db_fetch_assoc("select distinct weathermap_maps.*,weathermap_groups.name, weathermap_groups.sortorder as gsort from weathermap_groups,weathermap_auth,weathermap_maps where weathermap_maps.group_id=weathermap_groups.id and weathermap_maps.id=weathermap_auth.mapid and active='on' and (userid=" . $userid . " or userid=0) order by gsort, sortorder");
    if (sizeof($maps) > 1) {
        /* include graph view filter selector */
        html_graph_start_box(3, TRUE);
        ?>
	<tr bgcolor="<?php 
        print $colors["panel"];
        ?>
" class="noprint">
			<form name="weathermap_select" method="post" action="">
			<input name="action" value="viewmap" type="hidden">
			<td class="noprint">
					<table width="100%" cellpadding="0" cellspacing="0">
							<tr class="noprint">
									<td nowrap style='white-space: nowrap;' width="40">
										&nbsp;<strong>Jump To Map:</strong>&nbsp;
									</td>
									<td>
										<select name="id">
<?php 
        $ngroups = 0;
        $lastgroup = "------lasdjflkjsdlfkjlksdjflksjdflkjsldjlkjsd";
        foreach ($maps as $map) {
            if ($current_id == $map['id']) {
                $nullhash = $map['filehash'];
            }
            if ($map['name'] != $lastgroup) {
                $ngroups++;
                $lastgroup = $map['name'];
            }
        }
        $lastgroup = "------lasdjflkjsdlfkjlksdjflksjdflkjsldjlkjsd";
        foreach ($maps as $map) {
            if ($ngroups > 1 && $map['name'] != $lastgroup) {
                print "<option style='font-weight: bold; font-style: italic' value='{$nullhash}'>" . htmlspecialchars($map['name']) . "</option>";
                $lastgroup = $map['name'];
            }
            print '<option ';
            if ($current_id == $map['id']) {
                print " SELECTED ";
            }
            print 'value="' . $map['filehash'] . '">';
            // if we're showing group headings, then indent the map names
            if ($ngroups > 1) {
                print " - ";
            }
            print htmlspecialchars($map['titlecache']) . '</option>';
        }
        ?>
										</select>
											&nbsp;<input type="image" src="../../images/button_go.gif" alt="Go" border="0" align="absmiddle">										
									</td>
							</tr>
					</table>
			</td>
			</form>
	</tr>
	<?php 
        html_graph_end_box(FALSE);
    }
}
开发者ID:geldarr,项目名称:hack-space,代码行数:69,代码来源:weathermap-cacti-plugin.php


示例5: weathermap_tree_item_render

function weathermap_tree_item_render($leaf)
{
    global $colors;
    $outdir = dirname(__FILE__) . '/output/';
    $confdir = dirname(__FILE__) . '/configs/';
    $map = db_fetch_assoc("select weathermap_maps.* from weathermap_auth,weathermap_maps where weathermap_maps.id=weathermap_auth.mapid and active='on' and (userid=" . $_SESSION["sess_user_id"] . " or userid=0) and weathermap_maps.id=" . $leaf['item_id']);
    if (sizeof($map)) {
        $htmlfile = $outdir . "weathermap_" . $map[0]['id'] . ".html";
        $maptitle = $map[0]['titlecache'];
        if ($maptitle == '') {
            $maptitle = "Map for config file: " . $map[0]['configfile'];
        }
        html_graph_start_box(1, true);
        ?>
<tr bgcolor="<?php 
        print $colors["panel"];
        ?>
">
  <td>
          <table width="100%" cellpadding="0" cellspacing="0">
                <tr>
                   <td class="textHeader" nowrap><?php 
        print $maptitle;
        ?>
</td>
                </tr>
          </table>
  </td>
</tr>
<?php 
        print "<tr><td>";
        if (file_exists($htmlfile)) {
            include $htmlfile;
        }
        print "</td></tr>";
        html_graph_end_box();
    }
}
开发者ID:geldarr,项目名称:hack-space,代码行数:38,代码来源:setup.php


示例6: grow_right_pane_tree

function grow_right_pane_tree($tree_id, $leaf_id, $host_group_data) {
	global $current_user, $colors;

	require_once(CACTI_BASE_PATH . "/lib/data_query/data_query_info.php");
	require_once(CACTI_BASE_PATH . "/lib/graph_tree/graph_tree_utility.php");

	if (empty($tree_id)) { return; }

	$sql_where = "";
	$sql_join = "";
	$title = "";
	$title_delimiter = "";
	$search_key = "";

	$leaf = db_fetch_row("select order_key,title,host_id,host_grouping_type from graph_tree_items where id=$leaf_id");
	$leaf_type = get_tree_item_type($leaf_id);

	/* get the "starting leaf" if the user clicked on a specific branch */
	if (!empty($leaf_id)) {
		$search_key = substr($leaf["order_key"], 0, (api_graph_tree_item_depth_get($leaf["order_key"]) * CHARS_PER_TIER));
	}

	/* graph permissions */
	if (read_config_option("auth_method") != "0") {
		/* get policy information for the sql where clause */
		$sql_where = get_graph_permissions_sql($current_user["policy_graphs"], $current_user["policy_hosts"], $current_user["policy_graph_templates"]);
		$sql_where = (empty($sql_where) ? "" : "and $sql_where");
		$sql_join = "
			left join host on (host.id=graph.host_id)
			left join graph_template on (graph_template.id=graph.graph_template_id)
			left join user_auth_perms on ((graph.id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (graph_template.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . "))";
	}

	/* get information for the headers */
	if (!empty($tree_id)) { $tree_name = db_fetch_cell("select name from graph_tree where id=$tree_id"); }
	if (!empty($leaf_id)) { $leaf_name = $leaf["title"]; }
	if (!empty($leaf_id)) { $host_name = db_fetch_cell("select host.description from (graph_tree_items,host) where graph_tree_items.host_id=host.id and graph_tree_items.id=$leaf_id"); }

	$host_group_data_array = explode(":", $host_group_data);

	if ($host_group_data_array[0] == "graph_template") {
		$host_group_data_name = "<strong>" . _("Graph Template:") . "</strong> " . db_fetch_cell("select template_name from graph_template where id=" . $host_group_data_array[1]);
		$graph_template_id = $host_group_data_array[1];
	}elseif ($host_group_data_array[0] == "data_query") {
		$host_group_data_name = "<strong>" . _("Data Query:") . "</strong> " . (empty($host_group_data_array[1]) ? _("(Non Indexed)") : db_fetch_cell("select name from snmp_query where id=" . $host_group_data_array[1]));
		$data_query_id = $host_group_data_array[1];
	}elseif ($host_group_data_array[0] == "data_query_index") {
		$host_group_data_name = "<strong>" . _("Data Query:") . "</strong> " . (empty($host_group_data_array[1]) ? _("(Non Indexed)") : db_fetch_cell("select name from snmp_query where id=" . $host_group_data_array[1])) . "-> " . (empty($host_group_data_array[2]) ? "Unknown Index" : get_formatted_data_query_index($leaf["host_id"], $host_group_data_array[1], $host_group_data_array[2]));
		$data_query_id = $host_group_data_array[1];
		$data_query_index = $host_group_data_array[2];
	}

	if (!empty($tree_name)) { $title .= $title_delimiter . "<strong>" . _("Tree:") . "</strong> $tree_name"; $title_delimiter = "-> "; }
	if (!empty($leaf_name)) { $title .= $title_delimiter . "<strong>" . _("Leaf:") . "</strong> $leaf_name"; $title_delimiter = "-> "; }
	if (!empty($host_name)) { $title .= $title_delimiter . "<strong>" . _("Device:") . "</strong> $host_name"; $title_delimiter = "-> "; }
	if (!empty($host_group_data_name)) { $title .= $title_delimiter . " $host_group_data_name"; $title_delimiter = "-> "; }

	print "<table width='98%' align='center' cellpadding='3'>";

	/* include time span selector */
	if (read_graph_config_option("timespan_sel") == "on") {
		html_graph_start_box(3, false);
		require(CACTI_BASE_PATH . "/include/html/inc_timespan_selector.php");
		html_graph_end_box();
		print "<br>";
	}

	/* start graph display */
	html_graph_start_box(3, false);
	print "<tr bgcolor='#" . $colors["header_panel_background"] . "'><td width='390' colspan='3' class='textHeaderDark'>$title</td></tr>";

	if (($leaf_type == "header") || (empty($leaf_id))) {
		$heirarchy = db_fetch_assoc("select
			graph_tree_items.id,
			graph_tree_items.title,
			graph_tree_items.local_graph_id,
			graph_tree_items.rra_id,
			graph_tree_items.order_key,
			graph.title_cache
			from (graph_tree_items,graph)
			left join graph on (graph_tree_items.local_graph_id=graph.id)
			$sql_join
			where graph_tree_items.graph_tree_id=$tree_id
			and graph_tree_items.order_key like '$search_key" . str_repeat('_', CHARS_PER_TIER) . str_repeat('0', (MAX_TREE_DEPTH * CHARS_PER_TIER) - (strlen($search_key) + CHARS_PER_TIER)) . "'
			and graph_tree_items.local_graph_id>0
			$sql_where
			group by graph_tree_items.id
			order by graph_tree_items.order_key");

		if (read_graph_config_option("thumbnail_section_tree_2") == "on") {
			html_graph_thumbnail_area($heirarchy, "", "view_type=tree&graph_start=" . get_current_graph_start() . "&graph_end=" . get_current_graph_end());
		}else{
			html_graph_area($heirarchy, "", "view_type=tree&graph_start=" . get_current_graph_start() . "&graph_end=" . get_current_graph_end());
		}
	}elseif ($leaf_type == "host") {
		/* graph template grouping */
		if ($leaf["host_grouping_type"] == HOST_GROUPING_GRAPH_TEMPLATE) {
			$graph_templates = db_fetch_assoc("select
				graph_template.id,
				graph_template.template_name
//.........这里部分代码省略.........
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:html_tree.php


示例7: grow_right_pane_tree


//.........这里部分代码省略.........
		}
	}
	$_SESSION["sess_graph_view_host_group_data"] = $host_group_data;

	if ($changed) {
		$_REQUEST["page"] = 1;
	}

	load_current_session_value("page",   "sess_graph_view_page",   "1");
	load_current_session_value("graphs", "sess_graph_view_graphs", read_graph_config_option("treeview_graphs_per_page"));
	load_current_session_value("filter", "sess_graph_view_filter", "");

	if (isset($_SESSION["sess_graph_view_thumbnails"])) {
		if ($_SESSION["sess_graph_view_thumbnails"] == "on") {
			if (isset($_POST["filter"])) {
				if (!isset($_POST["thumbnails"])) {
					$_SESSION["sess_graph_view_thumbnails"] = 'off';
				}
			}
		}else{
			if (isset($_POST["thumbnails"])) {
				$_SESSION["sess_graph_view_thumbnails"] = 'on';
			}
		}
	}else{
		$_SESSION["sess_graph_view_thumbnails"] = read_graph_config_option("thumbnail_section_tree_2");
		if ($_SESSION["sess_graph_view_thumbnails"] == '') {
			$_SESSION["sess_graph_view_thumbnails"] = 'off';
		}else{
			$_SESSION["sess_graph_view_thumbnails"] = 'on';
		}
	}

	html_graph_start_box(1, false);

	/* include time span selector */
	if (read_graph_config_option("timespan_sel") == "on") {

		?>
			<script type='text/javascript'>
			// Initialize the calendar
			calendar=null;

			// This function displays the calendar associated to the input field 'id'
			function showCalendar(id) {
				var el = document.getElementById(id);
				if (calendar != null) {
					// we already have some calendar created
					calendar.hide();  // so we hide it first.
				} else {
					// first-time call, create the calendar.
					var cal = new Calendar(true, null, selected, closeHandler);
					cal.weekNumbers = false;  // Do not display the week number
					cal.showsTime = true;     // Display the time
					cal.time24 = true;        // Hours have a 24 hours format
					cal.showsOtherMonths = false;    // Just the current month is displayed
					calendar = cal;                  // remember it in the global var
					cal.setRange(1900, 2070);        // min/max year allowed.
					cal.create();
				}

				calendar.setDateFormat('%Y-%m-%d %H:%M');    // set the specified date format
				calendar.parseDate(el.value);                // try to parse the text in field
				calendar.sel = el;                           // inform it what input field we use

				// Display the calendar below the input field
开发者ID:songchin,项目名称:Cacti,代码行数:67,代码来源:html_tree.php


示例8: outputMapViewHeader

    private function outputMapViewHeader($pageTitle, $isCycling, $limitingToGroup)
    {
        $colors = $this->colours;
        html_graph_start_box(2, true);
        ?>
        <tr bgcolor="<?php 
        print $colors["panel"];
        ?>
">
            <td>
                <table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td class="textHeader" nowrap> <?php 
        print $pageTitle;
        ?>
 </td>
                        <td align="right">
                            <?php 
        if (!$isCycling) {
            ?>
                                (automatically cycle between full-size maps (<?php 
            if ($limitingToGroup > 0) {
                print '<a href = "?action=viewcycle_filtered&group=' . intval($limitingToGroup) . '">within this group</a>, or ';
            }
            print ' <a href = "?action=viewcycle">all maps</a>';
            ?>
)

                                <?php 
        }
        ?>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <?php 
        html_graph_end_box();
        $this->outputGroupTabs($limitingToGroup);
    }
开发者ID:jiangxilong,项目名称:network-weathermap,代码行数:40,代码来源:cacti-plugin-user.php


示例9: grow_graph_tree

function grow_graph_tree($tree_id, $start_branch, $user_id, $options) {
	global $colors, $current_user, $config;

	include(CACTI_BASE_PATH . "/include/global_arrays.php");
	require_once(CACTI_BASE_PATH . "/include/auth/auth_constants.php");
	include_once(CACTI_BASE_PATH . "/lib/tree.php");

	$search_key = "";
	$already_open = false;
	$hide_until_tier = false;
	$graph_ct = 0;
	$sql_where = "";
	$sql_join = "";

	/* get the "starting leaf" if the user clicked on a specific branch */
	if (($start_branch != "") && ($start_branch != "0")) {
		$order_key = db_fetch_cell("select order_key from graph_tree_items where id=$start_branch");

		$search_key = substr($order_key, 0, (tree_tier($order_key) * CHARS_PER_TIER));
	}

	/* graph permissions */
	if (read_config_option("auth_method") != 0) {
		/* get policy information for the sql where clause */
		$sql_where = get_graph_permissions_sql($current_user["policy_graphs"], $current_user["policy_devices"], $current_user["policy_graph_templates"]);
		$sql_where = (empty($sql_where) ? "" : "and (" . $sql_where . " OR graph_tree_items.local_graph_id=0)");
		$sql_join = "left join graph_local on (graph_templates_graph.local_graph_id=graph_local.id)
			left join graph_templates on (graph_templates.id=graph_local.graph_template_id)
			left join user_auth_perms on ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=" . PERM_GRAPHS . " and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (device.id=user_auth_perms.item_id and user_auth_perms.type=" . PERM_DEVICES . " and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=" . PERM_GRAPH_TEMPLATES . " and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . "))";
	}

	/* include time span selector */
	if (read_graph_config_option("timespan_sel") == CHECKED) {
		graph_view_timespan_selector();
	}

	$hier_sql = "select
		graph_tree_items.id,
		graph_tree_items.title,
		graph_tree_items.local_graph_id,
		graph_tree_items.rra_id,
		graph_tree_items.device_id,
		graph_tree_items.order_key,
		graph_templates_graph.title_cache as graph_title,
		CONCAT_WS('',device.description,' (',device.hostname,')') as hostname,
		settings_tree.status
		from graph_tree_items
		left join graph_templates_graph on (graph_tree_items.local_graph_id=graph_templates_graph.local_graph_id and graph_tree_items.local_graph_id>0)
		left join settings_tree on (graph_tree_items.id=settings_tree.graph_tree_item_id and settings_tree.user_id=$user_id)
		left join device on (graph_tree_items.device_id=device.id)
		$sql_join
		where graph_tree_items.graph_tree_id=$tree_id
		and graph_tree_items.order_key like '$search_key%'
		$sql_where
		order by graph_tree_items.order_key";

		$hierarchy = db_fetch_assoc($hier_sql);

		print "<!-- <P>Building Hierarchy w/ " . sizeof($hierarchy) . " leaves</P>  -->\n";

		html_graph_start_box(0, true);

		print "<tr class='rowHeader'><td colspan='30'><table cellspacing='0' cellpadding='3' width='100%'><tr><td class='textHeaderDark'><strong><a class='linkOverDark' href='" . htmlspecialchars("graph_view.php?action=tree&tree_id=" . $_SESSION["sess_view_tree_id"]) . "'>[root]</a> - " . db_fetch_cell("select name from graph_tree where id=" . $_SESSION["sess_view_tree_id"]) . "</strong></td></tr></table></td></tr>\n";

		$i = 0;

		/* loop through each tree item */
		if (sizeof($hierarchy) > 0) {
			foreach ($hierarchy as $leaf) {
				/* find out how 'deep' this item is */
				$tier = tree_tier($leaf["order_key"]);

				/* find the type of the current branch */
				if ($leaf["title"] != "") { $current_leaf_type = "heading"; }elseif (!empty($leaf["local_graph_id"])) { $current_leaf_type = "graph"; }else{ $current_leaf_type = "device"; }

				/* find the type of the next branch. make sure the next item exists first */
				if (isset($hierarchy{$i+1})) {
					if ($hierarchy{$i+1}["title"] != "") { $next_leaf_type = "heading"; }elseif (!empty($hierarchy{$i+1}["local_graph_id"])) { $next_leaf_type = "graph"; }else{ $next_leaf_type = "device"; }
				}else{
					$next_leaf_type = "";
				}

				if ((($current_leaf_type == 'heading') || ($current_leaf_type == 'device')) && (($tier <= $hide_until_tier) || ($hide_until_tier == false))) {
					$current_title = (($current_leaf_type == "heading") ? $leaf["title"] : $leaf["hostname"]);

					/* draw heading */
					draw_tree_header_row($tree_id, $leaf["id"], $tier, $current_title, true, $leaf["status"], true);

					/* this is an open device, lets expand a bit */
					if (($current_leaf_type == "device") && (empty($leaf["status"]))) {
						/* get a list of all graph templates in use by this device */
						$graph_templates = db_fetch_assoc("select
					graph_templates.id,
					graph_templates.name
					from (graph_local,graph_templates,graph_templates_graph)
					where graph_local.id=graph_templates_graph.local_graph_id
					and graph_templates_graph.graph_template_id=graph_templates.id
					and graph_local.device_id=" . $leaf["device_id"] . "
					group by graph_templates.id
					order by graph_templates.name");
//.........这里部分代码省略.........
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:html_tree.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP html_graph_thumbnail_area函数代码示例发布时间:2022-05-15
下一篇:
PHP html_graph_end_box函数代码示例发布时间: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