2 $this->
data[
'header'] =
'SimpleSAMLphp Statistics';
4 $this->
data[
'jquery'] = array(
'core' =>
true,
'ui' =>
true,
'css' =>
true);
9 $this->includeAtTemplateBase(
'includes/header.php');
11 echo '<h1>'. $this->
data[
'available.rules'][$this->
data[
'selected.rule']][
'name'] .
'</h1>';
12 echo '<p>' . $this->
data[
'available.rules'][$this->
data[
'selected.rule']][
'descr'] .
'</p>';
15 echo '<table class="selecttime">';
16 echo '<tr><td class="selecttime_icon"><img src="' . SimpleSAML\Utils\HTTP::getBaseUrl() .
'resources/icons/crystal_project/kchart.32x32.png" alt="Report settings" /></td>';
20 echo '<form action="#">';
22 if (!empty($this->
data[
'available.rules'])) {
23 echo '<select onchange="submit();" name="rule">';
25 if (
$key === $this->
data[
'selected.rule']) {
26 echo '<option selected="selected" value="' .
$key .
'">' .
$rule[
'name'] .
'</option>';
28 echo '<option value="' .
$key .
'">' .
$rule[
'name'] .
'</option>';
36 echo '<td class="td_right">';
37 echo '<form action="#">';
39 if(!empty($this->data[
'availdelimiters'])) {
40 echo '<select onchange="submit();" name="d">';
41 foreach ($this->data[
'availdelimiters'] as
$key => $delim) {
43 if (array_key_exists($delim, $this->data[
'delimiterPresentation'])) {
44 $delimName = $this->data[
'delimiterPresentation'][$delim];
48 echo '<option value="_">Total</option>';
49 } elseif (isset($_REQUEST[
'd']) && $delim == $_REQUEST[
'd']) {
50 echo '<option selected="selected" value="' . htmlspecialchars($delim) .
'">' . htmlspecialchars($delimName) .
'</option>';
52 echo '<option value="' . htmlspecialchars($delim) .
'">' . htmlspecialchars($delimName) .
'</option>';
57 echo '</form></td></tr>';
65 echo '<table class="selecttime">';
66 echo '<tr><td class="selecttime_icon"><img src="' . SimpleSAML\Utils\HTTP::getBaseUrl() .
'resources/icons/crystal_project/date.32x32.png" alt="Select date and time" /></td>';
68 if (isset($this->data[
'available.times.prev'])) {
69 echo '<td><a href="' . $this->data[
'get_times_prev'] .
'">« Previous</a></td>';
71 echo '<td class="selecttime_link_grey">« Previous</td>';
74 echo '<td class="td_right">';
75 echo '<form action="#">';
76 echo $this->data[
'post_res'];
77 if (!empty($this->data[
'available.timeres'])) {
78 echo '<select onchange="submit();" name="res">';
79 foreach ($this->data[
'available.timeres'] as
$key => $timeresname) {
80 if (
$key == $this->data[
'selected.timeres']) {
81 echo '<option selected="selected" value="' .
$key .
'">' . $timeresname .
'</option>';
83 echo '<option value="' .
$key .
'">' . $timeresname .
'</option>';
90 echo '<td class="td_left">';
91 echo '<form action="#">';
92 echo $this->data[
'post_time'];
93 if (!empty($this->data[
'available.times'])) {
94 echo '<select onchange="submit();" name="time">';
95 foreach ($this->data[
'available.times'] as
$key => $timedescr) {
96 if (
$key == $this->data[
'selected.time']) {
97 echo '<option selected="selected" value="' .
$key .
'">' . $timedescr .
'</option>';
99 echo '<option value="' .
$key .
'">' . $timedescr .
'</option>';
106 if (isset($this->data[
'available.times.next'])) {
107 echo '<td class="td_right td_next_right"><a href="' . $this->data[
'get_times_next'] .
'">Next »</a></td>';
109 echo '<td class="td_right selecttime_link_grey td_next_right">Next »</td>';
112 echo '</tr></table>';
113 echo '<div id="tabdiv">';
114 if (!empty($this->data[
'results'])){
115 echo '<ul class="tabset_tabs"> 116 <li><a href="#graph">Graph</a></li> 117 <li><a href="#table">Summary table</a></li> 118 <li><a href="#debug">Time serie</a></li> 122 <div id="graph" class="tabset_content">';
124 echo '<img src="' . htmlspecialchars($this->data[
'imgurl']) .
'" alt="Graph" />';
126 echo '<form action="#">';
127 echo '<p class="p_right">Compare with total from this dataset ';
128 echo $this->data[
'post_rule2'];
129 echo '<select onchange="submit();" name="rule2">';
130 echo ' <option value="_">None</option>';
131 foreach ($this->data[
'available.rules'] as
$key =>
$rule) {
132 if (
$key === $this->data[
'selected.rule2']) {
133 echo '<option selected="selected" value="' .
$key .
'">' .
$rule[
'name'] .
'</option>';
135 echo '<option value="' .
$key .
'">' .
$rule[
'name'] .
'</option>';
138 echo '</select></p></form>';
145 $classint = array(
'odd',
'even');
$i = 0;
146 echo '<div id="table" class="tabset_content">';
148 if (isset($this->data[
'pieimgurl'])) {
149 echo '<img src="' . $this->data[
'pieimgurl'] .
'" alt="Pie chart" />';
151 echo '<table class="tableview"><tr><th class="value">Value</th><th class="category">Data range</th></tr>';
153 foreach ($this->data[
'summaryDataset'] as
$key => $value) {
154 $clint = $classint[
$i++ % 2];
157 if (array_key_exists(
$key, $this->data[
'delimiterPresentation'])) {
158 $keyName = $this->data[
'delimiterPresentation'][
$key];
162 echo '<tr class="total ' . $clint .
'"><td class="value">' . $value .
'</td><td class="category">' . $keyName .
'</td></tr>';
164 echo '<tr class="' . $clint .
'"><td class="value">' . $value .
'</td><td class="category">' . $keyName .
'</td></tr>';
168 echo '</table></div>';
171 echo '<div id="debug" >';
172 echo '<table class="timeseries">';
173 echo '<tr><th>Time</th><th>Total</th>';
174 foreach ($this->data[
'topdelimiters'] as
$key) {
176 if (array_key_exists($key, $this->data[
'delimiterPresentation'])) {
177 $keyName = $this->data[
'delimiterPresentation'][
$key];
179 echo'<th>' . $keyName .
'</th>';
184 foreach ($this->data[
'debugdata'] as $slot => $dd) {
185 echo '<tr class="' . ((++
$i % 2) == 0 ?
'odd' :
'even') .
'">';
186 echo '<td>' . $dd[0] .
'</td>';
187 echo '<td class="datacontent">' . $dd[1] .
'</td>';
189 foreach ($this->data[
'topdelimiters'] as $key) {
190 echo '<td class="datacontent">' . (array_key_exists($key, $this->data[
'results'][$slot]) ?
191 $this->data[
'results'][$slot][
$key] :
' ') .
'</td>';
200 echo '<h4 align="center">'.$this->data[
'error'].
'</h4>';
201 echo '<p align="center"><a href="showstats.php">Clear selection</a></p>';
205 $this->includeAtTemplateBase(
'includes/footer.php');
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.