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 
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>';
13 
14 // Report settings
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>';
17 
18 // Select report
19 echo '<td>';
20 echo '<form action="#">';
21 echo $this->data['post_rule'];
22 echo '<select onchange="submit();" name="rule">';
23 foreach ($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 }
30 echo '</select></form>';
31 echo '</td>';
32 
33 // Select delimiter
34 echo '<td class="td_right">';
35 echo '<form action="#">';
36 echo $this->data['post_d'];
37 echo '<select onchange="submit();" name="d">';
38 foreach ($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 }
52 echo '</select></form>';
53 echo '</td></tr>';
54 
55 echo '</table>';
56 
57 // End report settings
58 
59 
60 // Select time and date
61 echo '<table class="selecttime">';
62 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>';
63 
64 if (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 
70 echo '<td class="td_right">';
71 echo '<form action="#">';
72 echo $this->data['post_res'];
73 echo '<select onchange="submit();" name="res">';
74 foreach ($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 }
81 echo '</select></form>';
82 echo '</td>';
83 
84 echo '<td class="td_left">';
85 echo '<form action="#">';
86 echo $this->data['post_time'];
87 echo '<select onchange="submit();" name="time">';
88 foreach ($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 }
95 echo '</select></form>';
96 echo '</td>';
97 
98 if (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 
104 echo '</tr></table>';
105 
106 
107 echo '<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>';
112 echo '
113 
114 <div id="graph" class="tabset_content">';
115 
116 echo '<img src="' . htmlspecialchars($this->data['imgurl']) . '" alt="Graph" />';
117 
118 echo '<form action="#">';
119 echo '<p class="p_right">Compare with total from this dataset ';
120 echo $this->data['post_rule2'];
121 echo '<select onchange="submit();" name="rule2">';
122 echo ' <option value="_">None</option>';
123 foreach ($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 }
130 echo '</select></p></form>';
131 
132 echo '</div>'; // end graph content.
133 
134 
138 $classint = array('odd', 'even'); $i = 0;
139 echo '<div id="table" class="tabset_content">';
140 
141 if (isset($this->data['pieimgurl'])) {
142  echo '<img src="' . $this->data['pieimgurl'] . '" alt="Pie chart" />';
143 }
144 echo '<table class="tableview"><tr><th class="value">Value</th><th class="category">Data range</th></tr>';
145 
146 foreach ($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 
161 echo '</table></div>';
162 // - - - - - - - End table view - - - - - - -
163 
164 echo '<div id="debug" >';
165 echo '<table class="timeseries">';
166 echo '<tr><th>Time</th><th>Total</th>';
167 foreach ($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 }
174 echo '</tr>';
175 
176 
177 $i = 0;
178 foreach ($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 }
189 echo '</table>';
190 
191 
192 echo '</div>'; // End debug tab content
193 echo '</div>'; // End tab div
194 
195 $this->includeAtTemplateBase('includes/footer.php');
$this data['header']
$classint
Handle table view - - - - - -.
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
Definition: Module.php:303
$rule
Definition: showstats.php:43
Create styles array
The data for the language used.
$key
Definition: croninfo.php:18