Completed
Push — master ( db2756...3d0574 )
by Yannick
29:36
created
require/class.SBS.php 1 patch
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -18,82 +18,82 @@  discard block
 block discarded – undo
18 18
 	public function parse($buffer) {
19 19
 		// Not yet finished, no CRC checks
20 20
 		$data = array();
21
-		$typehex = substr($buffer,0,1);
22
-		if ($typehex == '*' || $typehex == ':') $hex = substr($buffer,1,-1);
23
-		elseif ($typehex == '@' || $typehex == '%') $hex = substr($buffer,13,-13);
24
-		else $hex = substr($buffer,1,-1);
25
-		$bin = gmp_strval( gmp_init($hex,16), 2);
21
+		$typehex = substr($buffer, 0, 1);
22
+		if ($typehex == '*' || $typehex == ':') $hex = substr($buffer, 1, -1);
23
+		elseif ($typehex == '@' || $typehex == '%') $hex = substr($buffer, 13, -13);
24
+		else $hex = substr($buffer, 1, -1);
25
+		$bin = gmp_strval(gmp_init($hex, 16), 2);
26 26
 		//if (strlen($hex) == 28 && $this->parityCheck($hex,$bin)) {
27 27
 		if (strlen($hex) == 28) {
28
-			$df = intval(substr($bin,0,5),2);
28
+			$df = intval(substr($bin, 0, 5), 2);
29 29
 			//$ca = intval(substr($bin,5,3),2);
30 30
 			// Only support DF17 for now
31 31
 			//if ($df == 17 || ($df == 18 && ($ca == 0 || $ca == 1 || $ca == 6))) {
32
-			if (($df == 17 || $df == 18) && ($this->parityCheck($hex,$bin) || $typehex == '@')) {
33
-				$icao = substr($hex,2,6);
32
+			if (($df == 17 || $df == 18) && ($this->parityCheck($hex, $bin) || $typehex == '@')) {
33
+				$icao = substr($hex, 2, 6);
34 34
 				$data['hex'] = $icao;
35
-				$tc = intval(substr($bin,32,5),2);
35
+				$tc = intval(substr($bin, 32, 5), 2);
36 36
 				if ($tc >= 1 && $tc <= 4) {
37 37
 					//callsign
38
-					$csbin = substr($bin,40,56);
38
+					$csbin = substr($bin, 40, 56);
39 39
 					$charset = str_split('#ABCDEFGHIJKLMNOPQRSTUVWXYZ#####_###############0123456789######');
40 40
 					$cs = '';
41
-					$cs .= $charset[intval(substr($csbin,0,6),2)];
42
-					$cs .= $charset[intval(substr($csbin,6,6),2)];
43
-					$cs .= $charset[intval(substr($csbin,12,6),2)];
44
-					$cs .= $charset[intval(substr($csbin,18,6),2)];
45
-					$cs .= $charset[intval(substr($csbin,24,6),2)];
46
-					$cs .= $charset[intval(substr($csbin,30,6),2)];
47
-					$cs .= $charset[intval(substr($csbin,36,6),2)];
48
-					$cs .= $charset[intval(substr($csbin,42,6),2)];
49
-					$cs = str_replace('_','',$cs);
50
-					$cs = str_replace('#','',$cs);
41
+					$cs .= $charset[intval(substr($csbin, 0, 6), 2)];
42
+					$cs .= $charset[intval(substr($csbin, 6, 6), 2)];
43
+					$cs .= $charset[intval(substr($csbin, 12, 6), 2)];
44
+					$cs .= $charset[intval(substr($csbin, 18, 6), 2)];
45
+					$cs .= $charset[intval(substr($csbin, 24, 6), 2)];
46
+					$cs .= $charset[intval(substr($csbin, 30, 6), 2)];
47
+					$cs .= $charset[intval(substr($csbin, 36, 6), 2)];
48
+					$cs .= $charset[intval(substr($csbin, 42, 6), 2)];
49
+					$cs = str_replace('_', '', $cs);
50
+					$cs = str_replace('#', '', $cs);
51 51
 					$callsign = $cs;
52 52
 					$data['ident'] = $callsign;
53 53
 				} elseif ($tc >= 9 && $tc <= 18) {
54 54
 					// Check Q-bit
55
-					$q = substr($bin,47,1);
55
+					$q = substr($bin, 47, 1);
56 56
 					if ($q) {
57
-						$n = intval(substr($bin,40,7).substr($bin,48,4),2);
58
-						$alt = $n*25-1000;
57
+						$n = intval(substr($bin, 40, 7).substr($bin, 48, 4), 2);
58
+						$alt = $n*25 - 1000;
59 59
 						$data['altitude'] = $alt;
60 60
 					}
61 61
 					// Check odd/even flag
62
-					$oe = substr($bin,53,1);
62
+					$oe = substr($bin, 53, 1);
63 63
 					//if ($oe) => odd else even
64 64
 					//  131072 is 2^17 since CPR latitude and longitude are encoded in 17 bits.
65
-					$cprlat = intval(substr($bin,54,17),2)/131072.0;
66
-					$cprlon = intval(substr($bin,71,17),2)/131072.0;
67
-					if ($oe == 0) $this::$latlon[$icao] = array('latitude' => $cprlat,'longitude' => $cprlon,'created' => time());
65
+					$cprlat = intval(substr($bin, 54, 17), 2)/131072.0;
66
+					$cprlon = intval(substr($bin, 71, 17), 2)/131072.0;
67
+					if ($oe == 0) $this::$latlon[$icao] = array('latitude' => $cprlat, 'longitude' => $cprlon, 'created' => time());
68 68
 					elseif (isset($this::$latlon[$icao]) && (time() - $this::$latlon[$icao]['created']) < 10) {
69 69
 						$cprlat_odd = $cprlat;
70 70
 						$cprlon_odd = $cprlon;
71 71
 						$cprlat_even = $this::$latlon[$icao]['latitude'];
72 72
 						$cprlon_even = $this::$latlon[$icao]['longitude'];
73
-						$j = 59*$cprlat_even-60*$cprlat_odd+0.5;
74
-						$lat_even = (360.0/60)*($j%60+$cprlat_even);
75
-						$lat_odd = (360.0/59)*($j%59+$cprlat_odd);
73
+						$j = 59*$cprlat_even - 60*$cprlat_odd + 0.5;
74
+						$lat_even = (360.0/60)*($j%60 + $cprlat_even);
75
+						$lat_odd = (360.0/59)*($j%59 + $cprlat_odd);
76 76
 						if ($lat_even >= 270) $lat_even = $lat_even - 360;
77 77
 						if ($lat_odd >= 270) $lat_odd = $lat_odd - 360;
78 78
 						// check latitude zone
79 79
 						if ($this->cprNL($lat_even) == $this->cprNL($lat_odd)) {
80 80
 							if ($this::$latlon[$icao]['created'] > time()) {
81
-								$ni = $this->cprN($lat_even,0);
82
-								$m = floor($cprlon_even*($this->cprNL($lat_even)-1) - $cprlon_odd * $this->cprNL($lat_even)+0.5);
83
-								$lon = (360.0/$ni)*($m%$ni+$cprlon_even);
81
+								$ni = $this->cprN($lat_even, 0);
82
+								$m = floor($cprlon_even*($this->cprNL($lat_even) - 1) - $cprlon_odd*$this->cprNL($lat_even) + 0.5);
83
+								$lon = (360.0/$ni)*($m%$ni + $cprlon_even);
84 84
 								$lat = $lat_even;
85
-								if ($lon > 180) $lon = $lon -360;
85
+								if ($lon > 180) $lon = $lon - 360;
86 86
 								if ($lat > -91 && $lat < 91 && $lon > -181 && $lon < 181) {
87 87
 									//if ($globalDebug) echo 'cs : '.$cs.' - hex : '.$hex.' - lat : '.$lat.' - lon : '.$lon;
88 88
 									$data['latitude'] = $lat;
89 89
 									$data['longitude'] = $lon;
90 90
 								}
91 91
 							} else {
92
-								$ni = $this->cprN($lat_odd,1);
93
-								$m = floor($cprlon_even*($this->cprNL($lat_odd)-1) - $cprlon_odd * $this->cprNL($lat_odd)+0.5);
94
-								$lon = (360.0/$ni)*($m%$ni+$cprlon_odd);
92
+								$ni = $this->cprN($lat_odd, 1);
93
+								$m = floor($cprlon_even*($this->cprNL($lat_odd) - 1) - $cprlon_odd*$this->cprNL($lat_odd) + 0.5);
94
+								$lon = (360.0/$ni)*($m%$ni + $cprlon_odd);
95 95
 								$lat = $lat_odd;
96
-								if ($lon > 180) $lon = $lon -360;
96
+								if ($lon > 180) $lon = $lon - 360;
97 97
 								if ($lat > -91 && $lat < 91 && $lon > -181 && $lon < 181) {
98 98
 									//if ($globalDebug) echo 'icao : '.$icao.' - hex : '.$hex.' - lat : '.$lat.' - lon : '.$lon.' second'."\n";
99 99
 									$data['latitude'] = $lat;
@@ -105,15 +105,15 @@  discard block
 block discarded – undo
105 105
 					}
106 106
 				} elseif ($tc == 19) {
107 107
 					// speed & heading
108
-					$v_ew_dir = intval(substr($bin,45,1));
109
-					$v_ew = intval(substr($bin,46,10),2);
110
-					$v_ns_dir = intval(substr($bin,56,1));
111
-					$v_ns = intval(substr($bin,57,10),2);
108
+					$v_ew_dir = intval(substr($bin, 45, 1));
109
+					$v_ew = intval(substr($bin, 46, 10), 2);
110
+					$v_ns_dir = intval(substr($bin, 56, 1));
111
+					$v_ns = intval(substr($bin, 57, 10), 2);
112 112
 					if ($v_ew_dir) $v_ew = -1*$v_ew;
113 113
 					if ($v_ns_dir) $v_ns = -1*$v_ns;
114
-					$speed = sqrt($v_ns*$v_ns+$v_ew*$v_ew);
115
-					$heading = atan2($v_ew,$v_ns)*360.0/(2*pi());
116
-					if ($heading <0) $heading = $heading+360;
114
+					$speed = sqrt($v_ns*$v_ns + $v_ew*$v_ew);
115
+					$heading = atan2($v_ew, $v_ns)*360.0/(2*pi());
116
+					if ($heading < 0) $heading = $heading + 360;
117 117
 					$data['speed'] = $speed;
118 118
 					$data['heading'] = $heading;
119 119
 				}
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	 * Lookup table to convert the latitude to index.
129 129
 	*/
130 130
 	private function cprNL($lat) {
131
-		if ($lat < 0) $lat = -$lat;             // Table is simmetric about the equator.
131
+		if ($lat < 0) $lat = -$lat; // Table is simmetric about the equator.
132 132
 		if ($lat < 10.47047130) return 59;
133 133
 		if ($lat < 14.82817437) return 58;
134 134
 		if ($lat < 18.18626357) return 57;
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 		return 1;
191 191
 	}
192 192
 
193
-	private function cprN($lat,$isodd) {
193
+	private function cprN($lat, $isodd) {
194 194
 		$nl = $this->cprNL($lat) - $isodd;
195 195
 		if ($nl > 1) return $nl;
196 196
 		else return 1;
@@ -214,9 +214,9 @@  discard block
 block discarded – undo
214 214
 		    0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
215 215
 		);
216 216
 		$crc = 0;
217
-		$checksum = intval(substr($msg,22,6),16);
217
+		$checksum = intval(substr($msg, 22, 6), 16);
218 218
 		for ($j = 0; $j < strlen($bin); $j++) {
219
-			if ($bin[$j]) $crc = $crc^intval($modes_checksum_table[$j],0);
219
+			if ($bin[$j]) $crc = $crc^intval($modes_checksum_table[$j], 0);
220 220
 		}
221 221
 		if ($crc == $checksum) return true;
222 222
 		else {
@@ -238,10 +238,10 @@  discard block
 block discarded – undo
238 238
 			$msg['aircraftid'] = hexdec($data['address']);
239 239
 			$msg['hex'] = $data['address'];
240 240
 			$msg['flightid'] = hexdec($data['address']);
241
-			$msg['date_gen'] = date('Y/m/d',$data['timestamp']);
242
-			$msg['time_gen'] = date('H:i:s',$data['timestamp']).'.180';
243
-			$msg['date_log'] = date('Y/m/d',$data['timestamp']);
244
-			$msg['time_log'] = date('H:i:s',$data['timestamp']).'.180';
241
+			$msg['date_gen'] = date('Y/m/d', $data['timestamp']);
242
+			$msg['time_gen'] = date('H:i:s', $data['timestamp']).'.180';
243
+			$msg['date_log'] = date('Y/m/d', $data['timestamp']);
244
+			$msg['time_log'] = date('H:i:s', $data['timestamp']).'.180';
245 245
 			$msg['callsign'] = $data['ident'];
246 246
 			$msg['altitude'] = '';
247 247
 			$msg['speed'] = '';
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 			$msg['emergency'] = '';
255 255
 			$msg['SPI'] = '';
256 256
 			$msg['ground'] = '';
257
-			$result[] = implode(',',$msg);
257
+			$result[] = implode(',', $msg);
258 258
 		}
259 259
 		if (isset($data['latitude']) && $data['latitude'] != 0) {
260 260
 			$msg = array();
@@ -264,10 +264,10 @@  discard block
 block discarded – undo
264 264
 			$msg['aircraftid'] = hexdec($data['address']);
265 265
 			$msg['hex'] = $data['address'];
266 266
 			$msg['flightid'] = hexdec($data['address']);
267
-			$msg['date_gen'] = date('Y/m/d',$data['timestamp']);
268
-			$msg['time_gen'] = date('H:i:s',$data['timestamp']).'.180';
269
-			$msg['date_log'] = date('Y/m/d',$data['timestamp']);
270
-			$msg['time_log'] = date('H:i:s',$data['timestamp']).'.180';
267
+			$msg['date_gen'] = date('Y/m/d', $data['timestamp']);
268
+			$msg['time_gen'] = date('H:i:s', $data['timestamp']).'.180';
269
+			$msg['date_log'] = date('Y/m/d', $data['timestamp']);
270
+			$msg['time_log'] = date('H:i:s', $data['timestamp']).'.180';
271 271
 			$msg['callsign'] = '';
272 272
 			if (isset($data['altitude'])) $msg['altitude'] = $data['altitude'];
273 273
 			else $msg['altitude'] = '';
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 			$msg['SPI'] = 0;
286 286
 			if (isset($data['ground'])) $msg['ground'] = 1;
287 287
 			else $msg['ground'] = 0;
288
-			$result[] = implode(',',$msg);
288
+			$result[] = implode(',', $msg);
289 289
 		}
290 290
 		return $result;
291 291
 	}
Please login to merge, or discard this patch.
live-geojson.php 1 patch
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -64,17 +64,17 @@  discard block
 block discarded – undo
64 64
 $min = true;
65 65
 $allhistory = false;
66 66
 $filter['source'] = array();
67
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
68
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
69
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
70
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
71
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
72
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
73
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
74
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
75
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
76
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
77
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
67
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt'));
68
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup'));
69
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars'));
70
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs'));
71
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs'));
72
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING);
73
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING);
74
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING);
75
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING);
76
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING);
77
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING);
78 78
 
79 79
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
80 80
 	$min = true;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 $spotter_array = array();
84 84
 
85 85
 if (isset($_GET['ident'])) {
86
-	$ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING));
86
+	$ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING));
87 87
 	if ($tracker) {
88 88
 		$spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident);
