Skip to content
Snippets Groups Projects
Commit 1cd73cf4 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Dataset aggregation for the table view in the statistics module

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1008 44740490-163a-0410-bde0-09ae8108e29a
parent 5f84c516
No related branches found
No related tags found
No related merge requests found
...@@ -106,6 +106,27 @@ $max = sspmod_statistics_Graph_GoogleCharts::roof($maxvalue); ...@@ -106,6 +106,27 @@ $max = sspmod_statistics_Graph_GoogleCharts::roof($maxvalue);
/**
* Aggregate summary table from dataset. To be used in the table view.
*/
$summaryDataset = array();
foreach($results AS $slot => $res) {
foreach ($res AS $key => $value) {
if (array_key_exists($key, $summaryDataset)) {
$summaryDataset[$key] += $value;
} else {
$summaryDataset[$key] = $value;
}
}
}
#echo '<pre>'; print_r($summaryDataset); exit;
/* /*
* Walk through dataset to get percent values from max into dataset[]. * Walk through dataset to get percent values from max into dataset[].
*/ */
...@@ -143,6 +164,7 @@ $t->data['available.times'] = $available_times; ...@@ -143,6 +164,7 @@ $t->data['available.times'] = $available_times;
$t->data['selected.rule']= $rule; $t->data['selected.rule']= $rule;
$t->data['selected.time'] = $fileslot; $t->data['selected.time'] = $fileslot;
$t->data['debugdata'] = $debugdata; $t->data['debugdata'] = $debugdata;
$t->data['summaryDataset'] = $summaryDataset;
$t->data['availdelimiters'] = array_keys($availdelimiters); $t->data['availdelimiters'] = array_keys($availdelimiters);
$t->show(); $t->show();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment