Completed
Push — master ( 58e924...1d281c )
by Yannick
26:36
created
live-sat-geojson.php 1 patch
Braces   +13 added lines, -5 removed lines patch added patch discarded remove patch
@@ -58,13 +58,19 @@  discard block
 block discarded – undo
58 58
 		$nextlatlon = $Satellite->position($spotter_item['name'],time()+$globalMapRefresh+20);
59 59
 		$nextlat = $nextlatlon['latitude'];
60 60
 		if (abs($nextlat-$spotter_item['latitude']) > 90) {
61
-			if ($spotter_item['latitude'] < 0) $nexlat = -90;
62
-			else $nexlat = 90;
61
+			if ($spotter_item['latitude'] < 0) {
62
+				$nexlat = -90;
63
+			} else {
64
+				$nexlat = 90;
65
+			}
63 66
 		}
64 67
 		$nextlon = $nextlatlon['longitude'];
65 68
 		if (abs($nextlon-$spotter_item['longitude']) > 180) {
66
-			if ($spotter_item['longitude'] < 0) $nextlon = -180;
67
-			else $nextlon = 180;
69
+			if ($spotter_item['longitude'] < 0) {
70
+				$nextlon = -180;
71
+			} else {
72
+				$nextlon = 180;
73
+			}
68 74
 		}
69 75
 		$output_data .= '"nextlatlon":['.$nextlat.','.$nextlon.'],';
70 76
 		//$output_data .= '"heading":"'.$Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$nextlatlon['latitude'],$nextlatlon['longitude']).'",';
@@ -94,7 +100,9 @@  discard block
 block discarded – undo
94 100
 		}
95 101
 	}
96 102
 }
97
-if (isset($output_data)) $output = substr($output,0,-1);
103
+if (isset($output_data)) {
104
+	$output = substr($output,0,-1);
105
+}
98 106
 $output .= ']}';
99 107
 print $output;
100 108
 ?>
Please login to merge, or discard this patch.
getImages.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -105,8 +105,11 @@
 block discarded – undo
105 105
     } elseif (isset($_GET['satellite'])) {
106 106
         readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/satellites/'.$filename);
107 107
     } else {
108
-        if ($color == 'FF0000') readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename);
109
-	else readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename);
108
+        if ($color == 'FF0000') {
109
+        	readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename);
110
+        } else {
111
+		readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename);
112
+	}
110 113
     }
111 114
 }
112 115
 ?>
113 116
\ No newline at end of file
Please login to merge, or discard this patch.
js/map-aircraft.2d.js.php 1 patch
Braces   +66 added lines, -17 removed lines patch added patch discarded remove patch
@@ -3,11 +3,18 @@  discard block
 block discarded – undo
3 3
 require_once('../require/class.Language.php'); 
4 4
 
5 5
 // Compressed GeoJson is used if true
6
-if (!isset($globalJsonCompress)) $compress = true;
7
-else $compress = $globalJsonCompress;
6
+if (!isset($globalJsonCompress)) {
7
+	$compress = true;
8
+} else {
9
+	$compress = $globalJsonCompress;
10
+}
8 11
 
9
-if (isset($_GET['ident'])) $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
10
-if (isset($_GET['flightaware_id'])) $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
12
+if (isset($_GET['ident'])) {
13
+	$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
14
+}
15
+if (isset($_GET['flightaware_id'])) {
16
+	$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
17
+}
11 18
 ?>
12 19
 
13 20
 
@@ -72,9 +79,12 @@  discard block
 block discarded – undo
72 79
 
73 80
 function update_airportsLayer() {
74 81
 <?php
75
-	if (isset($_COOKIE['AirportZoom'])) $getZoom = $_COOKIE['AirportZoom'];
76
-	else $getZoom = '7';
77
-?>
82
+	if (isset($_COOKIE['AirportZoom'])) {
83
+		$getZoom = $_COOKIE['AirportZoom'];
84
+	} else {
85
+		$getZoom = '7';
86
+	}
87
+	?>
78 88
 	if (typeof airportsLayer != 'undefined') {
79 89
 		if (map.hasLayer(airportsLayer) == true) {
80 90
 			map.removeLayer(airportsLayer);
@@ -320,9 +330,13 @@  discard block
 block discarded – undo
320 330
 					if (callsign != ""){ markerLabel += callsign; }
321 331
 					if (departure_airport_code != "" && arrival_airport_code != "" && departure_airport_code != "NA" && arrival_airport_code != "NA"){ markerLabel += ' ( '+departure_airport_code+' - '+arrival_airport_code+' )'; }
322 332
 <?php
323
-	if (isset($_COOKIE['IconColor'])) $IconColor = $_COOKIE['IconColor'];
324
-	elseif (isset($globalAircraftIconColor)) $IconColor = $globalAircraftIconColor;
325
-	else $IconColor = '1a3151';
333
+	if (isset($_COOKIE['IconColor'])) {
334
+		$IconColor = $_COOKIE['IconColor'];
335
+	} elseif (isset($globalAircraftIconColor)) {
336
+		$IconColor = $globalAircraftIconColor;
337
+	} else {
338
+		$IconColor = '1a3151';
339
+	}
326 340
 	if (!isset($ident) && !isset($flightaware_id)) {
327 341
 ?>
328 342
 					//info_update(feature.properties.fc);
@@ -370,7 +384,12 @@  discard block
 block discarded – undo
370 384
 <?php
371 385
 		} else {
372 386
 ?>
373
-					var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
387
+					var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
388
+	print $archiveupdatetime*1000;
389
+} else {
390
+	print $globalMapRefresh*1000+20000;
391
+}
392
+?>+feature.properties.sqt*1000);
374 393
 					return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
375 394
 <?php
376 395
 		}
@@ -419,7 +438,12 @@  discard block
 block discarded – undo
419 438
 <?php
420 439
 		} else {
421 440
 ?>
422
-						var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
441
+						var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
442
+	print $archiveupdatetime*1000;
443
+} else {
444
+	print $globalMapRefresh*1000+20000;
445
+}
446
+?>+feature.properties.sqt*1000);
423 447
 						return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
424 448
 <?php
425 449
 		}
@@ -466,7 +490,12 @@  discard block
 block discarded – undo
466 490
 <?php
467 491
 		} else {
468 492
 ?>
469
-							var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
493
+							var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
494
+	print $archiveupdatetime*1000;
495
+} else {
496
+	print $globalMapRefresh*1000+20000;
497
+}
498
+?>+feature.properties.sqt*1000);
470 499
 							return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
471 500
 <?php
472 501
 		}
@@ -820,13 +849,23 @@  discard block
 block discarded – undo
820 849
 	if (isset($archive) && $archive) {
821 850
 ?>
822 851
 	//then load it again every 30 seconds
823
-	//  var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>);
852
+	//  var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) {
853
+	print ($globalMapRefresh*1000)/2;
854
+} else {
855
+	print '15000';
856
+}
857
+?>);
824 858
 	reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php print $archiveupdatetime*1000; ?>);
825 859
 <?php
826 860
 	} else {
827 861
 ?>
828 862
 	//then load it again every 30 seconds
829
-	reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>);
863
+	reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) {
864
+	print $globalMapRefresh*1000;
865
+} else {
866
+	print '30000';
867
+}
868
+?>);
830 869
 	var currentdate = new Date();
831 870
 	var currentyear = new Date().getFullYear();
832 871
 	var begindate = new Date(Date.UTC(currentyear,11,24,2,0,0,0));
@@ -838,7 +877,12 @@  discard block
 block discarded – undo
838 877
 		if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
839 878
 ?>
840 879
 	update_polarLayer();
841
-	setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>);
880
+	setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) {
881
+	print $globalMapRefresh*1000*2;
882
+} else {
883
+	print '60000';
884
+}
885
+?>);
842 886
 <?php
843 887
 		}
844 888
 ?>
@@ -853,7 +897,12 @@  discard block
 block discarded – undo
853 897
 	if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) {
854 898
 ?>
855 899
 	update_atcLayer();
856
-	setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>);
900
+	setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) {
901
+	print $globalMapRefresh*1000*2;
902
+} else {
903
+	print '60000';
904
+}
905
+?>);
857 906
 <?php
858 907
 	}
859 908
 ?>
Please login to merge, or discard this patch.
js/map-marine.2d.js.php 1 patch
Braces   +42 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,8 +5,11 @@  discard block
 block discarded – undo
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
 ?>
11 14
 
12 15
 
@@ -156,9 +159,13 @@  discard block
 block discarded – undo
156 159
 		    if (callsign != ""){ markerMarineLabel += callsign; }
157 160
 		    if (type != ""){ markerMarineLabel += ' - '+type; }
158 161
 <?php
