-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
67 lines (59 loc) · 1.54 KB
/
index.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>
<head>
<meta charset="utf-8">
<title>CCAMS Dashboard</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$.loadRanges = function() {
$.getJSON( "json?r=get-ranges", function( data ) {
$.each( data, function( range, val ) {
$("textarea#"+range).val(val);
});
});
};
$.loadResCodes = function() {
$.getJSON( "json?r=squawks", function( data ) {
$("textarea#reserved_codes").val(data);
});
};
$().ready( function() {
$( function() {
$.loadRanges();
});
// setInterval( function() {
// $.loadRanges();
// }, 5000);
$('#reload').click( function() {
$.loadRanges();
});
$( function() {
$.loadResCodes();
});
setInterval( function() {
$.loadResCodes();
}, 5000);
// $('#reload').click( function() {
// $.loadJSON();
// });
});
</script>
</head>
<body>
<table>
<tr>
<td>FIR code ranges</td>
<td>Airport code ranges</td>
<td>Currently reserved codes</td>
</tr>
<tr>
<td><textarea id="FIR" name="FIR" rows="40" cols="25" title="FIR codes" placeholder="NIL" disabled></textarea></td>
<td><textarea id="APT" name="APT" rows="40" cols="25" title="Airport codes" placeholder="NIL" disabled></textarea></td>
<td><textarea id="reserved_codes" name="codes" rows="40" cols="40" title="Currently reserved codes" placeholder="NIL" disabled></textarea></td>
</tr>
</table>
<button id="reload">Reload</button>
<br>
<p>Check out the usage <a href="statistics" target="_blank">statistics</a></p>
</body>
</html>