diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2001-08-13 05:53:05 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2001-08-13 05:53:05 +0000 |
| commit | b01bcb49f9b0d80308cb7724bfe3b4aecbb1c114 (patch) | |
| tree | 75cc311c7f3364ce1a72cf458c388c5077b3585b /frontends/php | |
| parent | 2d42de62ddd7faf462a1f5850fa80bedeb8d48d1 (diff) | |
| download | zabbix-b01bcb49f9b0d80308cb7724bfe3b4aecbb1c114.tar.gz zabbix-b01bcb49f9b0d80308cb7724bfe3b4aecbb1c114.tar.xz zabbix-b01bcb49f9b0d80308cb7724bfe3b4aecbb1c114.zip | |
Added status line to PHP froms.
git-svn-id: svn://svn.zabbix.com/trunk@166 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
| -rw-r--r-- | frontends/php/actions.html | 9 | ||||
| -rw-r--r-- | frontends/php/graph.html | 6 | ||||
| -rw-r--r-- | frontends/php/graphs.html | 9 | ||||
| -rw-r--r-- | frontends/php/include/config.inc | 17 | ||||
| -rw-r--r-- | frontends/php/media.html | 12 | ||||
| -rw-r--r-- | frontends/php/report1.html | 2 | ||||
| -rw-r--r-- | frontends/php/sysmap.html | 15 | ||||
| -rw-r--r-- | frontends/php/sysmaps.html | 9 | ||||
| -rw-r--r-- | frontends/php/tr_comments.html | 3 |
9 files changed, 53 insertions, 29 deletions
diff --git a/frontends/php/actions.html b/frontends/php/actions.html index 138bc4d9..2d1f5704 100644 --- a/frontends/php/actions.html +++ b/frontends/php/actions.html @@ -11,16 +11,19 @@ { if($register=="add") { - add_action( $triggerid, $userid, $good, $delay, $subject, $message ); + $result=add_action( $triggerid, $userid, $good, $delay, $subject, $message ); + show_messages($result,"Action added","Cannot add action"); } if($register=="update") { - update_action( $actionid, $userid, $good, $delay, $subject, $message ); + $result=update_action( $actionid, $userid, $good, $delay, $subject, $message ); + show_messages($result,"Action updated","Cannot update action"); unset($actionid); } if($register=="delete") { - delete_action($actionid); + $result=delete_action($actionid); + show_messages($result,"Action deleted","Cannot delete action"); unset($actionid); } } diff --git a/frontends/php/graph.html b/frontends/php/graph.html index dca018cb..ddf3f1c1 100644 --- a/frontends/php/graph.html +++ b/frontends/php/graph.html @@ -15,11 +15,13 @@ { if($register=="add") { - add_item_to_graph($graphid,$itemid,$color); + $result=add_item_to_graph($graphid,$itemid,$color); + show_messages($result,"Item added","Cannot add item"); } if($register=="delete") { - delete_graphs_item($gitemid); + $result=delete_graphs_item($gitemid); + show_messages($result,"Item deleted","Cannot delete item"); unset($gitemid); } } diff --git a/frontends/php/graphs.html b/frontends/php/graphs.html index 7e0fe08b..5aba4104 100644 --- a/frontends/php/graphs.html +++ b/frontends/php/graphs.html @@ -15,15 +15,18 @@ { if($register=="add") { - add_graph($name,$width,$height); + $result=add_graph($name,$width,$height); + show_messages($result,"Graph added","Cannot add graph"); } if($register=="update") { - update_graph($graphid,$name,$width,$height); + $result=update_graph($graphid,$name,$width,$height); + show_messages($result,"Graph updated","Cannot update graph"); } if($register=="delete") { - delete_graph($graphid); + $result=delete_graph($graphid); + show_messages($result,"Graph deleted","Cannot delete graph"); unset($graphid); } } diff --git a/frontends/php/include/config.inc b/frontends/php/include/config.inc index 885ec7f3..9bb8c09c 100644 --- a/frontends/php/include/config.inc +++ b/frontends/php/include/config.inc @@ -7,7 +7,7 @@ { if(!$bool) { - $msg=$errmsg; + $msg="ERROR:".$errmsg; $color="#AA0000"; } else @@ -643,14 +643,13 @@ $itemid=DBget_field($res,0,0); # echo "ITEMID:$itemid<BR>"; -# $sql="select functionid from functions where function='$function' and parameter=$parameter"; +# $sql="select functionid,count(*) from functions where function='$function' and parameter=$parameter group by 1"; # echo $sql,"<Br>"; -# $res=mysql_query($sql,$mysql); -# $row=mysql_fetch_row($res); - -# if($row) +# $res=DBselect($sql); +# +# if(DBget_field($res,0,1)>0) # { -# $functionid=$row[0]; +# $functionid=DBget_field($res,0,0); # } # else # { @@ -659,6 +658,7 @@ $res=DBexecute($sql); if(!$res) { +# echo "ERROR<br>"; return $res; } $functionid=DBinsert_id($res,"functions","functionid"); @@ -927,6 +927,7 @@ { $description=addslashes($description); $sql="insert into triggers (description,priority,istrue,comments) values ('$description',$priority,$istrue,'$comments')"; +# echo $sql,"<br>"; $result=DBexecute($sql); if(!$result) { @@ -934,9 +935,11 @@ } $triggerid=DBinsert_id($result,"triggers","triggerid"); +# echo $triggerid,"<br>"; $expression=implode_exp($expression,$triggerid); $sql="update triggers set expression='$expression' where triggerid=$triggerid"; +# echo $sql,"<br>"; return DBexecute($sql); } diff --git a/frontends/php/media.html b/frontends/php/media.html index 51cc3243..26347c21 100644 --- a/frontends/php/media.html +++ b/frontends/php/media.html @@ -17,19 +17,23 @@ { if($register=="enable") { - activate_media( $mediaid ); + $result=activate_media( $mediaid ); + show_messages($result,"Media activated","Cannot activate media"); } elseif($register=="disable") { - disactivate_media( $mediaid ); + $result=disactivate_media( $mediaid ); + show_messages($result,"Media disabled","Cannot disable media"); } elseif($register=="add") { - add_media( $userid, $type, $sendto); + $result=add_media( $userid, $type, $sendto); + show_messages($result,"Media added","Cannot add media"); } elseif($register=="delete") { - delete_media( $mediaid ); + $result=delete_media( $mediaid ); + show_messages($result,"Media deleted","Cannot delete media"); unset($mediaid); } } diff --git a/frontends/php/report1.html b/frontends/php/report1.html index 77a4d920..2ba4cbed 100644 --- a/frontends/php/report1.html +++ b/frontends/php/report1.html @@ -20,7 +20,7 @@ <td>Is zabbix_sucker running ?</td> <? $str="No"; - if(exec("ps -aef|grep zabbix_sucker|grep -v grep|wc -l")>0) + if(exec("ps -aef|grep zabbix_suckerd|grep -v grep|wc -l")>0) { $str="Yes"; } diff --git a/frontends/php/sysmap.html b/frontends/php/sysmap.html index 6e3a178d..873a8bec 100644 --- a/frontends/php/sysmap.html +++ b/frontends/php/sysmap.html @@ -15,24 +15,29 @@ { if($register=="add") { - add_host_to_sysmap($sysmapid,$hostid,$label,$x,$y,$icon); + $result=add_host_to_sysmap($sysmapid,$hostid,$label,$x,$y,$icon); + show_messages($result,"Host added","Cannot add host"); } if($register=="update") { - update_sysmap_host($shostid,$sysmapid,$hostid,$label,$x,$y,$icon); + $result=update_sysmap_host($shostid,$sysmapid,$hostid,$label,$x,$y,$icon); + show_messages($result,"Host updated","Cannot update host"); } if($register=="add link") { - add_link($sysmapid,$shostid1,$shostid2); + $result=add_link($sysmapid,$shostid1,$shostid2); + show_messages($result,"Link added","Cannot add link"); } if($register=="delete_link") { - delete_link($linkid); + $result=delete_link($linkid); + show_messages($result,"Link deleted","Cannot delete link"); unset($linkid); } if($register=="delete") { - delete_sysmaps_host($shostid); + $result=delete_sysmaps_host($shostid); + show_messages($result,"Host deleted","Cannot delete host"); unset($shostid); } } diff --git a/frontends/php/sysmaps.html b/frontends/php/sysmaps.html index c701b527..a794b25b 100644 --- a/frontends/php/sysmaps.html +++ b/frontends/php/sysmaps.html @@ -10,15 +10,18 @@ { if($register=="add") { - add_sysmap($name,$width,$height); + $result=add_sysmap($name,$width,$height); + show_messages($result,"Network map added","Cannot add network map"); } if($register=="update") { - update_sysmap($sysmapid,$name,$width,$height); + $result=update_sysmap($sysmapid,$name,$width,$height); + show_messages($result,"Network map updated","Cannot update network map"); } if($register=="delete") { - delete_sysmap($sysmapid); + $result=delete_sysmap($sysmapid); + show_messages($result,"Network map deleted","Cannot delete network map"); unset($sysmapid); } } diff --git a/frontends/php/tr_comments.html b/frontends/php/tr_comments.html index 1ab8e8d6..6ef72c79 100644 --- a/frontends/php/tr_comments.html +++ b/frontends/php/tr_comments.html @@ -14,7 +14,8 @@ <? if(isset($register) && ($register=="update")) { - update_trigger_comments($triggerid,$comments); + $result=update_trigger_comments($triggerid,$comments); + show_messages($result,"Trigger comment updated","Cannot update trigger comment"); } ?> |
