diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2004-11-13 11:56:12 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2004-11-13 11:56:12 +0000 |
| commit | e7b40fc153ce6f7be399380f45e22ee48e2ceb00 (patch) | |
| tree | 5566c4f33373d2fd94c44faf78973ff03b355778 /frontends/php/triggers.php | |
| parent | 6fe1ce1513c87a8b20c2281a342303aebc0a2414 (diff) | |
PHP GUI improvements.
git-svn-id: svn://svn.zabbix.com/trunk@1478 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/triggers.php')
| -rw-r--r-- | frontends/php/triggers.php | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/frontends/php/triggers.php b/frontends/php/triggers.php index 965b7789..edfddc60 100644 --- a/frontends/php/triggers.php +++ b/frontends/php/triggers.php @@ -146,29 +146,24 @@ } ?> -<?php - show_table_header_begin(); - echo S_CONFIGURATION_OF_TRIGGERS_BIG; - show_table_v_delimiter(); - -// Start of new code - echo "<form name=\"form2\" method=\"get\" action=\"triggers.php\">"; +<?php + $h1=S_CONFIGURATION_OF_TRIGGERS_BIG;; if(isset($_GET["groupid"])&&($_GET["groupid"]==0)) { unset($_GET["groupid"]); } - echo S_GROUP." "; - echo "<select class=\"biginput\" name=\"groupid\" onChange=\"submit()\">"; - echo "<option value=\"0\" ".iif(!isset($_GET["groupid"]),"selected","").">".S_ALL_SMALL; + $h2=S_GROUP." "; + $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"); + $result2=DBselect("select h.hostid,h.host from hosts h,hosts_groups hg where 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)) { @@ -180,19 +175,23 @@ } if($cnt!=0) { - echo "<option value=\"".$row["groupid"]."\" ".iif(isset($_GET["groupid"])&&($_GET["groupid"]==$row["groupid"]),"selected","").">".$row["name"]; + $h2=$h2."<option value=\"".$row["groupid"]."\" ".iif(isset($_GET["groupid"])&&($_GET["groupid"]==$row["groupid"]),"selected","").">".$row["name"]; } } - echo "</select>"; + $h2=$h2."</select>"; - echo " ".S_HOST." "; - echo "<select class=\"biginput\" name=\"hostid\" onChange=\"submit()\">"; - echo "<option value=\"0\" ".iif(!isset($_GET["hostid"]),"selected","").">".S_SELECT_HOST_DOT_DOT_DOT; + $h2=$h2." ".S_HOST." "; + $h2=$h2."<select class=\"biginput\" name=\"hostid\" onChange=\"submit()\">"; + $h2=$h2."<option value=\"0\" ".iif(!isset($_GET["hostid"]),"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"; + { + $sql="select h.hostid,h.host from hosts h,hosts_groups hg where 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"; + { + $sql="select h.hostid,h.host from hosts h group by h.hostid,h.host order by h.host"; + } $result=DBselect($sql); while($row=DBfetch($result)) @@ -201,14 +200,11 @@ { continue; } - echo "<option value=\"".$row["hostid"]."\"".iif(isset($_GET["hostid"])&&($_GET["hostid"]==$row["hostid"]),"selected","").">".$row["host"]; + $h2=$h2."<option value=\"".$row["hostid"]."\"".iif(isset($_GET["hostid"])&&($_GET["hostid"]==$row["hostid"]),"selected","").">".$row["host"]; } - echo "</select>"; - - echo "</form>"; -// end of new code + $h2=$h2."</select>"; - show_table_header_end(); + show_header2($h1, $h2, "<form name=\"form2\" method=\"get\" action=\"triggers.php\">", "</form>"); ?> <?php @@ -231,8 +227,8 @@ { echo "</TABLE><BR>"; } - echo "<br>"; - show_table_header("<A HREF='triggers.php?hostid=".$row["hostid"]."'>".$row["host"]."</A>"); +# echo "<br>"; +# show_table_header("<A HREF='triggers.php?hostid=".$row["hostid"]."'>".$row["host"]."</A>"); echo "<form method=\"get\" action=\"triggers.php\">"; echo "<input class=\"biginput\" name=\"hostid\" type=hidden value=".$_GET["hostid"]." size=8>"; echo "<TABLE BORDER=0 COLS=3 WIDTH=100% BGCOLOR=\"#AAAAAA\" cellspacing=1 cellpadding=3>"; |
