include "include/config.inc.php";
$page["title"] = "Configuration of network map";
$page["file"] = "sysmap.php";
show_header($page["title"],0,0);
?>
show_table_header("CONFIGURATION OF NETWORK MAP");
echo "
";
?>
if(isset($HTTP_GET_VARS["register"]))
{
if($HTTP_GET_VARS["register"]=="add")
{
$result=add_host_to_sysmap($HTTP_GET_VARS["sysmapid"],$HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["label"],$HTTP_GET_VARS["x"],$HTTP_GET_VARS["y"],$HTTP_GET_VARS["icon"]);
show_messages($result,"Host added","Cannot add host");
}
if($HTTP_GET_VARS["register"]=="update")
{
$result=update_sysmap_host($HTTP_GET_VARS["shostid"],$HTTP_GET_VARS["sysmapid"],$HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["label"],$HTTP_GET_VARS["x"],$HTTP_GET_VARS["y"],$HTTP_GET_VARS["icon"]);
show_messages($result,"Host updated","Cannot update host");
}
if($HTTP_GET_VARS["register"]=="add link")
{
$result=add_link($HTTP_GET_VARS["sysmapid"],$HTTP_GET_VARS["shostid1"],$HTTP_GET_VARS["shostid2"]);
show_messages($result,"Link added","Cannot add link");
}
if($HTTP_GET_VARS["register"]=="delete_link")
{
$result=delete_link($HTTP_GET_VARS["linkid"]);
show_messages($result,"Link deleted","Cannot delete link");
unset($HTTP_GET_VARS["linkid"]);
}
if($HTTP_GET_VARS["register"]=="delete")
{
$result=delete_sysmaps_host($HTTP_GET_VARS["shostid"]);
show_messages($result,"Host deleted","Cannot delete host");
unset($HTTP_GET_VARS["shostid"]);
}
}
?>
$result=DBselect("select name from sysmaps where sysmapid=".$HTTP_GET_VARS["sysmapid"]);
$map=DBget_field($result,0,0);
show_table_header($map);
echo "
";
echo "";
echo "";
if(isset($HTTP_GET_VARS["sysmapid"]))
{
$map="\n";
echo $map;
echo " ";
}
echo " | ";
echo "
";
echo "
";
show_table_header("DISPLAYED HOSTS");
echo "";
echo "| Host | ";
echo "Label | ";
echo "X | ";
echo "Y | ";
echo "Icon | ";
echo "Actions | ";
echo "";
$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=".$HTTP_GET_VARS["sysmapid"]." and h.hostid=sh.hostid order by h.host");
$col=0;
for($i=0;$i";
$col=0;
} else
{
echo "";
$col=1;
}
$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);
$icon_=DBget_field($result,$i,7);
echo "| $host | ";
echo "$label_ | ";
echo "$x_ | ";
echo "$y_ | ";
echo "$icon_ | ";
echo "Change - Delete | ";
echo "
";
}
echo "
";
?>
show_table_header("CONNECTORS");
echo "";
echo "| Host 1 | ";
echo "Host 2 | ";
echo "Actions | ";
echo "";
$result=DBselect("select linkid,shostid1,shostid2 from sysmaps_links where sysmapid=".$HTTP_GET_VARS["sysmapid"]." order by linkid");
$col=0;
for($i=0;$i";
$col=0;
} else
{
echo "";
$col=1;
}
$linkid=DBget_field($result,$i,0);
$shostid1=DBget_field($result,$i,1);
$shostid2=DBget_field($result,$i,2);
$result1=DBselect("select label from sysmaps_hosts where shostid=$shostid1");
$label1=DBget_field($result1,0,0);
$result1=DBselect("select label from sysmaps_hosts where shostid=$shostid2");
$label2=DBget_field($result1,0,0);
echo "| $label1 | ";
echo "$label2 | ";
echo "Delete | ";
echo "
";
}
echo "
";
?>
echo "
";
echo "";
if(isset($HTTP_GET_VARS["shostid"]))
{
$result=DBselect("select hostid,label,x,y,icon from sysmaps_hosts where shostid=".$HTTP_GET_VARS["shostid"]);
$hostid=DBget_field($result,0,0);
$label=DBget_field($result,0,1);
$x=DBget_field($result,0,2);
$y=DBget_field($result,0,3);
$icon=DBget_field($result,0,4);
}
else
{
$label="";
$x=0;
$y=0;
}
show_table2_header_begin();
echo "New host to display";
show_table2_v_delimiter();
echo "