Completed
Push — master ( fa71c2...10ce33 )
by Yannick
07:41
created
install/index.php 3 patches
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -317,18 +317,18 @@  discard block
 block discarded – undo
317 317
 				</tr>
318 318
 				<!--
319 319
 		<?php
320
-		    require_once(dirname(__FILE__).'/../require/class.Connection.php');
321
-		    $Connection = new Connection();
320
+			require_once(dirname(__FILE__).'/../require/class.Connection.php');
321
+			$Connection = new Connection();
322 322
 		?>
323 323
 				-->
324 324
 		<?php
325
-		    if ($Connection->db != NULL) {
325
+			if ($Connection->db != NULL) {
326 326
 			if ($Connection->tableExists('source_location')) {
327
-			    require_once(dirname(__FILE__).'/../require/class.Source.php');
328
-			    $Source = new Source();
329
-			    //$alllocations = $Source->getAllLocationInfo();
330
-			    $alllocations = $Source->getLocationInfobyType('');
331
-			    foreach ($alllocations as $location) {
327
+				require_once(dirname(__FILE__).'/../require/class.Source.php');
328
+				$Source = new Source();
329
+				//$alllocations = $Source->getAllLocationInfo();
330
+				$alllocations = $Source->getLocationInfobyType('');
331
+				foreach ($alllocations as $location) {
332 332
 		?>
333 333
 				<tr>
334 334
 	    				<input type="hidden" name="source_id[]" value="<?php print $location['id']; ?>" />
@@ -342,9 +342,9 @@  discard block
 block discarded – undo
342 342
 				</tr>
343 343
 		
344 344
 		<?php
345
-			    }
345
+				}
346
+			}
346 347
 			}
347
-		    }
348 348
 		?>
349 349
 
350 350
 				<tr>
@@ -452,12 +452,12 @@  discard block
 block discarded – undo
452 452
 ?>
453 453
 							<tr>
454 454
 								<?php
455
-								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
455
+									if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
456 456
 								?>
457 457
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
458 458
 								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
459 459
 								<?php
460
-								    } else {
460
+									} else {
461 461
 									$hostport = explode(':',$source['host']);
462 462
 									if (isset($hostport[1])) {
463 463
 										$host = $hostport[0];
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 								<td><input type="text" name="host[]" id="host" value="<?php print $host; ?>" /></td>
471 471
 								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php print $port; ?>" /></td>
472 472
 								<?php
473
-								    }
473
+									}
474 474
 								?>
475 475
 								<td>
476 476
 									<select name="format[]" id="format">
@@ -879,7 +879,7 @@  discard block
 block discarded – undo
879 879
 			<br />
880 880
 			<p>
881 881
 			<?php 
882
-			    if (extension_loaded('gd') && function_exists('gd_info')) {
882
+				if (extension_loaded('gd') && function_exists('gd_info')) {
883 883
 			?>
884 884
 				<label for="aircrafticoncolor">Color of aircraft icon on map</label>
885 885
 				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />
@@ -889,11 +889,11 @@  discard block
 block discarded – undo
889 889
 				<b>The directory cache is not writable, aircraft icon will not be cached</b>
890 890
 			<?php
891 891
 				}
892
-			    } else {
892
+				} else {
893 893
 			?>
894 894
 				<b>PHP GD is not installed, you can't change color of aircraft icon on map</b>
895 895
 			<?php
896
-			    }
896
+				}
897 897
 			?>
898 898
 			</p>
899 899
 			<br />
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
 	</p>
918 918
 <?php
919 919
 	require('../footer.php');
920
-        exit;
920
+		exit;
921 921
 }
922 922
 	
923 923
 $settings = array();
@@ -1008,8 +1008,8 @@  discard block
 block discarded – undo
1008 1008
 	
1009 1009
 	$sources = array();
1010 1010
 	foreach ($source_name as $keys => $name) {
1011
-	    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]);
1012
-	    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]);
1011
+		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]);
1012
+		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]);
1013 1013
 	}
1014 1014
 	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1015 1015
 
@@ -1391,14 +1391,14 @@  discard block
 block discarded – undo
1391 1391
 
1392 1392
 	// Set some defaults values...
1393 1393
 	if (!isset($globalAircraftImageSources)) {
1394
-	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1395
-	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1394
+		$globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1395
+		$settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1396 1396
 	}
1397 1397
 
1398 1398
 	if (!isset($globalSchedulesSources)) {
1399
-	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1400
-    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1401
-    	}
1399
+		$globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1400
+			$settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1401
+		}
1402 1402
 
1403 1403
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1404 1404
 
@@ -1450,21 +1450,21 @@  discard block
 block discarded – undo
1450 1450
 	$popi = false;
1451 1451
 	$popw = false;
1452 1452
 	foreach ($_SESSION['done'] as $done) {
1453
-	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1454
-	    if ($done == 'Create database') $pop = true;
1455
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1456
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1457
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
1453
+		print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1454
+		if ($done == 'Create database') $pop = true;
1455
+		if ($_SESSION['install'] == 'database_create') $pop = true;
1456
+		if ($_SESSION['install'] == 'database_import') $popi = true;
1457
+		if ($_SESSION['install'] == 'waypoints') $popw = true;
1458 1458
 	}
1459 1459
 	if ($pop) {
1460
-	    sleep(5);
1461
-	    print '<li>Create database....<img src="../images/loading.gif" /></li>';
1460
+		sleep(5);
1461
+		print '<li>Create database....<img src="../images/loading.gif" /></li>';
1462 1462
 	} else if ($popi) {
1463
-	    sleep(5);
1464
-	    print '<li>Create and import tables....<img src="../images/loading.gif" /></li>';
1463
+		sleep(5);
1464
+		print '<li>Create and import tables....<img src="../images/loading.gif" /></li>';
1465 1465
 	} else if ($popw) {
1466
-	    sleep(5);
1467
-	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1466
+		sleep(5);
1467
+		print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1468 1468
 	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
1469 1469
 	print '</div></ul>';
1470 1470
 	print '<div id="error"></div>';
@@ -1527,7 +1527,7 @@  discard block
 block discarded – undo
1527 1527
 	unset($_COOKIE['install']);
1528 1528
 	print '<div class="info column"><ul>';
1529 1529
 	foreach ($_SESSION['done'] as $done) {
1530
-	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1530
+		print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1531 1531
 	}
1532 1532
 	print '<li>Reloading page to check all is now ok....<strong>SUCCESS</strong></li>';
1533 1533
 	print '</ul></div>';
Please login to merge, or discard this patch.
Spacing   +243 added lines, -243 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 require_once(dirname(__FILE__).'/class.create_db.php');
11 11
 require_once(dirname(__FILE__).'/class.update_schema.php');
12 12
 require_once(dirname(__FILE__).'/class.settings.php');
13
-$title="Install";
13
+$title = "Install";
14 14
 require(dirname(__FILE__).'/../require/settings.php');
15 15
 require(dirname(__FILE__).'/header.php');
16 16
 
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 if (!extension_loaded('curl')) {
70 70
 	$error[] = "Curl is not loaded.";
71 71
 }
72
-if(function_exists('apache_get_modules') ){
73
-	if(!in_array('mod_rewrite',apache_get_modules())) {
72
+if (function_exists('apache_get_modules')) {
73
+	if (!in_array('mod_rewrite', apache_get_modules())) {
74 74
 		$error[] = "mod_rewrite is not available.";
75 75
 	}
76 76
 /*
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 print '<div class="info column"><p><strong>If you use MySQL or MariaDB, check that <i>max_allowed_packet</i> >= 8M, else import of some table can fail.</strong></p></div>';
87 87
 if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) {
88 88
 	if (function_exists('get_headers')) {
89
-		$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/','search',str_replace('index.php',$_SERVER["REQUEST_URI"])));
90
-		if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) {
89
+		$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/', 'search', str_replace('index.php', $_SERVER["REQUEST_URI"])));
90
+		if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) {
91 91
 			print '<div class="info column"><p><strong>Check your configuration, rewrite don\'t seems to work.</strong></p></div>';
92 92
 		}
93 93
 	}
@@ -452,13 +452,13 @@  discard block
 block discarded – undo
452 452
 ?>
453 453
 							<tr>
454 454
 								<?php
455
-								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
455
+								    if (filter_var($source['host'], FILTER_VALIDATE_URL)) {
456 456
 								?>
457 457
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
458 458
 								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
459 459
 								<?php
460 460
 								    } else {
461
-									$hostport = explode(':',$source['host']);
461
+									$hostport = explode(':', $source['host']);
462 462
 									if (isset($hostport[1])) {
463 463
 										$host = $hostport[0];
464 464
 										$port = $hostport[1];
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 									<select name="timezone[]" id="timezone">
505 505
 								<?php
506 506
 									$timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
507
-									foreach($timezonelist as $timezone){
507
+									foreach ($timezonelist as $timezone) {
508 508
 										if (isset($source['timezone']) && $source['timezone'] == $timezone) {
509 509
 											print '<option selected>'.$timezone.'</option>';
510 510
 										} elseif (!isset($source['timezone']) && $timezone == 'UTC') {
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 									<select name="timezone[]" id="timezone">
556 556
 								<?php
557 557
 									$timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
558
-									foreach($timezonelist as $timezone){
558
+									foreach ($timezonelist as $timezone) {
559 559
 										if ($timezone == 'UTC') {
560 560
 											print '<option selected>'.$timezone.'</option>';
561 561
 										} else print '<option>'.$timezone.'</option>';
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
 			<br />
870 870
 			<p>
871 871
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
872
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
872
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" />
873 873
 			</p>
874 874
 			<br />
875 875
 			<p>
@@ -925,14 +925,14 @@  discard block
 block discarded – undo
925 925
 $error = '';
926 926
 
927 927
 if (isset($_POST['dbtype'])) {
928
-	$dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING);
929
-	$dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING);
930
-	$dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING);
931
-	$dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING);
932
-	$dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING);
933
-	$dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING);
934
-	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
935
-	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
928
+	$dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING);
929
+	$dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING);
930
+	$dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING);
931
+	$dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING);
932
+	$dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING);
933
+	$dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING);
934
+	$dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING);
935
+	$dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING);
936 936
 
937 937
 	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
938 938
 	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
@@ -952,49 +952,49 @@  discard block
 block discarded – undo
952 952
 	} else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
953 953
 	*/
954 954
 	
955
-	$settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
955
+	$settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname));
956 956
 
957
-	$sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING);
958
-	$siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING);
959
-	$timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING);
960
-	$language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING);
961
-	$settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language));
957
+	$sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING);
958
+	$siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING);
959
+	$timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING);
960
+	$language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
961
+	$settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language));
962 962
 
