diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-05-02 14:26:47 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-05-02 14:26:47 +0000 |
| commit | a4faa2be5b1df6bff7d5d8be3b74cef9ad8cd383 (patch) | |
| tree | 3184e11361521d1ec8945e8ceb51a288a874b19d /frontends/php/items.php | |
| parent | f74231f5e392e6713da871ea6096622209ea0f2b (diff) | |
- added group selection in Item and Trigger definition forms (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@761 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/items.php')
| -rw-r--r-- | frontends/php/items.php | 53 |
1 files changed, 51 insertions, 2 deletions
diff --git a/frontends/php/items.php b/frontends/php/items.php index 68561233..55874b24 100644 --- a/frontends/php/items.php +++ b/frontends/php/items.php @@ -83,10 +83,52 @@ show_table_header_begin(); echo "CONFIGURATION OF ITEMS"; show_table_v_delimiter(); + +// echo "<font size=2>"; + + if(isset($HTTP_GET_VARS["groupid"])) + { +// echo "all "; + echo "<a href='items.php'>all</a> "; + } + else + { + echo "<b>[<a href='items.php'>all</a>]</b> "; + } + + $result=DBselect("select groupid,name from groups order by name"); + + while($row=DBfetch($result)) + { +// if(!check_right("Host","R",$row["hostid"])) +// { +// continue; +// } + if( isset($HTTP_GET_VARS["groupid"]) && ($HTTP_GET_VARS["groupid"] == $row["groupid"]) ) + { + echo "<b>["; + } + echo "<a href='items.php?groupid=".$row["groupid"]."'>".$row["name"]."</a>"; + if(isset($HTTP_GET_VARS["groupid"]) && ($HTTP_GET_VARS["groupid"] == $row["groupid"]) ) + { + echo "]</b>"; + } + echo " "; + } ?> <?php - $result=DBselect("select hostid,host from hosts order by host"); + show_table_v_delimiter(); + if(isset($HTTP_GET_VARS["groupid"])) + { + $sql="select h.hostid,h.host from hosts h,hosts_groups hg where hg.groupid=".$HTTP_GET_VARS["groupid"]." and hg.hostid=h.hostid order by h.host"; + } + else + { + $sql="select hostid,host from hosts order by host"; + } + $result=DBselect($sql); +// $result=DBselect("select hostid,host from hosts order by host"); while($row=DBfetch($result)) { if(!check_right("Host","R",$row["hostid"])) @@ -97,7 +139,14 @@ { echo "<b>["; } - echo "<A HREF=\"items.php?hostid=".$row["hostid"]."\">".$row["host"]."</A>"; + if(isset($HTTP_GET_VARS["groupid"])) + { + echo "<A HREF=\"items.php?hostid=".$row["hostid"]."&groupid=".$HTTP_GET_VARS["groupid"]."\">".$row["host"]."</A>"; + } + else + { + echo "<A HREF=\"items.php?hostid=".$row["hostid"]."\">".$row["host"]."</A>"; + } if(isset($HTTP_GET_VARS["hostid"]) && ($HTTP_GET_VARS["hostid"] == $row["hostid"])) { echo "]</b>"; |
