forked from kkaiser1952/NCM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetGridCounts.php
67 lines (54 loc) · 1.46 KB
/
getGridCounts.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
<!doctype html>
<html lang="en">
<head>
<title>NCM Usage by Maidenhead Grid</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href='https://fonts.googleapis.com/css?family=Allerta' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="css/NetManager.css" />
<style>
html {
width: 35%;
}
</style>
</head>
<body>
<div><h2>The 100</h2>
<h3>100 top Grid Locations</h3>
</div>
<div id="100grids">
<table>
<thead id="thead" style="text-align: center;">
<tr>
<th>GRID</th>
<th>Log-ins</th>
</tr>
</thead>
<tbody id="netGrid">
<?php
ini_set('display_errors',1);
error_reporting (E_ALL ^ E_NOTICE);
require_once "dbConnectDtls.php";
$sql = "SELECT DISTINCT SUBSTRING(grid, 1, 6) AS grid,
COUNT( SUBSTRING(grid, 1, 6) ) as logins
FROM NetLog
WHERE grid <> ''
GROUP BY grid
ORDER BY `logins` DESC
LIMIT 0, 100";
$num_rows = 0; // Counter to color row backgrounds in loop below
foreach($db_found->query($sql) as $row) {
++$num_rows;
echo ("
<tr>
<td> $row[grid] </td>
<td> $row[logins] </td>
</tr>
");
}
?>
</tbody>
</table>
</div>
</body>
</html>