ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
statistics.tpl.php
Go to the documentation of this file.
1<?php
2$this->data['header'] = 'SimpleSAMLphp Statistics';
3
4$this->data['jquery'] = array('core' => true, 'ui' => true, 'css' => true);
5
6$this->data['head'] = '<link rel="stylesheet" type="text/css" href="' . SimpleSAML\Module::getModuleURL("statistics/style.css") . '" />' . "\n";
7$this->data['head'] .= '<script type="text/javascript" src="' . SimpleSAML\Module::getModuleURL("statistics/javascript.js") . '"></script>' . "\n";
8
9$this->includeAtTemplateBase('includes/header.php');
10
11echo '<h1>'. $this->data['available.rules'][$this->data['selected.rule']]['name'] . '</h1>';
12echo '<p>' . $this->data['available.rules'][$this->data['selected.rule']]['descr'] . '</p>';
13
14// Report settings
15echo '<table class="selecttime">';
16echo '<tr><td class="selecttime_icon"><img src="' . SimpleSAML\Utils\HTTP::getBaseUrl() . 'resources/icons/crystal_project/kchart.32x32.png" alt="Report settings" /></td>';
17
18// Select report
19echo '<td>';
20echo '<form action="#">';
21echo $this->data['post_rule'];
22echo '<select onchange="submit();" name="rule">';
23foreach ($this->data['available.rules'] as $key => $rule) {
24 if ($key === $this->data['selected.rule']) {
25 echo '<option selected="selected" value="' . $key . '">' . $rule['name'] . '</option>';
26 } else {
27 echo '<option value="' . $key . '">' . $rule['name'] . '</option>';
28 }
29}
30echo '</select></form>';
31echo '</td>';
32
33// Select delimiter
34echo '<td class="td_right">';
35echo '<form action="#">';
36echo $this->data['post_d'];
37echo '<select onchange="submit();" name="d">';
38foreach ($this->data['availdelimiters'] as $key => $delim) {
39 $delimName = $delim;
40 if (array_key_exists($delim, $this->data['delimiterPresentation'])) {
41 $delimName = $this->data['delimiterPresentation'][$delim];
42 }
43
44 if ($key == '_') {
45 echo '<option value="_">Total</option>';
46 } elseif (isset($_REQUEST['d']) && $delim == $_REQUEST['d']) {
47 echo '<option selected="selected" value="' . htmlspecialchars($delim) . '">' . htmlspecialchars($delimName) . '</option>';
48 } else {
49 echo '<option value="' . htmlspecialchars($delim) . '">' . htmlspecialchars($delimName) . '</option>';
50 }
51}
52echo '</select></form>';
53echo '</td></tr>';
54
55echo '</table>';
56
57// End report settings
58
59
60// Select time and date
61echo '<table class="selecttime">';
62echo '<tr><td class="selecttime_icon"><img src="' . SimpleSAML\Utils\HTTP::getBaseUrl() . 'resources/icons/crystal_project/date.32x32.png" alt="Select date and time" /></td>';
63
64if (isset($this->data['available.times.prev'])) {
65 echo '<td><a href="' . $this->data['get_times_prev'] . '">« Previous</a></td>';
66} else {
67 echo '<td class="selecttime_link_grey">« Previous</td>';
68}
69
70echo '<td class="td_right">';
71echo '<form action="#">';
72echo $this->data['post_res'];
73echo '<select onchange="submit();" name="res">';
74foreach ($this->data['available.timeres'] as $key => $timeresname) {
75 if ($key == $this->data['selected.timeres']) {
76 echo '<option selected="selected" value="' . $key . '">' . $timeresname . '</option>';
77 } else {
78 echo '<option value="' . $key . '">' . $timeresname . '</option>';
79 }
80}
81echo '</select></form>';
82echo '</td>';
83
84echo '<td class="td_left">';
85echo '<form action="#">';
86echo $this->data['post_time'];
87echo '<select onchange="submit();" name="time">';
88foreach ($this->data['available.times'] as $key => $timedescr) {
89 if ($key == $this->data['selected.time']) {
90 echo '<option selected="selected" value="' . $key . '">' . $timedescr . '</option>';
91 } else {
92 echo '<option value="' . $key . '">' . $timedescr . '</option>';
93 }
94}
95echo '</select></form>';
96echo '</td>';
97
98if (isset($this->data['available.times.next'])) {
99 echo '<td class="td_right td_next_right"><a href="' . $this->data['get_times_next'] . '">Next »</a></td>';
100} else {
101 echo '<td class="td_right selecttime_link_grey td_next_right">Next »</td>';
102}
103
104echo '</tr></table>';
105
106
107echo '<div id="tabdiv"><ul class="tabset_tabs">
108 <li><a href="#graph">Graph</a></li>
109 <li><a href="#table">Summary table</a></li>
110 <li><a href="#debug">Time serie</a></li>
111</ul>';
112echo '
113
114<div id="graph" class="tabset_content">';
115
116echo '<img src="' . htmlspecialchars($this->data['imgurl']) . '" alt="Graph" />';
117
118echo '<form action="#">';
119echo '<p class="p_right">Compare with total from this dataset ';
120echo $this->data['post_rule2'];
121echo '<select onchange="submit();" name="rule2">';
122echo ' <option value="_">None</option>';
123foreach ($this->data['available.rules'] as $key => $rule) {
124 if ($key === $this->data['selected.rule2']) {
125 echo '<option selected="selected" value="' . $key . '">' . $rule['name'] . '</option>';
126 } else {
127 echo '<option value="' . $key . '">' . $rule['name'] . '</option>';
128 }
129}
130echo '</select></p></form>';
131
132echo '</div>'; // end graph content.
133
134
138$classint = array('odd', 'even'); $i = 0;
139echo '<div id="table" class="tabset_content">';
140
141if (isset($this->data['pieimgurl'])) {
142 echo '<img src="' . $this->data['pieimgurl'] . '" alt="Pie chart" />';
143}
144echo '<table class="tableview"><tr><th class="value">Value</th><th class="category">Data range</th></tr>';
145
146foreach ($this->data['summaryDataset'] as $key => $value) {
147 $clint = $classint[$i++ % 2];
148
149 $keyName = $key;
150 if (array_key_exists($key, $this->data['delimiterPresentation'])) {
151 $keyName = $this->data['delimiterPresentation'][$key];
152 }
153
154 if ($key === '_') {
155 echo '<tr class="total ' . $clint . '"><td class="value">' . $value . '</td><td class="category">' . $keyName . '</td></tr>';
156 } else {
157 echo '<tr class="' . $clint . '"><td class="value">' . $value . '</td><td class="category">' . $keyName . '</td></tr>';
158 }
159}
160
161echo '</table></div>';
162// - - - - - - - End table view - - - - - - -
163
164echo '<div id="debug" >';
165echo '<table class="timeseries">';
166echo '<tr><th>Time</th><th>Total</th>';
167foreach ($this->data['topdelimiters'] as $key) {
168 $keyName = $key;
169 if (array_key_exists($key, $this->data['delimiterPresentation'])) {
170 $keyName = $this->data['delimiterPresentation'][$key];
171 }
172 echo'<th>' . $keyName . '</th>';
173}
174echo '</tr>';
175
176
177$i = 0;
178foreach ($this->data['debugdata'] as $slot => $dd) {
179 echo '<tr class="' . ((++$i % 2) == 0 ? 'odd' : 'even') . '">';
180 echo '<td>' . $dd[0] . '</td>';
181 echo '<td class="datacontent">' . $dd[1] . '</td>';
182
183 foreach ($this->data['topdelimiters'] as $key) {
184 echo '<td class="datacontent">' . (array_key_exists($key, $this->data['results'][$slot]) ?
185 $this->data['results'][$slot][$key] : '&nbsp;') . '</td>';
186 }
187 echo '</tr>';
188}
189echo '</table>';
190
191
192echo '</div>'; // End debug tab content
193echo '</div>'; // End tab div
194
195$this->includeAtTemplateBase('includes/footer.php');
An exception for terminatinating execution or to throw for unit testing.
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
Definition: Module.php:303
$key
Definition: croninfo.php:18
$rule
Definition: showstats.php:43
$classint
Handle table view - - - - - -.
$this data['header']