No permissions !"); show_page_footer(); exit; } ?> 1) { insert_map_link_form(); } elseif(isset($_REQUEST["form"]) && $_REQUEST["form"]=="Add Host") { insert_map_host_form(); } else { $map=get_map_by_sysmapid($_REQUEST["sysmapid"]); show_table_header($map["name"]); echo ""; echo ""; echo ""; echo ""; echo "
"; if(isset($_REQUEST["sysmapid"])) { $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"); 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"]; if(function_exists("imagecreatetruecolor")&&@imagecreatetruecolor(1,1)) { $map .= "\n\"$host_\""; } else { $map .= "\n\"$host_\""; } } $map=$map."\n"; echo $map; echo ""; } echo "
"; ?> AddVar("sysmapid",$_REQUEST["sysmapid"]); $form->AddItem(new CButton("form","Add Host")); show_table_header("DISPLAYED HOSTS",$form); $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"); while($row=DBfetch($result)) { $table->addRow(array( $row["host"], $row["label"], $row["x"], $row["y"], nbsp($row["icon"]), array( new CLink("Change", "sysmap.php?sysmapid=".$row["sysmapid"]. "&form=Add+Host&shostid=".$row["shostid"]."#form"), SPACE."-".SPACE, new CLink("Delete", "sysmap.php?register=delete&sysmapid=".$row["sysmapid"]. "&shostid=".$row["shostid"]) ) )); } $table->show(); ?> AddVar("sysmapid",$_REQUEST["sysmapid"]); $form->AddItem(new CButton("form","Create Connection")); show_table_header("CONNECTORS",$form); $table = new CTableInfo(); $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"); while($row=DBfetch($result)) { /* prepare label 1 */ $db_hosts = DBselect("select h.*". " from sysmaps_hosts sh,hosts h". " where sh.sysmapid=".$_REQUEST["sysmapid"]. " and h.hostid=sh.hostid". " and h.status not in (".HOST_STATUS_DELETED.")". " and sh.shostid=".$row["shostid1"]); if(DBnum_rows($db_hosts)==0) continue; $result1=DBselect("select label from sysmaps_hosts where shostid=".$row["shostid1"]); $row1=DBfetch($result1); $label1=$row1["label"]; if($label1==""){ $db_host = DBfetch($db_hosts); $label1 = $db_host['host']; } /* prepare label 2 */ $db_hosts = DBselect("select h.*". " from sysmaps_hosts sh,hosts h". " where sh.sysmapid=".$_REQUEST["sysmapid"]. " and h.hostid=sh.hostid". " and h.status not in (".HOST_STATUS_DELETED.")". " and sh.shostid=".$row["shostid2"]); if(DBnum_rows($db_hosts)==0) continue; $result1=DBselect("select label from sysmaps_hosts where shostid=".$row["shostid2"]); $row1=DBfetch($result1); $label2=$row1["label"]; if($label2==""){ $db_host = DBfetch($db_hosts); $label2 = $db_host['host']; } /* prepare description */ if(isset($row["triggerid"])) $description=expand_trigger_description($row["triggerid"]); else $description="-"; /* draw row */ $table->addRow(array( $label1, $label2, $description, new CLink("Delete","sysmap.php?register=delete_link".url_param("sysmapid"). "&linkid=".$row["linkid"]) )); } $table->show(); } ?>