159
-	if (isset($_COOKIE['MarineIconColor'])) $MarineIconColor = $_COOKIE['MarineIconColor'];
160
-	elseif (isset($globalMarineIconColor)) $MarineIconColor = $globalMarineIconColor;
161
-	else $MarineIconColor = '1a3151';
162
+	if (isset($_COOKIE['MarineIconColor'])) {
163
+		$MarineIconColor = $_COOKIE['MarineIconColor'];
164
+	} elseif (isset($globalMarineIconColor)) {
165
+		$MarineIconColor = $globalMarineIconColor;
166
+	} else {
167
+		$MarineIconColor = '1a3151';
168
+	}
162 169
 	if (!isset($ident) && !isset($fammarine_id)) {
163 170
 ?>
164 171
 		    //info_marine_update(feature.properties.fc);
@@ -193,7 +200,12 @@  discard block
 block discarded – undo
193 200
 <?php
194 201
 		} else {
195 202
 ?>
196
-		    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
203
+		    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
204
+	print $archiveupdatetime*1000;
205
+} else {
206
+	print $globalMapRefresh*1000+20000;
207
+}
208
+?>+feature.properties.sqt*1000);
197 209
 		    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
198 210
 <?php
199 211
 		}
@@ -249,7 +261,12 @@  discard block
 block discarded – undo
249 261
 <?php
250 262
 		} else {
251 263
 ?>
252
-			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
264
+			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
265
+	print $archiveupdatetime*1000;
266
+} else {
267
+	print $globalMapRefresh*1000+20000;
268
+}
269
+?>+feature.properties.sqt*1000);
253 270
 			    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
254 271
 <?php
255 272
 		}
@@ -304,7 +321,12 @@  discard block
 block discarded – undo
304 321
 <?php
305 322
 		} else {
306 323
 ?>
307
-			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
324
+			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
325
+	print $archiveupdatetime*1000;
326
+} else {
327
+	print $globalMapRefresh*1000+20000;
328
+}
329
+?>+feature.properties.sqt*1000);
308 330
 			    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
309 331
 <?php
310 332
 		}
@@ -594,14 +616,24 @@  discard block
 block discarded – undo
594 616
 	if (isset($archive) && $archive) {
595 617
 ?>
596 618
 //then load it again every 30 seconds
597
-//  var reload = setInterval(function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>);
619
+//  var reload = setInterval(function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) {
620
+	print ($globalMapRefresh*1000)/2;
621
+} else {
622
+	print '15000';
623
+}
624
+?>);
598 625
 reloadMarinePage = setInterval(function(){if (noTimeout) getLiveMarineData(0)},<?php print $archiveupdatetime*1000; ?>);
599 626
 <?php
600 627
 	} else {
601 628
 ?>
602 629
 //then load it again every 30 seconds
603 630
 reloadMarinePage = setInterval(
604
-    function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>);
631
+    function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) {
632
+	print $globalMapRefresh*1000;
633
+} else {
634
+	print '30000';
635
+}
636
+?>);
605 637
 <?php
606 638
 	}
607 639
 ?>
Please login to merge, or discard this patch.
js/map-satellite.2d.js.php 1 patch
Braces   +42 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,8 +5,11 @@  discard block
 block discarded – undo
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
 $compress = false;
11 14
 ?>
12 15
 
@@ -158,9 +161,13 @@  discard block
 block discarded – undo
158 161
 		    if (callsign != ""){ markerSatelliteLabel += callsign; }
159 162
 		    if (type != ""){ markerSatelliteLabel += ' - '+type; }
160 163
 <?php
161
-	if (isset($_COOKIE['SatelliteIconColor'])) $IconColor = $_COOKIE['SatelliteIconColor'];
162
-	elseif (isset($globalSatelliteIconColor)) $IconColor = $globalSatelliteIconColor;
163
-	else $IconColor = '1a3151';
164
+	if (isset($_COOKIE['SatelliteIconColor'])) {
165
+		$IconColor = $_COOKIE['SatelliteIconColor'];
166
+	} elseif (isset($globalSatelliteIconColor)) {
167
+		$IconColor = $globalSatelliteIconColor;
168
+	} else {
169
+		$IconColor = '1a3151';
170
+	}
164 171
 	if (!isset($ident) && !isset($famsatid)) {
165 172
 ?>
166 173
 		    info_satellite_update(feature.properties.fc);
@@ -194,7 +201,12 @@  discard block
 block discarded – undo
194 201
 <?php
195 202
 		} else {
196 203
 ?>
197
-		    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
204
+		    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
205
+	print $archiveupdatetime*1000;
206
+} else {
207
+	print $globalMapRefresh*1000+20000;
208
+}
209
+?>+feature.properties.sqt*1000);
198 210
 		    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
199 211
 <?php
200 212
 		}
@@ -250,7 +262,12 @@  discard block
 block discarded – undo
250 262
 <?php
251 263
 		} else {
252 264
 ?>
253
-			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
265
+			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
266
+	print $archiveupdatetime*1000;
267
+} else {
268
+	print $globalMapRefresh*1000+20000;
269
+}
270
+?>+feature.properties.sqt*1000);
254 271
 			    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
255 272
 <?php
256 273
 		}
@@ -305,7 +322,12 @@  discard block
 block discarded – undo
305 322
 <?php
306 323
 		} else {
307 324
 ?>
308
-			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
325
+			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
326
+	print $archiveupdatetime*1000;
327
+} else {
328
+	print $globalMapRefresh*1000+20000;
329
+}
330
+?>+feature.properties.sqt*1000);
309 331
 			    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
310 332
 <?php
311 333
 		}
@@ -600,14 +622,24 @@  discard block
 block discarded – undo
600 622
 	if (isset($archive) && $archive) {
601 623
 ?>
602 624
 //then load it again every 30 seconds
603
-//  var reload = setInterval(function(){if (noTimeout) getLiveSatelliteData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>);
625
+//  var reload = setInterval(function(){if (noTimeout) getLiveSatelliteData(0)},<?php if (isset($globalMapRefresh)) {
626
+	print ($globalMapRefresh*1000)/2;
627
+} else {
628
+	print '15000';
629
+}
630
+?>);
604 631
 reloadSatellitePage = setInterval(function(){if (noTimeout) getLiveSatelliteData(0)},<?php print $archiveupdatetime*1000; ?>);
605 632
 <?php
606 633
 	} else {
607 634
 ?>
608 635
 //then load it again every 30 seconds
609 636
 reloadSatellitePage = setInterval(
610
-    function(){if (noTimeout) getLiveSatelliteData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>);
637
+    function(){if (noTimeout) getLiveSatelliteData(0)},<?php if (isset($globalMapRefresh)) {
638
+	print $globalMapRefresh*1000;
639
+} else {
640
+	print '30000';
641
+}
642
+?>);
611 643
 <?php
612 644
 	}
613 645
 ?>
Please login to merge, or discard this patch.
js/map-tracker.2d.js.php 1 patch
Braces   +42 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,8 +5,11 @@  discard block
 block discarded – undo
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
 ?>
11 14
 
12 15
 
@@ -157,9 +160,13 @@  discard block
 block discarded – undo
157 160
 		    if (callsign != ""){ markerTrackerLabel += callsign; }
158 161
 		    if (type != ""){ markerTrackerLabel += ' - '+type; }
159 162
 <?php
160
-	if (isset($_COOKIE['TrackerIconColor'])) $IconColor = $_COOKIE['TrackerIconColor'];
161
-	elseif (isset($globalTrackerIconColor)) $IconColor = $globalTrackerIconColor;
162
-	else $IconColor = '1a3151';
163
+	if (isset($_COOKIE['TrackerIconColor'])) {
164
+		$IconColor = $_COOKIE['TrackerIconColor'];
165
+	} elseif (isset($globalTrackerIconColor)) {
166
+		$IconColor = $globalTrackerIconColor;
167
+	} else {
168
+		$IconColor = '1a3151';
169
+	}
163 170
 	if (!isset($ident) && !isset($famtrackid)) {
164 171
 ?>
165 172
 		    //info_tracker_update(feature.properties.fc);
@@ -193,7 +200,12 @@  discard block
 block discarded – undo
193 200
 <?php
194 201
 		} else {
195 202
 ?>
196
-		    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
203
+		    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
204
+	print $archiveupdatetime*1000;
205
+} else {
206
+	print $globalMapRefresh*1000+20000;
207
+}
208
+?>+feature.properties.sqt*1000);
197 209
 		    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
198 210
 <?php
199 211
 		}
@@ -249,7 +261,12 @@  discard block
 block discarded – undo
249 261
 <?php
250 262
 		} else {
251 263
 ?>
252
-			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
264
+			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
265
+	print $archiveupdatetime*1000;
266
+} else {
267
+	print $globalMapRefresh*1000+20000;
268
+}
269
+?>+feature.properties.sqt*1000);
253 270
 			    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
254 271
 <?php
255 272
 		}
@@ -304,7 +321,12 @@  discard block
 block discarded – undo
304 321
 <?php
305 322
 		} else {
306 323
 ?>
307
-			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
324
+			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
325
+	print $archiveupdatetime*1000;
326
+} else {
327
+	print $globalMapRefresh*1000+20000;
328
+}
329
+?>+feature.properties.sqt*1000);
308 330
 			    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
309 331
 <?php
310 332
 		}