963
-	$mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING);
964
-	$mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING);
965
-	$mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING);
966
-	$googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING);
967
-	$bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING);
968
-	$openweathermapkey = filter_input(INPUT_POST,'openweathermapkey',FILTER_SANITIZE_STRING);
969
-	$mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING);
970
-	$hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING);
971
-	$hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING);
972
-	$settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey,'globalOpenWeatherMapKey' => $openweathermapkey));
963
+	$mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING);
964
+	$mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING);
965
+	$mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING);
966
+	$googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING);
967
+	$bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING);
968
+	$openweathermapkey = filter_input(INPUT_POST, 'openweathermapkey', FILTER_SANITIZE_STRING);
969
+	$mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING);
970
+	$hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING);
971
+	$hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING);
972
+	$settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey, 'globalOpenWeatherMapKey' => $openweathermapkey));
973 973
 	
974
-	$latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING);
975
-	$latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING);
976
-	$longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING);
977
-	$longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING);
978
-	$livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT);
979
-	$settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom));
974
+	$latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING);
975
+	$latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING);
976
+	$longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING);
977
+	$longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING);
978
+	$livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT);
979
+	$settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom));
980 980
 
981
-	$squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING);
982
-	$settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country));
981
+	$squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING);
982
+	$settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country));
983 983
 
984
-	$latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING);
985
-	$longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING);
986
-	$settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter));
984
+	$latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING);
985
+	$longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING);
986
+	$settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter));
987 987
 
988
-	$acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING);
988
+	$acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING);
989 989
 	if ($acars == 'acars') {
990
-		$settings = array_merge($settings,array('globalACARS' => 'TRUE'));
990
+		$settings = array_merge($settings, array('globalACARS' => 'TRUE'));
991 991
 	} else {
992
-		$settings = array_merge($settings,array('globalACARS' => 'FALSE'));
992
+		$settings = array_merge($settings, array('globalACARS' => 'FALSE'));
993 993
 	}
994 994
 
995
-	$flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING);
996
-	$flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING);
997
-	$settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword));
995
+	$flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING);
996
+	$flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING);
997
+	$settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword));
998 998
 	
999 999
 	$source_name = $_POST['source_name'];
1000 1000
 	$source_latitude = $_POST['source_latitude'];
@@ -1008,8 +1008,8 @@  discard block
 block discarded – undo
1008 1008
 	
1009 1009
 	$sources = array();
1010 1010
 	foreach ($source_name as $keys => $name) {
1011
-	    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]);
1012
-	    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]);
1011
+	    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]);
1012
+	    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]);
1013 1013
 	}
1014 1014
 	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1015 1015
 
@@ -1022,24 +1022,24 @@  discard block
 block discarded – undo
1022 1022
 	$sbsurl = $_POST['sbsurl'];
1023 1023
 	*/
1024 1024
 
1025
-	$globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING);
1026
-	$globalva = filter_input(INPUT_POST,'globalva',FILTER_SANITIZE_STRING);
1027
-	$globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING);
1028
-	$globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING);
1029
-	$globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING);
1030
-	$globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING);
1031
-	$globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING);
1032
-	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1025
+	$globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING);
1026
+	$globalva = filter_input(INPUT_POST, 'globalva', FILTER_SANITIZE_STRING);
1027
+	$globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING);
1028
+	$globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING);
1029
+	$globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING);
1030
+	$globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING);
1031
+	$globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING);
1032
+	$datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING);
1033 1033
 
1034
-	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1035
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1036
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1037
-	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1038
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1039
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1040
-	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1041
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1042
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1034
+	$globalaircraft = filter_input(INPUT_POST, 'globalaircraft', FILTER_SANITIZE_STRING);
1035
+	if ($globalaircraft == 'aircraft') $settings = array_merge($settings, array('globalAircraft' => 'TRUE'));
1036
+	else $settings = array_merge($settings, array('globalAircraft' => 'FALSE'));
1037
+	$globaltracker = filter_input(INPUT_POST, 'globaltracker', FILTER_SANITIZE_STRING);
1038
+	if ($globaltracker == 'tracker') $settings = array_merge($settings, array('globalTracker' => 'TRUE'));
1039
+	else $settings = array_merge($settings, array('globalTracker' => 'FALSE'));
1040
+	$globalmarine = filter_input(INPUT_POST, 'globalmarine', FILTER_SANITIZE_STRING);
1041
+	if ($globalmarine == 'marine') $settings = array_merge($settings, array('globalMarine' => 'TRUE'));
1042
+	else $settings = array_merge($settings, array('globalMarine' => 'FALSE'));
1043 1043
 
1044 1044
 /*	
1045 1045
 	$globalSBS1Hosts = array();
@@ -1055,7 +1055,7 @@  discard block
 block discarded – undo
1055 1055
 	}
1056 1056
 	$settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts));
1057 1057
 */
1058
-	$settings_comment = array_merge($settings_comment,array('globalSBS1Hosts'));
1058
+	$settings_comment = array_merge($settings_comment, array('globalSBS1Hosts'));
1059 1059
 	$host = $_POST['host'];
1060 1060
 	$port = $_POST['port'];
1061 1061
 	$name = $_POST['name'];
@@ -1072,104 +1072,104 @@  discard block
 block discarded – undo
1072 1072
 		else $cov = 'FALSE';
1073 1073
 		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1074 1074
 		else $arch = 'FALSE';
1075
-		if (strpos($format[$key],'_callback')) {
1076
-			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezone[$key],'callback' => 'TRUE');
1075
+		if (strpos($format[$key], '_callback')) {
1076
+			$gSources[] = array('host' => $h, 'pass' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezone[$key], 'callback' => 'TRUE');
1077 1077
 		} elseif ($h != '' || $name[$key] != '') {
1078
-			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezone[$key],'callback' => 'FALSE');
1078
+			$gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezone[$key], 'callback' => 'FALSE');
1079 1079
 		}
1080 1080
 		if ($format[$key] == 'airwhere') $forcepilots = true;
1081 1081
 	}
1082
-	$settings = array_merge($settings,array('globalSources' => $gSources));
1082
+	$settings = array_merge($settings, array('globalSources' => $gSources));
1083 1083
 
1084 1084
 /*
1085 1085
 	$sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT);
1086 1086
 	$settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout));
1087 1087
 */
1088
-	$acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING);
1089
-	$acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT);
1090
-	$settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport));
1088
+	$acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING);
1089
+	$acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT);
1090
+	$settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport));
1091 1091
 
1092
-	$bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING);
1093
-	$settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly));
1092
+	$bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING);
1093
+	$settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly));
1094 1094
 
1095
-	$customcss = filter_input(INPUT_POST,'customcss',FILTER_SANITIZE_STRING);
1096
-	$settings = array_merge($settings,array('globalCustomCSS' => $customcss));
1095
+	$customcss = filter_input(INPUT_POST, 'customcss', FILTER_SANITIZE_STRING);
1096
+	$settings = array_merge($settings, array('globalCustomCSS' => $customcss));
1097 1097
 
1098
-	$notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING);
1099
-	$settings = array_merge($settings,array('globalNOTAMSource' => $notamsource));
1100
-	$metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING);
1101
-	$settings = array_merge($settings,array('globalMETARurl' => $metarsource));
1098
+	$notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING);
1099
+	$settings = array_merge($settings, array('globalNOTAMSource' => $notamsource));
1100
+	$metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING);
1101
+	$settings = array_merge($settings, array('globalMETARurl' => $metarsource));
1102 1102
 
