include "include/config.inc.php";
$page["title"] = "Configuration of graph";
$page["file"] = "graph.php";
show_header($page["title"],0,0);
?>
show_table_header("CONFIGURATION OF GRAPH");
echo "
";
?>
if(isset($HTTP_GET_VARS["register"]))
{
if($HTTP_GET_VARS["register"]=="add")
{
$result=add_item_to_graph($HTTP_GET_VARS["graphid"],$HTTP_GET_VARS["itemid"],$HTTP_GET_VARS["color"]);
show_messages($result,"Item added","Cannot add item");
}
if($HTTP_GET_VARS["register"]=="delete")
{
$result=delete_graphs_item($HTTP_GET_VARS["gitemid"]);
show_messages($result,"Item deleted","Cannot delete item");
unset($gitemid);
}
}
?>
$result=DBselect("select name from graphs where graphid=".$HTTP_GET_VARS["graphid"]);
$row=DBfetch($result);
show_table_header($row["name"]);
echo "
";
echo "";
echo "";
echo " ";
echo " | ";
echo "
";
echo "
";
show_table_header("DISPLAYED PARAMETERS");
echo "";
echo "| Host | ";
echo "Parameter | ";
echo "Color | ";
echo "Actions | ";
echo "";
$sql="select i.itemid,h.host,i.description,gi.gitemid,gi.color from hosts h,graphs_items gi,items i where i.itemid=gi.itemid and gi.graphid=".$HTTP_GET_VARS["graphid"]." and h.hostid=i.hostid";
$result=DBselect($sql);
$col=0;
while($row=DBfetch($result))
{
if($col++%2==0) { echo ""; }
else { echo "
"; }
echo "| ".$row["host"]." | ";
echo "".$row["description"]." | ";
echo "".$row["color"]." | ";
echo "Delete | ";
echo "
";
}
echo "
";
?>
echo "
";
echo "";
show_table2_header_begin();
echo "New item for graph";
show_table2_v_delimiter();
echo "