@@ -595,14 +617,24 @@  discard block
 block discarded – undo
595 617
 	if (isset($archive) && $archive) {
596 618
 ?>
597 619
 //then load it again every 30 seconds
598
-//  var reload = setInterval(function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>);
620
+//  var reload = setInterval(function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) {
621
+	print ($globalMapRefresh*1000)/2;
622
+} else {
623
+	print '15000';
624
+}
625
+?>);
599 626
 reloadTrackerPage = setInterval(function(){if (noTimeout) getLiveTrackerData(0)},<?php print $archiveupdatetime*1000; ?>);
600 627
 <?php
601 628
 	} else {
602 629
 ?>
603 630
 //then load it again every 30 seconds
604 631
 reloadTrackerPage = setInterval(
605
-    function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>);
632
+    function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) {
633
+	print $globalMapRefresh*1000;
634
+} else {
635
+	print '30000';
636
+}
637
+?>);
606 638
 <?php
607 639
 	}
608 640
 ?>
Please login to merge, or discard this patch.
index.php 1 patch
Braces   +437 added lines, -110 removed lines patch added patch discarded remove patch
@@ -162,11 +162,26 @@  discard block
 block discarded – undo
162 162
 				<li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam();" /><?php echo _("Display NOTAM"); ?></label></div></li>
163 163
 				<li><?php echo _("NOTAM scope:"); ?>
164 164
 					<select class="selectpicker" onchange="notamscope(this);">
165
-						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') print ' selected'; ?>>All</option>
166
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') print ' selected'; ?>>Airport/Enroute warning</option>
167
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') print ' selected'; ?>>Airport warning</option>
168
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') print ' selected'; ?>>Navigation warning</option>
169
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') print ' selected'; ?>>Enroute warning</option>
165
+						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') {
166
+	print ' selected';
167
+}
168
+?>>All</option>
169
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') {
170
+	print ' selected';
171
+}
172
+?>>Airport/Enroute warning</option>
173
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') {
174
+	print ' selected';
175
+}
176
+?>>Airport warning</option>
177
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') {
178
+	print ' selected';
179
+}
180
+?>>Navigation warning</option>
181
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') {
182
+	print ' selected';
183
+}
184
+?>>Enroute warning</option>
170 185
 					</select
171 186
 				</li>
172 187
 			</ul>
@@ -194,7 +209,12 @@  discard block
 block discarded – undo
194 209
 		        <div class="form-group">
195 210
 			    <label>From (UTC):</label>
196 211
 		            <div class='input-group date' id='datetimepicker1'>
197
-            			<input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) print $_POST['start_date']; elseif (isset($_COOKIE['archive_begin'])) print date("m/d/Y h:i a",$_COOKIE['archive_begin']); ?>" required />
212
+            			<input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) {
213
+	print $_POST['start_date'];
214
+} elseif (isset($_COOKIE['archive_begin'])) {
215
+	print date("m/d/Y h:i a",$_COOKIE['archive_begin']);
216
+}
217
+?>" required />
198 218
 		                <span class="input-group-addon">
199 219
             			    <span class="glyphicon glyphicon-calendar"></span>
200 220
 		                </span>
@@ -203,7 +223,12 @@  discard block
 block discarded – undo
203 223
 		        <div class="form-group">
204 224
 			    <label>To (UTC):</label>
205 225
 		            <div class='input-group date' id='datetimepicker2'>
206
-		                <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) print $_POST['end_date']; elseif (isset($_COOKIE['archive_end'])) print date("m/d/Y h:i a",$_COOKIE['archive_end']); ?>" />
226
+		                <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) {
227
+	print $_POST['end_date'];
228
+} elseif (isset($_COOKIE['archive_end'])) {
229
+	print date("m/d/Y h:i a",$_COOKIE['archive_end']);
230
+}
231
+?>" />
207 232
             			<span class="input-group-addon">
208 233
 		                    <span class="glyphicon glyphicon-calendar"></span>
209 234
             			</span>
@@ -229,8 +254,20 @@  discard block
 block discarded – undo
229 254
 
230 255
 		    <li><?php echo _("Playback speed:"); ?>
231 256
 			<div class="range">
232
-			    <input type="range" min="0" max="50" step="1" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php  if (isset($_POST['archivespeed'])) print $_POST['archivespeed']; elseif (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?>">
233
-			    <output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?></output>
257
+			    <input type="range" min="0" max="50" step="1" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php  if (isset($_POST['archivespeed'])) {
258
+	print $_POST['archivespeed'];
259
+} elseif (isset($_COOKIE['archive_speed'])) {
260
+	print $_COOKIE['archive_speed'];
261
+} else {
262
+	print '1';
263
+}
264
+?>">
265
+			    <output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) {
266
+	print $_COOKIE['archive_speed'];
267
+} else {
268
+	print '1';
269
+}
270
+?></output>
234 271
 			</div>
235 272
 		    </li>
236 273
 		    <li><input type="submit" name="archive" value="Show archive" class="btn btn-primary" /></li>
@@ -252,15 +289,27 @@  discard block
 block discarded – undo
252 289
 		    <li><?php echo _("Type of Map:"); ?>
253 290
 			<select  class="selectpicker" onchange="mapType(this);">
254 291
 			    <?php
255
-				if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider;
256
-				else $MapType = $_COOKIE['MapType'];
292
+				if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') {
293
+					$MapType = $globalMapProvider;
294
+				} else {
295
+					$MapType = $_COOKIE['MapType'];
296
+				}
257 297
 			    ?>
258 298
 			    <?php
259 299
 				if (isset($globalBingMapKey) && $globalBingMapKey != '') {
260 300
 			    ?>
261
-			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option>
262
-			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option>
263
-			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option>
301
+			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') {
302
+	print ' selected';
303
+}
304
+?>>Bing-Aerial</option>
305
+			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') {
306
+	print ' selected';
307
+}
308
+?>>Bing-Hybrid</option>
309
+			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') {
310
+	print ' selected';
311
+}
312
+?>>Bing-Road</option>
264 313
 			    <?php
265 314
 				}
266 315
 			    ?>
@@ -270,56 +319,131 @@  discard block
 block discarded – undo
270 319
 			    <?php
271 320
 				    if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
272 321
 			    ?>
273
-			    <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option>
274
-			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option>
275
-			    <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option>
322
+			    <option value="Here-Aerial"<?php if ($MapType == 'Here') {
323
+	print ' selected';
324
+}
325
+?>>Here-Aerial</option>
326
+			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') {
327
+	print ' selected';
328
+}
329
+?>>Here-Hybrid</option>
330
+			    <option value="Here-Road"<?php if ($MapType == 'Here') {
331
+	print ' selected';
332
+}
333
+?>>Here-Road</option>
276 334
 			    <?php
277 335
 				    }
278 336
 			    ?>
279 337
 			    <?php
280 338
 				    if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
281 339
 			    ?>
282
-			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option>
283
-			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option>
284
-			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option>
285
-			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option>
340
+			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') {
341
+	print ' selected';
342
+}
343
+?>>Google Roadmap</option>
344
+			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') {
345
+	print ' selected';
346
+}
347
+?>>Google Satellite</option>
348
+			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') {
349
+	print ' selected';
350
+}
351
+?>>Google Hybrid</option>
352
+			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') {
353
+	print ' selected';
354
+}
355
+?>>Google Terrain</option>
286 356
 			    <?php
287 357
 				    }
288 358
 			    ?>
289 359
 			    <?php
290 360
 				    if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
291 361
 			    ?>
292
-			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option>
293
-			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option>
294
-			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option>
362
+			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') {
363
+	print ' selected';
364
+}
365
+?>>MapQuest-OSM</option>
366
+			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') {
367
+	print ' selected';
368
+}
369
+?>>MapQuest-Aerial</option>
370
+			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') {
371
+	print ' selected';
372
+}
373
+?>>MapQuest-Hybrid</option>
295 374
 			    <?php
296 375
 				    }
297 376
 			    ?>
298
-			    <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option>
377
+			    <option value="Yandex"<?php if ($MapType == 'Yandex') {
378
+	print ' selected';
379
+}
380
+?>>Yandex</option>
299 381
 			    <?php
300 382
 				}
301 383
 			    ?>
302 384
 			    <?php