1103
-	$zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING);
1104
-	$zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING);
1105
-	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1103
+	$zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING);
1104
+	$zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING);
1105
+	$zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT);
1106 1106
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1107
-		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1108
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1107
+		$settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance)));
1108
+	} else $settings = array_merge($settings, array('globalDistanceIgnore' => array()));
1109 1109
 
1110
-	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1111
-	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
1112
-	$maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT);
1113
-	$settings = array_merge($settings,array('globalMapRefresh' => $maprefresh));
1114
-	$mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT);
1115
-	$settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle));
1116
-	$closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT);
1117
-	$settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist));
1110
+	$refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT);
1111
+	$settings = array_merge($settings, array('globalLiveInterval' => $refresh));
1112
+	$maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT);
1113
+	$settings = array_merge($settings, array('globalMapRefresh' => $maprefresh));
1114
+	$mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT);
1115
+	$settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle));
1116
+	$closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT);
1117
+	$settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist));
1118 1118
 
1119
-	$aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT);
1120
-	$settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize));
1119
+	$aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT);
1120
+	$settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize));
1121 1121
 
1122
-	$archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT);
1123
-	$settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths));
1122
+	$archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT);
1123
+	$settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths));
1124 1124
 	
1125
-	$archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING);
1125
+	$archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING);
1126 1126
 	if ($archiveyear == "archiveyear") {
1127
-		$settings = array_merge($settings,array('globalArchiveYear' => 'TRUE'));
1127
+		$settings = array_merge($settings, array('globalArchiveYear' => 'TRUE'));
1128 1128
 	} else {
1129
-		$settings = array_merge($settings,array('globalArchiveYear' => 'FALSE'));
1129
+		$settings = array_merge($settings, array('globalArchiveYear' => 'FALSE'));
1130 1130
 	}
1131
-	$archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT);
1132
-	$settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths));
1133
-	$archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT);
1134
-	$settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1131
+	$archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT);
1132
+	$settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths));
1133
+	$archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT);
1134
+	$settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1135 1135
 
1136
-	$britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING);
1137
-	$settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways));
1138
-	$transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING);
1139
-	$settings = array_merge($settings,array('globalTransaviaKey' => $transavia));
1136
+	$britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING);
1137
+	$settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways));
1138
+	$transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING);
1139
+	$settings = array_merge($settings, array('globalTransaviaKey' => $transavia));
1140 1140
 
1141
-	$lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING);
1142
-	$lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING);
1143
-	$settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret)));
1141
+	$lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING);
1142
+	$lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING);
1143
+	$settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret)));
1144 1144
 
1145 1145
 	// Create in settings.php keys not yet configurable if not already here
1146 1146
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1147
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1147
+	if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE'));
1148 1148
 
1149
-	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1149
+	$resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING);
1150 1150
 	if ($resetyearstats == 'resetyearstats') {
1151
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE'));
1151
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE'));
1152 1152
 	} else {
1153
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE'));
1153
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE'));
1154 1154
 	}
1155 1155
 
1156
-	$archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING);
1156
+	$archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING);
1157 1157
 	if ($archive == 'archive') {
1158
-		$settings = array_merge($settings,array('globalArchive' => 'TRUE'));
1158
+		$settings = array_merge($settings, array('globalArchive' => 'TRUE'));
1159 1159
 	} else {
1160
-		$settings = array_merge($settings,array('globalArchive' => 'FALSE'));
1160
+		$settings = array_merge($settings, array('globalArchive' => 'FALSE'));
1161 1161
 	}
1162
-	$daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING);
1162
+	$daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING);
1163 1163
 	if ($daemon == 'daemon') {
1164
-		$settings = array_merge($settings,array('globalDaemon' => 'TRUE'));
1164
+		$settings = array_merge($settings, array('globalDaemon' => 'TRUE'));
1165 1165
 	} else {
1166
-		$settings = array_merge($settings,array('globalDaemon' => 'FALSE'));
1166
+		$settings = array_merge($settings, array('globalDaemon' => 'FALSE'));
1167 1167
 	}
1168
-	$schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING);
1168
+	$schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING);
1169 1169
 	if ($schedules == 'schedules') {
1170
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE'));
1170
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE'));
1171 1171
 	} else {
1172
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE'));
1172
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE'));
1173 1173
 	}
1174 1174
 
1175 1175
 /*
@@ -1180,227 +1180,227 @@  discard block
 block discarded – undo
1180 1180
 		$settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE'));
1181 1181
 	}
1182 1182
 */
1183
-	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1184
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1185
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1186
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1187
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1183
+	$settings = array_merge($settings, array('globalFlightAware' => 'FALSE'));
1184
+	if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE'));
1185
+	else $settings = array_merge($settings, array('globalSBS1' => 'FALSE'));
1186
+	if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE'));
1187
+	else $settings = array_merge($settings, array('globalAPRS' => 'FALSE'));
1188 1188
 	$va = false;
1189 1189
 	if ($globalivao == 'ivao') {
1190
-		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1190
+		$settings = array_merge($settings, array('globalIVAO' => 'TRUE'));
1191 1191
 		$va = true;
1192
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1192
+	} else $settings = array_merge($settings, array('globalIVAO' => 'FALSE'));
1193 1193
 	if ($globalvatsim == 'vatsim') {
1194
-		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1194
+		$settings = array_merge($settings, array('globalVATSIM' => 'TRUE'));
1195 1195
 		$va = true;
1196
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1196
+	} else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE'));
1197 1197
 	if ($globalphpvms == 'phpvms') {
1198
-		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1198
+		$settings = array_merge($settings, array('globalphpVMS' => 'TRUE'));
1199 1199
 		$va = true;
1200
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1200
+	} else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE'));
1201 1201
 	if ($globalvam == 'vam') {
1202
-		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1202
+		$settings = array_merge($settings, array('globalVAM' => 'TRUE'));
1203 1203
 		$va = true;
1204
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1204
+	} else $settings = array_merge($settings, array('globalVAM' => 'FALSE'));
1205 1205
 	if ($va) {
1206
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1207
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1206
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE'));
1207
+	} else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE'));
1208 1208
 	if ($globalva == 'va' || $va) {
1209
-		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1210
-		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1209
+		$settings = array_merge($settings, array('globalVA' => 'TRUE'));
1210
+		$settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE'));
1211 1211
 	} else {
1212
-		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1213
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1214
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1212
+		$settings = array_merge($settings, array('globalVA' => 'FALSE'));
1213
+		if ($forcepilots) $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE'));
1214
+		else $settings = array_merge($settings, array('globalUsePilot' => 'FALSE', 'globalUseOwner' => 'TRUE'));
1215 1215
 	}
1216 1216
 	
1217 1217
 	
1218 1218
 
1219
-	$notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING);
1219
+	$notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING);
1220 1220
 	if ($notam == 'notam') {
1221
-		$settings = array_merge($settings,array('globalNOTAM' => 'TRUE'));
1221
+		$settings = array_merge($settings, array('globalNOTAM' => 'TRUE'));
1222 1222
 	} else {
1223
-		$settings = array_merge($settings,array('globalNOTAM' => 'FALSE'));
1223
+		$settings = array_merge($settings, array('globalNOTAM' => 'FALSE'));
1224 1224
 	}
1225
-	$owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING);
1225
+	$owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING);
1226 1226
 	if ($owner == 'owner') {
1227
-		$settings = array_merge($settings,array('globalOwner' => 'TRUE'));
1227
+		$settings = array_merge($settings, array('globalOwner' => 'TRUE'));
1228 1228
 	} else {
1229
-		$settings = array_merge($settings,array('globalOwner' => 'FALSE'));
1229
+		$settings = array_merge($settings, array('globalOwner' => 'FALSE'));
1230 1230
 	}
1231
-	$map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING);
1231
+	$map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING);
1232 1232
 	if ($map3d == 'map3d') {
1233
-		$settings = array_merge($settings,array('globalMap3D' => 'TRUE'));
1233
+		$settings = array_merge($settings, array('globalMap3D' => 'TRUE'));
1234 1234
 	} else {
1235
-		$settings = array_merge($settings,array('globalMap3D' => 'FALSE'));
1235
+		$settings = array_merge($settings, array('globalMap3D' => 'FALSE'));
1236 1236
 	}
1237
-	$crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING);
1237
+	$crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING);
1238 1238
 	if ($crash == 'crash') {
1239
-		$settings = array_merge($settings,array('globalAccidents' => 'TRUE'));
1239
+		$settings = array_merge($settings, array('globalAccidents' => 'TRUE'));
1240 1240
 	} else {
1241
-		$settings = array_merge($settings,array('globalAccidents' => 'FALSE'));
1241
+		$settings = array_merge($settings, array('globalAccidents' => 'FALSE'));
1242 1242
 	}
1243
-	$mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING);
1243
+	$mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING);
1244 1244
 	if ($mapsatellites == 'mapsatellites') {
1245
-		$settings = array_merge($settings,array('globalMapSatellites' => 'TRUE'));
1245
+		$settings = array_merge($settings, array('globalMapSatellites' => 'TRUE'));
1246 1246
 	} else {
1247
-		$settings = array_merge($settings,array('globalMapSatellites' => 'FALSE'));
1247
+		$settings = array_merge($settings, array('globalMapSatellites' => 'FALSE'));
1248 1248
 	}
