/
statistics.php
138 lines (92 loc) · 3.23 KB
/
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
<?php
/**
* Allomani Movies v2.0
*
* @package Allomani.Movies
* @version 2.0
* @copyright (c) 2006-2018 Allomani , All rights reserved.
* @author Ali Allomani <info@allomani.com>
* @link http://allomani.com
* @license GNU General Public License version 3.0 (GPLv3)
*
*/
require("global.php");
require(CWD . "/includes/framework_start.php");
//---------------------------------------------------------
$year = intval($year);
$month = intval($month);
$ph_skin = 1;
require(CWD . '/includes/functions_statics.php');
require CWD . "/chart.php";
//-------- browser and os statics ---------
if($settings['count_visitors_info']){
open_table("$phrases[operating_systems]");
get_statics_info("select * from info_os where count > 0 order by count DESC","name","count",2);
close_table();
open_table("$phrases[the_browsers]");
get_statics_info("select * from info_browser where count > 0 order by count DESC","name","count",2);
close_table();
$printed = 1 ;
}
//--------- hits statics ----------
if($settings['count_visitors_hits']){
$printed = 1 ;
if (!$year){$year = date("Y");}
$PG = new PowerGraphic;
$PG->type = 2;
$PG->skin = $ph_skin;
$PG->credits = 0;
$PG->axis_x = "Month";
$PG->axis_y = ' Hits';
open_table("$phrases[monthly_statics_for] $year ");
$ixx =0 ;
for ($i=1;$i <= 12;$i++){
$dot = $year;
if($i < 10){$x="0$i";}else{$x=$i;}
$sql = "select sum(hits) as sum from info_hits where date like '%-$x-$dot' order by date" ;
$data_stat=db_qr_fetch($sql);
$PG->x[$ixx] = date('M',mktime(0,0,0,$x));
$PG->y[$ixx] = intval($data_stat['sum']);
$ixx++;
}
print "<center><img src=\"chart.php?" . $PG->create_query_string() . "\" border=\"1\" alt=\"\" /></center>";
print "<br><center>[ $phrases[the_year] : ";
$yl = date('Y') - 3 ;
while($yl != date('Y')+1){
print "<a href='statistics.php?year=$yl'>$yl</a> ";
$yl++;
}
print "]";
close_table();
if (!$month){
$month = date("m")."-$year" ;
}else{
$month= "$month-$year";
}
open_table("$phrases[daily_statics_for] $month ");
$dot = $month;
get_statics_info("select * from info_hits where date like '%$dot' order by date","date","hits");
print "<br><center>
[ $phrases[the_month] :
<a href='statistics.php?year=$year&month=1'>1</a> -
<a href='statistics.php?year=$year&month=2'>2</a> -
<a href='statistics.php?year=$year&month=3'>3</a> -
<a href='statistics.php?year=$year&month=4'>4</a> -
<a href='statistics.php?year=$year&month=5'>5</a> -
<a href='statistics.php?year=$year&month=6'>6</a> -
<a href='statistics.php?year=$year&month=7'>7</a> -
<a href='statistics.php?year=$year&month=8'>8</a> -
<a href='statistics.php?year=$year&month=9'>9</a> -
<a href='statistics.php?year=$year&month=10'>10</a> -
<a href='statistics.php?year=$year&month=11'>11</a> -
<a href='statistics.php?year=$year&month=12'>12</a>
]";
close_table();
}
if(!$printed){
open_table();
print "<center>$phrases[no_results]</center>";
close_table();
}
//---------------------------------------------
require(CWD . "/includes/framework_end.php");