89 89
 	} elseif ($marine) {
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	}
98 98
 	$allhistory = true;
99 99
 } elseif (isset($_GET['flightaware_id'])) {
100
-	$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
100
+	$flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING);
101 101
 	$spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id);
102 102
 	if (empty($spotter_array)) {
103 103
 		$from_archive = true;
@@ -105,38 +105,38 @@  discard block
 block discarded – undo
105 105
 	}
106 106
 	$allhistory = true;
107 107
 } elseif (isset($_GET['famtrack_id'])) {
108
-	$famtrack_id = urldecode(filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING));
108
+	$famtrack_id = urldecode(filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING));
109 109
 	$spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id);
110 110
 	$allhistory = true;
111 111
 } elseif (isset($_GET['fammarine_id'])) {
112
-	$fammarine_id = urldecode(filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING));
112
+	$fammarine_id = urldecode(filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING));
113 113
 	$spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id);
114 114
 	$allhistory = true;
115 115
 } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && (!isset($globalMapPopup) || $globalMapPopup || (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true'))) {
116 116
 //} elseif (isset($_GET['coord'])) {
117 117
 	$usecoord = true;
118
-	$coord = explode(',',$_GET['coord']);
119
-	if (filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
118
+	$coord = explode(',', $_GET['coord']);
119
+	if (filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) 
120 120
 	    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) {
121 121
 		if ($tracker) {
122
-			$spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord,$filter);
122
+			$spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord, $filter);
123 123
 		} elseif ($marine) {
124
-			$spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord,$filter);
124
+			$spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord, $filter);
125 125
 		} else {
126
-			$spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord,$filter);
126
+			$spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord, $filter);
127 127
 		}
128 128
 	}
129 129
 } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min) {
130 130
 	$usecoord = true;
131
-	$coord = explode(',',$_GET['coord']);
132
-	if (filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
131
+	$coord = explode(',', $_GET['coord']);
132
+	if (filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) 
133 133
 	    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) {
134 134
 		if ($tracker) {
135
-			$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter);
135
+			$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter);
136 136
 		} elseif ($marine) {
137
-			$spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter);
137
+			$spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter);
138 138
 		} else {
139
-			$spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$filter);
139
+			$spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $filter);
140 140
 		}