303 385
 				    if (isset($globalMapboxToken) && $globalMapboxToken != '') {
304
-					if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default';
305
-					else $MapBoxId = $_COOKIE['MapTypeId'];
386
+					if (!isset($_COOKIE['MapTypeId'])) {
387
+						$MapBoxId = 'default';
388
+					} else {
389
+						$MapBoxId = $_COOKIE['MapTypeId'];
390
+					}
306 391
 			    ?>
307
-			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option>
308
-			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option>
309
-			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option>
310
-			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') print ' selected'; ?>>Mapbox dark</option>
311
-			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') print ' selected'; ?>>Mapbox satellite</option>
312
-			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') print ' selected'; ?>>Mapbox streets-satellite</option>
313
-			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') print ' selected'; ?>>Mapbox streets-basic</option>
314
-			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') print ' selected'; ?>>Mapbox comic</option>
315
-			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') print ' selected'; ?>>Mapbox outdoors</option>
316
-			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') print ' selected'; ?>>Mapbox pencil</option>
317
-			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option>
318
-			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option>
392
+			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') {
393
+	print ' selected';
394
+}
395
+?>>Mapbox default</option>
396
+			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') {
397
+	print ' selected';
398
+}
399
+?>>Mapbox streets</option>
400
+			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') {
401
+	print ' selected';
402
+}
403
+?>>Mapbox light</option>
404
+			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') {
405
+	print ' selected';
406
+}
407
+?>>Mapbox dark</option>
408
+			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') {
409
+	print ' selected';
410
+}
411
+?>>Mapbox satellite</option>
412
+			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') {
413
+	print ' selected';
414
+}
415
+?>>Mapbox streets-satellite</option>
416
+			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') {
417
+	print ' selected';
418
+}
419
+?>>Mapbox streets-basic</option>
420
+			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') {
421
+	print ' selected';
422
+}
423
+?>>Mapbox comic</option>
424
+			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') {
425
+	print ' selected';
426
+}
427
+?>>Mapbox outdoors</option>
428
+			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') {
429
+	print ' selected';
430
+}
431
+?>>Mapbox pencil</option>
432
+			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') {
433
+	print ' selected';
434
+}
435
+?>>Mapbox pirates</option>
436
+			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') {
437
+	print ' selected';
438
+}
439
+?>>Mapbox emerald</option>
319 440
 			    <?php
320 441
 				    }
321 442
 			    ?>
322
-			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option>
443
+			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') {
444
+	print ' selected';
445
+}
446
+?>>OpenStreetMap</option>
323 447
 			</select>
324 448
 		    </li>
325 449
 <?php
@@ -327,10 +451,22 @@  discard block
 block discarded – undo
327 451
 ?>
328 452
 		    <li><?php echo _("Type of Terrain:"); ?>
329 453
 			<select  class="selectpicker" onchange="terrainType(this);">
330
-			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option>
331
-			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option>
332
-			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option>
333
-			    <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected';?>>ArticDEM</option>
454
+			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') {
455
+	print ' selected';
456
+}
457
+?>>stk terrain</option>
458
+			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') {
459
+	print ' selected';
460
+}
461
+?>>ellipsoid</option>
462
+			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') {
463
+	print ' selected';
464
+}
465
+?>>vr terrain</option>
466
+			    <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') {
467
+	print ' selected';
468
+}
469
+?>>ArticDEM</option>
334 470
 			</select>
335 471
 		    </li>
336 472
 <?php
@@ -342,28 +478,61 @@  discard block
 block discarded – undo
342 478
 <?php
343 479
 	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
344 480
 ?>
345
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') print 'checked'; ?> ><?php echo _("Display flight info as popup"); ?></label></div></li>
346
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) print 'checked'; ?> ><?php echo _("Display flight path"); ?></label></div></li>
347
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (isset($globalMapRoute) && $globalMapRoute)) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li>
348
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || !isset($_COOKIE['MapRemainingRoute']) || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) print 'checked'; ?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li>
349
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
481
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') {
482
+	print 'checked';
483
+}
484
+?> ><?php echo _("Display flight info as popup"); ?></label></div></li>
485
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) {
486
+	print 'checked';
487
+}
488
+?> ><?php echo _("Display flight path"); ?></label></div></li>
489
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (isset($globalMapRoute) && $globalMapRoute)) {
490
+	print 'checked';
491
+}
492
+?> ><?php echo _("Display flight route on click"); ?></label></div></li>
493
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || !isset($_COOKIE['MapRemainingRoute']) || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) {
494
+	print 'checked';
495
+}
496
+?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li>
497
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) {
498
+	print 'checked';
499
+}
500
+?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
350 501
 <?php
351 502
 	}
352 503
 	if (isset($globalSatellite) && $globalSatellite === TRUE) {
353 504
 ?>
354
-		    <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Satellites animate between updates"); ?></label></div></li>
505
+		    <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) {
506
+	print 'checked';
507
+}
508
+?> ><?php echo _("Satellites animate between updates"); ?></label></div></li>
355 509
 <?php
356 510
 	}
357 511
     }
358 512
 ?>
359
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li>
360
-		    <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) print 'checked'; ?> ><?php echo _("Display ground station on map"); ?></label></div></li>
361
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (!isset($globalMapWeatherStation) || $globalMapWeatherStation === TRUE))) print 'checked'; ?> ><?php echo _("Display weather station on map"); ?></label></div></li>
362
-		    <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (!isset($globalMapLightning) || $globalMapLightning === TRUE))) print 'checked'; ?> ><?php echo _("Display lightning on map"); ?></label></div></li>
513
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) {
514
+	print 'checked';
515
+}
516
+?> ><?php echo _("Display airports on map"); ?></label></div></li>
517
+		    <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) {
518
+	print 'checked';
519
+}
520
+?> ><?php echo _("Display ground station on map"); ?></label></div></li>
521
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (!isset($globalMapWeatherStation) || $globalMapWeatherStation === TRUE))) {
522
+	print 'checked';
523
+}
524
+?> ><?php echo _("Display weather station on map"); ?></label></div></li>
525
+		    <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (!isset($globalMapLightning) || $globalMapLightning === TRUE))) {
526
+	print 'checked';
527
+}
528
+?> ><?php echo _("Display lightning on map"); ?></label></div></li>
363 529
 <?php
364 530
     if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
365 531
 ?>
366
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li>
532
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) {
533
+	print 'checked';
534
+}
535
+?> ><?php echo _("Show mini-map"); ?></label></div></li>
367 536
 <?php
368 537
     }
369 538
     if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) {
@@ -377,17 +546,25 @@  discard block
 block discarded – undo
377 546
 			if (function_exists('array_column')) {
378 547
 			    if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
379 548
 		    ?>
380
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
549
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
550
+	print 'checked';
551
+}
552
+?> ><?php echo _("Display polar on map"); ?></label></div></li>
381 553
 		    <?php
382 554
 			    }
383 555
 			} elseif (isset($globalSources)) {
384 556
 			    $dispolar = false;
385 557
 			    foreach ($globalSources as $testsource) {
386
-			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
558
+			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) {
559
+			        	$dispolar = true;
560
+			        }
387 561
 			    }
388 562
 			    if ($dispolar) {
389 563
 		    ?>
390
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
564
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
565
+	print 'checked';
566
+}
567
+?> ><?php echo _("Display polar on map"); ?></label></div></li>
391 568
 		    <?php
392 569
 			    }
393 570
 		        }
@@ -400,12 +577,22 @@  discard block
 block discarded – undo
400 577
 			if (!isset($globalAircraft) || $globalAircraft === TRUE) {
401 578
 		    	    if (extension_loaded('gd') && function_exists('gd_info')) {
402 579
 		    ?>
403
-		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
580
+		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') {
581
+	print 'checked';
582
+}
583
+?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
404 584
 		    <?php 
405 585
 				if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') {
406 586
 		    ?>
407 587
 		    <li><?php echo _("Aircraft icon color:"); ?>
408
-			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>">
588
+			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) {
589
+	print $_COOKIE['IconColor'];
590
+} elseif (isset($globalAircraftIconColor)) {
591
+	print $globalAircraftIconColor;
592
+} else {
593
+	print '1a3151';
594
+}
595
+?>">
409 596
 		    </li>
410 597
 		    <?php
411 598
 				}
@@ -417,7 +604,14 @@  discard block
 block discarded – undo
417 604
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
418 605
 		    ?>
419 606
 		    <li><?php echo _("Marine icon color:"); ?>
420
-			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>">
607
+			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) {
608
+	print $_COOKIE['MarineIconColor'];
609
+} elseif (isset($globalMarineIconColor)) {
610
+	print $globalMarineIconColor;
611
+} else {
612
+	print '1a3151';
613
+}
614
+?>">
421 615
 		    </li>
422 616
 		    <?php
423 617
 			    }
@@ -428,7 +622,14 @@  discard block
 block discarded – undo
428 622
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
429 623
 		    ?>
430 624
 		    <li><?php echo _("Tracker icon color:"); ?>
431
-			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print '1a3151'; ?>">
625
+			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) {
626
+	print $_COOKIE['TrackerIconColor'];
627
+} elseif (isset($globalTrackerIconColor)) {
628
+	print $globalTrackerIconColor;
629
+} else {
630
+	print '1a3151';
631
+}
632
+?>">
432 633
 		    </li>
433 634
 		    <?php
434 635
 			    }
@@ -439,8 +640,22 @@  discard block
 block discarded – undo
439 640
 		    ?>
440 641
 		    <li><?php echo _("Show airport icon at zoom level:"); ?>
441 642
 			<div class="range">
