summaryrefslogtreecommitdiffstats
path: root/frontends/php/charts.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-03-19 16:43:36 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-03-19 16:43:36 +0000
commit06039f6164b8ec63d2bb16dc55ff257ec6d5c896 (patch)
treebcf96f55863a30e3ec547ec35aa78ec5790b8fc2 /frontends/php/charts.php
parentb023a1bde4bf4a193013296374325457f62a49f1 (diff)
Minor changes.
git-svn-id: svn://svn.zabbix.com/trunk@1716 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/charts.php')
-rw-r--r--frontends/php/charts.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/frontends/php/charts.php b/frontends/php/charts.php
index 72cd3811..45252c2b 100644
--- a/frontends/php/charts.php
+++ b/frontends/php/charts.php
@@ -137,14 +137,17 @@
$h2=$h2."<select class=\"biginput\" name=\"graphid\" onChange=\"submit()\">";
$h2=$h2."<option value=\"0\" ".iif(!isset($_GET["graphid"]),"selected","").">".S_SELECT_GRAPH_DOT_DOT_DOT;
- $result=DBselect("select graphid,name from graphs order by name");
- while($row=DBfetch($result))
+ if(isset($_GET["hostid"])&&($_GET["hostid"]!=0))
{
- if(!check_right("Graph","R",$row["graphid"]))
+ $result=DBselect("select distinct g.graphid,g.name from graphs g,graphs_items gi,items i where i.itemid=gi.itemid and g.graphid=gi.graphid and i.hostid=".$_GET["hostid"]." order by g.name");
+ while($row=DBfetch($result))
{
- continue;
+ if(!check_right("Graph","R",$row["graphid"]))
+ {
+ continue;
+ }
+ $h2=$h2."<option value=\"".$row["graphid"]."\" ".iif(isset($_GET["graphid"])&&($_GET["graphid"]==$row["graphid"]),"selected","").">".$row["name"];
}
- $h2=$h2."<option value=\"".$row["graphid"]."\" ".iif(isset($_GET["graphid"])&&($_GET["graphid"]==$row["graphid"]),"selected","").">".$row["name"];
}
$h2=$h2."</select>";