1249
-	$map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING);
1249
+	$map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING);
1250 1250
 	if ($map3ddefault == 'map3ddefault') {
1251
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE'));
1251
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE'));
1252 1252
 	} else {
1253
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE'));
1253
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE'));
1254 1254
 	}
1255
-	$translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING);
1255
+	$translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING);
1256 1256
 	if ($translate == 'translate') {
1257
-		$settings = array_merge($settings,array('globalTranslate' => 'TRUE'));
1257
+		$settings = array_merge($settings, array('globalTranslate' => 'TRUE'));
1258 1258
 	} else {
1259
-		$settings = array_merge($settings,array('globalTranslate' => 'FALSE'));
1259
+		$settings = array_merge($settings, array('globalTranslate' => 'FALSE'));
1260 1260
 	}
1261
-	$realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING);
1261
+	$realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING);
1262 1262
 	if ($realairlines == 'realairlines') {
1263
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE'));
1263
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE'));
1264 1264
 	} else {
1265
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE'));
1265
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE'));
1266 1266
 	}
1267
-	$estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING);
1267
+	$estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING);
1268 1268
 	if ($estimation == 'estimation') {
1269
-		$settings = array_merge($settings,array('globalMapEstimation' => 'TRUE'));
1269
+		$settings = array_merge($settings, array('globalMapEstimation' => 'TRUE'));
1270 1270
 	} else {
1271
-		$settings = array_merge($settings,array('globalMapEstimation' => 'FALSE'));
1271
+		$settings = array_merge($settings, array('globalMapEstimation' => 'FALSE'));
1272 1272
 	}
1273
-	$metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING);
1273
+	$metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING);
1274 1274
 	if ($metar == 'metar') {
1275
-		$settings = array_merge($settings,array('globalMETAR' => 'TRUE'));
1275
+		$settings = array_merge($settings, array('globalMETAR' => 'TRUE'));
1276 1276
 	} else {
1277
-		$settings = array_merge($settings,array('globalMETAR' => 'FALSE'));
1277
+		$settings = array_merge($settings, array('globalMETAR' => 'FALSE'));
1278 1278
 	}
1279
-	$metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING);
1279
+	$metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING);
1280 1280
 	if ($metarcycle == 'metarcycle') {
1281
-		$settings = array_merge($settings,array('globalMETARcycle' => 'TRUE'));
1281
+		$settings = array_merge($settings, array('globalMETARcycle' => 'TRUE'));
1282 1282
 	} else {
1283
-		$settings = array_merge($settings,array('globalMETARcycle' => 'FALSE'));
1283
+		$settings = array_merge($settings, array('globalMETARcycle' => 'FALSE'));
1284 1284
 	}
1285
-	$fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING);
1285
+	$fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING);
1286 1286
 	if ($fork == 'fork') {
1287
-		$settings = array_merge($settings,array('globalFork' => 'TRUE'));
1287
+		$settings = array_merge($settings, array('globalFork' => 'TRUE'));
1288 1288
 	} else {
1289
-		$settings = array_merge($settings,array('globalFork' => 'FALSE'));
1289
+		$settings = array_merge($settings, array('globalFork' => 'FALSE'));
1290 1290
 	}
1291 1291
 
1292
-	$colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING);
1292
+	$colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING);
1293 1293
 	if ($colormap == 'colormap') {
1294
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE'));
1294
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE'));
1295 1295
 	} else {
1296
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE'));
1296
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE'));
1297 1297
 	}
1298 1298
 	
1299 1299
 	if (isset($_POST['aircrafticoncolor'])) {
1300
-		$aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING);
1301
-		$settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1)));
1300
+		$aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING);
1301
+		$settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1)));
1302 1302
 	}
1303 1303
 
1304
-	$airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT);
1305
-	$settings = array_merge($settings,array('globalAirportZoom' => $airportzoom));
1304
+	$airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT);
1305
+	$settings = array_merge($settings, array('globalAirportZoom' => $airportzoom));
1306 1306
 
1307
-	$unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING);
1308
-	$settings = array_merge($settings,array('globalUnitDistance' => $unitdistance));
1309
-	$unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING);
1310
-	$settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude));
1311
-	$unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING);
1312
-	$settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed));
1307
+	$unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING);
1308
+	$settings = array_merge($settings, array('globalUnitDistance' => $unitdistance));
1309
+	$unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING);
1310
+	$settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude));
1311
+	$unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING);
1312
+	$settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed));
1313 1313
 
1314
-	$mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING);
1314
+	$mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING);
1315 1315
 	if ($mappopup == 'mappopup') {
1316
-		$settings = array_merge($settings,array('globalMapPopup' => 'TRUE'));
1316
+		$settings = array_merge($settings, array('globalMapPopup' => 'TRUE'));
1317 1317
 	} else {
1318
-		$settings = array_merge($settings,array('globalMapPopup' => 'FALSE'));
1318
+		$settings = array_merge($settings, array('globalMapPopup' => 'FALSE'));
1319 1319
 	}
1320
-	$airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING);
1320
+	$airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING);
1321 1321
 	if ($airportpopup == 'airportpopup') {
1322
-		$settings = array_merge($settings,array('globalAirportPopup' => 'TRUE'));
1322
+		$settings = array_merge($settings, array('globalAirportPopup' => 'TRUE'));
1323 1323
 	} else {
1324
-		$settings = array_merge($settings,array('globalAirportPopup' => 'FALSE'));
1324
+		$settings = array_merge($settings, array('globalAirportPopup' => 'FALSE'));
1325 1325
 	}
1326
-	$maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING);
1326
+	$maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING);
1327 1327
 	if ($maphistory == 'maphistory') {
1328
-		$settings = array_merge($settings,array('globalMapHistory' => 'TRUE'));
1328
+		$settings = array_merge($settings, array('globalMapHistory' => 'TRUE'));
1329 1329
 	} else {
1330
-		$settings = array_merge($settings,array('globalMapHistory' => 'FALSE'));
1330
+		$settings = array_merge($settings, array('globalMapHistory' => 'FALSE'));
1331 1331
 	}
1332
-	$maptooltip = filter_input(INPUT_POST,'maptooltip',FILTER_SANITIZE_STRING);
1332
+	$maptooltip = filter_input(INPUT_POST, 'maptooltip', FILTER_SANITIZE_STRING);
1333 1333
 	if ($maptooltip == 'maptooltip') {
1334
-		$settings = array_merge($settings,array('globalMapTooltip' => 'TRUE'));
1334
+		$settings = array_merge($settings, array('globalMapTooltip' => 'TRUE'));
1335 1335
 	} else {
1336
-		$settings = array_merge($settings,array('globalMapTooltip' => 'FALSE'));
1336
+		$settings = array_merge($settings, array('globalMapTooltip' => 'FALSE'));
1337 1337
 	}
1338
-	$flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING);
1338
+	$flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING);
1339 1339
 	if ($flightroute == 'flightroute') {
1340
-		$settings = array_merge($settings,array('globalMapRoute' => 'TRUE'));
1340
+		$settings = array_merge($settings, array('globalMapRoute' => 'TRUE'));
1341 1341
 	} else {
1342
-		$settings = array_merge($settings,array('globalMapRoute' => 'FALSE'));
1342
+		$settings = array_merge($settings, array('globalMapRoute' => 'FALSE'));
1343 1343
 	}
1344
-	$flightremainingroute = filter_input(INPUT_POST,'flightremainingroute',FILTER_SANITIZE_STRING);
1344
+	$flightremainingroute = filter_input(INPUT_POST, 'flightremainingroute', FILTER_SANITIZE_STRING);
1345 1345
 	if ($flightremainingroute == 'flightremainingroute') {
1346
-		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'TRUE'));
1346
+		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'TRUE'));
1347 1347
 	} else {
1348
-		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'FALSE'));
1348
+		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'FALSE'));
1349 1349
 	}
1350
-	$allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING);
1350
+	$allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING);
1351 1351
 	if ($allflights == 'allflights') {
1352
-		$settings = array_merge($settings,array('globalAllFlights' => 'TRUE'));
1352
+		$settings = array_merge($settings, array('globalAllFlights' => 'TRUE'));
1353 1353
 	} else {
1354
-		$settings = array_merge($settings,array('globalAllFlights' => 'FALSE'));
1354
+		$settings = array_merge($settings, array('globalAllFlights' => 'FALSE'));
1355 1355
 	}
1356
-	$bbox = filter_input(INPUT_POST,'bbox',FILTER_SANITIZE_STRING);
1356
+	$bbox = filter_input(INPUT_POST, 'bbox', FILTER_SANITIZE_STRING);
1357 1357
 	if ($bbox == 'bbox') {
1358
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'TRUE'));
1358
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'TRUE'));
1359 1359
 	} else {
1360
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'FALSE'));
1360
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'FALSE'));
1361 1361
 	}