442
-			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>">
443
-			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?></output>
643
+			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) {
644
+	print $_COOKIE['AirportZoom'];
645
+} elseif (isset($globalAirportZoom)) {
646
+	print $globalAirportZoom;
647
+} else {
648
+	print '7';
649
+}
650
+?>">
651
+			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) {
652
+	print $_COOKIE['AirportZoom'];
653
+} elseif (isset($globalAirportZoom)) {
654
+	print $globalAirportZoom;
655
+} else {
656
+	print '7';
657
+}
658
+?></output>
444 659
 			</div>
445 660
 		    </li>
446 661
 		    <?php
@@ -452,9 +667,19 @@  discard block
 block discarded – undo
452 667
 <?php
453 668
 	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
454 669
 ?>
455
-		    <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Aircraft color"); ?></li>
670
+		    <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') {
671
+	print 'checked';
672
+}
673
+?> ><?php echo _("Force Aircraft color"); ?></li>
456 674
 		    <li><?php echo _("Aircraft icon color:"); ?>
457
-			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print 'ff0000'; ?>">
675
+			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) {
676
+	print $_COOKIE['IconColor'];
677
+} elseif (isset($globalAircraftIconColor)) {
678
+	print $globalAircraftIconColor;
679
+} else {
680
+	print 'ff0000';
681
+}
682
+?>">
458 683
 		    </li>
459 684
 <?php
460 685
 	}
@@ -462,9 +687,19 @@  discard block
 block discarded – undo
462 687
 <?php
463 688
 	if (isset($globalMarine) && $globalMarine === TRUE) {
464 689
 ?>
465
-		    <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Marine color"); ?></li>
690
+		    <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') {
691
+	print 'checked';
692
+}
693
+?> ><?php echo _("Force Marine color"); ?></li>
466 694
 		    <li><?php echo _("Marine icon color:"); ?>
467
-			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print 'ff0000'; ?>">
695
+			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) {
696
+	print $_COOKIE['MarineIconColor'];
697
+} elseif (isset($globalMarineIconColor)) {
698
+	print $globalMarineIconColor;
699
+} else {
700
+	print 'ff0000';
701
+}
702
+?>">
468 703
 		    </li>
469 704
 <?php
470 705
 	}
@@ -472,9 +707,19 @@  discard block
 block discarded – undo
472 707
 <?php
473 708
 	if (isset($globalTracker) && $globalTracker === TRUE) {
474 709
 ?>
475
-		    <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Tracker color"); ?></li>
710
+		    <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') {
711
+	print 'checked';
712
+}
713
+?> ><?php echo _("Force Tracker color"); ?></li>
476 714
 		    <li><?php echo _("Tracker icon color:"); ?>
477
-			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print 'ff0000'; ?>">
715
+			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) {
716
+	print $_COOKIE['TrackerIconColor'];
717
+} elseif (isset($globalTrackerIconColor)) {
718
+	print $globalTrackerIconColor;
719
+} else {
720
+	print 'ff0000';
721
+}
722
+?>">
478 723
 		    </li>
479 724
 <?php
480 725
 	}
@@ -482,22 +727,46 @@  discard block
 block discarded – undo
482 727
 ?>
483 728
 		    <li><?php echo _("Distance unit:"); ?>
484 729
 			<select class="selectpicker" onchange="unitdistance(this);">
485
-			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) echo ' selected'; ?>>km</option>
486
-			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) echo ' selected'; ?>>nm</option>
487
-			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) echo ' selected'; ?>>mi</option>
730
+			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
731
+	echo ' selected';
732
+}
733
+?>>km</option>
734
+			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
735
+	echo ' selected';
736
+}
737
+?>>nm</option>
738
+			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
739
+	echo ' selected';
740
+}
741
+?>>mi</option>
488 742
 		        </select>
489 743
 		    </li>
490 744
 		    <li><?php echo _("Altitude unit:"); ?>
491 745
 			<select class="selectpicker" onchange="unitaltitude(this);">
492
-			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) echo ' selected'; ?>>m</option>
493
-			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) echo ' selected'; ?>>feet</option>
746
+			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) {
747
+	echo ' selected';
748
+}
749
+?>>m</option>
750
+			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
751
+	echo ' selected';
752
+}
753
+?>>feet</option>
494 754
 		        </select>
495 755
 		    </li>
496 756
 		    <li><?php echo _("Speed unit:"); ?>
497 757
 			<select class="selectpicker" onchange="unitspeed(this);">
498
-			    <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) echo ' selected'; ?>>km/h</option>
499
-			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) echo ' selected'; ?>>mph</option>
500
-			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) echo ' selected'; ?>>knots</option>
758
+			    <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) {
759
+	echo ' selected';
760
+}
761
+?>>km/h</option>
762
+			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) {
763
+	echo ' selected';
764
+}
765
+?>>mph</option>
766
+			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) {
767
+	echo ' selected';
768
+}
769
+?>>knots</option>
501 770
 		        </select>
502 771
 		    </li>
503 772
 
@@ -515,9 +784,18 @@  discard block
 block discarded – undo
515 784
 		    <?php
516 785
 			if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) {
517 786
 		    ?>
518
-			<?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
519
-			<?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
520
-			<?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
787
+			<?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) {
788
+	print 'checked';
789
+}
790
+?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
791
+			<?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) {
792
+	print 'checked';
793
+}
794
+?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
795
+			<?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) {
796
+	print 'checked';
797
+}
798
+?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
521 799
 		    <?php
522 800
 			}
523 801
 		    ?>
@@ -525,10 +803,16 @@  discard block
 block discarded – undo
525 803
 			if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) {
526 804
 		    ?>
527 805
 			<?php if (isset($globalSBS1) && $globalSBS1) { ?>
528
-			    <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
806
+			    <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) {
807
+	print 'checked';
808
+}
809
+?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
529 810
 			<?php } ?>
530 811
 			<?php if (isset($globalAPRS) && $globalAPRS) { ?>
531
-			    <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) print 'checked'; ?> ><?php echo _("Display APRS data"); ?></label></div></li>
812
+			    <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) {
813
+	print 'checked';
814
+}
815
+?> ><?php echo _("Display APRS data"); ?></label></div></li>
532 816
 			<?php } ?>
533 817
 		    <?php
534 818
 			}
@@ -545,7 +829,9 @@  discard block
 block discarded – undo
545 829
 				}
546 830
 				foreach($allairlinenames as $airline) {
547 831
 					$airline_name = $airline['airline_name'];
548
-					if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...';
832
+					if (strlen($airline_name) > 30) {
833
+						$airline_name = substr($airline_name,0,30).'...';
834
+					}
549 835
 					if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) {
550 836
 						echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>';
551 837
 					} else {
@@ -563,7 +849,10 @@  discard block
 block discarded – undo
563 849
 		    <li><?php echo _("Display alliance:"); ?>
564 850
 		    <br/>
565 851
 			<select class="selectpicker" onchange="alliance(this);" id="display_alliance">
566
-			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
852
+			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') {
853
+	echo ' selected';
854
+}
855
+?>><?php echo _("All"); ?></option>
567 856
 			    <?php
568 857
 				foreach($allalliancenames as $alliance) {
569 858
 					$alliance_name = $alliance['alliance'];
@@ -610,10 +899,22 @@  discard block
 block discarded – undo
610 899
 		    ?>
611 900
 		    <li><?php echo _("Display airlines of type:"); ?><br/>
612 901
 			<select class="selectpicker" onchange="airlinestype(this);">
613
-			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
614
-			    <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') echo ' selected'; ?>><?php echo _("Passenger"); ?></option>
615
-			    <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') echo ' selected'; ?>><?php echo _("Cargo"); ?></option>
616
-			    <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') echo ' selected'; ?>><?php echo _("Military"); ?></option>
902
+			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') {
903
+	echo ' selected';
904
+}
905
+?>><?php echo _("All"); ?></option>
906
+			    <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') {
907
+	echo ' selected';
908
+}
909
+?>><?php echo _("Passenger"); ?></option>
910
+			    <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') {
911
+	echo ' selected';
912
+}
913
+?>><?php echo _("Cargo"); ?></option>
914
+			    <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') {
915
+	echo ' selected';
916
+}
917
+?>><?php echo _("Military"); ?></option>
617 918
 			</select>
618 919
 		    </li>
619 920
 		    <?php
@@ -621,7 +922,10 @@  discard block
 block discarded – undo
621 922
 		    ?>
622 923
 		    <li>
623 924
 			<?php echo _("Display flight with ident:"); ?>
624
-			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" />
925
+			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) {
926
+	print $_COOKIE['filter_ident'];
927
+}
928
+?>" />
625 929
 		    </li>
626 930
 		    <?php
627 931
 			}
@@ -640,7 +944,10 @@  discard block
 block discarded – undo
640 944
 	    <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
641 945
 	    <form>
642 946
 		<ul>
