".S_NO_PERMISSIONS."");
show_footer();
exit;
}
?>
[Success for '$hosts_ok']
[Failed for '$hosts_notok'","Cannot add item");
unset($_GET["itemid"]);
}
if($_GET["register"]=="delete")
{
$result=delete_item($_GET["itemid"]);
show_messages($result, S_ITEM_DELETED, S_CANNOT_DELETE_ITEM);
unset($itemid);
}
if($_GET["register"]=="Delete selected")
{
$result=DBselect("select itemid from items where hostid=".$_GET["hostid"]);
while($row=DBfetch($result))
{
// $$ is correct here
if(isset($_GET[$row["itemid"]]))
{
$result2=delete_item($row["itemid"]);
}
}
show_messages(TRUE, S_ITEMS_DELETED, S_CANNOT_DELETE_ITEMS);
}
if($_GET["register"]=="Activate selected")
{
$result=DBselect("select itemid from items where hostid=".$_GET["hostid"]);
while($row=DBfetch($result))
{
// $$ is correct here
if(isset($_GET[$row["itemid"]]))
{
$result2=activate_item($row["itemid"]);
}
}
show_messages(TRUE, S_ITEMS_ACTIVATED, S_CANNOT_ACTIVATE_ITEMS);
}
if($_GET["register"]=="Disable selected")
{
$result=DBselect("select itemid from items where hostid=".$_GET["hostid"]);
while($row=DBfetch($result))
{
// $$ is correct here
if(isset($_GET[$row["itemid"]]))
{
$result2=disable_item($row["itemid"]);
}
}
show_messages(TRUE, S_ITEMS_DISABLED, S_CANNOT_DISABLE_ITEMS);
}
}
?>
";
if(isset($_GET["groupid"])&&($_GET["groupid"]==0))
{
unset($_GET["groupid"]);
}
echo S_GROUP." ";
echo "";
echo " ".S_HOST." ";
echo "";
echo "";
// end of new code
show_table_header_end();
$lasthost="";
if(isset($_GET["hostid"])&&!isset($_GET["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,i.trends from hosts h,items i where h.hostid=i.hostid and h.hostid=".$_GET["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 "