From bd9fabbdacb4c3d3a3a91a2c1e87660cb42483ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no> Date: Sat, 15 Nov 2008 12:41:42 +0000 Subject: [PATCH] Sort table view with largest values first. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1010 44740490-163a-0410-bde0-09ae8108e29a --- modules/statistics/www/showstats.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/statistics/www/showstats.php b/modules/statistics/www/showstats.php index 04381128e..af907cac3 100644 --- a/modules/statistics/www/showstats.php +++ b/modules/statistics/www/showstats.php @@ -112,7 +112,6 @@ $max = sspmod_statistics_Graph_GoogleCharts::roof($maxvalue); */ $summaryDataset = array(); foreach($results AS $slot => $res) { - foreach ($res AS $key => $value) { if (array_key_exists($key, $summaryDataset)) { $summaryDataset[$key] += $value; @@ -120,10 +119,9 @@ foreach($results AS $slot => $res) { $summaryDataset[$key] = $value; } } - } - - +asort($summaryDataset); +$summaryDataset = array_reverse($summaryDataset, TRUE); #echo '<pre>'; print_r($summaryDataset); exit; -- GitLab