summaryrefslogtreecommitdiffstats
path: root/frontends/php/report2.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-11-14 08:38:12 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-11-14 08:38:12 +0000
commitc2ebaf09c58047f2ef65d1c07c7521d3a1415be6 (patch)
tree13e706407f03477683966e3e438e9bd8e15090f3 /frontends/php/report2.php
parente7b40fc153ce6f7be399380f45e22ee48e2ceb00 (diff)
downloadzabbix-c2ebaf09c58047f2ef65d1c07c7521d3a1415be6.tar.gz
zabbix-c2ebaf09c58047f2ef65d1c07c7521d3a1415be6.tar.xz
zabbix-c2ebaf09c58047f2ef65d1c07c7521d3a1415be6.zip
Frontend improvements.
git-svn-id: svn://svn.zabbix.com/trunk@1479 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/report2.php')
-rw-r--r--frontends/php/report2.php75
1 files changed, 75 insertions, 0 deletions
diff --git a/frontends/php/report2.php b/frontends/php/report2.php
index 79dc74db..d15a2d91 100644
--- a/frontends/php/report2.php
+++ b/frontends/php/report2.php
@@ -35,6 +35,80 @@
?>
<?php
+ if(isset($_GET["groupid"])&&($_GET["groupid"]==0))
+ {
+ unset($_GET["groupid"]);
+ }
+
+ $h1="&nbsp;".S_AVAILABILITY_REPORT_BIG;
+
+ $h2=S_GROUP."&nbsp;";
+ $h2=$h2."<select class=\"biginput\" name=\"groupid\" onChange=\"submit()\">";
+ $h2=$h2."<option value=\"0\" ".iif(!isset($_GET["groupid"]),"selected","").">".S_ALL_SMALL;
+ $result=DBselect("select groupid,name from groups order by name");
+ while($row=DBfetch($result))
+ {
+// Check if at least one host with read permission exists for this group
+ $result2=DBselect("select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host");
+ $cnt=0;
+ while($row2=DBfetch($result2))
+ {
+ if(!check_right("Host","R",$row2["hostid"]))
+ {
+ continue;
+ }
+ $cnt=1; break;
+ }
+ if($cnt!=0)
+ {
+ $h2=$h2."<option value=\"".$row["groupid"]."\" ".iif(isset($_GET["groupid"])&&($_GET["groupid"]==$row["groupid"]),"selected","").">".$row["name"];
+ }
+ }
+ $h2=$h2."</select>";
+
+ $h2=$h2."&nbsp;".S_HOST."&nbsp;";
+ $h2=$h2."<select class=\"biginput\" name=\"hostid\" onChange=\"submit()\">";
+ $h2=$h2."<option value=\"0\"".iif(!isset($_GET["hostid"])||($_GET["hostid"]==0),"selected","").">".S_SELECT_HOST_DOT_DOT_DOT;
+
+ if(isset($_GET["groupid"]))
+ {
+ $sql="select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host";
+ }
+ else
+ {
+ $sql="select h.hostid,h.host from hosts h,items i where h.status in (0,2) and h.hostid=i.hostid group by h.hostid,h.host order by h.host";
+ }
+
+ $result=DBselect($sql);
+ while($row=DBfetch($result))
+ {
+ if(!check_right("Host","R",$row["hostid"]))
+ {
+ continue;
+ }
+ $h2=$h2."<option value=\"".$row["hostid"]."\"".iif(isset($_GET["hostid"])&&($_GET["hostid"]==$row["hostid"]),"selected","").">".$row["host"];
+ }
+ $h2=$h2."</select>";
+
+ show_header2($h1, $h2, "<form name=\"form2\" method=\"get\" action=\"report2.php\">", "</form>");
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<?php
+/*
show_table_header_begin();
echo S_AVAILABILITY_REPORT_BIG;
@@ -61,6 +135,7 @@
}
show_table_header_end();
+*/
?>
<?php