141 141
 	} else {
142 142
 		if ($tracker) {
@@ -151,12 +151,12 @@  discard block
 block discarded – undo
151 151
 	$from_archive = true;
152 152
 //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
153 153
 //	$enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
154
-	$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
155
-	$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
156
-	$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
157
-	$begindate = date('Y-m-d H:i:s',$begindate);
158
-	$enddate = date('Y-m-d H:i:s',$enddate);
159
-	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
154
+	$begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT);
155
+	$enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT);
156
+	$archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT);
157
+	$begindate = date('Y-m-d H:i:s', $begindate);
158
+	$enddate = date('Y-m-d H:i:s', $enddate);
159
+	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter);
160 160
 } elseif ($min) {
161 161
 	if ($tracker) {
162 162
 		$spotter_array = $TrackerLive->getMinLiveTrackerData($filter);
@@ -168,17 +168,17 @@  discard block
 block discarded – undo
168 168
 #	$min = true;
169 169
 } else {
170 170
 	if ($tracker) {
171
-		$spotter_array = $TrackerLive->getLiveTrackerData('','',$filter);
171
+		$spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter);
172 172
 	} elseif ($marine) {
173
-		$spotter_array = $marineLive->getLiveMarineData('','',$filter);
173
+		$spotter_array = $marineLive->getLiveMarineData('', '', $filter);
174 174
 	} else {
175
-		$spotter_array = $SpotterLive->getLiveSpotterData('','',$filter);
175
+		$spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter);
176 176
 	}
177 177
 }
178 178
 
179 179
 if ($usecoord) {
180 180
 	if (isset($_GET['archive'])) {
181
-		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);
181
+		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter);
182 182
 	} else {
183 183
 		if ($tracker) {
184 184
 			$flightcnt = $TrackerLive->getLiveTrackerCount($filter);
@@ -191,9 +191,9 @@  discard block
 block discarded – undo
191 191
 	if ($flightcnt == '') $flightcnt = 0;
192 192
 } else $flightcnt = 0;
193 193
 
194
-$sqltime = round(microtime(true)-$begintime,2);
194
+$sqltime = round(microtime(true) - $begintime, 2);
195 195
 
196
-$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
196
+$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
197 197
 if ($currenttime != '') $currenttime = round($currenttime/1000);
198 198
 
199 199
 if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false;
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 		if (!empty($spotter_array) && is_array($spotter_array))
213 213
 		{
214 214
 			$output .= '"features": [';
215
-			foreach($spotter_array as $spotter_item)
215
+			foreach ($spotter_array as $spotter_item)
216 216
 			{
217 217
 				$j++;
218 218
 				unset($idistance);
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
 */
270 270
 							//$output .= '"fc": "'.$spotter_item['nb'].'",';
271 271
 						if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') {
272
-							if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",';
273
-							else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",';
272
+							if ($compress) $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",';
273
+							else $output .= '"callsign": "'.str_replace('\\', '', $spotter_item['ident']).'",';
274 274
 							//"
275 275
 						} else {
276 276
 							if ($compress) $output .= '"c": "NA",';
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 						if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",';
280 280
 						if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) {
281 281
 							$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",';
282
-							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",';
282
+							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",';
283 283
 						} elseif (isset($spotter_item['aircraft_type'])) {
284 284
 							$output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",';
285 285
 						} elseif (!$min) {
@@ -422,15 +422,15 @@  discard block
 block discarded – undo
422 422
 						if (isset($archivespeed) || $usenextlatlon) {
423 423
 							if (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
424 424
 								if (isset($spotter_item['arrival_airport_latitude'])) {
425
-									$cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']);
426
-									$idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']);
425
+									$cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']);
426
+									$idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']);
427 427
 									$farr_lat = $spotter_item['arrival_airport_latitude'];
428 428
 									$farr_lon = $spotter_item['arrival_airport_longitude'];
429 429
 								} else {
430 430
 									$aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);
431 431
 									if (isset($aairport[0]['latitude'])) {
432
-										$cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']);
433
-										$idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']);
432
+										$cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']);
433
+										$idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']);
434 434
 										$farr_lat = $aairport[0]['latitude'];
435 435
 										$farr_lon = $aairport[0]['longitude'];
436 436
 									}
@@ -443,59 +443,59 @@  discard block
 block discarded – undo
443 443
 						if ($currenttime != '') {
444 444
 							if (strtotime($spotter_item['date']) < $currenttime) {
445 445
 								if (isset($archivespeed)) {
446
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
447
-									$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
446
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
447
+									$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
448 448
 									if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
449 449
 									else {
450
-										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
451
-										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
450
+										$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
451
+										$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
452 452
 										if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
453 453
 										else {
454
-											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);
454
+											$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed);
455 455
 											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
456 456
 										}
457 457
 									}
458 458
 								} elseif ($usenextlatlon) {
459
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
460
-									$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
459
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
460
+									$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
461 461
 									if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
462 462
 									else {
463
-										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
464
-										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
463
+										$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
464
+										$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
465 465
 										if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
466 466
 										else {
467
-											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);
467
+											$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading);
468 468
 											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
469 469
 										}
470 470
 									}
471 471
 								}
472 472
 							} else {
473 473
 								if (isset($archivespeed)) {
474
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);
474
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed);
475 475
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
476 476
 								} elseif ($usenextlatlon) {
477
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);
477
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading);
478 478
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
479 479
 								}
480 480
 							}
481 481
 						} else {
482 482
 							if (isset($archivespeed)) {
483
-								$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);
484
-								$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
483
+								$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed);
484
+								$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
485 485
 								if (!isset($idistance) || $fdistance < $idistance) {
486 486
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
487 487
 								} else {
488
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed);
488
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed);
489 489
 									//$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
490 490
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
491 491
 								}
492 492
 							} elseif ($usenextlatlon) {
493
-								$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);
494
-								$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
493
+								$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading);
494
+								$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
495 495
 								if (!isset($idistance) || $fdistance < $idistance) {
496 496
 										$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
497 497
 								} else {
498
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading);
498
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading);
499 499
 									//$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
500 500
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
501 501
 								}
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 
505 505
 						if (!$min) $output .= '"image": "'.$image.'",';
506 506
 						if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') {
507
-							$output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",';
507
+							$output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",';
508 508
 						}
509 509
 						if (isset($spotter_item['image_source_website'])) {
510 510
 							$output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",';
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 							$output .= '"waypoints": "'.$spotter_item['waypoints'].'",';
527 527
 						}
528 528
 						if (isset($spotter_item['acars'])) {
529
-							$output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",';
529
+							$output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",';
530 530
 						}
531 531
 						// type when not aircraft ?
532 532
 						if (isset($spotter_item['type'])) {
@@ -546,12 +546,12 @@  discard block
 block discarded – undo
546 546
 								if ($currenttime != '') {
547 547
 									if (strtotime($spotter_item['date']) < $currenttime) {
548 548
 										if (!isset($archivespeed)) $archivespeed = 1;
549
-										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));
550
-										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
549
+										$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date'])));
550
+										$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
551 551
 										if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
552 552
 										else {
553
-											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));
554
-											$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
553
+											$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date'])));
554
+											$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
555 555
 											if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
556 556
 											else {
557 557
 												$output .= $spotter_item['longitude'].', ';
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
                 
631 631
 			}
632 632
 */
633
-				$history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING);
633
+				$history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING);
634 634
 				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
635 635
 				
636 636
 				if (
@@ -638,11 +638,11 @@  discard block
 block discarded – undo
638 638
 				    || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)
639 639
 				//    || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))
640 640
 				//    || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident'])
