2008-09-03 Sancho Lerena <slerena@artica.es>
* reporting/fgraph.php: In grafico_eventos_grupo() array_multisort was not working as expected. Using a SORT sentence in SQL that provides the same functionality. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1080 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
f52b03b73a
commit
68b90636a4
|
@ -1,3 +1,9 @@
|
||||||
|
2008-09-03 Sancho Lerena <slerena@artica.es>
|
||||||
|
|
||||||
|
* reporting/fgraph.php: In grafico_eventos_grupo() array_multisort
|
||||||
|
was not working as expected. Using a SORT sentence in SQL that provides
|
||||||
|
the same functionality.
|
||||||
|
|
||||||
2008-09-03 Sancho Lerena <slerena@artica.es>
|
2008-09-03 Sancho Lerena <slerena@artica.es>
|
||||||
|
|
||||||
* reporting/fgraph.php: URL passed should don't get slashes or
|
* reporting/fgraph.php: URL passed should don't get slashes or
|
||||||
|
|
|
@ -1369,7 +1369,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "") {
|
||||||
//This will give the distinct id_agente, give the id_grupo that goes
|
//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
|
//with it and then the number of times it occured. GROUP BY statement
|
||||||
//is required if both DISTINCT() and COUNT() are in the statement
|
//is required if both DISTINCT() and COUNT() are in the statement
|
||||||
$sql = "SELECT DISTINCT(id_agente) AS id_agente, id_grupo, COUNT(id_agente) AS count FROM tevento WHERE 1=1 ".$url." GROUP BY id_agente";
|
$sql = "SELECT DISTINCT(id_agente) AS id_agente, id_grupo, COUNT(id_agente) AS count FROM tevento WHERE 1=1 ".$url." GROUP BY id_agente ORDER BY count DESC";
|
||||||
$result = get_db_all_rows_sql ($sql);
|
$result = get_db_all_rows_sql ($sql);
|
||||||
if ($result === false)
|
if ($result === false)
|
||||||
$result = array();
|
$result = array();
|
||||||
|
@ -1387,8 +1387,6 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
array_multisort ($legend, $data);
|
|
||||||
|
|
||||||
$max_items = 6; //Maximum items on the piegraph
|
$max_items = 6; //Maximum items on the piegraph
|
||||||
while (count($data) > $max_items) {
|
while (count($data) > $max_items) {
|
||||||
//Pops an element off the array until the array is small enough
|
//Pops an element off the array until the array is small enough
|
||||||
|
|
Loading…
Reference in New Issue