diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2001-11-23 19:07:25 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2001-11-23 19:07:25 +0000 |
| commit | 3013847c08c1b9c6e8941cbaeb0d2da7cdb002b5 (patch) | |
| tree | 79ad20349c21c0b8ce5d4c535504677ecbec90d4 /frontends/php/include | |
| parent | b38d789919f307b4ad3c7faadfe6f34b469aee9c (diff) | |
| download | zabbix-3013847c08c1b9c6e8941cbaeb0d2da7cdb002b5.tar.gz zabbix-3013847c08c1b9c6e8941cbaeb0d2da7cdb002b5.tar.xz zabbix-3013847c08c1b9c6e8941cbaeb0d2da7cdb002b5.zip | |
Minor changes
git-svn-id: svn://svn.zabbix.com/trunk@251 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
| -rw-r--r-- | frontends/php/include/config.inc | 81 |
1 files changed, 71 insertions, 10 deletions
diff --git a/frontends/php/include/config.inc b/frontends/php/include/config.inc index 5b7baf3b..2ee62b0f 100644 --- a/frontends/php/include/config.inc +++ b/frontends/php/include/config.inc @@ -4,6 +4,52 @@ $USER_DETAILS =""; $ERROR_MSG =""; + function select_trigger_by_triggerid($triggerid) + { + global $ERROR_MSG; + + $sql="select triggerid,expression,description,istrue,priority,lastchange,dep_level,comments from triggers where triggerid=$triggerid"; + $result=DBselect($sql); + if(DBnum_rows($result) == 1) + { + $trigger["groupid"]=DBget_field($result,0,0); + $trigger["expression"]=DBget_field($result,0,1); + $trigger["description"]=DBget_field($result,0,2); + $trigger["istrue"]=DBget_field($result,0,3); + $trigger["priority"]=DBget_field($result,0,4); + $trigger["lastchange"]=DBget_field($result,0,5); + $trigger["dep_level"]=DBget_field($result,0,6); + $trigger["comments"]=DBget_field($result,0,7); + } + else + { + $ERROR_MSG="No trigger with triggerid=[$triggerid]"; + } + return $trigger; + } + + function select_host_by_hostid($hostid) + { + global $ERROR_MSG; + + $sql="select hostid,host,useip,ip,port,status from hosts where hostid=$hostid"; + $result=DBselect($sql); + if(DBnum_rows($result) == 1) + { + $host["hostid"]=DBget_field($result,0,0); + $host["host"]=DBget_field($result,0,1); + $host["useip"]=DBget_field($result,0,2); + $host["ip"]=DBget_field($result,0,3); + $host["port"]=DBget_field($result,0,4); + $host["status"]=DBget_field($result,0,5); + } + else + { + $ERROR_MSG="No host with hostid=[$hostid]"; + } + return $host; + } + function show_messages($bool,$msg,$errmsg) { global $ERROR_MSG; @@ -1007,7 +1053,7 @@ $sql="select hostid from items where itemid=$itemid"; $result=DBselect($sql); $hostid=DBget_field($result,0,0); - delete_sysmaps_hosts($hostid); + delete_sysmaps_host($hostid); $result=delete_triggers_by_itemid($itemid); if(!$result) @@ -1243,7 +1289,7 @@ function add_host($host,$port,$status,$template,$useip,$ip) { - if($useip=="on") + if( isset($useip) && ($useip=="on") ) { $useip=1; } @@ -1434,6 +1480,23 @@ cr(); } + function show_table3_v_delimiter() + { + echo "</font>"; + cr(); + echo "</td>"; + cr(); + echo "</tr>"; + cr(); + echo "<tr>"; + cr(); + echo "<td colspan=1 bgcolor=99AABB align=left valign=\"top\">"; + cr(); + echo "<font face=\"Arial,Helvetica\" size=-1>"; + cr(); + } + + function show_table2_v_delimiter2() { echo "</font>"; @@ -1939,15 +2002,13 @@ { if(isset($triggerid)) { - $result=DBselect("select expression,description,priority,istrue,comments from triggers where triggerid=$triggerid"); + $trigger=select_trigger_by_triggerid($triggerid); - $expression=DBget_field($result,0,0); - $expression=explode_exp($expression,0); - - $description=DBget_field($result,0,1); - $priority=DBget_field($result,0,2); - $istrue=DBget_field($result,0,3); - $comments=DBget_field($result,0,4); + $expression=explode_exp($trigger["expression"],0); + $description=$trigger["description"]; + $priority=$trigger["priority"]; + $istrue=$trigger["istrue"]; + $comments=$trigger["comments"]; } else { |