643
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if (isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') print 'checked'; ?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li>
947
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if (isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') {
948
+	print 'checked';
949
+}
950
+?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li>
644 951
 		    <li><?php echo _("Type:"); ?>
645 952
 			<select class="selectpicker" multiple onchange="sattypes(this);">
646 953
 			    <?php
@@ -648,25 +955,45 @@  discard block
 block discarded – undo
648 955
 				$types = $Satellite->get_tle_types();
649 956
 				foreach ($types as $type) {
650 957
 					$type_name = $type['tle_type'];
651
-					if ($type_name == 'musson') $type_name = 'Russian LEO Navigation';
652
-					else if ($type_name == 'nnss') $type_name = 'Navi Navigation Satellite System';
653
-					else if ($type_name == 'sbas') $type_name = 'Satellite-Based Augmentation System';
654
-					else if ($type_name == 'glo-ops') $type_name = 'Glonass Operational';
655
-					else if ($type_name == 'gps-ops') $type_name = 'GPS Operational';
656
-					else if ($type_name == 'argos') $type_name = 'ARGOS Data Collection System';
657
-					else if ($type_name == 'tdrss') $type_name = 'Tracking and Data Relay Satellite System';
658
-					else if ($type_name == 'sarsat') $type_name = 'Search & Rescue';
659
-					else if ($type_name == 'dmc') $type_name = 'Disaster Monitoring';
660
-					else if ($type_name == 'resource') $type_name = 'Earth Resources';
661
-					else if ($type_name == 'stations') $type_name = 'Space Stations';
662
-					else if ($type_name == 'geo') $type_name = 'Geostationary';
663
-					else if ($type_name == 'amateur') $type_name = 'Amateur Radio';
664
-					else if ($type_name == 'x-comm') $type_name = 'Experimental';
665
-					else if ($type_name == 'other-comm') $type_name = 'Other Comm';
666
-					else if ($type_name == 'science') $type_name = 'Space & Earth Science';
667
-					else if ($type_name == 'military') $type_name = 'Miscellaneous Military';
668
-					else if ($type_name == 'radar') $type_name = 'Radar Calibration';
669
-					else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches';
958
+					if ($type_name == 'musson') {
959
+						$type_name = 'Russian LEO Navigation';
960
+					} else if ($type_name == 'nnss') {
961
+						$type_name = 'Navi Navigation Satellite System';
962
+					} else if ($type_name == 'sbas') {
963
+						$type_name = 'Satellite-Based Augmentation System';
964
+					} else if ($type_name == 'glo-ops') {
965
+						$type_name = 'Glonass Operational';
966
+					} else if ($type_name == 'gps-ops') {
967
+						$type_name = 'GPS Operational';
968
+					} else if ($type_name == 'argos') {
969
+						$type_name = 'ARGOS Data Collection System';
970
+					} else if ($type_name == 'tdrss') {
971
+						$type_name = 'Tracking and Data Relay Satellite System';
972
+					} else if ($type_name == 'sarsat') {
973
+						$type_name = 'Search & Rescue';
974
+					} else if ($type_name == 'dmc') {
975
+						$type_name = 'Disaster Monitoring';
976
+					} else if ($type_name == 'resource') {
977
+						$type_name = 'Earth Resources';
978
+					} else if ($type_name == 'stations') {
979
+						$type_name = 'Space Stations';
980
+					} else if ($type_name == 'geo') {
981
+						$type_name = 'Geostationary';
982
+					} else if ($type_name == 'amateur') {
983
+						$type_name = 'Amateur Radio';
984
+					} else if ($type_name == 'x-comm') {
985
+						$type_name = 'Experimental';
986
+					} else if ($type_name == 'other-comm') {
987
+						$type_name = 'Other Comm';
988
+					} else if ($type_name == 'science') {
989
+						$type_name = 'Space & Earth Science';
990
+					} else if ($type_name == 'military') {
991
+						$type_name = 'Miscellaneous Military';
992
+					} else if ($type_name == 'radar') {
993
+						$type_name = 'Radar Calibration';
994
+					} else if ($type_name == 'tle-new') {
995
+						$type_name = 'Last 30 days launches';
996
+					}
670 997
 					
671 998
 					if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) {
672 999
 						print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>';
Please login to merge, or discard this patch.
live-geojson.php 1 patch
Braces   +282 added lines, -111 removed lines patch added patch discarded remove patch
@@ -48,27 +48,52 @@  discard block
 block discarded – undo
48 48
 }
49 49
 header('Content-Type: text/javascript');
50 50
 
51
-if (!isset($globalJsonCompress)) $compress = true;
52
-else $compress = $globalJsonCompress;
51
+if (!isset($globalJsonCompress)) {
52
+	$compress = true;
53
+} else {
54
+	$compress = $globalJsonCompress;
55
+}
53 56
 
54 57
 $from_archive = false;
55 58
 $min = true;
56 59
 $allhistory = false;
57 60
 $filter['source'] = array();
58
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
59
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
60
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
61
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
62
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
63
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
64
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
65
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
66
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
67
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
61
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') {
62
+	$filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
63
+}
64
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') {
65
+	$filter['source'] = array_merge($filter['source'],array('whazzup'));
66
+}
67
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') {
68
+	$filter['source'] = array_merge($filter['source'],array('phpvmacars'));
69
+}
70
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') {
71
+	$filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
72
+}
73
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') {
74
+	$filter['source'] = array_merge($filter['source'],array('aprs'));
75
+}
76
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') {
77
+	$filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
78
+}
79
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') {
80
+	$filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
81
+}
82
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') {
83
+	$filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
84
+}
85
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') {
86
+	$filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
87
+}
88
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') {
89
+	$filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
90
+}
68 91
 
69 92
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
70 93
 	$min = true;
71
-} else $min = false;
94
+} else {
95
+	$min = false;
96
+}
72 97
 
73 98
 if (isset($_GET['ident'])) {
74 99
 	$ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING));
@@ -165,15 +190,21 @@  discard block
 block discarded – undo
165 190
 $flightcnt = 0;
166 191
 $sqltime = round(microtime(true)-$begintime,2);
167 192
 
168
-if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false;
169
-else $usenextlatlon = true;
193
+if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) {
194
+	$usenextlatlon = false;
195
+} else {
196
+	$usenextlatlon = true;
197
+}
170 198
 $j = 0;
171 199
 $prev_flightaware_id = '';
172 200
 $aircrafts_shadow = array();
173 201
 $output = '{';
174 202
 	$output .= '"type": "FeatureCollection",';
175
-		if ($min) $output .= '"minimal": "true",';
176
-		else $output .= '"minimal": "false",';
203
+		if ($min) {
204
+			$output .= '"minimal": "true",';
205
+		} else {
206
+			$output .= '"minimal": "false",';
207
+		}
177 208
 		//$output .= '"fc": "'.$flightcnt.'",';
178 209
 		$output .= '"sqt": "'.$sqltime.'",';
179 210
 
@@ -217,18 +248,29 @@  discard block
 block discarded – undo
217 248
 						}
218 249
 						$output .= '"properties": {';
219 250
 						if (isset($spotter_item['flightaware_id'])) {
220
-							if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",';
221
-							else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",';
251
+							if ($compress) {
252
+								$output .= '"fi": "'.$spotter_item['flightaware_id'].'",';
253
+							} else {
254
+								$output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",';
255
+							}
222 256
 						} elseif (isset($spotter_item['famtrackid'])) {
223
-							if ($compress) $output .= '"fti": "'.$spotter_item['famtrackid'].'",';
224
-							else $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",';
257
+							if ($compress) {
258
+								$output .= '"fti": "'.$spotter_item['famtrackid'].'",';
259
+							} else {
260
+								$output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",';
261
+							}
225 262
 						} elseif (isset($spotter_item['fammarine_id'])) {
226
-							if ($compress) $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",';
227
-							else $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",';
263
+							if ($compress) {
264
+								$output .= '"fmi": "'.$spotter_item['fammarine_id'].'",';
265
+							} else {
266
+								$output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",';
267
+							}
228 268
 						}
229 269
 							$output .= '"fc": "'.$flightcnt.'",';
230 270
 							$output .= '"sqt": "'.$sqltime.'",';
231
-							if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
271
+							if (isset($begindate)) {
272
+								$output .= '"archive_date": "'.$begindate.'",';
273
+							}
232 274
 
233 275
 /*
234 276
 							if ($min) $output .= '"minimal": "true",';
@@ -236,14 +278,22 @@  discard block
 block discarded – undo
236 278
 */
237 279
 							//$output .= '"fc": "'.$spotter_item['nb'].'",';
238 280
 						if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') {
239
-							if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",';
240
-							else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",';
281
+							if ($compress) {
282
+								$output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",';
283
+							} else {
284
+								$output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",';
285
+							}
241 286
 							//"
242 287
 						} else {
243
-							if ($compress) $output .= '"c": "NA",';
244
-							else $output .= '"callsign": "NA",';
288
+							if ($compress) {
289
+								$output .= '"c": "NA",';
290
+							} else {
291
+								$output .= '"callsign": "NA",';
292
+							}
293
+						}
294
+						if (isset($spotter_item['registration'])) {
295
+							$output .= '"registration": "'.$spotter_item['registration'].'",';
245 296
 						}
