";
$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");
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"];
$icon=$row["icon"];
$url=$row["url"];
if($status==HOST_STATUS_MONITORED)
{
$sql="select image from images where imagetype=1 and name='".zbx_ads($icon)."'";
$result2=DBselect($sql);
if(DBnum_rows($result2)==1)
{
$row2=DBfetch($result2);
$back=ImageCreateFromString($row2["image"]);
$sizex = imagesx($back);
$sizey = imagesy($back);
if($url=="")
{
$url="tr_status.php?hostid=$hostid&noactions=true&onlytrue=true&compact=true";
}
$map=$map."\n";
}
/* if(function_exists("imagecreatetruecolor")&&@imagecreatetruecolor(1,1))
{
$map=$map."\n";
}
else
{
$map=$map."\n";
}*/
}
}
$map=$map."\n";
return $map;
}
?>