1362
-	$groundaltitude = filter_input(INPUT_POST,'groundaltitude',FILTER_SANITIZE_STRING);
1362
+	$groundaltitude = filter_input(INPUT_POST, 'groundaltitude', FILTER_SANITIZE_STRING);
1363 1363
 	if ($groundaltitude == 'groundaltitude') {
1364
-		$settings = array_merge($settings,array('globalGroundAltitude' => 'TRUE'));
1364
+		$settings = array_merge($settings, array('globalGroundAltitude' => 'TRUE'));
1365 1365
 	} else {
1366
-		$settings = array_merge($settings,array('globalGroundAltitude' => 'FALSE'));
1366
+		$settings = array_merge($settings, array('globalGroundAltitude' => 'FALSE'));
1367 1367
 	}
1368
-	$waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING);
1368
+	$waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING);
1369 1369
 	if ($waypoints == 'waypoints') {
1370
-		$settings = array_merge($settings,array('globalWaypoints' => 'TRUE'));
1370
+		$settings = array_merge($settings, array('globalWaypoints' => 'TRUE'));
1371 1371
 	} else {
1372
-		$settings = array_merge($settings,array('globalWaypoints' => 'FALSE'));
1372
+		$settings = array_merge($settings, array('globalWaypoints' => 'FALSE'));
1373 1373
 	}
1374
-	$geoid = filter_input(INPUT_POST,'geoid',FILTER_SANITIZE_STRING);
1374
+	$geoid = filter_input(INPUT_POST, 'geoid', FILTER_SANITIZE_STRING);
1375 1375
 	if ($geoid == 'geoid') {
1376
-		$settings = array_merge($settings,array('globalGeoid' => 'TRUE'));
1376
+		$settings = array_merge($settings, array('globalGeoid' => 'TRUE'));
1377 1377
 	} else {
1378
-		$settings = array_merge($settings,array('globalGeoid' => 'FALSE'));
1378
+		$settings = array_merge($settings, array('globalGeoid' => 'FALSE'));
1379 1379
 	}
1380
-	$geoid_source = filter_input(INPUT_POST,'geoid_source',FILTER_SANITIZE_STRING);
1381
-	$settings = array_merge($settings,array('globalGeoidSource' => $geoid_source));
1380
+	$geoid_source = filter_input(INPUT_POST, 'geoid_source', FILTER_SANITIZE_STRING);
1381
+	$settings = array_merge($settings, array('globalGeoidSource' => $geoid_source));
1382 1382
 
1383
-	$noairlines = filter_input(INPUT_POST,'noairlines',FILTER_SANITIZE_STRING);
1383
+	$noairlines = filter_input(INPUT_POST, 'noairlines', FILTER_SANITIZE_STRING);
1384 1384
 	if ($noairlines == 'noairlines') {
1385
-		$settings = array_merge($settings,array('globalNoAirlines' => 'TRUE'));
1385
+		$settings = array_merge($settings, array('globalNoAirlines' => 'TRUE'));
1386 1386
 	} else {
1387
-		$settings = array_merge($settings,array('globalNoAirlines' => 'FALSE'));
1387
+		$settings = array_merge($settings, array('globalNoAirlines' => 'FALSE'));
1388 1388
 	}
1389 1389
 
1390
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1390
+	if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE'));
1391 1391
 
1392 1392
 	// Set some defaults values...
1393 1393
 	if (!isset($globalAircraftImageSources)) {
1394
-	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1395
-	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1394
+	    $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters');
1395
+	    $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources));
1396 1396
 	}
1397 1397
 
1398 1398
 	if (!isset($globalSchedulesSources)) {
1399
-	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1400
-    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1399
+	    $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware');
1400
+    	    $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources));
1401 1401
     	}
1402 1402
 
1403
-	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1403
+	$settings = array_merge($settings, array('globalInstalled' => 'TRUE'));
1404 1404
 
1405 1405
 	if ($error == '') settings::modify_settings($settings);
1406 1406
 	if ($error == '') settings::comment_settings($settings_comment);
Please login to merge, or discard this patch.
Braces   +497 added lines, -133 removed lines patch added patch discarded remove patch
@@ -131,45 +131,72 @@  discard block
 block discarded – undo
131 131
 			</div>
132 132
 			<p>
133 133
 				<label for="dbhost">Database hostname</label>
134
-				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" />
134
+				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) {
135
+	print $globalDBhost;
136
+}
137
+?>" />
135 138
 			</p>
136 139
 			<p>
137 140
 				<label for="dbport">Database port</label>
138
-				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" />
141
+				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) {
142
+	print $globalDBport;
143
+}
144
+?>" />
139 145
 				<p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p>
140 146
 			</p>
141 147
 			<p>
142 148
 				<label for="dbname">Database name</label>
143
-				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" />
149
+				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) {
150
+	print $globalDBname;
151
+}
152
+?>" />
144 153
 			</p>
145 154
 			<p>
146 155
 				<label for="dbuser">Database user</label>
147
-				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" />
156
+				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) {
157
+	print $globalDBuser;
158
+}
159
+?>" />
148 160
 			</p>
149 161
 			<p>
150 162
 				<label for="dbuserpass">Database user password</label>
151
-				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" />
163
+				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) {
164
+	print $globalDBpass;
165
+}
166
+?>" />
152 167
 			</p>
153 168
 		</fieldset>
154 169
 		<fieldset id="site">
155 170
 			<legend>Site configuration</legend>
156 171
 			<p>
157 172
 				<label for="sitename">Site name</label>
158
-				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" />
173
+				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) {
174
+	print $globalName;
175
+}
176
+?>" />
159 177
 			</p>
160 178
 			<p>
161 179
 				<label for="siteurl">Site directory</label>
162
-				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" />
180
+				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) {
181
+	print $globalURL;
182
+}
183
+?>" />
163 184
 				<p class="help-block">Can be null. ex : <i>flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p>
164 185
 			</p>
165 186
 			<p>
166 187
 				<label for="timezone">Timezone</label>
167
-				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" />
188
+				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) {
189
+	print $globalTimezone;
190
+}
191
+?>" />
168 192
 				<p class="help-block">ex : UTC, Europe/Paris,...</p>
169 193
 			</p>
170 194
 			<p>
171 195
 				<label for="language">Language</label>
172
-				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" />
196
+				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) {
197
+	print $globalLanguage;
198
+}
199
+?>" />
173 200
 				<p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p>
174 201
 			</p>
175 202
 		</fieldset>
@@ -190,11 +217,17 @@  discard block
 block discarded – undo
190 217
 			<div id="mapbox_data">
191 218
 				<p>
192 219
 					<label for="mapboxid">Mapbox id</label>
193
-					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" />
220
+					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) {
221
+	print $globalMapboxId;
222
+}
223
+?>" />
194 224
 				</p>
195 225
 				<p>
196 226
 					<label for="mapboxtoken">Mapbox token</label>
197
-					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" />
227
+					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) {
228
+	print $globalMapboxToken;
229
+}
230
+?>" />
198 231
 				</p>
199 232
 				<p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p>
200 233
 			</div>
@@ -202,7 +235,10 @@  discard block
 block discarded – undo
202 235
 			<div id="google_data">
203 236
 				<p>
204 237
 					<label for="googlekey">Google API key</label>
205
-					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" />
238
+					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) {
239
+	print $globalGoogleAPIKey;
240
+}
241
+?>" />
206 242
 					<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>
207 243
 				</p>
208 244
 			</div>
@@ -210,7 +246,10 @@  discard block
 block discarded – undo
210 246
 			<div id="bing_data">
211 247
 				<p>
212 248
 					<label for="bingkey">Bing Map key</label>
213
-					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" />
249
+					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) {
250
+	print $globalBingMapKey;
251
+}
252
+?>" />
214 253
 					<p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p>
215 254
 				</p>
216 255
 			</div>
@@ -218,7 +257,10 @@  discard block
 block discarded – undo
218 257
 			<div id="mapquest_data">
219 258
 				<p>
220 259
 					<label for="mapquestkey">MapQuest key</label>
221
-					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" />
260
+					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) {
261
+	print $globalMapQuestKey;
262
+}
263
+?>" />
222 264
 					<p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p>
223 265
 				</p>
224 266
 			</div>
@@ -226,11 +268,17 @@  discard block
 block discarded – undo
226 268
 			<div id="here_data">
227 269
 				<p>
228 270
 					<label for="hereappid">Here App_Id</label>
229
-					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" />
271
+					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) {
272
+	print $globalHereappId;
273
+}
274
+?>" />
230 275
 				</p>
231 276
 				<p>
232 277
 					<label for="hereappcode">Here App_Code</label>
233
-					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" />
278
+					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) {
279
+	print $globalHereappCode;
280
+}
281
+?>" />
234 282
 				</p>
235 283
 				<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>
236 284
 			</div>
@@ -238,7 +286,10 @@  discard block
 block discarded – undo
238 286
 			<div id="openweathermap_data">
239 287
 				<p>
240 288
 					<label for="openweathermapkey">OpenWeatherMap key (weather layer)</label>
241
-					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) print $globalOpenWeatherMapKey; ?>" />
289
+					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) {
290
+	print $globalOpenWeatherMapKey;
291
+}
292
+?>" />
242 293
 					<p class="help-block">Get a key <a href="https://openweathermap.org/">here</a></p>
243 294
 				</p>
244 295
 			</div>
@@ -248,42 +299,86 @@  discard block
 block discarded – undo
248 299
 			<legend>Coverage area</legend>
249 300
 			<p>
250 301
 				<label for="latitudemax">The maximum latitude (north)</label>
