Completed
Push — master ( 237d29...caebd9 )
by Yannick
20:41
created
require/class.Weather.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,12 +63,16 @@  discard block
 block discarded – undo
63 63
 	
64 64
 	public function openweathermap($latitude,$longitude) {
65 65
 		global $globalOpenWeatherMapKey;
66
-		if ($globalOpenWeatherMapKey == '') return array();
66
+		if ($globalOpenWeatherMapKey == '') {
67
+			return array();
68
+		}
67 69
 		$Common = new Common();
68 70
 		$url = 'http://api.openweathermap.org/data/2.5/weather?lat='.$latitude.'&lon='.$longitude.'&units=metric&appid='.$globalOpenWeatherMapKey;
69 71
 		//echo $url."\n";
70 72
 		$weatherdata = json_decode($Common->getData($url),true);
71
-		if (!isset($weatherdata['main']['temp']) || !isset($weatherdata['weather'][0]['id'])) return array('clouds' => array(),'rain' => array());
73
+		if (!isset($weatherdata['main']['temp']) || !isset($weatherdata['weather'][0]['id'])) {
74
+			return array('clouds' => array(),'rain' => array());
75
+		}
72 76
 		$dew = $weatherdata['main']['temp'] - ((100-$weatherdata['main']['humidity'])/5);
73 77
 		$cumulus_base = 122.0 * ($weatherdata['main']['temp'] - $dew);
74 78
 		$stratus_base = 100.0 * (100.0 * $weatherdata['main']['humidity'])*0.3048;
@@ -104,7 +108,9 @@  discard block
 block discarded – undo
104 108
 	
105 109
 	public function nomad_wind($hour = '') {
106 110
 		global $globalWindsPath;
107
-		if ($hour == '') $hour = date('G');
111
+		if ($hour == '') {
112
+			$hour = date('G');
113
+		}
108 114
 		if (isset($globalWindsPath) && $globalWindsPath != '') {
109 115
 			$grib2json = $globalWindsPath['grib2json'];
110 116
 			$windpathsrc = $globalWindsPath['source'];
@@ -142,13 +148,17 @@  discard block
 block discarded – undo
142 148
 			system($grib2json.' --data --output '.$windpathdest.' --names --compact '.$windpathsrc);
143 149
 		} else {
144 150
 			// if not try previous run
145
-			if ($hour == date('G')) $this->nomad_wind(date('G')-6);
151
+			if ($hour == date('G')) {
152
+				$this->nomad_wind(date('G')-6);
153
+			}
146 154
 		}
147 155
 	}
148 156
 
149 157
 	public function oscar_wave() {
150 158
 		global $globalWavesPath, $globalPODACCuser,$globalPODACCpass;
151
-		if ($globalPODACCuser == '' && $globalPODACCpass == '') return;
159
+		if ($globalPODACCuser == '' && $globalPODACCpass == '') {
160
+			return;
161
+		}
152 162
 		if (isset($globalWavesPath) && $globalWavesPath != '') {
153 163
 			$grib2json = $globalWavesPath['grib2json'];
154 164
 			$wavepathsrc = $globalWavesPath['source'];
Please login to merge, or discard this patch.
require/class.Common.php 1 patch
Braces   +123 added lines, -53 removed lines patch added patch discarded remove patch
@@ -36,7 +36,9 @@  discard block
 block discarded – undo
36 36
 		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
37 37
 		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
38 38
 		curl_setopt($ch, CURLINFO_HEADER_OUT, true); 
39
-		if ($getheaders) curl_setopt($ch, CURLOPT_HEADER, 1); 
39
+		if ($getheaders) {
40
+			curl_setopt($ch, CURLOPT_HEADER, 1);
41
+		}
40 42
 		curl_setopt($ch,CURLOPT_ENCODING , "gzip");
41 43
 		//curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5');
42 44
 //		curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0');
@@ -45,8 +47,11 @@  discard block
 block discarded – undo
45 47
 		} else {
46 48
 			curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
47 49
 		}
48
-		if ($timeout == '') curl_setopt($ch, CURLOPT_TIMEOUT, 10); 
49
-		else curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); 
50
+		if ($timeout == '') {
51
+			curl_setopt($ch, CURLOPT_TIMEOUT, 10);
52
+		} else {
53
+			curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
54
+		}
50 55
 		//curl_setopt($ch, CURLOPT_HEADERFUNCTION, array('Common',"curlResponseHeaderCallback"));
51 56
 		if ($type == 'post') {
52 57
 			curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
@@ -59,7 +64,9 @@  discard block
 block discarded – undo
59 64
 			} else {
60 65
 				curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
61 66
 			}
62
-		} elseif ($type != 'get' && $type != '') curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $type);
67
+		} elseif ($type != 'get' && $type != '') {
68
+			curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $type);
69
+		}
63 70
 		if ($headers != '') {
64 71
 			curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
65 72
 		}
@@ -104,8 +111,9 @@  discard block
 block discarded – undo
104 111
 	private function curlResponseHeaderCallback($ch, $headerLine) {
105 112
 		global $curl_cookies;
106 113
 		$curl_cookies = array();
107
-		if (preg_match('/^Set-Cookie:\s*([^;]*)/mi', $headerLine, $cookie) == 1)
108
-			$curl_cookies[] = $cookie;
114
+		if (preg_match('/^Set-Cookie:\s*([^;]*)/mi', $headerLine, $cookie) == 1) {
115
+					$curl_cookies[] = $cookie;
116
+		}
109 117
 		return strlen($headerLine); // Needed by curl
110 118
 	}
111 119
 
@@ -118,7 +126,9 @@  discard block
 block discarded – undo
118 126
 		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
119 127
 		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
120 128
 		curl_setopt($ch, CURLOPT_COOKIEFILE, '');
121
-		if ($referer != '') curl_setopt($ch, CURLOPT_REFERER, $referer);
129
+		if ($referer != '') {
130
+			curl_setopt($ch, CURLOPT_REFERER, $referer);
131
+		}
122 132
 		if (isset($globalForceIPv4) && $globalForceIPv4) {
123 133
 			if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')){
124 134
 				curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
@@ -133,7 +143,9 @@  discard block
 block discarded – undo
133 143
 		curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5');
134 144
 		curl_setopt($ch, CURLOPT_FILE, $fp);
135 145
 		curl_exec($ch);
136
-		if (curl_errno($ch) && $globalDebug) echo 'Download error: '.curl_error($ch);
146
+		if (curl_errno($ch) && $globalDebug) {
147
+			echo 'Download error: '.curl_error($ch);
148
+		}
137 149
 		curl_close($ch);
138 150
 		fclose($fp);
139 151
 	}
@@ -141,12 +153,16 @@  discard block
 block discarded – undo
