forked from KeyAuth/KeyAuth-Source-Code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstats.php
34 lines (23 loc) · 788 Bytes
/
stats.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
<?php
include 'includes/connection.php';
$result = mysqli_query($link, "select count(1) FROM `accounts`");
$row = mysqli_fetch_array($result);
$accs = number_format($row[0]);
$result = mysqli_query($link, "select count(1) FROM `apps`");
$row = mysqli_fetch_array($result);
$apps = number_format($row[0]);
$result = mysqli_query($link, "select count(1) FROM `keys`");
$row = mysqli_fetch_array($result);
$keys = number_format($row[0]);
$result = mysqli_query($link, "select count(1) FROM `sessions` WHERE `validated` = 1");
$row = mysqli_fetch_array($result);
$activeUsers = number_format($row[0]);
mysqli_close($link);
// output JSON
die(json_encode(array(
"accounts" => $accs,
"applications" => $apps,
"licenses" => $keys,
"activeUsers" => $activeUsers
)));
?>