251
-				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" />
302
+				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) {
303
+	print $globalLatitudeMax;
304
+}
305
+?>" />
252 306
 			</p>
253 307
 			<p>
254 308
 				<label for="latitudemin">The minimum latitude (south)</label>
255
-				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" />
309
+				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) {
310
+	print $globalLatitudeMin;
311
+}
312
+?>" />
256 313
 			</p>
257 314
 			<p>
258 315
 				<label for="longitudemax">The maximum longitude (west)</label>
259
-				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" />
316
+				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) {
317
+	print $globalLongitudeMax;
318
+}
319
+?>" />
260 320
 			</p>
261 321
 			<p>
262 322
 				<label for="longitudemin">The minimum longitude (east)</label>
263
-				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" />
323
+				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) {
324
+	print $globalLongitudeMin;
325
+}
326
+?>" />
264 327
 			</p>
265 328
 			<p>
266 329
 				<label for="latitudecenter">The latitude center</label>
267
-				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" />
330
+				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) {
331
+	print $globalCenterLatitude;
332
+}
333
+?>" />
268 334
 			</p>
269 335
 			<p>
270 336
 				<label for="longitudecenter">The longitude center</label>
271
-				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" />
337
+				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) {
338
+	print $globalCenterLongitude;
339
+}
340
+?>" />
272 341
 			</p>
273 342
 			<p>
274 343
 				<label for="livezoom">Default Zoom on live map</label>
275
-				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" />
344
+				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) {
345
+	print $globalLiveZoom;
346
+} else {
347
+	print '9';
348
+}
349
+?>" />
276 350
 			</p>
277 351
 			<p>
278 352
 				<label for="squawk_country">Country for squawk usage</label>
279 353
 				<select name="squawk_country" id="squawk_country">
280
-					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option>
281
-					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option>
282
-					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option>
283
-					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option>
284
-					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option>
285
-					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option>
286
-					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option>
354
+					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') {
355
+	print ' selected ';
356
+}
357
+?>>UK</option>
358
+					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') {
359
+	print ' selected ';
360
+}
361
+?>>NZ</option>
362
+					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') {
363
+	print ' selected ';
364
+}
365
+?>>US</option>
366
+					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') {
367
+	print ' selected ';
368
+}
369
+?>>AU</option>
370
+					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') {
371
+	print ' selected ';
372
+}
373
+?>>NL</option>
374
+					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') {
375
+	print ' selected ';
376
+}
377
+?>>FR</option>
378
+					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') {
379
+	print ' selected ';
380
+}
381
+?>>TR</option>
287 382
 				</select>
288 383
 			</p>
289 384
 		</fieldset>
@@ -292,15 +387,24 @@  discard block
 block discarded – undo
292 387
 			<p><i>Only put in DB flights that are inside a circle</i></p>
293 388
 			<p>
294 389
 				<label for="latitude">Center latitude</label>
295
-				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" />
390
+				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) {
391
+	echo $globalDistanceIgnore['latitude'];
392
+}
393
+?>" />
296 394
 			</p>
297 395
 			<p>
298 396
 				<label for="longitude">Center longitude</label>
299
-				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" />
397
+				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) {
398
+	echo $globalDistanceIgnore['longitude'];
399
+}
400
+?>" />
300 401
 			</p>
301 402
 			<p>
302 403
 				<label for="Distance">Distance (in km)</label>
303
-				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" />
404
+				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) {
405
+	echo $globalDistanceIgnore['distance'];
406
+}
407
+?>" />
304 408
 			</p>
305 409
 		</fieldset>
306 410
 		<fieldset id="sourceloc">
@@ -409,11 +513,17 @@  discard block
 block discarded – undo
409 513
 			<div id="flightaware_data">
410 514
 				<p>
411 515
 					<label for="flightawareusername">FlightAware username</label>
412
-					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
516
+					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
517
+	print $globalFlightAwareUsername;
518
+}
519
+?>" />
413 520
 				</p>
414 521
 				<p>
415 522
 					<label for="flightawarepassword">FlightAware password/API key</label>
416
-					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
523
+					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
524
+	print $globalFlightAwarePassword;
525
+}
526
+?>" />
417 527
 				</p>
418 528
 			</div>
419 529
 -->
@@ -455,7 +565,10 @@  discard block
 block discarded – undo
455 565
 								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
456 566
 								?>
457 567
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
458
-								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
568
+								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) {
569
+	print $source['port'];
570
+}
571
+?>" /></td>
459 572
 								<?php
460 573
 								    } else {
461 574
 									$hostport = explode(':',$source['host']);
@@ -474,32 +587,98 @@  discard block
 block discarded – undo
474 587
 								?>
475 588
 								<td>
476 589
 									<select name="format[]" id="format">
477
-										<option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option>
478
-										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option>
479
-										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option>
480
-										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option>
481
-										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option>
482
-										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option>
483
-										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option>
484
-										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option>
485
-										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option>
486
-										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option>
487
-										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option>
488
-										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option>
489
-										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option>
490
-										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option>
491
-										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
492
-										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option>
493
-										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option>
494
-										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') print 'selected'; ?>>AirWhere website</option>
495
-										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') print 'selected'; ?>>HidnSeek Callback</option>
590
+										<option value="auto" <?php if (!isset($source['format'])) {
591
+	print 'selected';
592
+}
593
+?>>Auto</option>
594
+										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') {
595
+	print 'selected';
596
+}
597
+?>>SBS</option>
598
+										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') {
599
+	print 'selected';
600
+}
601
+?>>TSV</option>
602
+										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') {
603
+	print 'selected';
604
+}
605
+?>>Raw</option>
606
+										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') {
607
+	print 'selected';
608
+}
609
+?>>APRS</option>
610
+										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') {
611
+	print 'selected';
612
+}
613
+?>>Radarcape deltadb.txt</option>
614
+										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') {
615
+	print 'selected';
616
+}
617
+?>>Vatsim</option>
618
+										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') {
619
+	print 'selected';
620
+}
621
+?>>Virtual Radar Server AircraftList.json</option>
622
+										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') {
623
+	print 'selected';
624
+}
625
+?>>Virtual Radar Server TCP</option>
626
+										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
627
+	print 'selected';
628
+}
629
+?>>phpVMS</option>
630
+										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') {
631
+	print 'selected';
632
+}
633
+?>>Virtual Airlines Manager</option>
634
+										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') {
635
+	print 'selected';
636
+}
637
+?>>IVAO</option>
638
+										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') {
639
+	print 'selected';
640
+}
641
+?>>FlightGear Multiplayer</option>
642
+										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') {
643
+	print 'selected';
644
+}
645
+?>>FlightGear Singleplayer</option>
646
+										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') {
647
+	print 'selected';
648
+}
649
+?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
650
+										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') {
651
+	print 'selected';
652
+}
653
+?>>ACARS SBS-3 over TCP</option>
654
+										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') {
655
+	print 'selected';
656
+}
657
+?>>NMEA AIS over TCP</option>
658
+										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') {
659
+	print 'selected';
660
+}
661
+?>>AirWhere website</option>
662
+										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') {
663
+	print 'selected';
664
+}
665
+?>>HidnSeek Callback</option>
496 666
 									</select>
497 667
 								</td>
498 668
 								<td>
499
-									<input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" />
669
+									<input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) {
670
+	print $source['name'];
671
+}
672
+?>" />
500 673
 								</td>
501
-								<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>
502
-								<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>
674
+								<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']) {
675
+	print 'checked';
676
+}
677
+?> /></td>
678
+								<td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) {
679
+	print 'checked';
680
+}
681
+?> /></td>
503 682
 								<td>
504 683
 									<select name="timezone[]" id="timezone">
505 684
 								<?php
@@ -509,7 +688,9 @@  discard block
 block discarded – undo
509 688
 											print '<option selected>'.$timezone.'</option>';
510 689
 										} elseif (!isset($source['timezone']) && $timezone == 'UTC') {
511 690
 											print '<option selected>'.$timezone.'</option>';
512
-										} else print '<option>'.$timezone.'</option>';
691
+										} else {
692
+											print '<option>'.$timezone.'</option>';
693
+										}
513 694
 									}
514 695
 								?>
515 696
 									</select>
@@ -558,7 +739,9 @@  discard block
 block discarded – undo
558 739
 									foreach($timezonelist as $timezone){
559 740
 										if ($timezone == 'UTC') {
560 741
 											print '<option selected>'.$timezone.'</option>';
561
-										} else print '<option>'.$timezone.'</option>';
742
+										} else {
743
+											print '<option>'.$timezone.'</option>';
744
+										}
562 745
 									}
563 746
 								?>
564 747
 									</select>
@@ -580,11 +763,17 @@  discard block
 block discarded – undo
580 763
 					<p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p>
581 764
 					<p>
582 765
 						<label for="acarshost">ACARS UDP host</label>
583
-						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" />
766
+						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) {
767
+	print $globalACARSHost;
768
+}
769
+?>" />
584 770
 					</p>
585 771
 					<p>
586 772
 						<label for="acarsport">ACARS UDP port</label>
587
-						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" />
773
+						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) {
774
+	print $globalACARSPort;
775
+}
776
+?>" />
588 777
 					</p>
589 778
 				</fieldset>
590 779
 			</div>
@@ -664,13 +853,19 @@  discard block
 block discarded – undo
664 853
 			<div id="schedules_options">
665 854
 				<p>
