include "include/config.inc";
$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($register))
{
if($register=="add")
{
$result=add_host_to_sysmap($sysmapid,$hostid,$label,$x,$y,$icon);
show_messages($result,"Host added","Cannot add host");
}
if($register=="update")
{
$result=update_sysmap_host($shostid,$sysmapid,$hostid,$label,$x,$y,$icon);
show_messages($result,"Host updated","Cannot update host");
}
if($register=="add link")
{
$result=add_link($sysmapid,$shostid1,$shostid2);
show_messages($result,"Link added","Cannot add link");
}
if($register=="delete_link")
{
$result=delete_link($linkid);
show_messages($result,"Link deleted","Cannot delete link");
unset($linkid);
}
if($register=="delete")
{
$result=delete_sysmaps_host($shostid);
show_messages($result,"Host deleted","Cannot delete host");
unset($shostid);
}
}
?>
$result=DBselect("select name from sysmaps where sysmapid=$sysmapid");
$map=DBget_field($result,0,0);
show_table_header($map);
echo "
";
echo "";
echo "";
if(isset($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=$sysmapid and h.hostid=sh.hostid order by h.host");
echo "";
$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=$sysmapid order by linkid");
echo "";
$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($shostid))
{
$result=DBselect("select hostid,label,x,y,icon from sysmaps_hosts where shostid=$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 "