246
-						if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",';
247 297
 						if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) {
248 298
 							$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",';
249 299
 							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",';
@@ -256,16 +306,23 @@  discard block
 block discarded – undo
256 306
 							$output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
257 307
 						}
258 308
 						if (!isset($spotter_item['aircraft_shadow']) && !$tracker) {
259
-							if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = '';
260
-							else {
309
+							if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') {
310
+								$spotter_item['aircraft_shadow'] = '';
311
+							} else {
261 312
 								$aircraft_icao = $spotter_item['aircraft_icao'];
262
-								if (isset($aircrafts_shadow[$aircraft_icao])) $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao];
263
-								else {
313
+								if (isset($aircrafts_shadow[$aircraft_icao])) {
314
+									$spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao];
315
+								} else {
264 316
 									$aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']);
265
-									if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow'];
266
-									elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png';
267
-									elseif ($aircraft_icao == 'PARAGLIDER') $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png';
268
-									else $spotter_item['aircraft_shadow'] = '';
317
+									if (count($aircraft_info) > 0) {
318
+										$spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow'];
319
+									} elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') {
320
+										$spotter_item['aircraft_shadow'] = 'PA18.png';
321
+									} elseif ($aircraft_icao == 'PARAGLIDER') {
322
+										$spotter_item['aircraft_shadow'] = 'PARAGLIDER.png';
323
+									} else {
324
+										$spotter_item['aircraft_shadow'] = '';
325
+									}
269 326
 									$aircrafts_shadow[$aircraft_icao] = $spotter_item['aircraft_shadow'];
270 327
 								}
271 328
 							}
@@ -273,73 +330,139 @@  discard block
 block discarded – undo
273 330
 						if (!isset($spotter_item['aircraft_shadow']) || $spotter_item['aircraft_shadow'] == '') {
274 331
 							if ($tracker) {
275 332
 								if (isset($spotter_item['type']) && $spotter_item['type'] == 'Ambulance') {
276
-									if ($compress) $output .= '"as": "ambulance.png",';
277
-									else $output .= '"aircraft_shadow": "ambulance.png",';
333
+									if ($compress) {
334
+										$output .= '"as": "ambulance.png",';
335
+									} else {
336
+										$output .= '"aircraft_shadow": "ambulance.png",';
337
+									}
278 338
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') {
279
-									if ($compress) $output .= '"as": "police.png",';
280
-									else $output .= '"aircraft_shadow": "police.png",';
339
+									if ($compress) {
340
+										$output .= '"as": "police.png",';
341
+									} else {
342
+										$output .= '"aircraft_shadow": "police.png",';
343
+									}
281 344
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') {
282
-									if ($compress) $output .= '"as": "ship.png",';
283
-									else $output .= '"aircraft_shadow": "ship.png",';
345
+									if ($compress) {
346
+										$output .= '"as": "ship.png",';
347
+									} else {
348
+										$output .= '"aircraft_shadow": "ship.png",';
349
+									}
284 350
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') {
285
-									if ($compress) $output .= '"as": "ship.png",';
286
-									else $output .= '"aircraft_shadow": "ship.png",';
351
+									if ($compress) {
352
+										$output .= '"as": "ship.png",';
353
+									} else {
354
+										$output .= '"aircraft_shadow": "ship.png",';
355
+									}
287 356
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') {
288
-									if ($compress) $output .= '"as": "ship.png",';
289
-									else $output .= '"aircraft_shadow": "ship.png",';
357
+									if ($compress) {
358
+										$output .= '"as": "ship.png",';
359
+									} else {
360
+										$output .= '"aircraft_shadow": "ship.png",';
361
+									}
290 362
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') {
291
-									if ($compress) $output .= '"as": "truck.png",';
292
-									else $output .= '"aircraft_shadow": "truck.png",';
363
+									if ($compress) {
364
+										$output .= '"as": "truck.png",';
365
+									} else {
366
+										$output .= '"aircraft_shadow": "truck.png",';
367
+									}
293 368
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') {
294
-									if ($compress) $output .= '"as": "truck.png",';
295
-									else $output .= '"aircraft_shadow": "truck.png",';
369
+									if ($compress) {
370
+										$output .= '"as": "truck.png",';
371
+									} else {
372
+										$output .= '"aircraft_shadow": "truck.png",';
373
+									}
296 374
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') {
297
-									if ($compress) $output .= '"as": "aircraft.png",';
298
-									else $output .= '"aircraft_shadow": "aircraft.png",';
375
+									if ($compress) {
376
+										$output .= '"as": "aircraft.png",';
377
+									} else {
378
+										$output .= '"aircraft_shadow": "aircraft.png",';
379
+									}
299 380
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') {
300
-									if ($compress) $output .= '"as": "aircraft.png",';
301
-									else $output .= '"aircraft_shadow": "aircraft.png",';
381
+									if ($compress) {
382
+										$output .= '"as": "aircraft.png",';
383
+									} else {
384
+										$output .= '"aircraft_shadow": "aircraft.png",';
385
+									}
302 386
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') {
303
-									if ($compress) $output .= '"as": "helico.png",';
304
-									else $output .= '"aircraft_shadow": "helico.png",';
387
+									if ($compress) {
388
+										$output .= '"as": "helico.png",';
389
+									} else {
390
+										$output .= '"aircraft_shadow": "helico.png",';
391
+									}
305 392
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') {
306
-									if ($compress) $output .= '"as": "rail.png",';
307
-									else $output .= '"aircraft_shadow": "rail.png",';
393
+									if ($compress) {
394
+										$output .= '"as": "rail.png",';
395
+									} else {
396
+										$output .= '"aircraft_shadow": "rail.png",';
397
+									}
308 398
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') {
309
-									if ($compress) $output .= '"as": "firetruck.png",';
310
-									else $output .= '"aircraft_shadow": "firetruck.png",';
399
+									if ($compress) {
400
+										$output .= '"as": "firetruck.png",';
401
+									} else {
402
+										$output .= '"aircraft_shadow": "firetruck.png",';
403
+									}
311 404
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') {
312
-									if ($compress) $output .= '"as": "bus.png",';
313
-									else $output .= '"aircraft_shadow": "bus.png",';
405
+									if ($compress) {
406
+										$output .= '"as": "bus.png",';
407
+									} else {
408
+										$output .= '"aircraft_shadow": "bus.png",';
409
+									}
314 410
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') {
315
-									if ($compress) $output .= '"as": "phone.png",';
316
-									else $output .= '"aircraft_shadow": "phone.png",';
411
+									if ($compress) {
412
+										$output .= '"as": "phone.png",';
413
+									} else {
414
+										$output .= '"aircraft_shadow": "phone.png",';
415
+									}
317 416
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') {
318
-									if ($compress) $output .= '"as": "jogger.png",';
319
-									else $output .= '"aircraft_shadow": "jogger.png",';
417
+									if ($compress) {
418
+										$output .= '"as": "jogger.png",';
419
+									} else {
420
+										$output .= '"aircraft_shadow": "jogger.png",';
421
+									}
320 422
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') {
321
-									if ($compress) $output .= '"as": "bike.png",';
322
-									else $output .= '"aircraft_shadow": "bike.png",';
423
+									if ($compress) {
424
+										$output .= '"as": "bike.png",';
425
+									} else {
426
+										$output .= '"aircraft_shadow": "bike.png",';
427
+									}
323 428
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') {
324
-									if ($compress) $output .= '"as": "motorcycle.png",';
325
-									else $output .= '"aircraft_shadow": "motorcycle.png",';
429
+									if ($compress) {
430
+										$output .= '"as": "motorcycle.png",';
431
+									} else {
432
+										$output .= '"aircraft_shadow": "motorcycle.png",';
433
+									}
326 434
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') {
327
-									if ($compress) $output .= '"as": "balloon.png",';
328
-									else $output .= '"aircraft_shadow": "balloon.png",';
435
+									if ($compress) {
436
+										$output .= '"as": "balloon.png",';
437
+									} else {
438
+										$output .= '"aircraft_shadow": "balloon.png",';
439
+									}
329 440
 								} else {
330
-									if ($compress) $output .= '"as": "car.png",';
331
-									else $output .= '"aircraft_shadow": "car.png",';
441
+									if ($compress) {
442
+										$output .= '"as": "car.png",';
443
+									} else {
444
+										$output .= '"aircraft_shadow": "car.png",';
445
+									}
332 446
 								}
333 447
 							} elseif ($marine) {
334
-								if ($compress) $output .= '"as": "ship.png",';
335
-								else $output .= '"aircraft_shadow": "ship.png",';
448
+								if ($compress) {
449
+									$output .= '"as": "ship.png",';
450
+								} else {
451
+									$output .= '"aircraft_shadow": "ship.png",';
452
+								}
336 453
 							} else {
337
-								if ($compress) $output .= '"as": "default.png",';
338
-								else $output .= '"aircraft_shadow": "default.png",';
454
+								if ($compress) {
455
+									$output .= '"as": "default.png",';
456
+								} else {
457
+									$output .= '"aircraft_shadow": "default.png",';
458
+								}
339 459
 							}
340 460
 						} else {
341
-							if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",';
342
-							else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
461
+							if ($compress) {
462
+								$output .= '"as": "'.$spotter_item['aircraft_shadow'].'",';
463
+							} else {
464
+								$output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
465
+							}
343 466
 						}