666 855
 					<label for="britishairways">British Airways API Key</label>
667
-					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" />
856
+					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) {
857
+	print $globalBritishAirwaysKey;
858
+}
859
+?>" />
668 860
 					<p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p>
669 861
 				</p>
670 862
 				<!--
671 863
 				<p>
672 864
 					<label for="transavia">Transavia Test API Consumer Key</label>
673
-					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" />
865
+					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) {
866
+	print $globalTransaviaKey;
867
+}
868
+?>" />
674 869
 					<p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p>
675 870
 				</p>
676 871
 				-->
@@ -679,10 +874,16 @@  discard block
 block discarded – undo
679 874
 						<b>Lufthansa API Key</b>
680 875
 						<p>
681 876
 							<label for="lufthansakey">Key</label>
682
-							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" />
877
+							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) {
878
+	print $globalLufthansaKey['key'];
879
+}
880
+?>" />
683 881
 						</p><p>
684 882
 							<label for="lufthansasecret">Secret</label>
685
-							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" />
883
+							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) {
884
+	print $globalLufthansaKey['secret'];
885
+}
886
+?>" />
686 887
 						</p>
687 888
 					</div>
688 889
 					<p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p>
@@ -702,7 +903,10 @@  discard block
 block discarded – undo
702 903
 			</p>
703 904
 			<p>
704 905
 				<label for="notamsource">URL of your feed from notaminfo.com</label>
705
-				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" />
906
+				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) {
907
+	print $globalNOTAMSource;
908
+}
909
+?>" />
706 910
 				<p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p>
707 911
 			</p>
708 912
 			<br />
@@ -718,14 +922,20 @@  discard block
 block discarded – undo
718 922
 			<div id="metarsrc">
719 923
 				<p>
720 924
 					<label for="metarsource">URL of your METAR source</label>
721
-					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" />
925
+					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) {
926
+	print $globalMETARurl;
927
+}
928
+?>" />
722 929
 					<p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p>
723 930
 				</p>
724 931
 			</div>
725 932
 			<br />
726 933
 			<p>
727 934
 				<label for="bitly">Bit.ly access token api (used in search page)</label>
728
-				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" />
935
+				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) {
936
+	print $globalBitlyAccessToken;
937
+}
938
+?>" />
729 939
 			</p>
730 940
 			<br />
731 941
 			<p>
@@ -741,11 +951,26 @@  discard block
 block discarded – undo
741 951
 			<p>
742 952
 				<label for="geoid_source">Geoid Source</label>
743 953
 				<select name="geoid_source" id="geoid_source">
744
-					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') print ' selected="selected"'; ?>>EGM96 15' (2.1MB)</option>
745
-					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') print ' selected="selected"'; ?>>EGM96 5' (19MB)</option>
746
-					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') print ' selected="selected"'; ?>>EGM2008 5' (19MB)</option>
747
-					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') print ' selected="selected"'; ?>>EGM2008 2.5' (75MB)</option>
748
-					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') print ' selected="selected"'; ?>>EGM2008 1' (470MB)</option>
954
+					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') {
955
+	print ' selected="selected"';
956
+}
957
+?>>EGM96 15' (2.1MB)</option>
958
+					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') {
959
+	print ' selected="selected"';
960
+}
961
+?>>EGM96 5' (19MB)</option>
962
+					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') {
963
+	print ' selected="selected"';
964
+}
965
+?>>EGM2008 5' (19MB)</option>
966
+					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') {
967
+	print ' selected="selected"';
968
+}
969
+?>>EGM2008 2.5' (75MB)</option>
970
+					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') {
971
+	print ' selected="selected"';
972
+}
973
+?>>EGM2008 1' (470MB)</option>
749 974
 				</select>
750 975
 				<p class="help-block">The geoid is approximated by an "earth gravity model" (EGM).</p>
751 976
 			</p>
@@ -763,7 +988,12 @@  discard block
 block discarded – undo
763 988
 			</p>
764 989
 			<p>
765 990
 				<label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label>
766
-				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '0'; ?>" />
991
+				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) {
992
+	print $globalArchiveMonths;
993
+} else {
994
+	echo '0';
995
+}
996
+?>" />
767 997
 				<p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p>
768 998
 			</p>
769 999
 			<p>
@@ -773,12 +1003,22 @@  discard block
 block discarded – undo
773 1003
 			</p>
774 1004
 			<p>
775 1005
 				<label for="archivekeepmonths">Keep flights data for xx months in archive</label>
776
-				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '0'; ?>" />
1006
+				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) {
1007
+	print $globalArchiveKeepMonths;
1008
+} else {
1009
+	echo '0';
1010
+}
1011
+?>" />
777 1012
 				<p class="help-block">0 to disable</p>
778 1013
 			</p>
779 1014
 			<p>
780 1015
 				<label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label>
781
-				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '0'; ?>" />
1016
+				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) {
1017
+	print $globalArchiveKeepTrackMonths;
1018
+} else {
1019
+	echo '0';
1020
+}
1021
+?>" />
782 1022
 				<p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p>
783 1023
 			</p>
784 1024
 			<br />
@@ -788,7 +1028,12 @@  discard block
 block discarded – undo
788 1028
 				<p class="help-block">Uncheck if the script is running as cron job</p>
789 1029
 				<div id="cronends"> 
790 1030
 					<label for="cronend">Run script for xx seconds</label>
791
-					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" />
1031
+					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) {
1032
+	print $globalCronEnd;
1033
+} else {
1034
+	print '0';
1035
+}
1036
+?>" />
792 1037
 					<p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p>
793 1038
 				</div>
794 1039
 			</p>
@@ -841,15 +1086,30 @@  discard block
 block discarded – undo
841 1086
 			<br />
842 1087
 			<p>
843 1088
 				<label for="refresh">Show flights detected since xxx seconds</label>
844
-				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" />
1089
+				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) {
1090
+	echo $globalLiveInterval;
1091
+} else {
1092
+	echo '200';
1093
+}
1094
+?>" />
845 1095
 			</p>
846 1096
 			<p>
847 1097
 				<label for="maprefresh">Live map refresh (in seconds)</label>
848
-				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" />
1098
+				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) {
1099
+	echo $globalMapRefresh;
1100
+} else {
1101
+	echo '30';
1102
+}
1103
+?>" />
849 1104
 			</p>
850 1105
 			<p>
851 1106
 				<label for="mapidle">Map idle timeout (in minutes)</label>
852
-				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" />
1107
+				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) {
1108
+	echo $globalMapIdleTimeout;
1109
+} else {
1110
+	echo '30';
1111
+}
1112
+?>" />
853 1113
 				<p class="help-block">0 to disable</p>
854 1114
 			</p>
855 1115
 			<p>
@@ -864,12 +1124,20 @@  discard block
 block discarded – undo
864 1124
 			<br />
865 1125
 			<p>
866 1126
 				<label for="closestmindist">Distance to airport set as arrival (in km)</label>
867
-				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" />
1127
+				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) {
1128
+	echo $globalClosestMinDist;
1129
+} else {
1130
+	echo '50';
1131
+}
1132
+?>" />
868 1133
 			</p>
869 1134
 			<br />
870 1135
 			<p>
871 1136
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
872
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
1137
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) {
1138
+	echo $globalAircraftSize;
1139
+}
1140
+?>" />
873 1141
 			</p>
874 1142
 			<br />
875 1143
 			<p>
@@ -882,7 +1150,12 @@  discard block
 block discarded – undo
882 1150
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
883 1151
 			?>
884 1152
 				<label for="aircrafticoncolor">Color of aircraft icon on map</label>
885
-				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />
1153
+				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) {
1154
+	echo $globalAircraftIconColor;
1155
+} else {
1156
+	echo '1a3151';
1157
+}
1158
+?>" />
886 1159
 			<?php
887 1160
 				if (!is_writable('../cache')) {
888 1161
 			?>
@@ -900,14 +1173,27 @@  discard block
 block discarded – undo
900 1173
 			<p>
901 1174
 				<label for="airportzoom">Zoom level minimum to see airports icons</label>
902 1175
 				<div class="range">
903
-					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" />
904
-					<output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output>
1176
+					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) {
1177
+	echo $globalAirportZoom;
1178
+} else {
1179
+	echo '7';
1180
+}
1181
+?>" />
1182
+					<output id="range"><?php if (isset($globalAirportZoom)) {
1183
+	echo $globalAirportZoom;
1184
+} else {
1185
+	echo '7';
1186
+}
1187
+?></output>
905 1188
 				</div>
906 1189
 			</p>
907 1190
 			<br />
908 1191
 			<p>
909 1192
 				<label for="customcss">Custom CSS web path</label>
910
-				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) echo $globalCustomCSS; ?>" />
1193
+				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) {
1194
+	echo $globalCustomCSS;
1195
+}
1196
+?>" />
911 1197
 			</p>
912 1198
 		</fieldset>
913 1199
 		<input type="submit" name="submit" value="Create/Update database & write setup" />
@@ -934,8 +1220,12 @@  discard block
 block discarded – undo
934 1220
 	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
935 1221
 	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
936 1222
 
937
-	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
938
-	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
1223
+	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) {
1224
+		$error .= 'Mysql driver for PDO must be loaded';
1225
+	}
1226
+	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) {
1227
+		$error .= 'PosgreSQL driver for PDO must be loaded';
1228
+	}
939 1229
 	