641
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
641
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
642 642
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])
643
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id']))
643
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id']))
644 644
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])
645
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid']))
645
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid']))
646 646
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])
647 647
 				    ) {
648 648
 					if ($tracker) {
@@ -698,9 +698,9 @@  discard block
 block discarded – undo
698 698
 								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
699 699
 							}
700 700
 							$output_history .= '[';
701
-							$output_history .=  $spotter_history['longitude'].', ';
702
-							$output_history .=  $spotter_history['latitude'].', ';
703
-							$output_history .=  $spotter_history['altitude']*30.48;
701
+							$output_history .= $spotter_history['longitude'].', ';
702
+							$output_history .= $spotter_history['latitude'].', ';
703
+							$output_history .= $spotter_history['altitude']*30.48;
704 704
 							$output_history .= '],';
705 705
 							/*
706 706
 							if ($from_archive === false) {
@@ -719,8 +719,8 @@  discard block
 block discarded – undo
719 719
 								$d = true;
720 720
 							}
721 721
 							$output_history .= '[';
722
-							$output_history .=  $spotter_history['longitude'].', ';
723
-							$output_history .=  $spotter_history['latitude'];
722
+							$output_history .= $spotter_history['longitude'].', ';
723
+							$output_history .= $spotter_history['latitude'];
724 724
 							$output_history .= '],';
725 725
 							/*
726 726
 							if ($from_archive === false) {
@@ -736,9 +736,9 @@  discard block
 block discarded – undo
736 736
 						//echo $output_history;
737 737
 						if ($from_archive === false) {
738 738
 							$output_historyd = '[';
739
-							$output_historyd .=  $spotter_item['longitude'].', ';
740
-							$output_historyd .=  $spotter_item['latitude'];
741
-							if (isset($spotter_history['altitude'])) $output_historyd .=  ','.$spotter_item['altitude']*30.48;
739
+							$output_historyd .= $spotter_item['longitude'].', ';
740
+							$output_historyd .= $spotter_item['latitude'];
741
+							if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48;
742 742
 							$output_historyd .= '],';
743 743
 							//$output_history = $output_historyd.$output_history;
744 744
 							$output_history = $output_history.$output_historyd;
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
 					}
753 753
 				}
754 754
 				
755
-				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
755
+				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
756 756
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
757 757
 				     && (isset($spotter_item['departure_airport']) 
758 758
 				        && $spotter_item['departure_airport'] != 'NA' 
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
 
787 787
 				//if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) {
788 788
 				//if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) {
789
-				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
789
+				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
790 790
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
791 791
 				     && (isset($spotter_item['arrival_airport']) 
792 792
 				        && $spotter_item['arrival_airport'] != 'NA' 
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
 			$output  = substr($output, 0, -1);
818 818
 			$output .= ']';
819 819
 			$output .= ',"initial_sqltime": "'.$sqltime.'",';
820
-			$output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';
820
+			$output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",';
821 821
 			if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
822 822
 			$output .= '"fc": "'.$j.'"';
823 823
 		} else {
Please login to merge, or discard this patch.
install/index.php 1 patch
Spacing   +279 added lines, -279 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 require_once(dirname(__FILE__).'/class.create_db.php');
23 23
 require_once(dirname(__FILE__).'/class.update_schema.php');
24 24
 require_once(dirname(__FILE__).'/class.settings.php');
25
-$title="Install";
25
+$title = "Install";
26 26
 require(dirname(__FILE__).'/../require/settings.php');
27 27
 require_once(dirname(__FILE__).'/../require/class.Common.php');
28 28
 require(dirname(__FILE__).'/header.php');
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
 	if (!extension_loaded('curl')) {
96 96
 		$error[] = "Curl is not loaded.";
97 97
 	}
98
-	if(function_exists('apache_get_modules') ){
99
-		if(!in_array('mod_rewrite',apache_get_modules())) {
98
+	if (function_exists('apache_get_modules')) {
99
+		if (!in_array('mod_rewrite', apache_get_modules())) {
100 100
 			$error[] = "mod_rewrite is not available.";
101 101
 		}
102 102
 	/*
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 	print '<div class="info column"><p><strong>If you use MySQL or MariaDB, check that <i>max_allowed_packet</i> >= 8M, else import of some table can fail.</strong></p></div>';
113 113
 	if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) {
114 114
 		if (function_exists('get_headers')) {
115
-			$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/','search',str_replace('index.php',$_SERVER["REQUEST_URI"])));
116
-			if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) {
115
+			$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/', 'search', str_replace('index.php', $_SERVER["REQUEST_URI"])));
116
+			if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) {
117 117
 				print '<div class="info column"><p><strong>Check your configuration, rewrite don\'t seems to work.</strong></p></div>';
118 118
 			}
119 119
 		}
@@ -506,13 +506,13 @@  discard block
 block discarded – undo
506 506
 ?>
507 507
 							<tr>
508 508
 								<?php
509
-								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
509
+								    if (filter_var($source['host'], FILTER_VALIDATE_URL)) {
510 510
 								?>
511 511
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
512 512
 								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
513 513
 								<?php
514 514
 								    } else {
515
-									$hostport = explode(':',$source['host']);
515
+									$hostport = explode(':', $source['host']);
516 516
 									if (isset($hostport[1])) {
517 517
 										$host = $hostport[0];
518 518
 										$port = $hostport[1];
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 									<select name="timezones[]" id="timezones">
561 561
 								<?php
562 562
 									$timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
563
-									foreach($timezonelist as $timezones){
563
+									foreach ($timezonelist as $timezones) {
564 564
 										if (isset($source['timezone']) && $source['timezone'] == $timezones) {
565 565
 											print '<option selected>'.$timezones.'</option>';
566 566
 										} elseif (!isset($source['timezone']) && $timezones == 'UTC') {
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
 									<select name="timezones[]" id="timezones">
614 614
 								<?php
615 615
 									$timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
616
-									foreach($timezonelist as $timezones){
616
+									foreach ($timezonelist as $timezones) {
617 617
 										if ($timezones == 'UTC') {
618 618
 											print '<option selected>'.$timezones.'</option>';
619 619
 										} else print '<option>'.$timezones.'</option>';
@@ -1060,7 +1060,7 @@  discard block
 block discarded – undo
1060 1060
 			<br />
1061 1061
 			<p>
1062 1062
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
1063
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
1063
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" />
1064 1064
 			</p>
1065 1065
 			<br />
1066 1066
 			<p>
@@ -1122,14 +1122,14 @@  discard block
 block discarded – undo
1122 1122
 $error = '';
1123 1123
 
1124 1124
 if (isset($_POST['dbtype'])) {
1125
-	$dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING);
1126
-	$dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING);
1127
-	$dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING);
1128
-	$dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING);
1129
-	$dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING);
1130
-	$dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING);
1131
-	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
1132
-	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
1125
+	$dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING);
1126
+	$dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING);
1127
+	$dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING);
1128
+	$dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING);
1129
+	$dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING);
1130
+	$dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING);
1131
+	$dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING);
1132
+	$dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING);
1133 1133
 
1134 1134
 	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
1135 1135
 	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
@@ -1149,49 +1149,49 @@  discard block
 block discarded – undo
1149 1149
 	} else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
1150 1150
 	*/
1151 1151
 	
1152
-	$settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
1152
+	$settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname));
1153 1153
 
1154
-	$sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING);
1155
-	$siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING);
1156
-	$timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING);
1157
-	$language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING);
1158
-	$settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language));
1154
+	$sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING);
1155
+	$siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING);
1156
+	$timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING);
1157
+	$language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
1158
+	$settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language));
1159 1159
 
1160
-	$mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING);
1161
-	$mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING);
1162
-	$mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING);
1163
-	$googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING);
1164
-	$bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING);
1165
-	$openweathermapkey = filter_input(INPUT_POST,'openweathermapkey',FILTER_SANITIZE_STRING);
1166
-	$mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING);
1167
-	$hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING);
1168
-	$hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING);
1169
-	$settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey,'globalOpenWeatherMapKey' => $openweathermapkey));
1160
+	$mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING);
1161
+	$mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING);
1162
+	$mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING);
1163
+	$googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING);
1164
+	$bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING);
1165
+	$openweathermapkey = filter_input(INPUT_POST, 'openweathermapkey', FILTER_SANITIZE_STRING);
1166
+	$mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING);
1167
+	$hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING);
1168
+	$hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING);
1169
+	$settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey, 'globalOpenWeatherMapKey' => $openweathermapkey));
1170 1170
 	
1171
-	$latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING);
1172
-	$latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING);
1173
-	$longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING);
1174
-	$longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING);
1175
-	$livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT);
1176
-	$settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom));
1171
+	$latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING);
1172
+	$latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING);
1173
+	$longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING);
1174
+	$longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING);
1175
+	$livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT);
1176
+	$settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom));
1177 1177
 
1178
-	$squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING);
1179
-	$settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country));
1178
+	$squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING);
1179
+	$settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country));
1180 1180
 
1181
-	$latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING);
1182
-	$longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING);
1183
-	$settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter));
1181
+	$latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING);
1182
+	$longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING);
1183
+	$settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter));
1184 1184
 
1185
-	$acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING);
1185
+	$acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING);
1186 1186
 	if ($acars == 'acars') {
1187
-		$settings = array_merge($settings,array('globalACARS' => 'TRUE'));
1187
+		$settings = array_merge($settings, array('globalACARS' => 'TRUE'));
1188 1188
 	} else {
1189
-		$settings = array_merge($settings,array('globalACARS' => 'FALSE'));
1189
+		$settings = array_merge($settings, array('globalACARS' => 'FALSE'));
1190 1190
 	}
1191 1191
 
1192
-	$flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING);
1193
-	$flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING);
1194
-	$settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword));
1192
+	$flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING);
1193
+	$flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING);
1194
+	$settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword));
1195 1195
 	
1196 1196
 	$source_name = $_POST['source_name'];
1197 1197
 	$source_latitude = $_POST['source_latitude'];
@@ -1205,8 +1205,8 @@  discard block
 block discarded – undo
1205 1205
 	
1206 1206
 	$sources = array();
