No permissions !");
show_footer();
exit;
}
?>
[Success for '$hosts_ok']
[Failed for '$hosts_notok'","Cannot add item");
unset($HTTP_GET_VARS["itemid"]);
}
if($HTTP_GET_VARS["register"]=="delete")
{
$result=delete_item($HTTP_GET_VARS["itemid"]);
show_messages($result,"Item deleted","Cannot delete item");
unset($itemid);
}
if($HTTP_GET_VARS["register"]=="Delete selected")
{
$result=DBselect("select itemid from items where hostid=".$HTTP_GET_VARS["hostid"]);
while($row=DBfetch($result))
{
// $$ is correct here
if(isset($HTTP_GET_VARS[$row["itemid"]]))
{
$result2=delete_item($row["itemid"]);
}
}
show_messages(TRUE,"Items deleted","Cannot delete items");
}
if($HTTP_GET_VARS["register"]=="Activate selected")
{
$result=DBselect("select itemid from items where hostid=".$HTTP_GET_VARS["hostid"]);
while($row=DBfetch($result))
{
// $$ is correct here
if(isset($HTTP_GET_VARS[$row["itemid"]]))
{
$result2=activate_item($row["itemid"]);
}
}
show_messages(TRUE,"Items activated","Cannot activate items");
}
if($HTTP_GET_VARS["register"]=="Disable selected")
{
$result=DBselect("select itemid from items where hostid=".$HTTP_GET_VARS["hostid"]);
while($row=DBfetch($result))
{
// $$ is correct here
if(isset($HTTP_GET_VARS[$row["itemid"]]))
{
$result2=disable_item($row["itemid"]);
}
}
show_messages(TRUE,"Items disabled","Cannot disable items");
}
}
?>
";
if(isset($HTTP_GET_VARS["groupid"]))
{
// echo "all ";
echo "all ";
}
else
{
echo "[all] ";
}
$result=DBselect("select groupid,name from groups order by name");
while($row=DBfetch($result))
{
// if(!check_right("Host","R",$row["hostid"]))
// {
// continue;
// }
if( isset($HTTP_GET_VARS["groupid"]) && ($HTTP_GET_VARS["groupid"] == $row["groupid"]) )
{
echo "[";
}
echo "".$row["name"]."";
if(isset($HTTP_GET_VARS["groupid"]) && ($HTTP_GET_VARS["groupid"] == $row["groupid"]) )
{
echo "]";
}
echo " ";
}
?>
[";
}
if(isset($HTTP_GET_VARS["groupid"]))
{
echo "".$row["host"]."";
}
else
{
echo "".$row["host"]."";
}
if(isset($HTTP_GET_VARS["hostid"]) && ($HTTP_GET_VARS["hostid"] == $row["hostid"]))
{
echo "]";
}
echo " ";
}
show_table_header_end();
$lasthost="";
if(isset($HTTP_GET_VARS["hostid"])&&!isset($HTTP_GET_VARS["type"]))
{
$result=DBselect("select h.host,i.key_,i.itemid,i.description,h.port,i.delay,i.history,i.lastvalue,i.lastclock,i.status,i.lastdelete,i.nextcheck,h.hostid,i.type from hosts h,items i where h.hostid=i.hostid and h.hostid=".$HTTP_GET_VARS["hostid"]." order by h.host,i.key_,i.description");
$col=0;
while($row=DBfetch($result))
{
if(!check_right("Item","R",$row["itemid"]))
{
continue;
}
if($lasthost != $row["host"])
{
if($lasthost != "")
{
echo "
";
}
echo "
";
show_table_header("".$row["host"]."");
echo "