Completed
Push — master ( f32ba6...d43b85 )
by Yannick
30:30
created
require/class.METAR.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 			$Connection = new Connection();
69 69
 			$sth = $Connection->db->prepare($query);
70 70
 			$sth->execute();
71
-		} catch(PDOException $e) {
71
+		} catch (PDOException $e) {
72 72
 			return "error : ".$e->getMessage();
73 73
 		}
74 74
 		$row = $sth->fetch(PDO::FETCH_ASSOC);
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 			$Connection = new Connection();
88 88
 			$sth = $Connection->db->prepare($query);
89 89
 			$sth->execute();
90
-		} catch(PDOException $e) {
90
+		} catch (PDOException $e) {
91 91
 			return "error : ".$e->getMessage();
92 92
 		}
93 93
 	}
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
 	public function parse($data) {
101 101
 		//$data = str_replace(array('\n','\r','\r','\n'),'',$data);
102 102
 		$codes = implode('|', array_keys($this->texts));
103
-		$regWeather = '#^(\+|\-|VC)?(' . $codes . ')(' . $codes . ')?$#';
103
+		$regWeather = '#^(\+|\-|VC)?('.$codes.')('.$codes.')?$#';
104 104
 		//$pieces = explode(' ',$data);
105
-		$pieces = preg_split('/\s/',$data);
105
+		$pieces = preg_split('/\s/', $data);
106 106
 		$pos = 0;
107 107
 		if ($pieces[0] == 'METAR') $pos++;
108 108
 		elseif ($pieces[0] == 'SPECI') $pos++;
@@ -112,25 +112,25 @@  discard block
 block discarded – undo
112 112
 		$result['location'] = $pieces[$pos];
113 113
 		$pos++;
114 114
 		if (!isset($pieces[$pos])) return $result;
115
-		$result['dayofmonth'] = substr($pieces[$pos],0,2);
116
-		$result['time'] = substr($pieces[$pos],2,4);
115
+		$result['dayofmonth'] = substr($pieces[$pos], 0, 2);
116
+		$result['time'] = substr($pieces[$pos], 2, 4);
117 117
 		$c = count($pieces);
118
-		for($pos++; $pos < $c; $pos++) {
118
+		for ($pos++; $pos < $c; $pos++) {
119 119
 			$piece = $pieces[$pos];
120 120
 			if ($piece == 'RMK') break;
121 121
 			if ($piece == 'AUTO') $result['auto'] = true;
122 122
 			if ($piece == 'COR') $result['correction'] = true;
123 123
 			// Wind Speed
124 124
 			if (preg_match('#(VRB|\d\d\d)(\d\d)(?:G(\d\d))?(KT|MPS|KPH)(?: (\d{1,3})V(\d{1,3}))?$#', $piece, $matches)) {
125
-				$result['wind']['direction'] = (float)$matches[1];
125
+				$result['wind']['direction'] = (float) $matches[1];
126 126
 				$result['wind']['unit'] = $matches[4];
127
-				if ($result['wind']['unit'] == 'KT') $result['wind']['speed'] = round(((float)$matches[2])*0.51444444444,2);
128
-				elseif ($result['wind']['unit'] == 'KPH') $result['wind']['speed'] = round(((float)$matches[2])*1000,2);
129
-				elseif ($result['wind']['unit'] == 'MPS') $result['wind']['speed'] = round(((float)$matches[2]),2);
130
-				$result['wind']['gust'] = (float)$matches[3];
127
+				if ($result['wind']['unit'] == 'KT') $result['wind']['speed'] = round(((float) $matches[2])*0.51444444444, 2);
128
+				elseif ($result['wind']['unit'] == 'KPH') $result['wind']['speed'] = round(((float) $matches[2])*1000, 2);
129
+				elseif ($result['wind']['unit'] == 'MPS') $result['wind']['speed'] = round(((float) $matches[2]), 2);
130
+				$result['wind']['gust'] = (float) $matches[3];
131 131
 				$result['wind']['unit'] = $matches[4];
132
-				$result['wind']['min_variation'] = array_key_exists(5,$matches) ? $matches[5] : 0;
133
-				$result['wind']['max_variation'] = array_key_exists(6,$matches) ? $matches[6] : 0;
132
+				$result['wind']['min_variation'] = array_key_exists(5, $matches) ? $matches[5] : 0;
133
+				$result['wind']['max_variation'] = array_key_exists(6, $matches) ? $matches[6] : 0;
134 134
 			}
135 135
 
136 136
 /*    			if (preg_match('#^([0-9]{3})([0-9]{2})(G([0-9]{2}))?(KT|MPS)$#', $piece, $matches)) {
@@ -151,17 +151,17 @@  discard block
 block discarded – undo
151 151
 
152 152
 			// Temperature
153 153
 			if (preg_match('#^(M?[0-9]{2,})/(M?[0-9]{2,})$#', $piece, $matches)) {
154
-				$temp = (float)$matches[1];
154
+				$temp = (float) $matches[1];
155 155
 				if ($matches[1]{0} == 'M') {
156
-					$temp = ((float)substr($matches[1], 1)) * -1;
156
+					$temp = ((float) substr($matches[1], 1))*-1;
157 157
 				}
158 158
 				$result['temperature'] = $temp;
159
-				$dew = (float)$matches[2];
159
+				$dew = (float) $matches[2];
160 160
 				if ($matches[2]{0} == 'M') {
161
-					$dew = ((float)substr($matches[2], 1)) * -1;
161
+					$dew = ((float) substr($matches[2], 1))*-1;
162 162
 				}
163 163
 				$result['dew'] = $dew;
164
-				$result['rh'] = round(100*(exp((17.625*$dew)/(243.04+$dew))/exp((17.625*$temp)/(243.04+$temp))));
164
+				$result['rh'] = round(100*(exp((17.625*$dew)/(243.04 + $dew))/exp((17.625*$temp)/(243.04 + $temp))));
165 165
 			}
166 166
 			// QNH
167 167
 			if (preg_match('#^(A|Q)([0-9]{4})$#', $piece, $matches)) {
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 					$result['QNH'] = $matches[2];
172 172
 				} else {
173 173
 					// inHg
174
-					$result['QNH'] = round(($matches[2] / 100)*33.86389,2);
174
+					$result['QNH'] = round(($matches[2]/100)*33.86389, 2);
175 175
 				}
176 176
 				/*
177 177
     				$result['QNH'] = $matches[1] == 'Q' ? $matches[2] : ($matches[2] / 100);
@@ -192,12 +192,12 @@  discard block
 block discarded – undo
192 192
     			// Visibility
193 193
 			if (preg_match('#^([0-9]{4})|(([0-9]{1,4})SM)$#', $piece, $matches)) {
194 194
 				if (isset($matches[3]) && strlen($matches[3]) > 0) {
195
-					$result['visibility'] = (float)$matches[3] * 1609.34;
195
+					$result['visibility'] = (float) $matches[3]*1609.34;
196 196
 				} else {
197 197
 					if ($matches[1] == '9999') {
198 198
 						$result['visibility'] = '> 10000';
199 199
 					} else {
200
-						$result['visibility'] = (float)$matches[1];
200
+						$result['visibility'] = (float) $matches[1];
201 201
 					}
202 202
 				}
203 203
 			}
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 				elseif ($type == 'OVC') $cloud['type'] = 'Overcast/Full cloud coverage';
221 221
 				elseif ($type == 'VV') $cloud['type'] = 'Vertical visibility';
222 222
 				$cloud['type_code'] = $type;
223
-				$cloud['level'] = round(((float)$matches[2]) * 100 * 0.3048);
223
+				$cloud['level'] = round(((float) $matches[2])*100*0.3048);
224 224
 				if (isset($matches[3])) $significant = $matches[3];
225 225
 				else $significant = '';
226 226
 				if ($significant == 'CB') $cloud['significant'] = 'Cumulonimbus';
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
 				$rvr['runway'] = $matches[1];
242 242
 				$rvr['assessment'] = $matches[2];
243 243
 				$rvr['rvr'] = $matches[3];
244
-				$rvr['rvr_max'] = array_key_exists(4,$matches) ? $matches[4] : 0;
245
-				$rvr['unit'] = array_key_exists(5,$matches) ? $matches[5] : '';
244
+				$rvr['rvr_max'] = array_key_exists(4, $matches) ? $matches[4] : 0;
245
+				$rvr['unit'] = array_key_exists(5, $matches) ? $matches[5] : '';
246 246
 				$result['RVR'] = $rvr;
247 247
 			}
248 248
 			//if (preg_match('#^(R[A-Z0-9]{2,3})/([0-9]{4})(V([0-9]{4}))?(FT)?$#', $piece, $matches)) {
@@ -255,12 +255,12 @@  discard block
 block discarded – undo
255 255
 				$result['RVR']['friction'] = $matches[5];
256 256
 			}
257 257
 			if (preg_match('#^(R[A-Z0-9]{2,3})/([0-9]{4})(V([0-9]{4}))?(FT)?$#', $piece, $matches)) {
258
-				if (isset($matches[5])) $range = array('exact' => (float)$matches[2], 'unit' => $matches[5] ? 'FT' : 'M');
259
-				else $range = array('exact' => (float)$matches[2], 'unit' => 'M');
258
+				if (isset($matches[5])) $range = array('exact' => (float) $matches[2], 'unit' => $matches[5] ? 'FT' : 'M');
259
+				else $range = array('exact' => (float) $matches[2], 'unit' => 'M');
260 260
 				if (isset($matches[3])) {
261 261
 					$range = Array(
262
-					    'from' => (float)$matches[2],
263
-					    'to'   => (float)$matches[4],
262
+					    'from' => (float) $matches[2],
263
+					    'to'   => (float) $matches[4],
264 264
 					    'unit' => $matches[5] ? 'FT' : 'M'
265 265
 					);
266 266
 				}
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 		try {
314 314
 			$sth = $this->db->prepare($query);
315 315
 			$sth->execute($query_values);
316
-		} catch(PDOException $e) {
316
+		} catch (PDOException $e) {
317 317
 			return "error : ".$e->getMessage();
318 318
 		}
319 319
 		$all = $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -329,19 +329,19 @@  discard block
 block discarded – undo
329 329
 	 * @param String $metar METAR text
330 330
 	 * @param String $date date of the METAR
331 331
 	*/
332
-	public function addMETAR($location,$metar,$date) {
332
+	public function addMETAR($location, $metar, $date) {
333 333
 		global $globalDBdriver;
334
-		$date = date('Y-m-d H:i:s',strtotime($date));
334
+		$date = date('Y-m-d H:i:s', strtotime($date));
335 335
 		if ($globalDBdriver == 'mysql') {
336 336
 			$query = "INSERT INTO metar (metar_location,metar_date,metar) VALUES (:location,:date,:metar) ON DUPLICATE KEY UPDATE metar_date = :date, metar = :metar";
337 337
 		} else {
338 338
 			$query = "UPDATE metar SET metar_date = :date, metar = :metar WHERE metar_location = :location;INSERT INTO metar (metar_location,metar_date,metar) SELECT :location,:date,:metar WHERE NOT EXISTS (SELECT 1 FROM metar WHERE metar_location = :location);";
339 339
 		}
340
-		$query_values = array(':location' => $location,':date' => $date,':metar' => utf8_encode($metar));
340
+		$query_values = array(':location' => $location, ':date' => $date, ':metar' => utf8_encode($metar));
341 341
 		try {
342 342
 			$sth = $this->db->prepare($query);
343 343
 			$sth->execute($query_values);
344
-		} catch(PDOException $e) {
344
+		} catch (PDOException $e) {
345 345
 			return "error : ".$e->getMessage();
346 346
 		}
347 347
 	}
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 		try {
357 357
 			$sth = $this->db->prepare($query);
358 358
 			$sth->execute($query_values);
359
-		} catch(PDOException $e) {
359
+		} catch (PDOException $e) {
360 360
 			return "error : ".$e->getMessage();
361 361
 		}
362 362
 	}
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 		try {
370 370
 			$sth = $this->db->prepare($query);
371 371
 			$sth->execute();
372
-		} catch(PDOException $e) {
372
+		} catch (PDOException $e) {
373 373
 			return "error : ".$e->getMessage();
374 374
 		}
375 375
 	}
@@ -383,29 +383,29 @@  discard block
 block discarded – undo
383 383
 		date_default_timezone_set("UTC");
384 384
 		$Common = new Common();
385 385
 		if (isset($globalIVAO) && $globalIVAO) {
386
-			$Common->download('http://wx.ivao.aero/metar.php',dirname(__FILE__).'/../install/tmp/ivaometar.txt');
387
-			$handle = fopen(dirname(__FILE__).'/../install/tmp/ivaometar.txt',"r");
386
+			$Common->download('http://wx.ivao.aero/metar.php', dirname(__FILE__).'/../install/tmp/ivaometar.txt');
387
+			$handle = fopen(dirname(__FILE__).'/../install/tmp/ivaometar.txt', "r");
388 388
 		} else {
389
-			$Common->download('http://tgftp.nws.noaa.gov/data/observations/metar/cycles/'.date('H').'Z.TXT',dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT');
390
-			$handle = fopen(dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT',"r");
389
+			$Common->download('http://tgftp.nws.noaa.gov/data/observations/metar/cycles/'.date('H').'Z.TXT', dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT');
390
+			$handle = fopen(dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT', "r");
391 391
 		}
392 392
 		if ($handle) {
393 393
 			if (isset($globalDebug) && $globalDebug) echo "Done - Updating DB...";
394 394
 			$date = '';
395 395
 			if ($globalTransaction) $this->db->beginTransaction();
396
-			while(($line = fgets($handle,4096)) !== false) {
397
-				$line = str_replace(array("\r\n","\r", "\n"), '', $line);
398
-				if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#',$line)) {
396
+			while (($line = fgets($handle, 4096)) !== false) {
397
+				$line = str_replace(array("\r\n", "\r", "\n"), '', $line);
398
+				if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#', $line)) {
399 399
 					$date = $line;
400 400
 				} elseif (trim($line) != '') {
401 401
 					if ($date == '') $date = date('Y/m/d H:m');
402 402
 					$pos = 0;
403
-					$pieces = preg_split('/\s/',$line);
403
+					$pieces = preg_split('/\s/', $line);
404 404
 					if ($pieces[0] == 'METAR') $pos++;
405 405
 					if (strlen($pieces[$pos]) != 4) $pos++;
406 406
 					$location = $pieces[$pos];
407 407
 					//if ($location == 'LFLL') echo 'location: '.$location.' - date: '.$date.' - data: '.$line."\n";
408
-					echo $this->addMETAR($location,$line,$date);
408
+					echo $this->addMETAR($location, $line, $date);
409 409
 				}
410 410
 			}
411 411
 			fclose($handle);
@@ -424,23 +424,23 @@  discard block
 block discarded – undo
424 424
 		if ($globalMETARurl == '') return array();
425 425
 		date_default_timezone_set("UTC");
426 426
 		$Common = new Common();
427
-		$url = str_replace('{icao}',$icao,$globalMETARurl);
427
+		$url = str_replace('{icao}', $icao, $globalMETARurl);
428 428
 		$cycle = $Common->getData($url);
429 429
 		$date = '';
430
-		foreach(explode("\n",$cycle) as $line) {
431
-			$line = str_replace(array("\r\n","\r", "\n"), '', $line);
432
-			if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#',$line)) {
430
+		foreach (explode("\n", $cycle) as $line) {
431
+			$line = str_replace(array("\r\n", "\r", "\n"), '', $line);
432
+			if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#', $line)) {
433 433
 				$date = $line;
434 434
 			} 
435 435
 			if (trim($line) != '') {
436 436
 				if ($date == '') $date = date('Y/m/d H:m');
437 437
 				$pos = 0;
438
-				$pieces = preg_split('/\s/',$line);
438
+				$pieces = preg_split('/\s/', $line);
439 439
 				if ($pieces[0] == 'METAR') $pos++;
440 440
 				if (strlen($pieces[$pos]) != 4) $pos++;
441 441
 				$location = $pieces[$pos];
442 442
 				if (strlen($location == 4)) {
443
-					$this->addMETAR($location,$line,$date);
443
+					$this->addMETAR($location, $line, $date);
444 444
 					return array('0' => array('metar_date' => $date, 'metar_location' => $location, 'metar' => $line));
445 445
 				} else return array();
446 446
 			}
Please login to merge, or discard this patch.
index.php 2 patches
Indentation   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     <?php }; if (isset($globalSatellite) && $globalSatellite) { ?><td><div id="ibxsatellite"><h4><?php echo _("Satellites Displayed"); ?></h4><br /><i class="fa fa-spinner fa-pulse fa-fw"></i></div></td><?php } ?>
51 51
 </tr></table></div>
52 52
 <?php
53
-    if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
53
+	if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
54 54
 ?>
55 55
 <script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) print '?tsk='.$tsk; ?>"></script>
56 56
 <?php
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 <script src="<?php echo $globalURL; ?>/js/map-marine.3d.js.php"></script>
75 75
 <?php
76 76
 	}
77
-    }
77
+	}
78 78
 ?>
79 79
 
80 80
 <div id="sidebar" class="sidebar collapsed">
@@ -85,13 +85,13 @@  discard block
 block discarded – undo
85 85
 	<li><a href="" onclick="getUserLocation(); return false;" title="<?php echo _("Plot your Location"); ?>"><i class="fa fa-map-marker"></i></a></li>
86 86
 	<li><a href="" onclick="getCompassDirection(); return false;" title="<?php echo _("Compass Mode"); ?>"><i class="fa fa-compass"></i></a></li>
87 87
 <?php
88
-    //if ((isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') || (isset($globalBeta) && $globalBeta === TRUE)) {
88
+	//if ((isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') || (isset($globalBeta) && $globalBeta === TRUE)) {
89 89
 	if (isset($globalArchive) && $globalArchive == TRUE && (!isset($globalAircraft) || $globalAircraft === TRUE)) {
90 90
 ?>
91 91
 	<li><a href="#archive" role="tab" title="<?php echo _("Archive"); ?>"><i class="fa fa-archive"></i></a></li>
92 92
 <?php
93 93
 	}
94
-    //}
94
+	//}
95 95
 ?>
96 96
 	<li><a href="#home" role="tab" title="<?php echo _("Layers"); ?>"><i class="fa fa-map"></i></a></li>
97 97
 	<li><a href="#filters" role="tab" title="<?php echo _("Filters"); ?>"><i class="fa fa-filter"></i></a></li>
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 ?>
106 106
 
107 107
 <?php
108
-    if (isset($globalMap3D) && $globalMap3D) {
108
+	if (isset($globalMap3D) && $globalMap3D) {
109 109
 	if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
110 110
 ?>
111 111
 	<li><a href="" onclick="show3D(); return false;" role="tab" title="3D"><b>3D</b></a></li>
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	<li><a href="" onclick="show2D(); return false;" role="tab" title="2D"><b>2D</b></a></li>
116 116
 <?php
117 117
 	}
118
-    }
118
+	}
119 119
 ?>
120 120
     </ul>
121 121
 
@@ -264,15 +264,15 @@  discard block
 block discarded – undo
264 264
 		    </div>
265 265
 		</li>
266 266
 		<?php
267
-		    if (isset($globalDemo) && $globalDemo) {
267
+			if (isset($globalDemo) && $globalDemo) {
268 268
 		?>
269 269
 		<li><button type="button" class="btn btn-primary disabled"><?php echo _("Show archive"); ?></button> Disabled in Demo mode</li>
270 270
 		<?php
271
-		    } else {
271
+			} else {
272 272
 		?>
273 273
 		<li><button type="button" onclick="addarchive(begindate,enddate);" class="btn btn-primary"><?php echo _("Show archive"); ?></button></li>
274 274
 		<?php
275
-		    }
275
+			}
276 276
 		?>
277 277
 	    </ul>
278 278
 	    <ul>
@@ -291,83 +291,83 @@  discard block
 block discarded – undo
291 291
 				if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
292 292
 					if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider;
293 293
 					else $MapType = $_COOKIE['MapType'];
294
-			    ?>
294
+				?>
295 295
 			<select  class="selectpicker" onchange="mapType(this);">
296 296
 			    <?php
297 297
 				} else {
298 298
 					if (!isset($_COOKIE['MapType3D']) || $_COOKIE['MapType3D'] == '') $MapType = $globalMapProvider;
299 299
 					else $MapType = $_COOKIE['MapType3D'];
300
-			    ?>
300
+				?>
301 301
 			<select  class="selectpicker" onchange="mapType3D(this);">
302 302
 			    <?php
303 303
 				}
304
-			    ?>
304
+				?>
305 305
 			    <?php
306 306
 				if (isset($globalMapOffline) && $globalMapOffline === TRUE) {
307
-			    ?>
307
+				?>
308 308
 			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option>
309 309
 			    <?php
310 310
 				} else {
311
-				    if (file_exists(dirname(__FILE__).'/js/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml')) {
312
-			    ?>
311
+					if (file_exists(dirname(__FILE__).'/js/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml')) {
312
+				?>
313 313
 			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option>
314 314
 			    <?php
315
-				    }
316
-			    ?>
315
+					}
316
+				?>
317 317
 			    <option value="ArcGIS-Streetmap"<?php if ($MapType == 'ArcGIS-Streetmap') print ' selected'; ?>>ArcGIS Streetmap</option>
318 318
 			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Satellite') print ' selected'; ?>>ArcGIS Satellite</option>
319 319
 			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Ocean') print ' selected'; ?>>ArcGIS Ocean</option>
320 320
 			    <?php
321
-				    if (isset($globalBingMapKey) && $globalBingMapKey != '') {
322
-			    ?>
321
+					if (isset($globalBingMapKey) && $globalBingMapKey != '') {
322
+				?>
323 323
 			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option>
324 324
 			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option>
325 325
 			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option>
326 326
 			    <?php
327
-				    }
328
-			    ?>
327
+					}
328
+				?>
329 329
 			    <?php
330
-				    if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
331
-			    ?>
330
+					if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
331
+				?>
332 332
 			    <?php
333 333
 					if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
334
-			    ?>
334
+				?>
335 335
 			    <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option>
336 336
 			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option>
337 337
 			    <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option>
338 338
 			    <?php
339 339
 					}
340
-			    ?>
340
+				?>
341 341
 			    <?php
342 342
 					if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
343
-			    ?>
343
+				?>
344 344
 			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option>
345 345
 			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option>
346 346
 			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option>
347 347
 			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option>
348 348
 			    <?php
349 349
 					}
350
-			    ?>
350
+				?>
351 351
 			    <?php
352 352
 					if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
353
-			    ?>
353
+				?>
354 354
 			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option>
355 355
 			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option>
356 356
 			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option>
357 357
 			    <?php
358 358
 					}
359
-			    ?>
359
+				?>
360 360
 			    <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option>
361 361
 			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth</option>
362 362
 			    <?php
363
-				    }
364
-			    ?>
363
+					}
364
+				?>
365 365
 			    <option value="NatGeo-Street"<?php if ($MapType == 'NatGeo-Street') print ' selected'; ?>>National Geographic Street</option>
366 366
 			    <?php
367
-				    if (isset($globalMapboxToken) && $globalMapboxToken != '') {
367
+					if (isset($globalMapboxToken) && $globalMapboxToken != '') {
368 368
 					if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default';
369 369
 					else $MapBoxId = $_COOKIE['MapTypeId'];
370
-			    ?>
370
+				?>
371 371
 			    <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') print ' selected'; ?>>Mapbox GL</option>
372 372
 			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option>
373 373
 			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option>
@@ -382,17 +382,17 @@  discard block
 block discarded – undo
382 382
 			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option>
383 383
 			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option>
384 384
 			    <?php
385
-				    }
386
-			    ?>
385
+					}
386
+				?>
387 387
 			    <!--<option value="OpenSeaMap"<?php if ($MapType == 'OpenSeaMap') print ' selected'; ?>>OpenSeaMap</option>-->
388 388
 			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option>
389 389
 			    <?php
390 390
 				}
391
-			    ?>
391
+				?>
392 392
 			</select>
393 393
 		    </li>
394 394
 <?php
395
-    if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d' && (!isset($globalMapOffline) || $globalMapOffline === FALSE)) {
395
+	if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d' && (!isset($globalMapOffline) || $globalMapOffline === FALSE)) {
396 396
 ?>
397 397
 		    <li><?php echo _("Type of Terrain:"); ?>
398 398
 			<select  class="selectpicker" onchange="terrainType(this);">
@@ -403,18 +403,18 @@  discard block
 block discarded – undo
403 403
 			</select>
404 404
 		    </li>
405 405
 <?php
406
-    }
406
+	}
407 407
 ?>
408 408
 
409 409
 <?php
410
-    if (isset($globalMap3D) && $globalMap3D) {
410
+	if (isset($globalMap3D) && $globalMap3D) {
411 411
 ?>
412 412
 		    <li><div class="checkbox"><label><input type="checkbox" name="synchro2d3d" value="1" onclick="clickSyncMap2D3D(this)" <?php if (isset($_COOKIE['Map2D3DSync']) && $_COOKIE['Map2D3DSync'] == 'true') print 'checked'; ?> ><?php echo _("Use same type of map for 2D & 3D"); ?></label></div></li>
413 413
 <?php
414
-    }
414
+	}
415 415
 ?>
416 416
 <?php
417
-    if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
417
+	if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
418 418
 ?>
419 419
 		    <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if (isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') print 'checked'; ?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li>
420 420
 
@@ -437,17 +437,17 @@  discard block
 block discarded – undo
437 437
 		    <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Satellites animate between updates"); ?></label></div></li>
438 438
 <?php
439 439
 	}
440
-    }
440
+	}
441 441
 ?>
442 442
 		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li>
443 443
 		    <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) print 'checked'; ?> ><?php echo _("Display ground station on map"); ?></label></div></li>
444 444
 		    <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) print 'checked'; ?> ><?php echo _("Display weather station on map"); ?></label></div></li>
445 445
 <?php
446
-    if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d' && isset($globalMETAR) && isset($globalMETARcycle) && $globalMETAR && $globalMETARcycle) {
446
+	if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d' && isset($globalMETAR) && isset($globalMETARcycle) && $globalMETAR && $globalMETARcycle) {
447 447
 ?>
448 448
 		    <li><div class="checkbox"><label><input type="checkbox" name="displayweather" value="1" onclick="clickDisplayWeather(this)" <?php if ((isset($_COOKIE['show_Weather']) && $_COOKIE['show_Weather'] == 'true') || (!isset($_COOKIE['show_Weather']) && (isset($globalMapWeather) && $globalMapWeather === TRUE))) print 'checked'; ?> ><?php echo _("Display weather on 3D map"); ?></label></div></li>
449 449
 <?php
450
-    }
450
+	}
451 451
 ?>
452 452
 		    <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) print 'checked'; ?> ><?php echo _("Display lightning on map"); ?></label></div></li>
453 453
 <?php
@@ -463,82 +463,82 @@  discard block
 block discarded – undo
463 463
 	}
464 464
 ?>
465 465
 <?php
466
-    if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
466
+	if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
467 467
 ?>
468 468
 		    <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li>
469 469
 		    <li><div class="checkbox"><label><input type="checkbox" name="shadows" value="1" onclick="clickShadows(this)" <?php if ((!isset($_COOKIE['map3dnoshadows']) && (!isset($globalMap3DShadows) || $globalMap3DShadows)) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'false')) print 'checked'; ?> ><?php echo _("Use shadows"); ?></label></div></li>
470 470
 		    <li><div class="checkbox"><label><input type="checkbox" name="one3dmodel" value="1" onclick="useOne3Dmodel(this)" <?php if ((isset($_COOKIE['one3dmodel']) && $_COOKIE['one3dmodel'] == 'true') || (!isset($_COOKIE['one3dmodel']) && isset($globalMap3DOneModel) && $globalMap3DOneModel)) print 'checked'; ?> ><?php echo _("Use same 3D model for all aircraft (use fewer resources)"); ?></label></div></li>
471 471
 		    <li><div class="checkbox"><label><input type="checkbox" name="updaterealtime" value="1" onclick="clickUpdateRealtime(this)" <?php if ((isset($_COOKIE['updaterealtime']) && $_COOKIE['updaterealtime'] == 'true') || !isset($_COOKIE['updaterealtime'])) print 'checked'; ?> ><?php echo _("Display realtime data in infobox"); ?></label></div></li>
472 472
 <?php
473
-    }
474
-    if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) {
473
+	}
474
+	if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) {
475 475
 ?>
476 476
 		    <li><div class="checkbox"><label><input type="checkbox" name="displaysanta" value="1" onclick="clickSanta(this)"><i class="fa fa-snowflake-o" aria-hidden="true"></i> <?php echo _("Show Santa Claus now"); ?> <i class="fa fa-snowflake-o" aria-hidden="true"></i></label></div></li>
477 477
 <?php
478
-    }
478
+	}
479 479
 ?>
480 480
 		    <?php
481 481
 			if (function_exists('array_column')) {
482
-			    if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
483
-		    ?>
482
+				if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
483
+			?>
484 484
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
485 485
 		    <?php
486
-			    }
486
+				}
487 487
 			} elseif (isset($globalSources)) {
488
-			    $dispolar = false;
489
-			    foreach ($globalSources as $testsource) {
490
-			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
491
-			    }
492
-			    if ($dispolar) {
493
-		    ?>
488
+				$dispolar = false;
489
+				foreach ($globalSources as $testsource) {
490
+					if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
491
+				}
492
+				if ($dispolar) {
493
+			?>
494 494
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
495 495
 		    <?php
496
-			    }
497
-		        }
498
-		    ?>
496
+				}
497
+				}
498
+			?>
499 499
 <?php
500
-    if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
500
+	if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
501 501
 ?>
502 502
 
503 503
 		    <?php
504 504
 			if (!isset($globalAircraft) || $globalAircraft === TRUE) {
505
-		    	    if (extension_loaded('gd') && function_exists('gd_info')) {
506
-		    ?>
505
+					if (extension_loaded('gd') && function_exists('gd_info')) {
506
+			?>
507 507
 		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
508 508
 		    <?php 
509 509
 				if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') {
510
-		    ?>
510
+			?>
511 511
 			<li><?php echo _("Aircraft icon color:"); ?><input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>"></li>
512 512
 		    <?php
513 513
 				}
514
-			    }
515
-		        }
516
-		    ?>
514
+				}
515
+				}
516
+			?>
517 517
 		    <?php
518 518
 			if (isset($globalMarine) && $globalMarine === TRUE) {
519
-			    if (extension_loaded('gd') && function_exists('gd_info')) {
520
-		    ?>
519
+				if (extension_loaded('gd') && function_exists('gd_info')) {
520
+			?>
521 521
 		    <li><?php echo _("Marine icon color:"); ?>
522 522
 			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>">
523 523
 		    </li>
524 524
 		    <?php
525
-			    }
526
-		        }
527
-		    ?>
525
+				}
526
+				}
527
+			?>
528 528
 		    <?php
529 529
 			if (isset($globalTracker) && $globalTracker === TRUE) {
530
-			    if (extension_loaded('gd') && function_exists('gd_info')) {
531
-		    ?>
530
+				if (extension_loaded('gd') && function_exists('gd_info')) {
531
+			?>
532 532
 		    <li><?php echo _("Tracker icon color:"); ?>
533 533
 			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print '1a3151'; ?>">
534 534
 		    </li>
535 535
 		    <?php
536
-			    }
537
-		        }
538
-		    ?>
536
+				}
537
+				}
538
+			?>
539 539
 		    <?php
540 540
 			if (!isset($globalAircraft) || $globalAircraft === TRUE) {
541
-		    ?>
541
+			?>
542 542
 		    <li><?php echo _("Show airport icon at zoom level:"); ?>
543 543
 			<div class="range">
544 544
 			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>">
@@ -547,9 +547,9 @@  discard block
 block discarded – undo
547 547
 		    </li>
548 548
 		    <?php
549 549
 			}
550
-		    ?>
550
+			?>
551 551
 <?php
552
-    } elseif (isset($_COOKIE['MapFormat']) || $_COOKIE['MapFOrmat'] == '3d') {
552
+	} elseif (isset($_COOKIE['MapFormat']) || $_COOKIE['MapFOrmat'] == '3d') {
553 553
 ?>
554 554
 		    <li><?php echo _("Set scaling factor for rendering resolution:"); ?>
555 555
 			<div class="range">
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 		    </li>
588 588
 <?php
589 589
 	}
590
-    }
590
+	}
591 591
 ?>
592 592
 		    <li><?php echo _("Distance unit:"); ?>
593 593
 			<select class="selectpicker" onchange="unitdistance(this);">
@@ -620,19 +620,19 @@  discard block
 block discarded – undo
620 620
 		    <ul>
621 621
 		    <?php
622 622
 			if (!isset($globalAircraft) || $globalAircraft) {
623
-		    ?>
623
+			?>
624 624
 		    <?php
625 625
 			if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) {
626
-		    ?>
626
+			?>
627 627
 			<?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
628 628
 			<?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
629 629
 			<?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
630 630
 		    <?php
631 631
 			}
632
-		    ?>
632
+			?>
633 633
 		    <?php
634 634
 			if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) {
635
-		    ?>
635
+			?>
636 636
 			<?php if (isset($globalSBS1) && $globalSBS1) { ?>
637 637
 			    <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
638 638
 			<?php } ?>
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 			<?php } ?>
642 642
 		    <?php
643 643
 			}
644
-		    ?>
644
+			?>
645 645
 		    <li><?php echo _("Display airlines:"); ?>
646 646
 		    <br/>
647 647
 			<select class="selectpicker" multiple onchange="airlines(this);" id="display_airlines">
@@ -661,14 +661,14 @@  discard block
 block discarded – undo
661 661
 						echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>';
662 662
 					}
663 663
 				}
664
-			    ?>
664
+				?>
665 665
 			</select>
666 666
 		    </li>
667 667
 		    <?php
668 668
 			$Spotter = new Spotter();
669 669
 			$allalliancenames = $Spotter->getAllAllianceNames();
670 670
 			if (!empty($allalliancenames)) {
671
-		    ?>
671
+			?>
672 672
 		    <li><?php echo _("Display alliance:"); ?>
673 673
 		    <br/>
674 674
 			<select class="selectpicker" onchange="alliance(this);" id="display_alliance">
@@ -682,18 +682,18 @@  discard block
 block discarded – undo
682 682
 						echo '<option value="'.$alliance_name.'">'.$alliance_name.'</option>';
683 683
 					}
684 684
 				}
685
-			    ?>
685
+				?>
686 686
 			</select>
687 687
 		    </li>
688 688
 		    <?php
689 689
 			}
690
-		    ?>
690
+			?>
691 691
 		    <?php
692 692
 			}
693
-		    ?>
693
+			?>
694 694
 		    <?php
695 695
 			if (isset($globalAPRS) && $globalAPRS) {
696
-		    ?>
696
+			?>
697 697
 		    <li><?php echo _("Display APRS sources name:"); ?>
698 698
 			<select class="selectpicker" multiple onchange="sources(this);">
699 699
 			    <?php
@@ -717,18 +717,18 @@  discard block
 block discarded – undo
717 717
 						echo '<option value="'.$src['name'].'">'.$src['name'].'</option>';
718 718
 					}
719 719
 				}
720
-			    ?>
720
+				?>
721 721
 			</select>
722 722
 		    </li>
723 723
 		    <?php
724 724
 			}
725
-		    ?>
725
+			?>
726 726
 		    <?php
727 727
 			if (!isset($globalAircraft) || $globalAircraft) {
728
-		    ?>
728
+			?>
729 729
 		    <?php
730
-			    if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) {
731
-		    ?>
730
+				if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) {
731
+			?>
732 732
 		    <li><?php echo _("Display airlines of type:"); ?><br/>
733 733
 			<select class="selectpicker" onchange="airlinestype(this);">
734 734
 			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
@@ -738,14 +738,14 @@  discard block
 block discarded – undo
738 738
 			</select>
739 739
 		    </li>
740 740
 		    <?php
741
-			    }
742
-		    ?>
741
+				}
742
+			?>
743 743
 		    <?php
744 744
 			}
745
-		    ?>
745
+			?>
746 746
 		    <?php
747 747
 			if (isset($globalMarine) && $globalMarine) {
748
-		    ?>
748
+			?>
749 749
 		    <li>
750 750
 			<?php echo _("Display vessels with MMSI:"); ?>
751 751
 			<input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) print $_COOKIE['filter_mmsi']; ?>" />
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
 						foreach ($races as $race) {
765 765
 							print '<option value="'.$race['race_id'].'">'.$race['race_name'].'</option>';
766 766
 						}
767
-			    ?>
767
+				?>
768 768
 			</select>
769 769
 		    </li>
770 770
 
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
 					}
773 773
 				}
774 774
 			}
775
-		    ?>
775
+			?>
776 776
 		    <li>
777 777
 			<?php echo _("Display with ident:"); ?>
778 778
 			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" />
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
 	    </form>
786 786
     	</div>
787 787
 <?php
788
-    if (isset($globalSatellite) && $globalSatellite) {
788
+	if (isset($globalSatellite) && $globalSatellite) {
789 789
 ?>
790 790
         <div class="sidebar-pane" id="satellites">
791 791
 	    <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
@@ -825,14 +825,14 @@  discard block
 block discarded – undo
825 825
 						print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>';
826 826
 					}
827 827
 				}
828
-			    ?>
828
+				?>
829 829
 			</select>
830 830
 		    </li>
831 831
 		</ul>
832 832
 	    </form>
833 833
 	</div>
834 834
 <?php
835
-    }
835
+	}
836 836
 ?>
837 837
     </div>
838 838
 </div>
Please login to merge, or discard this patch.
Braces   +558 added lines, -141 removed lines patch added patch discarded remove patch
@@ -52,7 +52,10 @@  discard block
 block discarded – undo
52 52
 <?php
53 53
     if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
54 54
 ?>
55
-<script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) print '?tsk='.$tsk; ?>"></script>
55
+<script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) {
56
+	print '?tsk='.$tsk;
57
+}
58
+?>"></script>
56 59
 <?php
57 60
 	if (!isset($globalAircraft) || $globalAircraft) {
58 61
 ?>
@@ -148,13 +151,22 @@  discard block
 block discarded – undo
148 151
 <?php
149 152
 		if (!isset($globalAircraft) || $globalAircraft) {
150 153
 ?>
151
-				<li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') print 'checked'; ?> /><?php echo _("Display waypoints"); ?></label></div></li>
152
-				<li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') print 'checked'; ?> /><?php echo _("Display airspace"); ?></label></div></li>
154
+				<li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') {
155
+	print 'checked';
156
+}
157
+?> /><?php echo _("Display waypoints"); ?></label></div></li>
158
+				<li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') {
159
+	print 'checked';
160
+}
161
+?> /><?php echo _("Display airspace"); ?></label></div></li>
153 162
 <?php
154 163
 		}
155 164
 		if (isset($globalMarine) && $globalMarine) {
156 165
 ?>
157
-				<li><div class="checkbox"><label><input type="checkbox" name="openseamap" value="1" onclick="loadOpenSeaMap(this);" <?php if (isset($_COOKIE['openseamap']) && $_COOKIE['openseamap'] == 'true') print 'checked'; ?> /><?php echo _("Display OpenSeaMap"); ?></label></div></li>
166
+				<li><div class="checkbox"><label><input type="checkbox" name="openseamap" value="1" onclick="loadOpenSeaMap(this);" <?php if (isset($_COOKIE['openseamap']) && $_COOKIE['openseamap'] == 'true') {
167
+	print 'checked';
168
+}
169
+?> /><?php echo _("Display OpenSeaMap"); ?></label></div></li>
158 170
 <?php
159 171
 		}
160 172
 ?>
@@ -168,8 +180,14 @@  discard block
 block discarded – undo
168 180
 <?php
169 181
 		if (!isset($globalAircraft) || $globalAircraft) {
170 182
 ?>
171
-				<li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') print 'checked'; ?> /><?php echo _("Display waypoints"); ?> Beta</label></div></li>
172
-				<li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') print 'checked'; ?> /><?php echo _("Display airspace"); ?> Beta</label></div></li>
183
+				<li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') {
184
+	print 'checked';
185
+}
186
+?> /><?php echo _("Display waypoints"); ?> Beta</label></div></li>
187
+				<li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') {
188
+	print 'checked';
189
+}
190
+?> /><?php echo _("Display airspace"); ?> Beta</label></div></li>
173 191
 <?php
174 192
 		}
175 193
 ?>
@@ -183,14 +201,32 @@  discard block
 block discarded – undo
183 201
 		<h1>NOTAM</h1>
184 202
 		<form>
185 203
 			<ul>
186
-				<li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam(this);" <?php if (isset($_COOKIE['notam']) && $_COOKIE['notam'] == 'true') print 'checked'; ?> /><?php echo _("Display NOTAM"); ?></label></div></li>
204
+				<li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam(this);" <?php if (isset($_COOKIE['notam']) && $_COOKIE['notam'] == 'true') {
205
+	print 'checked';
206
+}
207
+?> /><?php echo _("Display NOTAM"); ?></label></div></li>
187 208
 				<li><?php echo _("NOTAM scope:"); ?>
188 209
 					<select class="selectpicker" onchange="notamscope(this);">
189
-						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') print ' selected'; ?>>All</option>
190
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') print ' selected'; ?>>Airport/Enroute warning</option>
191
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') print ' selected'; ?>>Airport warning</option>
192
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') print ' selected'; ?>>Navigation warning</option>
193
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') print ' selected'; ?>>Enroute warning</option>
210
+						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') {
211
+	print ' selected';
212
+}
213
+?>>All</option>
214
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') {
215
+	print ' selected';
216
+}
217
+?>>Airport/Enroute warning</option>
218
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') {
219
+	print ' selected';
220
+}
221
+?>>Airport warning</option>
222
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') {
223
+	print ' selected';
224
+}
225
+?>>Navigation warning</option>
226
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') {
227
+	print ' selected';
228
+}
229
+?>>Enroute warning</option>
194 230
 					</select
195 231
 				</li>
196 232
 			</ul>
@@ -218,7 +254,10 @@  discard block
 block discarded – undo
218 254
 		    <div class="form-group">
219 255
 			<label><?php echo _("From:"); ?></label>
220 256
 			<div class='input-group date' id='datetimepicker1'>
221
-			    <input type='text' id="start_date" name="start_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_begin']) && $_COOKIE['archive_begin'] != '') print date("Y-m-d H:i",$_COOKIE['archive_begin']).' UTC'; ?>" required />
257
+			    <input type='text' id="start_date" name="start_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_begin']) && $_COOKIE['archive_begin'] != '') {
258
+	print date("Y-m-d H:i",$_COOKIE['archive_begin']).' UTC';
259
+}
260
+?>" required />
222 261
 			    <span class="input-group-addon">
223 262
 				<span class="glyphicon glyphicon-calendar"></span>
224 263
 			    </span>
@@ -227,7 +266,10 @@  discard block
 block discarded – undo
227 266
 		    <div class="form-group">
228 267
 			<label><?php echo _("To:"); ?></label>
229 268
 			<div class='input-group date' id='datetimepicker2'>
230
-			    <input type='text' id="end_date" name="end_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_end']) && $_COOKIE['archive_end'] != '') print date("Y-m-d H:i",$_COOKIE['archive_end']).' UTC'; ?>" />
269
+			    <input type='text' id="end_date" name="end_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_end']) && $_COOKIE['archive_end'] != '') {
270
+	print date("Y-m-d H:i",$_COOKIE['archive_end']).' UTC';
271
+}
272
+?>" />
231 273
 			    <span class="input-group-addon">
232 274
 				<span class="glyphicon glyphicon-calendar"></span>
233 275
 			    </span>
@@ -259,8 +301,20 @@  discard block
 block discarded – undo
259 301
 		    </script>
260 302
 		<li><?php echo _("Playback speed:"); ?>
261 303
 		    <div class="range">
262
-			<input type="range" min="0" max="50" step="1" id="archivespeed" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php  if (isset($_POST['archivespeed'])) print $_POST['archivespeed']; elseif (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?>">
263
-			<output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?></output>
304
+			<input type="range" min="0" max="50" step="1" id="archivespeed" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php  if (isset($_POST['archivespeed'])) {
305
+	print $_POST['archivespeed'];
306
+} elseif (isset($_COOKIE['archive_speed'])) {
307
+	print $_COOKIE['archive_speed'];
308
+} else {
309
+	print '1';
310
+}
311
+?>">
312
+			<output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) {
313
+	print $_COOKIE['archive_speed'];
314
+} else {
315
+	print '1';
316
+}
317
+?></output>
264 318
 		    </div>
265 319
 		</li>
266 320
 		<?php
@@ -289,14 +343,20 @@  discard block
 block discarded – undo
289 343
 		    <li><?php echo _("Type of Map:"); ?>
290 344
 			    <?php
291 345
 				if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
292
-					if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider;
293
-					else $MapType = $_COOKIE['MapType'];
346
+					if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') {
347
+						$MapType = $globalMapProvider;
348
+					} else {
349
+						$MapType = $_COOKIE['MapType'];
350
+					}
294 351
 			    ?>
295 352
 			<select  class="selectpicker" onchange="mapType(this);">
296 353
 			    <?php
297 354
 				} else {
298
-					if (!isset($_COOKIE['MapType3D']) || $_COOKIE['MapType3D'] == '') $MapType = $globalMapProvider;
299
-					else $MapType = $_COOKIE['MapType3D'];
355
+					if (!isset($_COOKIE['MapType3D']) || $_COOKIE['MapType3D'] == '') {
356
+						$MapType = $globalMapProvider;
357
+					} else {
358
+						$MapType = $_COOKIE['MapType3D'];
359
+					}
300 360
 			    ?>
301 361
 			<select  class="selectpicker" onchange="mapType3D(this);">
302 362
 			    <?php
@@ -305,24 +365,48 @@  discard block
 block discarded – undo
305 365
 			    <?php
306 366
 				if (isset($globalMapOffline) && $globalMapOffline === TRUE) {
307 367
 			    ?>
308
-			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option>
368
+			    <option value="offline"<?php if ($MapType == 'offline') {
369
+	print ' selected';
370
+}
371
+?>>Natural Earth (local)</option>
309 372
 			    <?php
310 373
 				} else {
311 374
 				    if (file_exists(dirname(__FILE__).'/js/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml')) {
312 375
 			    ?>
313
-			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option>
376
+			    <option value="offline"<?php if ($MapType == 'offline') {
377
+	print ' selected';
378
+}
379
+?>>Natural Earth (local)</option>
314 380
 			    <?php
315 381
 				    }
316 382
 			    ?>
317
-			    <option value="ArcGIS-Streetmap"<?php if ($MapType == 'ArcGIS-Streetmap') print ' selected'; ?>>ArcGIS Streetmap</option>
318
-			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Satellite') print ' selected'; ?>>ArcGIS Satellite</option>
319
-			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Ocean') print ' selected'; ?>>ArcGIS Ocean</option>
383
+			    <option value="ArcGIS-Streetmap"<?php if ($MapType == 'ArcGIS-Streetmap') {
384
+	print ' selected';
385
+}
386
+?>>ArcGIS Streetmap</option>
387
+			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Satellite') {
388
+	print ' selected';
389
+}
390
+?>>ArcGIS Satellite</option>
391
+			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Ocean') {
392
+	print ' selected';
393
+}
394
+?>>ArcGIS Ocean</option>
320 395
 			    <?php
321 396
 				    if (isset($globalBingMapKey) && $globalBingMapKey != '') {
322 397
 			    ?>
323
-			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option>
324
-			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option>
325
-			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option>
398
+			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') {
399
+	print ' selected';
400
+}
401
+?>>Bing-Aerial</option>
402
+			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') {
403
+	print ' selected';
404
+}
405
+?>>Bing-Hybrid</option>
406
+			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') {
407
+	print ' selected';
408
+}
409
+?>>Bing-Road</option>
326 410
 			    <?php
327 411
 				    }
328 412
 			    ?>
@@ -332,60 +416,147 @@  discard block
 block discarded – undo
332 416
 			    <?php
333 417
 					if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
334 418
 			    ?>
335
-			    <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option>
336
-			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option>
337
-			    <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option>
419
+			    <option value="Here-Aerial"<?php if ($MapType == 'Here') {
420
+	print ' selected';
421
+}
422
+?>>Here-Aerial</option>
423
+			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') {
424
+	print ' selected';
425
+}
426
+?>>Here-Hybrid</option>
427
+			    <option value="Here-Road"<?php if ($MapType == 'Here') {
428
+	print ' selected';
429
+}
430
+?>>Here-Road</option>
338 431
 			    <?php
339 432
 					}
340 433
 			    ?>
341 434
 			    <?php
342 435
 					if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
343 436
 			    ?>
344
-			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option>
345
-			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option>
346
-			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option>
347
-			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option>
437
+			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') {
438
+	print ' selected';
439
+}
440
+?>>Google Roadmap</option>
441
+			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') {
442
+	print ' selected';
443
+}
444
+?>>Google Satellite</option>
445
+			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') {
446
+	print ' selected';
447
+}
448
+?>>Google Hybrid</option>
449
+			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') {
450
+	print ' selected';
451
+}
452
+?>>Google Terrain</option>
348 453
 			    <?php
349 454
 					}
350 455
 			    ?>
351 456
 			    <?php
352 457
 					if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
353 458
 			    ?>
354
-			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option>
355
-			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option>
356
-			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option>
459
+			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') {
460
+	print ' selected';
461
+}
462
+?>>MapQuest-OSM</option>
463
+			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') {
464
+	print ' selected';
465
+}
466
+?>>MapQuest-Aerial</option>
467
+			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') {
468
+	print ' selected';
469
+}
470
+?>>MapQuest-Hybrid</option>
357 471
 			    <?php
358 472
 					}
359 473
 			    ?>
360
-			    <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option>
361
-			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth</option>
474
+			    <option value="Yandex"<?php if ($MapType == 'Yandex') {
475
+	print ' selected';
476
+}
477
+?>>Yandex</option>
478
+			    <option value="offline"<?php if ($MapType == 'offline') {
479
+	print ' selected';
480
+}
481
+?>>Natural Earth</option>
362 482
 			    <?php
363 483
 				    }
364 484
 			    ?>
365
-			    <option value="NatGeo-Street"<?php if ($MapType == 'NatGeo-Street') print ' selected'; ?>>National Geographic Street</option>
485
+			    <option value="NatGeo-Street"<?php if ($MapType == 'NatGeo-Street') {
486
+	print ' selected';
487
+}
488
+?>>National Geographic Street</option>
366 489
 			    <?php
367 490
 				    if (isset($globalMapboxToken) && $globalMapboxToken != '') {
368
-					if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default';
369
-					else $MapBoxId = $_COOKIE['MapTypeId'];
491
+					if (!isset($_COOKIE['MapTypeId'])) {
492
+						$MapBoxId = 'default';
493
+					} else {
494
+						$MapBoxId = $_COOKIE['MapTypeId'];
495
+					}
370 496
 			    ?>
371
-			    <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') print ' selected'; ?>>Mapbox GL</option>
372
-			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option>
373
-			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option>
374
-			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option>
375
-			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') print ' selected'; ?>>Mapbox dark</option>
376
-			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') print ' selected'; ?>>Mapbox satellite</option>
377
-			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') print ' selected'; ?>>Mapbox streets-satellite</option>
378
-			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') print ' selected'; ?>>Mapbox streets-basic</option>
379
-			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') print ' selected'; ?>>Mapbox comic</option>
380
-			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') print ' selected'; ?>>Mapbox outdoors</option>
381
-			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') print ' selected'; ?>>Mapbox pencil</option>
382
-			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option>
383
-			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option>
497
+			    <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') {
498
+	print ' selected';
499
+}
500
+?>>Mapbox GL</option>
501
+			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') {
502
+	print ' selected';
503
+}
504
+?>>Mapbox default</option>
505
+			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') {
506
+	print ' selected';
507
+}
508
+?>>Mapbox streets</option>
509
+			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') {
510
+	print ' selected';
511
+}
512
+?>>Mapbox light</option>
513
+			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') {
514
+	print ' selected';
515
+}
516
+?>>Mapbox dark</option>
517
+			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') {
518
+	print ' selected';
519
+}
520
+?>>Mapbox satellite</option>
521
+			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') {
522
+	print ' selected';
523
+}
524
+?>>Mapbox streets-satellite</option>
525
+			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') {
526
+	print ' selected';
527
+}
528
+?>>Mapbox streets-basic</option>
529
+			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') {
530
+	print ' selected';
531
+}
532
+?>>Mapbox comic</option>
533
+			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') {
534
+	print ' selected';
535
+}
536
+?>>Mapbox outdoors</option>
537
+			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') {
538
+	print ' selected';
539
+}
540
+?>>Mapbox pencil</option>
541
+			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') {
542
+	print ' selected';
543
+}
544
+?>>Mapbox pirates</option>
545
+			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') {
546
+	print ' selected';
547
+}
548
+?>>Mapbox emerald</option>
384 549
 			    <?php
385 550
 				    }
386 551
 			    ?>
387
-			    <!--<option value="OpenSeaMap"<?php if ($MapType == 'OpenSeaMap') print ' selected'; ?>>OpenSeaMap</option>-->
388
-			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option>
552
+			    <!--<option value="OpenSeaMap"<?php if ($MapType == 'OpenSeaMap') {
553
+	print ' selected';
554
+}
555
+?>>OpenSeaMap</option>-->
556
+			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') {
557
+	print ' selected';
558
+}
559
+?>>OpenStreetMap</option>
389 560
 			    <?php
390 561
 				}
391 562
 			    ?>
@@ -396,10 +567,22 @@  discard block
 block discarded – undo
396 567
 ?>
397 568
 		    <li><?php echo _("Type of Terrain:"); ?>
398 569
 			<select  class="selectpicker" onchange="terrainType(this);">
399
-			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option>
400
-			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option>
401
-			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option>
402
-			    <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected';?>>ArticDEM</option>
570
+			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') {
571
+	print ' selected';
572
+}
573
+?>>stk terrain</option>
574
+			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') {
575
+	print ' selected';
576
+}
577
+?>>ellipsoid</option>
578
+			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') {
579
+	print ' selected';
580
+}
581
+?>>vr terrain</option>
582
+			    <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') {
583
+	print ' selected';
584
+}
585
+?>>ArticDEM</option>
403 586
 			</select>
404 587
 		    </li>
405 588
 <?php
@@ -409,66 +592,126 @@  discard block
 block discarded – undo
409 592
 <?php
410 593
     if (isset($globalMap3D) && $globalMap3D) {
411 594
 ?>
412
-		    <li><div class="checkbox"><label><input type="checkbox" name="synchro2d3d" value="1" onclick="clickSyncMap2D3D(this)" <?php if (isset($_COOKIE['Map2D3DSync']) && $_COOKIE['Map2D3DSync'] == 'true') print 'checked'; ?> ><?php echo _("Use same type of map for 2D & 3D"); ?></label></div></li>
595
+		    <li><div class="checkbox"><label><input type="checkbox" name="synchro2d3d" value="1" onclick="clickSyncMap2D3D(this)" <?php if (isset($_COOKIE['Map2D3DSync']) && $_COOKIE['Map2D3DSync'] == 'true') {
596
+	print 'checked';
597
+}
598
+?> ><?php echo _("Use same type of map for 2D & 3D"); ?></label></div></li>
413 599
 <?php
414 600
     }
415 601
 ?>
416 602
 <?php
417 603
     if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
418 604
 ?>
419
-		    <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if (isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') print 'checked'; ?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li>
605
+		    <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if (isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') {
606
+	print 'checked';
607
+}
608
+?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li>
420 609
 
421 610
 <?php
422 611
 	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
423 612
 ?>
424
-		    <!--<li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') print 'checked'; ?> ><?php echo _("Display flight info as popup"); ?></label></div></li>-->
425
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) print 'checked'; ?> ><?php echo _("Display flight path"); ?></label></div></li>
426
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li>
427
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || (!isset($_COOKIE['MapRemainingRoute']) && isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) print 'checked'; ?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li>
428
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
613
+		    <!--<li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') {
614
+	print 'checked';
615
+}
616
+?> ><?php echo _("Display flight info as popup"); ?></label></div></li>-->
617
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) {
618
+	print 'checked';
619
+}
620
+?> ><?php echo _("Display flight path"); ?></label></div></li>
621
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)) {
622
+	print 'checked';
623
+}
624
+?> ><?php echo _("Display flight route on click"); ?></label></div></li>
625
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || (!isset($_COOKIE['MapRemainingRoute']) && isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) {
626
+	print 'checked';
627
+}
628
+?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li>
629
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) {
630
+	print 'checked';
631
+}
632
+?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
429 633
 <?php
430 634
 	} elseif (!isset($globalTracker) || $globalTracker === TRUE) {
431 635
 ?>
432
-		    <li><div class="checkbox"><label><input type="checkbox" name="mapmatching" value="1" onclick="clickMapMatching(this)" <?php if ((isset($_COOKIE['mapmatching']) && $_COOKIE['mapmatching'] == 'true') || (!isset($_COOKIE['mapmatching']) && isset($globalMapMatching) && $globalMapMatching)) print 'checked'; ?> ><?php echo _("Enable map matching"); ?></label></div></li>
636
+		    <li><div class="checkbox"><label><input type="checkbox" name="mapmatching" value="1" onclick="clickMapMatching(this)" <?php if ((isset($_COOKIE['mapmatching']) && $_COOKIE['mapmatching'] == 'true') || (!isset($_COOKIE['mapmatching']) && isset($globalMapMatching) && $globalMapMatching)) {
637
+	print 'checked';
638
+}
639
+?> ><?php echo _("Enable map matching"); ?></label></div></li>
433 640
 <?php
434 641
 	}
435 642
 	if (isset($globalSatellite) && $globalSatellite === TRUE) {
436 643
 ?>
437
-		    <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Satellites animate between updates"); ?></label></div></li>
644
+		    <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) {
645
+	print 'checked';
646
+}
647
+?> ><?php echo _("Satellites animate between updates"); ?></label></div></li>
438 648
 <?php
439 649
 	}
440 650
     }
441 651
 ?>
442
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li>
443
-		    <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) print 'checked'; ?> ><?php echo _("Display ground station on map"); ?></label></div></li>
444
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) print 'checked'; ?> ><?php echo _("Display weather station on map"); ?></label></div></li>
652
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) {
653
+	print 'checked';
654
+}
655
+?> ><?php echo _("Display airports on map"); ?></label></div></li>
656
+		    <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) {
657
+	print 'checked';
658
+}
659
+?> ><?php echo _("Display ground station on map"); ?></label></div></li>
660
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) {
661
+	print 'checked';
662
+}
663
+?> ><?php echo _("Display weather station on map"); ?></label></div></li>
445 664
 <?php
446 665
     if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d' && isset($globalMETAR) && isset($globalMETARcycle) && $globalMETAR && $globalMETARcycle) {
447 666
 ?>
448
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayweather" value="1" onclick="clickDisplayWeather(this)" <?php if ((isset($_COOKIE['show_Weather']) && $_COOKIE['show_Weather'] == 'true') || (!isset($_COOKIE['show_Weather']) && (isset($globalMapWeather) && $globalMapWeather === TRUE))) print 'checked'; ?> ><?php echo _("Display weather on 3D map"); ?></label></div></li>
667
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayweather" value="1" onclick="clickDisplayWeather(this)" <?php if ((isset($_COOKIE['show_Weather']) && $_COOKIE['show_Weather'] == 'true') || (!isset($_COOKIE['show_Weather']) && (isset($globalMapWeather) && $globalMapWeather === TRUE))) {
668
+	print 'checked';
669
+}
670
+?> ><?php echo _("Display weather on 3D map"); ?></label></div></li>
449 671
 <?php
450 672
     }
451 673
 ?>
452
-		    <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) print 'checked'; ?> ><?php echo _("Display lightning on map"); ?></label></div></li>
674
+		    <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) {
675
+	print 'checked';
676
+}
677
+?> ><?php echo _("Display lightning on map"); ?></label></div></li>
453 678
 <?php
454 679
 	if (isset($globalFires)) {
455 680
 ?>
456
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayfires" value="1" onclick="clickDisplayFires(this)" <?php if ((isset($_COOKIE['show_Fires']) && $_COOKIE['show_Fires'] == 'true') || (!isset($_COOKIE['show_Fires']) && (isset($globalMapFires) && $globalMapFires === TRUE))) print 'checked'; ?> ><?php echo _("Display fires on map"); ?></label></div></li>
681
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayfires" value="1" onclick="clickDisplayFires(this)" <?php if ((isset($_COOKIE['show_Fires']) && $_COOKIE['show_Fires'] == 'true') || (!isset($_COOKIE['show_Fires']) && (isset($globalMapFires) && $globalMapFires === TRUE))) {
682
+	print 'checked';
683
+}
684
+?> ><?php echo _("Display fires on map"); ?></label></div></li>
457 685
 <?php
458 686
 	}
459 687
 	if (isset($globalMap3D) && $globalMap3D) {
460 688
 ?>
461
-		    <li><div class="checkbox"><label><input type="checkbox" name="singlemodel" value="1" onclick="clickSingleModel(this)" <?php if (isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') print 'checked'; ?> ><?php echo _("Only display selected flight on 3D mode"); ?></label></div></li>
689
+		    <li><div class="checkbox"><label><input type="checkbox" name="singlemodel" value="1" onclick="clickSingleModel(this)" <?php if (isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') {
690
+	print 'checked';
691
+}
692
+?> ><?php echo _("Only display selected flight on 3D mode"); ?></label></div></li>
462 693
 <?php
463 694
 	}
464 695
 ?>
465 696
 <?php
466 697
     if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
467 698
 ?>
468
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li>
469
-		    <li><div class="checkbox"><label><input type="checkbox" name="shadows" value="1" onclick="clickShadows(this)" <?php if ((!isset($_COOKIE['map3dnoshadows']) && (!isset($globalMap3DShadows) || $globalMap3DShadows)) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'false')) print 'checked'; ?> ><?php echo _("Use shadows"); ?></label></div></li>
470
-		    <li><div class="checkbox"><label><input type="checkbox" name="one3dmodel" value="1" onclick="useOne3Dmodel(this)" <?php if ((isset($_COOKIE['one3dmodel']) && $_COOKIE['one3dmodel'] == 'true') || (!isset($_COOKIE['one3dmodel']) && isset($globalMap3DOneModel) && $globalMap3DOneModel)) print 'checked'; ?> ><?php echo _("Use same 3D model for all aircraft (use fewer resources)"); ?></label></div></li>
471
-		    <li><div class="checkbox"><label><input type="checkbox" name="updaterealtime" value="1" onclick="clickUpdateRealtime(this)" <?php if ((isset($_COOKIE['updaterealtime']) && $_COOKIE['updaterealtime'] == 'true') || !isset($_COOKIE['updaterealtime'])) print 'checked'; ?> ><?php echo _("Display realtime data in infobox"); ?></label></div></li>
699
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) {
700
+	print 'checked';
701
+}
702
+?> ><?php echo _("Show mini-map"); ?></label></div></li>
703
+		    <li><div class="checkbox"><label><input type="checkbox" name="shadows" value="1" onclick="clickShadows(this)" <?php if ((!isset($_COOKIE['map3dnoshadows']) && (!isset($globalMap3DShadows) || $globalMap3DShadows)) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'false')) {
704
+	print 'checked';
705
+}
706
+?> ><?php echo _("Use shadows"); ?></label></div></li>
707
+		    <li><div class="checkbox"><label><input type="checkbox" name="one3dmodel" value="1" onclick="useOne3Dmodel(this)" <?php if ((isset($_COOKIE['one3dmodel']) && $_COOKIE['one3dmodel'] == 'true') || (!isset($_COOKIE['one3dmodel']) && isset($globalMap3DOneModel) && $globalMap3DOneModel)) {
708
+	print 'checked';
709
+}
710
+?> ><?php echo _("Use same 3D model for all aircraft (use fewer resources)"); ?></label></div></li>
711
+		    <li><div class="checkbox"><label><input type="checkbox" name="updaterealtime" value="1" onclick="clickUpdateRealtime(this)" <?php if ((isset($_COOKIE['updaterealtime']) && $_COOKIE['updaterealtime'] == 'true') || !isset($_COOKIE['updaterealtime'])) {
712
+	print 'checked';
713
+}
714
+?> ><?php echo _("Display realtime data in infobox"); ?></label></div></li>
472 715
 <?php
473 716
     }
474 717
     if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) {
@@ -481,17 +724,25 @@  discard block
 block discarded – undo
481 724
 			if (function_exists('array_column')) {
482 725
 			    if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
483 726
 		    ?>
484
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
727
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
728
+	print 'checked';
729
+}
730
+?> ><?php echo _("Display polar on map"); ?></label></div></li>
485 731
 		    <?php
486 732
 			    }
487 733
 			} elseif (isset($globalSources)) {
488 734
 			    $dispolar = false;
489 735
 			    foreach ($globalSources as $testsource) {
490
-			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
736
+			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) {
737
+			        	$dispolar = true;
738
+			        }
491 739
 			    }
492 740
 			    if ($dispolar) {
493 741
 		    ?>
494
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
742
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
743
+	print 'checked';
744
+}
745
+?> ><?php echo _("Display polar on map"); ?></label></div></li>
495 746
 		    <?php
496 747
 			    }
497 748
 		        }
@@ -504,11 +755,21 @@  discard block
 block discarded – undo
504 755
 			if (!isset($globalAircraft) || $globalAircraft === TRUE) {
505 756
 		    	    if (extension_loaded('gd') && function_exists('gd_info')) {
506 757
 		    ?>
507
-		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
758
+		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') {
759
+	print 'checked';
760
+}
761
+?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
508 762
 		    <?php 
509 763
 				if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') {
510 764
 		    ?>
511
-			<li><?php echo _("Aircraft icon color:"); ?><input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>"></li>
765
+			<li><?php echo _("Aircraft icon color:"); ?><input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) {
766
+	print $_COOKIE['IconColor'];
767
+} elseif (isset($globalAircraftIconColor)) {
768
+	print $globalAircraftIconColor;
769
+} else {
770
+	print '1a3151';
771
+}
772
+?>"></li>
512 773
 		    <?php
513 774
 				}
514 775
 			    }
@@ -519,7 +780,14 @@  discard block
 block discarded – undo
519 780
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
520 781
 		    ?>
521 782
 		    <li><?php echo _("Marine icon color:"); ?>
522
-			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>">
783
+			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) {
784
+	print $_COOKIE['MarineIconColor'];
785
+} elseif (isset($globalMarineIconColor)) {
786
+	print $globalMarineIconColor;
787
+} else {
788
+	print '1a3151';
789
+}
790
+?>">
523 791
 		    </li>
524 792
 		    <?php
525 793
 			    }
@@ -530,7 +798,14 @@  discard block
 block discarded – undo
530 798
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
531 799
 		    ?>
532 800
 		    <li><?php echo _("Tracker icon color:"); ?>
533
-			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print '1a3151'; ?>">
801
+			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) {
802
+	print $_COOKIE['TrackerIconColor'];
803
+} elseif (isset($globalTrackerIconColor)) {
804
+	print $globalTrackerIconColor;
805
+} else {
806
+	print '1a3151';
807
+}
808
+?>">
534 809
 		    </li>
535 810
 		    <?php
536 811
 			    }
@@ -541,8 +816,22 @@  discard block
 block discarded – undo
541 816
 		    ?>
542 817
 		    <li><?php echo _("Show airport icon at zoom level:"); ?>
543 818
 			<div class="range">
544
-			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>">
545
-			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?></output>
819
+			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) {
820
+	print $_COOKIE['AirportZoom'];
821
+} elseif (isset($globalAirportZoom)) {
822
+	print $globalAirportZoom;
823
+} else {
824
+	print '7';
825
+}
826
+?>">
827
+			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) {
828
+	print $_COOKIE['AirportZoom'];
829
+} elseif (isset($globalAirportZoom)) {
830
+	print $globalAirportZoom;
831
+} else {
832
+	print '7';
833
+}
834
+?></output>
546 835
 			</div>
547 836
 		    </li>
548 837
 		    <?php
@@ -553,17 +842,40 @@  discard block
 block discarded – undo
553 842
 ?>
554 843
 		    <li><?php echo _("Set scaling factor for rendering resolution:"); ?>
555 844
 			<div class="range">
556
-			    <input type="range" min="0.5" max="2" step="0.5" name="resolutionscale" onchange="scale.value=value;resolutionScale(resolutionscale.value);" value="<?php if (isset($_COOKIE['resolutionScale'])) print $_COOKIE['resolutionScale']; else print '1'; ?>">
557
-			    <output id="scale"><?php if (isset($_COOKIE['resolutionScale'])) print $_COOKIE['resolutionScale']; else print '1'; ?></output>
845
+			    <input type="range" min="0.5" max="2" step="0.5" name="resolutionscale" onchange="scale.value=value;resolutionScale(resolutionscale.value);" value="<?php if (isset($_COOKIE['resolutionScale'])) {
846
+	print $_COOKIE['resolutionScale'];
847
+} else {
848
+	print '1';
849
+}
850
+?>">
851
+			    <output id="scale"><?php if (isset($_COOKIE['resolutionScale'])) {
852
+	print $_COOKIE['resolutionScale'];
853
+} else {
854
+	print '1';
855
+}
856
+?></output>
558 857
 			</div>
559 858
 		    </li>
560 859
 <?php
561 860
 	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
562 861
 ?>
563
-		    <li><input type="checkbox" name="useliveries" value="1" onclick="useLiveries(this)" <?php if (isset($_COOKIE['UseLiveries']) && $_COOKIE['UseLiveries'] == 'true') print 'checked'; ?> > <?php echo _("Use airlines liveries"); ?></li>
564
-		    <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') print 'checked'; ?> > <?php echo _("Force Aircraft color"); ?>&nbsp;
862
+		    <li><input type="checkbox" name="useliveries" value="1" onclick="useLiveries(this)" <?php if (isset($_COOKIE['UseLiveries']) && $_COOKIE['UseLiveries'] == 'true') {
863
+	print 'checked';
864
+}
865
+?> > <?php echo _("Use airlines liveries"); ?></li>
866
+		    <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') {
867
+	print 'checked';
868
+}
869
+?> > <?php echo _("Force Aircraft color"); ?>&nbsp;
565 870
 		    <!--<li><?php echo _("Aircraft icon color:"); ?>-->
566
-			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print 'ff0000'; ?>">
871
+			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) {
872
+	print $_COOKIE['IconColor'];
873
+} elseif (isset($globalAircraftIconColor)) {
874
+	print $globalAircraftIconColor;
875
+} else {
876
+	print 'ff0000';
877
+}
878
+?>">
567 879
 		    </li>
568 880
 <?php
569 881
 	}
@@ -571,9 +883,19 @@  discard block
 block discarded – undo
571 883
 <?php
572 884
 	if (isset($globalMarine) && $globalMarine === TRUE) {
573 885
 ?>
574
-		    <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Marine color"); ?>&nbsp;
886
+		    <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') {
887
+	print 'checked';
888
+}
889
+?> ><?php echo _("Force Marine color"); ?>&nbsp;
575 890
 		    <!--<li><?php echo _("Marine icon color:"); ?>-->
576
-			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print 'ff0000'; ?>">
891
+			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) {
892
+	print $_COOKIE['MarineIconColor'];
893
+} elseif (isset($globalMarineIconColor)) {
894
+	print $globalMarineIconColor;
895
+} else {
896
+	print 'ff0000';
897
+}
898
+?>">
577 899
 		    </li>
578 900
 <?php
579 901
 	}
@@ -581,9 +903,19 @@  discard block
 block discarded – undo
581 903
 <?php
582 904
 	if (isset($globalTracker) && $globalTracker === TRUE) {
583 905
 ?>
584
-		    <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Tracker color"); ?>&nbsp;
906
+		    <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') {
907
+	print 'checked';
908
+}
909
+?> ><?php echo _("Force Tracker color"); ?>&nbsp;
585 910
 		    <!--<li><?php echo _("Tracker icon color:"); ?>-->
586
-			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print 'ff0000'; ?>">
911
+			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) {
912
+	print $_COOKIE['TrackerIconColor'];
913
+} elseif (isset($globalTrackerIconColor)) {
914
+	print $globalTrackerIconColor;
915
+} else {
916
+	print 'ff0000';
917
+}
918
+?>">
587 919
 		    </li>
588 920
 <?php
589 921
 	}
@@ -591,22 +923,46 @@  discard block
 block discarded – undo
591 923
 ?>
592 924
 		    <li><?php echo _("Distance unit:"); ?>
593 925
 			<select class="selectpicker" onchange="unitdistance(this);">
594
-			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) echo ' selected'; ?>>km</option>
595
-			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) echo ' selected'; ?>>nm</option>
596
-			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) echo ' selected'; ?>>mi</option>
926
+			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
927
+	echo ' selected';
928
+}
929
+?>>km</option>
930
+			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
931
+	echo ' selected';
932
+}
933
+?>>nm</option>
934
+			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
935
+	echo ' selected';
936
+}
937
+?>>mi</option>
597 938
 		        </select>
598 939
 		    </li>
599 940
 		    <li><?php echo _("Altitude unit:"); ?>
600 941
 			<select class="selectpicker" onchange="unitaltitude(this);">
601
-			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) echo ' selected'; ?>>m</option>
602
-			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) echo ' selected'; ?>>feet</option>
942
+			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) {
943
+	echo ' selected';
944
+}
945
+?>>m</option>
946
+			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
947
+	echo ' selected';
948
+}
949
+?>>feet</option>
603 950
 		        </select>
604 951
 		    </li>
605 952
 		    <li><?php echo _("Speed unit:"); ?>
606 953
 			<select class="selectpicker" onchange="unitspeed(this);">
607
-			    <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) echo ' selected'; ?>>km/h</option>
608
-			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) echo ' selected'; ?>>mph</option>
609
-			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) echo ' selected'; ?>>knots</option>
954
+			    <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) {
955
+	echo ' selected';
956
+}
957
+?>>km/h</option>
958
+			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) {
959
+	echo ' selected';
960
+}
961
+?>>mph</option>
962
+			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) {
963
+	echo ' selected';
964
+}
965
+?>>knots</option>
610 966
 		        </select>
611 967
 		    </li>
612 968
 
@@ -624,9 +980,18 @@  discard block
 block discarded – undo
624 980
 		    <?php
625 981
 			if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) {
626 982
 		    ?>
627
-			<?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
628
-			<?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
629
-			<?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
983
+			<?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) {
984
+	print 'checked';
985
+}
986
+?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
987
+			<?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) {
988
+	print 'checked';
989
+}
990
+?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
991
+			<?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) {
992
+	print 'checked';
993
+}
994
+?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
630 995
 		    <?php
631 996
 			}
632 997
 		    ?>
@@ -634,10 +999,16 @@  discard block
 block discarded – undo
634 999
 			if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) {
635 1000
 		    ?>
636 1001
 			<?php if (isset($globalSBS1) && $globalSBS1) { ?>
637
-			    <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
1002
+			    <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) {
1003
+	print 'checked';
1004
+}
1005
+?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
638 1006
 			<?php } ?>
639 1007
 			<?php if (isset($globalAPRS) && $globalAPRS) { ?>
640
-			    <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) print 'checked'; ?> ><?php echo _("Display APRS data"); ?></label></div></li>
1008
+			    <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) {
1009
+	print 'checked';
1010
+}
1011
+?> ><?php echo _("Display APRS data"); ?></label></div></li>
641 1012
 			<?php } ?>
642 1013
 		    <?php
643 1014
 			}
@@ -654,7 +1025,9 @@  discard block
 block discarded – undo
654 1025
 				}
655 1026
 				foreach($allairlinenames as $airline) {
656 1027
 					$airline_name = $airline['airline_name'];
657
-					if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...';
1028
+					if (strlen($airline_name) > 30) {
1029
+						$airline_name = substr($airline_name,0,30).'...';
1030
+					}
658 1031
 					if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) {
659 1032
 						echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>';
660 1033
 					} else {
@@ -672,7 +1045,10 @@  discard block
 block discarded – undo
672 1045
 		    <li><?php echo _("Display alliance:"); ?>
673 1046
 		    <br/>
674 1047
 			<select class="selectpicker" onchange="alliance(this);" id="display_alliance">
675
-			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
1048
+			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') {
1049
+	echo ' selected';
1050
+}
1051
+?>><?php echo _("All"); ?></option>
676 1052
 			    <?php
677 1053
 				foreach($allalliancenames as $alliance) {
678 1054
 					$alliance_name = $alliance['alliance'];
@@ -731,10 +1107,22 @@  discard block
 block discarded – undo
731 1107
 		    ?>
732 1108
 		    <li><?php echo _("Display airlines of type:"); ?><br/>
733 1109
 			<select class="selectpicker" onchange="airlinestype(this);">
734
-			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
735
-			    <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') echo ' selected'; ?>><?php echo _("Passenger"); ?></option>
736
-			    <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') echo ' selected'; ?>><?php echo _("Cargo"); ?></option>
737
-			    <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') echo ' selected'; ?>><?php echo _("Military"); ?></option>
1110
+			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') {
1111
+	echo ' selected';
1112
+}
1113
+?>><?php echo _("All"); ?></option>
1114
+			    <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') {
1115
+	echo ' selected';
1116
+}
1117
+?>><?php echo _("Passenger"); ?></option>
1118
+			    <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') {
1119
+	echo ' selected';
1120
+}
1121
+?>><?php echo _("Cargo"); ?></option>
1122
+			    <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') {
1123
+	echo ' selected';
1124
+}
1125
+?>><?php echo _("Military"); ?></option>
738 1126
 			</select>
739 1127
 		    </li>
740 1128
 		    <?php
@@ -748,7 +1136,10 @@  discard block
 block discarded – undo
748 1136
 		    ?>
749 1137
 		    <li>
750 1138
 			<?php echo _("Display vessels with MMSI:"); ?>
751
-			<input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) print $_COOKIE['filter_mmsi']; ?>" />
1139
+			<input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) {
1140
+	print $_COOKIE['filter_mmsi'];
1141
+}
1142
+?>" />
752 1143
 		    </li>
753 1144
 			<?php
754 1145
 				if (isset($globalVM) && $globalVM) {
@@ -775,7 +1166,10 @@  discard block
 block discarded – undo
775 1166
 		    ?>
776 1167
 		    <li>
777 1168
 			<?php echo _("Display with ident:"); ?>
778
-			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" />
1169
+			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) {
1170
+	print $_COOKIE['filter_ident'];
1171
+}
1172
+?>" />
779 1173
 		    </li>
780 1174
 		</ul>
781 1175
 	    </form>
@@ -791,7 +1185,10 @@  discard block
 block discarded – undo
791 1185
 	    <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
792 1186
 	    <form>
793 1187
 		<ul>
794
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if ((isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') || !isset($_COOKIE['displayiss'])) print 'checked'; ?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li>
1188
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if ((isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') || !isset($_COOKIE['displayiss'])) {
1189
+	print 'checked';
1190
+}
1191
+?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li>
795 1192
 		    <li><?php echo _("Type:"); ?>
796 1193
 			<select class="selectpicker" multiple onchange="sattypes(this);">
797 1194
 			    <?php
@@ -799,25 +1196,45 @@  discard block
 block discarded – undo
799 1196
 				$types = $Satellite->get_tle_types();
800 1197
 				foreach ($types as $type) {
801 1198
 					$type_name = $type['tle_type'];
802
-					if ($type_name == 'musson') $type_name = 'Russian LEO Navigation';
803
-					else if ($type_name == 'nnss') $type_name = 'Navi Navigation Satellite System';
804
-					else if ($type_name == 'sbas') $type_name = 'Satellite-Based Augmentation System';
805
-					else if ($type_name == 'glo-ops') $type_name = 'Glonass Operational';
806
-					else if ($type_name == 'gps-ops') $type_name = 'GPS Operational';
807
-					else if ($type_name == 'argos') $type_name = 'ARGOS Data Collection System';
808
-					else if ($type_name == 'tdrss') $type_name = 'Tracking and Data Relay Satellite System';
809
-					else if ($type_name == 'sarsat') $type_name = 'Search & Rescue';
810
-					else if ($type_name == 'dmc') $type_name = 'Disaster Monitoring';
811
-					else if ($type_name == 'resource') $type_name = 'Earth Resources';
812
-					else if ($type_name == 'stations') $type_name = 'Space Stations';
813
-					else if ($type_name == 'geo') $type_name = 'Geostationary';
814
-					else if ($type_name == 'amateur') $type_name = 'Amateur Radio';
815
-					else if ($type_name == 'x-comm') $type_name = 'Experimental';
816
-					else if ($type_name == 'other-comm') $type_name = 'Other Comm';
817
-					else if ($type_name == 'science') $type_name = 'Space & Earth Science';
818
-					else if ($type_name == 'military') $type_name = 'Miscellaneous Military';
819
-					else if ($type_name == 'radar') $type_name = 'Radar Calibration';
820
-					else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches';
1199
+					if ($type_name == 'musson') {
1200
+						$type_name = 'Russian LEO Navigation';
1201
+					} else if ($type_name == 'nnss') {
1202
+						$type_name = 'Navi Navigation Satellite System';
1203
+					} else if ($type_name == 'sbas') {
1204
+						$type_name = 'Satellite-Based Augmentation System';
1205
+					} else if ($type_name == 'glo-ops') {
1206
+						$type_name = 'Glonass Operational';
1207
+					} else if ($type_name == 'gps-ops') {
1208
+						$type_name = 'GPS Operational';
1209
+					} else if ($type_name == 'argos') {
1210
+						$type_name = 'ARGOS Data Collection System';
1211
+					} else if ($type_name == 'tdrss') {
1212
+						$type_name = 'Tracking and Data Relay Satellite System';
1213
+					} else if ($type_name == 'sarsat') {
1214
+						$type_name = 'Search & Rescue';
1215
+					} else if ($type_name == 'dmc') {
1216
+						$type_name = 'Disaster Monitoring';
1217
+					} else if ($type_name == 'resource') {
1218
+						$type_name = 'Earth Resources';
1219
+					} else if ($type_name == 'stations') {
1220
+						$type_name = 'Space Stations';
1221
+					} else if ($type_name == 'geo') {
1222
+						$type_name = 'Geostationary';
1223
+					} else if ($type_name == 'amateur') {
1224
+						$type_name = 'Amateur Radio';
1225
+					} else if ($type_name == 'x-comm') {
1226
+						$type_name = 'Experimental';
1227
+					} else if ($type_name == 'other-comm') {
1228
+						$type_name = 'Other Comm';
1229
+					} else if ($type_name == 'science') {
1230
+						$type_name = 'Space & Earth Science';
1231
+					} else if ($type_name == 'military') {
1232
+						$type_name = 'Miscellaneous Military';
1233
+					} else if ($type_name == 'radar') {
1234
+						$type_name = 'Radar Calibration';
1235
+					} else if ($type_name == 'tle-new') {
1236
+						$type_name = 'Last 30 days launches';
1237
+					}
821 1238
 					
822 1239
 					if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) {
823 1240
 						print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>';
Please login to merge, or discard this patch.
live-geojson.php 2 patches
Spacing   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -64,18 +64,18 @@  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);
78
-if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'],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
+if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'], FILTER_SANITIZE_STRING);
79 79
 
80 80
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
81 81
 	$min = true;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 $spotter_array = array();
85 85
 
86 86
 if (isset($_GET['ident'])) {
87
-	$ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING));
87
+	$ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING));
88 88
 	if ($tracker) {
89 89
 		$spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident);
90 90
 	} elseif ($marine) {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	}
99 99
 	$allhistory = true;
100 100
 } elseif (isset($_GET['flightaware_id'])) {
101
-	$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
101
+	$flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING);
102 102
 	$spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id);
103 103
 	if (empty($spotter_array)) {
104 104
 		$from_archive = true;
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
 	}
107 107
 	$allhistory = true;
108 108
 } elseif (isset($_GET['famtrack_id'])) {
109
-	$famtrack_id = urldecode(filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING));
109
+	$famtrack_id = urldecode(filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING));
110 110
 	$spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id);
111 111
 	$allhistory = true;
112 112
 } elseif (isset($_GET['fammarine_id'])) {
113
-	$fammarine_id = urldecode(filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING));
113
+	$fammarine_id = urldecode(filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING));
114 114
 	$spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id);
115 115
 	$allhistory = true;
116 116
 /*
@@ -130,15 +130,15 @@  discard block
 block discarded – undo
130 130
 */
131 131
 } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min && !isset($_GET['archive'])) {
132 132
 	$usecoord = true;
133
-	$coord = explode(',',$_GET['coord']);
134
-	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
+	$coord = explode(',', $_GET['coord']);
134
+	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) 
135 135
 	    && $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) {
136 136
 		if ($tracker) {
137
-			$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter);
137
+			$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter);
138 138
 		} elseif ($marine) {
139
-			$spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter);
139
+			$spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter);
140 140
 		} else {
141
-			$spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$filter);
141
+			$spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $filter);
142 142
 		}
143 143
 	} else {
144 144
 		if ($tracker) {
@@ -153,12 +153,12 @@  discard block
 block discarded – undo
153 153
 	$from_archive = true;
154 154
 //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
155 155
 //	$enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
156
-	$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
157
-	$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
158
-	$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
159
-	$begindate = date('Y-m-d H:i:s',$begindate);
160
-	$enddate = date('Y-m-d H:i:s',$enddate);
161
-	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
156
+	$begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT);
157
+	$enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT);
158
+	$archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT);
159
+	$begindate = date('Y-m-d H:i:s', $begindate);
160
+	$enddate = date('Y-m-d H:i:s', $enddate);
161
+	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter);
162 162
 } elseif ($min) {
163 163
 	if ($tracker) {
164 164
 		$spotter_array = $TrackerLive->getMinLiveTrackerData($filter);
@@ -170,17 +170,17 @@  discard block
 block discarded – undo
170 170
 #	$min = true;
171 171
 } else {
172 172
 	if ($tracker) {
173
-		$spotter_array = $TrackerLive->getLiveTrackerData('','',$filter);
173
+		$spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter);
174 174
 	} elseif ($marine) {
175
-		$spotter_array = $marineLive->getLiveMarineData('','',$filter);
175
+		$spotter_array = $marineLive->getLiveMarineData('', '', $filter);
176 176
 	} else {
177
-		$spotter_array = $SpotterLive->getLiveSpotterData('','',$filter);
177
+		$spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter);
178 178
 	}
179 179
 }
180 180
 
181 181
 if ($usecoord) {
182 182
 	if (isset($_GET['archive'])) {
183
-		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);
183
+		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter);
184 184
 	} else {
185 185
 		if ($tracker) {
186 186
 			$flightcnt = $TrackerLive->getLiveTrackerCount($filter);
@@ -193,9 +193,9 @@  discard block
 block discarded – undo
193 193
 	if ($flightcnt == '') $flightcnt = 0;
194 194
 } else $flightcnt = 0;
195 195
 
196
-$sqltime = round(microtime(true)-$begintime,2);
196
+$sqltime = round(microtime(true) - $begintime, 2);
197 197
 
198
-$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
198
+$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
199 199
 if ($currenttime != '') $currenttime = round($currenttime/1000);
200 200
 
201 201
 if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false;
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		if (!empty($spotter_array) && is_array($spotter_array))
215 215
 		{
216 216
 			$output .= '"features": [';
217
-			foreach($spotter_array as $spotter_item)
217
+			foreach ($spotter_array as $spotter_item)
218 218
 			{
219 219
 				$j++;
220 220
 				unset($idistance);
@@ -271,8 +271,8 @@  discard block
 block discarded – undo
271 271
 */
272 272
 							//$output .= '"fc": "'.$spotter_item['nb'].'",';
273 273
 						if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') {
274
-							if ($compress) $output .= '"c": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
275
-							else $output .= '"callsign": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
274
+							if ($compress) $output .= '"c": '.json_encode(str_replace('\\', '', $spotter_item['ident'])).',';
275
+							else $output .= '"callsign": '.json_encode(str_replace('\\', '', $spotter_item['ident'])).',';
276 276
 							//'
277 277
 						} else {
278 278
 							if ($compress) $output .= '"c": "NA",';
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 						}
285 285
 						if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) {
286 286
 							$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",';
287
-							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",';
287
+							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",';
288 288
 						} elseif (isset($spotter_item['aircraft_type'])) {
289 289
 							$output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",';
290 290
 						} elseif (!$min) {
@@ -431,15 +431,15 @@  discard block
 block discarded – undo
431 431
 						if (isset($archivespeed) || $usenextlatlon) {
432 432
 							if (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
433 433
 								if (isset($spotter_item['arrival_airport_latitude'])) {
434
-									$cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']);
435
-									$idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']);
434
+									$cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']);
435
+									$idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']);
436 436
 									$farr_lat = $spotter_item['arrival_airport_latitude'];
437 437
 									$farr_lon = $spotter_item['arrival_airport_longitude'];
438 438
 								} else {
439 439
 									$aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);
440 440
 									if (isset($aairport[0]['latitude'])) {
441
-										$cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']);
442
-										$idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']);
441
+										$cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']);
442
+										$idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']);
443 443
 										$farr_lat = $aairport[0]['latitude'];
444 444
 										$farr_lon = $aairport[0]['longitude'];
445 445
 									}
@@ -452,59 +452,59 @@  discard block
 block discarded – undo
452 452
 						if ($currenttime != '') {
453 453
 							if (strtotime($spotter_item['date']) < $currenttime) {
454 454
 								if (isset($archivespeed)) {
455
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
456
-									$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
455
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
456
+									$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
457 457
 									if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
458 458
 									else {
459
-										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($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'], $cheading, $archivespeed, ($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'],$heading,$archivespeed);
463
+											$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed);
464 464
 											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
465 465
 										}
466 466
 									}
467 467
 								} elseif ($usenextlatlon) {
468
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
469
-									$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
468
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
469
+									$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
470 470
 									if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
471 471
 									else {
472
-										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
473
-										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
472
+										$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
473
+										$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
474 474
 										if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
475 475
 										else {
476
-											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);
476
+											$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading);
477 477
 											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
478 478
 										}
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);
483
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed);
484 484
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
485 485
 								} elseif ($usenextlatlon) {
486
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);
486
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading);
487 487
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
488 488
 								}
489 489
 							}
490 490
 						} else {
491 491
 							if (isset($archivespeed)) {
492
-								$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);
493
-								$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
492
+								$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed);
493
+								$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
494 494
 								if (!isset($idistance) || $fdistance < $idistance) {
495 495
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
496 496
 								} else {
497
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed);
497
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed);
498 498
 									//$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
499 499
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
500 500
 								}
501 501
 							} elseif ($usenextlatlon) {
502
-								$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);
503
-								$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
502
+								$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading);
503
+								$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
504 504
 								if (!isset($idistance) || $fdistance < $idistance) {
505 505
 										$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
506 506
 								} else {
507
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading);
507
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading);
508 508
 									//$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
509 509
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
510 510
 								}
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 
514 514
 						if (!$min) $output .= '"image": "'.$image.'",';
515 515
 						if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') {
516
-							$output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",';
516
+							$output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",';
517 517
 						}
518 518
 						if (isset($spotter_item['image_source_website'])) {
519 519
 							$output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",';
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 							$output .= '"waypoints": "'.$spotter_item['waypoints'].'",';
539 539
 						}
540 540
 						if (isset($spotter_item['acars'])) {
541
-							$output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",';
541
+							$output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",';
542 542
 						}
543 543
 						// type when not aircraft ?
544 544
 						if (isset($spotter_item['type'])) {
@@ -558,12 +558,12 @@  discard block
 block discarded – undo
558 558
 								if ($currenttime != '') {
559 559
 									if (strtotime($spotter_item['date']) < $currenttime) {
560 560
 										if (!isset($archivespeed)) $archivespeed = 1;
561
-										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));
562
-										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
561
+										$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date'])));
562
+										$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
563 563
 										if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
564 564
 										else {
565
-											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));
566
-											$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
565
+											$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date'])));
566
+											$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
567 567
 											if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
568 568
 											else {
569 569
 												$output .= $spotter_item['longitude'].', ';
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
                 
643 643
 			}
644 644
 */
645
-				$history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING);
645
+				$history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING);
646 646
 				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
647 647
 				
648 648
 				if (
@@ -650,11 +650,11 @@  discard block
 block discarded – undo
650 650
 				    || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)
651 651
 				//    || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))
652 652
 				//    || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident'])
653
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
653
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
654 654
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])
655
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id']))
655
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id']))
656 656
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])
657
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid']))
657
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid']))
658 658
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])
659 659
 				    ) {
660 660
 					if ($tracker) {
@@ -683,9 +683,9 @@  discard block
 block discarded – undo
683 683
 							require(dirname(__FILE__).'/require/class.MapMatching.php');
684 684
 							$MapMatching = new MapMatching();
685 685
 							if (isset($spotter_item['date_iso_8601'])) {
686
-								$spotter_history_array_mm = array_merge($spotter_history_array,array(array('latitude' => $spotter_item['latitude'],'longitude' => $spotter_item['longitude'],'date' => date('c',strtotime($spotter_item['date_iso_8601'])))));
686
+								$spotter_history_array_mm = array_merge($spotter_history_array, array(array('latitude' => $spotter_item['latitude'], 'longitude' => $spotter_item['longitude'], 'date' => date('c', strtotime($spotter_item['date_iso_8601'])))));
687 687
 							} else {
688
-								$spotter_history_array_mm = array_merge($spotter_history_array,array(array('latitude' => $spotter_item['latitude'],'longitude' => $spotter_item['longitude'],'date' => date('c',strtotime($spotter_item['date'])))));
688
+								$spotter_history_array_mm = array_merge($spotter_history_array, array(array('latitude' => $spotter_item['latitude'], 'longitude' => $spotter_item['longitude'], 'date' => date('c', strtotime($spotter_item['date'])))));
689 689
 							}
690 690
 							$spotter_history_array = $MapMatching->match($spotter_history_array_mm);
691 691
 						}
@@ -717,9 +717,9 @@  discard block
 block discarded – undo
717 717
 								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
718 718
 							}
719 719
 							$output_history .= '[';
720
-							$output_history .=  $spotter_history['longitude'].', ';
721
-							$output_history .=  $spotter_history['latitude'].', ';
722
-							$output_history .=  $spotter_history['altitude']*30.48;
720
+							$output_history .= $spotter_history['longitude'].', ';
721
+							$output_history .= $spotter_history['latitude'].', ';
722
+							$output_history .= $spotter_history['altitude']*30.48;
723 723
 							$output_history .= '],';
724 724
 							/*
725 725
 							if ($from_archive === false) {
@@ -742,8 +742,8 @@  discard block
 block discarded – undo
742 742
 								$d = true;
743 743
 							}
744 744
 							$output_history .= '[';
745
-							$output_history .=  $spotter_history['longitude'].', ';
746
-							$output_history .=  $spotter_history['latitude'];
745
+							$output_history .= $spotter_history['longitude'].', ';
746
+							$output_history .= $spotter_history['latitude'];
747 747
 							$output_history .= '],';
748 748
 							/*
749 749
 							if ($from_archive === false) {
@@ -759,9 +759,9 @@  discard block
 block discarded – undo
759 759
 						//echo $output_history;
760 760
 						if ($from_archive === false && !isset($spotter_history_array[0]['mapmatching_engine'])) {
761 761
 							$output_historyd = '[';
762
-							$output_historyd .=  $spotter_item['longitude'].', ';
763
-							$output_historyd .=  $spotter_item['latitude'];
764
-							if (isset($spotter_history['altitude'])) $output_historyd .=  ','.$spotter_item['altitude']*30.48;
762
+							$output_historyd .= $spotter_item['longitude'].', ';
763
+							$output_historyd .= $spotter_item['latitude'];
764
+							if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48;
765 765
 							$output_historyd .= '],';
766 766
 							//$output_history = $output_historyd.$output_history;
767 767
 							$output_history = $output_history.$output_historyd;
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
 							$last = array_pop($spotter_history_array);
770 770
 							$latitude = $last['latitude'];
771 771
 							$longitude = $last['longitude'];
772
-							$output = str_replace('"coordinates": ['.$spotter_item['longitude'].', '.$spotter_item['latitude'].']}','"coordinates": ['.$longitude.', '.$latitude.']}',$output);
772
+							$output = str_replace('"coordinates": ['.$spotter_item['longitude'].', '.$spotter_item['latitude'].']}', '"coordinates": ['.$longitude.', '.$latitude.']}', $output);
773 773
 						}
774 774
 						
775 775
 						$output_history  = substr($output_history, 0, -1);
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
 					}
781 781
 				}
782 782
 				
783
-				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
783
+				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
784 784
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
785 785
 				     && (isset($spotter_item['departure_airport']) 
786 786
 				        && $spotter_item['departure_airport'] != 'NA' 
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
 
815 815
 				//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))))) {
816 816
 				//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))))) {
817
-				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
817
+				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
818 818
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
819 819
 				     && (isset($spotter_item['arrival_airport']) 
820 820
 				        && $spotter_item['arrival_airport'] != 'NA' 
@@ -841,11 +841,11 @@  discard block
 block discarded – undo
841 841
 					}
842 842
 				    }
843 843
 				    if ($havedata) {
844
-					$line = $Common->greatCircle($spotter_item['latitude'],$spotter_item['longitude'],$end_lat,$end_lon);
844
+					$line = $Common->greatCircle($spotter_item['latitude'], $spotter_item['longitude'], $end_lat, $end_lon);
845 845
 					foreach ($line[0] as $coord) {
846 846
 						$output_dest .= '['.$coord[0].','.$coord[1].'],';
847 847
 					}
848
-					$output_dest  = substr($output_dest, 0, -1);
848
+					$output_dest = substr($output_dest, 0, -1);
849 849
 				    }
850 850
 				    $output_dest .= ']}},';
851 851
 				    if ($havedata) $output .= $output_dest;
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
 			$output  = substr($output, 0, -1);
856 856
 			$output .= ']';
857 857
 			$output .= ',"initial_sqltime": "'.$sqltime.'",';
858
-			$output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';
858
+			$output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",';
859 859
 			if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
860 860
 			$output .= '"fc": "'.$j.'"';
861 861
 		} else {
Please login to merge, or discard this patch.
Braces   +336 added lines, -136 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@  discard block
 block discarded – undo
12 12
 $tracker = false;
13 13
 $marine = false;
14 14
 $usecoord = false;
15
-if (isset($_GET['test'])) exit();
15
+if (isset($_GET['test'])) {
16
+	exit();
17
+}
16 18
 if (isset($_GET['tracker'])) {
17 19
     $tracker = true;
18 20
 }
@@ -57,29 +59,58 @@  discard block
 block discarded – undo
57 59
 }
58 60
 header('Content-Type: text/javascript');
59 61
 
60
-if (!isset($globalJsonCompress)) $compress = true;
61
-else $compress = $globalJsonCompress;
62
+if (!isset($globalJsonCompress)) {
63
+	$compress = true;
64
+} else {
65
+	$compress = $globalJsonCompress;
66
+}
62 67
 
63 68
 $from_archive = false;
64 69
 $min = true;
65 70
 $allhistory = false;
66 71
 $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);
78
-if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_STRING);
72
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') {
73
+	$filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
74
+}
75
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') {
76
+	$filter['source'] = array_merge($filter['source'],array('whazzup'));
77
+}
78
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') {
79
+	$filter['source'] = array_merge($filter['source'],array('phpvmacars'));
80
+}
81
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') {
82
+	$filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
83
+}
84
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') {
85
+	$filter['source'] = array_merge($filter['source'],array('aprs'));
86
+}
87
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') {
88
+	$filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
89
+}
90
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') {
91
+	$filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
92
+}
93
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') {
94
+	$filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
95
+}
96
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') {
97
+	$filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
98
+}
99
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') {
100
+	$filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
101
+}
102
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') {
103
+	$filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
104
+}
105
+if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') {
106
+	$filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_STRING);
107
+}
79 108
 
80 109
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
81 110
 	$min = true;
82
-} else $min = false;
111
+} else {
112
+	$min = false;
113
+}
83 114
 
84 115
 $spotter_array = array();
85 116
 
@@ -190,24 +221,38 @@  discard block
 block discarded – undo
190 221
 			$flightcnt = $SpotterLive->getLiveSpotterCount($filter);
191 222
 		}
192 223
 	}
193
-	if ($flightcnt == '') $flightcnt = 0;
194
-} else $flightcnt = 0;
224
+	if ($flightcnt == '') {
225
+		$flightcnt = 0;
226
+	}
227
+	} else {
228
+	$flightcnt = 0;
229
+}
195 230
 
196 231
 $sqltime = round(microtime(true)-$begintime,2);
197 232
 
198 233
 $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
199
-if ($currenttime != '') $currenttime = round($currenttime/1000);
234
+if ($currenttime != '') {
235
+	$currenttime = round($currenttime/1000);
236
+}
200 237
 
201
-if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false;
202
-else $usenextlatlon = true;
203
-if ($usenextlatlon === false) $currenttime = '';
238
+if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) {
239
+	$usenextlatlon = false;
240
+} else {
241
+	$usenextlatlon = true;
242
+}
243
+if ($usenextlatlon === false) {
244
+	$currenttime = '';
245
+}
204 246
 $j = 0;
205 247
 $prev_flightaware_id = '';
206 248
 $aircrafts_shadow = array();
207 249
 $output = '{';
208 250
 	$output .= '"type": "FeatureCollection",';
209
-		if ($min) $output .= '"minimal": "true",';
210
-		else $output .= '"minimal": "false",';
251
+		if ($min) {
252
+			$output .= '"minimal": "true",';
253
+		} else {
254
+			$output .= '"minimal": "false",';
255
+		}
211 256
 		//$output .= '"fc": "'.$flightcnt.'",';
212 257
 		$output .= '"sqt": "'.$sqltime.'",';
213 258
 
@@ -252,18 +297,29 @@  discard block
 block discarded – undo
252 297
 						}
253 298
 						$output .= '"properties": {';
254 299
 						if (isset($spotter_item['flightaware_id'])) {
255
-							if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",';
256
-							else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",';
300
+							if ($compress) {
301
+								$output .= '"fi": "'.$spotter_item['flightaware_id'].'",';
302
+							} else {
303
+								$output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",';
304
+							}
257 305
 						} elseif (isset($spotter_item['famtrackid'])) {
258
-							if ($compress) $output .= '"fti": "'.$spotter_item['famtrackid'].'",';
259
-							else $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",';
306
+							if ($compress) {
307
+								$output .= '"fti": "'.$spotter_item['famtrackid'].'",';
308
+							} else {
309
+								$output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",';
310
+							}
260 311
 						} elseif (isset($spotter_item['fammarine_id'])) {
261
-							if ($compress) $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",';
262
-							else $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",';
312
+							if ($compress) {
313
+								$output .= '"fmi": "'.$spotter_item['fammarine_id'].'",';
314
+							} else {
315
+								$output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",';
316
+							}
263 317
 						}
264 318
 						$output .= '"fc": "'.$flightcnt.'",';
265 319
 						$output .= '"sqt": "'.$sqltime.'",';
266
-						if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
320
+						if (isset($begindate)) {
321
+							$output .= '"archive_date": "'.$begindate.'",';
322
+						}
267 323
 
268 324
 /*
269 325
 							if ($min) $output .= '"minimal": "true",';
@@ -271,16 +327,25 @@  discard block
 block discarded – undo
271 327
 */
272 328
 							//$output .= '"fc": "'.$spotter_item['nb'].'",';
273 329
 						if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') {
274
-							if ($compress) $output .= '"c": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
275
-							else $output .= '"callsign": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
330
+							if ($compress) {
331
+								$output .= '"c": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
332
+							} else {
333
+								$output .= '"callsign": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
334
+							}
276 335
 							//'
277 336
 						} else {
278
-							if ($compress) $output .= '"c": "NA",';
279
-							else $output .= '"callsign": "NA",';
337
+							if ($compress) {
338
+								$output .= '"c": "NA",';
339
+							} else {
340
+								$output .= '"callsign": "NA",';
341
+							}
280 342
 						}
281 343
 						if (isset($spotter_item['registration'])) {
282
-							if ($compress) $output .= '"reg": '.json_encode($spotter_item['registration']).',';
283
-							else $output .= '"registration": '.json_encode($spotter_item['registration']).',';
344
+							if ($compress) {
345
+								$output .= '"reg": '.json_encode($spotter_item['registration']).',';
346
+							} else {
347
+								$output .= '"registration": '.json_encode($spotter_item['registration']).',';
348
+							}
284 349
 						}
285 350
 						if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) {
286 351
 							$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",';
@@ -291,20 +356,30 @@  discard block
 block discarded – undo
291 356
 							$output .= '"aircraft_name": "NA",';
292 357
 						}
293 358
 						if (isset($spotter_item['aircraft_icao'])) {
294
-							if ($compress) $output .= '"ai": "'.$spotter_item['aircraft_icao'].'",';
295
-							else $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
359
+							if ($compress) {
360
+								$output .= '"ai": "'.$spotter_item['aircraft_icao'].'",';
361
+							} else {
362
+								$output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
363
+							}
296 364
 						}
297 365
 						if (!isset($spotter_item['aircraft_shadow']) && !$tracker && !$marine) {
298
-							if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = '';
299
-							else {
366
+							if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') {
367
+								$spotter_item['aircraft_shadow'] = '';
368
+							} else {
300 369
 								$aircraft_icao = $spotter_item['aircraft_icao'];
301
-								if (isset($aircrafts_shadow[$aircraft_icao])) $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao];
302
-								else {
370
+								if (isset($aircrafts_shadow[$aircraft_icao])) {
371
+									$spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao];
372
+								} else {
303 373
 									$aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']);
304
-									if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow'];
305
-									elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png';
306
-									elseif ($aircraft_icao == 'PARAGLIDER') $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png';
307
-									else $spotter_item['aircraft_shadow'] = '';
374
+									if (count($aircraft_info) > 0) {
375
+										$spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow'];
376
+									} elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') {
377
+										$spotter_item['aircraft_shadow'] = 'PA18.png';
378
+									} elseif ($aircraft_icao == 'PARAGLIDER') {
379
+										$spotter_item['aircraft_shadow'] = 'PARAGLIDER.png';
380
+									} else {
381
+										$spotter_item['aircraft_shadow'] = '';
382
+									}
308 383
 									$aircrafts_shadow[$aircraft_icao] = $spotter_item['aircraft_shadow'];
309 384
 								}
310 385
 							}
@@ -312,73 +387,139 @@  discard block
 block discarded – undo
312 387
 						if (!isset($spotter_item['aircraft_shadow']) || $spotter_item['aircraft_shadow'] == '') {
313 388
 							if ($tracker) {
314 389
 								if (isset($spotter_item['type']) && $spotter_item['type'] == 'Ambulance') {
315
-									if ($compress) $output .= '"as": "ambulance.png",';
316
-									else $output .= '"aircraft_shadow": "ambulance.png",';
390
+									if ($compress) {
391
+										$output .= '"as": "ambulance.png",';
392
+									} else {
393
+										$output .= '"aircraft_shadow": "ambulance.png",';
394
+									}
317 395
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') {
318
-									if ($compress) $output .= '"as": "police.png",';
319
-									else $output .= '"aircraft_shadow": "police.png",';
396
+									if ($compress) {
397
+										$output .= '"as": "police.png",';
398
+									} else {
399
+										$output .= '"aircraft_shadow": "police.png",';
400
+									}
320 401
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') {
321
-									if ($compress) $output .= '"as": "ship.png",';
322
-									else $output .= '"aircraft_shadow": "ship.png",';
402
+									if ($compress) {
403
+										$output .= '"as": "ship.png",';
404
+									} else {
405
+										$output .= '"aircraft_shadow": "ship.png",';
406
+									}
323 407
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') {
324
-									if ($compress) $output .= '"as": "ship.png",';
325
-									else $output .= '"aircraft_shadow": "ship.png",';
408
+									if ($compress) {
409
+										$output .= '"as": "ship.png",';
410
+									} else {
411
+										$output .= '"aircraft_shadow": "ship.png",';
412
+									}
326 413
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') {
327
-									if ($compress) $output .= '"as": "ship.png",';
328
-									else $output .= '"aircraft_shadow": "ship.png",';
414
+									if ($compress) {
415
+										$output .= '"as": "ship.png",';
416
+									} else {
417
+										$output .= '"aircraft_shadow": "ship.png",';
418
+									}
329 419
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') {
330
-									if ($compress) $output .= '"as": "truck.png",';
331
-									else $output .= '"aircraft_shadow": "truck.png",';
420
+									if ($compress) {
421
+										$output .= '"as": "truck.png",';
422
+									} else {
423
+										$output .= '"aircraft_shadow": "truck.png",';
424
+									}
332 425
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') {
333
-									if ($compress) $output .= '"as": "truck.png",';
334
-									else $output .= '"aircraft_shadow": "truck.png",';
426
+									if ($compress) {
427
+										$output .= '"as": "truck.png",';
428
+									} else {
429
+										$output .= '"aircraft_shadow": "truck.png",';
430
+									}
335 431
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') {
336
-									if ($compress) $output .= '"as": "aircraft.png",';
337
-									else $output .= '"aircraft_shadow": "aircraft.png",';
432
+									if ($compress) {
433
+										$output .= '"as": "aircraft.png",';
434
+									} else {
435
+										$output .= '"aircraft_shadow": "aircraft.png",';
436
+									}
338 437
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') {
339
-									if ($compress) $output .= '"as": "aircraft.png",';
340
-									else $output .= '"aircraft_shadow": "aircraft.png",';
438
+									if ($compress) {
439
+										$output .= '"as": "aircraft.png",';
440
+									} else {
441
+										$output .= '"aircraft_shadow": "aircraft.png",';
442
+									}
341 443
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') {
342
-									if ($compress) $output .= '"as": "helico.png",';
343
-									else $output .= '"aircraft_shadow": "helico.png",';
444
+									if ($compress) {
445
+										$output .= '"as": "helico.png",';
446
+									} else {
447
+										$output .= '"aircraft_shadow": "helico.png",';
448
+									}
344 449
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') {
345
-									if ($compress) $output .= '"as": "rail.png",';
346
-									else $output .= '"aircraft_shadow": "rail.png",';
450
+									if ($compress) {
451
+										$output .= '"as": "rail.png",';
452
+									} else {
453
+										$output .= '"aircraft_shadow": "rail.png",';
454
+									}
347 455
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') {
348
-									if ($compress) $output .= '"as": "firetruck.png",';
349
-									else $output .= '"aircraft_shadow": "firetruck.png",';
456
+									if ($compress) {
457
+										$output .= '"as": "firetruck.png",';
458
+									} else {
459
+										$output .= '"aircraft_shadow": "firetruck.png",';
460
+									}
350 461
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') {
351
-									if ($compress) $output .= '"as": "bus.png",';
352
-									else $output .= '"aircraft_shadow": "bus.png",';
462
+									if ($compress) {
463
+										$output .= '"as": "bus.png",';
464
+									} else {
465
+										$output .= '"aircraft_shadow": "bus.png",';
466
+									}
353 467
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') {
354
-									if ($compress) $output .= '"as": "phone.png",';
355
-									else $output .= '"aircraft_shadow": "phone.png",';
468
+									if ($compress) {
469
+										$output .= '"as": "phone.png",';
470
+									} else {
471
+										$output .= '"aircraft_shadow": "phone.png",';
472
+									}
356 473
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') {
357
-									if ($compress) $output .= '"as": "jogger.png",';
358
-									else $output .= '"aircraft_shadow": "jogger.png",';
474
+									if ($compress) {
475
+										$output .= '"as": "jogger.png",';
476
+									} else {
477
+										$output .= '"aircraft_shadow": "jogger.png",';
478
+									}
359 479
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') {
360
-									if ($compress) $output .= '"as": "bike.png",';
361
-									else $output .= '"aircraft_shadow": "bike.png",';
480
+									if ($compress) {
481
+										$output .= '"as": "bike.png",';
482
+									} else {
483
+										$output .= '"aircraft_shadow": "bike.png",';
484
+									}
362 485
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') {
363
-									if ($compress) $output .= '"as": "motorcycle.png",';
364
-									else $output .= '"aircraft_shadow": "motorcycle.png",';
486
+									if ($compress) {
487
+										$output .= '"as": "motorcycle.png",';
488
+									} else {
489
+										$output .= '"aircraft_shadow": "motorcycle.png",';
490
+									}
365 491
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') {
366
-									if ($compress) $output .= '"as": "balloon.png",';
367
-									else $output .= '"aircraft_shadow": "balloon.png",';
492
+									if ($compress) {
493
+										$output .= '"as": "balloon.png",';
494
+									} else {
495
+										$output .= '"aircraft_shadow": "balloon.png",';
496
+									}
368 497
 								} else {
369
-									if ($compress) $output .= '"as": "car.png",';
370
-									else $output .= '"aircraft_shadow": "car.png",';
498
+									if ($compress) {
499
+										$output .= '"as": "car.png",';
500
+									} else {
501
+										$output .= '"aircraft_shadow": "car.png",';
502
+									}
371 503
 								}
372 504
 							} elseif ($marine) {
373
-								if ($compress) $output .= '"as": "ship.png",';
374
-								else $output .= '"aircraft_shadow": "ship.png",';
505
+								if ($compress) {
506
+									$output .= '"as": "ship.png",';
507
+								} else {
508
+									$output .= '"aircraft_shadow": "ship.png",';
509
+								}
375 510
 							} else {
376
-								if ($compress) $output .= '"as": "default.png",';
377
-								else $output .= '"aircraft_shadow": "default.png",';
511
+								if ($compress) {
512
+									$output .= '"as": "default.png",';
513
+								} else {
514
+									$output .= '"aircraft_shadow": "default.png",';
515
+								}
378 516
 							}
379 517
 						} else {
380
-							if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",';
381
-							else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
518
+							if ($compress) {
519
+								$output .= '"as": "'.$spotter_item['aircraft_shadow'].'",';
520
+							} else {
521
+								$output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
522
+							}
382 523
 						}
383 524
 						if (isset($spotter_item['airline_name'])) {
384 525
 							$output .= '"airline_name": "'.$spotter_item['airline_name'].'",';
@@ -386,8 +527,11 @@  discard block
 block discarded – undo
386 527
 							$output .= '"airline_name": "NA",';
387 528
 						}
388 529
 						if (isset($spotter_item['departure_airport'])) {
389
-							if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",';
390
-							else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",';
530
+							if ($compress) {
531
+								$output .= '"dac": "'.$spotter_item['departure_airport'].'",';
532
+							} else {
533
+								$output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",';
534
+							}
391 535
 						}
392 536
 						if (isset($spotter_item['departure_airport_city'])) {
393 537
 							$output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",';
@@ -399,8 +543,11 @@  discard block
 block discarded – undo
399 543
 							$output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",';
400 544
 						}
401 545
 						if (isset($spotter_item['arrival_airport'])) {
402
-							if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",';
403
-							else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",';
546
+							if ($compress) {
547
+								$output .= '"aac": "'.$spotter_item['arrival_airport'].'",';
548
+							} else {
549
+								$output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",';
550
+							}
404 551
 						}
405 552
 						if (isset($spotter_item['arrival_airport_city'])) {
406 553
 							$output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",';
@@ -419,11 +566,17 @@  discard block
 block discarded – undo
419 566
 						}
420 567
 						
421 568
 						if (isset($spotter_item['real_altitude'])) {
422
-							if ($compress) $output .= '"a": "'.($spotter_item['real_altitude']/100).'",';
423
-							else $output .= '"altitude": "'.($spotter_item['real_altitude']/100).'",';
569
+							if ($compress) {
570
+								$output .= '"a": "'.($spotter_item['real_altitude']/100).'",';
571
+							} else {
572
+								$output .= '"altitude": "'.($spotter_item['real_altitude']/100).'",';
573
+							}
424 574
 						} elseif (isset($spotter_item['altitude'])) {
425
-							if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",';
426
-							else $output .= '"altitude": "'.$spotter_item['altitude'].'",';
575
+							if ($compress) {
576
+								$output .= '"a": "'.$spotter_item['altitude'].'",';
577
+							} else {
578
+								$output .= '"altitude": "'.$spotter_item['altitude'].'",';
579
+							}
427 580
 						}
428 581
 						
429 582
 						$heading = $spotter_item['heading'];
@@ -447,19 +600,24 @@  discard block
 block discarded – undo
447 600
 							}
448 601
 						}
449 602
 						
450
-						if ($compress)$output .= '"h": "'.$heading.'",';
451
-						else $output .= '"heading": "'.$heading.'",';
603
+						if ($compress) {
604
+							$output .= '"h": "'.$heading.'",';
605
+						} else {
606
+							$output .= '"heading": "'.$heading.'",';
607
+						}
452 608
 						if ($currenttime != '') {
453 609
 							if (strtotime($spotter_item['date']) < $currenttime) {
454 610
 								if (isset($archivespeed)) {
455 611
 									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
456 612
 									$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
457
-									if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
458
-									else {
613
+									if (!isset($idistance) || $fdistance < $idistance) {
614
+										$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
615
+									} else {
459 616
 										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
460 617
 										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
461
-										if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
462
-										else {
618
+										if (!isset($idistance) || $fdistance < $idistance) {
619
+											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
620
+										} else {
463 621
 											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);
464 622
 											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
465 623
 										}
@@ -467,12 +625,14 @@  discard block
 block discarded – undo
467 625
 								} elseif ($usenextlatlon) {
468 626
 									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
469 627
 									$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
470
-									if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
471
-									else {
628
+									if (!isset($idistance) || $fdistance < $idistance) {
629
+										$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
630
+									} else {
472 631
 										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
473 632
 										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
474
-										if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
475
-										else {
633
+										if (!isset($idistance) || $fdistance < $idistance) {
634
+											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
635
+										} else {
476 636
 											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);
477 637
 											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
478 638
 										}
@@ -511,7 +671,9 @@  discard block
 block discarded – undo
511 671
 							}
512 672
 						}
513 673
 
514
-						if (!$min) $output .= '"image": "'.$image.'",';
674
+						if (!$min) {
675
+							$output .= '"image": "'.$image.'",';
676
+						}
515 677
 						if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') {
516 678
 							$output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",';
517 679
 						}
@@ -519,8 +681,11 @@  discard block
 block discarded – undo
519 681
 							$output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",';
520 682
 						}
521 683
 						if (isset($spotter_item['squawk'])) {
522
-							if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",';
523
-							else $output .= '"squawk": "'.$spotter_item['squawk'].'",';
684
+							if ($compress) {
685
+								$output .= '"sq": "'.$spotter_item['squawk'].'",';
686
+							} else {
687
+								$output .= '"squawk": "'.$spotter_item['squawk'].'",';
688
+							}
524 689
 						}
525 690
 						if (isset($spotter_item['squawk_usage'])) {
526 691
 							$output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",';
@@ -542,14 +707,23 @@  discard block
 block discarded – undo
542 707
 						}
543 708
 						// type when not aircraft ?
544 709
 						if (isset($spotter_item['type'])) {
545
-							if ($compress) $output .= '"t": "'.$spotter_item['type'].'"';
546
-							else $output .= '"type": "'.$spotter_item['type'].'"';
710
+							if ($compress) {
711
+								$output .= '"t": "'.$spotter_item['type'].'"';
712
+							} else {
713
+								$output .= '"type": "'.$spotter_item['type'].'"';
714
+							}
547 715
 						} elseif ($marine) {
548
-							if ($compress) $output .= '"t": "ship"';
549
-							else $output .= '"type": "ship"';
716
+							if ($compress) {
717
+								$output .= '"t": "ship"';
718
+							} else {
719
+								$output .= '"type": "ship"';
720
+							}
550 721
 						} else {
551
-							if ($compress) $output .= '"t": "aircraft"';
552
-							else $output .= '"type": "aircraft"';
722
+							if ($compress) {
723
+								$output .= '"t": "aircraft"';
724
+							} else {
725
+								$output .= '"type": "aircraft"';
726
+							}
553 727
 						}
554 728
 						$output .= '},';
555 729
 						$output .= '"geometry": {';
@@ -557,15 +731,19 @@  discard block
 block discarded – undo
557 731
 								$output .= '"coordinates": [';
558 732
 								if ($currenttime != '') {
559 733
 									if (strtotime($spotter_item['date']) < $currenttime) {
560
-										if (!isset($archivespeed)) $archivespeed = 1;
734
+										if (!isset($archivespeed)) {
735
+											$archivespeed = 1;
736
+										}
561 737
 										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));
562 738
 										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
563
-										if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
564
-										else {
739
+										if (!isset($idistance) || $fdistance < $idistance) {
740
+											$output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
741
+										} else {
565 742
 											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));
566 743
 											$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
567
-											if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
568
-											else {
744
+											if (!isset($idistance) || $fdistance < $idistance) {
745
+												$output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
746
+											} else {
569 747
 												$output .= $spotter_item['longitude'].', ';
570 748
 												$output .= $spotter_item['latitude'];
571 749
 											}
@@ -643,7 +821,9 @@  discard block
 block discarded – undo
643 821
 			}
644 822
 */
645 823
 				$history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING);
646
-				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
824
+				if ($history == '' && isset($_COOKIE['history'])) {
825
+					$history = $_COOKIE['history'];
826
+				}
647 827
 				
648 828
 				if (
649 829
 				    (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') 
@@ -713,8 +893,11 @@  discard block
 block discarded – undo
713 893
 									$output_history .= ']}},';
714 894
 									$output .= $output_history;
715 895
 								}
716
-								if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
717
-								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
896
+								if ($compress) {
897
+									$output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
898
+								} else {
899
+									$output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
900
+								}
718 901
 							}
719 902
 							$output_history .= '[';
720 903
 							$output_history .=  $spotter_history['longitude'].', ';
@@ -735,10 +918,15 @@  discard block
 block discarded – undo
735 918
 							if ($d == false) {
736 919
 								if ($compress) {
737 920
 									$output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'",';
738
-									if (isset($spotter_history_array[0]['mapmatching_engine']) && $spotter_history_array[0]['mapmatching_engine'] == 'graphhopper') $output_history .= '"atr": "Powered by <a href=\"https://www.graphhopper.com/\">GraphHopper API</a>", Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",';
739
-									elseif (isset($spotter_history_array[0]['mapmatching_engine'])) $output_history .= '"atr": "Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",';
921
+									if (isset($spotter_history_array[0]['mapmatching_engine']) && $spotter_history_array[0]['mapmatching_engine'] == 'graphhopper') {
922
+										$output_history .= '"atr": "Powered by <a href=\"https://www.graphhopper.com/\">GraphHopper API</a>", Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",';
923
+									} elseif (isset($spotter_history_array[0]['mapmatching_engine'])) {
924
+										$output_history .= '"atr": "Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",';
925
+									}
740 926
 									$output_history .= '"t": "history"},"geometry": {"type": "LineString","coordinates": [';
741
-								} else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": [';
927
+								} else {
928
+									$output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": [';
929
+								}
742 930
 								$d = true;
743 931
 							}
744 932
 							$output_history .= '[';
@@ -761,7 +949,9 @@  discard block
 block discarded – undo
761 949
 							$output_historyd = '[';
762 950
 							$output_historyd .=  $spotter_item['longitude'].', ';
763 951
 							$output_historyd .=  $spotter_item['latitude'];
764
-							if (isset($spotter_history['altitude'])) $output_historyd .=  ','.$spotter_item['altitude']*30.48;
952
+							if (isset($spotter_history['altitude'])) {
953
+								$output_historyd .=  ','.$spotter_item['altitude']*30.48;
954
+							}
765 955
 							$output_historyd .= '],';
766 956
 							//$output_history = $output_historyd.$output_history;
767 957
 							$output_history = $output_history.$output_historyd;
@@ -788,8 +978,11 @@  discard block
 block discarded – undo
788 978
 				        && $spotter_item['arrival_airport'] != 'NA' 
789 979
 				        && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") 
790 980
 				    	    || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) {
791
-				    if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
792
-				    else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
981
+				    if ($compress) {
982
+				    	$output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
983
+				    } else {
984
+				    	$output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
985
+				    }
793 986
 				    if (isset($spotter_item['departure_airport_latitude'])) {
794 987
 					$output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],';
795 988
 				    } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') {
@@ -822,8 +1015,11 @@  discard block
 block discarded – undo
822 1015
 				    	    || (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute) 
823 1016
 				    	    || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) {
824 1017
 				    $havedata = false;
825
-				    if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
826
-				    else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
1018
+				    if ($compress) {
1019
+				    	$output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
1020
+				    } else {
1021
+				    	$output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
1022
+				    }
827 1023
 				    
828 1024
 				    //$output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';
829 1025
 				    if (isset($spotter_item['arrival_airport_latitude'])) {
@@ -848,7 +1044,9 @@  discard block
 block discarded – undo
848 1044
 					$output_dest  = substr($output_dest, 0, -1);
849 1045
 				    }
850 1046
 				    $output_dest .= ']}},';
851
-				    if ($havedata) $output .= $output_dest;
1047
+				    if ($havedata) {
1048
+				    	$output .= $output_dest;
1049
+				    }
852 1050
 				    unset($output_dest);
853 1051
 				}
854 1052
 			}
@@ -856,7 +1054,9 @@  discard block
 block discarded – undo
856 1054
 			$output .= ']';
857 1055
 			$output .= ',"initial_sqltime": "'.$sqltime.'",';
858 1056
 			$output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';
859
-			if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
1057
+			if (isset($begindate)) {
1058
+				$output .= '"archive_date": "'.$begindate.'",';
1059
+			}
860 1060
 			$output .= '"fc": "'.$j.'"';
861 1061
 		} else {
862 1062
 			$output .= '"features": ';
Please login to merge, or discard this patch.
install/class.update_schema.php 2 patches
Spacing   +248 added lines, -248 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
             try {
15 15
             	$sth = $Connection->db->prepare($query);
16 16
 		$sth->execute();
17
-    	    } catch(PDOException $e) {
17
+    	    } catch (PDOException $e) {
18 18
 		return "error : ".$e->getMessage()."\n";
19 19
     	    }
20 20
     	    while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
21
-    		$Schedule->addSchedule($row['ident'],$row['departure_airport_icao'],$row['departure_airport_time'],$row['arrival_airport_icao'],$row['arrival_airport_time']);
21
+    		$Schedule->addSchedule($row['ident'], $row['departure_airport_icao'], $row['departure_airport_time'], $row['arrival_airport_icao'], $row['arrival_airport_time']);
22 22
     	    }
23 23
 	
24 24
 	}
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         	try {
51 51
             	    $sth = $Connection->db->prepare($query);
52 52
 		    $sth->execute();
53
-    		} catch(PDOException $e) {
53
+    		} catch (PDOException $e) {
54 54
 		    return "error (add new columns to routes table) : ".$e->getMessage()."\n";
55 55
     		}
56 56
     		// Copy schedules data to routes table
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         	try {
61 61
             	    $sth = $Connection->db->prepare($query);
62 62
 		    $sth->execute();
63
-    		} catch(PDOException $e) {
63
+    		} catch (PDOException $e) {
64 64
 		    return "error (delete schedule table) : ".$e->getMessage()."\n";
65 65
     		}
66 66
     		// Add source column
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     		try {
69 69
             	    $sth = $Connection->db->prepare($query);
70 70
 		    $sth->execute();
71
-    		} catch(PDOException $e) {
71
+    		} catch (PDOException $e) {
72 72
 		    return "error (add source column to aircraft_modes) : ".$e->getMessage()."\n";
73 73
     		}
74 74
 		// Delete unused column
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     		try {
77 77
             	    $sth = $Connection->db->prepare($query);
78 78
 		    $sth->execute();
79
-    		} catch(PDOException $e) {
79
+    		} catch (PDOException $e) {
80 80
 		    return "error (Delete unused column of aircraft_modes) : ".$e->getMessage()."\n";
81 81
     		}
82 82
 		// Add ModeS column
@@ -84,14 +84,14 @@  discard block
 block discarded – undo
84 84
     		try {
85 85
             	    $sth = $Connection->db->prepare($query);
86 86
 		    $sth->execute();
87
-    		} catch(PDOException $e) {
87
+    		} catch (PDOException $e) {
88 88
 		    return "error (Add ModeS column in spotter_output) : ".$e->getMessage()."\n";
89 89
     		}
90 90
 		$query = "ALTER TABLE `spotter_live`  ADD `ModeS` VARCHAR(255)";
91 91
     		try {
92 92
             	    $sth = $Connection->db->prepare($query);
93 93
 		    $sth->execute();
94
-    		} catch(PDOException $e) {
94
+    		} catch (PDOException $e) {
95 95
 		    return "error (Add ModeS column in spotter_live) : ".$e->getMessage()."\n";
96 96
     		}
97 97
     		// Add auto_increment for aircraft_modes
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     		try {
100 100
             	    $sth = $Connection->db->prepare($query);
101 101
 		    $sth->execute();
102
-    		} catch(PDOException $e) {
102
+    		} catch (PDOException $e) {
103 103
 		    return "error (Add Auto increment in aircraft_modes) : ".$e->getMessage()."\n";
104 104
     		}
105 105
     		$error = '';
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         	try {
111 111
             	    $sth = $Connection->db->prepare($query);
112 112
 		    $sth->execute();
113
-    		} catch(PDOException $e) {
113
+    		} catch (PDOException $e) {
114 114
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
115 115
     		}
116 116
 		return $error;
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         	try {
124 124
             	    $sth = $Connection->db->prepare($query);
125 125
 		    $sth->execute();
126
-    		} catch(PDOException $e) {
126
+    		} catch (PDOException $e) {
127 127
 		    return "error (add new columns to routes table) : ".$e->getMessage()."\n";
128 128
     		}
129 129
     		$error = '';
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         	try {
135 135
             	    $sth = $Connection->db->prepare($query);
136 136
 		    $sth->execute();
137
-    		} catch(PDOException $e) {
137
+    		} catch (PDOException $e) {
138 138
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
139 139
     		}
140 140
 		return $error;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         	try {
148 148
             	    $sth = $Connection->db->prepare($query);
149 149
 		    $sth->execute();
150
-    		} catch(PDOException $e) {
150
+    		} catch (PDOException $e) {
151 151
 		    return "error (add new columns to aircraft_modes) : ".$e->getMessage()."\n";
152 152
     		}
153 153
     		// Add image_source_website column to spotter_image
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         	try {
156 156
             	    $sth = $Connection->db->prepare($query);
157 157
 		    $sth->execute();
158
-    		} catch(PDOException $e) {
158
+    		} catch (PDOException $e) {
159 159
 		    return "error (add new columns to spotter_image) : ".$e->getMessage()."\n";
160 160
     		}
161 161
     		$error = '';
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         	try {
165 165
             	    $sth = $Connection->db->prepare($query);
166 166
 		    $sth->execute();
167
-    		} catch(PDOException $e) {
167
+    		} catch (PDOException $e) {
168 168
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
169 169
     		}
170 170
 		return $error;
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
         	    try {
183 183
             		$sth = $Connection->db->prepare($query);
184 184
 			$sth->execute();
185
-    		    } catch(PDOException $e) {
185
+    		    } catch (PDOException $e) {
186 186
 			return "error (update schema_version) : ".$e->getMessage()."\n";
187 187
     		    }
188 188
     		}
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         	try {
197 197
             	    $sth = $Connection->db->prepare($query);
198 198
 		    $sth->execute();
199
-    		} catch(PDOException $e) {
199
+    		} catch (PDOException $e) {
200 200
 		    return "error (add new columns to translation) : ".$e->getMessage()."\n";
201 201
     		}
202 202
     		// Add aircraft_shadow column to aircraft
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         	try {
205 205
             	    $sth = $Connection->db->prepare($query);
206 206
 		    $sth->execute();
207
-    		} catch(PDOException $e) {
207
+    		} catch (PDOException $e) {
208 208
 		    return "error (add new column to aircraft) : ".$e->getMessage()."\n";
209 209
     		}
210 210
     		// Add aircraft_shadow column to spotter_live
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
         	try {
213 213
             	    $sth = $Connection->db->prepare($query);
214 214
 		    $sth->execute();
215
-    		} catch(PDOException $e) {
215
+    		} catch (PDOException $e) {
216 216
 		    return "error (add new column to spotter_live) : ".$e->getMessage()."\n";
217 217
     		}
218 218
     		$error = '';
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
         	try {
226 226
             	    $sth = $Connection->db->prepare($query);
227 227
 		    $sth->execute();
228
-    		} catch(PDOException $e) {
228
+    		} catch (PDOException $e) {
229 229
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
230 230
     		}
231 231
 		return $error;
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 
234 234
 	private static function update_from_6() {
235 235
     		$Connection = new Connection();
236
-    		if (!$Connection->indexExists('spotter_output','flightaware_id')) {
236
+    		if (!$Connection->indexExists('spotter_output', 'flightaware_id')) {
237 237
     		    $query = "ALTER TABLE spotter_output ADD INDEX(flightaware_id);
238 238
 			ALTER TABLE spotter_output ADD INDEX(date);
239 239
 			ALTER TABLE spotter_output ADD INDEX(ident);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
         	    try {
251 251
             		$sth = $Connection->db->prepare($query);
252 252
 			$sth->execute();
253
-    		    } catch(PDOException $e) {
253
+    		    } catch (PDOException $e) {
254 254
 			return "error (add some indexes) : ".$e->getMessage()."\n";
255 255
     		    }
256 256
     		}
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
         	try {
266 266
             	    $sth = $Connection->db->prepare($query);
267 267
 		    $sth->execute();
268
-    		} catch(PDOException $e) {
268
+    		} catch (PDOException $e) {
269 269
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
270 270
     		}
271 271
 		return $error;
@@ -274,12 +274,12 @@  discard block
 block discarded – undo
274 274
 	private static function update_from_7() {
275 275
 		global $globalDBname, $globalDBdriver;
276 276
     		$Connection = new Connection();
277
-    		$query="ALTER TABLE spotter_live ADD pilot_name VARCHAR(255) NULL, ADD pilot_id VARCHAR(255) NULL;
277
+    		$query = "ALTER TABLE spotter_live ADD pilot_name VARCHAR(255) NULL, ADD pilot_id VARCHAR(255) NULL;
278 278
     			ALTER TABLE spotter_output ADD pilot_name VARCHAR(255) NULL, ADD pilot_id VARCHAR(255) NULL;";
279 279
         	try {
280 280
             	    $sth = $Connection->db->prepare($query);
281 281
 		    $sth->execute();
282
-    		} catch(PDOException $e) {
282
+    		} catch (PDOException $e) {
283 283
 		    return "error (add pilot column to spotter_live and spotter_output) : ".$e->getMessage()."\n";
284 284
     		}
285 285
     		if ($globalDBdriver == 'mysql') {
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 		    try {
288 288
             		$sth = $Connection->db->prepare($query);
289 289
 			$sth->execute();
290
-    		    } catch(PDOException $e) {
290
+    		    } catch (PDOException $e) {
291 291
 			return "error (problem when select engine for spotter_engine) : ".$e->getMessage()."\n";
292 292
     		    }
293 293
     		    $row = $sth->fetch(PDO::FETCH_ASSOC);
@@ -299,15 +299,15 @@  discard block
 block discarded – undo
299 299
 				DROP TABLE spotter_archive;
300 300
 				RENAME TABLE copy TO spotter_archive;";
301 301
             	    } else {
302
-    			$query="ALTER TABLE spotter_archive ADD pilot_name VARCHAR(255) NULL, ADD pilot_id VARCHAR(255) NULL";
302
+    			$query = "ALTER TABLE spotter_archive ADD pilot_name VARCHAR(255) NULL, ADD pilot_id VARCHAR(255) NULL";
303 303
             	    }
304 304
                 } else {
305
-    		    $query="ALTER TABLE spotter_archive ADD pilot_name VARCHAR(255) NULL, ADD pilot_id VARCHAR(255) NULL";
305
+    		    $query = "ALTER TABLE spotter_archive ADD pilot_name VARCHAR(255) NULL, ADD pilot_id VARCHAR(255) NULL";
306 306
                 }
307 307
         	try {
308 308
             	    $sth = $Connection->db->prepare($query);
309 309
 		    $sth->execute();
310
-    		} catch(PDOException $e) {
310
+    		} catch (PDOException $e) {
311 311
 		    return "error (add pilot column to spotter_archive) : ".$e->getMessage()."\n";
312 312
     		}
313 313
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
         	try {
321 321
             	    $sth = $Connection->db->prepare($query);
322 322
 		    $sth->execute();
323
-    		} catch(PDOException $e) {
323
+    		} catch (PDOException $e) {
324 324
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
325 325
     		}
326 326
 		return $error;
@@ -339,14 +339,14 @@  discard block
 block discarded – undo
339 339
         	try {
340 340
             	    $sth = $Connection->db->prepare($query);
341 341
 		    $sth->execute();
342
-    		} catch(PDOException $e) {
342
+    		} catch (PDOException $e) {
343 343
 		    return "error (insert last_update values) : ".$e->getMessage()."\n";
344 344
     		}
345 345
 		$query = "UPDATE `config` SET `value` = '9' WHERE `name` = 'schema_version'";
346 346
         	try {
347 347
             	    $sth = $Connection->db->prepare($query);
348 348
 		    $sth->execute();
349
-    		} catch(PDOException $e) {
349
+    		} catch (PDOException $e) {
350 350
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
351 351
     		}
352 352
 		return $error;
@@ -354,12 +354,12 @@  discard block
 block discarded – undo
354 354
 
355 355
 	private static function update_from_9() {
356 356
     		$Connection = new Connection();
357
-    		$query="ALTER TABLE spotter_live ADD verticalrate INT(11) NULL;
357
+    		$query = "ALTER TABLE spotter_live ADD verticalrate INT(11) NULL;
358 358
     			ALTER TABLE spotter_output ADD verticalrate INT(11) NULL;";
359 359
         	try {
360 360
             	    $sth = $Connection->db->prepare($query);
361 361
 		    $sth->execute();
362
-    		} catch(PDOException $e) {
362
+    		} catch (PDOException $e) {
363 363
 		    return "error (add verticalrate column to spotter_live and spotter_output) : ".$e->getMessage()."\n";
364 364
     		}
365 365
 		$error = '';
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
         	try {
372 372
             	    $sth = $Connection->db->prepare($query);
373 373
 		    $sth->execute();
374
-    		} catch(PDOException $e) {
374
+    		} catch (PDOException $e) {
375 375
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
376 376
     		}
377 377
 		return $error;
@@ -379,11 +379,11 @@  discard block
 block discarded – undo
379 379
 
380 380
 	private static function update_from_10() {
381 381
     		$Connection = new Connection();
382
-    		$query="ALTER TABLE atc CHANGE `type` `type` ENUM('Observer','Flight Information','Delivery','Tower','Approach','ACC','Departure','Ground','Flight Service Station','Control Radar or Centre') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL";
382
+    		$query = "ALTER TABLE atc CHANGE `type` `type` ENUM('Observer','Flight Information','Delivery','Tower','Approach','ACC','Departure','Ground','Flight Service Station','Control Radar or Centre') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL";
383 383
         	try {
384 384
             	    $sth = $Connection->db->prepare($query);
385 385
 		    $sth->execute();
386
-    		} catch(PDOException $e) {
386
+    		} catch (PDOException $e) {
387 387
 		    return "error (add new enum to ATC table) : ".$e->getMessage()."\n";
388 388
     		}
389 389
 		$error = '';
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
         	try {
402 402
             	    $sth = $Connection->db->prepare($query);
403 403
 		    $sth->execute();
404
-    		} catch(PDOException $e) {
404
+    		} catch (PDOException $e) {
405 405
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
406 406
     		}
407 407
 		return $error;
@@ -410,18 +410,18 @@  discard block
 block discarded – undo
410 410
 	private static function update_from_11() {
411 411
 		global $globalDBdriver, $globalDBname;
412 412
     		$Connection = new Connection();
413
-    		$query="ALTER TABLE spotter_output ADD owner_name VARCHAR(255) NULL DEFAULT NULL, ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE, ADD last_ground BOOLEAN NOT NULL DEFAULT FALSE, ADD last_seen DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, ADD last_latitude FLOAT NULL, ADD last_longitude FLOAT NULL, ADD last_altitude INT(11) NULL, ADD last_ground_speed INT(11), ADD real_arrival_airport_icao VARCHAR(999), ADD real_arrival_airport_time VARCHAR(20),ADD real_departure_airport_icao VARCHAR(999), ADD real_departure_airport_time VARCHAR(20)";
413
+    		$query = "ALTER TABLE spotter_output ADD owner_name VARCHAR(255) NULL DEFAULT NULL, ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE, ADD last_ground BOOLEAN NOT NULL DEFAULT FALSE, ADD last_seen DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, ADD last_latitude FLOAT NULL, ADD last_longitude FLOAT NULL, ADD last_altitude INT(11) NULL, ADD last_ground_speed INT(11), ADD real_arrival_airport_icao VARCHAR(999), ADD real_arrival_airport_time VARCHAR(20),ADD real_departure_airport_icao VARCHAR(999), ADD real_departure_airport_time VARCHAR(20)";
414 414
         	try {
415 415
             	    $sth = $Connection->db->prepare($query);
416 416
 		    $sth->execute();
417
-    		} catch(PDOException $e) {
417
+    		} catch (PDOException $e) {
418 418
 		    return "error (add owner_name & format_source column to spotter_output) : ".$e->getMessage()."\n";
419 419
     		}
420
-    		$query="ALTER TABLE spotter_live ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE";
420
+    		$query = "ALTER TABLE spotter_live ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE";
421 421
         	try {
422 422
             	    $sth = $Connection->db->prepare($query);
423 423
 		    $sth->execute();
424
-    		} catch(PDOException $e) {
424
+    		} catch (PDOException $e) {
425 425
 		    return "error (format_source column to spotter_live) : ".$e->getMessage()."\n";
426 426
     		}
427 427
     		if ($globalDBdriver == 'mysql') {
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 		    try {
430 430
             		$sth = $Connection->db->prepare($query);
431 431
 			$sth->execute();
432
-    		    } catch(PDOException $e) {
432
+    		    } catch (PDOException $e) {
433 433
 			return "error (problem when select engine for spotter_engine) : ".$e->getMessage()."\n";
434 434
     		    }
435 435
     		    $row = $sth->fetch(PDO::FETCH_ASSOC);
@@ -441,15 +441,15 @@  discard block
 block discarded – undo
441 441
 				DROP TABLE spotter_archive;
442 442
 				RENAME TABLE copy TO spotter_archive;";
443 443
             	    } else {
444
-    			$query="ALTER TABLE spotter_archive ADD verticalrate INT(11) NULL, ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE";
444
+    			$query = "ALTER TABLE spotter_archive ADD verticalrate INT(11) NULL, ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE";
445 445
             	    }
446 446
                 } else {
447
-    		    $query="ALTER TABLE spotter_archive ADD verticalrate INT(11) NULL, ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE";
447
+    		    $query = "ALTER TABLE spotter_archive ADD verticalrate INT(11) NULL, ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE";
448 448
                 }
449 449
         	try {
450 450
             	    $sth = $Connection->db->prepare($query);
451 451
 		    $sth->execute();
452
-    		} catch(PDOException $e) {
452
+    		} catch (PDOException $e) {
453 453
 		    return "error (add columns to spotter_archive) : ".$e->getMessage()."\n";
454 454
     		}
455 455
 
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
         	try {
460 460
             	    $sth = $Connection->db->prepare($query);
461 461
 		    $sth->execute();
462
-    		} catch(PDOException $e) {
462
+    		} catch (PDOException $e) {
463 463
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
464 464
     		}
465 465
 		return $error;
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
         	try {
488 488
             	    $sth = $Connection->db->prepare($query);
489 489
 		    $sth->execute();
490
-    		} catch(PDOException $e) {
490
+    		} catch (PDOException $e) {
491 491
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
492 492
     		}
493 493
 		return $error;
@@ -495,12 +495,12 @@  discard block
 block discarded – undo
495 495
 
496 496
 	private static function update_from_13() {
497 497
     		$Connection = new Connection();
498
-    		if (!$Connection->checkColumnName('spotter_archive_output','real_departure_airport_icao')) {
499
-    			$query="ALTER TABLE spotter_archive_output ADD real_departure_airport_icao VARCHAR(20), ADD real_departure_airport_time VARCHAR(20)";
498
+    		if (!$Connection->checkColumnName('spotter_archive_output', 'real_departure_airport_icao')) {
499
+    			$query = "ALTER TABLE spotter_archive_output ADD real_departure_airport_icao VARCHAR(20), ADD real_departure_airport_time VARCHAR(20)";
500 500
 			try {
501 501
 				$sth = $Connection->db->prepare($query);
502 502
 				$sth->execute();
503
-	    		} catch(PDOException $e) {
503
+	    		} catch (PDOException $e) {
504 504
 				return "error (update spotter_archive_output) : ".$e->getMessage()."\n";
505 505
     			}
506 506
 		}
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
         	try {
510 510
             	    $sth = $Connection->db->prepare($query);
511 511
 		    $sth->execute();
512
-    		} catch(PDOException $e) {
512
+    		} catch (PDOException $e) {
513 513
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
514 514
     		}
515 515
 		return $error;
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
         	try {
528 528
             	    $sth = $Connection->db->prepare($query);
529 529
 		    $sth->execute();
530
-    		} catch(PDOException $e) {
530
+    		} catch (PDOException $e) {
531 531
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
532 532
     		}
533 533
 		return $error;
@@ -538,11 +538,11 @@  discard block
 block discarded – undo
538 538
     		$Connection = new Connection();
539 539
 		$error = '';
540 540
     		// Add tables
541
-    		$query="ALTER TABLE `stats` CHANGE `stats_date` `stats_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP";
541
+    		$query = "ALTER TABLE `stats` CHANGE `stats_date` `stats_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP";
542 542
         	try {
543 543
             	    $sth = $Connection->db->prepare($query);
544 544
 		    $sth->execute();
545
-    		} catch(PDOException $e) {
545
+    		} catch (PDOException $e) {
546 546
 		    return "error (update stats) : ".$e->getMessage()."\n";
547 547
     		}
548 548
 		if ($error != '') return $error;
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
         	try {
551 551
             	    $sth = $Connection->db->prepare($query);
552 552
 		    $sth->execute();
553
-    		} catch(PDOException $e) {
553
+    		} catch (PDOException $e) {
554 554
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
555 555
     		}
556 556
 		return $error;
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
         	try {
572 572
             	    $sth = $Connection->db->prepare($query);
573 573
 		    $sth->execute();
574
-    		} catch(PDOException $e) {
574
+    		} catch (PDOException $e) {
575 575
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
576 576
     		}
577 577
 		return $error;
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
         	try {
590 590
             	    $sth = $Connection->db->prepare($query);
591 591
 		    $sth->execute();
592
-    		} catch(PDOException $e) {
592
+    		} catch (PDOException $e) {
593 593
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
594 594
     		}
595 595
 		return $error;
@@ -598,12 +598,12 @@  discard block
 block discarded – undo
598 598
     		$Connection = new Connection();
599 599
 		$error = '';
600 600
     		// Modify stats_airport table
601
-    		if (!$Connection->checkColumnName('stats_airport','airport_name')) {
601
+    		if (!$Connection->checkColumnName('stats_airport', 'airport_name')) {
602 602
     			$query = "ALTER TABLE `stats_airport` ADD `stats_type` VARCHAR(50) NOT NULL DEFAULT 'yearly', ADD `airport_name` VARCHAR(255) NOT NULL, ADD `date` DATE NULL DEFAULT NULL, DROP INDEX `airport_icao`, ADD UNIQUE `airport_icao` (`airport_icao`, `type`, `date`)";
603 603
     	        	try {
604 604
 	            	    $sth = $Connection->db->prepare($query);
605 605
 			    $sth->execute();
606
-    			} catch(PDOException $e) {
606
+    			} catch (PDOException $e) {
607 607
 			    return "error (update stats) : ".$e->getMessage()."\n";
608 608
     			}
609 609
     		}
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
         	try {
613 613
             	    $sth = $Connection->db->prepare($query);
614 614
 		    $sth->execute();
615
-    		} catch(PDOException $e) {
615
+    		} catch (PDOException $e) {
616 616
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
617 617
     		}
618 618
 		return $error;
@@ -629,73 +629,73 @@  discard block
 block discarded – undo
629 629
         	try {
630 630
             	    $sth = $Connection->db->prepare($query);
631 631
 		    $sth->execute();
632
-    		} catch(PDOException $e) {
632
+    		} catch (PDOException $e) {
633 633
 		    return "error (remove primary key on spotter_archive) : ".$e->getMessage()."\n";
634 634
     		}
635 635
 		$query = "alter table spotter_archive add spotter_archive_id INT(11)";
636 636
         	try {
637 637
             	    $sth = $Connection->db->prepare($query);
638 638
 		    $sth->execute();
639
-    		} catch(PDOException $e) {
639
+    		} catch (PDOException $e) {
640 640
 		    return "error (add id again on spotter_archive) : ".$e->getMessage()."\n";
641 641
     		}
642
-		if (!$Connection->checkColumnName('spotter_archive','over_country')) {
642
+		if (!$Connection->checkColumnName('spotter_archive', 'over_country')) {
643 643
 			// Add column over_country
644 644
     			$query = "ALTER TABLE `spotter_archive` ADD `over_country` VARCHAR(5) NULL DEFAULT NULL";
645 645
 			try {
646 646
             			$sth = $Connection->db->prepare($query);
647 647
 				$sth->execute();
648
-			} catch(PDOException $e) {
648
+			} catch (PDOException $e) {
649 649
 				return "error (add over_country) : ".$e->getMessage()."\n";
650 650
 			}
651 651
 		}
652
-		if (!$Connection->checkColumnName('spotter_live','over_country')) {
652
+		if (!$Connection->checkColumnName('spotter_live', 'over_country')) {
653 653
 			// Add column over_country
654 654
     			$query = "ALTER TABLE `spotter_live` ADD `over_country` VARCHAR(5) NULL DEFAULT NULL";
655 655
 			try {
656 656
             			$sth = $Connection->db->prepare($query);
657 657
 				$sth->execute();
658
-			} catch(PDOException $e) {
658
+			} catch (PDOException $e) {
659 659
 				return "error (add over_country) : ".$e->getMessage()."\n";
660 660
 			}
661 661
 		}
662
-		if (!$Connection->checkColumnName('spotter_output','source_name')) {
662
+		if (!$Connection->checkColumnName('spotter_output', 'source_name')) {
663 663
 			// Add source_name to spotter_output, spotter_live, spotter_archive, spotter_archive_output
664 664
     			$query = "ALTER TABLE `spotter_output` ADD `source_name` VARCHAR(255) NULL AFTER `format_source`";
665 665
 			try {
666 666
 				$sth = $Connection->db->prepare($query);
667 667
 				$sth->execute();
668
-			} catch(PDOException $e) {
668
+			} catch (PDOException $e) {
669 669
 				return "error (add source_name column) : ".$e->getMessage()."\n";
670 670
     			}
671 671
     		}
672
-		if (!$Connection->checkColumnName('spotter_live','source_name')) {
672
+		if (!$Connection->checkColumnName('spotter_live', 'source_name')) {
673 673
 			// Add source_name to spotter_output, spotter_live, spotter_archive, spotter_archive_output
674 674
     			$query = "ALTER TABLE `spotter_live` ADD `source_name` VARCHAR(255) NULL AFTER `format_source`";
675 675
 			try {
676 676
 				$sth = $Connection->db->prepare($query);
677 677
 				$sth->execute();
678
-			} catch(PDOException $e) {
678
+			} catch (PDOException $e) {
679 679
 				return "error (add source_name column) : ".$e->getMessage()."\n";
680 680
     			}
681 681
     		}
682
-		if (!$Connection->checkColumnName('spotter_archive_output','source_name')) {
682
+		if (!$Connection->checkColumnName('spotter_archive_output', 'source_name')) {
683 683
 			// Add source_name to spotter_output, spotter_live, spotter_archive, spotter_archive_output
684 684
     			$query = "ALTER TABLE `spotter_archive_output` ADD `source_name` VARCHAR(255) NULL AFTER `format_source`";
685 685
 			try {
686 686
 				$sth = $Connection->db->prepare($query);
687 687
 				$sth->execute();
688
-			} catch(PDOException $e) {
688
+			} catch (PDOException $e) {
689 689
 				return "error (add source_name column) : ".$e->getMessage()."\n";
690 690
     			}
691 691
     		}
692
-		if (!$Connection->checkColumnName('spotter_archive','source_name')) {
692
+		if (!$Connection->checkColumnName('spotter_archive', 'source_name')) {
693 693
 			// Add source_name to spotter_output, spotter_live, spotter_archive, spotter_archive_output
694 694
     			$query = "ALTER TABLE `spotter_archive` ADD `source_name` VARCHAR(255) NULL AFTER `format_source`;";
695 695
 			try {
696 696
 				$sth = $Connection->db->prepare($query);
697 697
 				$sth->execute();
698
-			} catch(PDOException $e) {
698
+			} catch (PDOException $e) {
699 699
 				return "error (add source_name column) : ".$e->getMessage()."\n";
700 700
     			}
701 701
     		}
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
         	try {
705 705
             	    $sth = $Connection->db->prepare($query);
706 706
 		    $sth->execute();
707
-    		} catch(PDOException $e) {
707
+    		} catch (PDOException $e) {
708 708
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
709 709
     		}
710 710
 		return $error;
@@ -719,13 +719,13 @@  discard block
 block discarded – undo
719 719
 			$error .= create_db::import_file('../db/airlines.sql');
720 720
 			if ($error != '') return 'Import airlines.sql : '.$error;
721 721
 		}
722
-		if (!$Connection->checkColumnName('aircraft_modes','type_flight')) {
722
+		if (!$Connection->checkColumnName('aircraft_modes', 'type_flight')) {
723 723
 			// Add column over_country
724 724
     			$query = "ALTER TABLE `aircraft_modes` ADD `type_flight` VARCHAR(50) NULL DEFAULT NULL;";
725 725
         		try {
726 726
 				$sth = $Connection->db->prepare($query);
727 727
 				$sth->execute();
728
-			} catch(PDOException $e) {
728
+			} catch (PDOException $e) {
729 729
 				return "error (add over_country) : ".$e->getMessage()."\n";
730 730
     			}
731 731
     		}
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
         	try {
742 742
             	    $sth = $Connection->db->prepare($query);
743 743
 		    $sth->execute();
744
-    		} catch(PDOException $e) {
744
+    		} catch (PDOException $e) {
745 745
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
746 746
     		}
747 747
 		return $error;
@@ -750,13 +750,13 @@  discard block
 block discarded – undo
750 750
 	private static function update_from_21() {
751 751
 		$Connection = new Connection();
752 752
 		$error = '';
753
-		if (!$Connection->checkColumnName('stats_airport','stats_type')) {
753
+		if (!$Connection->checkColumnName('stats_airport', 'stats_type')) {
754 754
 			// Rename type to stats_type
755 755
 			$query = "ALTER TABLE `stats_airport` CHANGE `type` `stats_type` VARCHAR(50);ALTER TABLE `stats` CHANGE `type` `stats_type` VARCHAR(50);ALTER TABLE `stats_flight` CHANGE `type` `stats_type` VARCHAR(50);";
756 756
 			try {
757 757
 				$sth = $Connection->db->prepare($query);
758 758
 				$sth->execute();
759
-			} catch(PDOException $e) {
759
+			} catch (PDOException $e) {
760 760
 				return "error (rename type to stats_type on stats*) : ".$e->getMessage()."\n";
761 761
 			}
762 762
 			if ($error != '') return $error;
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
         	try {
766 766
             	    $sth = $Connection->db->prepare($query);
767 767
 		    $sth->execute();
768
-    		} catch(PDOException $e) {
768
+    		} catch (PDOException $e) {
769 769
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
770 770
     		}
771 771
 		return $error;
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
         	try {
789 789
             	    $sth = $Connection->db->prepare($query);
790 790
 		    $sth->execute();
791
-    		} catch(PDOException $e) {
791
+    		} catch (PDOException $e) {
792 792
 		    return "error (update schema_version) : ".$e->getMessage()."\n";
793 793
     		}
794 794
 		return $error;
@@ -814,17 +814,17 @@  discard block
 block discarded – undo
814 814
 			try {
815 815
 				$sth = $Connection->db->prepare($query);
816 816
 				$sth->execute();
817
-			} catch(PDOException $e) {
817
+			} catch (PDOException $e) {
818 818
 				return "error (create index on spotter_archive) : ".$e->getMessage()."\n";
819 819
 			}
820 820
 		}
821
-		if (!$Connection->checkColumnName('stats_aircraft','aircraft_manufacturer')) {
821
+		if (!$Connection->checkColumnName('stats_aircraft', 'aircraft_manufacturer')) {
822 822
 			// Add aircraft_manufacturer to stats_aircraft
823 823
     			$query = "ALTER TABLE stats_aircraft ADD aircraft_manufacturer VARCHAR(255) NULL";
824 824
 			try {
825 825
 				$sth = $Connection->db->prepare($query);
826 826
 				$sth->execute();
827
-			} catch(PDOException $e) {
827
+			} catch (PDOException $e) {
828 828
 				return "error (add aircraft_manufacturer column) : ".$e->getMessage()."\n";
829 829
     			}
830 830
     		}
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
 		try {
834 834
 			$sth = $Connection->db->prepare($query);
835 835
 			$sth->execute();
836
-		} catch(PDOException $e) {
836
+		} catch (PDOException $e) {
837 837
 			return "error (update schema_version) : ".$e->getMessage()."\n";
838 838
 		}
839 839
 		return $error;
@@ -849,23 +849,23 @@  discard block
 block discarded – undo
849 849
 			$error .= create_db::import_file('../db/pgsql/airlines.sql');
850 850
 		}
851 851
 		if ($error != '') return 'Import airlines.sql : '.$error;
852
-		if (!$Connection->checkColumnName('airlines','forsource')) {
852
+		if (!$Connection->checkColumnName('airlines', 'forsource')) {
853 853
 			// Add forsource to airlines
854 854
 			$query = "ALTER TABLE airlines ADD forsource VARCHAR(255) NULL DEFAULT NULL";
855 855
 			try {
856 856
 				$sth = $Connection->db->prepare($query);
857 857
 				$sth->execute();
858
-			} catch(PDOException $e) {
858
+			} catch (PDOException $e) {
859 859
 				return "error (add forsource column) : ".$e->getMessage()."\n";
860 860
 			}
861 861
 		}
862
-		if (!$Connection->checkColumnName('stats_aircraft','stats_airline')) {
862
+		if (!$Connection->checkColumnName('stats_aircraft', 'stats_airline')) {
863 863
 			// Add forsource to airlines
864 864
 			$query = "ALTER TABLE stats_aircraft ADD stats_airline VARCHAR(255) NULL DEFAULT '', ADD filter_name VARCHAR(255) NULL DEFAULT ''";
865 865
 			try {
866 866
 				$sth = $Connection->db->prepare($query);
867 867
 				$sth->execute();
868
-			} catch(PDOException $e) {
868
+			} catch (PDOException $e) {
869 869
 				return "error (add stats_airline & filter_name column in stats_aircraft) : ".$e->getMessage()."\n";
870 870
 			}
871 871
 			// Add unique key
@@ -877,17 +877,17 @@  discard block
 block discarded – undo
877 877
 			try {
878 878
 				$sth = $Connection->db->prepare($query);
879 879
 				$sth->execute();
880
-			} catch(PDOException $e) {
880
+			} catch (PDOException $e) {
881 881
 				return "error (add unique key in stats_aircraft) : ".$e->getMessage()."\n";
882 882
 			}
883 883
 		}
884
-		if (!$Connection->checkColumnName('stats_airport','stats_airline')) {
884
+		if (!$Connection->checkColumnName('stats_airport', 'stats_airline')) {
885 885
 			// Add forsource to airlines
886 886
 			$query = "ALTER TABLE stats_airport ADD stats_airline VARCHAR(255) NULL DEFAULT '', ADD filter_name VARCHAR(255) NULL DEFAULT ''";
887 887
 			try {
888 888
 				$sth = $Connection->db->prepare($query);
889 889
 				$sth->execute();
890
-			} catch(PDOException $e) {
890
+			} catch (PDOException $e) {
891 891
 				return "error (add filter_name column in stats_airport) : ".$e->getMessage()."\n";
892 892
 			}
893 893
 			// Add unique key
@@ -899,17 +899,17 @@  discard block
 block discarded – undo
899 899
 			try {
900 900
 				$sth = $Connection->db->prepare($query);
901 901
 				$sth->execute();
902
-			} catch(PDOException $e) {
902
+			} catch (PDOException $e) {
903 903
 				return "error (add unique key in stats_airport) : ".$e->getMessage()."\n";
904 904
 			}
905 905
 		}
906
-		if (!$Connection->checkColumnName('stats_country','stats_airline')) {
906
+		if (!$Connection->checkColumnName('stats_country', 'stats_airline')) {
907 907
 			// Add forsource to airlines
908 908
 			$query = "ALTER TABLE stats_country ADD stats_airline VARCHAR(255) NULL DEFAULT '', ADD filter_name VARCHAR(255) NULL DEFAULT ''";
909 909
 			try {
910 910
 				$sth = $Connection->db->prepare($query);
911 911
 				$sth->execute();
912
-			} catch(PDOException $e) {
912
+			} catch (PDOException $e) {
913 913
 				return "error (add stats_airline & filter_name column in stats_country) : ".$e->getMessage()."\n";
914 914
 			}
915 915
 			// Add unique key
@@ -921,36 +921,36 @@  discard block
 block discarded – undo
921 921
 			try {
922 922
 				$sth = $Connection->db->prepare($query);
923 923
 				$sth->execute();
924
-			} catch(PDOException $e) {
924
+			} catch (PDOException $e) {
925 925
 				return "error (add unique key in stats_airline) : ".$e->getMessage()."\n";
926 926
 			}
927 927
 		}
928
-		if (!$Connection->checkColumnName('stats_flight','stats_airline')) {
928
+		if (!$Connection->checkColumnName('stats_flight', 'stats_airline')) {
929 929
 			// Add forsource to airlines
930 930
 			$query = "ALTER TABLE stats_flight ADD stats_airline VARCHAR(255) NULL DEFAULT '', ADD filter_name VARCHAR(255) NULL DEFAULT ''";
931 931
 			try {
932 932
 				$sth = $Connection->db->prepare($query);
933 933
 				$sth->execute();
934
-			} catch(PDOException $e) {
934
+			} catch (PDOException $e) {
935 935
 				return "error (add stats_airline & filter_name column in stats_flight) : ".$e->getMessage()."\n";
936 936
 			}
937 937
 		}
938
-		if (!$Connection->checkColumnName('stats','stats_airline')) {
938
+		if (!$Connection->checkColumnName('stats', 'stats_airline')) {
939 939
 			// Add forsource to airlines
940 940
 			$query = "ALTER TABLE stats ADD stats_airline VARCHAR(255) NULL DEFAULT '', ADD filter_name VARCHAR(255) NULL DEFAULT ''";
941 941
 			try {
942 942
 				$sth = $Connection->db->prepare($query);
943 943
 				$sth->execute();
944
-			} catch(PDOException $e) {
944
+			} catch (PDOException $e) {
945 945
 				return "error (add stats_airline & filter_name column in stats) : ".$e->getMessage()."\n";
946 946
 			}
947
-			if ($globalDBdriver == 'mysql' && $Connection->indexExists('stats','type')) {
947
+			if ($globalDBdriver == 'mysql' && $Connection->indexExists('stats', 'type')) {
948 948
 				// Add unique key
949 949
 				$query = "drop index type on stats;ALTER TABLE stats ADD UNIQUE stats_type (stats_type,stats_date,stats_airline,filter_name);";
950 950
 				try {
951 951
 					$sth = $Connection->db->prepare($query);
952 952
 					$sth->execute();
953
-				} catch(PDOException $e) {
953
+				} catch (PDOException $e) {
954 954
 					return "error (add unique key in stats) : ".$e->getMessage()."\n";
955 955
 				}
956 956
 			} else {
@@ -963,18 +963,18 @@  discard block
 block discarded – undo
963 963
 				try {
964 964
 					$sth = $Connection->db->prepare($query);
965 965
 					$sth->execute();
966
-				} catch(PDOException $e) {
966
+				} catch (PDOException $e) {
967 967
 					return "error (add unique key in stats) : ".$e->getMessage()."\n";
968 968
 				}
969 969
 			}
970 970
 		}
971
-		if (!$Connection->checkColumnName('stats_registration','stats_airline')) {
971
+		if (!$Connection->checkColumnName('stats_registration', 'stats_airline')) {
972 972
 			// Add forsource to airlines
973 973
 			$query = "ALTER TABLE stats_registration ADD stats_airline VARCHAR(255) NULL DEFAULT '', ADD filter_name VARCHAR(255) NULL DEFAULT ''";
974 974
 			try {
975 975
 				$sth = $Connection->db->prepare($query);
976 976
 				$sth->execute();
977
-			} catch(PDOException $e) {
977
+			} catch (PDOException $e) {
978 978
 				return "error (add stats_airline & filter_name column in stats_registration) : ".$e->getMessage()."\n";
979 979
 			}
980 980
 			// Add unique key
@@ -986,17 +986,17 @@  discard block
 block discarded – undo
986 986
 			try {
987 987
 				$sth = $Connection->db->prepare($query);
988 988
 				$sth->execute();
989
-			} catch(PDOException $e) {
989
+			} catch (PDOException $e) {
990 990
 				return "error (add unique key in stats_registration) : ".$e->getMessage()."\n";
991 991
 			}
992 992
 		}
993
-		if (!$Connection->checkColumnName('stats_callsign','filter_name')) {
993
+		if (!$Connection->checkColumnName('stats_callsign', 'filter_name')) {
994 994
 			// Add forsource to airlines
995 995
 			$query = "ALTER TABLE stats_callsign ADD filter_name VARCHAR(255) NULL DEFAULT ''";
996 996
 			try {
997 997
 				$sth = $Connection->db->prepare($query);
998 998
 				$sth->execute();
999
-			} catch(PDOException $e) {
999
+			} catch (PDOException $e) {
1000 1000
 				return "error (add filter_name column in stats_callsign) : ".$e->getMessage()."\n";
1001 1001
 			}
1002 1002
 			// Add unique key
@@ -1008,17 +1008,17 @@  discard block
 block discarded – undo
1008 1008
 			try {
1009 1009
 				$sth = $Connection->db->prepare($query);
1010 1010
 				$sth->execute();
1011
-			} catch(PDOException $e) {
1011
+			} catch (PDOException $e) {
1012 1012
 				return "error (add unique key in stats_callsign) : ".$e->getMessage()."\n";
1013 1013
 			}
1014 1014
 		}
1015
-		if (!$Connection->checkColumnName('stats_airline','filter_name')) {
1015
+		if (!$Connection->checkColumnName('stats_airline', 'filter_name')) {
1016 1016
 			// Add forsource to airlines
1017 1017
 			$query = "ALTER TABLE stats_airline ADD filter_name VARCHAR(255) NULL DEFAULT ''";
1018 1018
 			try {
1019 1019
 				$sth = $Connection->db->prepare($query);
1020 1020
 				$sth->execute();
1021
-			} catch(PDOException $e) {
1021
+			} catch (PDOException $e) {
1022 1022
 				return "error (add filter_name column in stats_airline) : ".$e->getMessage()."\n";
1023 1023
 			}
1024 1024
 			// Add unique key
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
 			try {
1031 1031
 				$sth = $Connection->db->prepare($query);
1032 1032
 				$sth->execute();
1033
-			} catch(PDOException $e) {
1033
+			} catch (PDOException $e) {
1034 1034
 				return "error (add unique key in stats_callsign) : ".$e->getMessage()."\n";
1035 1035
 			}
1036 1036
 		}
@@ -1039,7 +1039,7 @@  discard block
 block discarded – undo
1039 1039
 		try {
1040 1040
 			$sth = $Connection->db->prepare($query);
1041 1041
 			$sth->execute();
1042
-		} catch(PDOException $e) {
1042
+		} catch (PDOException $e) {
1043 1043
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1044 1044
 		}
1045 1045
 		return $error;
@@ -1049,13 +1049,13 @@  discard block
 block discarded – undo
1049 1049
 		global $globalDBdriver;
1050 1050
 		$Connection = new Connection();
1051 1051
 		$error = '';
1052
-		if (!$Connection->checkColumnName('stats_owner','stats_airline')) {
1052
+		if (!$Connection->checkColumnName('stats_owner', 'stats_airline')) {
1053 1053
 			// Add forsource to airlines
1054 1054
 			$query = "ALTER TABLE stats_owner ADD stats_airline VARCHAR(255) NULL DEFAULT '', ADD filter_name VARCHAR(255) NULL DEFAULT ''";
1055 1055
 			try {
1056 1056
 				$sth = $Connection->db->prepare($query);
1057 1057
 				$sth->execute();
1058
-			} catch(PDOException $e) {
1058
+			} catch (PDOException $e) {
1059 1059
 				return "error (add stats_airline & filter_name column in stats_owner) : ".$e->getMessage()."\n";
1060 1060
 			}
1061 1061
 			// Add unique key
@@ -1067,17 +1067,17 @@  discard block
 block discarded – undo
1067 1067
 			try {
1068 1068
 				$sth = $Connection->db->prepare($query);
1069 1069
 				$sth->execute();
1070
-			} catch(PDOException $e) {
1070
+			} catch (PDOException $e) {
1071 1071
 				return "error (add unique key in stats_owner) : ".$e->getMessage()."\n";
1072 1072
 			}
1073 1073
 		}
1074
-		if (!$Connection->checkColumnName('stats_pilot','stats_airline')) {
1074
+		if (!$Connection->checkColumnName('stats_pilot', 'stats_airline')) {
1075 1075
 			// Add forsource to airlines
1076 1076
 			$query = "ALTER TABLE stats_pilot ADD stats_airline VARCHAR(255) NULL DEFAULT '', ADD filter_name VARCHAR(255) NULL DEFAULT ''";
1077 1077
 			try {
1078 1078
 				$sth = $Connection->db->prepare($query);
1079 1079
 				$sth->execute();
1080
-			} catch(PDOException $e) {
1080
+			} catch (PDOException $e) {
1081 1081
 				return "error (add stats_airline & filter_name column in stats_pilot) : ".$e->getMessage()."\n";
1082 1082
 			}
1083 1083
 			// Add unique key
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
 			try {
1090 1090
 				$sth = $Connection->db->prepare($query);
1091 1091
 				$sth->execute();
1092
-			} catch(PDOException $e) {
1092
+			} catch (PDOException $e) {
1093 1093
 				return "error (add unique key in stats_pilot) : ".$e->getMessage()."\n";
1094 1094
 			}
1095 1095
 		}
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
 		try {
1098 1098
 			$sth = $Connection->db->prepare($query);
1099 1099
 			$sth->execute();
1100
-		} catch(PDOException $e) {
1100
+		} catch (PDOException $e) {
1101 1101
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1102 1102
 		}
1103 1103
 		return $error;
@@ -1107,12 +1107,12 @@  discard block
 block discarded – undo
1107 1107
 		global $globalDBdriver;
1108 1108
 		$Connection = new Connection();
1109 1109
 		$error = '';
1110
-		if (!$Connection->checkColumnName('atc','format_source')) {
1110
+		if (!$Connection->checkColumnName('atc', 'format_source')) {
1111 1111
 			$query = "ALTER TABLE atc ADD format_source VARCHAR(255) DEFAULT NULL, ADD source_name VARCHAR(255) DEFAULT NULL";
1112 1112
 			try {
1113 1113
 				$sth = $Connection->db->prepare($query);
1114 1114
 				$sth->execute();
1115
-			} catch(PDOException $e) {
1115
+			} catch (PDOException $e) {
1116 1116
 				return "error (add format_source & source_name column in atc) : ".$e->getMessage()."\n";
1117 1117
 			}
1118 1118
 		}
@@ -1120,7 +1120,7 @@  discard block
 block discarded – undo
1120 1120
 		try {
1121 1121
 			$sth = $Connection->db->prepare($query);
1122 1122
 			$sth->execute();
1123
-		} catch(PDOException $e) {
1123
+		} catch (PDOException $e) {
1124 1124
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1125 1125
 		}
1126 1126
 		return $error;
@@ -1130,13 +1130,13 @@  discard block
 block discarded – undo
1130 1130
 		global $globalDBdriver;
1131 1131
 		$Connection = new Connection();
1132 1132
 		$error = '';
1133
-		if (!$Connection->checkColumnName('stats_pilot','format_source')) {
1133
+		if (!$Connection->checkColumnName('stats_pilot', 'format_source')) {
1134 1134
 			// Add forsource to airlines
1135 1135
 			$query = "ALTER TABLE stats_pilot ADD format_source VARCHAR(255) NULL DEFAULT ''";
1136 1136
 			try {
1137 1137
 				$sth = $Connection->db->prepare($query);
1138 1138
 				$sth->execute();
1139
-			} catch(PDOException $e) {
1139
+			} catch (PDOException $e) {
1140 1140
 				return "error (add format_source column in stats_pilot) : ".$e->getMessage()."\n";
1141 1141
 			}
1142 1142
 			// Add unique key
@@ -1148,7 +1148,7 @@  discard block
 block discarded – undo
1148 1148
 			try {
1149 1149
 				$sth = $Connection->db->prepare($query);
1150 1150
 				$sth->execute();
1151
-			} catch(PDOException $e) {
1151
+			} catch (PDOException $e) {
1152 1152
 				return "error (modify unique key in stats_pilot) : ".$e->getMessage()."\n";
1153 1153
 			}
1154 1154
 		}
@@ -1156,7 +1156,7 @@  discard block
 block discarded – undo
1156 1156
 		try {
1157 1157
 			$sth = $Connection->db->prepare($query);
1158 1158
 			$sth->execute();
1159
-		} catch(PDOException $e) {
1159
+		} catch (PDOException $e) {
1160 1160
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1161 1161
 		}
1162 1162
 		return $error;
@@ -1166,23 +1166,23 @@  discard block
 block discarded – undo
1166 1166
 		global $globalDBdriver;
1167 1167
 		$Connection = new Connection();
1168 1168
 		$error = '';
1169
-		if ($globalDBdriver == 'mysql' && !$Connection->indexExists('spotter_live','latitude')) {
1169
+		if ($globalDBdriver == 'mysql' && !$Connection->indexExists('spotter_live', 'latitude')) {
1170 1170
 			// Add unique key
1171 1171
 			$query = "alter table spotter_live add index(latitude,longitude)";
1172 1172
 			try {
1173 1173
 				$sth = $Connection->db->prepare($query);
1174 1174
 				$sth->execute();
1175
-			} catch(PDOException $e) {
1175
+			} catch (PDOException $e) {
1176 1176
 				return "error (add index latitude,longitude on spotter_live) : ".$e->getMessage()."\n";
1177 1177
 			}
1178 1178
                 }
1179
-		if (!$Connection->checkColumnName('aircraft','mfr')) {
1179
+		if (!$Connection->checkColumnName('aircraft', 'mfr')) {
1180 1180
 			// Add mfr to aircraft
1181 1181
 			$query = "ALTER TABLE aircraft ADD mfr VARCHAR(255) NULL";
1182 1182
 			try {
1183 1183
 				$sth = $Connection->db->prepare($query);
1184 1184
 				$sth->execute();
1185
-			} catch(PDOException $e) {
1185
+			} catch (PDOException $e) {
1186 1186
 				return "error (add mfr column in aircraft) : ".$e->getMessage()."\n";
1187 1187
 			}
1188 1188
 		}
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
 		try {
1199 1199
 			$sth = $Connection->db->prepare($query);
1200 1200
 			$sth->execute();
1201
-		} catch(PDOException $e) {
1201
+		} catch (PDOException $e) {
1202 1202
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1203 1203
 		}
1204 1204
 		return $error;
@@ -1208,13 +1208,13 @@  discard block
 block discarded – undo
1208 1208
 		global $globalDBdriver;
1209 1209
 		$Connection = new Connection();
1210 1210
 		$error = '';
1211
-		if ($Connection->checkColumnName('aircraft','mfr')) {
1211
+		if ($Connection->checkColumnName('aircraft', 'mfr')) {
1212 1212
 			// drop mfr to aircraft
1213 1213
 			$query = "ALTER TABLE aircraft DROP COLUMN mfr";
1214 1214
 			try {
1215 1215
 				$sth = $Connection->db->prepare($query);
1216 1216
 				$sth->execute();
1217
-			} catch(PDOException $e) {
1217
+			} catch (PDOException $e) {
1218 1218
 				return "error (drop mfr column in aircraft) : ".$e->getMessage()."\n";
1219 1219
 			}
1220 1220
 		}
@@ -1230,7 +1230,7 @@  discard block
 block discarded – undo
1230 1230
 		try {
1231 1231
 			$sth = $Connection->db->prepare($query);
1232 1232
 			$sth->execute();
1233
-		} catch(PDOException $e) {
1233
+		} catch (PDOException $e) {
1234 1234
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1235 1235
 		}
1236 1236
 		return $error;
@@ -1240,33 +1240,33 @@  discard block
 block discarded – undo
1240 1240
 		global $globalDBdriver;
1241 1241
 		$Connection = new Connection();
1242 1242
 		$error = '';
1243
-		if (!$Connection->indexExists('notam','ref_idx')) {
1243
+		if (!$Connection->indexExists('notam', 'ref_idx')) {
1244 1244
 			// Add index key
1245 1245
 			$query = "create index ref_idx on notam (ref)";
1246 1246
 			try {
1247 1247
 				$sth = $Connection->db->prepare($query);
1248 1248
 				$sth->execute();
1249
-			} catch(PDOException $e) {
1249
+			} catch (PDOException $e) {
1250 1250
 				return "error (add index ref on notam) : ".$e->getMessage()."\n";
1251 1251
 			}
1252 1252
                 }
1253
-		if (!$Connection->indexExists('accidents','registration_idx')) {
1253
+		if (!$Connection->indexExists('accidents', 'registration_idx')) {
1254 1254
 			// Add index key
1255 1255
 			$query = "create index registration_idx on accidents (registration)";
1256 1256
 			try {
1257 1257
 				$sth = $Connection->db->prepare($query);
1258 1258
 				$sth->execute();
1259
-			} catch(PDOException $e) {
1259
+			} catch (PDOException $e) {
1260 1260
 				return "error (add index registration on accidents) : ".$e->getMessage()."\n";
1261 1261
 			}
1262 1262
                 }
1263
-		if (!$Connection->indexExists('accidents','rdts')) {
1263
+		if (!$Connection->indexExists('accidents', 'rdts')) {
1264 1264
 			// Add index key
1265 1265
 			$query = "create index rdts on accidents (registration,date,type,source)";
1266 1266
 			try {
1267 1267
 				$sth = $Connection->db->prepare($query);
1268 1268
 				$sth->execute();
1269
-			} catch(PDOException $e) {
1269
+			} catch (PDOException $e) {
1270 1270
 				return "error (add index registration, date, type & source on accidents) : ".$e->getMessage()."\n";
1271 1271
 			}
1272 1272
                 }
@@ -1275,7 +1275,7 @@  discard block
 block discarded – undo
1275 1275
 		try {
1276 1276
 			$sth = $Connection->db->prepare($query);
1277 1277
 			$sth->execute();
1278
-		} catch(PDOException $e) {
1278
+		} catch (PDOException $e) {
1279 1279
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1280 1280
 		}
1281 1281
 		return $error;
@@ -1285,23 +1285,23 @@  discard block
 block discarded – undo
1285 1285
 		global $globalDBdriver;
1286 1286
 		$Connection = new Connection();
1287 1287
 		$error = '';
1288
-		if (!$Connection->checkColumnName('accidents','airline_name')) {
1288
+		if (!$Connection->checkColumnName('accidents', 'airline_name')) {
1289 1289
 			// Add airline_name to accidents
1290 1290
 			$query = "ALTER TABLE accidents ADD airline_name VARCHAR(255) NULL";
1291 1291
 			try {
1292 1292
 				$sth = $Connection->db->prepare($query);
1293 1293
 				$sth->execute();
1294
-			} catch(PDOException $e) {
1294
+			} catch (PDOException $e) {
1295 1295
 				return "error (add airline_name column in accidents) : ".$e->getMessage()."\n";
1296 1296
 			}
1297 1297
 		}
1298
-		if (!$Connection->checkColumnName('accidents','airline_icao')) {
1298
+		if (!$Connection->checkColumnName('accidents', 'airline_icao')) {
1299 1299
 			// Add airline_icao to accidents
1300 1300
 			$query = "ALTER TABLE accidents ADD airline_icao VARCHAR(10) NULL";
1301 1301
 			try {
1302 1302
 				$sth = $Connection->db->prepare($query);
1303 1303
 				$sth->execute();
1304
-			} catch(PDOException $e) {
1304
+			} catch (PDOException $e) {
1305 1305
 				return "error (add airline_icao column in accidents) : ".$e->getMessage()."\n";
1306 1306
 			}
1307 1307
 		}
@@ -1309,7 +1309,7 @@  discard block
 block discarded – undo
1309 1309
 		try {
1310 1310
 			$sth = $Connection->db->prepare($query);
1311 1311
 			$sth->execute();
1312
-		} catch(PDOException $e) {
1312
+		} catch (PDOException $e) {
1313 1313
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1314 1314
 		}
1315 1315
 		return $error;
@@ -1319,13 +1319,13 @@  discard block
 block discarded – undo
1319 1319
 		global $globalDBdriver, $globalVATSIM, $globalIVAO;
1320 1320
 		$Connection = new Connection();
1321 1321
 		$error = '';
1322
-		if (!$Connection->checkColumnName('airlines','alliance')) {
1322
+		if (!$Connection->checkColumnName('airlines', 'alliance')) {
1323 1323
 			// Add alliance to airlines
1324 1324
 			$query = "ALTER TABLE airlines ADD alliance VARCHAR(255) NULL";
1325 1325
 			try {
1326 1326
 				$sth = $Connection->db->prepare($query);
1327 1327
 				$sth->execute();
1328
-			} catch(PDOException $e) {
1328
+			} catch (PDOException $e) {
1329 1329
 				return "error (add alliance column in airlines) : ".$e->getMessage()."\n";
1330 1330
 			}
1331 1331
 		}
@@ -1352,7 +1352,7 @@  discard block
 block discarded – undo
1352 1352
 		try {
1353 1353
 			$sth = $Connection->db->prepare($query);
1354 1354
 			$sth->execute();
1355
-		} catch(PDOException $e) {
1355
+		} catch (PDOException $e) {
1356 1356
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1357 1357
 		}
1358 1358
 		return $error;
@@ -1362,13 +1362,13 @@  discard block
 block discarded – undo
1362 1362
 		global $globalDBdriver, $globalVATSIM, $globalIVAO;
1363 1363
 		$Connection = new Connection();
1364 1364
 		$error = '';
1365
-		if (!$Connection->checkColumnName('airlines','ban_eu')) {
1365
+		if (!$Connection->checkColumnName('airlines', 'ban_eu')) {
1366 1366
 			// Add ban_eu to airlines
1367 1367
 			$query = "ALTER TABLE airlines ADD ban_eu INTEGER NOT NULL DEFAULT '0'";
1368 1368
 			try {
1369 1369
 				$sth = $Connection->db->prepare($query);
1370 1370
 				$sth->execute();
1371
-			} catch(PDOException $e) {
1371
+			} catch (PDOException $e) {
1372 1372
 				return "error (add ban_eu column in airlines) : ".$e->getMessage()."\n";
1373 1373
 			}
1374 1374
 		}
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
 		try {
1377 1377
 			$sth = $Connection->db->prepare($query);
1378 1378
 			$sth->execute();
1379
-		} catch(PDOException $e) {
1379
+		} catch (PDOException $e) {
1380 1380
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1381 1381
 		}
1382 1382
 		return $error;
@@ -1387,19 +1387,19 @@  discard block
 block discarded – undo
1387 1387
 		$Connection = new Connection();
1388 1388
 		$error = '';
1389 1389
 		if ($globalDBdriver == 'mysql') {
1390
-			if ($Connection->getColumnType('spotter_output','date') == 'TIMESTAMP' && $Connection->getColumnType('spotter_output','last_seen') != 'TIMESTAMP') {
1390
+			if ($Connection->getColumnType('spotter_output', 'date') == 'TIMESTAMP' && $Connection->getColumnType('spotter_output', 'last_seen') != 'TIMESTAMP') {
1391 1391
 				$query = "ALTER TABLE spotter_output CHANGE date date TIMESTAMP NULL DEFAULT NULL";
1392 1392
 				try {
1393 1393
 					$sth = $Connection->db->prepare($query);
1394 1394
 					$sth->execute();
1395
-				} catch(PDOException $e) {
1395
+				} catch (PDOException $e) {
1396 1396
 					return "error (delete default timestamp spotter_output) : ".$e->getMessage()."\n";
1397 1397
 				}
1398 1398
 				$query = "ALTER TABLE spotter_output MODIFY COLUMN last_seen timestamp not null default current_timestamp()";
1399 1399
 				try {
1400 1400
 					$sth = $Connection->db->prepare($query);
1401 1401
 					$sth->execute();
1402
-				} catch(PDOException $e) {
1402
+				} catch (PDOException $e) {
1403 1403
 					return "error (convert spotter_output last_seen to timestamp) : ".$e->getMessage()."\n";
1404 1404
 				}
1405 1405
 				
@@ -1407,7 +1407,7 @@  discard block
 block discarded – undo
1407 1407
 				try {
1408 1408
 					$sth = $Connection->db->prepare($query);
1409 1409
 					$sth->execute();
1410
-				} catch(PDOException $e) {
1410
+				} catch (PDOException $e) {
1411 1411
 					return "error (delete default timestamp spotter_output) : ".$e->getMessage()."\n";
1412 1412
 				}
1413 1413
 				/*$query = "SELECT date,last_seen FROM spotter_output WHERE last_seen < date ORDER BY date DESC LIMIT 150";
@@ -1458,7 +1458,7 @@  discard block
 block discarded – undo
1458 1458
 				try {
1459 1459
 					$sth = $Connection->db->prepare($query);
1460 1460
 					$sth->execute();
1461
-				} catch(PDOException $e) {
1461
+				} catch (PDOException $e) {
1462 1462
 					return "error (fix date) : ".$e->getMessage()."\n";
1463 1463
 				}
1464 1464
 			}
@@ -1543,7 +1543,7 @@  discard block
 block discarded – undo
1543 1543
 		try {
1544 1544
 			$sth = $Connection->db->prepare($query);
1545 1545
 			$sth->execute();
1546
-		} catch(PDOException $e) {
1546
+		} catch (PDOException $e) {
1547 1547
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1548 1548
 		}
1549 1549
 		return $error;
@@ -1552,13 +1552,13 @@  discard block
 block discarded – undo
1552 1552
 		global $globalDBdriver;
1553 1553
 		$Connection = new Connection();
1554 1554
 		$error = '';
1555
-		if (!$Connection->indexExists('accidents','type')) {
1555
+		if (!$Connection->indexExists('accidents', 'type')) {
1556 1556
 			// Add index key
1557 1557
 			$query = "create index type on accidents (type,date)";
1558 1558
 			try {
1559 1559
 				$sth = $Connection->db->prepare($query);
1560 1560
 				$sth->execute();
1561
-			} catch(PDOException $e) {
1561
+			} catch (PDOException $e) {
1562 1562
 				return "error (add index type on accidents) : ".$e->getMessage()."\n";
1563 1563
 			}
1564 1564
                 }
@@ -1566,7 +1566,7 @@  discard block
 block discarded – undo
1566 1566
 		try {
1567 1567
 			$sth = $Connection->db->prepare($query);
1568 1568
 			$sth->execute();
1569
-		} catch(PDOException $e) {
1569
+		} catch (PDOException $e) {
1570 1570
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1571 1571
 		}
1572 1572
 		return $error;
@@ -1576,12 +1576,12 @@  discard block
 block discarded – undo
1576 1576
 		global $globalDBdriver;
1577 1577
 		$Connection = new Connection();
1578 1578
 		$error = '';
1579
-		if (!$Connection->checkColumnName('aircraft_modes','source_type')) {
1579
+		if (!$Connection->checkColumnName('aircraft_modes', 'source_type')) {
1580 1580
 			$query = "ALTER TABLE aircraft_modes ADD source_type VARCHAR(255) DEFAULT 'modes'";
1581 1581
 			try {
1582 1582
 				$sth = $Connection->db->prepare($query);
1583 1583
 				$sth->execute();
1584
-			} catch(PDOException $e) {
1584
+			} catch (PDOException $e) {
1585 1585
 				return "error (add source_type column in aircraft_modes) : ".$e->getMessage()."\n";
1586 1586
 			}
1587 1587
 		}
@@ -1647,7 +1647,7 @@  discard block
 block discarded – undo
1647 1647
 		try {
1648 1648
 			$sth = $Connection->db->prepare($query);
1649 1649
 			$sth->execute();
1650
-		} catch(PDOException $e) {
1650
+		} catch (PDOException $e) {
1651 1651
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1652 1652
 		}
1653 1653
 		return $error;
@@ -1699,7 +1699,7 @@  discard block
 block discarded – undo
1699 1699
 			try {
1700 1700
 				$sth = $Connection->db->prepare($query);
1701 1701
 				$sth->execute();
1702
-			} catch(PDOException $e) {
1702
+			} catch (PDOException $e) {
1703 1703
 				return "error (problem when select engine for spotter_engine) : ".$e->getMessage()."\n";
1704 1704
 			}
1705 1705
 			$row = $sth->fetch(PDO::FETCH_ASSOC);
@@ -1708,18 +1708,18 @@  discard block
 block discarded – undo
1708 1708
 				try {
1709 1709
 					$sth = $Connection->db->prepare($query);
1710 1710
 					$sth->execute();
1711
-				} catch(PDOException $e) {
1711
+				} catch (PDOException $e) {
1712 1712
 					return "error (Change table format from archive to InnoDB for spotter_archive) : ".$e->getMessage()."\n";
1713 1713
 				}
1714 1714
 			}
1715 1715
 		}
1716
-		if (!$Connection->indexExists('spotter_archive','flightaware_id_date_idx') && !$Connection->indexExists('spotter_archive','flightaware_id')) {
1716
+		if (!$Connection->indexExists('spotter_archive', 'flightaware_id_date_idx') && !$Connection->indexExists('spotter_archive', 'flightaware_id')) {
1717 1717
 			// Add index key
1718 1718
 			$query = "create index flightaware_id_date_idx on spotter_archive (flightaware_id,date)";
1719 1719
 			try {
1720 1720
 				$sth = $Connection->db->prepare($query);
1721 1721
 				$sth->execute();
1722
-			} catch(PDOException $e) {
1722
+			} catch (PDOException $e) {
1723 1723
 				return "error (add index flightaware_id, date on spotter_archive) : ".$e->getMessage()."\n";
1724 1724
 			}
1725 1725
                 }
@@ -1727,7 +1727,7 @@  discard block
 block discarded – undo
1727 1727
 		try {
1728 1728
 			$sth = $Connection->db->prepare($query);
1729 1729
 			$sth->execute();
1730
-		} catch(PDOException $e) {
1730
+		} catch (PDOException $e) {
1731 1731
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1732 1732
 		}
1733 1733
 		return $error;
@@ -1738,148 +1738,148 @@  discard block
 block discarded – undo
1738 1738
 		$Connection = new Connection();
1739 1739
 		$error = '';
1740 1740
 		if ($globalDBdriver == 'mysql') {
1741
-			if (!$Connection->checkColumnName('marine_output','type_id')) {
1741
+			if (!$Connection->checkColumnName('marine_output', 'type_id')) {
1742 1742
 				$query = "ALTER TABLE marine_output ADD COLUMN type_id int(11) DEFAULT NULL";
1743 1743
 				try {
1744 1744
 					$sth = $Connection->db->prepare($query);
1745 1745
 					$sth->execute();
1746
-				} catch(PDOException $e) {
1746
+				} catch (PDOException $e) {
1747 1747
 					return "error (add column type_id in marine_output) : ".$e->getMessage()."\n";
1748 1748
 				}
1749 1749
 			}
1750
-			if (!$Connection->checkColumnName('marine_live','type_id')) {
1750
+			if (!$Connection->checkColumnName('marine_live', 'type_id')) {
1751 1751
 				$query = "ALTER TABLE marine_live ADD COLUMN type_id int(11) DEFAULT NULL";
1752 1752
 				try {
1753 1753
 					$sth = $Connection->db->prepare($query);
1754 1754
 					$sth->execute();
1755
-				} catch(PDOException $e) {
1755
+				} catch (PDOException $e) {
1756 1756
 					return "error (add column type_id in marine_live) : ".$e->getMessage()."\n";
1757 1757
 				}
1758 1758
 			}
1759
-			if (!$Connection->checkColumnName('marine_archive','type_id')) {
1759
+			if (!$Connection->checkColumnName('marine_archive', 'type_id')) {
1760 1760
 				$query = "ALTER TABLE marine_archive ADD COLUMN type_id int(11) DEFAULT NULL";
1761 1761
 				try {
1762 1762
 					$sth = $Connection->db->prepare($query);
1763 1763
 					$sth->execute();
1764
-				} catch(PDOException $e) {
1764
+				} catch (PDOException $e) {
1765 1765
 					return "error (add column type_id in marine_archive) : ".$e->getMessage()."\n";
1766 1766
 				}
1767 1767
 			}
1768
-			if (!$Connection->checkColumnName('marine_archive_output','type_id')) {
1768
+			if (!$Connection->checkColumnName('marine_archive_output', 'type_id')) {
1769 1769
 				$query = "ALTER TABLE marine_archive_output ADD COLUMN type_id int(11) DEFAULT NULL";
1770 1770
 				try {
1771 1771
 					$sth = $Connection->db->prepare($query);
1772 1772
 					$sth->execute();
1773
-				} catch(PDOException $e) {
1773
+				} catch (PDOException $e) {
1774 1774
 					return "error (add column type_id in marine_archive_output) : ".$e->getMessage()."\n";
1775 1775
 				}
1776 1776
 			}
1777
-			if (!$Connection->checkColumnName('marine_output','status_id')) {
1777
+			if (!$Connection->checkColumnName('marine_output', 'status_id')) {
1778 1778
 				$query = "ALTER TABLE marine_output ADD COLUMN status_id int(11) DEFAULT NULL";
1779 1779
 				try {
1780 1780
 					$sth = $Connection->db->prepare($query);
1781 1781
 					$sth->execute();
1782
-				} catch(PDOException $e) {
1782
+				} catch (PDOException $e) {
1783 1783
 					return "error (add column status_id in marine_output) : ".$e->getMessage()."\n";
1784 1784
 				}
1785 1785
 			}
1786
-			if (!$Connection->checkColumnName('marine_live','status_id')) {
1786
+			if (!$Connection->checkColumnName('marine_live', 'status_id')) {
1787 1787
 				$query = "ALTER TABLE marine_live ADD COLUMN status_id int(11) DEFAULT NULL";
1788 1788
 				try {
1789 1789
 					$sth = $Connection->db->prepare($query);
1790 1790
 					$sth->execute();
1791
-				} catch(PDOException $e) {
1791
+				} catch (PDOException $e) {
1792 1792
 					return "error (add column status_id in marine_live) : ".$e->getMessage()."\n";
1793 1793
 				}
1794 1794
 			}
1795
-			if (!$Connection->checkColumnName('marine_archive','status_id')) {
1795
+			if (!$Connection->checkColumnName('marine_archive', 'status_id')) {
1796 1796
 				$query = "ALTER TABLE marine_archive ADD COLUMN status_id int(11) DEFAULT NULL";
1797 1797
 				try {
1798 1798
 					$sth = $Connection->db->prepare($query);
1799 1799
 					$sth->execute();
1800
-				} catch(PDOException $e) {
1800
+				} catch (PDOException $e) {
1801 1801
 					return "error (add column status_id in marine_archive) : ".$e->getMessage()."\n";
1802 1802
 				}
1803 1803
 			}
1804
-			if (!$Connection->checkColumnName('marine_archive_output','status_id')) {
1804
+			if (!$Connection->checkColumnName('marine_archive_output', 'status_id')) {
1805 1805
 				$query = "ALTER TABLE marine_archive_output ADD COLUMN status_id int(11) DEFAULT NULL";
1806 1806
 				try {
1807 1807
 					$sth = $Connection->db->prepare($query);
1808 1808
 					$sth->execute();
1809
-				} catch(PDOException $e) {
1809
+				} catch (PDOException $e) {
1810 1810
 					return "error (add column status_id in marine_archive_output) : ".$e->getMessage()."\n";
1811 1811
 				}
1812 1812
 			}
1813 1813
 		} else {
1814
-			if (!$Connection->checkColumnName('marine_output','type_id')) {
1814
+			if (!$Connection->checkColumnName('marine_output', 'type_id')) {
1815 1815
 				$query = "ALTER TABLE marine_output ADD COLUMN type_id integer DEFAULT NULL";
1816 1816
 				try {
1817 1817
 					$sth = $Connection->db->prepare($query);
1818 1818
 					$sth->execute();
1819
-				} catch(PDOException $e) {
1819
+				} catch (PDOException $e) {
1820 1820
 					return "error (add column type_id in marine_output) : ".$e->getMessage()."\n";
1821 1821
 				}
1822 1822
 			}
1823
-			if (!$Connection->checkColumnName('marine_live','type_id')) {
1823
+			if (!$Connection->checkColumnName('marine_live', 'type_id')) {
1824 1824
 				$query = "ALTER TABLE marine_live ADD COLUMN type_id integer DEFAULT NULL";
1825 1825
 				try {
1826 1826
 					$sth = $Connection->db->prepare($query);
1827 1827
 					$sth->execute();
1828
-				} catch(PDOException $e) {
1828
+				} catch (PDOException $e) {
1829 1829
 					return "error (add column type_id in marine_live) : ".$e->getMessage()."\n";
1830 1830
 				}
1831 1831
 			}
1832
-			if (!$Connection->checkColumnName('marine_archive','type_id')) {
1832
+			if (!$Connection->checkColumnName('marine_archive', 'type_id')) {
1833 1833
 				$query = "ALTER TABLE marine_archive ADD COLUMN type_id integer DEFAULT NULL";
1834 1834
 				try {
1835 1835
 					$sth = $Connection->db->prepare($query);
1836 1836
 					$sth->execute();
1837
-				} catch(PDOException $e) {
1837
+				} catch (PDOException $e) {
1838 1838
 					return "error (add column type_id in marine_archive) : ".$e->getMessage()."\n";
1839 1839
 				}
1840 1840
 			}
1841
-			if (!$Connection->checkColumnName('marine_archive_output','type_id')) {
1841
+			if (!$Connection->checkColumnName('marine_archive_output', 'type_id')) {
1842 1842
 				$query = "ALTER TABLE marine_archive_output ADD COLUMN type_id integer DEFAULT NULL";
1843 1843
 				try {
1844 1844
 					$sth = $Connection->db->prepare($query);
1845 1845
 					$sth->execute();
1846
-				} catch(PDOException $e) {
1846
+				} catch (PDOException $e) {
1847 1847
 					return "error (add column type_id in marine_archive_output) : ".$e->getMessage()."\n";
1848 1848
 				}
1849 1849
 			}
1850
-			if (!$Connection->checkColumnName('marine_output','status_id')) {
1850
+			if (!$Connection->checkColumnName('marine_output', 'status_id')) {
1851 1851
 				$query = "ALTER TABLE marine_output ADD COLUMN status_id integer DEFAULT NULL";
1852 1852
 				try {
1853 1853
 					$sth = $Connection->db->prepare($query);
1854 1854
 					$sth->execute();
1855
-				} catch(PDOException $e) {
1855
+				} catch (PDOException $e) {
1856 1856
 					return "error (add column status_id in marine_output) : ".$e->getMessage()."\n";
1857 1857
 				}
1858 1858
 			}
1859
-			if (!$Connection->checkColumnName('marine_live','status_id')) {
1859
+			if (!$Connection->checkColumnName('marine_live', 'status_id')) {
1860 1860
 				$query = "ALTER TABLE marine_live ADD COLUMN status_id integer DEFAULT NULL";
1861 1861
 				try {
1862 1862
 					$sth = $Connection->db->prepare($query);
1863 1863
 					$sth->execute();
1864
-				} catch(PDOException $e) {
1864
+				} catch (PDOException $e) {
1865 1865
 					return "error (add column status_id in marine_live) : ".$e->getMessage()."\n";
1866 1866
 				}
1867 1867
 			}
1868
-			if (!$Connection->checkColumnName('marine_archive','status_id')) {
1868
+			if (!$Connection->checkColumnName('marine_archive', 'status_id')) {
1869 1869
 				$query = "ALTER TABLE marine_archive ADD COLUMN status_id integer DEFAULT NULL";
1870 1870
 				try {
1871 1871
 					$sth = $Connection->db->prepare($query);
1872 1872
 					$sth->execute();
1873
-				} catch(PDOException $e) {
1873
+				} catch (PDOException $e) {
1874 1874
 					return "error (add column status_id in marine_archive) : ".$e->getMessage()."\n";
1875 1875
 				}
1876 1876
 			}
1877
-			if (!$Connection->checkColumnName('marine_archive_output','status_id')) {
1877
+			if (!$Connection->checkColumnName('marine_archive_output', 'status_id')) {
1878 1878
 				$query = "ALTER TABLE marine_archive_output ADD COLUMN status_id integer DEFAULT NULL";
1879 1879
 				try {
1880 1880
 					$sth = $Connection->db->prepare($query);
1881 1881
 					$sth->execute();
1882
-				} catch(PDOException $e) {
1882
+				} catch (PDOException $e) {
1883 1883
 					return "error (add column status_id in marine_archive_output) : ".$e->getMessage()."\n";
1884 1884
 				}
1885 1885
 			}
@@ -1888,7 +1888,7 @@  discard block
 block discarded – undo
1888 1888
 		try {
1889 1889
 			$sth = $Connection->db->prepare($query);
1890 1890
 			$sth->execute();
1891
-		} catch(PDOException $e) {
1891
+		} catch (PDOException $e) {
1892 1892
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1893 1893
 		}
1894 1894
 		return $error;
@@ -1903,14 +1903,14 @@  discard block
 block discarded – undo
1903 1903
 			try {
1904 1904
 				$sth = $Connection->db->prepare($query);
1905 1905
 				$sth->execute();
1906
-			} catch(PDOException $e) {
1906
+			} catch (PDOException $e) {
1907 1907
 				return "error (change pilot_id type to varchar in stats_pilot) : ".$e->getMessage()."\n";
1908 1908
 			}
1909 1909
 			$query = "ALTER TABLE marine_identity MODIFY COLUMN mmsi varchar(255) DEFAULT NULL";
1910 1910
 			try {
1911 1911
 				$sth = $Connection->db->prepare($query);
1912 1912
 				$sth->execute();
1913
-			} catch(PDOException $e) {
1913
+			} catch (PDOException $e) {
1914 1914
 				return "error (change mmsi type to varchar in marine_identity) : ".$e->getMessage()."\n";
1915 1915
 			}
1916 1916
 		} else {
@@ -1918,14 +1918,14 @@  discard block
 block discarded – undo
1918 1918
 			try {
1919 1919
 				$sth = $Connection->db->prepare($query);
1920 1920
 				$sth->execute();
1921
-			} catch(PDOException $e) {
1921
+			} catch (PDOException $e) {
1922 1922
 				return "error (change pilot_id type to varchar in stats_pilot) : ".$e->getMessage()."\n";
1923 1923
 			}
1924 1924
 			$query = "alter table marine_identity alter column mmsi type varchar(255)";
1925 1925
 			try {
1926 1926
 				$sth = $Connection->db->prepare($query);
1927 1927
 				$sth->execute();
1928
-			} catch(PDOException $e) {
1928
+			} catch (PDOException $e) {
1929 1929
 				return "error (change mmsi type to varchar in marine_identity) : ".$e->getMessage()."\n";
1930 1930
 			}
1931 1931
 		}
@@ -1933,7 +1933,7 @@  discard block
 block discarded – undo
1933 1933
 		try {
1934 1934
 			$sth = $Connection->db->prepare($query);
1935 1935
 			$sth->execute();
1936
-		} catch(PDOException $e) {
1936
+		} catch (PDOException $e) {
1937 1937
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1938 1938
 		}
1939 1939
 		return $error;
@@ -1943,32 +1943,32 @@  discard block
 block discarded – undo
1943 1943
 		global $globalDBdriver;
1944 1944
 		$Connection = new Connection();
1945 1945
 		$error = '';
1946
-		if (!$Connection->checkColumnName('source_location','last_seen')) {
1946
+		if (!$Connection->checkColumnName('source_location', 'last_seen')) {
1947 1947
 			$query = "ALTER TABLE source_location ADD COLUMN last_seen timestamp NULL DEFAULT NULL";
1948 1948
 			try {
1949 1949
 				$sth = $Connection->db->prepare($query);
1950 1950
 				$sth->execute();
1951
-			} catch(PDOException $e) {
1951
+			} catch (PDOException $e) {
1952 1952
 				return "error (add column last_seen in source_location) : ".$e->getMessage()."\n";
1953 1953
 			}
1954 1954
 		}
1955 1955
 		if ($globalDBdriver == 'mysql') {
1956
-			if (!$Connection->checkColumnName('source_location','location_id')) {
1956
+			if (!$Connection->checkColumnName('source_location', 'location_id')) {
1957 1957
 				$query = "ALTER TABLE source_location ADD COLUMN location_id int(11) DEFAULT NULL";
1958 1958
 				try {
1959 1959
 					$sth = $Connection->db->prepare($query);
1960 1960
 					$sth->execute();
1961
-				} catch(PDOException $e) {
1961
+				} catch (PDOException $e) {
1962 1962
 					return "error (add column location_id in source_location) : ".$e->getMessage()."\n";
1963 1963
 				}
1964 1964
 			}
1965 1965
 		} else {
1966
-			if (!$Connection->checkColumnName('source_location','location_id')) {
1966
+			if (!$Connection->checkColumnName('source_location', 'location_id')) {
1967 1967
 				$query = "ALTER TABLE source_location ADD COLUMN location_id integer DEFAULT NULL";
1968 1968
 				try {
1969 1969
 					$sth = $Connection->db->prepare($query);
1970 1970
 					$sth->execute();
1971
-				} catch(PDOException $e) {
1971
+				} catch (PDOException $e) {
1972 1972
 					return "error (add column location_id in source_location) : ".$e->getMessage()."\n";
1973 1973
 				}
1974 1974
 			}
@@ -1977,7 +1977,7 @@  discard block
 block discarded – undo
1977 1977
 		try {
1978 1978
 			$sth = $Connection->db->prepare($query);
1979 1979
 			$sth->execute();
1980
-		} catch(PDOException $e) {
1980
+		} catch (PDOException $e) {
1981 1981
 			return "error (update schema_version) : ".$e->getMessage()."\n";
1982 1982
 		}
1983 1983
 		return $error;
@@ -1987,12 +1987,12 @@  discard block
 block discarded – undo
1987 1987
 		global $globalDBdriver;
1988 1988
 		$Connection = new Connection();
1989 1989
 		$error = '';
1990
-		if (!$Connection->checkColumnName('source_location','description')) {
1990
+		if (!$Connection->checkColumnName('source_location', 'description')) {
1991 1991
 			$query = "ALTER TABLE source_location ADD COLUMN description text DEFAULT NULL";
1992 1992
 			try {
1993 1993
 				$sth = $Connection->db->prepare($query);
1994 1994
 				$sth->execute();
1995
-			} catch(PDOException $e) {
1995
+			} catch (PDOException $e) {
1996 1996
 				return "error (add column description in source_location) : ".$e->getMessage()."\n";
1997 1997
 			}
1998 1998
 		}
@@ -2000,7 +2000,7 @@  discard block
 block discarded – undo
2000 2000
 		try {
2001 2001
 			$sth = $Connection->db->prepare($query);
2002 2002
 			$sth->execute();
2003
-		} catch(PDOException $e) {
2003
+		} catch (PDOException $e) {
2004 2004
 			return "error (update schema_version) : ".$e->getMessage()."\n";
2005 2005
 		}
2006 2006
 		return $error;
@@ -2010,39 +2010,39 @@  discard block
 block discarded – undo
2010 2010
 		global $globalDBdriver;
2011 2011
 		$Connection = new Connection();
2012 2012
 		$error = '';
2013
-		if (!$Connection->checkColumnName('spotter_live','real_altitude')) {
2013
+		if (!$Connection->checkColumnName('spotter_live', 'real_altitude')) {
2014 2014
 			$query = "ALTER TABLE spotter_live ADD COLUMN real_altitude float DEFAULT NULL";
2015 2015
 			try {
2016 2016
 				$sth = $Connection->db->prepare($query);
2017 2017
 				$sth->execute();
2018
-			} catch(PDOException $e) {
2018
+			} catch (PDOException $e) {
2019 2019
 				return "error (add column real_altitude in spotter_live) : ".$e->getMessage()."\n";
2020 2020
 			}
2021 2021
 		}
2022
-		if (!$Connection->checkColumnName('spotter_output','real_altitude')) {
2022
+		if (!$Connection->checkColumnName('spotter_output', 'real_altitude')) {
2023 2023
 			$query = "ALTER TABLE spotter_output ADD COLUMN real_altitude float DEFAULT NULL";
2024 2024
 			try {
2025 2025
 				$sth = $Connection->db->prepare($query);
2026 2026
 				$sth->execute();
2027
-			} catch(PDOException $e) {
2027
+			} catch (PDOException $e) {
2028 2028
 				return "error (add column real_altitude in spotter_output) : ".$e->getMessage()."\n";
2029 2029
 			}
2030 2030
 		}
2031
-		if (!$Connection->checkColumnName('spotter_archive_output','real_altitude')) {
2031
+		if (!$Connection->checkColumnName('spotter_archive_output', 'real_altitude')) {
2032 2032
 			$query = "ALTER TABLE spotter_archive_output ADD COLUMN real_altitude float DEFAULT NULL";
2033 2033
 			try {
2034 2034
 				$sth = $Connection->db->prepare($query);
2035 2035
 				$sth->execute();
2036
-			} catch(PDOException $e) {
2036
+			} catch (PDOException $e) {
2037 2037
 				return "error (add column real_altitude in spotter_archive_output) : ".$e->getMessage()."\n";
2038 2038
 			}
2039 2039
 		}
2040
-		if (!$Connection->checkColumnName('spotter_archive','real_altitude')) {
2040
+		if (!$Connection->checkColumnName('spotter_archive', 'real_altitude')) {
2041 2041
 			$query = "ALTER TABLE spotter_archive ADD COLUMN real_altitude float DEFAULT NULL";
2042 2042
 			try {
2043 2043
 				$sth = $Connection->db->prepare($query);
2044 2044
 				$sth->execute();
2045
-			} catch(PDOException $e) {
2045
+			} catch (PDOException $e) {
2046 2046
 				return "error (add column real_altitude in spotter_archive) : ".$e->getMessage()."\n";
2047 2047
 			}
2048 2048
 		}
@@ -2050,7 +2050,7 @@  discard block
 block discarded – undo
2050 2050
 		try {
2051 2051
 			$sth = $Connection->db->prepare($query);
2052 2052
 			$sth->execute();
2053
-		} catch(PDOException $e) {
2053
+		} catch (PDOException $e) {
2054 2054
 			return "error (update schema_version) : ".$e->getMessage()."\n";
2055 2055
 		}
2056 2056
 		return $error;
@@ -2072,14 +2072,14 @@  discard block
 block discarded – undo
2072 2072
 		try {
2073 2073
 			$sth = $Connection->db->prepare($query);
2074 2074
 			$sth->execute();
2075
-		} catch(PDOException $e) {
2075
+		} catch (PDOException $e) {
2076 2076
 			return "error (modify column altitude in tracker_*) : ".$e->getMessage()."\n";
2077 2077
 		}
2078 2078
 		$query = "UPDATE config SET value = '44' WHERE name = 'schema_version'";
2079 2079
 		try {
2080 2080
 			$sth = $Connection->db->prepare($query);
2081 2081
 			$sth->execute();
2082
-		} catch(PDOException $e) {
2082
+		} catch (PDOException $e) {
2083 2083
 			return "error (update schema_version) : ".$e->getMessage()."\n";
2084 2084
 		}
2085 2085
 		return $error;
@@ -2120,7 +2120,7 @@  discard block
 block discarded – undo
2120 2120
 		try {
2121 2121
 			$sth = $Connection->db->prepare($query);
2122 2122
 			$sth->execute();
2123
-		} catch(PDOException $e) {
2123
+		} catch (PDOException $e) {
2124 2124
 			return "error (update schema_version) : ".$e->getMessage()."\n";
2125 2125
 		}
2126 2126
 		return $error;
@@ -2143,7 +2143,7 @@  discard block
 block discarded – undo
2143 2143
 		try {
2144 2144
 			$sth = $Connection->db->prepare($query);
2145 2145
 			$sth->execute();
2146
-		} catch(PDOException $e) {
2146
+		} catch (PDOException $e) {
2147 2147
 			return "error (update schema_version) : ".$e->getMessage()."\n";
2148 2148
 		}
2149 2149
 		return $error;
@@ -2193,7 +2193,7 @@  discard block
 block discarded – undo
2193 2193
 		try {
2194 2194
 			$sth = $Connection->db->prepare($query);
2195 2195
 			$sth->execute();
2196
-		} catch(PDOException $e) {
2196
+		} catch (PDOException $e) {
2197 2197
 			return "error (update schema_version) : ".$e->getMessage()."\n";
2198 2198
 		}
2199 2199
 		return $error;
@@ -2216,7 +2216,7 @@  discard block
 block discarded – undo
2216 2216
 		try {
2217 2217
 			$sth = $Connection->db->prepare($query);
2218 2218
 			$sth->execute();
2219
-		} catch(PDOException $e) {
2219
+		} catch (PDOException $e) {
2220 2220
 			return "error (update schema_version) : ".$e->getMessage()."\n";
2221 2221
 		}
2222 2222
 		return $error;
@@ -2239,7 +2239,7 @@  discard block
 block discarded – undo
2239 2239
 		try {
2240 2240
 			$sth = $Connection->db->prepare($query);
2241 2241
 			$sth->execute();
2242
-		} catch(PDOException $e) {
2242
+		} catch (PDOException $e) {
2243 2243
 			return "error (update schema_version) : ".$e->getMessage()."\n";
2244 2244
 		}
2245 2245
 		return $error;
@@ -2260,7 +2260,7 @@  discard block
 block discarded – undo
2260 2260
 		try {
2261 2261
 			$sth = $Connection->db->prepare($query);
2262 2262
 			$sth->execute();
2263
-		} catch(PDOException $e) {
2263
+		} catch (PDOException $e) {
2264 2264
 			return "error (update schema_version) : ".$e->getMessage()."\n";
2265 2265
 		}
2266 2266
 		return $error;
@@ -2285,7 +2285,7 @@  discard block
 block discarded – undo
2285 2285
 		try {
2286 2286
 			$sth = $Connection->db->prepare($query);
2287 2287
 			$sth->execute();
2288
-		} catch(PDOException $e) {
2288
+		} catch (PDOException $e) {
2289 2289
 			return "error (update schema_version) : ".$e->getMessage()."\n";
2290 2290
 		}
2291 2291
 		return $error;
@@ -2295,39 +2295,39 @@  discard block
 block discarded – undo
2295 2295
 		global $globalDBdriver;
2296 2296
 		$Connection = new Connection();
2297 2297
 		$error = '';
2298
-		if (!$Connection->checkColumnName('marine_live','captain_name')) {
2298
+		if (!$Connection->checkColumnName('marine_live', 'captain_name')) {
2299 2299
 			$query = "ALTER TABLE marine_live ADD COLUMN captain_name varchar(255) DEFAULT NULL,ADD COLUMN captain_id varchar(255) DEFAULT NULL,ADD COLUMN race_name varchar(255) DEFAULT NULL,ADD COLUMN race_id varchar(255) DEFAULT NULL";
2300 2300
 			try {
2301 2301
 				$sth = $Connection->db->prepare($query);
2302 2302
 				$sth->execute();
2303
-			} catch(PDOException $e) {
2303
+			} catch (PDOException $e) {
2304 2304
 				return "error (add columns captain and race in marine_live) : ".$e->getMessage()."\n";
2305 2305
 			}
2306 2306
 		}
2307
-		if (!$Connection->checkColumnName('marine_output','captain_name')) {
2307
+		if (!$Connection->checkColumnName('marine_output', 'captain_name')) {
2308 2308
 			$query = "ALTER TABLE marine_output ADD COLUMN captain_name varchar(255) DEFAULT NULL,ADD COLUMN captain_id varchar(255) DEFAULT NULL,ADD COLUMN race_name varchar(255) DEFAULT NULL,ADD COLUMN race_id varchar(255) DEFAULT NULL";
2309 2309
 			try {
2310 2310
 				$sth = $Connection->db->prepare($query);
2311 2311
 				$sth->execute();
2312
-			} catch(PDOException $e) {
2312
+			} catch (PDOException $e) {
2313 2313
 				return "error (add columns captain and race in marine_output) : ".$e->getMessage()."\n";
2314 2314
 			}
2315 2315
 		}
2316
-		if (!$Connection->checkColumnName('marine_archive','captain_name')) {
2316
+		if (!$Connection->checkColumnName('marine_archive', 'captain_name')) {
2317 2317
 			$query = "ALTER TABLE marine_archive ADD COLUMN captain_name varchar(255) DEFAULT NULL,ADD COLUMN captain_id varchar(255) DEFAULT NULL,ADD COLUMN race_name varchar(255) DEFAULT NULL,ADD COLUMN race_id varchar(255) DEFAULT NULL";
2318 2318
 			try {
2319 2319
 				$sth = $Connection->db->prepare($query);
2320 2320
 				$sth->execute();
2321
-			} catch(PDOException $e) {
2321
+			} catch (PDOException $e) {
2322 2322
 				return "error (add columns captain and race in marine_archive) : ".$e->getMessage()."\n";
2323 2323
 			}
2324 2324
 		}
2325
-		if (!$Connection->checkColumnName('marine_archive_output','captain_name')) {
2325
+		if (!$Connection->checkColumnName('marine_archive_output', 'captain_name')) {
2326 2326
 			$query = "ALTER TABLE marine_archive_output ADD COLUMN captain_name varchar(255) DEFAULT NULL,ADD COLUMN captain_id varchar(255) DEFAULT NULL,ADD COLUMN race_name varchar(255) DEFAULT NULL,ADD COLUMN race_id varchar(255) DEFAULT NULL";
2327 2327
 			try {
2328 2328
 				$sth = $Connection->db->prepare($query);
2329 2329
 				$sth->execute();
2330
-			} catch(PDOException $e) {
2330
+			} catch (PDOException $e) {
2331 2331
 				return "error (add columns captain and race in marine_archive_output) : ".$e->getMessage()."\n";
2332 2332
 			}
2333 2333
 		}
@@ -2335,7 +2335,7 @@  discard block
 block discarded – undo
2335 2335
 		try {
2336 2336
 			$sth = $Connection->db->prepare($query);
2337 2337
 			$sth->execute();
2338
-		} catch(PDOException $e) {
2338
+		} catch (PDOException $e) {
2339 2339
 			return "error (update schema_version) : ".$e->getMessage()."\n";
2340 2340
 		}
2341 2341
 		return $error;
@@ -2360,7 +2360,7 @@  discard block
 block discarded – undo
2360 2360
 					try {
2361 2361
 						$sth = $Connection->db->prepare($query);
2362 2362
 						$sth->execute();
2363
-					} catch(PDOException $e) {
2363
+					} catch (PDOException $e) {
2364 2364
 						return "error (check_version): ".$e->getMessage()."\n";
2365 2365
 					}
2366 2366
 					$result = $sth->fetch(PDO::FETCH_ASSOC);
Please login to merge, or discard this patch.
Braces   +512 added lines, -188 removed lines patch added patch discarded remove patch
@@ -258,7 +258,9 @@  discard block
 block discarded – undo
258 258
     		// Update table countries
259 259
     		if ($Connection->tableExists('airspace')) {
260 260
     		    $error .= update_db::update_countries();
261
-		    if ($error != '') return $error;
261
+		    if ($error != '') {
262
+		    	return $error;
263
+		    }
262 264
 		}
263 265
 		// Update schema_version to 7
264 266
 		$query = "UPDATE `config` SET `value` = '7' WHERE `name` = 'schema_version'";
@@ -314,7 +316,9 @@  discard block
 block discarded – undo
314 316
     		$error = '';
315 317
     		// Update table aircraft
316 318
 		$error .= create_db::import_file('../db/source_location.sql');
317
-		if ($error != '') return $error;
319
+		if ($error != '') {
320
+			return $error;
321
+		}
318 322
 		// Update schema_version to 6
319 323
 		$query = "UPDATE `config` SET `value` = '8' WHERE `name` = 'schema_version'";
320 324
         	try {
@@ -331,7 +335,9 @@  discard block
 block discarded – undo
331 335
     		$error = '';
332 336
     		// Update table aircraft
333 337
 		$error .= create_db::import_file('../db/notam.sql');
334
-		if ($error != '') return $error;
338
+		if ($error != '') {
339
+			return $error;
340
+		}
335 341
 		$query = "DELETE FROM config WHERE name = 'last_update_db';
336 342
                         INSERT INTO config (name,value) VALUES ('last_update_db',NOW());
337 343
                         DELETE FROM config WHERE name = 'last_update_notam_db';
@@ -365,7 +371,9 @@  discard block
 block discarded – undo
365 371
 		$error = '';
366 372
     		// Update table atc
367 373
 		$error .= create_db::import_file('../db/atc.sql');
368
-		if ($error != '') return $error;
374
+		if ($error != '') {
375
+			return $error;
376
+		}
369 377
 		
370 378
 		$query = "UPDATE `config` SET `value` = '10' WHERE `name` = 'schema_version'";
371 379
         	try {
@@ -389,13 +397,21 @@  discard block
 block discarded – undo
389 397
 		$error = '';
390 398
     		// Add tables
391 399
 		$error .= create_db::import_file('../db/aircraft_owner.sql');
392
-		if ($error != '') return $error;
400
+		if ($error != '') {
401
+			return $error;
402
+		}
393 403
 		$error .= create_db::import_file('../db/metar.sql');
394
-		if ($error != '') return $error;
404
+		if ($error != '') {
405
+			return $error;
406
+		}
395 407
 		$error .= create_db::import_file('../db/taf.sql');
396
-		if ($error != '') return $error;
408
+		if ($error != '') {
409
+			return $error;
410
+		}
397 411
 		$error .= create_db::import_file('../db/airport.sql');
398
-		if ($error != '') return $error;
412
+		if ($error != '') {
413
+			return $error;
414
+		}
399 415
 		
400 416
 		$query = "UPDATE `config` SET `value` = '11' WHERE `name` = 'schema_version'";
401 417
         	try {
@@ -469,19 +485,33 @@  discard block
 block discarded – undo
469 485
 		$error = '';
470 486
     		// Add tables
471 487
 		$error .= create_db::import_file('../db/stats.sql');
472
-		if ($error != '') return $error;
488
+		if ($error != '') {
489
+			return $error;
490
+		}
473 491
 		$error .= create_db::import_file('../db/stats_aircraft.sql');
474
-		if ($error != '') return $error;
492
+		if ($error != '') {
493
+			return $error;
494
+		}
475 495
 		$error .= create_db::import_file('../db/stats_airline.sql');
476
-		if ($error != '') return $error;
496
+		if ($error != '') {
497
+			return $error;
498
+		}
477 499
 		$error .= create_db::import_file('../db/stats_airport.sql');
478
-		if ($error != '') return $error;
500
+		if ($error != '') {
501
+			return $error;
502
+		}
479 503
 		$error .= create_db::import_file('../db/stats_owner.sql');
480
-		if ($error != '') return $error;
504
+		if ($error != '') {
505
+			return $error;
506
+		}
481 507
 		$error .= create_db::import_file('../db/stats_pilot.sql');
482
-		if ($error != '') return $error;
508
+		if ($error != '') {
509
+			return $error;
510
+		}
483 511
 		$error .= create_db::import_file('../db/spotter_archive_output.sql');
484
-		if ($error != '') return $error;
512
+		if ($error != '') {
513
+			return $error;
514
+		}
485 515
 		
486 516
 		$query = "UPDATE `config` SET `value` = '13' WHERE `name` = 'schema_version'";
487 517
         	try {
@@ -521,7 +551,9 @@  discard block
 block discarded – undo
521 551
     		// Add tables
522 552
     		if (!$Connection->tableExists('stats_flight')) {
523 553
 			$error .= create_db::import_file('../db/stats_flight.sql');
524
-			if ($error != '') return $error;
554
+			if ($error != '') {
555
+				return $error;
556
+			}
525 557
 		}
526 558
 		$query = "UPDATE `config` SET `value` = '15' WHERE `name` = 'schema_version'";
527 559
         	try {
@@ -545,7 +577,9 @@  discard block
 block discarded – undo
545 577
     		} catch(PDOException $e) {
546 578
 		    return "error (update stats) : ".$e->getMessage()."\n";
547 579
     		}
548
-		if ($error != '') return $error;
580
+		if ($error != '') {
581
+			return $error;
582
+		}
549 583
 		$query = "UPDATE `config` SET `value` = '16' WHERE `name` = 'schema_version'";
550 584
         	try {
551 585
             	    $sth = $Connection->db->prepare($query);
@@ -566,7 +600,9 @@  discard block
 block discarded – undo
566 600
     		if (!$Connection->tableExists('stats_callsign')) {
567 601
 			$error .= create_db::import_file('../db/stats_callsign.sql');
568 602
 		}
569
-		if ($error != '') return $error;
603
+		if ($error != '') {
604
+			return $error;
605
+		}
570 606
 		$query = "UPDATE `config` SET `value` = '17' WHERE `name` = 'schema_version'";
571 607
         	try {
572 608
             	    $sth = $Connection->db->prepare($query);
@@ -584,7 +620,9 @@  discard block
 block discarded – undo
584 620
     		if (!$Connection->tableExists('stats_country')) {
585 621
 			$error .= create_db::import_file('../db/stats_country.sql');
586 622
 		}
587
-		if ($error != '') return $error;
623
+		if ($error != '') {
624
+			return $error;
625
+		}
588 626
 		$query = "UPDATE `config` SET `value` = '18' WHERE `name` = 'schema_version'";
589 627
         	try {
590 628
             	    $sth = $Connection->db->prepare($query);
@@ -607,7 +645,9 @@  discard block
 block discarded – undo
607 645
 			    return "error (update stats) : ".$e->getMessage()."\n";
608 646
     			}
609 647
     		}
610
-		if ($error != '') return $error;
648
+		if ($error != '') {
649
+			return $error;
650
+		}
611 651
 		$query = "UPDATE `config` SET `value` = '19' WHERE `name` = 'schema_version'";
612 652
         	try {
613 653
             	    $sth = $Connection->db->prepare($query);
@@ -623,7 +663,9 @@  discard block
 block discarded – undo
623 663
 		$error = '';
624 664
     		// Update airport table
625 665
 		$error .= create_db::import_file('../db/airport.sql');
626
-		if ($error != '') return 'Import airport.sql : '.$error;
666
+		if ($error != '') {
667
+			return 'Import airport.sql : '.$error;
668
+		}
627 669
 		// Remove primary key on Spotter_Archive
628 670
 		$query = "alter table spotter_archive drop spotter_archive_id";
629 671
         	try {
@@ -699,7 +741,9 @@  discard block
 block discarded – undo
699 741
 				return "error (add source_name column) : ".$e->getMessage()."\n";
700 742
     			}
701 743
     		}
702
-		if ($error != '') return $error;
744
+		if ($error != '') {
745
+			return $error;
746
+		}
703 747
 		$query = "UPDATE `config` SET `value` = '20' WHERE `name` = 'schema_version'";
704 748
         	try {
705 749
             	    $sth = $Connection->db->prepare($query);
@@ -717,7 +761,9 @@  discard block
 block discarded – undo
717 761
     		// Update airline table
718 762
     		if (!$globalIVAO && !$globalVATSIM && !$globalphpVMS) {
719 763
 			$error .= create_db::import_file('../db/airlines.sql');
720
-			if ($error != '') return 'Import airlines.sql : '.$error;
764
+			if ($error != '') {
765
+				return 'Import airlines.sql : '.$error;
766
+			}
721 767
 		}
722 768
 		if (!$Connection->checkColumnName('aircraft_modes','type_flight')) {
723 769
 			// Add column over_country
@@ -729,7 +775,9 @@  discard block
 block discarded – undo
729 775
 				return "error (add over_country) : ".$e->getMessage()."\n";
730 776
     			}
731 777
     		}
732
-		if ($error != '') return $error;
778
+		if ($error != '') {
779
+			return $error;
780
+		}
733 781
 		/*
734 782
     		if (!$globalIVAO && !$globalVATSIM && !$globalphpVMS) {
735 783
 			// Force update ModeS (this will put type_flight data
@@ -759,7 +807,9 @@  discard block
 block discarded – undo
759 807
 			} catch(PDOException $e) {
760 808
 				return "error (rename type to stats_type on stats*) : ".$e->getMessage()."\n";
761 809
 			}
762
-			if ($error != '') return $error;
810
+			if ($error != '') {
811
+				return $error;
812
+			}
763 813
 		}
764 814
 		$query = "UPDATE `config` SET `value` = '22' WHERE `name` = 'schema_version'";
765 815
         	try {
@@ -782,7 +832,9 @@  discard block
 block discarded – undo
782 832
 			} else {
783 833
 				$error .= create_db::import_file('../db/pgsql/stats_source.sql');
784 834
 			}
785
-			if ($error != '') return $error;
835
+			if ($error != '') {
836
+				return $error;
837
+			}
786 838
 		}
787 839
 		$query = "UPDATE config SET value = '23' WHERE name = 'schema_version'";
788 840
         	try {
@@ -803,12 +855,16 @@  discard block
 block discarded – undo
803 855
 		if ($globalDBdriver == 'mysql') {
804 856
 			if (!$Connection->tableExists('tle')) {
805 857
 				$error .= create_db::import_file('../db/tle.sql');
806
-				if ($error != '') return $error;
858
+				if ($error != '') {
859
+					return $error;
860
+				}
807 861
 			}
808 862
 		} else {
809 863
 			if (!$Connection->tableExists('tle')) {
810 864
 				$error .= create_db::import_file('../db/pgsql/tle.sql');
811
-				if ($error != '') return $error;
865
+				if ($error != '') {
866
+					return $error;
867
+				}
812 868
 			}
813 869
 			$query = "create index flightaware_id_idx ON spotter_archive USING btree(flightaware_id)";
814 870
 			try {
@@ -848,7 +904,9 @@  discard block
 block discarded – undo
848 904
 		} else {
849 905
 			$error .= create_db::import_file('../db/pgsql/airlines.sql');
850 906
 		}
851
-		if ($error != '') return 'Import airlines.sql : '.$error;
907
+		if ($error != '') {
908
+			return 'Import airlines.sql : '.$error;
909
+		}
852 910
 		if (!$Connection->checkColumnName('airlines','forsource')) {
853 911
 			// Add forsource to airlines
854 912
 			$query = "ALTER TABLE airlines ADD forsource VARCHAR(255) NULL DEFAULT NULL";
@@ -1331,20 +1389,28 @@  discard block
 block discarded – undo
1331 1389
 		}
1332 1390
 		if ($globalDBdriver == 'mysql') {
1333 1391
 			$error .= create_db::import_file('../db/airlines.sql');
1334
-			if ($error != '') return $error;
1392
+			if ($error != '') {
1393
+				return $error;
1394
+			}
1335 1395
 		} else {
1336 1396
 			$error .= create_db::import_file('../db/pgsql/airlines.sql');
1337
-			if ($error != '') return $error;
1397
+			if ($error != '') {
1398
+				return $error;
1399
+			}
1338 1400
 		}
1339 1401
 		if ((isset($globalVATSIM) && $globalVATSIM) || (isset($globalIVAO) && $globalIVAO)) {
1340 1402
 			include_once(dirname(__FILE__).'/class.update_db.php');
1341 1403
 			if (isset($globalVATSIM) && $globalVATSIM) {
1342 1404
 				$error .= update_db::update_vatsim();
1343
-				if ($error != '') return $error;
1405
+				if ($error != '') {
1406
+					return $error;
1407
+				}
1344 1408
 			}
1345 1409
 			if (isset($globalIVAO) && $globalIVAO && file_exists('tmp/ivae_feb2013.zip')) {
1346 1410
 				$error .= update_db::update_IVAO();
1347
-				if ($error != '') return $error;
1411
+				if ($error != '') {
1412
+					return $error;
1413
+				}
1348 1414
 			}
1349 1415
 		}
1350 1416
 
@@ -1607,41 +1673,65 @@  discard block
 block discarded – undo
1607 1673
 		if ($globalDBdriver == 'mysql') {
1608 1674
 			if (!$Connection->tableExists('tracker_output')) {
1609 1675
 				$error .= create_db::import_file('../db/tracker_output.sql');
1610
-				if ($error != '') return $error;
1676
+				if ($error != '') {
1677
+					return $error;
1678
+				}
1611 1679
 			}
1612 1680
 			if (!$Connection->tableExists('tracker_live')) {
1613 1681
 				$error .= create_db::import_file('../db/tracker_live.sql');
1614
-				if ($error != '') return $error;
1682
+				if ($error != '') {
1683
+					return $error;
1684
+				}
1615 1685
 			}
1616 1686
 			if (!$Connection->tableExists('marine_output')) {
1617 1687
 				$error .= create_db::import_file('../db/marine_output.sql');
1618
-				if ($error != '') return $error;
1688
+				if ($error != '') {
1689
+					return $error;
1690
+				}
1619 1691
 			}
1620 1692
 			if (!$Connection->tableExists('marine_live')) {
1621 1693
 				$error .= create_db::import_file('../db/marine_live.sql');
1622
-				if ($error != '') return $error;
1694
+				if ($error != '') {
1695
+					return $error;
1696
+				}
1623 1697
 			}
1624 1698
 			if (!$Connection->tableExists('marine_identity')) {
1625 1699
 				$error .= create_db::import_file('../db/marine_identity.sql');
1626
-				if ($error != '') return $error;
1700
+				if ($error != '') {
1701
+					return $error;
1702
+				}
1627 1703
 			}
1628 1704
 			if (!$Connection->tableExists('marine_mid')) {
1629 1705
 				$error .= create_db::import_file('../db/marine_mid.sql');
1630
-				if ($error != '') return $error;
1706
+				if ($error != '') {
1707
+					return $error;
1708
+				}
1631 1709
 			}
1632 1710
 		} else {
1633 1711
 			$error .= create_db::import_file('../db/pgsql/tracker_output.sql');
1634
-			if ($error != '') return $error;
1712
+			if ($error != '') {
1713
+				return $error;
1714
+			}
1635 1715
 			$error .= create_db::import_file('../db/pgsql/tracker_live.sql');
1636
-			if ($error != '') return $error;
1716
+			if ($error != '') {
1717
+				return $error;
1718
+			}
1637 1719
 			$error .= create_db::import_file('../db/pgsql/marine_output.sql');
1638
-			if ($error != '') return $error;
1720
+			if ($error != '') {
1721
+				return $error;
1722
+			}
1639 1723
 			$error .= create_db::import_file('../db/pgsql/marine_live.sql');
1640
-			if ($error != '') return $error;
1724
+			if ($error != '') {
1725
+				return $error;
1726
+			}
1641 1727
 			$error .= create_db::import_file('../db/pgsql/marine_identity.sql');
1642
-			if ($error != '') return $error;
1728
+			if ($error != '') {
1729
+				return $error;
1730
+			}
1643 1731
 			$error .= create_db::import_file('../db/pgsql/marine_mid.sql');
1644
-			if ($error != '') return $error;
1732
+			if ($error != '') {
1733
+				return $error;
1734
+			}
1645 1735
 		}
1646 1736
 		$query = "UPDATE config SET value = '37' WHERE name = 'schema_version'";
1647 1737
 		try {
@@ -1660,39 +1750,61 @@  discard block
 block discarded – undo
1660 1750
 		if ($globalDBdriver == 'mysql') {
1661 1751
 			if (!$Connection->tableExists('marine_image')) {
1662 1752
 				$error .= create_db::import_file('../db/marine_image.sql');
1663
-				if ($error != '') return $error;
1753
+				if ($error != '') {
1754
+					return $error;
1755
+				}
1664 1756
 			}
1665 1757
 			if (!$Connection->tableExists('marine_archive')) {
1666 1758
 				$error .= create_db::import_file('../db/marine_archive.sql');
1667
-				if ($error != '') return $error;
1759
+				if ($error != '') {
1760
+					return $error;
1761
+				}
1668 1762
 			}
1669 1763
 			if (!$Connection->tableExists('marine_archive_output')) {
1670 1764
 				$error .= create_db::import_file('../db/marine_archive_output.sql');
1671
-				if ($error != '') return $error;
1765
+				if ($error != '') {
1766
+					return $error;
1767
+				}
1672 1768
 			}
1673 1769
 			if (!$Connection->tableExists('tracker_archive')) {
1674 1770
 				$error .= create_db::import_file('../db/tracker_archive.sql');
1675
-				if ($error != '') return $error;
1771
+				if ($error != '') {
1772
+					return $error;
1773
+				}
1676 1774
 			}
1677 1775
 			if (!$Connection->tableExists('tracker_archive_output')) {
1678 1776
 				$error .= create_db::import_file('../db/tracker_archive_output.sql');
1679
-				if ($error != '') return $error;
1777
+				if ($error != '') {
1778
+					return $error;
1779
+				}
1680 1780
 			}
1681 1781
 			if (!$Connection->tableExists('marine_archive_output')) {
1682 1782
 				$error .= create_db::import_file('../db/tracker_archive_output.sql');
1683
-				if ($error != '') return $error;
1783
+				if ($error != '') {
1784
+					return $error;
1785
+				}
1684 1786
 			}
1685 1787
 		} else {
1686 1788
 			$error .= create_db::import_file('../db/pgsql/marine_image.sql');
1687
-			if ($error != '') return $error;
1789
+			if ($error != '') {
1790
+				return $error;
1791
+			}
1688 1792
 			$error .= create_db::import_file('../db/pgsql/marine_archive.sql');
1689
-			if ($error != '') return $error;
1793
+			if ($error != '') {
1794
+				return $error;
1795
+			}
1690 1796
 			$error .= create_db::import_file('../db/pgsql/marine_archive_output.sql');
1691
-			if ($error != '') return $error;
1797
+			if ($error != '') {
1798
+				return $error;
1799
+			}
1692 1800
 			$error .= create_db::import_file('../db/pgsql/tracker_archive.sql');
1693
-			if ($error != '') return $error;
1801
+			if ($error != '') {
1802
+				return $error;
1803
+			}
1694 1804
 			$error .= create_db::import_file('../db/pgsql/tracker_archive_output.sql');
1695
-			if ($error != '') return $error;
1805
+			if ($error != '') {
1806
+				return $error;
1807
+			}
1696 1808
 		}
1697 1809
 		if ($globalDBdriver == 'mysql') {
1698 1810
 			$query = "SELECT ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = '".$globalDBname."' AND TABLE_NAME = 'spotter_archive'";
@@ -2063,7 +2175,9 @@  discard block
 block discarded – undo
2063 2175
 		if ($globalDBdriver == 'mysql') {
2064 2176
 			if (!$Connection->tableExists('tracker_archive_output')) {
2065 2177
 				$error .= create_db::import_file('../db/tracker_archive_output.sql');
2066
-				if ($error != '') return $error;
2178
+				if ($error != '') {
2179
+					return $error;
2180
+				}
2067 2181
 			}
2068 2182
 			$query = "ALTER TABLE tracker_live MODIFY COLUMN altitude float DEFAULT NULL;ALTER TABLE tracker_output MODIFY COLUMN last_altitude float DEFAULT NULL;ALTER TABLE tracker_output MODIFY COLUMN altitude float DEFAULT NULL;ALTER TABLE tracker_archive MODIFY COLUMN altitude float DEFAULT NULL;ALTER TABLE tracker_archive_output MODIFY COLUMN last_altitude float DEFAULT NULL;ALTER TABLE tracker_output MODIFY COLUMN altitude float DEFAULT NULL;";
2069 2183
 		} else {
@@ -2091,14 +2205,22 @@  discard block
 block discarded – undo
2091 2205
 		$error = '';
2092 2206
 		if ($globalDBdriver == 'mysql') {
2093 2207
 			$error .= create_db::import_file('../db/airport.sql');
2094
-			if ($error != '') return $error;
2208
+			if ($error != '') {
2209
+				return $error;
2210
+			}
2095 2211
 			$error .= create_db::import_file('../db/airlines.sql');
2096
-			if ($error != '') return $error;
2212
+			if ($error != '') {
2213
+				return $error;
2214
+			}
2097 2215
 		} else {
2098 2216
 			$error .= create_db::import_file('../db/pgsql/airport.sql');
2099
-			if ($error != '') return $error;
2217
+			if ($error != '') {
2218
+				return $error;
2219
+			}
2100 2220
 			$error .= create_db::import_file('../db/pgsql/airlines.sql');
2101
-			if ($error != '') return $error;
2221
+			if ($error != '') {
2222
+				return $error;
2223
+			}
2102 2224
 		}
2103 2225
 		if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) {
2104 2226
 			if (file_exists('tmp/ivae_feb2013.zip')) {
@@ -2115,7 +2237,9 @@  discard block
 block discarded – undo
2115 2237
 				$error .= update_db::update_vatsim();
2116 2238
 			}
2117 2239
 		}
2118
-		if ($error != '') return $error;
2240
+		if ($error != '') {
2241
+			return $error;
2242
+		}
2119 2243
 		$query = "UPDATE config SET value = '45' WHERE name = 'schema_version'";
2120 2244
 		try {
2121 2245
 			$sth = $Connection->db->prepare($query);
@@ -2133,10 +2257,14 @@  discard block
 block discarded – undo
2133 2257
 		if (!$Connection->tableExists('satellite')) {
2134 2258
 			if ($globalDBdriver == 'mysql') {
2135 2259
 				$error .= create_db::import_file('../db/satellite.sql');
2136
-				if ($error != '') return $error;
2260
+				if ($error != '') {
2261
+					return $error;
2262
+				}
2137 2263
 			} else {
2138 2264
 				$error .= create_db::import_file('../db/pgsql/satellite.sql');
2139
-				if ($error != '') return $error;
2265
+				if ($error != '') {
2266
+					return $error;
2267
+				}
2140 2268
 			}
2141 2269
 		}
2142 2270
 		$query = "UPDATE config SET value = '46' WHERE name = 'schema_version'";
@@ -2156,37 +2284,53 @@  discard block
 block discarded – undo
2156 2284
 		if (!$Connection->tableExists('stats_marine')) {
2157 2285
 			if ($globalDBdriver == 'mysql') {
2158 2286
 				$error .= create_db::import_file('../db/stats_marine.sql');
2159
-				if ($error != '') return $error;
2287
+				if ($error != '') {
2288
+					return $error;
2289
+				}
2160 2290
 			} else {
2161 2291
 				$error .= create_db::import_file('../db/pgsql/stats_marine.sql');
2162
-				if ($error != '') return $error;
2292
+				if ($error != '') {
2293
+					return $error;
2294
+				}
2163 2295
 			}
2164 2296
 		}
2165 2297
 		if (!$Connection->tableExists('stats_marine_country')) {
2166 2298
 			if ($globalDBdriver == 'mysql') {
2167 2299
 				$error .= create_db::import_file('../db/stats_marine_country.sql');
2168
-				if ($error != '') return $error;
2300
+				if ($error != '') {
2301
+					return $error;
2302
+				}
2169 2303
 			} else {
2170 2304
 				$error .= create_db::import_file('../db/pgsql/stats_marine_country.sql');
2171
-				if ($error != '') return $error;
2305
+				if ($error != '') {
2306
+					return $error;
2307
+				}
2172 2308
 			}
2173 2309
 		}
2174 2310
 		if (!$Connection->tableExists('stats_tracker')) {
2175 2311
 			if ($globalDBdriver == 'mysql') {
2176 2312
 				$error .= create_db::import_file('../db/stats_tracker.sql');
2177
-				if ($error != '') return $error;
2313
+				if ($error != '') {
2314
+					return $error;
2315
+				}
2178 2316
 			} else {
2179 2317
 				$error .= create_db::import_file('../db/pgsql/stats_tracker.sql');
2180
-				if ($error != '') return $error;
2318
+				if ($error != '') {
2319
+					return $error;
2320
+				}
2181 2321
 			}
2182 2322
 		}
2183 2323
 		if (!$Connection->tableExists('stats_tracker_country')) {
2184 2324
 			if ($globalDBdriver == 'mysql') {
2185 2325
 				$error .= create_db::import_file('../db/stats_tracker_country.sql');
2186
-				if ($error != '') return $error;
2326
+				if ($error != '') {
2327
+					return $error;
2328
+				}
2187 2329
 			} else {
2188 2330
 				$error .= create_db::import_file('../db/pgsql/stats_tracker_country.sql');
2189
-				if ($error != '') return $error;
2331
+				if ($error != '') {
2332
+					return $error;
2333
+				}
2190 2334
 			}
2191 2335
 		}
2192 2336
 		$query = "UPDATE config SET value = '47' WHERE name = 'schema_version'";
@@ -2206,10 +2350,14 @@  discard block
 block discarded – undo
2206 2350
 		if (!$Connection->tableExists('stats_marine_type')) {
2207 2351
 			if ($globalDBdriver == 'mysql') {
2208 2352
 				$error .= create_db::import_file('../db/stats_marine_type.sql');
2209
-				if ($error != '') return $error;
2353
+				if ($error != '') {
2354
+					return $error;
2355
+				}
2210 2356
 			} else {
2211 2357
 				$error .= create_db::import_file('../db/pgsql/stats_marine_type.sql');
2212
-				if ($error != '') return $error;
2358
+				if ($error != '') {
2359
+					return $error;
2360
+				}
2213 2361
 			}
2214 2362
 		}
2215 2363
 		$query = "UPDATE config SET value = '48' WHERE name = 'schema_version'";
@@ -2229,10 +2377,14 @@  discard block
 block discarded – undo
2229 2377
 		if (!$Connection->tableExists('stats_tracker_type')) {
2230 2378
 			if ($globalDBdriver == 'mysql') {
2231 2379
 				$error .= create_db::import_file('../db/stats_tracker_type.sql');
2232
-				if ($error != '') return $error;
2380
+				if ($error != '') {
2381
+					return $error;
2382
+				}
2233 2383
 			} else {
2234 2384
 				$error .= create_db::import_file('../db/pgsql/stats_tracker_type.sql');
2235
-				if ($error != '') return $error;
2385
+				if ($error != '') {
2386
+					return $error;
2387
+				}
2236 2388
 			}
2237 2389
 		}
2238 2390
 		$query = "UPDATE config SET value = '49' WHERE name = 'schema_version'";
@@ -2251,10 +2403,14 @@  discard block
 block discarded – undo
2251 2403
 		$error = '';
2252 2404
 		if ($globalDBdriver == 'mysql') {
2253 2405
 			$error .= create_db::import_file('../db/airport.sql');
2254
-			if ($error != '') return $error;
2406
+			if ($error != '') {
2407
+				return $error;
2408
+			}
2255 2409
 		} else {
2256 2410
 			$error .= create_db::import_file('../db/pgsql/airport.sql');
2257
-			if ($error != '') return $error;
2411
+			if ($error != '') {
2412
+				return $error;
2413
+			}
2258 2414
 		}
2259 2415
 		$query = "UPDATE config SET value = '50' WHERE name = 'schema_version'";
2260 2416
 		try {
@@ -2272,14 +2428,22 @@  discard block
 block discarded – undo
2272 2428
 		$error = '';
2273 2429
 		if ($globalDBdriver == 'mysql') {
2274 2430
 			$error .= create_db::import_file('../db/aircraft.sql');
2275
-			if ($error != '') return $error;
2431
+			if ($error != '') {
2432
+				return $error;
2433
+			}
2276 2434
 			$error .= create_db::import_file('../db/aircraft_block.sql');
2277
-			if ($error != '') return $error;
2435
+			if ($error != '') {
2436
+				return $error;
2437
+			}
2278 2438
 		} else {
2279 2439
 			$error .= create_db::import_file('../db/pgsql/aircraft.sql');
2280
-			if ($error != '') return $error;
2440
+			if ($error != '') {
2441
+				return $error;
2442
+			}
2281 2443
 			$error .= create_db::import_file('../db/pgsql/aircraft_block.sql');
2282
-			if ($error != '') return $error;
2444
+			if ($error != '') {
2445
+				return $error;
2446
+			}
2283 2447
 		}
2284 2448
 		$query = "UPDATE config SET value = '51' WHERE name = 'schema_version'";
2285 2449
 		try {
@@ -2353,8 +2517,11 @@  discard block
 block discarded – undo
2353 2517
 			if ($Connection->tableExists('aircraft')) {
2354 2518
 				if (!$Connection->tableExists('config')) {
2355 2519
 					$version = '1';
2356
-					if ($update) return self::update_from_1();
2357
-					else return $version;
2520
+					if ($update) {
2521
+						return self::update_from_1();
2522
+					} else {
2523
+						return $version;
2524
+					}
2358 2525
 				} else {
2359 2526
 					$query = "SELECT value FROM config WHERE name = 'schema_version' LIMIT 1";
2360 2527
 					try {
@@ -2367,211 +2534,368 @@  discard block
 block discarded – undo
2367 2534
 					if ($update) {
2368 2535
 						if ($result['value'] == '2') {
2369 2536
 							$error = self::update_from_2();
2370
-							if ($error != '') return $error;
2371
-							else return self::check_version(true);
2537
+							if ($error != '') {
2538
+								return $error;
2539
+							} else {
2540
+								return self::check_version(true);
2541
+							}
2372 2542
 						} elseif ($result['value'] == '3') {
2373 2543
 							$error = self::update_from_3();
2374
-							if ($error != '') return $error;
2375
-							else return self::check_version(true);
2544
+							if ($error != '') {
2545
+								return $error;
2546
+							} else {
2547
+								return self::check_version(true);
2548
+							}
2376 2549
 						} elseif ($result['value'] == '4') {
2377 2550
 							$error = self::update_from_4();
2378
-							if ($error != '') return $error;
2379
-							else return self::check_version(true);
2551
+							if ($error != '') {
2552
+								return $error;
2553
+							} else {
2554
+								return self::check_version(true);
2555
+							}
2380 2556
 						} elseif ($result['value'] == '5') {
2381 2557
 							$error = self::update_from_5();
2382
-							if ($error != '') return $error;
2383
-							else return self::check_version(true);
2558
+							if ($error != '') {
2559
+								return $error;
2560
+							} else {
2561
+								return self::check_version(true);
2562
+							}
2384 2563
 						} elseif ($result['value'] == '6') {
2385 2564
 							$error = self::update_from_6();
2386
-							if ($error != '') return $error;
2387
-							else return self::check_version(true);
2565
+							if ($error != '') {
2566
+								return $error;
2567
+							} else {
2568
+								return self::check_version(true);
2569
+							}
2388 2570
 						} elseif ($result['value'] == '7') {
2389 2571
 							$error = self::update_from_7();
2390
-							if ($error != '') return $error;
2391
-							else return self::check_version(true);
2572
+							if ($error != '') {
2573
+								return $error;
2574
+							} else {
2575
+								return self::check_version(true);
2576
+							}
2392 2577
 						} elseif ($result['value'] == '8') {
2393 2578
 							$error = self::update_from_8();
2394
-							if ($error != '') return $error;
2395
-							else return self::check_version(true);
2579
+							if ($error != '') {
2580
+								return $error;
2581
+							} else {
2582
+								return self::check_version(true);
2583
+							}
2396 2584
 						} elseif ($result['value'] == '9') {
2397 2585
 							$error = self::update_from_9();
2398
-							if ($error != '') return $error;
2399
-							else return self::check_version(true);
2586
+							if ($error != '') {
2587
+								return $error;
2588
+							} else {
2589
+								return self::check_version(true);
2590
+							}
2400 2591
 						} elseif ($result['value'] == '10') {
2401 2592
 							$error = self::update_from_10();
2402
-							if ($error != '') return $error;
2403
-							else return self::check_version(true);
2593
+							if ($error != '') {
2594
+								return $error;
2595
+							} else {
2596
+								return self::check_version(true);
2597
+							}
2404 2598
 						} elseif ($result['value'] == '11') {
2405 2599
 							$error = self::update_from_11();
2406
-							if ($error != '') return $error;
2407
-							else return self::check_version(true);
2600
+							if ($error != '') {
2601
+								return $error;
2602
+							} else {
2603
+								return self::check_version(true);
2604
+							}
2408 2605
 						} elseif ($result['value'] == '12') {
2409 2606
 							$error = self::update_from_12();
2410
-							if ($error != '') return $error;
2411
-							else return self::check_version(true);
2607
+							if ($error != '') {
2608
+								return $error;
2609
+							} else {
2610
+								return self::check_version(true);
2611
+							}
2412 2612
 						} elseif ($result['value'] == '13') {
2413 2613
 							$error = self::update_from_13();
2414
-							if ($error != '') return $error;
2415
-							else return self::check_version(true);
2614
+							if ($error != '') {
2615
+								return $error;
2616
+							} else {
2617
+								return self::check_version(true);
2618
+							}
2416 2619
 						} elseif ($result['value'] == '14') {
2417 2620
 							$error = self::update_from_14();
2418
-							if ($error != '') return $error;
2419
-							else return self::check_version(true);
2621
+							if ($error != '') {
2622
+								return $error;
2623
+							} else {
2624
+								return self::check_version(true);
2625
+							}
2420 2626
 						} elseif ($result['value'] == '15') {
2421 2627
 							$error = self::update_from_15();
2422
-							if ($error != '') return $error;
2423
-							else return self::check_version(true);
2628
+							if ($error != '') {
2629
+								return $error;
2630
+							} else {
2631
+								return self::check_version(true);
2632
+							}
2424 2633
 						} elseif ($result['value'] == '16') {
2425 2634
 							$error = self::update_from_16();
2426
-							if ($error != '') return $error;
2427
-							else return self::check_version(true);
2635
+							if ($error != '') {
2636
+								return $error;
2637
+							} else {
2638
+								return self::check_version(true);
2639
+							}
2428 2640
 						} elseif ($result['value'] == '17') {
2429 2641
 							$error = self::update_from_17();
2430
-							if ($error != '') return $error;
2431
-							else return self::check_version(true);
2642
+							if ($error != '') {
2643
+								return $error;
2644
+							} else {
2645
+								return self::check_version(true);
2646
+							}
2432 2647
 						} elseif ($result['value'] == '18') {
2433 2648
 							$error = self::update_from_18();
2434
-							if ($error != '') return $error;
2435
-							else return self::check_version(true);
2649
+							if ($error != '') {
2650
+								return $error;
2651
+							} else {
2652
+								return self::check_version(true);
2653
+							}
2436 2654
 						} elseif ($result['value'] == '19') {
2437 2655
 							$error = self::update_from_19();
2438
-							if ($error != '') return $error;
2439
-							else return self::check_version(true);
2656
+							if ($error != '') {
2657
+								return $error;
2658
+							} else {
2659
+								return self::check_version(true);
2660
+							}
2440 2661
 						} elseif ($result['value'] == '20') {
2441 2662
 							$error = self::update_from_20();
2442
-							if ($error != '') return $error;
2443
-							else return self::check_version(true);
2663
+							if ($error != '') {
2664
+								return $error;
2665
+							} else {
2666
+								return self::check_version(true);
2667
+							}
2444 2668
 						} elseif ($result['value'] == '21') {
2445 2669
 							$error = self::update_from_21();
2446
-							if ($error != '') return $error;
2447
-							else return self::check_version(true);
2670
+							if ($error != '') {
2671
+								return $error;
2672
+							} else {
2673
+								return self::check_version(true);
2674
+							}
2448 2675
 						} elseif ($result['value'] == '22') {
2449 2676
 							$error = self::update_from_22();
2450
-							if ($error != '') return $error;
2451
-							else return self::check_version(true);
2677
+							if ($error != '') {
2678
+								return $error;
2679
+							} else {
2680
+								return self::check_version(true);
2681
+							}
2452 2682
 						} elseif ($result['value'] == '23') {
2453 2683
 							$error = self::update_from_23();
2454
-							if ($error != '') return $error;
2455
-							else return self::check_version(true);
2684
+							if ($error != '') {
2685
+								return $error;
2686
+							} else {
2687
+								return self::check_version(true);
2688
+							}
2456 2689
 						} elseif ($result['value'] == '24') {
2457 2690
 							$error = self::update_from_24();
2458
-							if ($error != '') return $error;
2459
-							else return self::check_version(true);
2691
+							if ($error != '') {
2692
+								return $error;
2693
+							} else {
2694
+								return self::check_version(true);
2695
+							}
2460 2696
 						} elseif ($result['value'] == '25') {
2461 2697
 							$error = self::update_from_25();
2462
-							if ($error != '') return $error;
2463
-							else return self::check_version(true);
2698
+							if ($error != '') {
2699
+								return $error;
2700
+							} else {
2701
+								return self::check_version(true);
2702
+							}
2464 2703
 						} elseif ($result['value'] == '26') {
2465 2704
 							$error = self::update_from_26();
2466
-							if ($error != '') return $error;
2467
-							else return self::check_version(true);
2705
+							if ($error != '') {
2706
+								return $error;
2707
+							} else {
2708
+								return self::check_version(true);
2709
+							}
2468 2710
 						} elseif ($result['value'] == '27') {
2469 2711
 							$error = self::update_from_27();
2470
-							if ($error != '') return $error;
2471
-							else return self::check_version(true);
2712
+							if ($error != '') {
2713
+								return $error;
2714
+							} else {
2715
+								return self::check_version(true);
2716
+							}
2472 2717
 						} elseif ($result['value'] == '28') {
2473 2718
 							$error = self::update_from_28();
2474
-							if ($error != '') return $error;
2475
-							else return self::check_version(true);
2719
+							if ($error != '') {
2720
+								return $error;
2721
+							} else {
2722
+								return self::check_version(true);
2723
+							}
2476 2724
 						} elseif ($result['value'] == '29') {
2477 2725
 							$error = self::update_from_29();
2478
-							if ($error != '') return $error;
2479
-							else return self::check_version(true);
2726
+							if ($error != '') {
2727
+								return $error;
2728
+							} else {
2729
+								return self::check_version(true);
2730
+							}
2480 2731
 						} elseif ($result['value'] == '30') {
2481 2732
 							$error = self::update_from_30();
2482
-							if ($error != '') return $error;
2483
-							else return self::check_version(true);
2733
+							if ($error != '') {
2734
+								return $error;
2735
+							} else {
2736
+								return self::check_version(true);
2737
+							}
2484 2738
 						} elseif ($result['value'] == '31') {
2485 2739
 							$error = self::update_from_31();
2486
-							if ($error != '') return $error;
2487
-							else return self::check_version(true);
2740
+							if ($error != '') {
2741
+								return $error;
2742
+							} else {
2743
+								return self::check_version(true);
2744
+							}
2488 2745
 						} elseif ($result['value'] == '32') {
2489 2746
 							$error = self::update_from_32();
2490
-							if ($error != '') return $error;
2491
-							else return self::check_version(true);
2747
+							if ($error != '') {
2748
+								return $error;
2749
+							} else {
2750
+								return self::check_version(true);
2751
+							}
2492 2752
 						} elseif ($result['value'] == '33') {
2493 2753
 							$error = self::update_from_33();
2494
-							if ($error != '') return $error;
2495
-							else return self::check_version(true);
2754
+							if ($error != '') {
2755
+								return $error;
2756
+							} else {
2757
+								return self::check_version(true);
2758
+							}
2496 2759
 						} elseif ($result['value'] == '34') {
2497 2760
 							$error = self::update_from_34();
2498
-							if ($error != '') return $error;
2499
-							else return self::check_version(true);
2761
+							if ($error != '') {
2762
+								return $error;
2763
+							} else {
2764
+								return self::check_version(true);
2765
+							}
2500 2766
 						} elseif ($result['value'] == '35') {
2501 2767
 							$error = self::update_from_35();
2502
-							if ($error != '') return $error;
2503
-							else return self::check_version(true);
2768
+							if ($error != '') {
2769
+								return $error;
2770
+							} else {
2771
+								return self::check_version(true);
2772
+							}
2504 2773
 						} elseif ($result['value'] == '36') {
2505 2774
 							$error = self::update_from_36();
2506
-							if ($error != '') return $error;
2507
-							else return self::check_version(true);
2775
+							if ($error != '') {
2776
+								return $error;
2777
+							} else {
2778
+								return self::check_version(true);
2779
+							}
2508 2780
 						} elseif ($result['value'] == '37') {
2509 2781
 							$error = self::update_from_37();
2510
-							if ($error != '') return $error;
2511
-							else return self::check_version(true);
2782
+							if ($error != '') {
2783
+								return $error;
2784
+							} else {
2785
+								return self::check_version(true);
2786
+							}
2512 2787
 						} elseif ($result['value'] == '38') {
2513 2788
 							$error = self::update_from_38();
2514
-							if ($error != '') return $error;
2515
-							else return self::check_version(true);
2789
+							if ($error != '') {
2790
+								return $error;
2791
+							} else {
2792
+								return self::check_version(true);
2793
+							}
2516 2794
 						} elseif ($result['value'] == '39') {
2517 2795
 							$error = self::update_from_39();
2518
-							if ($error != '') return $error;
2519
-							else return self::check_version(true);
2796
+							if ($error != '') {
2797
+								return $error;
2798
+							} else {
2799
+								return self::check_version(true);
2800
+							}
2520 2801
 						} elseif ($result['value'] == '40') {
2521 2802
 							$error = self::update_from_40();
2522
-							if ($error != '') return $error;
2523
-							else return self::check_version(true);
2803
+							if ($error != '') {
2804
+								return $error;
2805
+							} else {
2806
+								return self::check_version(true);
2807
+							}
2524 2808
 						} elseif ($result['value'] == '41') {
2525 2809
 							$error = self::update_from_41();
2526
-							if ($error != '') return $error;
2527
-							else return self::check_version(true);
2810
+							if ($error != '') {
2811
+								return $error;
2812
+							} else {
2813
+								return self::check_version(true);
2814
+							}
2528 2815
 						} elseif ($result['value'] == '42') {
2529 2816
 							$error = self::update_from_42();
2530
-							if ($error != '') return $error;
2531
-							else return self::check_version(true);
2817
+							if ($error != '') {
2818
+								return $error;
2819
+							} else {
2820
+								return self::check_version(true);
2821
+							}
2532 2822
 						} elseif ($result['value'] == '43') {
2533 2823
 							$error = self::update_from_43();
2534
-							if ($error != '') return $error;
2535
-							else return self::check_version(true);
2824
+							if ($error != '') {
2825
+								return $error;
2826
+							} else {
2827
+								return self::check_version(true);
2828
+							}
2536 2829
 						} elseif ($result['value'] == '44') {
2537 2830
 							$error = self::update_from_44();
2538
-							if ($error != '') return $error;
2539
-							else return self::check_version(true);
2831
+							if ($error != '') {
2832
+								return $error;
2833
+							} else {
2834
+								return self::check_version(true);
2835
+							}
2540 2836
 						} elseif ($result['value'] == '45') {
2541 2837
 							$error = self::update_from_45();
2542
-							if ($error != '') return $error;
2543
-							else return self::check_version(true);
2838
+							if ($error != '') {
2839
+								return $error;
2840
+							} else {
2841
+								return self::check_version(true);
2842
+							}
2544 2843
 						} elseif ($result['value'] == '46') {
2545 2844
 							$error = self::update_from_46();
2546
-							if ($error != '') return $error;
2547
-							else return self::check_version(true);
2845
+							if ($error != '') {
2846
+								return $error;
2847
+							} else {
2848
+								return self::check_version(true);
2849
+							}
2548 2850
 						} elseif ($result['value'] == '47') {
2549 2851
 							$error = self::update_from_47();
2550
-							if ($error != '') return $error;
2551
-							else return self::check_version(true);
2852
+							if ($error != '') {
2853
+								return $error;
2854
+							} else {
2855
+								return self::check_version(true);
2856
+							}
2552 2857
 						} elseif ($result['value'] == '48') {
2553 2858
 							$error = self::update_from_48();
2554
-							if ($error != '') return $error;
2555
-							else return self::check_version(true);
2859
+							if ($error != '') {
2860
+								return $error;
2861
+							} else {
2862
+								return self::check_version(true);
2863
+							}
2556 2864
 						} elseif ($result['value'] == '49') {
2557 2865
 							$error = self::update_from_49();
2558
-							if ($error != '') return $error;
2559
-							else return self::check_version(true);
2866
+							if ($error != '') {
2867
+								return $error;
2868
+							} else {
2869
+								return self::check_version(true);
2870
+							}
2560 2871
 						} elseif ($result['value'] == '50') {
2561 2872
 							$error = self::update_from_50();
2562
-							if ($error != '') return $error;
2563
-							else return self::check_version(true);
2873
+							if ($error != '') {
2874
+								return $error;
2875
+							} else {
2876
+								return self::check_version(true);
2877
+							}
2564 2878
 						} elseif ($result['value'] == '51') {
2565 2879
 							$error = self::update_from_51();
2566
-							if ($error != '') return $error;
2567
-							else return self::check_version(true);
2568
-						} else return '';
2880
+							if ($error != '') {
2881
+								return $error;
2882
+							} else {
2883
+								return self::check_version(true);
2884
+							}
2885
+						} else {
2886
+							return '';
2887
+						}
2569 2888
 					} else {
2570
-						if (isset($result['value']) && $result['value'] != '') return $result['value'];
2571
-						else return 0;
2889
+						if (isset($result['value']) && $result['value'] != '') {
2890
+							return $result['value'];
2891
+						} else {
2892
+							return 0;
2893
+						}
2572 2894
 					}
2573 2895
 				}
2574
-			} else return $version;
2896
+			} else {
2897
+				return $version;
2898
+			}
2575 2899
 		}
2576 2900
 	}
2577 2901
 }
Please login to merge, or discard this patch.
install/index.php 2 patches
Spacing   +295 added lines, -295 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');
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
 	if (!extension_loaded('curl')) {
94 94
 		$error[] = "Curl is not loaded.";
95 95
 	}
96
-	if(function_exists('apache_get_modules') ){
97
-		if(!in_array('mod_rewrite',apache_get_modules())) {
96
+	if (function_exists('apache_get_modules')) {
97
+		if (!in_array('mod_rewrite', apache_get_modules())) {
98 98
 			$error[] = "mod_rewrite is not available.";
99 99
 		}
100 100
 	/*
@@ -113,22 +113,22 @@  discard block
 block discarded – undo
113 113
 		$alllng = $Language->listLocaleDir();
114 114
 		if (count($alllng) != count($availablelng)) {
115 115
 			$notavailable = array();
116
-			foreach($alllng as $lng) {
116
+			foreach ($alllng as $lng) {
117 117
 				if (!isset($availablelng[$lng])) $notavailable[] = $lng;
118 118
 			}
119
-			print '<div class="alert alert-warning">The following translation can\'t be used on your system: '.implode(', ',$notavailable).'. You need to add the system locales: <a href="https://github.com/Ysurac/FlightAirMap/wiki/Translation">documentation</a>.</div>';
119
+			print '<div class="alert alert-warning">The following translation can\'t be used on your system: '.implode(', ', $notavailable).'. You need to add the system locales: <a href="https://github.com/Ysurac/FlightAirMap/wiki/Translation">documentation</a>.</div>';
120 120
 		}
121 121
 	}
122 122
 	print '<div class="alert alert-info">If you use MySQL or MariaDB, check that <i>max_allowed_packet</i> >= 8M, else import of some tables can fail.</div>';
123 123
 	if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) {
124 124
 		if (function_exists('get_headers')) {
125 125
 			//$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace(array('install/','install'),'search',str_replace('index.php','',$_SERVER["REQUEST_URI"])));
126
-			$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace(array('install/','install'),'live/geojson?test',str_replace('index.php','',$_SERVER["REQUEST_URI"])));
127
-			if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) {
126
+			$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace(array('install/', 'install'), 'live/geojson?test', str_replace('index.php', '', $_SERVER["REQUEST_URI"])));
127
+			if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) {
128 128
 				print '<div class="alert alert-danger"><strong>Error</strong> Check your configuration, rewrite don\'t seems to work well. If using Apache, you need to desactivate MultiViews <a href="https://github.com/Ysurac/FlightAirMap/wiki/Apache-configuration">https://github.com/Ysurac/FlightAirMap/wiki/Apache-configuration</a></div>';
129 129
 			} else {
130
-				$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace(array('install/','install'),'search',str_replace('index.php','',$_SERVER["REQUEST_URI"])));
131
-				if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) {
130
+				$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace(array('install/', 'install'), 'search', str_replace('index.php', '', $_SERVER["REQUEST_URI"])));
131
+				if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) {
132 132
 					print '<div class="alert alert-danger"><strong>Error</strong> Check your configuration, rewrite don\'t seems to work well. If using Apache, you need to desactivate MultiViews <a href="https://github.com/Ysurac/FlightAirMap/wiki/Apache-configuration">https://github.com/Ysurac/FlightAirMap/wiki/Apache-configuration</a></div>';
133 133
 				}
134 134
 			}
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 				    if ((!isset($globalURL) || $globalURL == '') && (!isset($globalDBuser) || $globalDBuser == '')) {
209 209
 					if (isset($_SERVER['REQUEST_URI'])) {
210 210
 						$URL = $_SERVER['REQUEST_URI'];
211
-						$globalURL = str_replace('/install','',str_replace('/install/','',str_replace('/install/index.php','',$URL)));
211
+						$globalURL = str_replace('/install', '', str_replace('/install/', '', str_replace('/install/index.php', '', $URL)));
212 212
 					}
213 213
 				    }
214 214
 				?>
@@ -538,13 +538,13 @@  discard block
 block discarded – undo
538 538
 ?>
539 539
 							<tr>
540 540
 								<?php
541
-								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
541
+								    if (filter_var($source['host'], FILTER_VALIDATE_URL)) {
542 542
 								?>
543 543
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
544 544
 								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
545 545
 								<?php
546 546
 								    } else {
547
-									$hostport = explode(':',$source['host']);
547
+									$hostport = explode(':', $source['host']);
548 548
 									if (isset($hostport[1])) {
549 549
 										$host = $hostport[0];
550 550
 										$port = $hostport[1];
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 									<select name="timezones[]" id="timezones">
596 596
 								<?php
597 597
 									$timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
598
-									foreach($timezonelist as $timezones){
598
+									foreach ($timezonelist as $timezones) {
599 599
 										if (isset($source['timezone']) && $source['timezone'] == $timezones) {
600 600
 											print '<option selected>'.$timezones.'</option>';
601 601
 										} elseif (!isset($source['timezone']) && $timezones == 'UTC') {
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
 									<select name="timezones[]" id="timezones">
652 652
 								<?php
653 653
 									$timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
654
-									foreach($timezonelist as $timezones){
654
+									foreach ($timezonelist as $timezones) {
655 655
 										if ($timezones == 'UTC') {
656 656
 											print '<option selected>'.$timezones.'</option>';
657 657
 										} else print '<option>'.$timezones.'</option>';
@@ -1114,7 +1114,7 @@  discard block
 block discarded – undo
1114 1114
 			<br />
1115 1115
 			<p>
1116 1116
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
1117
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
1117
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" />
1118 1118
 			</p>
1119 1119
 			<br />
1120 1120
 			<p>
@@ -1176,14 +1176,14 @@  discard block
 block discarded – undo
1176 1176
 $error = '';
1177 1177
 
1178 1178
 if (isset($_POST['dbtype'])) {
1179
-	$dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING);
1180
-	$dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING);
1181
-	$dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING);
1182
-	$dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING);
1183
-	$dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING);
1184
-	$dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING);
1185
-	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
1186
-	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
1179
+	$dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING);
1180
+	$dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING);
1181
+	$dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING);
1182
+	$dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING);
1183
+	$dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING);
1184
+	$dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING);
1185
+	$dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING);
1186
+	$dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING);
1187 1187
 
1188 1188
 	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
1189 1189
 	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
@@ -1203,49 +1203,49 @@  discard block
 block discarded – undo
1203 1203
 	} else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
1204 1204
 	*/
1205 1205
 	
1206
-	$settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
1206
+	$settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname));
1207 1207
 
1208
-	$sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING);
1209
-	$siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING);
1210
-	$timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING);
1211
-	$language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING);
1212
-	$settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language));
1208
+	$sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING);
1209
+	$siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING);
1210
+	$timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING);
1211
+	$language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
1212
+	$settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language));
1213 1213
 
1214
-	$mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING);
1215
-	$mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING);
1216
-	$mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING);
1217
-	$googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING);
1218
-	$bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING);
1219
-	$openweathermapkey = filter_input(INPUT_POST,'openweathermapkey',FILTER_SANITIZE_STRING);
1220
-	$mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING);
1221
-	$hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING);
1222
-	$hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING);
1223
-	$settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey,'globalOpenWeatherMapKey' => $openweathermapkey));
1214
+	$mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING);
1215
+	$mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING);
1216
+	$mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING);
1217
+	$googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING);
1218
+	$bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING);
1219
+	$openweathermapkey = filter_input(INPUT_POST, 'openweathermapkey', FILTER_SANITIZE_STRING);
1220
+	$mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING);
1221
+	$hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING);
1222
+	$hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING);
1223
+	$settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey, 'globalOpenWeatherMapKey' => $openweathermapkey));
1224 1224
 	
1225
-	$latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING);
1226
-	$latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING);
1227
-	$longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING);
1228
-	$longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING);
1229
-	$livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT);
1230
-	$settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom));
1225
+	$latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING);
1226
+	$latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING);
1227
+	$longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING);
1228
+	$longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING);
1229
+	$livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT);
1230
+	$settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom));
1231 1231
 
1232
-	$squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING);
1233
-	$settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country));
1232
+	$squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING);
1233
+	$settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country));
1234 1234
 
1235
-	$latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING);
1236
-	$longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING);
1237
-	$settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter));
1235
+	$latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING);
1236
+	$longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING);
1237
+	$settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter));
1238 1238
 
1239
-	$acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING);
1239
+	$acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING);
1240 1240
 	if ($acars == 'acars') {
1241
-		$settings = array_merge($settings,array('globalACARS' => 'TRUE'));
1241
+		$settings = array_merge($settings, array('globalACARS' => 'TRUE'));
1242 1242
 	} else {
1243
-		$settings = array_merge($settings,array('globalACARS' => 'FALSE'));
1243
+		$settings = array_merge($settings, array('globalACARS' => 'FALSE'));
1244 1244
 	}
1245 1245
 
1246
-	$flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING);
1247
-	$flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING);
1248
-	$settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword));
1246
+	$flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING);
1247
+	$flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING);
1248
+	$settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword));
1249 1249
 	
1250 1250
 	$source_name = $_POST['source_name'];
1251 1251
 	$source_latitude = $_POST['source_latitude'];
@@ -1259,8 +1259,8 @@  discard block
 block discarded – undo
1259 1259
 	
1260 1260
 	$sources = array();
1261 1261
 	foreach ($source_name as $keys => $name) {
1262
-	    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]);
1263
-	    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]);
1262
+	    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]);
1263
+	    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]);
1264 1264
 	}
1265 1265
 	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1266 1266
 
@@ -1269,16 +1269,16 @@  discard block
 block discarded – undo
1269 1269
 	$newstype = $_POST['newstype'];
1270 1270
 	
1271 1271
 	$newsfeeds = array();
1272
-	foreach($newsurl as $newskey => $url) {
1272
+	foreach ($newsurl as $newskey => $url) {
1273 1273
 	    if ($url != '') {
1274 1274
 		$type = $newstype[$newskey];
1275 1275
 		$lng = $newslng[$newskey];
1276 1276
 		if (isset($newsfeeds[$type][$lng])) {
1277
-		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1277
+		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng], array($url));
1278 1278
 		} else $newsfeeds[$type][$lng] = array($url);
1279 1279
 	    }
1280 1280
 	}
1281
-	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds));
1281
+	$settings = array_merge($settings, array('globalNewsFeeds' => $newsfeeds));
1282 1282
 
1283 1283
 	//$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING);
1284 1284
 	//$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT);
@@ -1289,28 +1289,28 @@  discard block
 block discarded – undo
1289 1289
 	$sbsurl = $_POST['sbsurl'];
1290 1290
 	*/
1291 1291
 
1292
-	$globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING);
1293
-	$globalva = filter_input(INPUT_POST,'globalva',FILTER_SANITIZE_STRING);
1294
-	$globalvm = filter_input(INPUT_POST,'globalvm',FILTER_SANITIZE_STRING);
1295
-	$globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING);
1296
-	$globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING);
1297
-	$globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING);
1298
-	$globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING);
1299
-	$globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING);
1300
-	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1292
+	$globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING);
1293
+	$globalva = filter_input(INPUT_POST, 'globalva', FILTER_SANITIZE_STRING);
1294
+	$globalvm = filter_input(INPUT_POST, 'globalvm', FILTER_SANITIZE_STRING);
1295
+	$globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING);
1296
+	$globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING);
1297
+	$globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING);
1298
+	$globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING);
1299
+	$globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING);
1300
+	$datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING);
1301 1301
 
1302
-	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1303
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1304
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1305
-	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1306
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1307
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1308
-	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1309
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1310
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1311
-	$globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING);
1312
-	if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1313
-	else $settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1302
+	$globalaircraft = filter_input(INPUT_POST, 'globalaircraft', FILTER_SANITIZE_STRING);
1303
+	if ($globalaircraft == 'aircraft') $settings = array_merge($settings, array('globalAircraft' => 'TRUE'));
1304
+	else $settings = array_merge($settings, array('globalAircraft' => 'FALSE'));
1305
+	$globaltracker = filter_input(INPUT_POST, 'globaltracker', FILTER_SANITIZE_STRING);
1306
+	if ($globaltracker == 'tracker') $settings = array_merge($settings, array('globalTracker' => 'TRUE'));
1307
+	else $settings = array_merge($settings, array('globalTracker' => 'FALSE'));
1308
+	$globalmarine = filter_input(INPUT_POST, 'globalmarine', FILTER_SANITIZE_STRING);
1309
+	if ($globalmarine == 'marine') $settings = array_merge($settings, array('globalMarine' => 'TRUE'));
1310
+	else $settings = array_merge($settings, array('globalMarine' => 'FALSE'));
1311
+	$globalsatellite = filter_input(INPUT_POST, 'globalsatellite', FILTER_SANITIZE_STRING);
1312
+	if ($globalsatellite == 'satellite') $settings = array_merge($settings, array('globalSatellite' => 'TRUE'));
1313
+	else $settings = array_merge($settings, array('globalSatellite' => 'FALSE'));
1314 1314
 
1315 1315
 /*	
1316 1316
 	$globalSBS1Hosts = array();
@@ -1326,7 +1326,7 @@  discard block
 block discarded – undo
1326 1326
 	}
1327 1327
 	$settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts));
1328 1328
 */
1329
-	$settings_comment = array_merge($settings_comment,array('globalSBS1Hosts'));
1329
+	$settings_comment = array_merge($settings_comment, array('globalSBS1Hosts'));
1330 1330
 	$host = $_POST['host'];
1331 1331
 	$port = $_POST['port'];
1332 1332
 	$name = $_POST['name'];
@@ -1343,115 +1343,115 @@  discard block
 block discarded – undo
1343 1343
 		else $cov = 'FALSE';
1344 1344
 		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1345 1345
 		else $arch = 'FALSE';
1346
-		if (strpos($format[$key],'_callback')) {
1347
-			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE');
1346
+		if (strpos($format[$key], '_callback')) {
1347
+			$gSources[] = array('host' => $h, 'pass' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'TRUE');
1348 1348
 		} elseif ($h != '' || $name[$key] != '') {
1349
-			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE');
1349
+			$gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'FALSE');
1350 1350
 		}
1351 1351
 		if ($format[$key] == 'airwhere') $forcepilots = true;
1352 1352
 	}
1353
-	$settings = array_merge($settings,array('globalSources' => $gSources));
1353
+	$settings = array_merge($settings, array('globalSources' => $gSources));
1354 1354
 
1355 1355
 /*
1356 1356
 	$sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT);
1357 1357
 	$settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout));
1358 1358
 */
1359
-	$acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING);
1360
-	$acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT);
1361
-	$settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport));
1359
+	$acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING);
1360
+	$acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT);
1361
+	$settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport));
1362 1362
 
1363
-	$bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING);
1364
-	$settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly));
1363
+	$bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING);
1364
+	$settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly));
1365 1365
 
1366
-	$customcss = filter_input(INPUT_POST,'customcss',FILTER_SANITIZE_STRING);
1367
-	$settings = array_merge($settings,array('globalCustomCSS' => $customcss));
1366
+	$customcss = filter_input(INPUT_POST, 'customcss', FILTER_SANITIZE_STRING);
1367
+	$settings = array_merge($settings, array('globalCustomCSS' => $customcss));
1368 1368
 
1369
-	$map3dtile = filter_input(INPUT_POST,'map3dtileset',FILTER_SANITIZE_STRING);
1370
-	$settings = array_merge($settings,array('globalMap3DTiles' => $map3dtile));
1369
+	$map3dtile = filter_input(INPUT_POST, 'map3dtileset', FILTER_SANITIZE_STRING);
1370
+	$settings = array_merge($settings, array('globalMap3DTiles' => $map3dtile));
1371 1371
 
1372
-	$notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING);
1373
-	$settings = array_merge($settings,array('globalNOTAMSource' => $notamsource));
1374
-	$metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING);
1375
-	$settings = array_merge($settings,array('globalMETARurl' => $metarsource));
1372
+	$notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING);
1373
+	$settings = array_merge($settings, array('globalNOTAMSource' => $notamsource));
1374
+	$metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING);
1375
+	$settings = array_merge($settings, array('globalMETARurl' => $metarsource));
1376 1376
 
1377
-	$zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING);
1378
-	$zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING);
1379
-	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1377
+	$zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING);
1378
+	$zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING);
1379
+	$zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT);
1380 1380
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1381
-		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1382
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1381
+		$settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance)));
1382
+	} else $settings = array_merge($settings, array('globalDistanceIgnore' => array()));
1383 1383
 
1384
-	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1385
-	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
1386
-	$maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT);
1387
-	$settings = array_merge($settings,array('globalMapRefresh' => $maprefresh));
1388
-	$mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT);
1389
-	$settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle));
1390
-	$minfetch = filter_input(INPUT_POST,'minfetch',FILTER_SANITIZE_NUMBER_INT);
1391
-	$settings = array_merge($settings,array('globalMinFetch' => $minfetch));
1392
-	$closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT);
1393
-	$settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist));
1384
+	$refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT);
1385
+	$settings = array_merge($settings, array('globalLiveInterval' => $refresh));
1386
+	$maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT);
1387
+	$settings = array_merge($settings, array('globalMapRefresh' => $maprefresh));
1388
+	$mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT);
1389
+	$settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle));
1390
+	$minfetch = filter_input(INPUT_POST, 'minfetch', FILTER_SANITIZE_NUMBER_INT);
1391
+	$settings = array_merge($settings, array('globalMinFetch' => $minfetch));
1392
+	$closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT);
1393
+	$settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist));
1394 1394
 
1395
-	$aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT);
1396
-	$settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize));
1395
+	$aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT);
1396
+	$settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize));
1397 1397
 
1398
-	$archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT);
1399
-	$settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths));
1398
+	$archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT);
1399
+	$settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths));
1400 1400
 	
1401
-	$archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING);
1401
+	$archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING);
1402 1402
 	if ($archiveyear == "archiveyear") {
1403
-		$settings = array_merge($settings,array('globalArchiveYear' => 'TRUE'));
1403
+		$settings = array_merge($settings, array('globalArchiveYear' => 'TRUE'));
1404 1404
 	} else {
1405
-		$settings = array_merge($settings,array('globalArchiveYear' => 'FALSE'));
1405
+		$settings = array_merge($settings, array('globalArchiveYear' => 'FALSE'));
1406 1406
 	}
1407
-	$archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT);
1408
-	$settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths));
1409
-	$archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT);
1410
-	$settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1407
+	$archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT);
1408
+	$settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths));
1409
+	$archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT);
1410
+	$settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1411 1411
 
1412
-	$britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING);
1413
-	$settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways));
1414
-	$transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING);
1415
-	$settings = array_merge($settings,array('globalTransaviaKey' => $transavia));
1412
+	$britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING);
1413
+	$settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways));
1414
+	$transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING);
1415
+	$settings = array_merge($settings, array('globalTransaviaKey' => $transavia));
1416 1416
 
1417
-	$lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING);
1418
-	$lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING);
1419
-	$settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret)));
1417
+	$lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING);
1418
+	$lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING);
1419
+	$settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret)));
1420 1420
 
1421 1421
 	// Create in settings.php keys not yet configurable if not already here
1422 1422
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1423
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1423
+	if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE'));
1424 1424
 
1425
-	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1425
+	$resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING);
1426 1426
 	if ($resetyearstats == 'resetyearstats') {
1427
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE'));
1427
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE'));
1428 1428
 	} else {
1429
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE'));
1429
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE'));
1430 1430
 	}
1431 1431
 
1432
-	$archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING);
1432
+	$archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING);
1433 1433
 	if ($archive == 'archive') {
1434
-		$settings = array_merge($settings,array('globalArchive' => 'TRUE'));
1434
+		$settings = array_merge($settings, array('globalArchive' => 'TRUE'));
1435 1435
 	} else {
1436
-		$settings = array_merge($settings,array('globalArchive' => 'FALSE'));
1436
+		$settings = array_merge($settings, array('globalArchive' => 'FALSE'));
1437 1437
 	}
1438
-	$archiveresults = filter_input(INPUT_POST,'archiveresults',FILTER_SANITIZE_STRING);
1438
+	$archiveresults = filter_input(INPUT_POST, 'archiveresults', FILTER_SANITIZE_STRING);
1439 1439
 	if ($archiveresults == 'archiveresults') {
1440
-		$settings = array_merge($settings,array('globalArchiveResults' => 'TRUE'));
1440
+		$settings = array_merge($settings, array('globalArchiveResults' => 'TRUE'));
1441 1441
 	} else {
1442
-		$settings = array_merge($settings,array('globalArchiveResults' => 'FALSE'));
1442
+		$settings = array_merge($settings, array('globalArchiveResults' => 'FALSE'));
1443 1443
 	}
1444
-	$daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING);
1444
+	$daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING);
1445 1445
 	if ($daemon == 'daemon') {
1446
-		$settings = array_merge($settings,array('globalDaemon' => 'TRUE'));
1446
+		$settings = array_merge($settings, array('globalDaemon' => 'TRUE'));
1447 1447
 	} else {
1448
-		$settings = array_merge($settings,array('globalDaemon' => 'FALSE'));
1448
+		$settings = array_merge($settings, array('globalDaemon' => 'FALSE'));
1449 1449
 	}
1450
-	$schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING);
1450
+	$schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING);
1451 1451
 	if ($schedules == 'schedules') {
1452
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE'));
1452
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE'));
1453 1453
 	} else {
1454
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE'));
1454
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE'));
1455 1455
 	}
1456 1456
 
1457 1457
 /*
@@ -1462,290 +1462,290 @@  discard block
 block discarded – undo
1462 1462
 		$settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE'));
1463 1463
 	}
1464 1464
 */
1465
-	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1466
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1467
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1468
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1469
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1465
+	$settings = array_merge($settings, array('globalFlightAware' => 'FALSE'));
1466
+	if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE'));
1467
+	else $settings = array_merge($settings, array('globalSBS1' => 'FALSE'));
1468
+	if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE'));
1469
+	else $settings = array_merge($settings, array('globalAPRS' => 'FALSE'));
1470 1470
 	$va = false;
1471 1471
 	if ($globalivao == 'ivao') {
1472
-		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1472
+		$settings = array_merge($settings, array('globalIVAO' => 'TRUE'));
1473 1473
 		$va = true;
1474
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1474
+	} else $settings = array_merge($settings, array('globalIVAO' => 'FALSE'));
1475 1475
 	if ($globalvatsim == 'vatsim') {
1476
-		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1476
+		$settings = array_merge($settings, array('globalVATSIM' => 'TRUE'));
1477 1477
 		$va = true;
1478
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1478
+	} else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE'));
1479 1479
 	if ($globalphpvms == 'phpvms') {
1480
-		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1480
+		$settings = array_merge($settings, array('globalphpVMS' => 'TRUE'));
1481 1481
 		$va = true;
1482
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1482
+	} else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE'));
1483 1483
 	if ($globalvam == 'vam') {
1484
-		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1484
+		$settings = array_merge($settings, array('globalVAM' => 'TRUE'));
1485 1485
 		$va = true;
1486
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1486
+	} else $settings = array_merge($settings, array('globalVAM' => 'FALSE'));
1487 1487
 	if ($va) {
1488
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1489
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1488
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE'));
1489
+	} else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE'));
1490 1490
 	if ($globalva == 'va' || $va) {
1491
-		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1492
-		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1491
+		$settings = array_merge($settings, array('globalVA' => 'TRUE'));
1492
+		$settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE'));
1493 1493
 	} else {
1494
-		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1495
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1496
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1494
+		$settings = array_merge($settings, array('globalVA' => 'FALSE'));
1495
+		if ($forcepilots) $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE'));
1496
+		else $settings = array_merge($settings, array('globalUsePilot' => 'FALSE', 'globalUseOwner' => 'TRUE'));
1497 1497
 	}
1498 1498
 	if ($globalvm == 'vm') {
1499
-		$settings = array_merge($settings,array('globalVM' => 'TRUE'));
1499
+		$settings = array_merge($settings, array('globalVM' => 'TRUE'));
1500 1500
 	} else {
1501
-		$settings = array_merge($settings,array('globalVM' => 'FALSE'));
1501
+		$settings = array_merge($settings, array('globalVM' => 'FALSE'));
1502 1502
 	}
1503 1503
 	
1504
-	$mapoffline = filter_input(INPUT_POST,'mapoffline',FILTER_SANITIZE_STRING);
1504
+	$mapoffline = filter_input(INPUT_POST, 'mapoffline', FILTER_SANITIZE_STRING);
1505 1505
 	if ($mapoffline == 'mapoffline') {
1506
-		$settings = array_merge($settings,array('globalMapOffline' => 'TRUE'));
1506
+		$settings = array_merge($settings, array('globalMapOffline' => 'TRUE'));
1507 1507
 	} else {
1508
-		$settings = array_merge($settings,array('globalMapOffline' => 'FALSE'));
1508
+		$settings = array_merge($settings, array('globalMapOffline' => 'FALSE'));
1509 1509
 	}
1510
-	$globaloffline = filter_input(INPUT_POST,'globaloffline',FILTER_SANITIZE_STRING);
1510
+	$globaloffline = filter_input(INPUT_POST, 'globaloffline', FILTER_SANITIZE_STRING);
1511 1511
 	if ($globaloffline == 'globaloffline') {
1512
-		$settings = array_merge($settings,array('globalOffline' => 'TRUE'));
1512
+		$settings = array_merge($settings, array('globalOffline' => 'TRUE'));
1513 1513
 	} else {
1514
-		$settings = array_merge($settings,array('globalOffline' => 'FALSE'));
1514
+		$settings = array_merge($settings, array('globalOffline' => 'FALSE'));
1515 1515
 	}
1516 1516
 
1517
-	$notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING);
1517
+	$notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING);
1518 1518
 	if ($notam == 'notam') {
1519
-		$settings = array_merge($settings,array('globalNOTAM' => 'TRUE'));
1519
+		$settings = array_merge($settings, array('globalNOTAM' => 'TRUE'));
1520 1520
 	} else {
1521
-		$settings = array_merge($settings,array('globalNOTAM' => 'FALSE'));
1521
+		$settings = array_merge($settings, array('globalNOTAM' => 'FALSE'));
1522 1522
 	}
1523
-	$owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING);
1523
+	$owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING);
1524 1524
 	if ($owner == 'owner') {
1525
-		$settings = array_merge($settings,array('globalOwner' => 'TRUE'));
1525
+		$settings = array_merge($settings, array('globalOwner' => 'TRUE'));
1526 1526
 	} else {
1527
-		$settings = array_merge($settings,array('globalOwner' => 'FALSE'));
1527
+		$settings = array_merge($settings, array('globalOwner' => 'FALSE'));
1528 1528
 	}
1529
-	$map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING);
1529
+	$map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING);
1530 1530
 	if ($map3d == 'map3d') {
1531
-		$settings = array_merge($settings,array('globalMap3D' => 'TRUE'));
1531
+		$settings = array_merge($settings, array('globalMap3D' => 'TRUE'));
1532 1532
 	} else {
1533
-		$settings = array_merge($settings,array('globalMap3D' => 'FALSE'));
1533
+		$settings = array_merge($settings, array('globalMap3D' => 'FALSE'));
1534 1534
 	}
1535
-	$crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING);
1535
+	$crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING);
1536 1536
 	if ($crash == 'crash') {
1537
-		$settings = array_merge($settings,array('globalAccidents' => 'TRUE'));
1537
+		$settings = array_merge($settings, array('globalAccidents' => 'TRUE'));
1538 1538
 	} else {
1539
-		$settings = array_merge($settings,array('globalAccidents' => 'FALSE'));
1539
+		$settings = array_merge($settings, array('globalAccidents' => 'FALSE'));
1540 1540
 	}
1541
-	$fires = filter_input(INPUT_POST,'fires',FILTER_SANITIZE_STRING);
1541
+	$fires = filter_input(INPUT_POST, 'fires', FILTER_SANITIZE_STRING);
1542 1542
 	if ($fires == 'fires') {
1543
-		$settings = array_merge($settings,array('globalMapFires' => 'TRUE'));
1543
+		$settings = array_merge($settings, array('globalMapFires' => 'TRUE'));
1544 1544
 	} else {
1545
-		$settings = array_merge($settings,array('globalMapFires' => 'FALSE'));
1545
+		$settings = array_merge($settings, array('globalMapFires' => 'FALSE'));
1546 1546
 	}
1547
-	$firessupport = filter_input(INPUT_POST,'firessupport',FILTER_SANITIZE_STRING);
1547
+	$firessupport = filter_input(INPUT_POST, 'firessupport', FILTER_SANITIZE_STRING);
1548 1548
 	if ($firessupport == 'firessupport') {
1549
-		$settings = array_merge($settings,array('globalFires' => 'TRUE'));
1549
+		$settings = array_merge($settings, array('globalFires' => 'TRUE'));
1550 1550
 	} else {
1551
-		$settings = array_merge($settings,array('globalFires' => 'FALSE'));
1551
+		$settings = array_merge($settings, array('globalFires' => 'FALSE'));
1552 1552
 	}
1553
-	$mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING);
1553
+	$mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING);
1554 1554
 	if ($mapsatellites == 'mapsatellites') {
1555
-		$settings = array_merge($settings,array('globalMapSatellites' => 'TRUE'));
1555
+		$settings = array_merge($settings, array('globalMapSatellites' => 'TRUE'));
1556 1556
 	} else {
1557
-		$settings = array_merge($settings,array('globalMapSatellites' => 'FALSE'));
1557
+		$settings = array_merge($settings, array('globalMapSatellites' => 'FALSE'));
1558 1558
 	}
1559
-	$map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING);
1559
+	$map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING);
1560 1560
 	if ($map3ddefault == 'map3ddefault') {
1561
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE'));
1561
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE'));
1562 1562
 	} else {
1563
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE'));
1563
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE'));
1564 1564
 	}
1565
-	$one3dmodel = filter_input(INPUT_POST,'one3dmodel',FILTER_SANITIZE_STRING);
1565
+	$one3dmodel = filter_input(INPUT_POST, 'one3dmodel', FILTER_SANITIZE_STRING);
1566 1566
 	if ($one3dmodel == 'one3dmodel') {
1567
-		$settings = array_merge($settings,array('globalMap3DOneModel' => 'TRUE'));
1567
+		$settings = array_merge($settings, array('globalMap3DOneModel' => 'TRUE'));
1568 1568
 	} else {
1569
-		$settings = array_merge($settings,array('globalMap3DOneModel' => 'FALSE'));
1569
+		$settings = array_merge($settings, array('globalMap3DOneModel' => 'FALSE'));
1570 1570
 	}
1571
-	$map3dliveries = filter_input(INPUT_POST,'map3dliveries',FILTER_SANITIZE_STRING);
1571
+	$map3dliveries = filter_input(INPUT_POST, 'map3dliveries', FILTER_SANITIZE_STRING);
1572 1572
 	if ($map3dliveries == 'map3dliveries') {
1573
-		$settings = array_merge($settings,array('globalMap3DLiveries' => 'TRUE'));
1573
+		$settings = array_merge($settings, array('globalMap3DLiveries' => 'TRUE'));
1574 1574
 	} else {
1575
-		$settings = array_merge($settings,array('globalMap3DLiveries' => 'FALSE'));
1575
+		$settings = array_merge($settings, array('globalMap3DLiveries' => 'FALSE'));
1576 1576
 	}
1577
-	$map3dshadows = filter_input(INPUT_POST,'map3dshadows',FILTER_SANITIZE_STRING);
1577
+	$map3dshadows = filter_input(INPUT_POST, 'map3dshadows', FILTER_SANITIZE_STRING);
1578 1578
 	if ($map3dshadows == 'map3dshadows') {
1579
-		$settings = array_merge($settings,array('globalMap3DShadows' => 'TRUE'));
1579
+		$settings = array_merge($settings, array('globalMap3DShadows' => 'TRUE'));
1580 1580
 	} else {
1581
-		$settings = array_merge($settings,array('globalMap3DShadows' => 'FALSE'));
1581
+		$settings = array_merge($settings, array('globalMap3DShadows' => 'FALSE'));
1582 1582
 	}
1583
-	$translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING);
1583
+	$translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING);
1584 1584
 	if ($translate == 'translate') {
1585
-		$settings = array_merge($settings,array('globalTranslate' => 'TRUE'));
1585
+		$settings = array_merge($settings, array('globalTranslate' => 'TRUE'));
1586 1586
 	} else {
1587
-		$settings = array_merge($settings,array('globalTranslate' => 'FALSE'));
1587
+		$settings = array_merge($settings, array('globalTranslate' => 'FALSE'));
1588 1588
 	}
1589
-	$realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING);
1589
+	$realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING);
1590 1590
 	if ($realairlines == 'realairlines') {
1591
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE'));
1591
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE'));
1592 1592
 	} else {
1593
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE'));
1593
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE'));
1594 1594
 	}
1595
-	$estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING);
1595
+	$estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING);
1596 1596
 	if ($estimation == 'estimation') {
1597
-		$settings = array_merge($settings,array('globalMapEstimation' => 'TRUE'));
1597
+		$settings = array_merge($settings, array('globalMapEstimation' => 'TRUE'));
1598 1598
 	} else {
1599
-		$settings = array_merge($settings,array('globalMapEstimation' => 'FALSE'));
1599
+		$settings = array_merge($settings, array('globalMapEstimation' => 'FALSE'));
1600 1600
 	}
1601
-	$metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING);
1601
+	$metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING);
1602 1602
 	if ($metar == 'metar') {
1603
-		$settings = array_merge($settings,array('globalMETAR' => 'TRUE'));
1603
+		$settings = array_merge($settings, array('globalMETAR' => 'TRUE'));
1604 1604
 	} else {
1605
-		$settings = array_merge($settings,array('globalMETAR' => 'FALSE'));
1605
+		$settings = array_merge($settings, array('globalMETAR' => 'FALSE'));
1606 1606
 	}
1607
-	$metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING);
1607
+	$metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING);
1608 1608
 	if ($metarcycle == 'metarcycle') {
1609
-		$settings = array_merge($settings,array('globalMETARcycle' => 'TRUE'));
1609
+		$settings = array_merge($settings, array('globalMETARcycle' => 'TRUE'));
1610 1610
 	} else {
1611
-		$settings = array_merge($settings,array('globalMETARcycle' => 'FALSE'));
1611
+		$settings = array_merge($settings, array('globalMETARcycle' => 'FALSE'));
1612 1612
 	}
1613
-	$fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING);
1613
+	$fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING);
1614 1614
 	if ($fork == 'fork') {
1615
-		$settings = array_merge($settings,array('globalFork' => 'TRUE'));
1615
+		$settings = array_merge($settings, array('globalFork' => 'TRUE'));
1616 1616
 	} else {
1617
-		$settings = array_merge($settings,array('globalFork' => 'FALSE'));
1617
+		$settings = array_merge($settings, array('globalFork' => 'FALSE'));
1618 1618
 	}
1619 1619
 
1620
-	$colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING);
1620
+	$colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING);
1621 1621
 	if ($colormap == 'colormap') {
1622
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE'));
1622
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE'));
1623 1623
 	} else {
1624
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE'));
1624
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE'));
1625 1625
 	}
1626 1626
 	
1627 1627
 	if (isset($_POST['aircrafticoncolor'])) {
1628
-		$aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING);
1629
-		$settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1)));
1628
+		$aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING);
1629
+		$settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1)));
1630 1630
 	}
1631 1631
 
1632
-	$airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT);
1633
-	$settings = array_merge($settings,array('globalAirportZoom' => $airportzoom));
1632
+	$airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT);
1633
+	$settings = array_merge($settings, array('globalAirportZoom' => $airportzoom));
1634 1634
 
1635
-	$unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING);
1636
-	$settings = array_merge($settings,array('globalUnitDistance' => $unitdistance));
1637
-	$unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING);
1638
-	$settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude));
1639
-	$unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING);
1640
-	$settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed));
1635
+	$unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING);
1636
+	$settings = array_merge($settings, array('globalUnitDistance' => $unitdistance));
1637
+	$unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING);
1638
+	$settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude));
1639
+	$unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING);
1640
+	$settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed));
1641 1641
 
1642
-	$mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING);
1642
+	$mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING);
1643 1643
 	if ($mappopup == 'mappopup') {
1644
-		$settings = array_merge($settings,array('globalMapPopup' => 'TRUE'));
1644
+		$settings = array_merge($settings, array('globalMapPopup' => 'TRUE'));
1645 1645
 	} else {
1646
-		$settings = array_merge($settings,array('globalMapPopup' => 'FALSE'));
1646
+		$settings = array_merge($settings, array('globalMapPopup' => 'FALSE'));
1647 1647
 	}
1648
-	$airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING);
1648
+	$airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING);
1649 1649
 	if ($airportpopup == 'airportpopup') {
1650
-		$settings = array_merge($settings,array('globalAirportPopup' => 'TRUE'));
1650
+		$settings = array_merge($settings, array('globalAirportPopup' => 'TRUE'));
1651 1651
 	} else {
1652
-		$settings = array_merge($settings,array('globalAirportPopup' => 'FALSE'));
1652
+		$settings = array_merge($settings, array('globalAirportPopup' => 'FALSE'));
1653 1653
 	}
1654
-	$maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING);
1654
+	$maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING);
1655 1655
 	if ($maphistory == 'maphistory') {
1656
-		$settings = array_merge($settings,array('globalMapHistory' => 'TRUE'));
1656
+		$settings = array_merge($settings, array('globalMapHistory' => 'TRUE'));
1657 1657
 	} else {
1658
-		$settings = array_merge($settings,array('globalMapHistory' => 'FALSE'));
1658
+		$settings = array_merge($settings, array('globalMapHistory' => 'FALSE'));
1659 1659
 	}
1660
-	$maptooltip = filter_input(INPUT_POST,'maptooltip',FILTER_SANITIZE_STRING);
1660
+	$maptooltip = filter_input(INPUT_POST, 'maptooltip', FILTER_SANITIZE_STRING);
1661 1661
 	if ($maptooltip == 'maptooltip') {
1662
-		$settings = array_merge($settings,array('globalMapTooltip' => 'TRUE'));
1662
+		$settings = array_merge($settings, array('globalMapTooltip' => 'TRUE'));
1663 1663
 	} else {
1664
-		$settings = array_merge($settings,array('globalMapTooltip' => 'FALSE'));
1664
+		$settings = array_merge($settings, array('globalMapTooltip' => 'FALSE'));
1665 1665
 	}
1666
-	$flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING);
1666
+	$flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING);
1667 1667
 	if ($flightroute == 'flightroute') {
1668
-		$settings = array_merge($settings,array('globalMapRoute' => 'TRUE'));
1668
+		$settings = array_merge($settings, array('globalMapRoute' => 'TRUE'));
1669 1669
 	} else {
1670
-		$settings = array_merge($settings,array('globalMapRoute' => 'FALSE'));
1670
+		$settings = array_merge($settings, array('globalMapRoute' => 'FALSE'));
1671 1671
 	}
1672
-	$flightremainingroute = filter_input(INPUT_POST,'flightremainingroute',FILTER_SANITIZE_STRING);
1672
+	$flightremainingroute = filter_input(INPUT_POST, 'flightremainingroute', FILTER_SANITIZE_STRING);
1673 1673
 	if ($flightremainingroute == 'flightremainingroute') {
1674
-		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'TRUE'));
1674
+		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'TRUE'));
1675 1675
 	} else {
1676
-		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'FALSE'));
1676
+		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'FALSE'));
1677 1677
 	}
1678
-	$allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING);
1678
+	$allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING);
1679 1679
 	if ($allflights == 'allflights') {
1680
-		$settings = array_merge($settings,array('globalAllFlights' => 'TRUE'));
1680
+		$settings = array_merge($settings, array('globalAllFlights' => 'TRUE'));
1681 1681
 	} else {
1682
-		$settings = array_merge($settings,array('globalAllFlights' => 'FALSE'));
1682
+		$settings = array_merge($settings, array('globalAllFlights' => 'FALSE'));
1683 1683
 	}
1684
-	$bbox = filter_input(INPUT_POST,'bbox',FILTER_SANITIZE_STRING);
1684
+	$bbox = filter_input(INPUT_POST, 'bbox', FILTER_SANITIZE_STRING);
1685 1685
 	if ($bbox == 'bbox') {
1686
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'TRUE'));
1686
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'TRUE'));
1687 1687
 	} else {
1688
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'FALSE'));
1688
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'FALSE'));
1689 1689
 	}
1690
-	$groundaltitude = filter_input(INPUT_POST,'groundaltitude',FILTER_SANITIZE_STRING);
1690
+	$groundaltitude = filter_input(INPUT_POST, 'groundaltitude', FILTER_SANITIZE_STRING);
1691 1691
 	if ($groundaltitude == 'groundaltitude') {
1692
-		$settings = array_merge($settings,array('globalGroundAltitude' => 'TRUE'));
1692
+		$settings = array_merge($settings, array('globalGroundAltitude' => 'TRUE'));
1693 1693
 	} else {
1694
-		$settings = array_merge($settings,array('globalGroundAltitude' => 'FALSE'));
1694
+		$settings = array_merge($settings, array('globalGroundAltitude' => 'FALSE'));
1695 1695
 	}
1696
-	$waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING);
1696
+	$waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING);
1697 1697
 	if ($waypoints == 'waypoints') {
1698
-		$settings = array_merge($settings,array('globalWaypoints' => 'TRUE'));
1698
+		$settings = array_merge($settings, array('globalWaypoints' => 'TRUE'));
1699 1699
 	} else {
1700
-		$settings = array_merge($settings,array('globalWaypoints' => 'FALSE'));
1700
+		$settings = array_merge($settings, array('globalWaypoints' => 'FALSE'));
1701 1701
 	}
1702
-	$geoid = filter_input(INPUT_POST,'geoid',FILTER_SANITIZE_STRING);
1702
+	$geoid = filter_input(INPUT_POST, 'geoid', FILTER_SANITIZE_STRING);
1703 1703
 	if ($geoid == 'geoid') {
1704
-		$settings = array_merge($settings,array('globalGeoid' => 'TRUE'));
1704
+		$settings = array_merge($settings, array('globalGeoid' => 'TRUE'));
1705 1705
 	} else {
1706
-		$settings = array_merge($settings,array('globalGeoid' => 'FALSE'));
1706
+		$settings = array_merge($settings, array('globalGeoid' => 'FALSE'));
1707 1707
 	}
1708
-	$geoid_source = filter_input(INPUT_POST,'geoid_source',FILTER_SANITIZE_STRING);
1709
-	$settings = array_merge($settings,array('globalGeoidSource' => $geoid_source));
1708
+	$geoid_source = filter_input(INPUT_POST, 'geoid_source', FILTER_SANITIZE_STRING);
1709
+	$settings = array_merge($settings, array('globalGeoidSource' => $geoid_source));
1710 1710
 
1711
-	$noairlines = filter_input(INPUT_POST,'noairlines',FILTER_SANITIZE_STRING);
1711
+	$noairlines = filter_input(INPUT_POST, 'noairlines', FILTER_SANITIZE_STRING);
1712 1712
 	if ($noairlines == 'noairlines') {
1713
-		$settings = array_merge($settings,array('globalNoAirlines' => 'TRUE'));
1713
+		$settings = array_merge($settings, array('globalNoAirlines' => 'TRUE'));
1714 1714
 	} else {
1715
-		$settings = array_merge($settings,array('globalNoAirlines' => 'FALSE'));
1715
+		$settings = array_merge($settings, array('globalNoAirlines' => 'FALSE'));
1716 1716
 	}
1717 1717
 
1718
-	$tsk = filter_input(INPUT_POST,'tsk',FILTER_SANITIZE_STRING);
1718
+	$tsk = filter_input(INPUT_POST, 'tsk', FILTER_SANITIZE_STRING);
1719 1719
 	if ($tsk == 'tsk') {
1720
-		$settings = array_merge($settings,array('globalTSK' => 'TRUE'));
1720
+		$settings = array_merge($settings, array('globalTSK' => 'TRUE'));
1721 1721
 	} else {
1722
-		$settings = array_merge($settings,array('globalTSK' => 'FALSE'));
1722
+		$settings = array_merge($settings, array('globalTSK' => 'FALSE'));
1723 1723
 	}
1724
-	$mapmatching = filter_input(INPUT_POST,'mapmatching',FILTER_SANITIZE_STRING);
1724
+	$mapmatching = filter_input(INPUT_POST, 'mapmatching', FILTER_SANITIZE_STRING);
1725 1725
 	if ($mapmatching == 'mapmatching') {
1726
-		$settings = array_merge($settings,array('globalMapMatching' => 'TRUE'));
1726
+		$settings = array_merge($settings, array('globalMapMatching' => 'TRUE'));
1727 1727
 	} else {
1728
-		$settings = array_merge($settings,array('globalMapMatching' => 'FALSE'));
1728
+		$settings = array_merge($settings, array('globalMapMatching' => 'FALSE'));
1729 1729
 	}
1730
-	$mapmatchingsource = filter_input(INPUT_POST,'mapmatchingsource',FILTER_SANITIZE_STRING);
1731
-	$settings = array_merge($settings,array('globalMapMatchingSource' => $mapmatchingsource));
1732
-	$graphhopper = filter_input(INPUT_POST,'graphhopper',FILTER_SANITIZE_STRING);
1733
-	$settings = array_merge($settings,array('globalGraphHopperKey' => $graphhopper));
1730
+	$mapmatchingsource = filter_input(INPUT_POST, 'mapmatchingsource', FILTER_SANITIZE_STRING);
1731
+	$settings = array_merge($settings, array('globalMapMatchingSource' => $mapmatchingsource));
1732
+	$graphhopper = filter_input(INPUT_POST, 'graphhopper', FILTER_SANITIZE_STRING);
1733
+	$settings = array_merge($settings, array('globalGraphHopperKey' => $graphhopper));
1734 1734
 
1735
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1735
+	if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE'));
1736 1736
 
1737 1737
 	// Set some defaults values...
1738 1738
 	if (!isset($globalAircraftImageSources)) {
1739
-	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1740
-	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1739
+	    $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters');
1740
+	    $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources));
1741 1741
 	}
1742 1742
 
1743 1743
 	if (!isset($globalSchedulesSources)) {
1744
-	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1745
-    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1744
+	    $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware');
1745
+    	    $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources));
1746 1746
     	}
1747 1747
 
1748
-	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1748
+	$settings = array_merge($settings, array('globalInstalled' => 'TRUE'));
1749 1749
 
1750 1750
 	if ($error == '') settings::modify_settings($settings);
1751 1751
 	if ($error == '') settings::comment_settings($settings_comment);
Please login to merge, or discard this patch.
Braces   +603 added lines, -162 removed lines patch added patch discarded remove patch
@@ -4,11 +4,19 @@  discard block
 block discarded – undo
4 4
 if (isset($_SESSION['error'])) {
5 5
 	header('Content-Encoding: none;');
6 6
 	echo 'Error : '.$_SESSION['error'].' - Resetting install... You need to fix the problem and run install again.';
7
-	if (isset($_SESSION['error'])) unset($_SESSION['error']);
8
-	if (isset($_SESSION['errorlst'])) unset($_SESSION['errorlst']);
9
-	if (isset($_SESSION['next'])) unset($_SESSION['next']);
10
-	if (isset($_SESSION['install'])) unset($_SESSION['install']);
11
-}
7
+	if (isset($_SESSION['error'])) {
8
+		unset($_SESSION['error']);
9
+	}
10
+	if (isset($_SESSION['errorlst'])) {
11
+		unset($_SESSION['errorlst']);
12
+	}
13
+	if (isset($_SESSION['next'])) {
14
+		unset($_SESSION['next']);
15
+	}
16
+	if (isset($_SESSION['install'])) {
17
+		unset($_SESSION['install']);
18
+	}
19
+	}
12 20
 /*
13 21
 if (isset($_SESSION['errorlst'])) {
14 22
 	header('Content-Encoding: none;');
@@ -114,7 +122,9 @@  discard block
 block discarded – undo
114 122
 		if (count($alllng) != count($availablelng)) {
115 123
 			$notavailable = array();
116 124
 			foreach($alllng as $lng) {
117
-				if (!isset($availablelng[$lng])) $notavailable[] = $lng;
125
+				if (!isset($availablelng[$lng])) {
126
+					$notavailable[] = $lng;
127
+				}
118 128
 			}
119 129
 			print '<div class="alert alert-warning">The following translation can\'t be used on your system: '.implode(', ',$notavailable).'. You need to add the system locales: <a href="https://github.com/Ysurac/FlightAirMap/wiki/Translation">documentation</a>.</div>';
120 130
 		}
@@ -175,31 +185,49 @@  discard block
 block discarded – undo
175 185
 			</div>
176 186
 			<p>
177 187
 				<label for="dbhost">Database hostname</label>
178
-				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" />
188
+				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) {
189
+	print $globalDBhost;
190
+}
191
+?>" />
179 192
 			</p>
180 193
 			<p>
181 194
 				<label for="dbport">Database port</label>
182
-				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" />
195
+				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) {
196
+	print $globalDBport;
197
+}
198
+?>" />
183 199
 				<p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p>
184 200
 			</p>
185 201
 			<p>
186 202
 				<label for="dbname">Database name</label>
187
-				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" />
203
+				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) {
204
+	print $globalDBname;
205
+}
206
+?>" />
188 207
 			</p>
189 208
 			<p>
190 209
 				<label for="dbuser">Database user</label>
191
-				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" />
210
+				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) {
211
+	print $globalDBuser;
212
+}
213
+?>" />
192 214
 			</p>
193 215
 			<p>
194 216
 				<label for="dbuserpass">Database user password</label>
195
-				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" />
217
+				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) {
218
+	print $globalDBpass;
219
+}
220
+?>" />
196 221
 			</p>
197 222
 		</fieldset>
198 223
 		<fieldset id="site">
199 224
 			<legend>Site configuration</legend>
200 225
 			<p>
201 226
 				<label for="sitename">Site name</label>
202
-				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" />
227
+				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) {
228
+	print $globalName;
229
+}
230
+?>" />
203 231
 			</p>
204 232
 			<p>
205 233
 				<label for="siteurl">Site directory</label>
@@ -212,18 +240,27 @@  discard block
 block discarded – undo
212 240
 					}
213 241
 				    }
214 242
 				?>
215
-				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" />
243
+				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) {
244
+	print $globalURL;
245
+}
246
+?>" />
216 247
 				<p class="help-block">ex : <i>/flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p>
217 248
 				<p class="help-block">Can be empty</p>
218 249
 			</p>
219 250
 			<p>
220 251
 				<label for="timezone">Timezone</label>
221
-				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" />
252
+				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) {
253
+	print $globalTimezone;
254
+}
255
+?>" />
222 256
 				<p class="help-block">ex : UTC, Europe/Paris,...</p>
223 257
 			</p>
224 258
 			<p>
225 259
 				<label for="language">Language</label>
226
-				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" />
260
+				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) {
261
+	print $globalLanguage;
262
+}
263
+?>" />
227 264
 				<p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p>
228 265
 			</p>
229 266
 		</fieldset>
@@ -243,11 +280,17 @@  discard block
 block discarded – undo
243 280
 			<div id="mapbox_data">
244 281
 				<p>
245 282
 					<label for="mapboxid">Mapbox id</label>
246
-					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" />
283
+					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) {
284
+	print $globalMapboxId;
285
+}
286
+?>" />
247 287
 				</p>
248 288
 				<p>
249 289
 					<label for="mapboxtoken">Mapbox token</label>
250
-					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" />
290
+					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) {
291
+	print $globalMapboxToken;
292
+}
293
+?>" />
251 294
 				</p>
252 295
 				<p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p>
253 296
 			</div>
@@ -255,7 +298,10 @@  discard block
 block discarded – undo
255 298
 			<div id="google_data">
256 299
 				<p>
257 300
 					<label for="googlekey">Google API key</label>
258
-					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" />
301
+					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) {
302
+	print $globalGoogleAPIKey;
303
+}
304
+?>" />
259 305
 					<p class="help-block">Get a key <a href="https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key">here</a></p>
260 306
 				</p>
261 307
 			</div>
@@ -263,7 +309,10 @@  discard block
 block discarded – undo
263 309
 			<div id="bing_data">
264 310
 				<p>
265 311
 					<label for="bingkey">Bing Map key</label>
266
-					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" />
312
+					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) {
313
+	print $globalBingMapKey;
314
+}
315
+?>" />
267 316
 					<p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p>
268 317
 				</p>
269 318
 			</div>
@@ -271,7 +320,10 @@  discard block
 block discarded – undo
271 320
 			<div id="mapquest_data">
272 321
 				<p>
273 322
 					<label for="mapquestkey">MapQuest key</label>
274
-					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" />
323
+					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) {
324
+	print $globalMapQuestKey;
325
+}
326
+?>" />
275 327
 					<p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p>
276 328
 				</p>
277 329
 			</div>
@@ -279,11 +331,17 @@  discard block
 block discarded – undo
279 331
 			<div id="here_data">
280 332
 				<p>
281 333
 					<label for="hereappid">Here App_Id</label>
282
-					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" />
334
+					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) {
335
+	print $globalHereappId;
336
+}
337
+?>" />
283 338
 				</p>
284 339
 				<p>
285 340
 					<label for="hereappcode">Here App_Code</label>
286
-					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" />
341
+					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) {
342
+	print $globalHereappCode;
343
+}
344
+?>" />
287 345
 				</p>
288 346
 				<p class="help-block">Get a key <a href="https://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/quick-start.html">here</a></p>
289 347
 			</div>
@@ -291,7 +349,10 @@  discard block
 block discarded – undo
291 349
 			<div id="openweathermap_data">
292 350
 				<p>
293 351
 					<label for="openweathermapkey">OpenWeatherMap key (weather layer)</label>
294
-					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) print $globalOpenWeatherMapKey; ?>" />
352
+					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) {
353
+	print $globalOpenWeatherMapKey;
354
+}
355
+?>" />
295 356
 					<p class="help-block">Get a key <a href="https://openweathermap.org/">here</a></p>
296 357
 				</p>
297 358
 			</div>
@@ -320,42 +381,86 @@  discard block
 block discarded – undo
320 381
 			<legend>Coverage area</legend>
321 382
 			<p>
322 383
 				<label for="latitudemax">The maximum latitude (north)</label>
323
-				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" />
384
+				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) {
385
+	print $globalLatitudeMax;
386
+}
387
+?>" />
324 388
 			</p>
325 389
 			<p>
326 390
 				<label for="latitudemin">The minimum latitude (south)</label>
327
-				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" />
391
+				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) {
392
+	print $globalLatitudeMin;
393
+}
394
+?>" />
328 395
 			</p>
329 396
 			<p>
330 397
 				<label for="longitudemax">The maximum longitude (west)</label>
331
-				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" />
398
+				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) {
399
+	print $globalLongitudeMax;
400
+}
401
+?>" />
332 402
 			</p>
333 403
 			<p>
334 404
 				<label for="longitudemin">The minimum longitude (east)</label>
335
-				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" />
405
+				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) {
406
+	print $globalLongitudeMin;
407
+}
408
+?>" />
336 409
 			</p>
337 410
 			<p>
338 411
 				<label for="latitudecenter">The latitude center</label>
339
-				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" />
412
+				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) {
413
+	print $globalCenterLatitude;
414
+}
415
+?>" />
340 416
 			</p>
341 417
 			<p>
342 418
 				<label for="longitudecenter">The longitude center</label>
343
-				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" />
419
+				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) {
420
+	print $globalCenterLongitude;
421
+}
422
+?>" />
344 423
 			</p>
345 424
 			<p>
346 425
 				<label for="livezoom">Default Zoom on live map</label>
347
-				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" />
426
+				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) {
427
+	print $globalLiveZoom;
428
+} else {
429
+	print '9';
430
+}
431
+?>" />
348 432
 			</p>
349 433
 			<p>
350 434
 				<label for="squawk_country">Country for squawk usage</label>
351 435
 				<select name="squawk_country" id="squawk_country">
352
-					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option>
353
-					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option>
354
-					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option>
355
-					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option>
356
-					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option>
357
-					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option>
358
-					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option>
436
+					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') {
437
+	print ' selected ';
438
+}
439
+?>>UK</option>
440
+					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') {
441
+	print ' selected ';
442
+}
443
+?>>NZ</option>
444
+					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') {
445
+	print ' selected ';
446
+}
447
+?>>US</option>
448
+					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') {
449
+	print ' selected ';
450
+}
451
+?>>AU</option>
452
+					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') {
453
+	print ' selected ';
454
+}
455
+?>>NL</option>
456
+					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') {
457
+	print ' selected ';
458
+}
459
+?>>FR</option>
460
+					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') {
461
+	print ' selected ';
462
+}
463
+?>>TR</option>
359 464
 				</select>
360 465
 			</p>
361 466
 		</fieldset>
@@ -364,15 +469,24 @@  discard block
 block discarded – undo
364 469
 			<p><i>Only put in DB flights that are inside a circle</i></p>
365 470
 			<p>
366 471
 				<label for="latitude">Center latitude</label>
367
-				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" />
472
+				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) {
473
+	echo $globalDistanceIgnore['latitude'];
474
+}
475
+?>" />
368 476
 			</p>
369 477
 			<p>
370 478
 				<label for="longitude">Center longitude</label>
371
-				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" />
479
+				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) {
480
+	echo $globalDistanceIgnore['longitude'];
481
+}
482
+?>" />
372 483
 			</p>
373 484
 			<p>
374 485
 				<label for="Distance">Distance (in km)</label>
375
-				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" />
486
+				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) {
487
+	echo $globalDistanceIgnore['distance'];
488
+}
489
+?>" />
376 490
 			</p>
377 491
 		</fieldset>
378 492
 		<fieldset id="sourceloc">
@@ -495,11 +609,17 @@  discard block
 block discarded – undo
495 609
 			<div id="flightaware_data">
496 610
 				<p>
497 611
 					<label for="flightawareusername">FlightAware username</label>
498
-					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
612
+					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
613
+	print $globalFlightAwareUsername;
614
+}
615
+?>" />
499 616
 				</p>
500 617
 				<p>
501 618
 					<label for="flightawarepassword">FlightAware password/API key</label>
502
-					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
619
+					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
620
+	print $globalFlightAwarePassword;
621
+}
622
+?>" />
503 623
 				</p>
504 624
 			</div>
505 625
 -->
@@ -541,7 +661,10 @@  discard block
 block discarded – undo
541 661
 								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
542 662
 								?>
543 663
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
544
-								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
664
+								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) {
665
+	print $source['port'];
666
+}
667
+?>" /></td>
545 668
 								<?php
546 669
 								    } else {
547 670
 									$hostport = explode(':',$source['host']);
@@ -560,37 +683,118 @@  discard block
 block discarded – undo
560 683
 								?>
561 684
 								<td>
562 685
 									<select name="format[]" id="format">
563
-										<option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option>
564
-										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option>
565
-										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option>
566
-										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option>
567
-										<option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') print 'selected'; ?>>Dump1090 aircraft.json</option>
568
-										<option value="planefinderclient" <?php if (isset($source['format']) && $source['format'] == 'planefinderclient') print 'selected'; ?>>Planefinder client</option>
569
-										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option>
570
-										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option>
571
-										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option>
572
-										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option>
573
-										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option>
574
-										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option>
575
-										<option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>Virtual Airline Operations System (VAOS)</option>
576
-										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option>
577
-										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option>
578
-										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option>
579
-										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option>
580
-										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
581
-										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option>
582
-										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option>
583
-										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') print 'selected'; ?>>AirWhere website</option>
584
-										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') print 'selected'; ?>>HidnSeek Callback</option>
585
-										<option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') print 'selected'; ?>>Blitzortung</option>
586
-										<option value="sailaway" <?php if (isset($source['format']) && $source['format'] == 'sailaway') print 'selected'; ?>>Sailaway</option>
686
+										<option value="auto" <?php if (!isset($source['format'])) {
687
+	print 'selected';
688
+}
689
+?>>Auto</option>
690
+										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') {
691
+	print 'selected';
692
+}
693
+?>>SBS</option>
694
+										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') {
695
+	print 'selected';
696
+}
697
+?>>TSV</option>
698
+										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') {
699
+	print 'selected';
700
+}
701
+?>>Raw</option>
702
+										<option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') {
703
+	print 'selected';
704
+}
705
+?>>Dump1090 aircraft.json</option>
706
+										<option value="planefinderclient" <?php if (isset($source['format']) && $source['format'] == 'planefinderclient') {
707
+	print 'selected';
708
+}
709
+?>>Planefinder client</option>
710
+										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') {
711
+	print 'selected';
712
+}
713
+?>>APRS</option>
714
+										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') {
715
+	print 'selected';
716
+}
717
+?>>Radarcape deltadb.txt</option>
718
+										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') {
719
+	print 'selected';
720
+}
721
+?>>Vatsim</option>
722
+										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') {
723
+	print 'selected';
724
+}
725
+?>>Virtual Radar Server AircraftList.json</option>
726
+										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') {
727
+	print 'selected';
728
+}
729
+?>>Virtual Radar Server TCP</option>
730
+										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
731
+	print 'selected';
732
+}
733
+?>>phpVMS</option>
734
+										<option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
735
+	print 'selected';
736
+}
737
+?>>Virtual Airline Operations System (VAOS)</option>
738
+										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') {
739
+	print 'selected';
740
+}
741
+?>>Virtual Airlines Manager</option>
742
+										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') {
743
+	print 'selected';
744
+}
745
+?>>IVAO</option>
746
+										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') {
747
+	print 'selected';
748
+}
749
+?>>FlightGear Multiplayer</option>
750
+										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') {
751
+	print 'selected';
752
+}
753
+?>>FlightGear Singleplayer</option>
754
+										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') {
755
+	print 'selected';
756
+}
757
+?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
758
+										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') {
759
+	print 'selected';
760
+}
761
+?>>ACARS SBS-3 over TCP</option>
762
+										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') {
763
+	print 'selected';
764
+}
765
+?>>NMEA AIS over TCP</option>
766
+										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') {
767
+	print 'selected';
768
+}
769
+?>>AirWhere website</option>
770
+										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') {
771
+	print 'selected';
772
+}
773
+?>>HidnSeek Callback</option>
774
+										<option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') {
775
+	print 'selected';
776
+}
777
+?>>Blitzortung</option>
778
+										<option value="sailaway" <?php if (isset($source['format']) && $source['format'] == 'sailaway') {
779
+	print 'selected';
780
+}
781
+?>>Sailaway</option>
587 782
 									</select>
588 783
 								</td>
589 784
 								<td>
590
-									<input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" />
785
+									<input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) {
786
+	print $source['name'];
787
+}
788
+?>" />
591 789
 								</td>
592
-								<td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) print 'checked'; ?> /></td>
593
-								<td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) print 'checked'; ?> /></td>
790
+								<td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) {
791
+	print 'checked';
792
+}
793
+?> /></td>
794
+								<td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) {
795
+	print 'checked';
796
+}
797
+?> /></td>
594 798
 								<td>
595 799
 									<select name="timezones[]" id="timezones">
596 800
 								<?php
@@ -600,7 +804,9 @@  discard block
 block discarded – undo
600 804
 											print '<option selected>'.$timezones.'</option>';
601 805
 										} elseif (!isset($source['timezone']) && $timezones == 'UTC') {
602 806
 											print '<option selected>'.$timezones.'</option>';
603
-										} else print '<option>'.$timezones.'</option>';
807
+										} else {
808
+											print '<option>'.$timezones.'</option>';
809
+										}
604 810
 									}
605 811
 								?>
606 812
 									</select>
@@ -654,7 +860,9 @@  discard block
 block discarded – undo
654 860
 									foreach($timezonelist as $timezones){
655 861
 										if ($timezones == 'UTC') {
656 862
 											print '<option selected>'.$timezones.'</option>';
657
-										} else print '<option>'.$timezones.'</option>';
863
+										} else {
864
+											print '<option>'.$timezones.'</option>';
865
+										}
658 866
 									}
659 867
 								?>
660 868
 									</select>
@@ -679,11 +887,17 @@  discard block
 block discarded – undo
679 887
 					<p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p>
680 888
 					<p>
681 889
 						<label for="acarshost">ACARS UDP host</label>
682
-						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" />
890
+						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) {
891
+	print $globalACARSHost;
892
+}
893
+?>" />
683 894
 					</p>
684 895
 					<p>
685 896
 						<label for="acarsport">ACARS UDP port</label>
686
-						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" />
897
+						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) {
898
+	print $globalACARSPort;
899
+}
900
+?>" />
687 901
 					</p>
688 902
 				</fieldset>
689 903
 			</div>
@@ -709,17 +923,38 @@  discard block
 block discarded – undo
709 923
 				    <td><input type="url" name="newsurl[]" value="<?php print $feed; ?>"/></td>
710 924
 				    <td>
711 925
 					<select name="newslang[]">
712
-					    <option value="en"<?php if ($lng == 'en') print ' selected'; ?>>English</option>
713
-					    <option value="fr"<?php if ($lng == 'fr') print ' selected'; ?>>French</option>
926
+					    <option value="en"<?php if ($lng == 'en') {
927
+	print ' selected';
928
+}
929
+?>>English</option>
930
+					    <option value="fr"<?php if ($lng == 'fr') {
931
+	print ' selected';
932
+}
933
+?>>French</option>
714 934
 					</select>
715 935
 				    </td>
716 936
 				    <td>
717 937
 					<select name="newstype[]">
718
-					    <option value="global"<?php if ($type == 'global') print ' selected'; ?>>Global</option>
719
-					    <option value="aircraft"<?php if ($type == 'aircraft') print ' selected'; ?>>Aircraft</option>
720
-					    <option value="marine"<?php if ($type == 'marine') print ' selected'; ?>>Marine</option>
721
-					    <option value="tracker"<?php if ($type == 'tracker') print ' selected'; ?>>Tracker</option>
722
-					    <option value="satellite"<?php if ($type == 'Satellite') print ' selected'; ?>>Satellite</option>
938
+					    <option value="global"<?php if ($type == 'global') {
939
+	print ' selected';
940
+}
941
+?>>Global</option>
942
+					    <option value="aircraft"<?php if ($type == 'aircraft') {
943
+	print ' selected';
944
+}
945
+?>>Aircraft</option>
946
+					    <option value="marine"<?php if ($type == 'marine') {
947
+	print ' selected';
948
+}
949
+?>>Marine</option>
950
+					    <option value="tracker"<?php if ($type == 'tracker') {
951
+	print ' selected';
952
+}
953
+?>>Tracker</option>
954
+					    <option value="satellite"<?php if ($type == 'Satellite') {
955
+	print ' selected';
956
+}
957
+?>>Satellite</option>
723 958
 					</select>
724 959
 				    </td>
725 960
 				    <td><input type="button" value="Delete" onclick="deleteRowNews(this)" /> <input type="button" value="Add" onclick="insRowNews()" /></td>
@@ -861,13 +1096,19 @@  discard block
 block discarded – undo
861 1096
 			<div id="schedules_options">
862 1097
 				<p>
863 1098
 					<label for="britishairways">British Airways API Key</label>
864
-					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" />
1099
+					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) {
1100
+	print $globalBritishAirwaysKey;
1101
+}
1102
+?>" />
865 1103
 					<p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p>
866 1104
 				</p>
867 1105
 				<!--
868 1106
 				<p>
869 1107
 					<label for="transavia">Transavia Test API Consumer Key</label>
870
-					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" />
1108
+					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) {
1109
+	print $globalTransaviaKey;
1110
+}
1111
+?>" />
871 1112
 					<p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p>
872 1113
 				</p>
873 1114
 				-->
@@ -876,10 +1117,16 @@  discard block
 block discarded – undo
876 1117
 						<b>Lufthansa API Key</b>
877 1118
 						<p>
878 1119
 							<label for="lufthansakey">Key</label>
879
-							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" />
1120
+							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) {
1121
+	print $globalLufthansaKey['key'];
1122
+}
1123
+?>" />
880 1124
 						</p><p>
881 1125
 							<label for="lufthansasecret">Secret</label>
882
-							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" />
1126
+							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) {
1127
+	print $globalLufthansaKey['secret'];
1128
+}
1129
+?>" />
883 1130
 						</p>
884 1131
 					</div>
885 1132
 					<p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p>
@@ -889,11 +1136,17 @@  discard block
 block discarded – undo
889 1136
 						<b>FlightAware API Key</b>
890 1137
 						<p>
891 1138
 							<label for="flightawareusername">Username</label>
892
-							<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
1139
+							<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
1140
+	print $globalFlightAwareUsername;
1141
+}
1142
+?>" />
893 1143
 						</p>
894 1144
 						<p>
895 1145
 							<label for="flightawarepassword">API key</label>
896
-							<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
1146
+							<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
1147
+	print $globalFlightAwarePassword;
1148
+}
1149
+?>" />
897 1150
 						</p>
898 1151
 					</div>
899 1152
 					<p class="help-block">Register an account on <a href="https://www.flightaware.com/">https://www.flightaware.com/</a></p>
@@ -910,10 +1163,22 @@  discard block
 block discarded – undo
910 1163
 				<p>
911 1164
 					<label for="mapmatchingsource">Map Matching source</label>
912 1165
 					<select name="mapmatchingsource" id="mapmatchingsource">
913
-						<option value="fam" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'fam') || !isset($globalMatchingSource)) print 'selected="selected" '; ?>>FlightAirMap Map Matching</option>
914
-						<option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') print 'selected="selected" '; ?>>GraphHopper</option>
915
-						<option value="osmr" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') print 'selected="selected" '; ?>>OSMR</option>
916
-						<option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') print 'selected="selected" '; ?>>Mapbox</option>
1166
+						<option value="fam" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'fam') || !isset($globalMatchingSource)) {
1167
+	print 'selected="selected" ';
1168
+}
1169
+?>>FlightAirMap Map Matching</option>
1170
+						<option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') {
1171
+	print 'selected="selected" ';
1172
+}
1173
+?>>GraphHopper</option>
1174
+						<option value="osmr" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') {
1175
+	print 'selected="selected" ';
1176
+}
1177
+?>>OSMR</option>
1178
+						<option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') {
1179
+	print 'selected="selected" ';
1180
+}
1181
+?>>Mapbox</option>
917 1182
 					</select>
918 1183
 					<p class="help-block">Mapbox need the API Key defined in map section.</p>
919 1184
 					<p class="help-block">FlightAirMap Map Matching is free, without API key but limited to about 100 input points to keep fast results.</p>
@@ -921,7 +1186,10 @@  discard block
 block discarded – undo
921 1186
 				<br />
922 1187
 				<p>
923 1188
 					<label for="graphhopper">GraphHopper API Key</label>
924
-					<input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) print $globalGraphHopperKey; ?>" />
1189
+					<input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) {
1190
+	print $globalGraphHopperKey;
1191
+}
1192
+?>" />
925 1193
 					<p class="help-block">Register an account on <a href="https://www.graphhopper.com/">https://www.graphhopper.com/</a></p>
926 1194
 				</p>
927 1195
 			</div>
@@ -939,7 +1207,10 @@  discard block
 block discarded – undo
939 1207
 			</p>
940 1208
 			<p>
941 1209
 				<label for="notamsource">URL of your feed from notaminfo.com</label>
942
-				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" />
1210
+				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) {
1211
+	print $globalNOTAMSource;
1212
+}
1213
+?>" />
943 1214
 				<p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p>
944 1215
 			</p>
945 1216
 			<br />
@@ -955,14 +1226,20 @@  discard block
 block discarded – undo
955 1226
 			<div id="metarsrc">
956 1227
 				<p>
957 1228
 					<label for="metarsource">URL of your METAR source</label>
958
-					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" />
1229
+					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) {
1230
+	print $globalMETARurl;
1231
+}
1232
+?>" />
959 1233
 					<p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p>
960 1234
 				</p>
961 1235
 			</div>
962 1236
 			<br />
963 1237
 			<p>
964 1238
 				<label for="bitly">Bit.ly access token api (used in search page)</label>
965
-				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" />
1239
+				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) {
1240
+	print $globalBitlyAccessToken;
1241
+}
1242
+?>" />
966 1243
 			</p>
967 1244
 			<br />
968 1245
 			<p>
@@ -978,11 +1255,26 @@  discard block
 block discarded – undo
978 1255
 			<p>
979 1256
 				<label for="geoid_source">Geoid Source</label>
980 1257
 				<select name="geoid_source" id="geoid_source">
981
-					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') print ' selected="selected"'; ?>>EGM96 15' (2.1MB)</option>
982
-					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') print ' selected="selected"'; ?>>EGM96 5' (19MB)</option>
983
-					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') print ' selected="selected"'; ?>>EGM2008 5' (19MB)</option>
984
-					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') print ' selected="selected"'; ?>>EGM2008 2.5' (75MB)</option>
985
-					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') print ' selected="selected"'; ?>>EGM2008 1' (470MB)</option>
1258
+					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') {
1259
+	print ' selected="selected"';
1260
+}
1261
+?>>EGM96 15' (2.1MB)</option>
1262
+					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') {
1263
+	print ' selected="selected"';
1264
+}
1265
+?>>EGM96 5' (19MB)</option>
1266
+					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') {
1267
+	print ' selected="selected"';
1268
+}
1269
+?>>EGM2008 5' (19MB)</option>
1270
+					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') {
1271
+	print ' selected="selected"';
1272
+}
1273
+?>>EGM2008 2.5' (75MB)</option>
1274
+					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') {
1275
+	print ' selected="selected"';
1276
+}
1277
+?>>EGM2008 1' (470MB)</option>
986 1278
 				</select>
987 1279
 				<p class="help-block">The geoid is approximated by an "earth gravity model" (EGM).</p>
988 1280
 			</p>
@@ -1004,7 +1296,12 @@  discard block
 block discarded – undo
1004 1296
 			</p>
1005 1297
 			<p>
1006 1298
 				<label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label>
1007
-				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '1'; ?>" />
1299
+				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) {
1300
+	print $globalArchiveMonths;
1301
+} else {
1302
+	echo '1';
1303
+}
1304
+?>" />
1008 1305
 				<p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p>
1009 1306
 			</p>
1010 1307
 			<p>
@@ -1014,12 +1311,22 @@  discard block
 block discarded – undo
1014 1311
 			</p>
1015 1312
 			<p>
1016 1313
 				<label for="archivekeepmonths">Keep flights data for xx months in archive</label>
1017
-				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '1'; ?>" />
1314
+				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) {
1315
+	print $globalArchiveKeepMonths;
1316
+} else {
1317
+	echo '1';
1318
+}
1319
+?>" />
1018 1320
 				<p class="help-block">0 to disable</p>
1019 1321
 			</p>
1020 1322
 			<p>
1021 1323
 				<label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label>
1022
-				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '1'; ?>" />
1324
+				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) {
1325
+	print $globalArchiveKeepTrackMonths;
1326
+} else {
1327
+	echo '1';
1328
+}
1329
+?>" />
1023 1330
 				<p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p>
1024 1331
 			</p>
1025 1332
 			<br />
@@ -1029,7 +1336,12 @@  discard block
 block discarded – undo
1029 1336
 				<p class="help-block">Uncheck if the script is running as cron job. You should always run it as daemon when it's possible.</p>
1030 1337
 				<div id="cronends"> 
1031 1338
 					<label for="cronend">Run script for xx seconds</label>
1032
-					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" />
1339
+					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) {
1340
+	print $globalCronEnd;
1341
+} else {
1342
+	print '0';
1343
+}
1344
+?>" />
1033 1345
 					<p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p>
1034 1346
 				</div>
1035 1347
 			</p>
@@ -1082,20 +1394,40 @@  discard block
 block discarded – undo
1082 1394
 			<br />
1083 1395
 			<p>
1084 1396
 				<label for="refresh">Show flights detected since xxx seconds</label>
1085
-				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" />
1397
+				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) {
1398
+	echo $globalLiveInterval;
1399
+} else {
1400
+	echo '200';
1401
+}
1402
+?>" />
1086 1403
 			</p>
1087 1404
 			<p>
1088 1405
 				<label for="maprefresh">Live map refresh (in seconds)</label>
1089
-				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" />
1406
+				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) {
1407
+	echo $globalMapRefresh;
1408
+} else {
1409
+	echo '30';
1410
+}
1411
+?>" />
1090 1412
 			</p>
1091 1413
 			<p>
1092 1414
 				<label for="mapidle">Map idle timeout (in minutes)</label>
1093
-				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" />
1415
+				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) {
1416
+	echo $globalMapIdleTimeout;
1417
+} else {
1418
+	echo '30';
1419
+}
1420
+?>" />
1094 1421
 				<p class="help-block">0 to disable</p>
1095 1422
 			</p>
1096 1423
 			<p>
1097 1424
 				<label for="minfetch">HTTP/file source fetch every xxx seconds</label>
1098
-				<input type="number" name="minfetch" id="minfetch" value="<?php if (isset($globalMinFetch)) echo $globalMinFetch; else echo '20'; ?>" />
1425
+				<input type="number" name="minfetch" id="minfetch" value="<?php if (isset($globalMinFetch)) {
1426
+	echo $globalMinFetch;
1427
+} else {
1428
+	echo '20';
1429
+}
1430
+?>" />
1099 1431
 			</p>
1100 1432
 			<p>
1101 1433
 				<label for="bbox">Only display flights that we can see on screen (bounding box)</label>
@@ -1109,12 +1441,20 @@  discard block
 block discarded – undo
1109 1441
 			<br />
1110 1442
 			<p>
1111 1443
 				<label for="closestmindist">Distance to airport set as arrival (in km)</label>
1112
-				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" />
1444
+				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) {
1445
+	echo $globalClosestMinDist;
1446
+} else {
1447
+	echo '50';
1448
+}
1449
+?>" />
1113 1450
 			</p>
1114 1451
 			<br />
1115 1452
 			<p>
1116 1453
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
1117
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
1454
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) {
1455
+	echo $globalAircraftSize;
1456
+}
1457
+?>" />
1118 1458
 			</p>
1119 1459
 			<br />
1120 1460
 			<p>
@@ -1133,7 +1473,12 @@  discard block
 block discarded – undo
1133 1473
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
1134 1474
 			?>
1135 1475
 				<label for="aircrafticoncolor">Color of aircraft icon on map</label>
1136
-				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />
1476
+				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) {
1477
+	echo $globalAircraftIconColor;
1478
+} else {
1479
+	echo '1a3151';
1480
+}
1481
+?>" />
1137 1482
 			<?php
1138 1483
 				if (!is_writable('../cache')) {
1139 1484
 			?>
@@ -1151,14 +1496,27 @@  discard block
 block discarded – undo
1151 1496
 			<p>
1152 1497
 				<label for="airportzoom">Zoom level minimum to see airports icons</label>
1153 1498
 				<div class="range">
1154
-					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" />
1155
-					<output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output>
1499
+					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) {
1500
+	echo $globalAirportZoom;
1501
+} else {
1502
+	echo '7';
1503
+}
1504
+?>" />
1505
+					<output id="range"><?php if (isset($globalAirportZoom)) {
1506
+	echo $globalAirportZoom;
1507
+} else {
1508
+	echo '7';
1509
+}
1510
+?></output>
1156 1511
 				</div>
1157 1512
 			</p>
1158 1513
 			<br />
1159 1514
 			<p>
1160 1515
 				<label for="customcss">Custom CSS web path</label>
1161
-				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) echo $globalCustomCSS; ?>" />
1516
+				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) {
1517
+	echo $globalCustomCSS;
1518
+}
1519
+?>" />
1162 1520
 			</p>
1163 1521
 		</fieldset>
1164 1522
 		<input type="submit" name="submit" value="Create/Update database & write setup" />
@@ -1185,8 +1543,12 @@  discard block
 block discarded – undo
1185 1543
 	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
1186 1544
 	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
1187 1545
 
1188
-	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
1189
-	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
1546
+	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) {
1547
+		$error .= 'Mysql driver for PDO must be loaded';
1548
+	}
1549
+	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) {
1550
+		$error .= 'PosgreSQL driver for PDO must be loaded';
1551
+	}
1190 1552
 	
1191 1553
 	$_SESSION['database_root'] = $dbroot;
1192 1554
 	$_SESSION['database_rootpass'] = $dbrootpass;
@@ -1254,15 +1616,23 @@  discard block
 block discarded – undo
1254 1616
 	$source_city = $_POST['source_city'];
1255 1617
 	$source_country = $_POST['source_country'];
1256 1618
 	$source_ref = $_POST['source_ref'];
1257
-	if (isset($source_id)) $source_id = $_POST['source_id'];
1258
-	else $source_id = array();
1619
+	if (isset($source_id)) {
1620
+		$source_id = $_POST['source_id'];
1621
+	} else {
1622
+		$source_id = array();
1623
+	}
1259 1624
 	
1260 1625
 	$sources = array();
1261 1626
 	foreach ($source_name as $keys => $name) {
1262
-	    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]);
1263
-	    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]);
1627
+	    if (isset($source_id[$keys])) {
1628
+	    	$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]);
1629
+	    } else {
1630
+	    	$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]);
1631
+	    }
1632
+	}
1633
+	if (count($sources) > 0) {
1634
+		$_SESSION['sources'] = $sources;
1264 1635
 	}
1265
-	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1266 1636
 
1267 1637
 	$newsurl = $_POST['newsurl'];
1268 1638
 	$newslng = $_POST['newslang'];
@@ -1275,7 +1645,9 @@  discard block
 block discarded – undo
1275 1645
 		$lng = $newslng[$newskey];
1276 1646
 		if (isset($newsfeeds[$type][$lng])) {
1277 1647
 		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1278
-		} else $newsfeeds[$type][$lng] = array($url);
1648
+		} else {
1649
+			$newsfeeds[$type][$lng] = array($url);
1650
+		}
1279 1651
 	    }
1280 1652
 	}
1281 1653
 	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds));
@@ -1300,17 +1672,29 @@  discard block
 block discarded – undo
1300 1672
 	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1301 1673
 
1302 1674
 	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1303
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1304
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1675
+	if ($globalaircraft == 'aircraft') {
1676
+		$settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1677
+	} else {
1678
+		$settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1679
+	}
1305 1680
 	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1306
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1307
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1681
+	if ($globaltracker == 'tracker') {
1682
+		$settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1683
+	} else {
1684
+		$settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1685
+	}
1308 1686
 	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1309
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1310
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1687
+	if ($globalmarine == 'marine') {
1688
+		$settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1689
+	} else {
1690
+		$settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1691
+	}
1311 1692
 	$globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING);
1312
-	if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1313
-	else $settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1693
+	if ($globalsatellite == 'satellite') {
1694
+		$settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1695
+	} else {
1696
+		$settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1697
+	}
1314 1698
 
1315 1699
 /*	
1316 1700
 	$globalSBS1Hosts = array();
@@ -1332,23 +1716,37 @@  discard block
 block discarded – undo
1332 1716
 	$name = $_POST['name'];
1333 1717
 	$format = $_POST['format'];
1334 1718
 	$timezones = $_POST['timezones'];
1335
-	if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats'];
1336
-	else $sourcestats = array();
1337
-	if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive'];
1338
-	else $noarchive = array();
1719
+	if (isset($_POST['sourcestats'])) {
1720
+		$sourcestats = $_POST['sourcestats'];
1721
+	} else {
1722
+		$sourcestats = array();
1723
+	}
1724
+	if (isset($_POST['noarchive'])) {
1725
+		$noarchive = $_POST['noarchive'];
1726
+	} else {
1727
+		$noarchive = array();
1728
+	}
1339 1729
 	$gSources = array();
1340 1730
 	$forcepilots = false;
1341 1731
 	foreach ($host as $key => $h) {
1342
-		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE';
1343
-		else $cov = 'FALSE';
1344
-		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1345
-		else $arch = 'FALSE';
1732
+		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) {
1733
+			$cov = 'TRUE';
1734
+		} else {
1735
+			$cov = 'FALSE';
1736
+		}
1737
+		if (isset($noarchive[$key]) && $noarchive[$key] == 1) {
1738
+			$arch = 'TRUE';
1739
+		} else {
1740
+			$arch = 'FALSE';
1741
+		}
1346 1742
 		if (strpos($format[$key],'_callback')) {
1347 1743
 			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE');
1348 1744
 		} elseif ($h != '' || $name[$key] != '') {
1349 1745
 			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE');
1350 1746
 		}
1351
-		if ($format[$key] == 'airwhere') $forcepilots = true;
1747
+		if ($format[$key] == 'airwhere') {
1748
+			$forcepilots = true;
1749
+		}
1352 1750
 	}
1353 1751
 	$settings = array_merge($settings,array('globalSources' => $gSources));
1354 1752
 
@@ -1379,7 +1777,9 @@  discard block
 block discarded – undo
1379 1777
 	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1380 1778
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1381 1779
 		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1382
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1780
+	} else {
1781
+		$settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1782
+	}
1383 1783
 
1384 1784
 	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1385 1785
 	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
@@ -1420,7 +1820,9 @@  discard block
 block discarded – undo
1420 1820
 
1421 1821
 	// Create in settings.php keys not yet configurable if not already here
1422 1822
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1423
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1823
+	if (!isset($globalDebug)) {
1824
+		$settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1825
+	}
1424 1826
 
1425 1827
 	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1426 1828
 	if ($resetyearstats == 'resetyearstats') {
@@ -1463,37 +1865,56 @@  discard block
 block discarded – undo
1463 1865
 	}
1464 1866
 */
1465 1867
 	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1466
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1467
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1468
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1469
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1868
+	if ($globalsbs == 'sbs') {
1869
+		$settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1870
+	} else {
1871
+		$settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1872
+	}
1873
+	if ($globalaprs == 'aprs') {
1874
+		$settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1875
+	} else {
1876
+		$settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1877
+	}
1470 1878
 	$va = false;
1471 1879
 	if ($globalivao == 'ivao') {
1472 1880
 		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1473 1881
 		$va = true;
1474
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1882
+	} else {
1883
+		$settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1884
+	}
1475 1885
 	if ($globalvatsim == 'vatsim') {
1476 1886
 		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1477 1887
 		$va = true;
1478
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1888
+	} else {
1889
+		$settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1890
+	}
1479 1891
 	if ($globalphpvms == 'phpvms') {
1480 1892
 		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1481 1893
 		$va = true;
1482
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1894
+	} else {
1895
+		$settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1896
+	}
1483 1897
 	if ($globalvam == 'vam') {
1484 1898
 		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1485 1899
 		$va = true;
1486
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1900
+	} else {
1901
+		$settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1902
+	}
1487 1903
 	if ($va) {
1488 1904
 		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1489
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1905
+	} else {
1906
+		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1907
+	}
1490 1908
 	if ($globalva == 'va' || $va) {
1491 1909
 		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1492 1910
 		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1493 1911
 	} else {
1494 1912
 		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1495
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1496
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1913
+		if ($forcepilots) {
1914
+			$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1915
+		} else {
1916
+			$settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1917
+		}
1497 1918
 	}
1498 1919
 	if ($globalvm == 'vm') {
1499 1920
 		$settings = array_merge($settings,array('globalVM' => 'TRUE'));
@@ -1732,7 +2153,9 @@  discard block
 block discarded – undo
1732 2153
 	$graphhopper = filter_input(INPUT_POST,'graphhopper',FILTER_SANITIZE_STRING);
1733 2154
 	$settings = array_merge($settings,array('globalGraphHopperKey' => $graphhopper));
1734 2155
 
1735
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
2156
+	if (!isset($globalTransaction)) {
2157
+		$settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
2158
+	}
1736 2159
 
1737 2160
 	// Set some defaults values...
1738 2161
 	if (!isset($globalAircraftImageSources)) {
@@ -1747,15 +2170,23 @@  discard block
 block discarded – undo
1747 2170
 
1748 2171
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1749 2172
 
1750
-	if ($error == '') settings::modify_settings($settings);
1751
-	if ($error == '') settings::comment_settings($settings_comment);
2173
+	if ($error == '') {
2174
+		settings::modify_settings($settings);
2175
+	}
2176
+	if ($error == '') {
2177
+		settings::comment_settings($settings_comment);
2178
+	}
1752 2179
 	if ($error != '') {
1753 2180
 		print '<div class="info column">'.$error.'</div>';
1754 2181
 		require('../footer.php');
1755 2182
 		exit;
1756 2183
 	} else {
1757
-		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1;
1758
-		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1;
2184
+		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') {
2185
+			$_SESSION['waypoints'] = 1;
2186
+		}
2187
+		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') {
2188
+			$_SESSION['owner'] = 1;
2189
+		}
1759 2190
 		if (isset($_POST['createdb'])) {
1760 2191
 			$_SESSION['install'] = 'database_create';
1761 2192
 		} else {
@@ -1792,10 +2223,18 @@  discard block
 block discarded – undo
1792 2223
 	$popw = false;
1793 2224
 	foreach ($_SESSION['done'] as $done) {
1794 2225
 	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1795
-	    if ($done == 'Create database') $pop = true;
1796
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1797
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1798
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
2226
+	    if ($done == 'Create database') {
2227
+	    	$pop = true;
2228
+	    }
2229
+	    if ($_SESSION['install'] == 'database_create') {
2230
+	    	$pop = true;
2231
+	    }
2232
+	    if ($_SESSION['install'] == 'database_import') {
2233
+	    	$popi = true;
2234
+	    }
2235
+	    if ($_SESSION['install'] == 'waypoints') {
2236
+	    	$popw = true;
2237
+	    }
1799 2238
 	}
1800 2239
 	if ($pop) {
1801 2240
 	    sleep(5);
@@ -1806,7 +2245,9 @@  discard block
 block discarded – undo
1806 2245
 	} else if ($popw) {
1807 2246
 	    sleep(5);
1808 2247
 	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1809
-	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
2248
+	} else {
2249
+		print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
2250
+	}
1810 2251
 	print '</div></ul>';
1811 2252
 	print '<div id="error"></div>';
1812 2253
 /*	foreach ($_SESSION['done'] as $done) {
Please login to merge, or discard this patch.