1207 1207
 	foreach ($source_name as $keys => $name) {
1208
-	    if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
1209
-	    else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
1208
+	    if (isset($source_id[$keys])) $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'id' => $source_id[$keys], 'source' => $source_ref[$keys]);
1209
+	    else $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'source' => $source_ref[$keys]);
1210 1210
 	}
1211 1211
 	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1212 1212
 
@@ -1215,16 +1215,16 @@  discard block
 block discarded – undo
1215 1215
 	$newstype = $_POST['newstype'];
1216 1216
 	
1217 1217
 	$newsfeeds = array();
1218
-	foreach($newsurl as $newskey => $url) {
1218
+	foreach ($newsurl as $newskey => $url) {
1219 1219
 	    if ($url != '') {
1220 1220
 		$type = $newstype[$newskey];
1221 1221
 		$lng = $newslng[$newskey];
1222 1222
 		if (isset($newsfeeds[$type][$lng])) {
1223
-		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1223
+		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng], array($url));
1224 1224
 		} else $newsfeeds[$type][$lng] = array($url);
1225 1225
 	    }
1226 1226
 	}
1227
-	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds));
1227
+	$settings = array_merge($settings, array('globalNewsFeeds' => $newsfeeds));
1228 1228
 
1229 1229
 	//$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING);
1230 1230
 	//$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT);
@@ -1235,27 +1235,27 @@  discard block
 block discarded – undo
1235 1235
 	$sbsurl = $_POST['sbsurl'];
1236 1236
 	*/
1237 1237
 
1238
-	$globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING);
1239
-	$globalva = filter_input(INPUT_POST,'globalva',FILTER_SANITIZE_STRING);
1240
-	$globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING);
1241
-	$globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING);
1242
-	$globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING);
1243
-	$globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING);
1244
-	$globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING);
1245
-	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1238
+	$globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING);
1239
+	$globalva = filter_input(INPUT_POST, 'globalva', FILTER_SANITIZE_STRING);
1240
+	$globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING);
1241
+	$globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING);
1242
+	$globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING);
1243
+	$globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING);
1244
+	$globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING);
1245
+	$datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING);
1246 1246
 
1247
-	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1248
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1249
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1250
-	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1251
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1252
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1253
-	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1254
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1255
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1256
-	$globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING);
1257
-	if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1258
-	else $settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1247
+	$globalaircraft = filter_input(INPUT_POST, 'globalaircraft', FILTER_SANITIZE_STRING);
1248
+	if ($globalaircraft == 'aircraft') $settings = array_merge($settings, array('globalAircraft' => 'TRUE'));
1249
+	else $settings = array_merge($settings, array('globalAircraft' => 'FALSE'));
1250
+	$globaltracker = filter_input(INPUT_POST, 'globaltracker', FILTER_SANITIZE_STRING);
1251
+	if ($globaltracker == 'tracker') $settings = array_merge($settings, array('globalTracker' => 'TRUE'));
1252
+	else $settings = array_merge($settings, array('globalTracker' => 'FALSE'));
1253
+	$globalmarine = filter_input(INPUT_POST, 'globalmarine', FILTER_SANITIZE_STRING);
1254
+	if ($globalmarine == 'marine') $settings = array_merge($settings, array('globalMarine' => 'TRUE'));
1255
+	else $settings = array_merge($settings, array('globalMarine' => 'FALSE'));
1256
+	$globalsatellite = filter_input(INPUT_POST, 'globalsatellite', FILTER_SANITIZE_STRING);
1257
+	if ($globalsatellite == 'satellite') $settings = array_merge($settings, array('globalSatellite' => 'TRUE'));
1258
+	else $settings = array_merge($settings, array('globalSatellite' => 'FALSE'));
1259 1259
 
1260 1260
 /*	
1261 1261
 	$globalSBS1Hosts = array();
@@ -1271,7 +1271,7 @@  discard block
 block discarded – undo
1271 1271
 	}
1272 1272
 	$settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts));
1273 1273
 */
1274
-	$settings_comment = array_merge($settings_comment,array('globalSBS1Hosts'));
1274
+	$settings_comment = array_merge($settings_comment, array('globalSBS1Hosts'));
1275 1275
 	$host = $_POST['host'];
1276 1276
 	$port = $_POST['port'];
1277 1277
 	$name = $_POST['name'];
@@ -1288,113 +1288,113 @@  discard block
 block discarded – undo
1288 1288
 		else $cov = 'FALSE';
1289 1289
 		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1290 1290
 		else $arch = 'FALSE';
1291
-		if (strpos($format[$key],'_callback')) {
1292
-			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE');
1291
+		if (strpos($format[$key], '_callback')) {
1292
+			$gSources[] = array('host' => $h, 'pass' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'TRUE');
1293 1293
 		} elseif ($h != '' || $name[$key] != '') {
1294
-			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE');
1294
+			$gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'FALSE');
1295 1295
 		}
1296 1296
 		if ($format[$key] == 'airwhere') $forcepilots = true;
1297 1297
 	}
1298
-	$settings = array_merge($settings,array('globalSources' => $gSources));
1298
+	$settings = array_merge($settings, array('globalSources' => $gSources));
1299 1299
 
1300 1300
 /*
1301 1301
 	$sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT);
1302 1302
 	$settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout));
1303 1303
 */
1304
-	$acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING);
1305
-	$acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT);
1306
-	$settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport));
1304
+	$acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING);
1305
+	$acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT);
1306
+	$settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport));
1307 1307
 
1308
-	$bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING);
1309
-	$settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly));
1308
+	$bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING);
1309
+	$settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly));
1310 1310
 
1311
-	$customcss = filter_input(INPUT_POST,'customcss',FILTER_SANITIZE_STRING);
1312
-	$settings = array_merge($settings,array('globalCustomCSS' => $customcss));
1311
+	$customcss = filter_input(INPUT_POST, 'customcss', FILTER_SANITIZE_STRING);
1312
+	$settings = array_merge($settings, array('globalCustomCSS' => $customcss));
1313 1313
 
1314
-	$map3dtile = filter_input(INPUT_POST,'map3dtileset',FILTER_SANITIZE_STRING);
1315
-	$settings = array_merge($settings,array('globalMap3DTiles' => $map3dtile));
1314
+	$map3dtile = filter_input(INPUT_POST, 'map3dtileset', FILTER_SANITIZE_STRING);
1315
+	$settings = array_merge($settings, array('globalMap3DTiles' => $map3dtile));
1316 1316
 
1317
-	$notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING);
1318
-	$settings = array_merge($settings,array('globalNOTAMSource' => $notamsource));
1319
-	$metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING);
1320
-	$settings = array_merge($settings,array('globalMETARurl' => $metarsource));
1317
+	$notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING);
1318
+	$settings = array_merge($settings, array('globalNOTAMSource' => $notamsource));
1319
+	$metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING);
1320
+	$settings = array_merge($settings, array('globalMETARurl' => $metarsource));
1321 1321
 
1322
-	$zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING);
1323
-	$zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING);
1324
-	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1322
+	$zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING);
1323
+	$zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING);
1324
+	$zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT);
1325 1325
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1326
-		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1327
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1326
+		$settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance)));
1327
+	} else $settings = array_merge($settings, array('globalDistanceIgnore' => array()));
1328 1328
 
1329
-	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1330
-	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
1331
-	$maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT);
1332
-	$settings = array_merge($settings,array('globalMapRefresh' => $maprefresh));
1333
-	$mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT);
1334
-	$settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle));
1335
-	$closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT);
1336
-	$settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist));
1329
+	$refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT);
1330
+	$settings = array_merge($settings, array('globalLiveInterval' => $refresh));
1331
+	$maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT);
1332
+	$settings = array_merge($settings, array('globalMapRefresh' => $maprefresh));
1333
+	$mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT);
1334
+	$settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle));
1335
+	$closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT);
1336
+	$settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist));
1337 1337
 
1338
-	$aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT);
1339
-	$settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize));
1338
+	$aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT);
1339
+	$settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize));
1340 1340
 
1341
-	$archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT);
1342
-	$settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths));
1341
+	$archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT);
1342
+	$settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths));
1343 1343
 	
1344
-	$archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING);
1344
+	$archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING);
1345 1345
 	if ($archiveyear == "archiveyear") {
1346
-		$settings = array_merge($settings,array('globalArchiveYear' => 'TRUE'));
1346
+		$settings = array_merge($settings, array('globalArchiveYear' => 'TRUE'));
1347 1347
 	} else {
1348
-		$settings = array_merge($settings,array('globalArchiveYear' => 'FALSE'));
1348
+		$settings = array_merge($settings, array('globalArchiveYear' => 'FALSE'));
1349 1349
 	}
1350
-	$archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT);
1351
-	$settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths));
1352
-	$archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT);
1353
-	$settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1350
+	$archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT);
1351
+	$settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths));
1352
+	$archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT);
1353
+	$settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1354 1354
 
