forked from kkaiser1952/NCM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetCallsHistoryByNetCall.php
97 lines (79 loc) · 2.61 KB
/
getCallsHistoryByNetCall.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
<!doctype html>
<?php
// getCallHistory.php
// This program produces a report of the callsign being called, it opens as a modal or windwo
ini_set('display_errors',1);
error_reporting (E_ALL ^ E_NOTICE);
require_once "dbConnectDtls.php";
$netcall = $_POST['netcall'];
$and1 = '';
$netcall = strtoupper($netcall);
$nomo = 12; // number of months
$state = '';
if ($state <> '') {
$and1 = "AND state = '$state'";
}
// Function to convert tod in seconds to days, hours, min, seconds
function secondsToDHMS($seconds) {
$s = (int)$seconds;
return sprintf('%d:%02d:%02d:%02d', $s/86400, $s/3600%24, $s/60%60, $s%60);
}
$sql = "
SELECT callsign, Fname, Lname, CONCAT(state,' ',county,' ',district) as place
FROM NetLog
WHERE netcall = '$netcall'
AND logdate > DATE_SUB(now(), INTERVAL $nomo MONTH)
$and1
GROUP BY callsign
ORDER BY `NetLog`.`district`, callsign ASC
";
//echo "$sql<br>";
$listing = '<tr>';
$rowno = 0;
foreach($db_found->query($sql) as $row) {
$rowno = $rowno + 1;
$netcallsign = $row[callsign];
$Fname = ucfirst(strtolower($row[Fname]));
$Lname = $row[Lname];
$listing .= "<td>$rowno</td> <td>$row[callsign]</td> <td>$row[Fname]</td> <td>$row[Lname]</td>. <td>$row[place]</td> </tr>";
}
?>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Stations Associated With This Net </title>
<meta name="author" content="Kaiser" />
<link rel="shortcut icon" type="image/x-icon" href="images/favicon-32x32.png" >
<link href='https://fonts.googleapis.com/css?family=Allerta' rel='stylesheet' type='text/css'>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script>
</script>
<style>
html {
width: 100%;
}
h2 {
column-span: all;
}
.prime {
/* column-width: 40px;
column-count: 2; */
columns: 20px 2;
column-gap: 10px;
/* column-rule-width: 3px;
column-rule-style: solid;
column-rule-color: green;
column-rule: 3px solid green; */
}
</style>
</head>
<body>
<h1>The Usual Suspects</h1>
<h2>This is a list of the stations that have checked into the <?php echo $netcall ?> net in the past <?php echo $nomo ?> months</h2>
<div class="prime">
<table>
<?php echo "$listing</table></div>"; ?>
</table>
</div>
</body>
</html>