forked from poppyred/1.6.x
/
admin.dashboard.smtpgraphs.php
executable file
·105 lines (82 loc) · 3.28 KB
/
admin.dashboard.smtpgraphs.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
<?php
if(isset($_GET["verbose"])){$GLOBALS["VERBOSE"]=true;$GLOBALS["DEBUG_MEM"]=true;ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string',null);ini_set('error_append_string',null);}
$GLOBALS["BASEDIR"]="/usr/share/artica-postfix/ressources/interface-cache";
include_once(dirname(__FILE__).'/ressources/class.html.pages.inc');
include_once(dirname(__FILE__).'/ressources/class.cyrus.inc');
include_once(dirname(__FILE__).'/ressources/class.main_cf.inc');
include_once(dirname(__FILE__).'/ressources/charts.php');
include_once(dirname(__FILE__).'/ressources/class.system.network.inc');
include_once(dirname(__FILE__).'/ressources/class.os.system.inc');
include_once(dirname(__FILE__).'/ressources/class.templates.inc');
include_once(dirname(__FILE__).'/ressources/class.os.system.tools.inc');
if(isset($_GET["graph2"])){graph2();exit;}
if(isset($_GET["graph3"])){graph3();exit;}
graph1();
function graph1(){
$page=CurrentPageName();
$MAIN=unserialize(@file_get_contents("{$GLOBALS["BASEDIR"]}/SMTP_DASHBOARD_GRAPHS"));
if(count($MAIN)<2){
header("content-type: application/x-javascript");
die();
}
$tpl=new templates();
$title="{received}";
$timetext="{hours}";
$highcharts=new highcharts();
$highcharts->container="graph1-dashboard";
$highcharts->xAxis=$MAIN["RECEIVED"]["X"];
$highcharts->Title=$title;
$highcharts->TitleFontSize="22px";
$highcharts->AxisFontsize="12px";
$highcharts->yAxisTtitle="{messages}";
$highcharts->xAxis_labels=false;
$highcharts->LegendPrefix=$tpl->javascript_parse_text('{date}: ');
$highcharts->LegendSuffix="Mails";
$highcharts->xAxisTtitle=$timetext;
$highcharts->datas=array("{size}"=>$MAIN["RECEIVED"]["Y"]);
echo $highcharts->BuildChart();
echo "\nLoadjs('$page?graph2=yes');\n";
}
function graph2(){
$page=CurrentPageName();
$MAIN=unserialize(@file_get_contents("{$GLOBALS["BASEDIR"]}/SMTP_DASHBOARD_GRAPHS"));
$tpl=new templates();
$tpl=new templates();
$title="{delivered}";
$timetext="{hours}";
$highcharts=new highcharts();
$highcharts->container="graph2-dashboard";
$highcharts->xAxis=$MAIN["DELIVERED"]["X"];
$highcharts->Title=$title;
$highcharts->TitleFontSize="22px";
$highcharts->AxisFontsize="12px";
$highcharts->yAxisTtitle="{messages}";
$highcharts->xAxis_labels=false;
$highcharts->LegendPrefix=$tpl->javascript_parse_text('{date}: ');
$highcharts->LegendSuffix="Mails";
$highcharts->xAxisTtitle=$timetext;
$highcharts->datas=array("{size}"=>$MAIN["DELIVERED"]["Y"]);
echo $highcharts->BuildChart();
echo "\nLoadjs('$page?graph3=yes');\n";
}
function graph3(){
$page=CurrentPageName();
$MAIN=unserialize(@file_get_contents("{$GLOBALS["BASEDIR"]}/SMTP_DASHBOARD_GRAPHS"));
$tpl=new templates();
$tpl=new templates();
$title="{rejected}";
$timetext="{hours}";
$highcharts=new highcharts();
$highcharts->container="graph3-dashboard";
$highcharts->xAxis=$MAIN["REJECTED"]["X"];
$highcharts->Title=$title;
$highcharts->TitleFontSize="22px";
$highcharts->AxisFontsize="12px";
$highcharts->yAxisTtitle="{messages}";
$highcharts->xAxis_labels=false;
$highcharts->LegendPrefix=$tpl->javascript_parse_text('{date}: ');
$highcharts->LegendSuffix="Mails";
$highcharts->xAxisTtitle=$timetext;
$highcharts->datas=array("{size}"=>$MAIN["REJECTED"]["Y"]);
echo $highcharts->BuildChart();
}