@@ -5,8 +5,11 @@ discard block |
||
5 | 5 | setcookie("MapFormat",'2d'); |
6 | 6 | |
7 | 7 | // Compressed GeoJson is used if true |
8 | -if (!isset($globalJsonCompress)) $compress = true; |
|
9 | -else $compress = $globalJsonCompress; |
|
8 | +if (!isset($globalJsonCompress)) { |
|
9 | + $compress = true; |
|
10 | +} else { |
|
11 | + $compress = $globalJsonCompress; |
|
12 | +} |
|
10 | 13 | if (isset($_GET['archive'])) { |
11 | 14 | //$archiveupdatetime = 50; |
12 | 15 | $archiveupdatetime = $globalMapRefresh; |
@@ -16,8 +19,11 @@ discard block |
||
16 | 19 | //$lastupd = round(($_GET['enddate']-$_GET['begindate'])/(($_GET['during']*60)/10)); |
17 | 20 | //$lastupd = 20; |
18 | 21 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
19 | - if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
|
20 | - else $enddate = time(); |
|
22 | + if (isset($_GET['enddate']) && $_GET['enddate'] != '') { |
|
23 | + $enddate = $_GET['enddate']; |
|
24 | + } else { |
|
25 | + $enddate = time(); |
|
26 | + } |
|
21 | 27 | setcookie("archive_begin",$begindate); |
22 | 28 | setcookie("archive_end",$enddate); |
23 | 29 | setcookie("archive_update",$lastupd); |
@@ -123,7 +129,17 @@ discard block |
||
123 | 129 | } |
124 | 130 | |
125 | 131 | //create the map |
126 | - map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) print $latitude; else print $globalCenterLatitude; ?>,<?php if (isset($longitude)) print $longitude; else print $globalCenterLongitude; ?>], zoom); |
|
132 | + map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) { |
|
133 | + print $latitude; |
|
134 | +} else { |
|
135 | + print $globalCenterLatitude; |
|
136 | +} |
|
137 | +?>,<?php if (isset($longitude)) { |
|
138 | + print $longitude; |
|
139 | +} else { |
|
140 | + print $globalCenterLongitude; |
|
141 | +} |
|
142 | +?>], zoom); |
|
127 | 143 | <?php |
128 | 144 | } else { |
129 | 145 | ?> |
@@ -136,9 +152,19 @@ discard block |
||
136 | 152 | || navigator.userAgent.match(/BlackBerry/i) |
137 | 153 | || navigator.userAgent.match(/Windows Phone/i)) |
138 | 154 | { |
139 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
155 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
156 | + print $globalLiveZoom-1; |
|
157 | +} else { |
|
158 | + print '8'; |
|
159 | +} |
|
160 | +?>; |
|
140 | 161 | } else { |
141 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
|
162 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
163 | + print $globalLiveZoom; |
|
164 | +} else { |
|
165 | + print '9'; |
|
166 | +} |
|
167 | +?>; |
|
142 | 168 | } |
143 | 169 | |
144 | 170 | //create the map |
@@ -163,16 +189,27 @@ discard block |
||
163 | 189 | bounds = L.latLngBounds(southWest,northEast); |
164 | 190 | //a few title layers |
165 | 191 | <?php |
166 | - if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType']; |
|
167 | - else $MapType = $globalMapProvider; |
|
192 | + if (isset($_COOKIE['MapType'])) { |
|
193 | + $MapType = $_COOKIE['MapType']; |
|
194 | + } else { |
|
195 | + $MapType = $globalMapProvider; |
|
196 | + } |
|
168 | 197 | |
169 | 198 | if ($MapType == 'Mapbox') { |
170 | - if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId; |
|
171 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
172 | -?> |
|
199 | + if ($_COOKIE['MapTypeId'] == 'default') { |
|
200 | + $MapBoxId = $globalMapboxId; |
|
201 | + } else { |
|
202 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
203 | + } |
|
204 | + ?> |
|
173 | 205 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
174 | 206 | maxZoom: 18, |
175 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
207 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
208 | + print 'false'; |
|
209 | +} else { |
|
210 | + print 'true'; |
|
211 | +} |
|
212 | +?>, |
|
176 | 213 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
177 | 214 | '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + |
178 | 215 | 'Imagery © <a href="http://mapbox.com">Mapbox</a>', |
@@ -184,7 +221,12 @@ discard block |
||
184 | 221 | ?> |
185 | 222 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
186 | 223 | maxZoom: 18, |
187 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
224 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
225 | + print 'false'; |
|
226 | +} else { |
|
227 | + print 'true'; |
|
228 | +} |
|
229 | +?>, |
|
188 | 230 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
189 | 231 | '<a href="www.openstreetmap.org/copyright">Open Database Licence</a>' |
190 | 232 | }).addTo(map); |
@@ -230,20 +272,26 @@ discard block |
||
230 | 272 | map.addLayer(yandexLayer); |
231 | 273 | <?php |
232 | 274 | } elseif ($MapType == 'Bing-Aerial') { |
233 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
234 | -?> |
|
275 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
276 | + setcookie('MapType','OpenStreetMap'); |
|
277 | + } |
|
278 | + ?> |
|
235 | 279 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
236 | 280 | map.addLayer(bingLayer); |
237 | 281 | <?php |
238 | 282 | } elseif ($MapType == 'Bing-Hybrid') { |
239 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
240 | -?> |
|
283 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
284 | + setcookie('MapType','OpenStreetMap'); |
|
285 | + } |
|
286 | + ?> |
|
241 | 287 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
242 | 288 | map.addLayer(bingLayer); |
243 | 289 | <?php |
244 | 290 | } elseif ($MapType == 'Bing-Road') { |
245 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
246 | -?> |
|
291 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
292 | + setcookie('MapType','OpenStreetMap'); |
|
293 | + } |
|
294 | + ?> |
|
247 | 295 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
248 | 296 | map.addLayer(bingLayer); |
249 | 297 | <?php |
@@ -291,7 +339,12 @@ discard block |
||
291 | 339 | } |
292 | 340 | } elseif ($globalBounding == 'circle') { |
293 | 341 | ?> |
294 | - var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) print $globalBoundingCircleSize; else print '70000'; ?>,{ |
|
342 | + var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) { |
|
343 | + print $globalBoundingCircleSize; |
|
344 | +} else { |
|
345 | + print '70000'; |
|
346 | +} |
|
347 | +?>,{ |
|
295 | 348 | color: '#92C7D1', |
296 | 349 | fillColor: '#92C7D1', |
297 | 350 | fillOpacity: 0.3, |
@@ -350,8 +403,11 @@ discard block |
||
350 | 403 | |
351 | 404 | function update_airportsLayer() { |
352 | 405 | <?php |
353 | - if (isset($_COOKIE['AirportZoom'])) $getZoom = $_COOKIE['AirportZoom']; |
|
354 | - else $getZoom = '7'; |
|
406 | + if (isset($_COOKIE['AirportZoom'])) { |
|
407 | + $getZoom = $_COOKIE['AirportZoom']; |
|
408 | + } else { |
|
409 | + $getZoom = '7'; |
|
410 | + } |
|
355 | 411 | ?> |
356 | 412 | //if (map.getZoom() <= <?php print $getZoom; ?>) { |
357 | 413 | if (typeof airportsLayer != 'undefined') { |
@@ -687,9 +743,13 @@ discard block |
||
687 | 743 | if (callsign != ""){ markerLabel += callsign; } |
688 | 744 | if (departure_airport_code != "" && arrival_airport_code != "" && departure_airport_code != "NA" && arrival_airport_code != "NA"){ markerLabel += ' ( '+departure_airport_code+' - '+arrival_airport_code+' )'; } |
689 | 745 | <?php |
690 | - if (isset($_COOKIE['IconColor'])) $IconColor = $_COOKIE['IconColor']; |
|
691 | - elseif (isset($globalAircraftIconColor)) $IconColor = $globalAircraftIconColor; |
|
692 | - else $IconColor = '1a3151'; |
|
746 | + if (isset($_COOKIE['IconColor'])) { |
|
747 | + $IconColor = $_COOKIE['IconColor']; |
|
748 | + } elseif (isset($globalAircraftIconColor)) { |
|
749 | + $IconColor = $globalAircraftIconColor; |
|
750 | + } else { |
|
751 | + $IconColor = '1a3151'; |
|
752 | + } |
|
693 | 753 | if (!isset($ident) && !isset($flightaware_id)) { |
694 | 754 | ?> |
695 | 755 | info_update(feature.properties.fc); |
@@ -737,7 +797,12 @@ discard block |
||
737 | 797 | <?php |
738 | 798 | } else { |
739 | 799 | ?> |
740 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
800 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
801 | + print $archiveupdatetime*1000; |
|
802 | +} else { |
|
803 | + print $globalMapRefresh*1000+20000; |
|
804 | +} |
|
805 | +?>+feature.properties.sqt*1000); |
|
741 | 806 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
742 | 807 | <?php |
743 | 808 | } |
@@ -786,7 +851,12 @@ discard block |
||
786 | 851 | <?php |
787 | 852 | } else { |
788 | 853 | ?> |
789 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
854 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
855 | + print $archiveupdatetime*1000; |
|
856 | +} else { |
|
857 | + print $globalMapRefresh*1000+20000; |
|
858 | +} |
|
859 | +?>+feature.properties.sqt*1000); |
|
790 | 860 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
791 | 861 | <?php |
792 | 862 | } |
@@ -834,7 +904,12 @@ discard block |
||
834 | 904 | <?php |
835 | 905 | } else { |
836 | 906 | ?> |
837 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
907 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
908 | + print $archiveupdatetime*1000; |
|
909 | +} else { |
|
910 | + print $globalMapRefresh*1000+20000; |
|
911 | +} |
|
912 | +?>+feature.properties.sqt*1000); |
|
838 | 913 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
839 | 914 | <?php |
840 | 915 | } |
@@ -1177,14 +1252,24 @@ discard block |
||
1177 | 1252 | if (isset($_GET['archive'])) { |
1178 | 1253 | ?> |
1179 | 1254 | //then load it again every 30 seconds |
1180 | -// var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
1255 | +// var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) { |
|
1256 | + print ($globalMapRefresh*1000)/2; |
|
1257 | +} else { |
|
1258 | + print '15000'; |
|
1259 | +} |
|
1260 | +?>); |
|
1181 | 1261 | reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php print $archiveupdatetime*1000; ?>); |
1182 | 1262 | <?php |
1183 | 1263 | } else { |
1184 | 1264 | ?> |
1185 | 1265 | //then load it again every 30 seconds |
1186 | 1266 | reloadPage = setInterval( |
1187 | - function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
1267 | + function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) { |
|
1268 | + print $globalMapRefresh*1000; |
|
1269 | +} else { |
|
1270 | + print '30000'; |
|
1271 | +} |
|
1272 | +?>); |
|
1188 | 1273 | var currentdate = new Date(); |
1189 | 1274 | var currentyear = new Date().getFullYear(); |
1190 | 1275 | var begindate = new Date(Date.UTC(currentyear,11,24,2,0,0,0)); |
@@ -1196,7 +1281,12 @@ discard block |
||
1196 | 1281 | if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
1197 | 1282 | ?> |
1198 | 1283 | update_polarLayer(); |
1199 | -setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
1284 | +setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) { |
|
1285 | + print $globalMapRefresh*1000*2; |
|
1286 | +} else { |
|
1287 | + print '60000'; |
|
1288 | +} |
|
1289 | +?>); |
|
1200 | 1290 | <?php |
1201 | 1291 | } |
1202 | 1292 | ?> |
@@ -1212,7 +1302,12 @@ discard block |
||
1212 | 1302 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) { |
1213 | 1303 | ?> |
1214 | 1304 | update_atcLayer(); |
1215 | -setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
1305 | +setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) { |
|
1306 | + print $globalMapRefresh*1000*2; |
|
1307 | +} else { |
|
1308 | + print '60000'; |
|
1309 | +} |
|
1310 | +?>); |
|
1216 | 1311 | <?php |
1217 | 1312 | } |
1218 | 1313 | ?> |
@@ -22,7 +22,9 @@ |
||
22 | 22 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
23 | 23 | $Stats = new Stats(); |
24 | 24 | $all_manufacturers = $Stats->getAllManufacturers(); |
25 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
25 | + if (empty($all_manufacturers)) { |
|
26 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
27 | + } |
|
26 | 28 | foreach($all_manufacturers as $all_manufacturer) |
27 | 29 | { |
28 | 30 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -12,7 +12,7 @@ |
||
12 | 12 | $limit_start = 0; |
13 | 13 | $limit_end = 25; |
14 | 14 | $absolute_difference = 25; |
15 | -} else { |
|
15 | +} else { |
|
16 | 16 | $limit_explode = explode(",", $_GET['limit']); |
17 | 17 | $limit_start = $limit_explode[0]; |
18 | 18 | $limit_end = $limit_explode[1]; |
@@ -23,7 +23,9 @@ |
||
23 | 23 | print '<option></option>'; |
24 | 24 | $Stats = new Stats(); |
25 | 25 | $airport_names = $Stats->getAllAirportNames(); |
26 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
26 | + if (empty($airport_names)) { |
|
27 | + $airport_names = $Spotter->getAllAirportNames(); |
|
28 | + } |
|
27 | 29 | ksort($airport_names); |
28 | 30 | foreach($airport_names as $airport_name) |
29 | 31 | { |
@@ -22,7 +22,9 @@ |
||
22 | 22 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
23 | 23 | $Stats = new Stats(); |
24 | 24 | $all_manufacturers = $Stats->getAllManufacturers(); |
25 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
25 | + if (empty($all_manufacturers)) { |
|
26 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
27 | + } |
|
26 | 28 | foreach($all_manufacturers as $all_manufacturer) |
27 | 29 | { |
28 | 30 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -14,7 +14,7 @@ |
||
14 | 14 | $limit_start = 0; |
15 | 15 | $limit_end = 25; |
16 | 16 | $absolute_difference = 25; |
17 | - } else { |
|
17 | + } else { |
|
18 | 18 | $limit_explode = explode(",", $_GET['limit']); |
19 | 19 | $limit_start = $limit_explode[0]; |
20 | 20 | $limit_end = $limit_explode[1]; |
@@ -22,7 +22,9 @@ |
||
22 | 22 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
23 | 23 | $Stats = new Stats(); |
24 | 24 | $all_manufacturers = $Stats->getAllManufacturers(); |
25 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
25 | + if (empty($all_manufacturers)) { |
|
26 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
27 | + } |
|
26 | 28 | foreach($all_manufacturers as $all_manufacturer) |
27 | 29 | { |
28 | 30 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -74,7 +74,9 @@ |
||
74 | 74 | $radius = $spotter_item['radius']*1852; |
75 | 75 | $output .= '"radiusm": "'.$radius.'",'; |
76 | 76 | $output .= '"radiusnm": "'.$spotter_item['radius'].'",'; |
77 | - if ($radius > 25000) $radius = 25000; |
|
77 | + if ($radius > 25000) { |
|
78 | + $radius = 25000; |
|
79 | + } |
|
78 | 80 | $output .= '"radius": '.$radius.''; |
79 | 81 | $output .= '},'; |
80 | 82 | $output .= '"geometry": {'; |
@@ -22,7 +22,9 @@ |
||
22 | 22 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
23 | 23 | $Stats = new Stats(); |
24 | 24 | $all_manufacturers = $Stats->getAllManufacturers(); |
25 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
25 | + if (empty($all_manufacturers)) { |
|
26 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
27 | + } |
|
26 | 28 | foreach($all_manufacturers as $all_manufacturer) |
27 | 29 | { |
28 | 30 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |