".__('delete_ok').""; else $result = "

".__('delete_no')."

"; $sql = "DELETE FROM tgraph WHERE id_graph = $id"; if ($res=mysql_query($sql)) $result = "

".__('delete_ok')."

"; else $result = "

".__('delete_no')."

"; echo $result; } else { audit_db ($config['id_user'],$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"]; $zoom = (int) get_parameter ('zoom', 0); if ($zoom > 0){ switch ($zoom){ case 1: $width = 500; $height = 210; break; case 2: $width = 650; $height = 310; break; case 3: $width = 770; $height = 400; break; } } $period = (int) get_parameter ('period'); if (! $period) $period = $row["period"]; else $period = 3600 * $period; $events = $row["events"]; $description = $row["description"]; $stacked = (int) get_parameter ('stacked', -1); if ($stacked == -1) $stacked = $row["stacked"]; $name = $row["name"]; if (($row["private"]==1) && ($row["id_user"] != $id_user)){ audit_db($config['id_user'],$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"]; $id_grupo = get_db_sql ("SELECT id_grupo FROM tagente, tagente_modulo WHERE tagente_modulo.id_agente_modulo = $id_agent_module AND tagente.id_agente = tagente_modulo.id_agente"); if (give_acl($config["id_user"], $id_grupo, "AR")==1){ if (!isset($modules)){ $modules = $id_agent_module; $weights = $weight; } else { $modules = $modules.",".$id_agent_module; $weights = $weights.",".$weight; } } } echo "

".__('reporting')." > "; echo __('combined_image')."

"; echo ""; echo "
"; echo ""; echo "
"; $period_label = human_time_description ($period); echo "
"; echo ""; echo "
"; echo "".__('period').""; echo ""; $periods = array (); $periods[1] = __('hour'); $periods[2] = '2 '.__('hours'); $periods[3] = '3 '.__('hours'); $periods[6] = '6 '.__('hours'); $periods[12] = '12 '.__('hours'); $periods[24] = __('last_day'); $periods[48] = __('two_days'); $periods[360] = __('last_week'); $periods[720] = __('last_month'); $periods[4320] = __('six_months'); print_select ($periods, 'period', intval ($period / 3600), '', '', 0); echo ""; $stackeds = array (); $stackeds[0] = __('Graph defined'); $stackeds[0] = __('Area'); $stackeds[1] = __('Stacked area'); $stackeds[2] = __('Line'); print_select ($stackeds, 'stacked', $stacked , '', '', -1, false, false); echo ""; $zooms = array(); $zooms[0] = __('Graph defined'); $zooms[1] = __('Zoom x1'); $zooms[2] = __('Zoom x2'); $zooms[3] = __('Zoom x3'); print_select ($zooms, 'zoom', $zoom , '', '', 0); echo ""; echo ""; echo "
"; echo "
"; } } echo "

" . __('reporting') . " > "; echo __('custom_graph_viewer') . "

"; $color=1; $sql="SELECT * FROM tgraph ORDER by name"; $res=mysql_query($sql); if (mysql_num_rows($res)) { echo ""; echo ""; if (give_acl ($config['id_user'], 0, "AW")) echo ""; 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 ""; echo ""; $id_graph = $row["id_graph"]; echo ""; } } } echo "
".__('graph_name')." ".__('description')." ".__('view')."".__('delete')."
".$row["name"]."".$row["description"].""; if (give_acl ($config['id_user'], 0, "AW")) { echo "'; echo "
"; } else { echo "
".__('no_reporting_def')."
"; } ?>