-
Notifications
You must be signed in to change notification settings - Fork 1
/
statistic.php
43 lines (35 loc) · 1.04 KB
/
statistic.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/*
* Created on 10.11.2017
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
function statistic() {
if(isset($_GET['type'])) {
$type = $_GET['type'];
include "statistic/".$type.".php";
$type();
}
}
function getStatisticMenue() {
$dir = 'statistic';
$files = scandir($dir);
?>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-bar-chart"></i> Statistic <span class="caret"></span></a>
<ul class="dropdown-menu">
<?php
foreach ($files as $file) {
if (preg_match ( '/.php$/', $file )) {
$fileWithoutSuffix = str_replace( ".php", "", $file);
$fileDisp = str_replace( "_", " ", $fileWithoutSuffix);
echo "<li><a href=\"index.php?func=statistic&type=$fileWithoutSuffix\">$fileDisp</a></li>";
}
}
?>
</ul>
</li>
<?php
}
?>