-
Notifications
You must be signed in to change notification settings - Fork 1
/
chart_dashboard.php
40 lines (28 loc) · 1.14 KB
/
chart_dashboard.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
<?php
require "core.php";
$i = 1;
$array_count = array();
while ($i <= 12) {
// SQLi Count
$date = date('F Y', mktime(0, 0, 0, $i, 1));
$squery = $mysqli->query("SELECT type FROM `psec_logs` WHERE `date` LIKE '%$date' AND `type` = 'SQLi'");
$scount = mysqli_num_rows($squery);
$array_count['SQLi'][] = $scount;
// Bad Bots Count
$bquery = $mysqli->query("SELECT type FROM `psec_logs` WHERE `date` LIKE '%$date' AND
(`type` = 'Bad Bot' or `type` = 'Fake Bot' OR type = 'Missing User-Agent header'
OR type = 'Missing header Accept' OR type = 'Invalid IP Address header')");
$bcount = mysqli_num_rows($bquery);
$array_count['Bad Bot'][] = $bcount;
// Proxies Count
$pquery = $mysqli->query("SELECT type FROM `psec_logs` WHERE `date` LIKE '%$date' AND `type` = 'Proxy'");
$pcount = mysqli_num_rows($pquery);
$array_count['Proxies'][] = $pcount;
// Spammers Count
$spquery = $mysqli->query("SELECT type FROM `psec_logs` WHERE `date` LIKE '%$date' AND `type` = 'Spammer'");
$spcount = mysqli_num_rows($spquery);
$array_count['Spammers'][] = $spcount;
$i++;
}
echo json_encode($array_count);
?>