-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfleet_location.php
93 lines (80 loc) · 3.94 KB
/
fleet_location.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
<?php
/*
Copyright 2014-2024 Eric Vyncke
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
ob_start("ob_gzhandler");
require_once "dbi.php" ;
if ($userId <= 0 && (!isset($_REQUEST['auth'])))
die("Vous devez être connecté pour visualiser les vols de la journée.") ;
if (isset($_REQUEST['auth']))
if ($_REQUEST['auth'] != md5($_REQUEST['pilot'] . $_REQUEST['period'] . $shared_secret))
MustBeLoggedIn() ;
if ($userId != 62) journalise($userId, 'I', "Fleet location displayed") ;
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="log.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<link href="<?=$favicon?>" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<!-- Load the MAP BOX scripts & CSS -->
<script src='https://api.mapbox.com/mapbox-gl-js/v0.42.0/mapbox-gl.js'></script>
<link href='https://api.mapbox.com/mapbox-gl-js/v0.42.0/mapbox-gl.css' rel='stylesheet' />
<title>Dernières positions de notre flotte</title>
<script type="text/javascript">
var
// preset Javascript constant fill with the right data from db.php PHP variables
userFullName = '<?=$userFullName?>',
userName = '<?=$userName?>',
userId = <?=$userId?>,
userIsPilot = <?=($userIsPilot)? 'true' : 'false'?>,
userIsAdmin = <?=($userIsAdmin)? 'true' : 'false'?>,
userIsInstructor = <?=($userIsInstructor)? 'true' : 'false'?>,
userIsMechanic = <?=($userIsMechanic)? 'true' : 'false'?>;
</script>
<script type="text/javascript" src="fleet_map.js"></script>
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['setUserId', '<?=$userName?>']);
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
_paq.push(["setDomains", ["*.spa-aviation.be","*.ebsp.be","*.m.ebsp.be","*.m.spa-aviation.be","*.resa.spa-aviation.be"]]);
_paq.push(['enableHeartBeatTimer']);
_paq.push(['setCustomVariable', 1, "userID", <?=$userId?>, "visit"]);
_paq.push(["setCookieDomain", "*.spa-aviation.be"]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//analytics.vyncke.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '5']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
</head>
<body onload="initFleet(<?=$apt_longitude?>, <?=$apt_latitude?>, '<?=$mapbox_token?>', 'get_tracks.php?latest=y');">
<center><h2>Dernières positions de notre flotte</h2></center>
<div id='map' style='width: 100%; height: 90%;'></div>
<div id='flightInfo' style='display: none; position: absolute; margin: 0px auto; padding: 10px; text-align: left; color: black; background: white; opacity: 0.7;'></div>
<?php
$version_php = date ("Y-m-d H:i:s.", filemtime('fleet_map.php')) ;
$version_js = date ("Y-m-d H:i:s.", filemtime('fleet_map.js')) ;
$version_ajax = date ("Y-m-d H:i:s.", filemtime('get_tracks.php')) ;
?>
<hr>
<div class="copyright">Réalisation: Eric Vyncke, mars 2021, pour RAPCS, Royal Aéro Para Club de Spa, ASBL<br/>
Données via Flight Aware (avec maximum une heure de délai) et via quelques récepteurs ADS-B / MLAT (avec maximum 1 minute de délai).</br>
Versions: PHP=<?=$version_php?>, JS=<?=$version_js?>, AJAX=<?=$version_ajax?></div>
</body>
</html>