From 3a27d72321ab48220991929605ba0a5f09e20c7e Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 13 Apr 2011 17:37:51 +0000 Subject: [PATCH] 2011-04-13 Miguel de Dios * include/functions_graph.php: deleted a repeat function. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4217 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 4 ++ pandora_console/include/functions_graph.php | 69 --------------------- 2 files changed, 4 insertions(+), 69 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 37949d8495..cb3df83031 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,7 @@ +2011-04-13 Miguel de Dios + + * include/functions_graph.php: deleted a repeat function. + 2011-04-13 Miguel de Dios * include/functions_graph.php, include/functions_reporting.php, diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index e92a880486..734d58cad1 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1223,73 +1223,4 @@ function grafico_eventos_usuario2 ($width, $height) { return pie3d_graph($config['flash_charts'], $data, $width, $height); } - -/** - * Print a pie graph with events data of group - * - * @param integer width pie graph width - * @param integer height pie graph height - * @param string url - */ -function grafico_eventos_grupo2 ($width = 300, $height = 200, $url = "") { - global $config; - global $graphic_type; - - $url = html_entity_decode (rawurldecode ($url), ENT_QUOTES); //It was urlencoded, so we urldecode it - $data = array (); - $loop = 0; - define ('NUM_PIECES_PIE', 6); - - $badstrings = array (";", "SELECT ", "DELETE ", "UPDATE ", "INSERT ", "EXEC"); - //remove bad strings from the query so queries like ; DELETE FROM don't pass - $url = str_ireplace ($badstrings, "", $url); - - //This will give the distinct id_agente, give the id_grupo that goes - //with it and then the number of times it occured. GROUP BY statement - //is required if both DISTINCT() and COUNT() are in the statement - switch ($config["dbtype"]) { - case "mysql": - case "postgresql": - $sql = sprintf ('SELECT DISTINCT(id_agente) AS id_agente, id_grupo, COUNT(id_agente) AS count - FROM tevento WHERE 1=1 %s - GROUP BY id_agente ORDER BY count DESC', $url); - break; - case "oracle": - $sql = sprintf ('SELECT DISTINCT(id_agente) AS id_agente, id_grupo, COUNT(id_agente) AS count - FROM tevento WHERE 1=1 %s - GROUP BY id_agente, id_grupo ORDER BY count DESC', $url); - break; - } - - $result = get_db_all_rows_sql ($sql); - if ($result === false) { - $result = array(); - } - - foreach ($result as $row) { - if (!check_acl ($config["id_user"], $row["id_grupo"], "AR") == 1) - continue; - - if ($loop >= NUM_PIECES_PIE) { - if (!isset ($data[__('Other')])) - $data[__('Other')] = 0; - $data[__('Other')] += $row["count"]; - } else { - if ($row["id_agente"] == 0) { - $name = __('SYSTEM')." (".$row["count"].")"; - } else { - $name = mb_substr (get_agent_name ($row["id_agente"], "lower"), 0, 14)." (".$row["count"].")"; - } - $data[$name] = $row["count"]; - } - $loop++; - } - - if (! $graphic_type) { - return fs_3d_pie_chart ($data, $width, $height); - } - - error_reporting (0); - generic_pie_graph ($width, $height, $data, array ('show_legend' => false)); -} ?> \ No newline at end of file