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/hosts.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/hosts.php')
| -rw-r--r-- | frontends/php/hosts.php | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php index 409ecc15..ba938012 100644 --- a/frontends/php/hosts.php +++ b/frontends/php/hosts.php @@ -147,47 +147,49 @@ ?> <?php - show_table_header_begin(); - echo S_CONFIGURATION_OF_HOSTS_BIG; - show_table_v_delimiter(); - - if(isset($_GET["groupid"])) - { -// echo "all "; - echo "<a href='hosts.php'>".S_ALL_SMALL."</a> "; - } - else + if(isset($_GET["groupid"])&&($_GET["groupid"]==0)) { - echo "<b>[<a href='hosts.php'>".S_ALL_SMALL."</a>]</b> "; + unset($_GET["groupid"]); } +?> - $result=DBselect("select groupid,name from groups order by name"); +<?php + if(!isset($_GET["hostid"])) +{ + $h1=" ".S_CONFIGURATION_OF_HOSTS_BIG; + + $h2_form1="<form name=\"form2\" method=\"get\" action=\"latest.php\">"; + + + $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)) { -// if(!check_right("Host","R",$row["hostid"])) -// { -// continue; -// } - if( isset($_GET["groupid"]) && ($_GET["groupid"] == $row["groupid"]) ) +// 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.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)) { - echo "<b>["; + if(!check_right("Host","R",$row2["hostid"])) + { + continue; + } + $cnt=1; break; } - echo "<a href='hosts.php?groupid=".$row["groupid"]."'>".$row["name"]."</a>"; - if(isset($_GET["groupid"]) && ($_GET["groupid"] == $row["groupid"]) ) + if($cnt!=0) { - echo "]</b>"; + $h2=$h2."<option value=\"".$row["groupid"]."\" ".iif(isset($_GET["groupid"])&&($_GET["groupid"]==$row["groupid"]),"selected","").">".$row["name"]; } - echo " "; } + $h2=$h2."</select>"; - show_table_header_end(); - echo "<br>"; + show_header2($h1, $h2, "<form name=\"form2\" method=\"get\" action=\"hosts.php\">", "</form>"); ?> <?php - if(!isset($_GET["hostid"])) -{ table_begin(); table_header(array(S_ID,S_HOST,S_IP,S_PORT,S_STATUS,S_ACTIONS)); |