141 153
 	public static function gunzip($in_file,$out_file_name = '') {
142 154
 		//echo $in_file.' -> '.$out_file_name."\n";
143 155
 		$buffer_size = 4096; // read 4kb at a time
144
-		if ($out_file_name == '') $out_file_name = str_replace('.gz', '', $in_file); 
156
+		if ($out_file_name == '') {
157
+			$out_file_name = str_replace('.gz', '', $in_file);
158
+		}
145 159
 		if ($in_file != '' && file_exists($in_file)) {
146 160
 			// PHP version of Ubuntu use gzopen64 instead of gzopen
147
-			if (function_exists('gzopen')) $file = gzopen($in_file,'rb');
148
-			elseif (function_exists('gzopen64')) $file = gzopen64($in_file,'rb');
149
-			else {
161
+			if (function_exists('gzopen')) {
162
+				$file = gzopen($in_file,'rb');
163
+			} elseif (function_exists('gzopen64')) {
164
+				$file = gzopen64($in_file,'rb');
165
+			} else {
150 166
 				echo 'gzopen not available';
151 167
 				die;
152 168
 			}
@@ -162,11 +178,14 @@  discard block
 block discarded – undo
162 178
 	public static function bunzip2($in_file,$out_file_name = '') {
163 179
 		//echo $in_file.' -> '.$out_file_name."\n";
164 180
 		$buffer_size = 4096; // read 4kb at a time
165
-		if ($out_file_name == '') $out_file_name = str_replace('.bz2', '', $in_file); 
181
+		if ($out_file_name == '') {
182
+			$out_file_name = str_replace('.bz2', '', $in_file);
183
+		}
166 184
 		if ($in_file != '' && file_exists($in_file)) {
167 185
 			// PHP version of Ubuntu use gzopen64 instead of gzopen
168
-			if (function_exists('bzopen')) $file = bzopen($in_file,'rb');
169
-			else {
186
+			if (function_exists('bzopen')) {
187
+				$file = bzopen($in_file,'rb');
188
+			} else {
170 189
 				echo 'bzopen not available';
171 190
 				die;
172 191
 			}
@@ -185,10 +204,16 @@  discard block
 block discarded – undo
185 204
 	* @return array array of the tables in HTML page
186 205
 	*/
187 206
 	public function table2array($data) {
188
-		if (!is_string($data)) return array();
189
-		if ($data == '') return array();
207
+		if (!is_string($data)) {
208
+			return array();
209
+		}
210
+		if ($data == '') {
211
+			return array();
212
+		}
190 213
 		$html = str_get_html($data);
191
-		if ($html === false) return array();
214
+		if ($html === false) {
215
+			return array();
216
+		}
192 217
 		$tabledata=array();
193 218
 		foreach($html->find('tr') as $element)
194 219
 		{
@@ -223,7 +248,9 @@  discard block
 block discarded – undo
223 248
 	*/
224 249
 	public function text2array($data) {
225 250
 		$html = str_get_html($data);
226
-		if ($html === false) return array();
251
+		if ($html === false) {
252
+			return array();
253
+		}
227 254
 		$tabledata=array();
228 255
 		foreach($html->find('p') as $element)
229 256
 		{
@@ -244,7 +271,9 @@  discard block
 block discarded – undo
244 271
 	* @return Float Distance in $unit
245 272
 	*/
246 273
 	public function distance($lat, $lon, $latc, $lonc, $unit = 'km') {
247
-		if ($lat == $latc && $lon == $lonc) return 0;
274
+		if ($lat == $latc && $lon == $lonc) {
275
+			return 0;
276
+		}
248 277
 		$dist = rad2deg(acos(sin(deg2rad(floatval($lat)))*sin(deg2rad(floatval($latc)))+ cos(deg2rad(floatval($lat)))*cos(deg2rad(floatval($latc)))*cos(deg2rad(floatval($lon)-floatval($lonc)))))*60*1.1515;
249 278
 		if ($unit == "km") {
250 279
 			return round($dist * 1.609344);
@@ -290,7 +319,9 @@  discard block
 block discarded – undo
290 319
 		$dX = $latc - $lat;
291 320
 		$dY = $lonc - $lon;
292 321
 		$azimuth = rad2deg(atan2($dY,$dX));
293
-		if ($azimuth < 0) return $azimuth+360;
322
+		if ($azimuth < 0) {
323
+			return $azimuth+360;
324
+		}
294 325
 		return $azimuth;
295 326
 	}
296 327
 	
@@ -304,10 +335,16 @@  discard block
 block discarded – undo
304 335
 	public function withinThreshold ($timeDifference, $distance) {
305 336
 		$x = abs($timeDifference);
306 337
 		$d = abs($distance);
307
-		if ($x == 0 || $d == 0) return true;
338
+		if ($x == 0 || $d == 0) {
339
+			return true;
340
+		}
308 341
 		// may be due to Internet jitter; distance is realistic
309
-		if ($x < 0.7 && $d < 2000) return true;
310
-		else return $d/$x < 1500*0.27778; // 1500 km/h max
342
+		if ($x < 0.7 && $d < 2000) {
343
+			return true;
344
+		} else {
345
+			return $d/$x < 1500*0.27778;
346
+		}
347
+		// 1500 km/h max
311 348
 	}
312 349
 
313 350
 
@@ -359,11 +396,17 @@  discard block
 block discarded – undo
359 396
 	
360 397
 	public function convertDM($coord,$latlong) {
361 398
 		if ($latlong == 'latitude') {
362
-			if ($coord < 0) $NSEW = 'S';
363
-			else $NSEW = 'N';
399
+			if ($coord < 0) {
400
+				$NSEW = 'S';
401
+			} else {
402
+				$NSEW = 'N';
403
+			}
364 404
 		} else {
365
-			if ($coord < 0) $NSEW = 'W';
366
-			else $NSEW = 'E';
405
+			if ($coord < 0) {
406
+				$NSEW = 'W';
407
+			} else {
408
+				$NSEW = 'E';
409
+			}
367 410
 		}
368 411
 		$coord = abs($coord);
369 412
 		$deg = floor($coord);
@@ -373,11 +416,17 @@  discard block
 block discarded – undo
373 416
 	}
374 417
 	public function convertDMS($coord,$latlong) {
375 418
 		if ($latlong == 'latitude') {
376
-			if ($coord < 0) $NSEW = 'S';
377
-			else $NSEW = 'N';
419
+			if ($coord < 0) {
420
+				$NSEW = 'S';
421
+			} else {
422
+				$NSEW = 'N';
423
+			}
378 424
 		} else {
379
-			if ($coord < 0) $NSEW = 'W';
380
-			else $NSEW = 'E';
425
+			if ($coord < 0) {
426
+				$NSEW = 'W';
427
+			} else {
428
+				$NSEW = 'E';
429
+			}
381 430
 		}
382 431
 		$coord = abs($coord);
383 432
 		$deg = floor($coord);
@@ -421,7 +470,9 @@  discard block
 block discarded – undo
421 470
 	public function hex2str($hex) {
422 471
 		$str = '';
423 472
 		$hexln = strlen($hex);
424
-		for($i=0;$i<$hexln;$i+=2) $str .= chr(hexdec(substr($hex,$i,2)));
473
+		for($i=0;$i<$hexln;$i+=2) {
474
+			$str .= chr(hexdec(substr($hex,$i,2)));
475
+		}
425 476
 		return $str;
426 477
 	}
427 478
 	
@@ -458,8 +509,11 @@  discard block
 block discarded – undo
458 509
 		$b = $lat2 - $lat1;
459 510
 		$c = -($a*$lat1+$b*$lon1);
460 511
 		$d = $a*$lat3+$b*$lon3+$c;
461
-		if ($d > -$approx && $d < $approx) return true;
462
-		else return false;
512
+		if ($d > -$approx && $d < $approx) {
513
+			return true;
514
+		} else {
515
+			return false;
516
+		}
463 517
 	}
464 518
 	
465 519
 	public function array_merge_noappend() {
@@ -518,7 +572,9 @@  discard block
 block discarded – undo
518 572
 			return $result;
519 573
 		}
520 574
 		$handle = @opendir('./locale');
521
-		if ($handle === false) return $result;
575
+		if ($handle === false) {
576
+			return $result;
577
+		}
522 578
 		while (false !== ($file = readdir($handle))) {
523 579
 			$path = './locale'.'/'.$file.'/LC_MESSAGES/fam.mo';
524 580
 			if ($file != "." && $file != ".." && @file_exists($path)) {
@@ -589,8 +645,9 @@  discard block
 block discarded – undo
589 645
 		$error = false; 
590 646
 		if ($fp_out = gzopen($dest, $mode)) { 
591 647
 			if ($fp_in = fopen($source,'rb')) { 
592
-				while (!feof($fp_in)) 
593
-					gzwrite($fp_out, fread($fp_in, 1024 * 512)); 
648
+				while (!feof($fp_in)) {
649
+									gzwrite($fp_out, fread($fp_in, 1024 * 512));
650
+				}
594 651
 				fclose($fp_in); 
595 652
 			} else {
596 653
 				$error = true; 
@@ -599,14 +656,17 @@  discard block
 block discarded – undo
599 656
 		} else {
600 657
 			$error = true; 
601 658
 		}
602
-		if ($error)
603
-			return false; 
604
-		else
605
-			return $dest; 
659
+		if ($error) {
660
+					return false;
661
+		} else {
662
+					return $dest;
663
+		}
606 664
 	} 
607 665
 	
608 666
 	public function remove_accents($string) {
609
-		if ( !preg_match('/[\x80-\xff]/', $string) ) return $string;
667
+		if ( !preg_match('/[\x80-\xff]/', $string) ) {
668
+			return $string;
669
+		}
610 670
 		$chars = array(
611 671
 		    // Decompositions for Latin-1 Supplement
612 672
 		    chr(195).chr(128) => 'A', chr(195).chr(129) => 'A',
@@ -730,7 +790,9 @@  discard block
 block discarded – undo
730 790
 		$ip = gethostbyname($host);
731 791
 		$s = socket_create(AF_INET, SOCK_STREAM, 0);
732 792
 		$r = @socket_connect($s, $ip, $port);
733
-		if (!socket_set_nonblock($s)) echo "Unable to set nonblock on socket\n";
793
+		if (!socket_set_nonblock($s)) {
794
+			echo "Unable to set nonblock on socket\n";
795
+		}
734 796
 		if ($r || socket_last_error() == 114 || socket_last_error() == 115) {
735 797
 			return $s;
736 798
 		}
@@ -775,18 +837,22 @@  discard block
 block discarded – undo
775 837
 		//NOTE: use a trailing slash for folders!!!
776 838
 		//see http://bugs.php.net/bug.php?id=27609
777 839
 		//see http://bugs.php.net/bug.php?id=30931
778
-		if ($path{strlen($path)-1}=='/') // recursively return a temporary file path
840
+		if ($path{strlen($path)-1}=='/') {
841
+			// recursively return a temporary file path
779 842
 			return $this->is__writable($path.uniqid(mt_rand()).'.tmp');
780
-		else if (is_dir($path))
781
-			return $this->is__writable($path.'/'.uniqid(mt_rand()).'.tmp');
843
+		} else if (is_dir($path)) {
844
+					return $this->is__writable($path.'/'.uniqid(mt_rand()).'.tmp');
845
+		}
782 846
 		// check tmp file for read/write capabilities
783 847
 		$rm = file_exists($path);
784 848
 		$f = @fopen($path, 'a');
785
-		if ($f===false)
786
-			return false;
849
+		if ($f===false) {
850
+					return false;
851
+		}
787 852
 		fclose($f);
788
-		if (!$rm)
789
-			unlink($path);
853
+		if (!$rm) {
854
+					unlink($path);
855
+		}
790 856
 		return true;
791 857
 	}
792 858
 	
@@ -802,7 +868,9 @@  discard block
 block discarded – undo
802 868
 	 * @return Array Coordinate of the route
803 869
 	*/
804 870
 	public function greatcircle($begin_lat,$begin_lon,$end_lat,$end_lon,$nbpts = 20, $offset = 10) {
805
-		if ($nbpts <= 2) return array(array($begin_lon,$begin_lat),array($end_lon,$end_lat));
871
+		if ($nbpts <= 2) {
872
+			return array(array($begin_lon,$begin_lat),array($end_lon,$end_lat));
873
+		}
806 874
 		$sx = deg2rad($begin_lon);
807 875
 		$sy = deg2rad($begin_lat);
808 876
 		$ex = deg2rad($end_lon);
@@ -811,7 +879,9 @@  discard block
 block discarded – undo
811 879
 		$h = $sy - $ey;
812 880
 		$z = pow(sin($h/2.0),2) + cos($sy)*cos($ey)*pow(sin($w/2.0),2);
813 881
 		$g = 2.0*asin(sqrt($z));
814
-		if ($g == M_PI || is_nan($g)) return array(array($begin_lon,$begin_lat),array($end_lon,$end_lat));
882
+		if ($g == M_PI || is_nan($g)) {
883
+			return array(array($begin_lon,$begin_lat),array($end_lon,$end_lat));
884
+		}
815 885
 		$first_pass = array();
816 886
 		$delta = 1.0/($nbpts-1);
817 887
 		for ($i =0; $i < $nbpts; ++$i) {
Please login to merge, or discard this patch.
install/index.php 1 patch
Braces   +667 added lines, -177 removed lines patch added patch discarded remove patch
@@ -4,12 +4,22 @@  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
-	if (isset($_SESSION['identitied'])) unset($_SESSION['identified']);
12
-}
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
+	if (isset($_SESSION['identitied'])) {
20
+		unset($_SESSION['identified']);
21
+	}
22
+	}
13 23
 /*
14 24
 if (isset($_SESSION['errorlst'])) {
15 25
 	header('Content-Encoding: none;');
@@ -131,7 +141,9 @@  discard block
 block discarded – undo
131 141
 		if (count($alllng) != count($availablelng)) {
132 142
 			$notavailable = array();
133 143
 			foreach($alllng as $lng) {
134
-				if (!isset($availablelng[$lng])) $notavailable[] = $lng;
144
+				if (!isset($availablelng[$lng])) {
145
+					$notavailable[] = $lng;
146
+				}
135 147
 			}
136 148
 			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>';
137 149
 		}
@@ -170,7 +182,10 @@  discard block
 block discarded – undo
170 182
 			<legend>Install script configuration</legend>
171 183
 			<p>
172 184
 				<label for="installpass">Install password</label>
173
-				<input type="password" name="installpass" id="installpass" value="<?php if (isset($globalInstallPassword)) print $globalInstallPassword; ?>" />
185
+				<input type="password" name="installpass" id="installpass" value="<?php if (isset($globalInstallPassword)) {
186
+	print $globalInstallPassword;
187
+}
188
+?>" />
174 189
 			</p>
175 190
 			<p class="help-block">Password needed to access this install script. If empty, to access this script,  you will need to change the $globalInstalled setting in require/settings.php to FALSE</p>
176 191
 		</fieldset>
@@ -200,31 +215,49 @@  discard block
 block discarded – undo
200 215
 			</div>
201 216
 			<p>
202 217
 				<label for="dbhost">Database hostname</label>
203
-				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" />
218
+				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) {
219
+	print $globalDBhost;
220
+}
221
+?>" />
204 222
 			</p>
205 223
 			<p>
206 224
 				<label for="dbport">Database port</label>
207
-				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" />
225
+				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) {
226
+	print $globalDBport;
227
+}
228
+?>" />
208 229
 				<p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p>
209 230
 			</p>
210 231
 			<p>
211 232
 				<label for="dbname">Database name</label>
212
-				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" />
233
+				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) {
234
+	print $globalDBname;
235
+}
236
+?>" />
213 237
 			</p>
214 238
 			<p>
215 239
 				<label for="dbuser">Database user</label>
216
-				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" />
240
+				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) {
241
+	print $globalDBuser;
242
+}
243
+?>" />
217 244
 			</p>
218 245
 			<p>
219 246
 				<label for="dbuserpass">Database user password</label>
220
-				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" />
247
+				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) {
248
+	print $globalDBpass;
249
+}
250
+?>" />
221 251
 			</p>
222 252
 		</fieldset>
223 253
 		<fieldset id="site">
224 254
 			<legend>Site configuration</legend>
225 255
 			<p>
226 256
 				<label for="sitename">Site name</label>
227
-				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" />
257
+				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) {
258
+	print $globalName;
259
+}
260
+?>" />
228 261
 			</p>
229 262
 			<p>
230 263
 				<label for="siteurl">Site directory</label>
@@ -237,18 +270,27 @@  discard block
 block discarded – undo
237 270
 					}
238 271
 				    }
239 272
 				?>
240
-				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" />
273
+				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) {
274
+	print $globalURL;
275
+}
276
+?>" />
241 277
 				<p class="help-block">ex : <i>/flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p>
242 278
 				<p class="help-block">Can be empty</p>
243 279
 			</p>
244 280
 			<p>
245 281
 				<label for="timezone">Timezone</label>
246
-				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" />
282
+				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) {
283
+	print $globalTimezone;
284
+}
285
+?>" />
247 286
 				<p class="help-block">ex : UTC, Europe/Paris,...</p>
248 287
 			</p>
249 288
 			<p>
250 289
 				<label for="language">Language</label>
251
-				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" />
290
+				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) {
291
+	print $globalLanguage;
292
+}
293
+?>" />
252 294
 				<p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p>
253 295
 			</p>
254 296
 		</fieldset>
@@ -268,11 +310,17 @@  discard block
 block discarded – undo
268 310
 			<div id="mapbox_data">
269 311
 				<p>
270 312
 					<label for="mapboxid">Mapbox id</label>
271
-					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" />
313
+					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) {
314
+	print $globalMapboxId;
315
+}
316
+?>" />
272 317
 				</p>
273 318
 				<p>
274 319
 					<label for="mapboxtoken">Mapbox token</label>
275
-					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" />
320
+					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) {
321
+	print $globalMapboxToken;
322
+}
323
+?>" />
276 324
 				</p>
277 325
 				<p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p>
278 326
 			</div>
@@ -280,7 +328,10 @@  discard block
 block discarded – undo
280 328
 			<div id="google_data">
281 329
 				<p>
282 330
 					<label for="googlekey">Google API key</label>
283
-					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" />
331
+					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) {
332
+	print $globalGoogleAPIKey;
333
+}
334
+?>" />
284 335
 					<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>
285 336
 				</p>
286 337
 			</div>
@@ -288,7 +339,10 @@  discard block
 block discarded – undo
288 339
 			<div id="bing_data">
289 340
 				<p>
290 341
 					<label for="bingkey">Bing Map key</label>
291
-					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" />
342
+					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) {
343
+	print $globalBingMapKey;
344
+}
345
+?>" />
292 346
 					<p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p>
293 347
 				</p>
294 348
 			</div>
@@ -296,7 +350,10 @@  discard block
 block discarded – undo
296 350
 			<div id="mapquest_data">
297 351
 				<p>
298 352
 					<label for="mapquestkey">MapQuest key</label>
299
-					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" />
353
+					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) {
354
+	print $globalMapQuestKey;
355
+}
356
+?>" />
300 357
 					<p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p>
301 358
 				</p>
302 359
 			</div>
@@ -304,11 +361,17 @@  discard block
 block discarded – undo
304 361
 			<div id="here_data">
305 362
 				<p>
306 363
 					<label for="hereappid">Here App_Id</label>
307
-					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" />
364
+					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) {
365
+	print $globalHereappId;
366
+}
367
+?>" />
308 368
 				</p>
309 369
 				<p>
310 370
 					<label for="hereappcode">Here App_Code</label>
311
-					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" />
371
+					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) {
372
+	print $globalHereappCode;
373
+}
374
+?>" />
312 375
 				</p>
313 376
 				<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>
314 377
 			</div>
@@ -316,7 +379,10 @@  discard block
 block discarded – undo
316 379
 			<div id="openweathermap_data">
317 380
 				<p>
318 381
 					<label for="openweathermapkey">OpenWeatherMap key (weather layer)</label>
319
-					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) print $globalOpenWeatherMapKey; ?>" />
382
+					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) {
383
+	print $globalOpenWeatherMapKey;
384
+}
385
+?>" />
320 386
 					<p class="help-block">Get a key <a href="https://openweathermap.org/">here</a></p>
321 387
 				</p>
322 388
 			</div>
@@ -345,42 +411,86 @@  discard block
 block discarded – undo
345 411
 			<legend>Coverage area</legend>
346 412
 			<p>
347 413
 				<label for="latitudemax">The maximum latitude (north)</label>
348
-				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" />
414
+				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) {
415
+	print $globalLatitudeMax;
416
+}
417
+?>" />
349 418
 			</p>
350 419
 			<p>
351 420
 				<label for="latitudemin">The minimum latitude (south)</label>
352
-				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" />
421
+				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) {
422
+	print $globalLatitudeMin;
423
+}
424
+?>" />
353 425
 			</p>
354 426
 			<p>
355 427
 				<label for="longitudemax">The maximum longitude (west)</label>
356
-				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" />
428
+				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) {
429
+	print $globalLongitudeMax;
430
+}
431
+?>" />
357 432
 			</p>
358 433
 			<p>
359 434
 				<label for="longitudemin">The minimum longitude (east)</label>
360
-				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" />
435
+				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) {
436
+	print $globalLongitudeMin;
437
+}
438
+?>" />
361 439
 			</p>
362 440
 			<p>
363 441
 				<label for="latitudecenter">The latitude center</label>
364
-				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" />
442
+				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) {
443
+	print $globalCenterLatitude;
444
+}
445
+?>" />
365 446
 			</p>
366 447
 			<p>
367 448
 				<label for="longitudecenter">The longitude center</label>
368
-				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" />
449
+				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) {
450
+	print $globalCenterLongitude;
451
+}
452
+?>" />
369 453
 			</p>
370 454
 			<p>
371 455
 				<label for="livezoom">Default Zoom on live map</label>
372
-				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" />
456
+				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) {
457
+	print $globalLiveZoom;
458
+} else {
459
+	print '9';
460
+}
461
+?>" />
373 462
 			</p>
374 463
 			<p>
375 464
 				<label for="squawk_country">Country for squawk usage</label>
376 465
 				<select name="squawk_country" id="squawk_country">
377
-					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option>
378
-					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option>
379
-					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option>
380
-					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option>
381
-					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option>
382
-					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option>
383
-					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option>
466
+					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') {
467
+	print ' selected ';
468
+}
469
+?>>UK</option>
470
+					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') {
471
+	print ' selected ';
472
+}
473
+?>>NZ</option>
474
+					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') {
475
+	print ' selected ';
476
+}
477
+?>>US</option>
478
+					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') {
479
+	print ' selected ';
480
+}
481
+?>>AU</option>
482
+					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') {
483
+	print ' selected ';
484
+}
485
+?>>NL</option>
486
+					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') {
487
+	print ' selected ';
488
+}
489
+?>>FR</option>
490
+					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') {
491
+	print ' selected ';
492
+}
493
+?>>TR</option>
384 494
 				</select>
385 495
 			</p>
386 496
 		</fieldset>
@@ -389,15 +499,24 @@  discard block
 block discarded – undo
389 499
 			<p><i>Only put in DB flights that are inside a circle</i></p>
390 500
 			<p>
391 501
 				<label for="latitude">Center latitude</label>
392
-				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" />
502
+				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) {
503
+	echo $globalDistanceIgnore['latitude'];
504
+}
505
+?>" />
393 506
 			</p>
394 507
 			<p>
395 508
 				<label for="longitude">Center longitude</label>
396
-				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" />
509
+				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) {
510
+	echo $globalDistanceIgnore['longitude'];
511
+}
512
+?>" />
397 513
 			</p>
398 514
 			<p>
399 515
 				<label for="Distance">Distance (in km)</label>
400
-				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" />
516
+				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) {
517
+	echo $globalDistanceIgnore['distance'];
518
+}
519
+?>" />
401 520
 			</p>
402 521
 		</fieldset>
403 522
 		<fieldset id="sourceloc">
@@ -523,28 +642,43 @@  discard block
 block discarded – undo
523 642
 			<div id="flightaware_data">
524 643
 				<p>
525 644
 					<label for="flightawareusername">FlightAware username</label>
526
-					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
645
+					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
646
+	print $globalFlightAwareUsername;
647
+}
648
+?>" />
527 649
 				</p>
528 650
 				<p>
529 651
 					<label for="flightawarepassword">FlightAware password/API key</label>
530
-					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
652
+					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
653
+	print $globalFlightAwarePassword;
654
+}
655
+?>" />
531 656
 				</p>
532 657
 			</div>
533 658
 -->
534 659
 			<div id="sailaway_data">
535 660
 				<p>
536 661
 					<label for="sailawayemail">Sailaway email</label>
537
-					<input type="text" name="sailawayemail" id="sailawayemail" value="<?php if (isset($globalSailaway['email'])) print $globalSailaway['email']; ?>" />
662
+					<input type="text" name="sailawayemail" id="sailawayemail" value="<?php if (isset($globalSailaway['email'])) {
663
+	print $globalSailaway['email'];
664
+}
665
+?>" />
538 666
 					<p class="help-block">Only needed for Sailaway full format</p>
539 667
 				</p>
540 668
 				<p>
541 669
 					<label for="sailawaypassword">Sailaway password</label>
542
-					<input type="text" name="sailawaypassword" id="sailawaypassword" value="<?php if (isset($globalSailaway['password'])) print $globalSailaway['password']; ?>" />
670
+					<input type="text" name="sailawaypassword" id="sailawaypassword" value="<?php if (isset($globalSailaway['password'])) {
671
+	print $globalSailaway['password'];
672
+}
673
+?>" />
543 674
 					<p class="help-block">Only needed for Sailaway full format</p>
544 675
 				</p>
545 676
 				<p>
546 677
 					<label for="sailawaykey">Sailaway API key</label>
547
-					<input type="text" name="sailawaykey" id="sailawaykey" value="<?php if (isset($globalSailaway['key'])) print $globalSailaway['key']; ?>" />
678
+					<input type="text" name="sailawaykey" id="sailawaykey" value="<?php if (isset($globalSailaway['key'])) {
679
+	print $globalSailaway['key'];
680
+}
681
+?>" />
548 682
 				</p>
549 683
 			</div>
550 684
 
@@ -586,7 +720,10 @@  discard block
 block discarded – undo
586 720
 								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
587 721
 								?>
588 722
 								<td><input type="text" name="host[]" value="<?php print $source['host']; ?>" /></td>
589
-								<td><input type="text" name="port[]" class="col-xs-2" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
723
+								<td><input type="text" name="port[]" class="col-xs-2" value="<?php if (isset($source['port'])) {
724
+	print $source['port'];
725
+}
726
+?>" /></td>
590 727
 								<?php
591 728
 								    } else {
592 729
 									$hostport = explode(':',$source['host']);
@@ -605,41 +742,134 @@  discard block
 block discarded – undo
605 742
 								?>
606 743
 								<td>
607 744
 									<select name="format[]">
608
-										<option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option>
609
-										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option>
610
-										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option>
611
-										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option>
612
-										<option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') print 'selected'; ?>>Dump1090 aircraft.json</option>
613
-										<option value="planefinderclient" <?php if (isset($source['format']) && $source['format'] == 'planefinderclient') print 'selected'; ?>>Planefinder client</option>
614
-										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option>
615
-										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option>
616
-                                        <option value="radarcapejson" <?php if (isset($source['format']) && $source['format'] == 'radarcapejson') print 'selected'; ?>>Radarcape json</option>
617
-										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option>
618
-										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option>
619
-										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option>
620
-										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option>
621
-										<option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>Virtual Airline Operations System (VAOS)</option>
622
-										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option>
623
-										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option>
624
-										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option>
625
-										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option>
626
-										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
627
-										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option>
628
-										<option value="acarsjson" <?php if (isset($source['format']) && $source['format'] == 'acarsjson') print 'selected'; ?>>ACARS from acarsdec json and vdlm2dec</option>
629
-										<option value="acarsjsonudp" <?php if (isset($source['format']) && $source['format'] == 'acarsjsonudp') print 'selected'; ?>>ACARS from acarsdec json and vdlm2dec over UDP</option>
630
-										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option>
631
-										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') print 'selected'; ?>>AirWhere website</option>
632
-										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') print 'selected'; ?>>HidnSeek Callback</option>
633
-										<option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') print 'selected'; ?>>Blitzortung</option>
634
-										<option value="sailaway" <?php if (isset($source['format']) && $source['format'] == 'sailaway') print 'selected'; ?>>Sailaway</option>
635
-										<option value="sailawayfull" <?php if (isset($source['format']) && $source['format'] == 'sailawayfull') print 'selected'; ?>>Sailaway with missions, races,...</option>
745
+										<option value="auto" <?php if (!isset($source['format'])) {
746
+	print 'selected';
747
+}
748
+?>>Auto</option>
749
+										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') {
750
+	print 'selected';
751
+}
752
+?>>SBS</option>
753
+										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') {
754
+	print 'selected';
755
+}
756
+?>>TSV</option>
757
+										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') {
758
+	print 'selected';
759
+}
760
+?>>Raw</option>
761
+										<option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') {
762
+	print 'selected';
763
+}
764
+?>>Dump1090 aircraft.json</option>
765
+										<option value="planefinderclient" <?php if (isset($source['format']) && $source['format'] == 'planefinderclient') {
766
+	print 'selected';
767
+}
768
+?>>Planefinder client</option>
769
+										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') {
770
+	print 'selected';
771
+}
772
+?>>APRS</option>
773
+										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') {
774
+	print 'selected';
775
+}
776
+?>>Radarcape deltadb.txt</option>
777
+                                        <option value="radarcapejson" <?php if (isset($source['format']) && $source['format'] == 'radarcapejson') {
778
+	print 'selected';
779
+}
780
+?>>Radarcape json</option>
781
+										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') {
782
+	print 'selected';
783
+}
784
+?>>Vatsim</option>
785
+										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') {
786
+	print 'selected';
787
+}
788
+?>>Virtual Radar Server AircraftList.json</option>
789
+										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') {
790
+	print 'selected';
791
+}
792
+?>>Virtual Radar Server TCP</option>
793
+										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
794
+	print 'selected';
795
+}
796
+?>>phpVMS</option>
797
+										<option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
798
+	print 'selected';
799
+}
800
+?>>Virtual Airline Operations System (VAOS)</option>
801
+										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') {
802
+	print 'selected';
803
+}
804
+?>>Virtual Airlines Manager</option>
805
+										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') {
806
+	print 'selected';
807
+}
808
+?>>IVAO</option>
809
+										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') {
810
+	print 'selected';
811
+}
812
+?>>FlightGear Multiplayer</option>
813
+										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') {
814
+	print 'selected';
815
+}
816
+?>>FlightGear Singleplayer</option>
817
+										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') {
818
+	print 'selected';
819
+}
820
+?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
821
+										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') {
822
+	print 'selected';
823
+}
824
+?>>ACARS SBS-3 over TCP</option>
825
+										<option value="acarsjson" <?php if (isset($source['format']) && $source['format'] == 'acarsjson') {
826
+	print 'selected';
827
+}
828
+?>>ACARS from acarsdec json and vdlm2dec</option>
829
+										<option value="acarsjsonudp" <?php if (isset($source['format']) && $source['format'] == 'acarsjsonudp') {
830
+	print 'selected';
831
+}
832
+?>>ACARS from acarsdec json and vdlm2dec over UDP</option>
833
+										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') {
834
+	print 'selected';
835
+}
836
+?>>NMEA AIS over TCP</option>
837
+										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') {
838
+	print 'selected';
839
+}
840
+?>>AirWhere website</option>
841
+										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') {
842
+	print 'selected';
843
+}
844
+?>>HidnSeek Callback</option>
845
+										<option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') {
846
+	print 'selected';
847
+}
848
+?>>Blitzortung</option>
849
+										<option value="sailaway" <?php if (isset($source['format']) && $source['format'] == 'sailaway') {
850
+	print 'selected';
851
+}
852
+?>>Sailaway</option>
853
+										<option value="sailawayfull" <?php if (isset($source['format']) && $source['format'] == 'sailawayfull') {
854
+	print 'selected';
855
+}
856
+?>>Sailaway with missions, races,...</option>
636 857
 									</select>
637 858
 								</td>
638 859
 								<td>
639
-									<input type="text" name="name[]" value="<?php if (isset($source['name'])) print $source['name']; ?>" />
860
+									<input type="text" name="name[]" value="<?php if (isset($source['name'])) {
861
+	print $source['name'];
862
+}
863
+?>" />
640 864
 								</td>
641
-								<td><input type="checkbox" name="sourcestats[]" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) print 'checked'; ?> /></td>
642
-								<td><input type="checkbox" name="noarchive[]" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) print 'checked'; ?> /></td>
865
+								<td><input type="checkbox" name="sourcestats[]" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) {
866
+	print 'checked';
867
+}
868
+?> /></td>
869
+								<td><input type="checkbox" name="noarchive[]" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) {
870
+	print 'checked';
871
+}
872
+?> /></td>
643 873
 								<td>
644 874
 									<select name="timezones[]">
645 875
 								<?php
@@ -649,7 +879,9 @@  discard block
 block discarded – undo
649 879
 											print '<option selected>'.$timezones.'</option>';
650 880
 										} elseif (!isset($source['timezone']) && $timezones == 'UTC') {
651 881
 											print '<option selected>'.$timezones.'</option>';
652
-										} else print '<option>'.$timezones.'</option>';
882
+										} else {
883
+											print '<option>'.$timezones.'</option>';
884
+										}
653 885
 									}
654 886
 								?>
655 887
 									</select>
@@ -707,7 +939,9 @@  discard block
 block discarded – undo
707 939
 									foreach($timezonelist as $timezones){
708 940
 										if ($timezones == 'UTC') {
709 941
 											print '<option selected>'.$timezones.'</option>';
710
-										} else print '<option>'.$timezones.'</option>';
942
+										} else {
943
+											print '<option>'.$timezones.'</option>';
944
+										}
711 945
 									}
712 946
 								?>
713 947
 									</select>
@@ -732,11 +966,17 @@  discard block
 block discarded – undo
732 966
 					<p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p>
733 967
 					<p>
734 968
 						<label for="acarshost">ACARS UDP host</label>
735
-						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" />
969
+						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) {
970
+	print $globalACARSHost;
971
+}
972
+?>" />
736 973
 					</p>
737 974
 					<p>
738 975
 						<label for="acarsport">ACARS UDP port</label>
739
-						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" />
976
+						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) {
977
+	print $globalACARSPort;
978
+}
979
+?>" />
740 980
 					</p>
741 981
 					<p class="help-block"><i>daemon-acars.php</i> can only be run as daemon. It's an alternate script for ACARS data, <i>daemon-spotter.php</i> may be better.</p>
742 982
 				</fieldset>
@@ -763,17 +1003,38 @@  discard block
 block discarded – undo
763 1003
 				    <td><input type="url" name="newsurl[]" value="<?php print $feed; ?>"/></td>
764 1004
 				    <td>
765 1005
 					<select name="newslang[]">
766
-					    <option value="en"<?php if ($lng == 'en') print ' selected'; ?>>English</option>
767
-					    <option value="fr"<?php if ($lng == 'fr') print ' selected'; ?>>French</option>
1006
+					    <option value="en"<?php if ($lng == 'en') {
1007
+	print ' selected';
1008
+}
1009
+?>>English</option>
1010
+					    <option value="fr"<?php if ($lng == 'fr') {
1011
+	print ' selected';
1012
+}
1013
+?>>French</option>
768 1014
 					</select>
769 1015
 				    </td>
770 1016
 				    <td>
771 1017
 					<select name="newstype[]">
772
-					    <option value="global"<?php if ($type == 'global') print ' selected'; ?>>Global</option>
773
-					    <option value="aircraft"<?php if ($type == 'aircraft') print ' selected'; ?>>Aircraft</option>
774
-					    <option value="marine"<?php if ($type == 'marine') print ' selected'; ?>>Marine</option>
775
-					    <option value="tracker"<?php if ($type == 'tracker') print ' selected'; ?>>Tracker</option>
776
-					    <option value="satellite"<?php if ($type == 'Satellite') print ' selected'; ?>>Satellite</option>
1018
+					    <option value="global"<?php if ($type == 'global') {
1019
+	print ' selected';
1020
+}
1021
+?>>Global</option>
1022
+					    <option value="aircraft"<?php if ($type == 'aircraft') {
1023
+	print ' selected';
1024
+}
1025
+?>>Aircraft</option>
1026
+					    <option value="marine"<?php if ($type == 'marine') {
1027
+	print ' selected';
1028
+}
1029
+?>>Marine</option>
1030
+					    <option value="tracker"<?php if ($type == 'tracker') {
1031
+	print ' selected';
1032
+}
1033
+?>>Tracker</option>
1034
+					    <option value="satellite"<?php if ($type == 'Satellite') {
1035
+	print ' selected';
1036
+}
1037
+?>>Satellite</option>
777 1038
 					</select>
778 1039
 				    </td>
779 1040
 				    <td><input type="button" value="Delete" onclick="deleteRowNews(this)" /> <input type="button" value="Add" onclick="insRowNews()" /></td>
@@ -857,7 +1118,10 @@  discard block
 block discarded – undo
857 1118
 			</p>
858 1119
 			<p>
859 1120
 				<label for="corsproxy">CORS proxy</label>
860
-				<input type="text" name="corsproxy" id="corsproxy" value="<?php if (isset($globalCORSproxy)) print $globalCORSproxy; else print 'https://galvanize-cors-proxy.herokuapp.com/' ?>" />
1121
+				<input type="text" name="corsproxy" id="corsproxy" value="<?php if (isset($globalCORSproxy)) {
1122
+	print $globalCORSproxy;
1123
+} else {
1124
+	print 'https://galvanize-cors-proxy.herokuapp.com/' ?>" />
861 1125
 				<p class="help-block">CORS proxy used for some WMS servers</p>
862 1126
 			</p>
863 1127
 <!--
@@ -920,13 +1184,18 @@  discard block
 block discarded – undo
920 1184
 			<div id="schedules_options">
921 1185
 				<p>
922 1186
 					<label for="britishairways">British Airways API Key</label>
923
-					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" />
1187
+					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey;
1188
+}
1189
+?>" />
924 1190
 					<p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p>
925 1191
 				</p>
926 1192
 				<!--
927 1193
 				<p>
928 1194
 					<label for="transavia">Transavia Test API Consumer Key</label>
929
-					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" />
1195
+					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) {
1196
+	print $globalTransaviaKey;
1197
+}
1198
+?>" />
930 1199
 					<p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p>
931 1200
 				</p>
932 1201
 				-->
@@ -935,10 +1204,16 @@  discard block
 block discarded – undo
935 1204
 						<b>Lufthansa API Key</b>
936 1205
 						<p>
937 1206
 							<label for="lufthansakey">Key</label>
938
-							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" />
1207
+							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) {
1208
+	print $globalLufthansaKey['key'];
1209
+}
1210
+?>" />
939 1211
 						</p><p>
940 1212
 							<label for="lufthansasecret">Secret</label>
941
-							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" />
1213
+							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) {
1214
+	print $globalLufthansaKey['secret'];
1215
+}
1216
+?>" />
942 1217
 						</p>
943 1218
 					</div>
944 1219
 					<p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p>
@@ -948,11 +1223,17 @@  discard block
 block discarded – undo
948 1223
 						<b>FlightAware API Key</b>
949 1224
 						<p>
950 1225
 							<label for="flightawareusername">Username</label>
951
-							<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
1226
+							<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
1227
+	print $globalFlightAwareUsername;
1228
+}
1229
+?>" />
952 1230
 						</p>
953 1231
 						<p>
954 1232
 							<label for="flightawarepassword">API key</label>
955
-							<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
1233
+							<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
1234
+	print $globalFlightAwarePassword;
1235
+}
1236
+?>" />
956 1237
 						</p>
957 1238
 					</div>
958 1239
 					<p class="help-block">Register an account on <a href="https://www.flightaware.com/">https://www.flightaware.com/</a></p>
@@ -969,10 +1250,22 @@  discard block
 block discarded – undo
969 1250
 				<p>
970 1251
 					<label for="mapmatchingsource">Map Matching source</label>
971 1252
 					<select name="mapmatchingsource" id="mapmatchingsource">
972
-						<option value="fam" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'fam') || !isset($globalMatchingSource)) print 'selected="selected" '; ?>>FlightAirMap Map Matching</option>
973
-						<option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') print 'selected="selected" '; ?>>GraphHopper</option>
974
-						<option value="osmr" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') print 'selected="selected" '; ?>>OSMR</option>
975
-						<option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') print 'selected="selected" '; ?>>Mapbox</option>
1253
+						<option value="fam" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'fam') || !isset($globalMatchingSource)) {
1254
+	print 'selected="selected" ';
1255
+}
1256
+?>>FlightAirMap Map Matching</option>
1257
+						<option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') {
1258
+	print 'selected="selected" ';
1259
+}
1260
+?>>GraphHopper</option>
1261
+						<option value="osmr" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') {
1262
+	print 'selected="selected" ';
1263
+}
1264
+?>>OSMR</option>
1265
+						<option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') {
1266
+	print 'selected="selected" ';
1267
+}
1268
+?>>Mapbox</option>
976 1269
 					</select>
977 1270
 					<p class="help-block">Mapbox need the API Key defined in map section.</p>
978 1271
 					<p class="help-block">FlightAirMap Map Matching is free, without API key but limited to about 100 input points to keep fast results.</p>
@@ -980,7 +1273,10 @@  discard block
 block discarded – undo
980 1273
 				<br />
981 1274
 				<p>
982 1275
 					<label for="graphhopper">GraphHopper API Key</label>
983
-					<input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) print $globalGraphHopperKey; ?>" />
1276
+					<input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) {
1277
+	print $globalGraphHopperKey;
1278
+}
1279
+?>" />
984 1280
 					<p class="help-block">Register an account on <a href="https://www.graphhopper.com/">https://www.graphhopper.com/</a></p>
985 1281
 				</p>
986 1282
 			</div>
@@ -998,7 +1294,10 @@  discard block
 block discarded – undo
998 1294
 			</p>
999 1295
 			<p>
1000 1296
 				<label for="notamsource">URL of your feed from notaminfo.com</label>
1001
-				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" />
1297
+				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) {
1298
+	print $globalNOTAMSource;
1299
+}
1300
+?>" />
1002 1301
 				<p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p>
1003 1302
 			</p>
1004 1303
 			<br />
@@ -1014,7 +1313,10 @@  discard block
 block discarded – undo
1014 1313
 			<div id="metarsrc">
1015 1314
 				<p>
1016 1315
 					<label for="metarsource">URL of your METAR source</label>
1017
-					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" />
1316
+					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) {
1317
+	print $globalMETARurl;
1318
+}
1319
+?>" />
1018 1320
 					<p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p>
1019 1321
 				</p>
1020 1322
 			</div>
@@ -1022,18 +1324,27 @@  discard block
 block discarded – undo
1022 1324
 			<div id="podaac">
1023 1325
 				<p>
1024 1326
 					<label for="podaccuser">PO.DAAC username (used for waves)</label>
1025
-					<input type="text" name="podaccuser" id="podaccuser" value="<?php if (isset($globalPODAACuser)) print $globalPODAACuser; ?>" />
1327
+					<input type="text" name="podaccuser" id="podaccuser" value="<?php if (isset($globalPODAACuser)) {
1328
+	print $globalPODAACuser;
1329
+}
1330
+?>" />
1026 1331
 				</p>
1027 1332
 				<p>
1028 1333
 					<label for="podaccpass">PO.DAAC password</label>
1029
-					<input type="text" name="podaccpass" id="podaccpass" value="<?php if (isset($globalPODAACpass)) print $globalPODAACpass; ?>" />
1334
+					<input type="text" name="podaccpass" id="podaccpass" value="<?php if (isset($globalPODAACpass)) {
1335
+	print $globalPODAACpass;
1336
+}
1337
+?>" />
1030 1338
 				</p>
1031 1339
 				<p class="help-block">Register an account on <a href="https://podaac-tools.jpl.nasa.gov/drive/">https://podaac-tools.jpl.nasa.gov/drive/</a></p>
1032 1340
 			</div>
1033 1341
 			<br />
1034 1342
 			<p>
1035 1343
 				<label for="bitly">Bit.ly access token api (used in search page)</label>
1036
-				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" />
1344
+				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) {
1345
+	print $globalBitlyAccessToken;
1346
+}
1347
+?>" />
1037 1348
 			</p>
1038 1349
 			<br />
1039 1350
 			<p>
@@ -1049,11 +1360,26 @@  discard block
 block discarded – undo
1049 1360
 			<p>
1050 1361
 				<label for="geoid_source">Geoid Source</label>
1051 1362
 				<select name="geoid_source" id="geoid_source">
1052
-					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') print ' selected="selected"'; ?>>EGM96 15' (2.1MB)</option>
1053
-					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') print ' selected="selected"'; ?>>EGM96 5' (19MB)</option>
1054
-					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') print ' selected="selected"'; ?>>EGM2008 5' (19MB)</option>
1055
-					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') print ' selected="selected"'; ?>>EGM2008 2.5' (75MB)</option>
1056
-					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') print ' selected="selected"'; ?>>EGM2008 1' (470MB)</option>
1363
+					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') {
1364
+	print ' selected="selected"';
1365
+}
1366
+?>>EGM96 15' (2.1MB)</option>
1367
+					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') {
1368
+	print ' selected="selected"';
1369
+}
1370
+?>>EGM96 5' (19MB)</option>
1371
+					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') {
1372
+	print ' selected="selected"';
1373
+}
1374
+?>>EGM2008 5' (19MB)</option>
1375
+					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') {
1376
+	print ' selected="selected"';
1377
+}
1378
+?>>EGM2008 2.5' (75MB)</option>
1379
+					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') {
1380
+	print ' selected="selected"';
1381
+}
1382
+?>>EGM2008 1' (470MB)</option>
1057 1383
 				</select>
1058 1384
 				<p class="help-block">The geoid is approximated by an "earth gravity model" (EGM).</p>
1059 1385
 			</p>
@@ -1075,7 +1401,12 @@  discard block
 block discarded – undo
1075 1401
 			</p>
1076 1402
 			<p>
1077 1403
 				<label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label>
1078
-				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '1'; ?>" />
1404
+				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) {
1405
+	print $globalArchiveMonths;
1406
+} else {
1407
+	echo '1';
1408
+}
1409
+?>" />
1079 1410
 				<p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p>
1080 1411
 			</p>
1081 1412
 			<p>
@@ -1085,12 +1416,22 @@  discard block
 block discarded – undo
1085 1416
 			</p>
1086 1417
 			<p>
1087 1418
 				<label for="archivekeepmonths">Keep flights data for xx months in archive</label>
1088
-				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '1'; ?>" />
1419
+				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) {
1420
+	print $globalArchiveKeepMonths;
1421
+} else {
1422
+	echo '1';
1423
+}
1424
+?>" />
1089 1425
 				<p class="help-block">0 to disable</p>
1090 1426
 			</p>
1091 1427
 			<p>
1092 1428
 				<label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label>
1093
-				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '1'; ?>" />
1429
+				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) {
1430
+	print $globalArchiveKeepTrackMonths;
1431
+} else {
1432
+	echo '1';
1433
+}
1434
+?>" />
1094 1435
 				<p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p>
1095 1436
 			</p>
1096 1437
 			<br />
@@ -1100,7 +1441,12 @@  discard block
 block discarded – undo
1100 1441
 				<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>
1101 1442
 				<div id="cronends"> 
1102 1443
 					<label for="cronend">Run script for xx seconds</label>
1103
-					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" />
1444
+					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) {
1445
+	print $globalCronEnd;
1446
+} else {
1447
+	print '0';
1448
+}
1449
+?>" />
1104 1450
 					<p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p>
1105 1451
 				</div>
1106 1452
 			</p>
@@ -1159,20 +1505,40 @@  discard block
 block discarded – undo
1159 1505
 			<br />
1160 1506
 			<p>
1161 1507
 				<label for="refresh">Show flights detected since xxx seconds</label>
1162
-				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" />
1508
+				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) {
1509
+	echo $globalLiveInterval;
1510
+} else {
1511
+	echo '200';
1512
+}
1513
+?>" />
1163 1514
 			</p>
1164 1515
 			<p>
1165 1516
 				<label for="maprefresh">Live map refresh (in seconds)</label>
1166
-				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" />
1517
+				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) {
1518
+	echo $globalMapRefresh;
1519
+} else {
1520
+	echo '30';
1521
+}
1522
+?>" />
1167 1523
 			</p>
1168 1524
 			<p>
1169 1525
 				<label for="mapidle">Map idle timeout (in minutes)</label>
1170
-				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" />
1526
+				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) {
1527
+	echo $globalMapIdleTimeout;
1528
+} else {
1529
+	echo '30';
1530
+}
1531
+?>" />
1171 1532
 				<p class="help-block">0 to disable</p>
1172 1533
 			</p>
1173 1534
 			<p>
1174 1535
 				<label for="minfetch">HTTP/file source fetch every xxx seconds</label>
1175
-				<input type="number" name="minfetch" id="minfetch" value="<?php if (isset($globalMinFetch)) echo $globalMinFetch; else echo '20'; ?>" />
1536
+				<input type="number" name="minfetch" id="minfetch" value="<?php if (isset($globalMinFetch)) {
1537
+	echo $globalMinFetch;
1538
+} else {
1539
+	echo '20';
1540
+}
1541
+?>" />
1176 1542
 			</p>
1177 1543
 			<p>
1178 1544
 				<label for="bbox">Only display flights that we can see on screen (bounding box)</label>
@@ -1191,12 +1557,20 @@  discard block
 block discarded – undo
1191 1557
 			<br />
1192 1558
 			<p>
1193 1559
 				<label for="closestmindist">Distance to airport set as arrival (in km)</label>
1194
-				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" />
1560
+				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) {
1561
+	echo $globalClosestMinDist;
1562
+} else {
1563
+	echo '50';
1564
+}
1565
+?>" />
1195 1566
 			</p>
1196 1567
 			<br />
1197 1568
 			<p>
1198 1569
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
1199
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
1570
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) {
1571
+	echo $globalAircraftSize;
1572
+}
1573
+?>" />
1200 1574
 			</p>
1201 1575
 			<br />
1202 1576
 			<p>
@@ -1215,22 +1589,42 @@  discard block
 block discarded – undo
1215 1589
 			<br />
1216 1590
 			<p>
1217 1591
 				<label for="aircrafticoncolor">Color of aircraft icon on map</label>
1218
-				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />
1592
+				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) {
1593
+	echo $globalAircraftIconColor;
1594
+} else {
1595
+	echo '1a3151';
1596
+}
1597
+?>" />
1219 1598
 			</p>
1220 1599
 			<br />
1221 1600
 			<p>
1222 1601
 				<label for="marineiconcolor">Color of marine icon on map</label>
1223
-				<input type="color" name="marineiconcolor" id="marineiconcolor" value="#<?php if (isset($globalMarineIconColor)) echo $globalMarineIconColor; else echo '43d1d8'; ?>" />
1602
+				<input type="color" name="marineiconcolor" id="marineiconcolor" value="#<?php if (isset($globalMarineIconColor)) {
1603
+	echo $globalMarineIconColor;
1604
+} else {
1605
+	echo '43d1d8';
1606
+}
1607
+?>" />
1224 1608
 			</p>
1225 1609
 			<br />
1226 1610
 			<p>
1227 1611
 				<label for="trackericoncolor">Color of tracker icon on map</label>
1228
-				<input type="color" name="trackericoncolor" id="trackericoncolor" value="#<?php if (isset($globalTrackerIconColor)) echo $globalTrackerIconColor; else echo '1a3151'; ?>" />
1612
+				<input type="color" name="trackericoncolor" id="trackericoncolor" value="#<?php if (isset($globalTrackerIconColor)) {
1613
+	echo $globalTrackerIconColor;
1614
+} else {
1615
+	echo '1a3151';
1616
+}
1617
+?>" />
1229 1618
 			</p>
1230 1619
 			<br />
1231 1620
 			<p>
1232 1621
 				<label for="satelliteiconcolor">Color of satellite icon on map</label>
1233
-				<input type="color" name="satelliteiconcolor" id="satelliteiconcolor" value="#<?php if (isset($globalSatelliteIconColor)) echo $globalSatelliteIconColor; else echo '1a3151'; ?>" />
1622
+				<input type="color" name="satelliteiconcolor" id="satelliteiconcolor" value="#<?php if (isset($globalSatelliteIconColor)) {
1623
+	echo $globalSatelliteIconColor;
1624
+} else {
1625
+	echo '1a3151';
1626
+}
1627
+?>" />
1234 1628
 			</p>
1235 1629
 			<?php
1236 1630
 				if (!is_writable('../cache')) {
@@ -1254,14 +1648,27 @@  discard block
 block discarded – undo
1254 1648
 			<p>
1255 1649
 				<label for="airportzoom">Zoom level minimum to see airports icons</label>
1256 1650
 				<div class="range">
1257
-					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" />
1258
-					<output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output>
1651
+					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) {
1652
+	echo $globalAirportZoom;
1653
+} else {
1654
+	echo '7';
1655
+}
1656
+?>" />
1657
+					<output id="range"><?php if (isset($globalAirportZoom)) {
1658
+	echo $globalAirportZoom;
1659
+} else {
1660
+	echo '7';
1661
+}
1662
+?></output>
1259 1663
 				</div>
1260 1664
 			</p>
1261 1665
 			<br />
1262 1666
 			<p>
1263 1667
 				<label for="customcss">Custom CSS web path</label>
1264
-				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) echo $globalCustomCSS; ?>" />
1668
+				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) {
1669
+	echo $globalCustomCSS;
1670
+}
1671
+?>" />
1265 1672
 			</p>
1266 1673
 		</fieldset>
1267 1674
 		<input type="submit" name="submit" value="Create/Update database & write setup" />
@@ -1291,8 +1698,12 @@  discard block
 block discarded – undo
1291 1698
 	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
1292 1699
 	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
1293 1700
 
1294
-	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
1295
-	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
1701
+	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) {
1702
+		$error .= 'Mysql driver for PDO must be loaded';
1703
+	}
1704
+	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) {
1705
+		$error .= 'PosgreSQL driver for PDO must be loaded';
1706
+	}
1296 1707
 	
1297 1708
 	$_SESSION['database_root'] = $dbroot;
1298 1709
 	$_SESSION['database_rootpass'] = $dbrootpass;
@@ -1371,15 +1782,23 @@  discard block
 block discarded – undo
1371 1782
 	$source_city = $_POST['source_city'];
1372 1783
 	$source_country = $_POST['source_country'];
1373 1784
 	$source_ref = $_POST['source_ref'];
1374
-	if (isset($source_id)) $source_id = $_POST['source_id'];
1375
-	else $source_id = array();
1785
+	if (isset($source_id)) {
1786
+		$source_id = $_POST['source_id'];
1787
+	} else {
1788
+		$source_id = array();
1789
+	}
1376 1790
 	
1377 1791
 	$sources = array();
1378 1792
 	foreach ($source_name as $keys => $name) {
1379
-	    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]);
1380
-	    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]);
1793
+	    if (isset($source_id[$keys])) {
1794
+	    	$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]);
1795
+	    } else {
1796
+	    	$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]);
1797
+	    }
1798
+	}
1799
+	if (count($sources) > 0) {
1800
+		$_SESSION['sources'] = $sources;
1381 1801
 	}
1382
-	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1383 1802
 
1384 1803
 	$newsurl = $_POST['newsurl'];
1385 1804
 	$newslng = $_POST['newslang'];
@@ -1392,7 +1811,9 @@  discard block
 block discarded – undo
1392 1811
 		$lng = $newslng[$newskey];
1393 1812
 		if (isset($newsfeeds[$type][$lng])) {
1394 1813
 		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1395
-		} else $newsfeeds[$type][$lng] = array($url);
1814
+		} else {
1815
+			$newsfeeds[$type][$lng] = array($url);
1816
+		}
1396 1817
 	    }
1397 1818
 	}
1398 1819
 	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds));
@@ -1417,17 +1838,29 @@  discard block
 block discarded – undo
1417 1838
 	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1418 1839
 
1419 1840
 	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1420
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1421
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1841
+	if ($globalaircraft == 'aircraft') {
1842
+		$settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1843
+	} else {
1844
+		$settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1845
+	}
1422 1846
 	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1423
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1424
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1847
+	if ($globaltracker == 'tracker') {
1848
+		$settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1849
+	} else {
1850
+		$settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1851
+	}
1425 1852
 	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1426
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1427
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1853
+	if ($globalmarine == 'marine') {
1854
+		$settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1855
+	} else {
1856
+		$settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1857
+	}
1428 1858
 	$globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING);
1429
-	if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1430
-	else $settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1859
+	if ($globalsatellite == 'satellite') {
1860
+		$settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1861
+	} else {
1862
+		$settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1863
+	}
1431 1864
 
1432 1865
 /*	
1433 1866
 	$globalSBS1Hosts = array();
@@ -1449,23 +1882,37 @@  discard block
 block discarded – undo
1449 1882
 	$name = $_POST['name'];
1450 1883
 	$format = $_POST['format'];
1451 1884
 	$timezones = $_POST['timezones'];
1452
-	if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats'];
1453
-	else $sourcestats = array();
1454
-	if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive'];
1455
-	else $noarchive = array();
1885
+	if (isset($_POST['sourcestats'])) {
1886
+		$sourcestats = $_POST['sourcestats'];
1887
+	} else {
1888
+		$sourcestats = array();
1889
+	}
1890
+	if (isset($_POST['noarchive'])) {
1891
+		$noarchive = $_POST['noarchive'];
1892
+	} else {
1893
+		$noarchive = array();
1894
+	}
1456 1895
 	$gSources = array();
1457 1896
 	$forcepilots = false;
1458 1897
 	foreach ($host as $key => $h) {
1459
-		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE';
1460
-		else $cov = 'FALSE';
1461
-		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1462
-		else $arch = 'FALSE';
1898
+		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) {
1899
+			$cov = 'TRUE';
1900
+		} else {
1901
+			$cov = 'FALSE';
1902
+		}
1903
+		if (isset($noarchive[$key]) && $noarchive[$key] == 1) {
1904
+			$arch = 'TRUE';
1905
+		} else {
1906
+			$arch = 'FALSE';
1907
+		}
1463 1908
 		if (strpos($format[$key],'_callback')) {
1464 1909
 			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE');
1465 1910
 		} elseif ($format[$key] != 'auto' || ($h != '' || $name[$key] != '')) {
1466 1911
 			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE');
1467 1912
 		}
1468
-		if ($format[$key] == 'airwhere') $forcepilots = true;
1913
+		if ($format[$key] == 'airwhere') {
1914
+			$forcepilots = true;
1915
+		}
1469 1916
 	}
1470 1917
 	$settings = array_merge($settings,array('globalSources' => $gSources));
1471 1918
 
@@ -1501,7 +1948,9 @@  discard block
 block discarded – undo
1501 1948
 	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1502 1949
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1503 1950
 		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1504
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1951
+	} else {
1952
+		$settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1953
+	}
1505 1954
 
1506 1955
 	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1507 1956
 	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
@@ -1542,7 +1991,9 @@  discard block
 block discarded – undo
1542 1991
 
1543 1992
 	// Create in settings.php keys not yet configurable if not already here
1544 1993
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1545
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1994
+	if (!isset($globalDebug)) {
1995
+		$settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1996
+	}
1546 1997
 
1547 1998
 	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1548 1999
 	if ($resetyearstats == 'resetyearstats') {
@@ -1585,37 +2036,56 @@  discard block
 block discarded – undo
1585 2036
 	}
1586 2037
 */
1587 2038
 	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1588
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1589
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1590
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1591
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
2039
+	if ($globalsbs == 'sbs') {
2040
+		$settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
2041
+	} else {
2042
+		$settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
2043
+	}
2044
+	if ($globalaprs == 'aprs') {
2045
+		$settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
2046
+	} else {
2047
+		$settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
2048
+	}
1592 2049
 	$va = false;
1593 2050
 	if ($globalivao == 'ivao') {
1594 2051
 		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1595 2052
 		$va = true;
1596
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
2053
+	} else {
2054
+		$settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
2055
+	}
1597 2056
 	if ($globalvatsim == 'vatsim') {
1598 2057
 		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1599 2058
 		$va = true;
1600
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
2059
+	} else {
2060
+		$settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
2061
+	}
1601 2062
 	if ($globalphpvms == 'phpvms') {
1602 2063
 		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1603 2064
 		$va = true;
1604
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
2065
+	} else {
2066
+		$settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
2067
+	}
1605 2068
 	if ($globalvam == 'vam') {
1606 2069
 		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1607 2070
 		$va = true;
1608
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
2071
+	} else {
2072
+		$settings = array_merge($settings,array('globalVAM' => 'FALSE'));
2073
+	}
1609 2074
 	if ($va) {
1610 2075
 		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1611
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
2076
+	} else {
2077
+		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
2078
+	}
1612 2079
 	if ($globalva == 'va' || $va) {
1613 2080
 		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1614 2081
 		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1615 2082
 	} else {
1616 2083
 		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1617
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1618
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
2084
+		if ($forcepilots) {
2085
+			$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
2086
+		} else {
2087
+			$settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
2088
+		}
1619 2089
 	}
1620 2090
 	if ($globalvm == 'vm') {
1621 2091
 		$settings = array_merge($settings,array('globalVM' => 'TRUE'));
@@ -1875,7 +2345,9 @@  discard block
 block discarded – undo
1875 2345
 	$graphhopper = filter_input(INPUT_POST,'graphhopper',FILTER_SANITIZE_STRING);
1876 2346
 	$settings = array_merge($settings,array('globalGraphHopperKey' => $graphhopper));
1877 2347
 
1878
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
2348
+	if (!isset($globalTransaction)) {
2349
+		$settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
2350
+	}
1879 2351
 
1880 2352
 	// Set some defaults values...
1881 2353
 	if (!isset($globalAircraftImageSources)) {
@@ -1890,15 +2362,23 @@  discard block
 block discarded – undo
1890 2362
 
1891 2363
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1892 2364
 
1893
-	if ($error == '') settings::modify_settings($settings);
1894
-	if ($error == '') settings::comment_settings($settings_comment);
2365
+	if ($error == '') {
2366
+		settings::modify_settings($settings);
2367
+	}
2368
+	if ($error == '') {
2369
+		settings::comment_settings($settings_comment);
2370
+	}
1895 2371
 	if ($error != '') {
1896 2372
 		print '<div class="info column">'.$error.'</div>';
1897 2373
 		require('../footer.php');
1898 2374
 		exit;
1899 2375
 	} else {
1900
-		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1;
1901
-		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1;
2376
+		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') {
2377
+			$_SESSION['waypoints'] = 1;
2378
+		}
2379
+		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') {
2380
+			$_SESSION['owner'] = 1;
2381
+		}
1902 2382
 		if (isset($_POST['createdb'])) {
1903 2383
 			$_SESSION['install'] = 'database_create';
1904 2384
 		} else {
@@ -1935,10 +2415,18 @@  discard block
 block discarded – undo
1935 2415
 	$popw = false;
1936 2416
 	foreach ($_SESSION['done'] as $done) {
1937 2417
 	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1938
-	    if ($done == 'Create database') $pop = true;
1939
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1940
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1941
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
2418
+	    if ($done == 'Create database') {
2419
+	    	$pop = true;
2420
+	    }
2421
+	    if ($_SESSION['install'] == 'database_create') {
2422
+	    	$pop = true;
2423
+	    }
2424
+	    if ($_SESSION['install'] == 'database_import') {
2425
+	    	$popi = true;
2426
+	    }
2427
+	    if ($_SESSION['install'] == 'waypoints') {
2428
+	    	$popw = true;
2429
+	    }
1942 2430
 	}
1943 2431
 	if ($pop) {
1944 2432
 	    sleep(5);
@@ -1949,7 +2437,9 @@  discard block
 block discarded – undo
1949 2437
 	} else if ($popw) {
1950 2438
 	    sleep(5);
1951 2439
 	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1952
-	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
2440
+	} else {
2441
+		print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
2442
+	}
1953 2443
 	print '</div></ul>';
1954 2444
 	print '<div id="error"></div>';
1955 2445
 /*	foreach ($_SESSION['done'] as $done) {
Please login to merge, or discard this patch.