940 1230
 	$_SESSION['database_root'] = $dbroot;
941 1231
 	$_SESSION['database_rootpass'] = $dbrootpass;
@@ -1003,15 +1293,23 @@  discard block
 block discarded – undo
1003 1293
 	$source_city = $_POST['source_city'];
1004 1294
 	$source_country = $_POST['source_country'];
1005 1295
 	$source_ref = $_POST['source_ref'];
1006
-	if (isset($source_id)) $source_id = $_POST['source_id'];
1007
-	else $source_id = array();
1296
+	if (isset($source_id)) {
1297
+		$source_id = $_POST['source_id'];
1298
+	} else {
1299
+		$source_id = array();
1300
+	}
1008 1301
 	
1009 1302
 	$sources = array();
1010 1303
 	foreach ($source_name as $keys => $name) {
1011
-	    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]);
1012
-	    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]);
1304
+	    if (isset($source_id[$keys])) {
1305
+	    	$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]);
1306
+	    } else {
1307
+	    	$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]);
1308
+	    }
1309
+	}
1310
+	if (count($sources) > 0) {
1311
+		$_SESSION['sources'] = $sources;
1013 1312
 	}
1014
-	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1015 1313
 
1016 1314
 	//$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING);
1017 1315
 	//$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT);
@@ -1032,14 +1330,23 @@  discard block
 block discarded – undo
1032 1330
 	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1033 1331
 
1034 1332
 	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1035
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1036
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1333
+	if ($globalaircraft == 'aircraft') {
1334
+		$settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1335
+	} else {
1336
+		$settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1337
+	}
1037 1338
 	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1038
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1039
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1339
+	if ($globaltracker == 'tracker') {
1340
+		$settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1341
+	} else {
1342
+		$settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1343
+	}
1040 1344
 	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1041
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1042
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1345
+	if ($globalmarine == 'marine') {
1346
+		$settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1347
+	} else {
1348
+		$settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1349
+	}
1043 1350
 
1044 1351
 /*	
1045 1352
 	$globalSBS1Hosts = array();
@@ -1061,23 +1368,37 @@  discard block
 block discarded – undo
1061 1368
 	$name = $_POST['name'];
1062 1369
 	$format = $_POST['format'];
1063 1370
 	$timezone = $_POST['timezone'];
1064
-	if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats'];
1065
-	else $sourcestats = array();
1066
-	if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive'];
1067
-	else $noarchive = array();
1371
+	if (isset($_POST['sourcestats'])) {
1372
+		$sourcestats = $_POST['sourcestats'];
1373
+	} else {
1374
+		$sourcestats = array();
1375
+	}
1376
+	if (isset($_POST['noarchive'])) {
1377
+		$noarchive = $_POST['noarchive'];
1378
+	} else {
1379
+		$noarchive = array();
1380
+	}
1068 1381
 	$gSources = array();
1069 1382
 	$forcepilots = false;
1070 1383
 	foreach ($host as $key => $h) {
1071
-		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE';
1072
-		else $cov = 'FALSE';
1073
-		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1074
-		else $arch = 'FALSE';
1384
+		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) {
1385
+			$cov = 'TRUE';
1386
+		} else {
1387
+			$cov = 'FALSE';
1388
+		}
1389
+		if (isset($noarchive[$key]) && $noarchive[$key] == 1) {
1390
+			$arch = 'TRUE';
1391
+		} else {
1392
+			$arch = 'FALSE';
1393
+		}
1075 1394
 		if (strpos($format[$key],'_callback')) {
1076 1395
 			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezone[$key],'callback' => 'TRUE');
1077 1396
 		} elseif ($h != '' || $name[$key] != '') {
1078 1397
 			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezone[$key],'callback' => 'FALSE');
1079 1398
 		}
1080
-		if ($format[$key] == 'airwhere') $forcepilots = true;
1399
+		if ($format[$key] == 'airwhere') {
1400
+			$forcepilots = true;
1401
+		}
1081 1402
 	}
1082 1403
 	$settings = array_merge($settings,array('globalSources' => $gSources));
1083 1404
 
@@ -1105,7 +1426,9 @@  discard block
 block discarded – undo
1105 1426
 	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1106 1427
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1107 1428
 		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1108
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1429
+	} else {
1430
+		$settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1431
+	}
1109 1432
 
1110 1433
 	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1111 1434
 	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
@@ -1144,7 +1467,9 @@  discard block
 block discarded – undo
1144 1467
 
1145 1468
 	// Create in settings.php keys not yet configurable if not already here
1146 1469
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1147
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1470
+	if (!isset($globalDebug)) {
1471
+		$settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1472
+	}
1148 1473
 
1149 1474
 	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1150 1475
 	if ($resetyearstats == 'resetyearstats') {
@@ -1181,37 +1506,56 @@  discard block
 block discarded – undo
1181 1506
 	}
1182 1507
 */
1183 1508
 	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1184
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1185
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1186
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1187
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1509
+	if ($globalsbs == 'sbs') {
1510
+		$settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1511
+	} else {
1512
+		$settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1513
+	}
1514
+	if ($globalaprs == 'aprs') {
1515
+		$settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1516
+	} else {
1517
+		$settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1518
+	}
1188 1519
 	$va = false;
1189 1520
 	if ($globalivao == 'ivao') {
1190 1521
 		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1191 1522
 		$va = true;
1192
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1523
+	} else {
1524
+		$settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1525
+	}
1193 1526
 	if ($globalvatsim == 'vatsim') {
1194 1527
 		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1195 1528
 		$va = true;
1196
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1529
+	} else {
1530
+		$settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1531
+	}
1197 1532
 	if ($globalphpvms == 'phpvms') {
1198 1533
 		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1199 1534
 		$va = true;
1200
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1535
+	} else {
1536
+		$settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1537
+	}
1201 1538
 	if ($globalvam == 'vam') {
1202 1539
 		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1203 1540
 		$va = true;
1204
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1541
+	} else {
1542
+		$settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1543
+	}
1205 1544
 	if ($va) {
1206 1545
 		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1207
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1546
+	} else {
1547
+		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1548
+	}
1208 1549
 	if ($globalva == 'va' || $va) {
1209 1550
 		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1210 1551
 		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1211 1552
 	} else {
1212 1553
 		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1213
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1214
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1554
+		if ($forcepilots) {
1555
+			$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1556
+		} else {
1557
+			$settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1558
+		}
1215 1559
 	}
1216 1560
 	
1217 1561
 	
@@ -1387,7 +1731,9 @@  discard block
 block discarded – undo
1387 1731
 		$settings = array_merge($settings,array('globalNoAirlines' => 'FALSE'));
1388 1732
 	}
1389 1733
 
1390
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1734
+	if (!isset($globalTransaction)) {
1735
+		$settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1736
+	}
1391 1737
 
1392 1738
 	// Set some defaults values...
1393 1739
 	if (!isset($globalAircraftImageSources)) {
@@ -1402,15 +1748,23 @@  discard block
 block discarded – undo
1402 1748
 
1403 1749
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1404 1750
 
1405
-	if ($error == '') settings::modify_settings($settings);
1406
-	if ($error == '') settings::comment_settings($settings_comment);
1751
+	if ($error == '') {
1752
+		settings::modify_settings($settings);
1753
+	}
1754
+	if ($error == '') {
1755
+		settings::comment_settings($settings_comment);
1756
+	}
1407 1757
 	if ($error != '') {
1408 1758
 		print '<div class="info column">'.$error.'</div>';
1409 1759
 		require('../footer.php');
1410 1760
 		exit;
1411 1761
 	} else {
1412
-		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1;
1413
-		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1;
1762
+		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') {
1763
+			$_SESSION['waypoints'] = 1;
1764
+		}
1765
+		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') {
1766
+			$_SESSION['owner'] = 1;
1767
+		}
1414 1768
 		if (isset($_POST['createdb'])) {
1415 1769
 			$_SESSION['install'] = 'database_create';
1416 1770
 		} else {
@@ -1451,10 +1805,18 @@  discard block
 block discarded – undo
1451 1805
 	$popw = false;
1452 1806
 	foreach ($_SESSION['done'] as $done) {
1453 1807
 	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1454
-	    if ($done == 'Create database') $pop = true;
1455
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1456
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1457
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
1808
+	    if ($done == 'Create database') {
1809
+	    	$pop = true;
1810
+	    }
1811
+	    if ($_SESSION['install'] == 'database_create') {
1812
+	    	$pop = true;
1813
+	    }
1814
+	    if ($_SESSION['install'] == 'database_import') {
1815
+	    	$popi = true;
1816
+	    }
1817
+	    if ($_SESSION['install'] == 'waypoints') {
1818
+	    	$popw = true;
1819
+	    }
1458 1820
 	}
1459 1821
 	if ($pop) {
1460 1822
 	    sleep(5);
@@ -1465,7 +1827,9 @@  discard block
 block discarded – undo
1465 1827
 	} else if ($popw) {
1466 1828
 	    sleep(5);
1467 1829
 	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1468
-	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
1830
+	} else {
1831
+		print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
1832
+	}
1469 1833
 	print '</div></ul>';
1470 1834
 	print '<div id="error"></div>';
1471 1835
 /*	foreach ($_SESSION['done'] as $done) {
Please login to merge, or discard this patch.