1355
-	$britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING);
1356
-	$settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways));
1357
-	$transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING);
1358
-	$settings = array_merge($settings,array('globalTransaviaKey' => $transavia));
1355
+	$britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING);
1356
+	$settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways));
1357
+	$transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING);
1358
+	$settings = array_merge($settings, array('globalTransaviaKey' => $transavia));
1359 1359
 
1360
-	$lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING);
1361
-	$lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING);
1362
-	$settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret)));
1360
+	$lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING);
1361
+	$lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING);
1362
+	$settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret)));
1363 1363
 
1364 1364
 	// Create in settings.php keys not yet configurable if not already here
1365 1365
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1366
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1366
+	if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE'));
1367 1367
 
1368
-	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1368
+	$resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING);
1369 1369
 	if ($resetyearstats == 'resetyearstats') {
1370
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE'));
1370
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE'));
1371 1371
 	} else {
1372
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE'));
1372
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE'));
1373 1373
 	}
1374 1374
 
1375
-	$archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING);
1375
+	$archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING);
1376 1376
 	if ($archive == 'archive') {
1377
-		$settings = array_merge($settings,array('globalArchive' => 'TRUE'));
1377
+		$settings = array_merge($settings, array('globalArchive' => 'TRUE'));
1378 1378
 	} else {
1379
-		$settings = array_merge($settings,array('globalArchive' => 'FALSE'));
1379
+		$settings = array_merge($settings, array('globalArchive' => 'FALSE'));
1380 1380
 	}
1381
-	$archiveresults = filter_input(INPUT_POST,'archiveresults',FILTER_SANITIZE_STRING);
1381
+	$archiveresults = filter_input(INPUT_POST, 'archiveresults', FILTER_SANITIZE_STRING);
1382 1382
 	if ($archiveresults == 'archiveresults') {
1383
-		$settings = array_merge($settings,array('globalArchiveResults' => 'TRUE'));
1383
+		$settings = array_merge($settings, array('globalArchiveResults' => 'TRUE'));
1384 1384
 	} else {
1385
-		$settings = array_merge($settings,array('globalArchiveResults' => 'FALSE'));
1385
+		$settings = array_merge($settings, array('globalArchiveResults' => 'FALSE'));
1386 1386
 	}
1387
-	$daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING);
1387
+	$daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING);
1388 1388
 	if ($daemon == 'daemon') {
1389
-		$settings = array_merge($settings,array('globalDaemon' => 'TRUE'));
1389
+		$settings = array_merge($settings, array('globalDaemon' => 'TRUE'));
1390 1390
 	} else {
1391
-		$settings = array_merge($settings,array('globalDaemon' => 'FALSE'));
1391
+		$settings = array_merge($settings, array('globalDaemon' => 'FALSE'));
1392 1392
 	}
1393
-	$schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING);
1393
+	$schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING);
1394 1394
 	if ($schedules == 'schedules') {
1395
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE'));
1395
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE'));
1396 1396
 	} else {
1397
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE'));
1397
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE'));
1398 1398
 	}
1399 1399
 
1400 1400
 /*
@@ -1405,274 +1405,274 @@  discard block
 block discarded – undo
1405 1405
 		$settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE'));
1406 1406
 	}
1407 1407
 */
1408
-	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1409
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1410
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1411
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1412
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1408
+	$settings = array_merge($settings, array('globalFlightAware' => 'FALSE'));
1409
+	if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE'));
1410
+	else $settings = array_merge($settings, array('globalSBS1' => 'FALSE'));
1411
+	if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE'));
1412
+	else $settings = array_merge($settings, array('globalAPRS' => 'FALSE'));
1413 1413
 	$va = false;
1414 1414
 	if ($globalivao == 'ivao') {
1415
-		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1415
+		$settings = array_merge($settings, array('globalIVAO' => 'TRUE'));
1416 1416
 		$va = true;
1417
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1417
+	} else $settings = array_merge($settings, array('globalIVAO' => 'FALSE'));
1418 1418
 	if ($globalvatsim == 'vatsim') {
1419
-		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1419
+		$settings = array_merge($settings, array('globalVATSIM' => 'TRUE'));
1420 1420
 		$va = true;
1421
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1421
+	} else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE'));
1422 1422
 	if ($globalphpvms == 'phpvms') {
1423
-		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1423
+		$settings = array_merge($settings, array('globalphpVMS' => 'TRUE'));
1424 1424
 		$va = true;
1425
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1425
+	} else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE'));
1426 1426
 	if ($globalvam == 'vam') {
1427
-		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1427
+		$settings = array_merge($settings, array('globalVAM' => 'TRUE'));
1428 1428
 		$va = true;
1429
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1429
+	} else $settings = array_merge($settings, array('globalVAM' => 'FALSE'));
1430 1430
 	if ($va) {
1431
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1432
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1431
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE'));
1432
+	} else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE'));
1433 1433
 	if ($globalva == 'va' || $va) {
1434
-		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1435
-		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1434
+		$settings = array_merge($settings, array('globalVA' => 'TRUE'));
1435
+		$settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE'));
1436 1436
 	} else {
1437
-		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1438
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1439
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1437
+		$settings = array_merge($settings, array('globalVA' => 'FALSE'));
1438
+		if ($forcepilots) $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE'));
1439
+		else $settings = array_merge($settings, array('globalUsePilot' => 'FALSE', 'globalUseOwner' => 'TRUE'));
1440 1440
 	}
1441 1441
 	
1442 1442
 	
1443
-	$mapoffline = filter_input(INPUT_POST,'mapoffline',FILTER_SANITIZE_STRING);
1443
+	$mapoffline = filter_input(INPUT_POST, 'mapoffline', FILTER_SANITIZE_STRING);
1444 1444
 	if ($mapoffline == 'mapoffline') {
1445
-		$settings = array_merge($settings,array('globalMapOffline' => 'TRUE'));
1445
+		$settings = array_merge($settings, array('globalMapOffline' => 'TRUE'));
1446 1446
 	} else {
1447
-		$settings = array_merge($settings,array('globalMapOffline' => 'FALSE'));
1447
+		$settings = array_merge($settings, array('globalMapOffline' => 'FALSE'));
1448 1448
 	}
1449
-	$globaloffline = filter_input(INPUT_POST,'globaloffline',FILTER_SANITIZE_STRING);
1449
+	$globaloffline = filter_input(INPUT_POST, 'globaloffline', FILTER_SANITIZE_STRING);
1450 1450
 	if ($globaloffline == 'globaloffline') {
1451
-		$settings = array_merge($settings,array('globalOffline' => 'TRUE'));
1451
+		$settings = array_merge($settings, array('globalOffline' => 'TRUE'));
1452 1452
 	} else {
1453
-		$settings = array_merge($settings,array('globalOffline' => 'FALSE'));
1453
+		$settings = array_merge($settings, array('globalOffline' => 'FALSE'));
1454 1454
 	}
1455 1455
 
1456
-	$notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING);
1456
+	$notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING);
1457 1457
 	if ($notam == 'notam') {
1458
-		$settings = array_merge($settings,array('globalNOTAM' => 'TRUE'));
1458
+		$settings = array_merge($settings, array('globalNOTAM' => 'TRUE'));
1459 1459
 	} else {
1460
-		$settings = array_merge($settings,array('globalNOTAM' => 'FALSE'));
1460
+		$settings = array_merge($settings, array('globalNOTAM' => 'FALSE'));
1461 1461
 	}
1462
-	$owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING);
1462
+	$owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING);
1463 1463
 	if ($owner == 'owner') {
1464
-		$settings = array_merge($settings,array('globalOwner' => 'TRUE'));
1464
+		$settings = array_merge($settings, array('globalOwner' => 'TRUE'));
1465 1465
 	} else {
1466
-		$settings = array_merge($settings,array('globalOwner' => 'FALSE'));
1466
+		$settings = array_merge($settings, array('globalOwner' => 'FALSE'));
1467 1467
 	}
1468
-	$map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING);
1468
+	$map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING);
1469 1469
 	if ($map3d == 'map3d') {
1470
-		$settings = array_merge($settings,array('globalMap3D' => 'TRUE'));
1470
+		$settings = array_merge($settings, array('globalMap3D' => 'TRUE'));
1471 1471
 	} else {
1472
-		$settings = array_merge($settings,array('globalMap3D' => 'FALSE'));
1472
+		$settings = array_merge($settings, array('globalMap3D' => 'FALSE'));
1473 1473
 	}
1474
-	$crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING);
1474
+	$crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING);
1475 1475
 	if ($crash == 'crash') {
1476
-		$settings = array_merge($settings,array('globalAccidents' => 'TRUE'));
1476
+		$settings = array_merge($settings, array('globalAccidents' => 'TRUE'));
1477 1477
 	} else {
1478
-		$settings = array_merge($settings,array('globalAccidents' => 'FALSE'));
1478
+		$settings = array_merge($settings, array('globalAccidents' => 'FALSE'));
1479 1479
 	}