344 467
 						if (isset($spotter_item['airline_name'])) {
345 468
 							$output .= '"airline_name": "'.$spotter_item['airline_name'].'",';
@@ -347,8 +470,11 @@  discard block
 block discarded – undo
347 470
 							$output .= '"airline_name": "NA",';
348 471
 						}
349 472
 						if (isset($spotter_item['departure_airport'])) {
350
-							if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",';
351
-							else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",';
473
+							if ($compress) {
474
+								$output .= '"dac": "'.$spotter_item['departure_airport'].'",';
475
+							} else {
476
+								$output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",';
477
+							}
352 478
 						}
353 479
 						if (isset($spotter_item['departure_airport_city'])) {
354 480
 							$output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",';
@@ -360,8 +486,11 @@  discard block
 block discarded – undo
360 486
 							$output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",';
361 487
 						}
362 488
 						if (isset($spotter_item['arrival_airport'])) {
363
-							if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",';
364
-							else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",';
489
+							if ($compress) {
490
+								$output .= '"aac": "'.$spotter_item['arrival_airport'].'",';
491
+							} else {
492
+								$output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",';
493
+							}
365 494
 						}
366 495
 						if (isset($spotter_item['arrival_airport_city'])) {
367 496
 							$output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",';
@@ -380,11 +509,17 @@  discard block
 block discarded – undo
380 509
 						}
381 510
 						
382 511
 						if (isset($spotter_item['altitude'])) {
383
-							if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",';
384
-							else $output .= '"altitude": "'.$spotter_item['altitude'].'",';
512
+							if ($compress) {
513
+								$output .= '"a": "'.$spotter_item['altitude'].'",';
514
+							} else {
515
+								$output .= '"altitude": "'.$spotter_item['altitude'].'",';
516
+							}
517
+						}
518
+						if ($compress) {
519
+							$output .= '"h": "'.$spotter_item['heading'].'",';
520
+						} else {
521
+							$output .= '"heading": "'.$spotter_item['heading'].'",';
385 522
 						}
386
-						if ($compress)$output .= '"h": "'.$spotter_item['heading'].'",';
387
-						else $output .= '"heading": "'.$spotter_item['heading'].'",';
388 523
 						
389 524
 						if (isset($archivespeed)) {
390 525
 							$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed);
@@ -394,7 +529,9 @@  discard block
 block discarded – undo
394 529
 							$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
395 530
 						}
396 531
 
397
-						if (!$min) $output .= '"image": "'.$image.'",';
532
+						if (!$min) {
533
+							$output .= '"image": "'.$image.'",';
534
+						}
398 535
 						if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') {
399 536
 							$output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",';
400 537
 						}
@@ -402,8 +539,11 @@  discard block
 block discarded – undo
402 539
 							$output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",';
403 540
 						}
404 541
 						if (isset($spotter_item['squawk'])) {
405
-							if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",';
406
-							else $output .= '"squawk": "'.$spotter_item['squawk'].'",';
542
+							if ($compress) {
543
+								$output .= '"sq": "'.$spotter_item['squawk'].'",';
544
+							} else {
545
+								$output .= '"squawk": "'.$spotter_item['squawk'].'",';
546
+							}
407 547
 						}
408 548
 						if (isset($spotter_item['squawk_usage'])) {
409 549
 							$output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",';
@@ -422,14 +562,23 @@  discard block
 block discarded – undo
422 562
 						}
423 563
 						// type when not aircraft ?
424 564
 						if (isset($spotter_item['type'])) {
425
-							if ($compress) $output .= '"t": "'.$spotter_item['type'].'"';
426
-							else $output .= '"type": "'.$spotter_item['type'].'"';
565
+							if ($compress) {
566
+								$output .= '"t": "'.$spotter_item['type'].'"';
567
+							} else {
568
+								$output .= '"type": "'.$spotter_item['type'].'"';
569
+							}
427 570
 						} elseif ($marine) {
428
-							if ($compress) $output .= '"t": "ship"';
429
-							else $output .= '"type": "ship"';
571
+							if ($compress) {
572
+								$output .= '"t": "ship"';
573
+							} else {
574
+								$output .= '"type": "ship"';
575
+							}
430 576
 						} else {
431
-							if ($compress) $output .= '"t": "aircraft"';
432
-							else $output .= '"type": "aircraft"';
577
+							if ($compress) {
578
+								$output .= '"t": "aircraft"';
579
+							} else {
580
+								$output .= '"type": "aircraft"';
581
+							}
433 582
 						}
434 583
 						$output .= '},';
435 584
 						$output .= '"geometry": {';
@@ -497,7 +646,9 @@  discard block
 block discarded – undo
497 646
 			}
498 647
 */
499 648
 				$history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING);
500
-				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
649
+				if ($history == '' && isset($_COOKIE['history'])) {
650
+					$history = $_COOKIE['history'];
651
+				}
501 652
 				
502 653
 				if (
503 654
 				    (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') 
@@ -541,8 +692,11 @@  discard block
 block discarded – undo
541 692
 									$output_history .= ']}},';
542 693
 									$output .= $output_history;
543 694
 								}
544
-								if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
545
-								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
695
+								if ($compress) {
696
+									$output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
697
+								} else {
698
+									$output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
699
+								}
546 700
 							}
547 701
 							$output_history .= '[';
548 702
 							$output_history .=  $spotter_history['longitude'].', ';
@@ -561,9 +715,14 @@  discard block
 block discarded – undo
561 715
 							$prev_alt = $alt;
562 716
 						} else {
563 717
 							if ($d == false) {
564
-								if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history"},"geometry": {"type": "LineString","coordinates": [';
565
-								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": [';
566
-							} else $d = true;
718
+								if ($compress) {
719
+									$output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history"},"geometry": {"type": "LineString","coordinates": [';
720
+								} else {
721
+									$output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": [';
722
+								}
723
+							} else {
724
+								$d = true;
725
+							}
567 726
 							$output_history .= '[';
568 727
 							$output_history .=  $spotter_history['longitude'].', ';
569 728
 							$output_history .=  $spotter_history['latitude'];
@@ -584,7 +743,9 @@  discard block
 block discarded – undo
584 743
 							$output_historyd = '[';
585 744
 							$output_historyd .=  $spotter_item['longitude'].', ';
586 745
 							$output_historyd .=  $spotter_item['latitude'];
587
-							if (isset($spotter_history['altitude'])) $output_historyd .=  ','.$spotter_item['altitude']*30.48;
746
+							if (isset($spotter_history['altitude'])) {
747
+								$output_historyd .=  ','.$spotter_item['altitude']*30.48;
748
+							}
588 749
 							$output_historyd .= '],';
589 750
 							//$output_history = $output_historyd.$output_history;
590 751
 							$output_history = $output_history.$output_historyd;
@@ -606,8 +767,11 @@  discard block
 block discarded – undo
606 767
 				        && $spotter_item['arrival_airport'] != 'NA' 
607 768
 				        && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") 
608 769
 				    	    || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) {
609
-				    if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
610
-				    else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
770
+				    if ($compress) {
771
+				    	$output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
772
+				    } else {
773
+				    	$output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
774
+				    }
611 775
 				    if (isset($spotter_item['departure_airport_latitude'])) {
612 776
 					$output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],';
613 777
 				    } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') {
@@ -640,8 +804,11 @@  discard block
 block discarded – undo
640 804
 				    	    || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) 
641 805
 				    	    || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) {
642 806
 				    $havedata = false;
643
-				    if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
644
-				    else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
807
+				    if ($compress) {
808
+				    	$output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
809
+				    } else {
810
+				    	$output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
811
+				    }
645 812
 				    $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';
646 813
 
647 814
 				    if (isset($spotter_item['arrival_airport_latitude'])) {
@@ -656,7 +823,9 @@  discard block
 block discarded – undo
656 823
 				    }
657 824
 				    //$output_dest  = substr($output_dest, 0, -1);
658 825
 				    $output_dest .= ']}},';
659
-				    if ($havedata) $output .= $output_dest;
826
+				    if ($havedata) {
827
+				    	$output .= $output_dest;
828
+				    }
660 829
 				    unset($output_dest);
661 830
 				}
662 831
 			}
@@ -664,7 +833,9 @@  discard block
 block discarded – undo
664 833
 			$output .= ']';
665 834
 			$output .= ',"initial_sqltime": "'.$sqltime.'",';
666 835
 			$output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';
667
-			if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
836
+			if (isset($begindate)) {
837
+				$output .= '"archive_date": "'.$begindate.'",';
838
+			}
668 839
 			$output .= '"fc": "'.$j.'"';
669 840
 		} else {
670 841
 			$output .= '"features": ';
Please login to merge, or discard this patch.