".$lang_label["delete_ok"]."";
else
$result = "
".$lang_label["delete_no"]."
";
$sql = "DELETE FROM tgraph WHERE id_graph = $id";
if ($res=mysql_query($sql))
$result = "".$lang_label["delete_ok"]."
";
else
$result = "".$lang_label["delete_no"]."
";
echo $result;
} else {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to delete a graph from access graph builder");
include ("general/noaccess.php");
exit;
}
}
if (isset($_GET["view_graph"])){
$id_graph = $_GET["view_graph"];
$sql="SELECT * FROM tgraph WHERE id_graph = $id_graph";
$res=mysql_query($sql);
if ($row = mysql_fetch_array($res)){
$id_user = $row["id_user"];
$private = $row["private"];
$width = $row["width"];
$height = $row["height"];
$period = $row["period"];
if (isset($_POST["period"]))
$period = $_POST["period"];
$events = $row["events"];
$description = $row["description"];
$stacked = $row["stacked"];
$name = $row["name"];
if (($row["private"]==1) && ($row["id_user"] != $id_user)){
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access to a custom graph not allowed");
include ("general/noaccess.php");
exit;
}
$sql2="SELECT * FROM tgraph_source WHERE id_graph = $id_graph";
$res2=mysql_query($sql2);
while ( $row2 = mysql_fetch_array($res2)){
$weight = $row2["weight"];
$id_agent_module = $row2["id_agent_module"];
if (!isset($modules)){
$modules = $id_agent_module;
$weights = $weight;
} else {
$modules = $modules.",".$id_agent_module;
$weights = $weights.",".$weight;
}
}
echo "".$lang_label["reporting"]." > ";
echo $lang_label["combined_image"]."
";
echo "";
echo "";
echo "";
echo " |
";
switch ($period) {
case 3600: $period_label = $lang_label["hour"];
break;
case 7200: $period_label = $lang_label["2_hours"];
break;
case 21600: $period_label = $lang_label["6_hours"];
break;
case 43200: $period_label = $lang_label["12_Hours"];
break;
case 86400: $period_label = $lang_label["last_day"];
break;
case 172800: $period_label = $lang_label["two_days"];
break;
case 432000: $period_label = $lang_label["five_days"];
break;
case 604800: $period_label = $lang_label["last_week"];
break;
case 1296000: $period_label = $lang_label["15_days"];
break;
case 2592000: $period_label = $lang_label["last_month"];
break;
case 5184000: $period_label = $lang_label["two_month"];
break;
case 15552000: $period_label = $lang_label["six_months"];
break;
default: $period_label = "--";
}
echo "";
}
}
echo "".$lang_label["reporting"]." > ";
echo $lang_label["custom_graph_viewer"]."
";
$color=1;
$sql="SELECT * FROM tgraph";
$res=mysql_query($sql);
if (mysql_num_rows($res)) {
echo "";
echo "
".$lang_label["graph_name"]." |
".$lang_label["description"]." |
".$lang_label["view"]." | ";
if ((give_acl($id_usuario,0,"AW") == 1 ) OR (dame_admin($id_usuario)==1))
echo "".$lang_label["delete"]." | ";
echo "
";
while ($row = mysql_fetch_array($res)){
if (($row["private"]==0) || ($row["id_user"] == $id_user)){
// Calculate table line color
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo "";
echo "".$row["name"]." | ";
echo "".$row["description"]." | ";
$id_graph = $row["id_graph"];
echo "";
if ((give_acl($id_usuario,0,"AW") == 1 ) OR (dame_admin($id_usuario)==1)) {
echo " | ';
echo " | ";
}
}
}
echo "
";
} else {
echo "".$lang_label["no_reporting_def"]."
";
}
?>