1480
-	$fires = filter_input(INPUT_POST,'fires',FILTER_SANITIZE_STRING);
1480
+	$fires = filter_input(INPUT_POST, 'fires', FILTER_SANITIZE_STRING);
1481 1481
 	if ($fires == 'fires') {
1482
-		$settings = array_merge($settings,array('globalMapFires' => 'TRUE'));
1482
+		$settings = array_merge($settings, array('globalMapFires' => 'TRUE'));
1483 1483
 	} else {
1484
-		$settings = array_merge($settings,array('globalMapFires' => 'FALSE'));
1484
+		$settings = array_merge($settings, array('globalMapFires' => 'FALSE'));
1485 1485
 	}
1486
-	$firessupport = filter_input(INPUT_POST,'firessupport',FILTER_SANITIZE_STRING);
1486
+	$firessupport = filter_input(INPUT_POST, 'firessupport', FILTER_SANITIZE_STRING);
1487 1487
 	if ($firessupport == 'firessupport') {
1488
-		$settings = array_merge($settings,array('globalFires' => 'TRUE'));
1488
+		$settings = array_merge($settings, array('globalFires' => 'TRUE'));
1489 1489
 	} else {
1490
-		$settings = array_merge($settings,array('globalFires' => 'FALSE'));
1490
+		$settings = array_merge($settings, array('globalFires' => 'FALSE'));
1491 1491
 	}
1492
-	$mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING);
1492
+	$mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING);
1493 1493
 	if ($mapsatellites == 'mapsatellites') {
1494
-		$settings = array_merge($settings,array('globalMapSatellites' => 'TRUE'));
1494
+		$settings = array_merge($settings, array('globalMapSatellites' => 'TRUE'));
1495 1495
 	} else {
1496
-		$settings = array_merge($settings,array('globalMapSatellites' => 'FALSE'));
1496
+		$settings = array_merge($settings, array('globalMapSatellites' => 'FALSE'));
1497 1497
 	}
1498
-	$map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING);
1498
+	$map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING);
1499 1499
 	if ($map3ddefault == 'map3ddefault') {
1500
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE'));
1500
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE'));
1501 1501
 	} else {
1502
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE'));
1502
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE'));
1503 1503
 	}
1504
-	$map3dliveries = filter_input(INPUT_POST,'map3dliveries',FILTER_SANITIZE_STRING);
1504
+	$map3dliveries = filter_input(INPUT_POST, 'map3dliveries', FILTER_SANITIZE_STRING);
1505 1505
 	if ($map3dliveries == 'map3dliveries') {
1506
-		$settings = array_merge($settings,array('globalMap3DLiveries' => 'TRUE'));
1506
+		$settings = array_merge($settings, array('globalMap3DLiveries' => 'TRUE'));
1507 1507
 	} else {
1508
-		$settings = array_merge($settings,array('globalMap3DLiveries' => 'FALSE'));
1508
+		$settings = array_merge($settings, array('globalMap3DLiveries' => 'FALSE'));
1509 1509
 	}
1510
-	$translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING);
1510
+	$translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING);
1511 1511
 	if ($translate == 'translate') {
1512
-		$settings = array_merge($settings,array('globalTranslate' => 'TRUE'));
1512
+		$settings = array_merge($settings, array('globalTranslate' => 'TRUE'));
1513 1513
 	} else {
1514
-		$settings = array_merge($settings,array('globalTranslate' => 'FALSE'));
1514
+		$settings = array_merge($settings, array('globalTranslate' => 'FALSE'));
1515 1515
 	}
1516
-	$realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING);
1516
+	$realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING);
1517 1517
 	if ($realairlines == 'realairlines') {
1518
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE'));
1518
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE'));
1519 1519
 	} else {
1520
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE'));
1520
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE'));
1521 1521
 	}
1522
-	$estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING);
1522
+	$estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING);
1523 1523
 	if ($estimation == 'estimation') {
1524
-		$settings = array_merge($settings,array('globalMapEstimation' => 'TRUE'));
1524
+		$settings = array_merge($settings, array('globalMapEstimation' => 'TRUE'));
1525 1525
 	} else {
1526
-		$settings = array_merge($settings,array('globalMapEstimation' => 'FALSE'));
1526
+		$settings = array_merge($settings, array('globalMapEstimation' => 'FALSE'));
1527 1527
 	}
1528
-	$metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING);
1528
+	$metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING);
1529 1529
 	if ($metar == 'metar') {
1530
-		$settings = array_merge($settings,array('globalMETAR' => 'TRUE'));
1530
+		$settings = array_merge($settings, array('globalMETAR' => 'TRUE'));
1531 1531
 	} else {
1532
-		$settings = array_merge($settings,array('globalMETAR' => 'FALSE'));
1532
+		$settings = array_merge($settings, array('globalMETAR' => 'FALSE'));
1533 1533
 	}
1534
-	$metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING);
1534
+	$metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING);
1535 1535
 	if ($metarcycle == 'metarcycle') {
1536
-		$settings = array_merge($settings,array('globalMETARcycle' => 'TRUE'));
1536
+		$settings = array_merge($settings, array('globalMETARcycle' => 'TRUE'));
1537 1537
 	} else {
1538
-		$settings = array_merge($settings,array('globalMETARcycle' => 'FALSE'));
1538
+		$settings = array_merge($settings, array('globalMETARcycle' => 'FALSE'));
1539 1539
 	}
1540
-	$fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING);
1540
+	$fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING);
1541 1541
 	if ($fork == 'fork') {
1542
-		$settings = array_merge($settings,array('globalFork' => 'TRUE'));
1542
+		$settings = array_merge($settings, array('globalFork' => 'TRUE'));
1543 1543
 	} else {
1544
-		$settings = array_merge($settings,array('globalFork' => 'FALSE'));
1544
+		$settings = array_merge($settings, array('globalFork' => 'FALSE'));
1545 1545
 	}
1546 1546
 
1547
-	$colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING);
1547
+	$colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING);
1548 1548
 	if ($colormap == 'colormap') {
1549
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE'));
1549
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE'));
1550 1550
 	} else {
1551
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE'));
1551
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE'));
1552 1552
 	}
1553 1553
 	
1554 1554
 	if (isset($_POST['aircrafticoncolor'])) {
1555
-		$aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING);
1556
-		$settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1)));
1555
+		$aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING);
1556
+		$settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1)));
1557 1557
 	}
1558 1558
 
1559
-	$airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT);
1560
-	$settings = array_merge($settings,array('globalAirportZoom' => $airportzoom));
1559
+	$airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT);
1560
+	$settings = array_merge($settings, array('globalAirportZoom' => $airportzoom));
1561 1561
 
1562
-	$unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING);
1563
-	$settings = array_merge($settings,array('globalUnitDistance' => $unitdistance));
1564
-	$unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING);
1565
-	$settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude));
1566
-	$unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING);
1567
-	$settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed));
1562
+	$unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING);
1563
+	$settings = array_merge($settings, array('globalUnitDistance' => $unitdistance));
1564
+	$unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING);
1565
+	$settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude));
1566
+	$unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING);
1567
+	$settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed));
1568 1568
 
1569
-	$mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING);
1569
+	$mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING);
1570 1570
 	if ($mappopup == 'mappopup') {
1571
-		$settings = array_merge($settings,array('globalMapPopup' => 'TRUE'));
1571
+		$settings = array_merge($settings, array('globalMapPopup' => 'TRUE'));
1572 1572
 	} else {
1573
-		$settings = array_merge($settings,array('globalMapPopup' => 'FALSE'));
1573
+		$settings = array_merge($settings, array('globalMapPopup' => 'FALSE'));
1574 1574
 	}
1575
-	$airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING);
1575
+	$airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING);
1576 1576
 	if ($airportpopup == 'airportpopup') {
1577
-		$settings = array_merge($settings,array('globalAirportPopup' => 'TRUE'));
1577
+		$settings = array_merge($settings, array('globalAirportPopup' => 'TRUE'));
1578 1578
 	} else {
1579
-		$settings = array_merge($settings,array('globalAirportPopup' => 'FALSE'));
1579
+		$settings = array_merge($settings, array('globalAirportPopup' => 'FALSE'));
1580 1580
 	}
1581
-	$maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING);
1581
+	$maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING);
1582 1582
 	if ($maphistory == 'maphistory') {
1583
-		$settings = array_merge($settings,array('globalMapHistory' => 'TRUE'));
1583
+		$settings = array_merge($settings, array('globalMapHistory' => 'TRUE'));
1584 1584
 	} else {
1585
-		$settings = array_merge($settings,array('globalMapHistory' => 'FALSE'));
1585
+		$settings = array_merge($settings, array('globalMapHistory' => 'FALSE'));
1586 1586
 	}
