From 09c21bc3dbdf65ac9a4b8a159e33df42fa86d254 Mon Sep 17 00:00:00 2001 From: hugetoad Date: Tue, 3 Jun 2003 18:10:20 +0000 Subject: - dynamic form items.php (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@805 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/config.inc.php | 128 +++++++++++++++++++---------------- 1 file changed, 68 insertions(+), 60 deletions(-) (limited to 'frontends/php/include') diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 63e1f8f1..ec1c09ed 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -3114,11 +3114,13 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; } # Insert form for Item information - function insert_item_form($itemid) + function insert_item_form() { - if(isset($itemid)) + global $HTTP_GET_VARS; + + if(isset($HTTP_GET_VARS["itemid"])) { - $result=DBselect("select i.description, i.key_, h.host, h.port, i.delay, i.history, i.status, i.type, i.snmp_community,i.snmp_oid,i.value_type,i.trapper_hosts,i.snmp_port from items i,hosts h where i.itemid=$itemid and h.hostid=i.hostid"); + $result=DBselect("select i.description, i.key_, h.host, h.port, i.delay, i.history, i.status, i.type, i.snmp_community,i.snmp_oid,i.value_type,i.trapper_hosts,i.snmp_port from items i,hosts h where i.itemid=".$HTTP_GET_VARS["itemid"]." and h.hostid=i.hostid"); $description=DBget_field($result,0,0); $key=DBget_field($result,0,1); @@ -3136,19 +3138,19 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; } else { - $description=""; - $key=""; - $host=""; - $port=10000; - $delay=30; - $history=365; - $status=0; - $type=0; - $snmp_community="public"; - $snmp_oid="interfaces.ifTable.ifEntry.ifInOctets.1"; - $value_type=0; - $trapper_hosts=""; - $snmp_port=161; + $description=@iif(isset($HTTP_GET_VARS["description"]),$HTTP_GET_VARS["description"],""); + $key=@iif(isset($HTTP_GET_VARS["key"]),$HTTP_GET_VARS["key"],""); + $host=@iif(isset($HTTP_GET_VARS["host"]),$HTTP_GET_VARS["host"],""); + $port=@iif(isset($HTTP_GET_VARS["port"]),$HTTP_GET_VARS["port"],10000); + $delay=@iif(isset($HTTP_GET_VARS["delay"]),$HTTP_GET_VARS["delay"],30); + $history=@iif(isset($HTTP_GET_VARS["history"]),$HTTP_GET_VARS["history"],365); + $status=@iif(isset($HTTP_GET_VARS["status"]),$HTTP_GET_VARS["status"],0); + $type=@iif(isset($HTTP_GET_VARS["type"]),$HTTP_GET_VARS["type"],0); + $snmp_community=@iif(isset($HTTP_GET_VARS["snmp_community"]),$HTTP_GET_VARS["snmp_community"],"public"); + $snmp_oid=@iif(isset($HTTP_GET_VARS["snmp_oid"]),$HTTP_GET_VARS["snmp_oid"],"interfaces.ifTable.ifEntry.ifInOctets.1"); + $value_type=@iif(isset($HTTP_GET_VARS["value_type"]),$HTTP_GET_VARS["value_type"],0); + $trapper_hosts=@iif(isset($HTTP_GET_VARS["trapper_hosts"]),$HTTP_GET_VARS["trapper_hosts"],""); + $snmp_port=@iif(isset($HTTP_GET_VARS["snmp_port"]),$HTTP_GET_VARS["snmp_port"],161); } echo "
"; @@ -3158,7 +3160,10 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; show_table2_v_delimiter(); echo "
"; - echo ""; + if(isset($HTTP_GET_VARS["itemid"])) + { + echo ""; + } echo "Description"; show_table2_h_delimiter(); echo ""; @@ -3183,30 +3188,10 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; } echo ""; -/* show_table2_v_delimiter(); - echo "Host"; - show_table2_h_delimiter(); - echo "";*/ - show_table2_v_delimiter(); echo "Type"; show_table2_h_delimiter(); - echo ""; echo "