-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathfreq.php
149 lines (140 loc) · 6.47 KB
/
freq.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!doctype html>
<?php
require_once("php_includes/base.inc.php");
if(!hasPerm("officer") || empty($luser['id'])) {
redirect("/index.php");
die();
}
$info = getInfo("freqs");
$info = json_decode($info['data'], true);
$tinfo = getInfo("threat");
$tinfo = json_decode($tinfo['data'], true);
$lf = getInfo("lastfreq");
$lf = json_decode($lf['data'], true);
$lf[$luser['id']] = time();
$now = time();
foreach($lf as $k => $v)
if($now - $v > HOUR*4) unset($lf[$k]);
setInfo("lastfreq", json_encode($lf));
$info[$info['active']] = "<span style=\"color: red; font-weight: bold;\">".$info[$info['active']]." - ACTIVE</span>";
$sert = hasPerm("sert");
$cmd = hasPerm("pdcmd");
$cminfo = getInfo("cminfo");
$cminfo = json_decode($cminfo['data'], true);
/*
$ip = $_SERVER["REMOTE_ADDR"];
$file = fopen("log.txt","a");
fwrite($file, "Name: ".$luser['uname']."\nIP: ".$ip."\nDate: ".date("D dS M, Y h:i a")."\n\n");
fclose($file);
*/
?>
<html lang="en-US">
<head>
<!-- Meta -->
<meta charset="UTF-8">
<title><?php echo $cminfo['pda']; ?> - Frequencies</title>
<meta name="description" content="<?php echo $cminfo['pdn']; ?> - Frequencies">
<meta name="author" content="Cole, Scott Harm (Retired)">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Favicons -->
<link rel="shortcut icon" href="img/favicons/favicon.png">
<link rel="apple-touch-icon" href="img/favicons/icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="img/favicons/72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="img/favicons/114x114.png">
<!-- CSS -->
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Raleway:300|Muli:300" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/idangerous.swiper.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/ticker.css">
</head>
<body>
<div id="overlay"></div>
<div id="top">
<a href="#" id="sidebar-button"></a>
<header id="logo">
<img src="img/logo.png" alt="Logo">
</header>
</div>
<div id="main-wrapper">
<?php require_once("boloTicker.php"); ?>
<div id="content">
<div class="container-fluid">
<div id="heading" class="row">
<div class="col-12">
<header>
<h1>Frequencies</h1>
</header>
</div>
</div>
<div class="row">
<div class="col-12">
<article class="inner">
<div class="row">
<div class="col-12">
<h4>Threat Level:
<?php
$t = intval($tinfo['level']);
$col = "#00aa00";
switch($t) {
case 1:
$col = "<span style=\"color: #00aa00; font-weight: bold\">GREEN</span>";
break;
case 2:
$col = "<span style=\"color: #ffc200; font-weight: bold\">AMBER</span>";
break;
case 3:
$col = "<span style=\"color: red; font-weight: bold\">RED</span>";
break;
case 4:
$col = "<span style=\"color: black; font-weight: bold\" id=\"mlaw\">MARTIAL LAW</span><script type=\"text/javascript\">var m = document.getElementById('mlaw'); setInterval('if(m.style.opacity == 0.0) m.style.opacity = 1.0; else m.style.opacity = 0.0;', 250);</script>";
break;
default:
$col = "<span style=\"color: white; font-weight: bold\">UNKNOWN</span>";
}
echo $col;
?>
</h4>
<h4 style="-webkit-touch-callout: none; -webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;">PD Frequency 1: <?php echo $info['tac1']; ?></h4>
<h4 style="-webkit-touch-callout: none; -webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;">PD Frequency 2: <?php echo $info['tac2']; ?></h4>
<h4 style="-webkit-touch-callout: none; -webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;">DOC Frequency: <?php echo $info['doc1']; ?></h4>
<?php if(hasPerm("dtu")) { ?>
<h4 style="-webkit-touch-callout: none; -webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;">DTU Frequency: <?php echo $info['dtu']; }?></h4>
<h4 style="-webkit-touch-callout: none; -webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;">Emergency Backup Frequency: <?php echo $info['emg']; ?></h4>
<br/>
<h4 style="-webkit-touch-callout: none; -webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;">PD-EMS Joint Frequency: <?php echo $info['ems']; ?></h4>
<h4 style="-webkit-touch-callout: none; -webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;">Ch-3: <?php echo $info['ch3']; ?></h4>
<span><b>Last Accesses:</b><br/><?php
arsort($lf, SORT_NUMERIC);
foreach($lf as $k => $v) {
if(empty($k)) continue;
$u = getUser($k, U_ID);
echo $u['display'].' ( '.round(($now-$v)/60).' minutes ago )<br/>';
}
?></span>
</div>
</div>
</article>
</div>
</div>
</div>
</div>
<?php require_once("sidebar.php"); ?>
<footer>
<p class="copyright">© Copyright 2017 <a href="http://coltonbrister.com" target="_blank">Colton Brister</a></p>
</footer>
</div>
</div>
<!-- JavaScripts -->
<script type='text/javascript' src='js/jquery.min.js'></script>
<script type='text/javascript' src='js/bootstrap.min.js'></script>
<script type='text/javascript' src='js/swiper/idangerous.swiper.min.js'></script>
<script type='text/javascript' src='js/masonry/masonry.pkgd.min.js'></script>
<script type='text/javascript' src='js/isotope/jquery.isotope.min.js'></script>
<script type='text/javascript' src='js/custom.js'></script>
<script type="text/javascript" src="js/ticker.js"></script>
</body>
</html>