-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetsystem.php
More file actions
110 lines (91 loc) · 2.75 KB
/
getsystem.php
File metadata and controls
110 lines (91 loc) · 2.75 KB
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
<?php
require_once "path.php";
require_once $path_settings."db.php";
if($_GET['visits']){
$q = "SELECT * FROM `visits` ORDER BY `id` DESC LIMIT 25;";
$result = $mysql->query($q);
//var_dump($result);
$json = array();
$row = $result->fetch_assoc();
while($row){
array_push($json,$row);
$row = $result->fetch_assoc();
}
echo json_encode($json);
}
if($_GET['uniqueip']){
$q = "SELECT * FROM `uniqueip`;";
$result = $mysql->query($q);
//var_dump($result);
$json = array();
$row = $result->fetch_assoc();
while($row){
array_push($json,$row);
$row = $result->fetch_assoc();
}
echo json_encode($json);
}
if($_GET['defferreload']){
$q = "SELECT * FROM `defferreload`;";
$result = $mysql->query($q);
//var_dump($result);
$json = array();
$row = $result->fetch_assoc();
while($row){
array_push($json,$row);
$row = $result->fetch_assoc();
}
echo json_encode($json);
}
if($_GET['status']){
$q = "SELECT * FROM `status`;";
$json = array();
$result = $mysql->query($q);
$row = $result->fetch_assoc();
array_push($json,$row);
echo json_encode($json);
}
if($_GET['visits_d']){
$q = "SELECT COUNT(`ip`) AS `cnt` ,`ip`,`rip` FROM `visits` WHERE `datetime`>SUBDATE(NOW(),INTERVAL 1 DAY) GROUP by `ip`,`rip`";
$json = array();
$result = $mysql->query($q);
$row = $result->fetch_assoc();
while($row){
array_push($json,$row);
$row = $result->fetch_assoc();
}
echo json_encode($json);
}
if($_GET['visits_w']){
$q = "SELECT COUNT(`ip`) AS `cnt` ,`ip`,`rip` FROM `visits` WHERE `datetime`>SUBDATE(NOW(),INTERVAL 7 DAY) GROUP by `ip`,`rip`";
$json = array();
$result = $mysql->query($q);
$row = $result->fetch_assoc();
while($row){
array_push($json,$row);
$row = $result->fetch_assoc();
}
echo json_encode($json);
}
if($_GET['visits_m']){
$q = "SELECT COUNT(`ip`) AS `cnt` ,`ip`,`rip` FROM `visits` WHERE `datetime`>SUBDATE(NOW(),INTERVAL 1 MONTH) GROUP by `ip`,`rip`";
$json = array();
$result = $mysql->query($q);
$row = $result->fetch_assoc();
while($row){
array_push($json,$row);
$row = $result->fetch_assoc();
}
echo json_encode($json);
}
if($_GET['visits_y']){
$q = "SELECT COUNT(`ip`) AS `cnt` ,`ip`,`rip` FROM `visits` WHERE `datetime`>SUBDATE(NOW(),INTERVAL 12 MONTH) GROUP by `ip`,`rip`";
$json = array();
$result = $mysql->query($q);
$row = $result->fetch_assoc();
while($row){
array_push($json,$row);
$row = $result->fetch_assoc();
}
echo json_encode($json);
}