@@ -6,8 +6,11 @@ discard block |
||
6 | 6 | //$_COOKIE['MapFormat'] = '2d'; |
7 | 7 | |
8 | 8 | // Compressed GeoJson is used if true |
9 | -if (!isset($globalJsonCompress)) $compress = true; |
|
10 | -else $compress = $globalJsonCompress; |
|
9 | +if (!isset($globalJsonCompress)) { |
|
10 | + $compress = true; |
|
11 | +} else { |
|
12 | + $compress = $globalJsonCompress; |
|
13 | +} |
|
11 | 14 | ?> |
12 | 15 | <?php |
13 | 16 | if (isset($_GET['archive'])) { |
@@ -19,8 +22,11 @@ discard block |
||
19 | 22 | //$lastupd = round(($_GET['enddate']-$_GET['begindate'])/(($_GET['during']*60)/10)); |
20 | 23 | //$lastupd = 20; |
21 | 24 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
22 | - if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
|
23 | - else $enddate = time(); |
|
25 | + if (isset($_GET['enddate']) && $_GET['enddate'] != '') { |
|
26 | + $enddate = $_GET['enddate']; |
|
27 | + } else { |
|
28 | + $enddate = time(); |
|
29 | + } |
|
24 | 30 | setcookie("archive_begin",$begindate); |
25 | 31 | setcookie("archive_end",$enddate); |
26 | 32 | setcookie("archive_update",$lastupd); |
@@ -127,7 +133,17 @@ discard block |
||
127 | 133 | } |
128 | 134 | |
129 | 135 | //create the map |
130 | - 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); |
|
136 | + map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) { |
|
137 | + print $latitude; |
|
138 | +} else { |
|
139 | + print $globalCenterLatitude; |
|
140 | +} |
|
141 | +?>,<?php if (isset($longitude)) { |
|
142 | + print $longitude; |
|
143 | +} else { |
|
144 | + print $globalCenterLongitude; |
|
145 | +} |
|
146 | +?>], zoom); |
|
131 | 147 | <?php |
132 | 148 | } else { |
133 | 149 | ?> |
@@ -140,9 +156,19 @@ discard block |
||
140 | 156 | || navigator.userAgent.match(/BlackBerry/i) |
141 | 157 | || navigator.userAgent.match(/Windows Phone/i)) |
142 | 158 | { |
143 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
159 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
160 | + print $globalLiveZoom-1; |
|
161 | +} else { |
|
162 | + print '8'; |
|
163 | +} |
|
164 | +?>; |
|
144 | 165 | } else { |
145 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
|
166 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
167 | + print $globalLiveZoom; |
|
168 | +} else { |
|
169 | + print '9'; |
|
170 | +} |
|
171 | +?>; |
|
146 | 172 | } |
147 | 173 | |
148 | 174 | //create the map |
@@ -167,16 +193,27 @@ discard block |
||
167 | 193 | bounds = L.latLngBounds(southWest,northEast); |
168 | 194 | //a few title layers |
169 | 195 | <?php |
170 | - if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType']; |
|
171 | - else $MapType = $globalMapProvider; |
|
196 | + if (isset($_COOKIE['MapType'])) { |
|
197 | + $MapType = $_COOKIE['MapType']; |
|
198 | + } else { |
|
199 | + $MapType = $globalMapProvider; |
|
200 | + } |
|
172 | 201 | |
173 | 202 | if ($MapType == 'Mapbox') { |
174 | - if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId; |
|
175 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
176 | -?> |
|
203 | + if ($_COOKIE['MapTypeId'] == 'default') { |
|
204 | + $MapBoxId = $globalMapboxId; |
|
205 | + } else { |
|
206 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
207 | + } |
|
208 | + ?> |
|
177 | 209 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
178 | 210 | maxZoom: 18, |
179 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
211 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
212 | + print 'false'; |
|
213 | +} else { |
|
214 | + print 'true'; |
|
215 | +} |
|
216 | +?>, |
|
180 | 217 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
181 | 218 | '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + |
182 | 219 | 'Imagery © <a href="http://mapbox.com">Mapbox</a>', |
@@ -188,7 +225,12 @@ discard block |
||
188 | 225 | ?> |
189 | 226 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
190 | 227 | maxZoom: 18, |
191 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
228 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
229 | + print 'false'; |
|
230 | +} else { |
|
231 | + print 'true'; |
|
232 | +} |
|
233 | +?>, |
|
192 | 234 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
193 | 235 | '<a href="www.openstreetmap.org/copyright">Open Database Licence</a>' |
194 | 236 | }).addTo(map); |
@@ -234,20 +276,26 @@ discard block |
||
234 | 276 | map.addLayer(yandexLayer); |
235 | 277 | <?php |
236 | 278 | } elseif ($MapType == 'Bing-Aerial') { |
237 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
238 | -?> |
|
279 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
280 | + setcookie('MapType','OpenStreetMap'); |
|
281 | + } |
|
282 | + ?> |
|
239 | 283 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
240 | 284 | map.addLayer(bingLayer); |
241 | 285 | <?php |
242 | 286 | } elseif ($MapType == 'Bing-Hybrid') { |
243 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
244 | -?> |
|
287 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
288 | + setcookie('MapType','OpenStreetMap'); |
|
289 | + } |
|
290 | + ?> |
|
245 | 291 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
246 | 292 | map.addLayer(bingLayer); |
247 | 293 | <?php |
248 | 294 | } elseif ($MapType == 'Bing-Road') { |
249 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
250 | -?> |
|
295 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
296 | + setcookie('MapType','OpenStreetMap'); |
|
297 | + } |
|
298 | + ?> |
|
251 | 299 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
252 | 300 | map.addLayer(bingLayer); |
253 | 301 | <?php |
@@ -295,7 +343,12 @@ discard block |
||
295 | 343 | } |
296 | 344 | } elseif ($globalBounding == 'circle') { |
297 | 345 | ?> |
298 | - var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) print $globalBoundingCircleSize; else print '70000'; ?>,{ |
|
346 | + var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) { |
|
347 | + print $globalBoundingCircleSize; |
|
348 | +} else { |
|
349 | + print '70000'; |
|
350 | +} |
|
351 | +?>,{ |
|
299 | 352 | color: '#92C7D1', |
300 | 353 | fillColor: '#92C7D1', |
301 | 354 | fillOpacity: 0.3, |
@@ -354,8 +407,11 @@ discard block |
||
354 | 407 | |
355 | 408 | function update_airportsLayer() { |
356 | 409 | <?php |
357 | - if (isset($_COOKIE['AirportZoom'])) $getZoom = $_COOKIE['AirportZoom']; |
|
358 | - else $getZoom = '7'; |
|
410 | + if (isset($_COOKIE['AirportZoom'])) { |
|
411 | + $getZoom = $_COOKIE['AirportZoom']; |
|
412 | + } else { |
|
413 | + $getZoom = '7'; |
|
414 | + } |
|
359 | 415 | ?> |
360 | 416 | //if (map.getZoom() <= <?php print $getZoom; ?>) { |
361 | 417 | if (typeof airportsLayer != 'undefined') { |
@@ -689,9 +745,13 @@ discard block |
||
689 | 745 | if (callsign != ""){ markerLabel += callsign; } |
690 | 746 | if (departure_airport_code != "" && arrival_airport_code != "" && departure_airport_code != "NA" && arrival_airport_code != "NA"){ markerLabel += ' ( '+departure_airport_code+' - '+arrival_airport_code+' )'; } |
691 | 747 | <?php |
692 | - if (isset($_COOKIE['IconColor'])) $IconColor = $_COOKIE['IconColor']; |
|
693 | - elseif (isset($globalAircraftIconColor)) $IconColor = $globalAircraftIconColor; |
|
694 | - else $IconColor = '1a3151'; |
|
748 | + if (isset($_COOKIE['IconColor'])) { |
|
749 | + $IconColor = $_COOKIE['IconColor']; |
|
750 | + } elseif (isset($globalAircraftIconColor)) { |
|
751 | + $IconColor = $globalAircraftIconColor; |
|
752 | + } else { |
|
753 | + $IconColor = '1a3151'; |
|
754 | + } |
|
695 | 755 | if (!isset($ident) && !isset($flightaware_id)) { |
696 | 756 | ?> |
697 | 757 | info_update(feature.properties.fc); |
@@ -739,7 +799,12 @@ discard block |
||
739 | 799 | <?php |
740 | 800 | } else { |
741 | 801 | ?> |
742 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
802 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
803 | + print $archiveupdatetime*1000; |
|
804 | +} else { |
|
805 | + print $globalMapRefresh*1000+20000; |
|
806 | +} |
|
807 | +?>+feature.properties.sqt*1000); |
|
743 | 808 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
744 | 809 | <?php |
745 | 810 | } |
@@ -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 | } |
@@ -832,7 +902,12 @@ discard block |
||
832 | 902 | <?php |
833 | 903 | } else { |
834 | 904 | ?> |
835 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
905 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
906 | + print $archiveupdatetime*1000; |
|
907 | +} else { |
|
908 | + print $globalMapRefresh*1000+20000; |
|
909 | +} |
|
910 | +?>+feature.properties.sqt*1000); |
|
836 | 911 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
837 | 912 | <?php |
838 | 913 | } |
@@ -1173,14 +1248,24 @@ discard block |
||
1173 | 1248 | if (isset($_GET['archive'])) { |
1174 | 1249 | ?> |
1175 | 1250 | //then load it again every 30 seconds |
1176 | -// var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
1251 | +// var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) { |
|
1252 | + print ($globalMapRefresh*1000)/2; |
|
1253 | +} else { |
|
1254 | + print '15000'; |
|
1255 | +} |
|
1256 | +?>); |
|
1177 | 1257 | reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php print $archiveupdatetime*1000; ?>); |
1178 | 1258 | <?php |
1179 | 1259 | } else { |
1180 | 1260 | ?> |
1181 | 1261 | //then load it again every 30 seconds |
1182 | 1262 | reloadPage = setInterval( |
1183 | - function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
1263 | + function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) { |
|
1264 | + print $globalMapRefresh*1000; |
|
1265 | +} else { |
|
1266 | + print '30000'; |
|
1267 | +} |
|
1268 | +?>); |
|
1184 | 1269 | var currentdate = new Date(Date.UTC()); |
1185 | 1270 | var currentyear = new Date().getFullYear(); |
1186 | 1271 | var begindate = new Date(Date.UTC(currentyear,12,24,2,0,0,0)); |
@@ -1192,7 +1277,12 @@ discard block |
||
1192 | 1277 | if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
1193 | 1278 | ?> |
1194 | 1279 | update_polarLayer(); |
1195 | -setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
1280 | +setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) { |
|
1281 | + print $globalMapRefresh*1000*2; |
|
1282 | +} else { |
|
1283 | + print '60000'; |
|
1284 | +} |
|
1285 | +?>); |
|
1196 | 1286 | <?php |
1197 | 1287 | } |
1198 | 1288 | ?> |
@@ -1208,7 +1298,12 @@ discard block |
||
1208 | 1298 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) { |
1209 | 1299 | ?> |
1210 | 1300 | update_atcLayer(); |
1211 | -setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
1301 | +setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) { |
|
1302 | + print $globalMapRefresh*1000*2; |
|
1303 | +} else { |
|
1304 | + print '60000'; |
|
1305 | +} |
|
1306 | +?>); |
|
1212 | 1307 | <?php |
1213 | 1308 | } |
1214 | 1309 | ?> |
@@ -22,8 +22,11 @@ |
||
22 | 22 | $j = 0; |
23 | 23 | $prev_satname = ''; |
24 | 24 | $timearray = array(); |
25 | -if (isset($_GET['now'])) $begin = time(); |
|
26 | -else $begin = strtotime(date("Y").'-12-24T02:00:00Z'); |
|
25 | +if (isset($_GET['now'])) { |
|
26 | + $begin = time(); |
|
27 | +} else { |
|
28 | + $begin = strtotime(date("Y").'-12-24T02:00:00Z'); |
|
29 | +} |
|
27 | 30 | for ($i =0; $i <= 288; $i++) { |
28 | 31 | $timearray[] = ($begin + $i*300)*1000; |
29 | 32 | } |
@@ -6,7 +6,9 @@ discard block |
||
6 | 6 | $Stats = new Stats(); |
7 | 7 | $title = _("Statistics"); |
8 | 8 | |
9 | -if (!isset($filter_name)) $filter_name = ''; |
|
9 | +if (!isset($filter_name)) { |
|
10 | + $filter_name = ''; |
|
11 | +} |
|
10 | 12 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
11 | 13 | if ($airline_icao == 'all') { |
12 | 14 | unset($_COOKIE['stats_airline_icao']); |
@@ -15,8 +17,10 @@ discard block |
||
15 | 17 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
16 | 18 | $airline_icao = $_COOKIE['stats_airline_icao']; |
17 | 19 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
18 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
19 | -} |
|
20 | + if (isset($globalFilter['airline'])) { |
|
21 | + $airline_icao = $globalFilter['airline'][0]; |
|
22 | + } |
|
23 | + } |
|
20 | 24 | setcookie('stats_airline_icao',$airline_icao); |
21 | 25 | require_once('header.php'); |
22 | 26 | |
@@ -36,7 +40,9 @@ discard block |
||
36 | 40 | if (isset($last_update[0]['value'])) { |
37 | 41 | date_default_timezone_set('UTC'); |
38 | 42 | $lastupdate = strtotime($last_update[0]['value']); |
39 | - if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
|
43 | + if (isset($globalTimezone) && $globalTimezone != '') { |
|
44 | + date_default_timezone_set($globalTimezone); |
|
45 | + } |
|
40 | 46 | print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
41 | 47 | } |
42 | 48 | ?> |
@@ -89,8 +95,9 @@ discard block |
||
89 | 95 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
90 | 96 | <?php |
91 | 97 | $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name); |
92 | - if (count($aircraft_array) == 0) print _("No data available"); |
|
93 | - else { |
|
98 | + if (count($aircraft_array) == 0) { |
|
99 | + print _("No data available"); |
|
100 | + } else { |
|
94 | 101 | |
95 | 102 | print '<div id="chart1" class="chart" width="100%"></div> |
96 | 103 | <script> |
@@ -186,8 +193,9 @@ discard block |
||
186 | 193 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
187 | 194 | <?php |
188 | 195 | $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name); |
189 | - if (count($pilot_array) == 0) print _("No data available"); |
|
190 | - else { |
|
196 | + if (count($pilot_array) == 0) { |
|
197 | + print _("No data available"); |
|
198 | + } else { |
|
191 | 199 | print '<div id="chart7" class="chart" width="100%"></div> |
192 | 200 | <script> |
193 | 201 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -232,8 +240,9 @@ discard block |
||
232 | 240 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
233 | 241 | <?php |
234 | 242 | $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name); |
235 | - if (count($owner_array) == 0) print _("No data available"); |
|
236 | - else { |
|
243 | + if (count($owner_array) == 0) { |
|
244 | + print _("No data available"); |
|
245 | + } else { |
|
237 | 246 | print '<div id="chart7" class="chart" width="100%"></div> |
238 | 247 | <script> |
239 | 248 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -279,8 +288,9 @@ discard block |
||
279 | 288 | <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2> |
280 | 289 | <?php |
281 | 290 | //$flightover_array = $Stats->countAllFlightOverCountries(); |
282 | - if (count($flightover_array) == 0) print _("No data available"); |
|
283 | - else { |
|
291 | + if (count($flightover_array) == 0) { |
|
292 | + print _("No data available"); |
|
293 | + } else { |
|
284 | 294 | print '<div id="chart10" class="chart" width="100%"></div> |
285 | 295 | <script> |
286 | 296 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -424,8 +434,9 @@ discard block |
||
424 | 434 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
425 | 435 | <?php |
426 | 436 | $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
427 | - if (count($year_array) == 0) print _("No data available"); |
|
428 | - else { |
|
437 | + if (count($year_array) == 0) { |
|
438 | + print _("No data available"); |
|
439 | + } else { |
|
429 | 440 | print '<div id="chart8" class="chart" width="100%"></div> |
430 | 441 | <script> |
431 | 442 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -470,8 +481,9 @@ discard block |
||
470 | 481 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
471 | 482 | <?php |
472 | 483 | $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
473 | - if (count($month_array) == 0) print _("No data available"); |
|
474 | - else { |
|
484 | + if (count($month_array) == 0) { |
|
485 | + print _("No data available"); |
|
486 | + } else { |
|
475 | 487 | print '<div id="chart9" class="chart" width="100%"></div> |
476 | 488 | <script> |
477 | 489 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -516,8 +528,9 @@ discard block |
||
516 | 528 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
517 | 529 | <?php |
518 | 530 | $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
519 | - if (empty($date_array)) print _("No data available"); |
|
520 | - else { |
|
531 | + if (empty($date_array)) { |
|
532 | + print _("No data available"); |
|
533 | + } else { |
|
521 | 534 | print '<div id="chart5" class="chart" width="100%"></div> |
522 | 535 | <script> |
523 | 536 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -563,8 +576,9 @@ discard block |
||
563 | 576 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
564 | 577 | <?php |
565 | 578 | $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
566 | - if (empty($hour_array)) print _("No data available"); |
|
567 | - else { |
|
579 | + if (empty($hour_array)) { |
|
580 | + print _("No data available"); |
|
581 | + } else { |
|
568 | 582 | |
569 | 583 | print '<div id="chart6" class="chart" width="100%"></div> |
570 | 584 | <script> |
@@ -632,8 +646,11 @@ discard block |
||
632 | 646 | $distance = $distance; |
633 | 647 | $unit = 'km'; |
634 | 648 | } |
635 | - if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
636 | - else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
649 | + if (!isset($polar_data)) { |
|
650 | + $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
651 | + } else { |
|
652 | + $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
653 | + } |
|
637 | 654 | } |
638 | 655 | ?> |
639 | 656 | <div class="col-md-6"> |
@@ -680,8 +697,11 @@ discard block |
||
680 | 697 | foreach ($msg as $eachmsg) { |
681 | 698 | //$eachmsg = $msg[0]; |
682 | 699 | $data = $eachmsg['source_data']; |
683 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
684 | - else $max = 500; |
|
700 | + if ($data > 500) { |
|
701 | + $max = (round(($data+100)/100))*100; |
|
702 | + } else { |
|
703 | + $max = 500; |
|
704 | + } |
|
685 | 705 | ?> |
686 | 706 | <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
687 | 707 | <script> |
@@ -18,26 +18,49 @@ discard block |
||
18 | 18 | } |
19 | 19 | header('Content-Type: text/javascript'); |
20 | 20 | |
21 | -if (!isset($globalJsonCompress)) $compress = true; |
|
22 | -else $compress = $globalJsonCompress; |
|
21 | +if (!isset($globalJsonCompress)) { |
|
22 | + $compress = true; |
|
23 | +} else { |
|
24 | + $compress = $globalJsonCompress; |
|
25 | +} |
|
23 | 26 | |
24 | 27 | $from_archive = false; |
25 | 28 | $min = true; |
26 | 29 | $allhistory = false; |
27 | 30 | $filter['source'] = array(); |
28 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
29 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
30 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
31 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
32 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
33 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
34 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
35 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
36 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
31 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
32 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
33 | +} |
|
34 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
35 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
36 | +} |
|
37 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
38 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
39 | +} |
|
40 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
41 | + $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
42 | +} |
|
43 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
44 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
45 | +} |
|
46 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
47 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
48 | +} |
|
49 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
50 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
51 | +} |
|
52 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
53 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
54 | +} |
|
55 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
56 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
57 | +} |
|
37 | 58 | |
38 | 59 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
39 | 60 | $min = true; |
40 | -} else $min = false; |
|
61 | +} else { |
|
62 | + $min = false; |
|
63 | +} |
|
41 | 64 | |
42 | 65 | if (isset($_GET['ident'])) { |
43 | 66 | $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
@@ -87,20 +110,30 @@ discard block |
||
87 | 110 | } |
88 | 111 | */ |
89 | 112 | $flightcnt = count($spotter_array); |
90 | - if ($flightcnt == '') $flightcnt = 0; |
|
91 | -} else $flightcnt = 0; |
|
113 | + if ($flightcnt == '') { |
|
114 | + $flightcnt = 0; |
|
115 | + } |
|
116 | + } else { |
|
117 | + $flightcnt = 0; |
|
118 | +} |
|
92 | 119 | |
93 | 120 | $sqltime = round(microtime(true)-$begintime,2); |
94 | 121 | |
95 | -if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
|
96 | -else $usenextlatlon = true; |
|
122 | +if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) { |
|
123 | + $usenextlatlon = false; |
|
124 | +} else { |
|
125 | + $usenextlatlon = true; |
|
126 | +} |
|
97 | 127 | $j = 0; |
98 | 128 | $prev_flightaware_id = ''; |
99 | 129 | $aircrafts_shadow = array(); |
100 | 130 | $output = '{'; |
101 | 131 | $output .= '"type": "FeatureCollection",'; |
102 | - if ($min) $output .= '"minimal": "true",'; |
|
103 | - else $output .= '"minimal": "false",'; |
|
132 | + if ($min) { |
|
133 | + $output .= '"minimal": "true",'; |
|
134 | + } else { |
|
135 | + $output .= '"minimal": "false",'; |
|
136 | + } |
|
104 | 137 | $output .= '"fc": "'.$flightcnt.'",'; |
105 | 138 | $output .= '"sqt": "'.$sqltime.'",'; |
106 | 139 | |
@@ -137,11 +170,16 @@ discard block |
||
137 | 170 | //$output .= '"sqt": "'.$sqltime.'",'; |
138 | 171 | $output .= '"id": "'.$spotter_item['flightaware_id'].'",'; |
139 | 172 | $output .= '"properties": {'; |
140 | - if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
141 | - else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
173 | + if ($compress) { |
|
174 | + $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
175 | + } else { |
|
176 | + $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
177 | + } |
|
142 | 178 | $output .= '"fc": "'.$flightcnt.'",'; |
143 | 179 | $output .= '"sqt": "'.$sqltime.'",'; |
144 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
180 | + if (isset($begindate)) { |
|
181 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
182 | + } |
|
145 | 183 | |
146 | 184 | /* |
147 | 185 | if ($min) $output .= '"minimal": "true",'; |
@@ -149,13 +187,21 @@ discard block |
||
149 | 187 | */ |
150 | 188 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
151 | 189 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
152 | - if ($compress) $output .= '"c": "'.$spotter_item['ident'].'",'; |
|
153 | - else $output .= '"callsign": "'.$spotter_item['ident'].'",'; |
|
190 | + if ($compress) { |
|
191 | + $output .= '"c": "'.$spotter_item['ident'].'",'; |
|
192 | + } else { |
|
193 | + $output .= '"callsign": "'.$spotter_item['ident'].'",'; |
|
194 | + } |
|
154 | 195 | } else { |
155 | - if ($compress) $output .= '"c": "NA",'; |
|
156 | - else $output .= '"callsign": "NA",'; |
|
196 | + if ($compress) { |
|
197 | + $output .= '"c": "NA",'; |
|
198 | + } else { |
|
199 | + $output .= '"callsign": "NA",'; |
|
200 | + } |
|
201 | + } |
|
202 | + if (isset($spotter_item['registration'])) { |
|
203 | + $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
157 | 204 | } |
158 | - if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
159 | 205 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
160 | 206 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
161 | 207 | $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
@@ -168,25 +214,37 @@ discard block |
||
168 | 214 | $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
169 | 215 | } |
170 | 216 | if (!isset($spotter_item['aircraft_shadow'])) { |
171 | - if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = ''; |
|
172 | - else { |
|
217 | + if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') { |
|
218 | + $spotter_item['aircraft_shadow'] = ''; |
|
219 | + } else { |
|
173 | 220 | $aircraft_icao = $spotter_item['aircraft_icao']; |
174 | - if (isset($aircrafts_shadow[$aircraft_icao])) $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao]; |
|
175 | - else { |
|
221 | + if (isset($aircrafts_shadow[$aircraft_icao])) { |
|
222 | + $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao]; |
|
223 | + } else { |
|
176 | 224 | $aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']); |
177 | - if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
178 | - elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
179 | - else $spotter_item['aircraft_shadow'] = ''; |
|
225 | + if (count($aircraft_info) > 0) { |
|
226 | + $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
227 | + } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
|
228 | + $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
229 | + } else { |
|
230 | + $spotter_item['aircraft_shadow'] = ''; |
|
231 | + } |
|
180 | 232 | $aircrafts_shadow[$aircraft_icao] = $spotter_item['aircraft_shadow']; |
181 | 233 | } |
182 | 234 | } |
183 | 235 | } |
184 | 236 | if ($spotter_item['aircraft_shadow'] == '') { |
185 | - if ($compress) $output .= '"as": "default.png",'; |
|
186 | - else $output .= '"aircraft_shadow": "default.png",'; |
|
237 | + if ($compress) { |
|
238 | + $output .= '"as": "default.png",'; |
|
239 | + } else { |
|
240 | + $output .= '"aircraft_shadow": "default.png",'; |
|
241 | + } |
|
187 | 242 | } else { |
188 | - if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
189 | - else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
243 | + if ($compress) { |
|
244 | + $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
245 | + } else { |
|
246 | + $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
247 | + } |
|
190 | 248 | } |
191 | 249 | if (isset($spotter_item['airline_name'])) { |
192 | 250 | $output .= '"airline_name": "'.$spotter_item['airline_name'].'",'; |
@@ -194,8 +252,11 @@ discard block |
||
194 | 252 | $output .= '"airline_name": "NA",'; |
195 | 253 | } |
196 | 254 | if (isset($spotter_item['departure_airport'])) { |
197 | - if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
198 | - else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
255 | + if ($compress) { |
|
256 | + $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
257 | + } else { |
|
258 | + $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
259 | + } |
|
199 | 260 | } |
200 | 261 | if (isset($spotter_item['departure_airport_city'])) { |
201 | 262 | $output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",'; |
@@ -207,8 +268,11 @@ discard block |
||
207 | 268 | $output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",'; |
208 | 269 | } |
209 | 270 | if (isset($spotter_item['arrival_airport'])) { |
210 | - if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
211 | - else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
271 | + if ($compress) { |
|
272 | + $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
273 | + } else { |
|
274 | + $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
275 | + } |
|
212 | 276 | } |
213 | 277 | if (isset($spotter_item['arrival_airport_city'])) { |
214 | 278 | $output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",'; |
@@ -226,10 +290,16 @@ discard block |
||
226 | 290 | $output .= '"ground_speed": "'.$spotter_item['ground_speed'].'",'; |
227 | 291 | } |
228 | 292 | |
229 | - if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
230 | - else $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
231 | - if ($compress)$output .= '"h": "'.$spotter_item['heading'].'",'; |
|
232 | - else $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
293 | + if ($compress) { |
|
294 | + $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
295 | + } else { |
|
296 | + $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
297 | + } |
|
298 | + if ($compress) { |
|
299 | + $output .= '"h": "'.$spotter_item['heading'].'",'; |
|
300 | + } else { |
|
301 | + $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
302 | + } |
|
233 | 303 | |
234 | 304 | if (isset($archivespeed)) { |
235 | 305 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
@@ -239,7 +309,9 @@ discard block |
||
239 | 309 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
240 | 310 | } |
241 | 311 | |
242 | - if (!$min) $output .= '"image": "'.$image.'",'; |
|
312 | + if (!$min) { |
|
313 | + $output .= '"image": "'.$image.'",'; |
|
314 | + } |
|
243 | 315 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
244 | 316 | $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
245 | 317 | } |
@@ -247,8 +319,11 @@ discard block |
||
247 | 319 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
248 | 320 | } |
249 | 321 | if (isset($spotter_item['squawk'])) { |
250 | - if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
251 | - else $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
322 | + if ($compress) { |
|
323 | + $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
324 | + } else { |
|
325 | + $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
326 | + } |
|
252 | 327 | } |
253 | 328 | if (isset($spotter_item['squawk_usage'])) { |
254 | 329 | $output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",'; |
@@ -266,8 +341,11 @@ discard block |
||
266 | 341 | $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
267 | 342 | } |
268 | 343 | // type when not aircraft ? |
269 | - if ($compress) $output .= '"t": "aircraft"'; |
|
270 | - else $output .= '"type": "aircraft"'; |
|
344 | + if ($compress) { |
|
345 | + $output .= '"t": "aircraft"'; |
|
346 | + } else { |
|
347 | + $output .= '"type": "aircraft"'; |
|
348 | + } |
|
271 | 349 | $output .= '},'; |
272 | 350 | $output .= '"geometry": {'; |
273 | 351 | $output .= '"type": "Point",'; |
@@ -334,7 +412,9 @@ discard block |
||
334 | 412 | } |
335 | 413 | */ |
336 | 414 | $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
337 | - if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
|
415 | + if ($history == '' && isset($_COOKIE['history'])) { |
|
416 | + $history = $_COOKIE['history']; |
|
417 | + } |
|
338 | 418 | |
339 | 419 | if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
340 | 420 | || (!isset($_COOKIE['flightpath']) |
@@ -356,8 +436,11 @@ discard block |
||
356 | 436 | $output_history .= ']}},'; |
357 | 437 | $output .= $output_history; |
358 | 438 | } |
359 | - if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
360 | - else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
439 | + if ($compress) { |
|
440 | + $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
441 | + } else { |
|
442 | + $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
443 | + } |
|
361 | 444 | } |
362 | 445 | $output_history .= '['; |
363 | 446 | $output_history .= $spotter_history['longitude'].', '; |
@@ -403,7 +486,9 @@ discard block |
||
403 | 486 | $output .= ']'; |
404 | 487 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
405 | 488 | $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
406 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
489 | + if (isset($begindate)) { |
|
490 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
491 | + } |
|
407 | 492 | $output .= '"fc": "'.$j.'"'; |
408 | 493 | } else { |
409 | 494 | $output .= '"features": '; |
@@ -40,22 +40,43 @@ discard block |
||
40 | 40 | } |
41 | 41 | header('Content-Type: text/javascript'); |
42 | 42 | |
43 | -if (!isset($globalJsonCompress)) $compress = true; |
|
44 | -else $compress = $globalJsonCompress; |
|
43 | +if (!isset($globalJsonCompress)) { |
|
44 | + $compress = true; |
|
45 | +} else { |
|
46 | + $compress = $globalJsonCompress; |
|
47 | +} |
|
45 | 48 | |
46 | 49 | $from_archive = false; |
47 | 50 | $min = false; |
48 | 51 | $allhistory = false; |
49 | 52 | $filter['source'] = array(); |
50 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
51 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
52 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
53 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
54 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
55 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
56 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
57 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
58 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
53 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
54 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
55 | +} |
|
56 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
57 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
58 | +} |
|
59 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
60 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
61 | +} |
|
62 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
63 | + $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
64 | +} |
|
65 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
66 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
67 | +} |
|
68 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
69 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
70 | +} |
|
71 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
72 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
73 | +} |
|
74 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
75 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
76 | +} |
|
77 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
78 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
79 | +} |
|
59 | 80 | /* |
60 | 81 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
61 | 82 | $min = true; |
@@ -132,8 +153,12 @@ discard block |
||
132 | 153 | } else { |
133 | 154 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
134 | 155 | } |
135 | - if ($flightcnt == '') $flightcnt = 0; |
|
136 | -} else $flightcnt = 0; |
|
156 | + if ($flightcnt == '') { |
|
157 | + $flightcnt = 0; |
|
158 | + } |
|
159 | + } else { |
|
160 | + $flightcnt = 0; |
|
161 | +} |
|
137 | 162 | |
138 | 163 | $sqltime = round(microtime(true)-$begintime,2); |
139 | 164 | $minitime = time(); |
@@ -156,7 +181,9 @@ discard block |
||
156 | 181 | $j = 0; |
157 | 182 | $prev_flightaware_id = ''; |
158 | 183 | $speed = 1; |
159 | -if (isset($archivespeed)) $speed = $archivespeed; |
|
184 | +if (isset($archivespeed)) { |
|
185 | + $speed = $archivespeed; |
|
186 | +} |
|
160 | 187 | $output = '['; |
161 | 188 | $output .= '{"id" : "document", "name" : "fam","version" : "1.0"'; |
162 | 189 | // $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "LOOP_STOP","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
@@ -226,7 +253,9 @@ discard block |
||
226 | 253 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
227 | 254 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
228 | 255 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
229 | - } else $aircraft_shadow = ''; |
|
256 | + } else { |
|
257 | + $aircraft_shadow = ''; |
|
258 | + } |
|
230 | 259 | if ($aircraft_shadow != '') { |
231 | 260 | if (isset($modelsdb[$aircraft_shadow])) { |
232 | 261 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_shadow].'","scale" : 1.0,"minimumPixelSize": 20 ,'; |
@@ -323,7 +352,9 @@ discard block |
||
323 | 352 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : 1.0,"minimumPixelSize": 20,'; |
324 | 353 | $output .= '"heightReference": "'.$heightrelative.'"},'; |
325 | 354 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
326 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
355 | + if ($spotter_item['aircraft_icao'] != '') { |
|
356 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
357 | + } |
|
327 | 358 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
328 | 359 | } |
329 | 360 | } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
@@ -335,7 +366,9 @@ discard block |
||
335 | 366 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : 1.0,"minimumPixelSize": 20,'; |
336 | 367 | $output .= '"heightReference": "'.$heightrelative.'"},'; |
337 | 368 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
338 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
369 | + if ($spotter_item['aircraft_icao'] != '') { |
|
370 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
371 | + } |
|
339 | 372 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
340 | 373 | } |
341 | 374 | |
@@ -343,7 +376,9 @@ discard block |
||
343 | 376 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : 1.0,"minimumPixelSize": 20,'; |
344 | 377 | $output .= '"heightReference": "'.$heightrelative.'"},'; |
345 | 378 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
346 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
379 | + if ($spotter_item['aircraft_icao'] != '') { |
|
380 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
381 | + } |
|
347 | 382 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
348 | 383 | } |
349 | 384 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
@@ -356,8 +391,12 @@ discard block |
||
356 | 391 | // $output .= '"interpolationDegree" : 5,'; |
357 | 392 | // $output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", '; |
358 | 393 | $output .= '"cartographicDegrees": ['; |
359 | - if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
|
360 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
394 | + if ($minitime > strtotime($spotter_item['date'])) { |
|
395 | + $minitime = strtotime($spotter_item['date']); |
|
396 | + } |
|
397 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
398 | + $maxitime = strtotime($spotter_item['date']); |
|
399 | + } |
|
361 | 400 | $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
362 | 401 | $output .= $spotter_item['longitude'].', '; |
363 | 402 | $output .= $spotter_item['latitude'].', '; |
@@ -371,7 +410,9 @@ discard block |
||
371 | 410 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
372 | 411 | } else { |
373 | 412 | $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
374 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
413 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
414 | + $maxitime = strtotime($spotter_item['date']); |
|
415 | + } |
|
375 | 416 | if ($spotter_item['ground_speed'] == 0) { |
376 | 417 | $output .= $prevlong.', '; |
377 | 418 | $output .= $prevlat.', '; |
@@ -8,8 +8,11 @@ |
||
8 | 8 | $date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
9 | 9 | |
10 | 10 | $Spotter = new Spotter(); |
11 | -if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
12 | -else $spotter_array = array(); |
|
11 | +if (isset($_GET['date'])) { |
|
12 | + $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
13 | +} else { |
|
14 | + $spotter_array = array(); |
|
15 | +} |
|
13 | 16 | |
14 | 17 | if (!empty($spotter_array)) |
15 | 18 | { |
@@ -38,8 +38,12 @@ |
||
38 | 38 | if (!empty($spotter_array) && $spotter_array[0]['query_number_rows'] != 0) { |
39 | 39 | include('table-output.php'); |
40 | 40 | print '<div class="pagination">'; |
41 | - if ($limit_previous_1 >= 0) print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; |
|
42 | - if ($spotter_array[0]['query_number_rows'] == $absolute_difference) print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; |
|
41 | + if ($limit_previous_1 >= 0) { |
|
42 | + print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; |
|
43 | + } |
|
44 | + if ($spotter_array[0]['query_number_rows'] == $absolute_difference) { |
|
45 | + print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; |
|
46 | + } |
|
43 | 47 | print '</div>'; |
44 | 48 | } |
45 | 49 | print '</div>'; |
@@ -6,8 +6,11 @@ |
||
6 | 6 | $Spotter = new Spotter(); |
7 | 7 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
8 | 8 | $date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
9 | -if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
10 | -else $spotter_array = ''; |
|
9 | +if (isset($_GET['date'])) { |
|
10 | + $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
11 | +} else { |
|
12 | + $spotter_array = ''; |
|
13 | +} |
|
11 | 14 | |
12 | 15 | if (!empty($spotter_array)) |
13 | 16 | { |
@@ -8,8 +8,11 @@ |
||
8 | 8 | $date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
9 | 9 | |
10 | 10 | $Spotter = new Spotter(); |
11 | -if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
12 | -else $spotter_array = array(); |
|
11 | +if (isset($_GET['date'])) { |
|
12 | + $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
13 | +} else { |
|
14 | + $spotter_array = array(); |
|
15 | +} |
|
13 | 16 | |
14 | 17 | if (!empty($spotter_array)) |
15 | 18 | { |