From 8305c6e35edf34036d417b70379d8f61ae53877a Mon Sep 17 00:00:00 2001 From: osmiy Date: Fri, 27 Jan 2006 15:07:16 +0000 Subject: - Frontend improvements (Eugene) git-svn-id: svn://svn.zabbix.com/trunk@2566 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/sysmap.php | 188 ++++++++++++----------------------------------- 1 file changed, 46 insertions(+), 142 deletions(-) (limited to 'frontends/php/sysmap.php') diff --git a/frontends/php/sysmap.php b/frontends/php/sysmap.php index 42309e43..c2456026 100644 --- a/frontends/php/sysmap.php +++ b/frontends/php/sysmap.php @@ -20,9 +20,11 @@ ?> "; + echo BR; ?> "; echo ""; echo ""; @@ -83,26 +86,33 @@ { $map_name="links".$_REQUEST["sysmapid"]."_".rand(0,100000); $map="\n"; - $result=DBselect("select h.host,sh.shostid,sh.sysmapid,sh.hostid,sh.label,sh.x,sh.y,h.status from sysmaps_hosts sh,hosts h where sh.sysmapid=".$_REQUEST["sysmapid"]." and h.status not in (".HOST_STATUS_DELETED.") and h.hostid=sh.hostid"); + + $result=DBselect("select h.host,sh.shostid,sh.sysmapid,sh.hostid,sh.label,sh.x,sh.y,h.status". + " from sysmaps_hosts sh,hosts h where sh.sysmapid=".$_REQUEST["sysmapid"]. + " and h.status not in (".HOST_STATUS_DELETED.") and h.hostid=sh.hostid"); while($row=DBfetch($result)) { - $host_=$row["host"]; - $shostid_=$row["shostid"]; - $sysmapid_=$row["sysmapid"]; - $hostid_=$row["hostid"]; - $label_=$row["label"]; - $x_=$row["x"]; - $y_=$row["y"]; - $status_=$row["status"]; + $host_ = $row["host"]; + $shostid_ = $row["shostid"]; + $sysmapid_ = $row["sysmapid"]; + $hostid_ = $row["hostid"]; + $label_ = $row["label"]; + $x_ = $row["x"]; + $y_ = $row["y"]; + $status_ = $row["status"]; if(function_exists("imagecreatetruecolor")&&@imagecreatetruecolor(1,1)) { - $map=$map."\n\"$host_\""; + $map .= "\n\"$host_\""; } else { - $map=$map."\n\"$host_\""; + $map .= "\n\"$host_\""; } } $map=$map."\n"; @@ -115,10 +125,13 @@ echo ""; show_table_header("DISPLAYED HOSTS"); + $table = new CTableInfo(); $table->setHeader(array(S_HOST,S_LABEL,S_X,S_Y,S_ICON,S_ACTIONS)); - $result=DBselect("select h.host,sh.shostid,sh.sysmapid,sh.hostid,sh.label,sh.x,sh.y,sh.icon from sysmaps_hosts sh,hosts h where sh.sysmapid=".$_REQUEST["sysmapid"]." and h.status not in (".HOST_STATUS_DELETED.") and h.hostid=sh.hostid order by h.host"); + $result=DBselect("select h.host,sh.shostid,sh.sysmapid,sh.hostid,sh.label,sh.x,sh.y,sh.icon". + " from sysmaps_hosts sh,hosts h where sh.sysmapid=".$_REQUEST["sysmapid"]. + " and h.status not in (".HOST_STATUS_DELETED.") and h.hostid=sh.hostid order by h.host"); while($row=DBfetch($result)) { $table->addRow(array( @@ -127,18 +140,29 @@ $row["x"], $row["y"], nbsp($row["icon"]), - "Change - Delete" + array( + new CLink("Change", + "sysmap.php?sysmapid=".$row["sysmapid"]. + "&shostid=".$row["shostid"]."#form"), + SPACE."-".SPACE, + new CLink("Delete", + "sysmap.php?register=delete&sysmapid=".$row["sysmapid"]. + "&shostid=".$row["shostid"]) + ) )); } $table->show(); ?> setHeader(array(S_HOST_1,S_HOST_2,S_LINK_STATUS_INDICATOR,S_ACTIONS)); + $table->SetHeader(array(S_HOST_1,S_HOST_2,S_LINK_STATUS_INDICATOR,S_ACTIONS)); - $result=DBselect("select linkid,shostid1,shostid2,triggerid from sysmaps_links where sysmapid=".$_REQUEST["sysmapid"]." order by linkid"); + $result=DBselect("select linkid,shostid1,shostid2,triggerid from sysmaps_links". + " where sysmapid=".$_REQUEST["sysmapid"]." order by linkid"); while($row=DBfetch($result)) { $result1=DBselect("select label from sysmaps_hosts where shostid=".$row["shostid1"]); @@ -161,143 +185,23 @@ $label1, $label2, $description, - "Delete" + new CLink("Delete","sysmap.php?register=delete_link".url_param("sysmapid"). + "&linkid=".$row["linkid"]) )); } $table->show(); ?> "; - - if(isset($_REQUEST["shostid"])) - { - $shost=get_sysmaps_hosts_by_shostid($_REQUEST["shostid"]); - $hostid=$shost["hostid"]; - $label=$shost["label"]; - $x=$shost["x"]; - $y=$shost["y"]; - $icon=$shost["icon"]; - $url=$shost["url"]; - $icon_on=$shost["icon_on"]; - } - else - { - $label=""; - $x=0; - $y=0; - $icon=""; - $url=""; - $icon_on=""; - } - - show_form_begin("sysmap.host"); - echo "New host to display"; - $col=0; - show_table2_v_delimiter($col++); - echo "
"; - if(isset($_REQUEST["shostid"])) - { - echo ""; - } - if(isset($_REQUEST["sysmapid"])) - { - echo ""; - } - echo "Host"; - show_table2_h_delimiter(); - echo ""; - echo ""; - echo ""; -// -// $result=DBselect("select hostid,host from hosts where status not in (".HOST_STATUS_DELETED.") order by host"); -// echo ""; - - show_table2_v_delimiter($col++); - echo "Icon (OFF)"; - show_table2_h_delimiter(); - echo ""; - - show_table2_v_delimiter($col++); - echo "Icon (ON)"; - show_table2_h_delimiter(); - echo ""; - - show_table2_v_delimiter($col++); - echo "Label"; - show_table2_h_delimiter(); - echo ""; - - show_table2_v_delimiter($col++); - echo nbsp("Coordinate X"); - show_table2_h_delimiter(); - echo ""; - - show_table2_v_delimiter($col++); - echo nbsp("Coordinate Y"); - show_table2_h_delimiter(); - echo ""; - - show_table2_v_delimiter($col++); - echo nbsp("URL"); - show_table2_h_delimiter(); - echo ""; - - show_table2_v_delimiter2(); - echo ""; - if(isset($_REQUEST["shostid"])) - { - echo ""; - } + echo BR; - show_table2_header_end(); + insert_map_host_form(); ?> 1) { show_form_begin("sysmap.connector"); -- cgit