diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-03-17 08:30:54 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-03-17 08:30:54 +0000 |
| commit | f8983d0ef387a56e3d3db9c7e2dafc332f2adaa4 (patch) | |
| tree | e3805b47c485c65b5337b0e35abc3438c4a4b46b /frontends/php/include/config.inc.php | |
| parent | 0940d9c76a721725392f3bb8db149bf337ad1a75 (diff) | |
| download | zabbix-f8983d0ef387a56e3d3db9c7e2dafc332f2adaa4.tar.gz zabbix-f8983d0ef387a56e3d3db9c7e2dafc332f2adaa4.tar.xz zabbix-f8983d0ef387a56e3d3db9c7e2dafc332f2adaa4.zip | |
- added frontends/php/include/maps.inc.php (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@1701 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/config.inc.php')
| -rw-r--r-- | frontends/php/include/config.inc.php | 177 |
1 files changed, 1 insertions, 176 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 53394957..7d0b4596 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -37,6 +37,7 @@ include_once "include/triggers.inc.php"; include_once "include/actions.inc.php"; include_once "include/services.inc.php"; + include_once "include/maps.inc.php"; function getmicrotime() { @@ -629,23 +630,6 @@ return $result; } - function get_map_by_sysmapid($sysmapid) - { - global $ERROR_MSG; - - $sql="select * from sysmaps where sysmapid=$sysmapid"; - $result=DBselect($sql); - if(DBnum_rows($result) == 1) - { - return DBfetch($result); - } - else - { - $ERROR_MSG="No system map with sysmapid=[$sysmapid]"; - } - return $result; - } - function get_image_by_name($imagetype,$name) { $sql="select * from images where imagetype=$imagetype and name='$name'"; @@ -1506,26 +1490,6 @@ echo "</head>"; return DBexecute($sql); } - # Delete System Map - - function delete_sysmap( $sysmapid ) - { - $sql="delete from sysmaps where sysmapid=$sysmapid"; - $result=DBexecute($sql); - if(!$result) - { - return $result; - } - $sql="delete from sysmaps_hosts where sysmapid=$sysmapid"; - $result=DBexecute($sql); - if(!$result) - { - return $result; - } - $sql="delete from sysmaps_links where sysmapid=$sysmapid"; - return DBexecute($sql); - } - # Delete Alert by actionid function delete_alert_by_actionid( $actionid ) @@ -1598,57 +1562,6 @@ echo "</head>"; } } - # Update System Map - - function update_sysmap($sysmapid,$name,$width,$height,$background,$label_type) - { - global $ERROR_MSG; - - if(!check_right("Network map","U",$sysmapid)) - { - $ERROR_MSG="Insufficient permissions"; - return 0; - } - - $sql="update sysmaps set name='$name',width=$width,height=$height,background='$background',label_type=$label_type where sysmapid=$sysmapid"; - return DBexecute($sql); - } - - # Add System Map - - function add_sysmap($name,$width,$height,$background,$label_type) - { - global $ERROR_MSG; - - if(!check_right("Network map","A",0)) - { - $ERROR_MSG="Insufficient permissions"; - return 0; - } - - $sql="insert into sysmaps (name,width,height,background,label_type) values ('$name',$width,$height,'$background',$label_type)"; - return DBexecute($sql); - } - - function add_link($sysmapid,$shostid1,$shostid2,$triggerid,$drawtype_off,$color_off,$drawtype_on,$color_on) - { - if($triggerid == 0) - { - $sql="insert into sysmaps_links (sysmapid,shostid1,shostid2,triggerid,drawtype_off,color_off,drawtype_on,color_on) values ($sysmapid,$shostid1,$shostid2,NULL,$drawtype_off,'$color_off',$drawtype_on,'$color_on')"; - } - else - { - $sql="insert into sysmaps_links (sysmapid,shostid1,shostid2,triggerid,drawtype_off,color_off,drawtype_on,color_on) values ($sysmapid,$shostid1,$shostid2,$triggerid,$drawtype_off,'$color_off',$drawtype_on,'$color_on')"; - } - return DBexecute($sql); - } - - function delete_link($linkid) - { - $sql="delete from sysmaps_links where linkid=$linkid"; - return DBexecute($sql); - } - # Add host-template linkage function add_template_linkage($hostid,$templateid,$items,$triggers,$actions,$graphs,$screens) { @@ -1670,20 +1583,6 @@ echo "</head>"; return DBexecute($sql); } - # Add Host to system map - - function add_host_to_sysmap($sysmapid,$hostid,$label,$x,$y,$icon,$url,$icon_on) - { - $sql="insert into sysmaps_hosts (sysmapid,hostid,label,x,y,icon,url,icon_on) values ($sysmapid,$hostid,'$label',$x,$y,'$icon','$url','$icon_on')"; - return DBexecute($sql); - } - - function update_sysmap_host($shostid,$sysmapid,$hostid,$label,$x,$y,$icon,$url,$icon_on) - { - $sql="update sysmaps_hosts set hostid=$hostid,label='$label',x=$x,y=$y,icon='$icon',url='$url',icon_on='$icon_on' where shostid=$shostid"; - return DBexecute($sql); - } - # Add everything based on host_templateid function add_using_host_template($hostid,$host_templateid) @@ -2299,33 +2198,6 @@ echo "</head>"; return DBexecute($sql); } - function delete_sysmaps_host_by_hostid($hostid) - { - $sql="select shostid from sysmaps_hosts where hostid=$hostid"; - $result=DBselect($sql); - while($row=DBfetch($result)) - { - $sql="delete from sysmaps_links where shostid1=".$row["shostid"]." or shostid2".$row["shostid"]; - DBexecute($sql); - } - $sql="delete from sysmaps_hosts where hostid=$hostid"; - return DBexecute($sql); - } - - # Delete Host from sysmap definition - - function delete_sysmaps_host($shostid) - { - $sql="delete from sysmaps_links where shostid1=$shostid or shostid2=$shostid"; - $result=DBexecute($sql); - if(!$result) - { - return $result; - } - $sql="delete from sysmaps_hosts where shostid=$shostid"; - return DBexecute($sql); - } - function delete_groups_by_hostid($hostid) { $sql="select groupid from hosts_groups where hostid=$hostid"; @@ -3289,53 +3161,6 @@ echo "</head>"; echo "</SCRIPT>"; } - function get_map_imagemap($sysmapid) - { - $map="\n<map name=links$sysmapid>"; - $result=DBselect("select h.host,sh.shostid,sh.sysmapid,sh.hostid,sh.label,sh.x,sh.y,h.status,sh.icon,sh.url from sysmaps_hosts sh,hosts h where sh.sysmapid=$sysmapid and h.hostid=sh.hostid"); - for($i=0;$i<DBnum_rows($result);$i++) - { - $host=DBget_field($result,$i,0); - $shostid=DBget_field($result,$i,1); - $sysmapid=DBget_field($result,$i,2); - $hostid=DBget_field($result,$i,3); - $label=DBget_field($result,$i,4); - $x=DBget_field($result,$i,5); - $y=DBget_field($result,$i,6); - $status=DBget_field($result,$i,7); - $icon=DBget_field($result,$i,8); - $url=DBget_field($result,$i,9); - - if($status==HOST_STATUS_MONITORED) - { - $sql="select image from images where imagetype=1 and name='$icon'"; - $result2=DBselect($sql); - if(DBnum_rows($result2)==1) - { - $back=ImageCreateFromString(DBget_field($result2,0,0)); - $sizex = imagesx($back); - $sizey = imagesy($back); - if($url=="") - { - $url="tr_status.php?hostid=$hostid&noactions=true&onlytrue=true&compact=true"; - } - $map=$map."\n<area shape=rect coords=$x,$y,".($x+$sizex).",".($y+$sizey)." href=\"$url\" alt=\"Host: $host Label: $label\">"; - } - -/* if(function_exists("imagecreatetruecolor")&&@imagecreatetruecolor(1,1)) - { - $map=$map."\n<area shape=rect coords=$x,$y,".($x+48).",".($y+48)." href=\"tr_status.php?hostid=$hostid&noactions=true&onlytrue=true&compact=true\" alt=\"$host\">"; - } - else - { - $map=$map."\n<area shape=rect coords=$x,$y,".($x+32).",".($y+32)." href=\"tr_status.php?hostid=$hostid&noactions=true&onlytrue=true&compact=true\" alt=\"$host\">"; - }*/ - } - } - $map=$map."\n</map>"; - return $map; - } - /* Use ImageSetStyle+ImageLIne instead of bugged ImageDashedLine */ if(function_exists("imagesetstyle")) { |