1587
-	$maptooltip = filter_input(INPUT_POST,'maptooltip',FILTER_SANITIZE_STRING);
1587
+	$maptooltip = filter_input(INPUT_POST, 'maptooltip', FILTER_SANITIZE_STRING);
1588 1588
 	if ($maptooltip == 'maptooltip') {
1589
-		$settings = array_merge($settings,array('globalMapTooltip' => 'TRUE'));
1589
+		$settings = array_merge($settings, array('globalMapTooltip' => 'TRUE'));
1590 1590
 	} else {
1591
-		$settings = array_merge($settings,array('globalMapTooltip' => 'FALSE'));
1591
+		$settings = array_merge($settings, array('globalMapTooltip' => 'FALSE'));
1592 1592
 	}
1593
-	$flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING);
1593
+	$flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING);
1594 1594
 	if ($flightroute == 'flightroute') {
1595
-		$settings = array_merge($settings,array('globalMapRoute' => 'TRUE'));
1595
+		$settings = array_merge($settings, array('globalMapRoute' => 'TRUE'));
1596 1596
 	} else {
1597
-		$settings = array_merge($settings,array('globalMapRoute' => 'FALSE'));
1597
+		$settings = array_merge($settings, array('globalMapRoute' => 'FALSE'));
1598 1598
 	}
1599
-	$flightremainingroute = filter_input(INPUT_POST,'flightremainingroute',FILTER_SANITIZE_STRING);
1599
+	$flightremainingroute = filter_input(INPUT_POST, 'flightremainingroute', FILTER_SANITIZE_STRING);
1600 1600
 	if ($flightremainingroute == 'flightremainingroute') {
1601
-		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'TRUE'));
1601
+		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'TRUE'));
1602 1602
 	} else {
1603
-		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'FALSE'));
1603
+		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'FALSE'));
1604 1604
 	}
1605
-	$allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING);
1605
+	$allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING);
1606 1606
 	if ($allflights == 'allflights') {
1607
-		$settings = array_merge($settings,array('globalAllFlights' => 'TRUE'));
1607
+		$settings = array_merge($settings, array('globalAllFlights' => 'TRUE'));
1608 1608
 	} else {
1609
-		$settings = array_merge($settings,array('globalAllFlights' => 'FALSE'));
1609
+		$settings = array_merge($settings, array('globalAllFlights' => 'FALSE'));
1610 1610
 	}
1611
-	$bbox = filter_input(INPUT_POST,'bbox',FILTER_SANITIZE_STRING);
1611
+	$bbox = filter_input(INPUT_POST, 'bbox', FILTER_SANITIZE_STRING);
1612 1612
 	if ($bbox == 'bbox') {
1613
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'TRUE'));
1613
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'TRUE'));
1614 1614
 	} else {
1615
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'FALSE'));
1615
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'FALSE'));
1616 1616
 	}
1617
-	$groundaltitude = filter_input(INPUT_POST,'groundaltitude',FILTER_SANITIZE_STRING);
1617
+	$groundaltitude = filter_input(INPUT_POST, 'groundaltitude', FILTER_SANITIZE_STRING);
1618 1618
 	if ($groundaltitude == 'groundaltitude') {
1619
-		$settings = array_merge($settings,array('globalGroundAltitude' => 'TRUE'));
1619
+		$settings = array_merge($settings, array('globalGroundAltitude' => 'TRUE'));
1620 1620
 	} else {
1621
-		$settings = array_merge($settings,array('globalGroundAltitude' => 'FALSE'));
1621
+		$settings = array_merge($settings, array('globalGroundAltitude' => 'FALSE'));
1622 1622
 	}
1623
-	$waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING);
1623
+	$waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING);
1624 1624
 	if ($waypoints == 'waypoints') {
1625
-		$settings = array_merge($settings,array('globalWaypoints' => 'TRUE'));
1625
+		$settings = array_merge($settings, array('globalWaypoints' => 'TRUE'));
1626 1626
 	} else {
1627
-		$settings = array_merge($settings,array('globalWaypoints' => 'FALSE'));
1627
+		$settings = array_merge($settings, array('globalWaypoints' => 'FALSE'));
1628 1628
 	}
1629
-	$geoid = filter_input(INPUT_POST,'geoid',FILTER_SANITIZE_STRING);
1629
+	$geoid = filter_input(INPUT_POST, 'geoid', FILTER_SANITIZE_STRING);
1630 1630
 	if ($geoid == 'geoid') {
1631
-		$settings = array_merge($settings,array('globalGeoid' => 'TRUE'));
1631
+		$settings = array_merge($settings, array('globalGeoid' => 'TRUE'));
1632 1632
 	} else {
1633
-		$settings = array_merge($settings,array('globalGeoid' => 'FALSE'));
1633
+		$settings = array_merge($settings, array('globalGeoid' => 'FALSE'));
1634 1634
 	}
1635
-	$geoid_source = filter_input(INPUT_POST,'geoid_source',FILTER_SANITIZE_STRING);
1636
-	$settings = array_merge($settings,array('globalGeoidSource' => $geoid_source));
1635
+	$geoid_source = filter_input(INPUT_POST, 'geoid_source', FILTER_SANITIZE_STRING);
1636
+	$settings = array_merge($settings, array('globalGeoidSource' => $geoid_source));
1637 1637
 
1638
-	$noairlines = filter_input(INPUT_POST,'noairlines',FILTER_SANITIZE_STRING);
1638
+	$noairlines = filter_input(INPUT_POST, 'noairlines', FILTER_SANITIZE_STRING);
1639 1639
 	if ($noairlines == 'noairlines') {
1640
-		$settings = array_merge($settings,array('globalNoAirlines' => 'TRUE'));
1640
+		$settings = array_merge($settings, array('globalNoAirlines' => 'TRUE'));
1641 1641
 	} else {
1642
-		$settings = array_merge($settings,array('globalNoAirlines' => 'FALSE'));
1642
+		$settings = array_merge($settings, array('globalNoAirlines' => 'FALSE'));
1643 1643
 	}
1644 1644
 
1645
-	$tsk = filter_input(INPUT_POST,'tsk',FILTER_SANITIZE_STRING);
1645
+	$tsk = filter_input(INPUT_POST, 'tsk', FILTER_SANITIZE_STRING);
1646 1646
 	if ($tsk == 'tsk') {
1647
-		$settings = array_merge($settings,array('globalTSK' => 'TRUE'));
1647
+		$settings = array_merge($settings, array('globalTSK' => 'TRUE'));
1648 1648
 	} else {
1649
-		$settings = array_merge($settings,array('globalTSK' => 'FALSE'));
1649
+		$settings = array_merge($settings, array('globalTSK' => 'FALSE'));
1650 1650
 	}
1651
-	$mapmatching = filter_input(INPUT_POST,'mapmatching',FILTER_SANITIZE_STRING);
1651
+	$mapmatching = filter_input(INPUT_POST, 'mapmatching', FILTER_SANITIZE_STRING);
1652 1652
 	if ($mapmatching == 'mapmatching') {
1653
-		$settings = array_merge($settings,array('globalMapMatching' => 'TRUE'));
1653
+		$settings = array_merge($settings, array('globalMapMatching' => 'TRUE'));
1654 1654
 	} else {
1655
-		$settings = array_merge($settings,array('globalMapMatching' => 'FALSE'));
1655
+		$settings = array_merge($settings, array('globalMapMatching' => 'FALSE'));
1656 1656
 	}
1657
-	$mapmatchingsource = filter_input(INPUT_POST,'mapmatchingsource',FILTER_SANITIZE_STRING);
1658
-	$settings = array_merge($settings,array('globalMapMatchingSource' => $mapmatchingsource));
1659
-	$graphhopper = filter_input(INPUT_POST,'graphhopper',FILTER_SANITIZE_STRING);
1660
-	$settings = array_merge($settings,array('globalGraphHopperKey' => $graphhopper));
1657
+	$mapmatchingsource = filter_input(INPUT_POST, 'mapmatchingsource', FILTER_SANITIZE_STRING);
1658
+	$settings = array_merge($settings, array('globalMapMatchingSource' => $mapmatchingsource));
1659
+	$graphhopper = filter_input(INPUT_POST, 'graphhopper', FILTER_SANITIZE_STRING);
1660
+	$settings = array_merge($settings, array('globalGraphHopperKey' => $graphhopper));
1661 1661
 
1662
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1662
+	if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE'));
1663 1663
 
1664 1664
 	// Set some defaults values...
1665 1665
 	if (!isset($globalAircraftImageSources)) {
1666
-	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1667
-	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1666
+	    $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters');
1667
+	    $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources));
1668 1668
 	}
1669 1669
 
1670 1670
 	if (!isset($globalSchedulesSources)) {
1671
-	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1672
-    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1671
+	    $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware');
1672
+    	    $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources));
1673 1673
     	}
1674 1674
 
1675
-	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1675
+	$settings = array_merge($settings, array('globalInstalled' => 'TRUE'));
1676 1676
 
1677 1677
 	if ($error == '') settings::modify_settings($settings);
1678 1678
 	if ($error == '') settings::comment_settings($settings_comment);
Please login to merge, or discard this patch.