diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-03-20 09:10:56 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-03-20 09:10:56 +0000 |
| commit | 46f41c39f4ad9095c77a4df7f8d553528da0bc41 (patch) | |
| tree | 044cf6ca32c4a28f0998409b58c36ca31e384095 /frontends/php/include/graphs.inc.php | |
| parent | c628c6d120a5e4f3899d342d7e96a256404b795c (diff) | |
| download | zabbix-46f41c39f4ad9095c77a4df7f8d553528da0bc41.tar.gz zabbix-46f41c39f4ad9095c77a4df7f8d553528da0bc41.tar.xz zabbix-46f41c39f4ad9095c77a4df7f8d553528da0bc41.zip | |
Minor changes.
git-svn-id: svn://svn.zabbix.com/trunk@1719 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/graphs.inc.php')
| -rw-r--r-- | frontends/php/include/graphs.inc.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/frontends/php/include/graphs.inc.php b/frontends/php/include/graphs.inc.php index f6d39809..cb642277 100644 --- a/frontends/php/include/graphs.inc.php +++ b/frontends/php/include/graphs.inc.php @@ -168,25 +168,29 @@ $item=get_item_by_itemid($graph_item["itemid"]); $sql="select hostid,templateid,graphs from hosts_templates where templateid=".$item["hostid"]; - echo $sql,"<br>"; $result=DBselect($sql); while($row=DBfetch($result)) { if($row["graphs"]&4 == 0) continue; $sql="select i.itemid from items i where i.key_='".$item["key_"]."' and i.hostid=".$row["hostid"]; - echo $sql,"<br>"; $result2=DBselect($sql); if(DBnum_rows($result2)==0) continue; $row2=DBfetch($result2); $itemid=$row2["itemid"]; - $sql="select distinct gi.gitemid from graphs_items gi,items i where i.itemid=gi.itemid and i.hostid=".$row["hostid"]." and i.itemid=$itemid"; - echo $sql,"<br>"; + $sql="select distinct gi.gitemid,gi.graphid from graphs_items gi,items i where i.itemid=gi.itemid and i.hostid=".$row["hostid"]." and i.itemid=$itemid"; $result2=DBselect($sql); while($row2=DBfetch($result2)) { delete_graphs_item($row2["gitemid"]); + $sql="select count(*) as count from graphs_items where graphid=".$row2["graphid"]; + $result3=DBselect($sql); + $row3=DBfetch($result3); + if($row3["count"]==0) + { + delete_graph($row2["graphid"]); + } } } } |
