forked from poppyred/1.6.x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
system_statistics.php
executable file
·157 lines (117 loc) · 3.98 KB
/
system_statistics.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?php
session_start();
header("Pragma: no-cache");
header("Expires: 0");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
include_once('ressources/class.templates.inc');
include_once('ressources/class.users.menus.inc');
include_once('ressources/class.html.pages.inc');
include_once('ressources/charts.php');
$pages=new HtmlPages();
if ($pages->rrdtool_installed==false){header('location:users.index.php');exit;}
if(isset($_GET["SystemStatistics"])){echo SystemStatistics(1);exit;}
if(isset($_GET["MonthCourbeDay"])){MonthCourbeDay();exit();}
if(isset($_GET["BuildByHour"])){BuildByHour();exit;}
if(isset($_GET["report_minutes"])){report_minutes();exit;}
if(isset($_GET["LinesMessagesHour"])){report_hours();exit;}
SystemStatistics();
function SystemStatistics($nopage=0){
$users=new usersMenus();
$graph1=InsertChart('js/charts.swf',"js/charts_library","listener.graphs.php?MonthsBlocketType=yes",600,180,"",true,$users->ChartLicence);
$js="<script>
function wait(){
document.getElementById('blank').src='img/blank.gif';
setTimeout(\"Refreshit()\",10000)
}
function Refreshit(){
document.getElementById('blank').src='img/wait.gif';
setTimeout(\"Send()\",2000);
}
function Send(){
var XHR = new XHRConnection();
XHR.appendData('SystemStatistics','yes');
XHR.setRefreshArea('rrd');
XHR.sendAndLoad(CurrentPageName(), 'GET');
wait();
}
</script>";
$time=serialize(date('Y-m-d H:I:s'));
$html="
<div id='rrd'>
<center style='border:1px dotted #CCCCCC;margin:4px;padding:4px'>
<H3>{detected_this_month}</H3>
$graph1
</center>
<div id='graph2'></div>
<div id='graph3'></div>
</div>
";
// <script>wait()</script>
if($nopage==0){
$tpl=new template_users("{more_stats}",$js.$html);
echo $tpl->web_page;
}else{
$tpl=new Templates();
echo $tpl->_ENGINE_parse_body($html);
}
}
function MonthCourbeDay(){
$users=new usersMenus();
$datas=$_GET["datas"];
$graph1=InsertChart('js/charts.swf',"js/charts_library","listener.graphs.php?MonthCourbeDay=$datas",600,180,"",true,$users->ChartLicence);
$tpl=new templates();
$html="<center style='border:1px dotted #CCCCCC;margin:4px;padding:4px'>
<H3>{trend_month}: $datas</H3>
$graph1
</center>";
echo $tpl->_ENGINE_parse_body($html);
}
function BuildByHour(){
$filter=$_GET["BuildByHour"];
$day=$_GET["datas"];
$users=new usersMenus();
$datas=$_GET["datas"];
$graph1=InsertChart('js/charts.swf',"js/charts_library","listener.graphs.php?MonthCourbeHour=$filter&date=$day",600,180,"",true,$users->ChartLicence);
$tpl=new templates();
$html="<center style='border:1px dotted #CCCCCC;margin:4px;padding:4px'>
<H3>« $filter » {trend_day}: " . date('F') . " $datas</H3>
$graph1
</center>";
echo $tpl->_ENGINE_parse_body($html);
}
function report_hours(){
$users=new usersMenus();
$graph1=InsertChart('js/charts.swf',"js/charts_library","listener.graphs.php?DayLine=" .date('Y-m-d'),600,180,"",true,$users->ChartLicence);
$html="
<center style='border:1px dotted #CCCCCC;margin:4px;padding:4px'>
<H3>{messages_by_hour}</H3>
$graph1
</center>
<div id='graph2'></div>
<div id='graph3'></div>
</div>
<script>LoadAjax('graph2','system_statistics.php?report_minutes={$_GET["data"]}&day=". date('Y-m-d') . "')</script>
";
// <script>wait()</script>
$tpl=new template_users("{today} ".date('l d F'),$js.$html);
echo $tpl->web_page;
}
function report_minutes(){
$users=new usersMenus();
if(isset($_GET["datas"])){
$hour=$_GET["datas"];
$day=$_GET["report_minutes"];
}else{
$hour=$_GET["report_minutes"];
$day=date('Y-m-d');
}
$graph1=InsertChart('js/charts.swf',"js/charts_library","listener.graphs.php?HourLine=$day&hour=$hour",600,180,"",true,$users->ChartLicence);
$html=" <center style='border:1px dotted #CCCCCC;margin:4px;padding:4px'>
<H3>{messages_by_minutes} $hour ({hour})</H3>
$graph1
</center>";
$tpl=new templates();
echo $tpl->_ENGINE_parse_body($html);
}
?>