summaryrefslogtreecommitdiffstats
path: root/frontends/php/hosts.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-10-20 07:10:41 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-10-20 07:10:41 +0000
commit2b110264a62b85ffd03938f36ab56ff850e31aad (patch)
tree323dff3addc63a5f61e9a5e45592f1caaaad198d /frontends/php/hosts.php
parentb0a2c054f9bee44c63758b015757154cdd8098b7 (diff)
- support for host groups (Alexei)
- added table hosts_groups (Alexei) - added table groups (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@533 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/hosts.php')
-rw-r--r--frontends/php/hosts.php37
1 files changed, 35 insertions, 2 deletions
diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php
index 141752e7..087ba0df 100644
--- a/frontends/php/hosts.php
+++ b/frontends/php/hosts.php
@@ -19,13 +19,13 @@
{
if($HTTP_GET_VARS["register"]=="add")
{
- $result=add_host($HTTP_GET_VARS["host"],$HTTP_GET_VARS["port"],$HTTP_GET_VARS["status"],$HTTP_GET_VARS["template"],$HTTP_GET_VARS["useip"],$HTTP_GET_VARS["ip"],$HTTP_GET_VARS["host_templateid"]);
+ $result=add_host($HTTP_GET_VARS["host"],$HTTP_GET_VARS["port"],$HTTP_GET_VARS["status"],$HTTP_GET_VARS["template"],$HTTP_GET_VARS["useip"],$HTTP_GET_VARS["ip"],$HTTP_GET_VARS["host_templateid"],$HTTP_GET_VARS["newgroup"],$HTTP_GET_VARS["groups"]);
show_messages($result,"Host added","Cannot add host");
unset($HTTP_GET_VARS["hostid"]);
}
if($HTTP_GET_VARS["register"]=="update")
{
- $result=update_host($HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["host"],$HTTP_GET_VARS["port"],$HTTP_GET_VARS["status"],$HTTP_GET_VARS["useip"],$HTTP_GET_VARS["ip"]);
+ $result=update_host($HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["host"],$HTTP_GET_VARS["port"],$HTTP_GET_VARS["status"],$HTTP_GET_VARS["useip"],$HTTP_GET_VARS["ip"],$HTTP_GET_VARS["newgroup"],$HTTP_GET_VARS["groups"]);
show_messages($result,"Host details updated","Cannot update host details");
unset($HTTP_GET_VARS["hostid"]);
}
@@ -156,6 +156,39 @@
echo "<input name=\"host\" value=\"$host\" size=20>";
show_table2_v_delimiter();
+ echo "Groups";
+ show_table2_h_delimiter();
+ echo "<select multiple name=\"groups[]\" size=\"5\">";
+ $result=DBselect("select distinct groupid,name from groups order by name");
+ while($row=DBfetch($result))
+ {
+ if(isset($HTTP_GET_VARS["hostid"]))
+ {
+ $sql="select count(*) as count from hosts_groups where hostid=".$HTTP_GET_VARS["hostid"]." and groupid=".$row["groupid"];
+ $result2=DBselect($sql);
+ $row2=DBfetch($result2);
+ if($row2["count"]==0)
+ {
+ echo "<option value=\"".$row["groupid"]."\">".$row["name"];
+ }
+ else
+ {
+ echo "<option value=\"".$row["groupid"]."\" selected>".$row["name"];
+ }
+ }
+ else
+ {
+ echo "<option value=\"".$row["groupid"]."\">".$row["name"];
+ }
+ }
+ echo "</select>";
+
+ show_table2_v_delimiter();
+ echo "New group";
+ show_table2_h_delimiter();
+ echo "<input name=\"newgroup\" value=\"\" size=20>";
+
+ show_table2_v_delimiter();
echo "Use IP address";
show_table2_h_delimiter();
echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"useip\" $useip>";