summaryrefslogtreecommitdiffstats
path: root/frontends/php/items.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-12-28 10:02:41 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-12-28 10:02:41 +0000
commit872ec0a0138d166aeac623a43202a4be5f66a15b (patch)
tree21a5be0333bcd1c112217ed81d9d418f4815c039 /frontends/php/items.php
parent58ccdaf3152e279c222e84bc264771c5dc9c4141 (diff)
- mass insert and delete for items. (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@614 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/items.php')
-rw-r--r--frontends/php/items.php24
1 files changed, 22 insertions, 2 deletions
diff --git a/frontends/php/items.php b/frontends/php/items.php
index 749ff55c..db630c1f 100644
--- a/frontends/php/items.php
+++ b/frontends/php/items.php
@@ -37,6 +37,26 @@
show_messages($result,"Item added","Cannot add item");
unset($HTTP_GET_VARS["itemid"]);
}
+ if($HTTP_GET_VARS["register"]=="add to all hosts")
+ {
+ $result=DBselect("select hostid,host from hosts order by host");
+ $hosts_ok="";
+ $hosts_notok="";
+ while($row=DBfetch($result))
+ {
+ $result2=add_item($HTTP_GET_VARS["description"],$HTTP_GET_VARS["key"],$row["hostid"],$HTTP_GET_VARS["delay"],$HTTP_GET_VARS["history"],$HTTP_GET_VARS["status"],$HTTP_GET_VARS["type"],$HTTP_GET_VARS["snmp_community"],$HTTP_GET_VARS["snmp_oid"],$HTTP_GET_VARS["value_type"],$HTTP_GET_VARS["trapper_hosts"]);
+ if($result2)
+ {
+ $hosts_ok=$hosts_ok." ".$row["host"];
+ }
+ else
+ {
+ $hosts_notok=$hosts_notok." ".$row["host"];
+ }
+ }
+ show_messages(TRUE,"Items added]<br>[Success for '$hosts_ok']<br>[Failed for '$hosts_notok'","Cannot add item");
+ unset($HTTP_GET_VARS["itemid"]);
+ }
if($HTTP_GET_VARS["register"]=="delete")
{
$result=delete_item($HTTP_GET_VARS["itemid"]);
@@ -49,12 +69,12 @@
while($row=DBfetch($result))
{
// $$ is correct here
- if(isset($$row["itemid"]))
+ if(isset($HTTP_GET_VARS[$row["itemid"]]))
{
$result2=delete_item($row["itemid"]);
}
}
- show_messages($result2,"Items deleted","Cannot delete items");
+ show_messages(TRUE,"Items deleted","Cannot delete items");
}
}
?>