Completed
Push — master ( 6e8bf5...1987da )
by Yannick
36:12
created
install/index.php 3 patches
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -345,14 +345,14 @@  discard block
 block discarded – undo
345 345
 				</tr>
346 346
 				<!--
347 347
 		<?php
348
-		    if (isset($globalDBuser) && isset($globalDBpass) && $globalDBuser != '' && $globalDBpass != '') {
349
-			    require_once(dirname(__FILE__).'/../require/class.Connection.php');
350
-			    $Connection = new Connection();
348
+			if (isset($globalDBuser) && isset($globalDBpass) && $globalDBuser != '' && $globalDBpass != '') {
349
+				require_once(dirname(__FILE__).'/../require/class.Connection.php');
350
+				$Connection = new Connection();
351 351
 		?>
352 352
 			-->
353 353
 		<?php
354 354
 			if ($Connection->db != NULL) {
355
-			    if ($Connection->tableExists('source_location')) {
355
+				if ($Connection->tableExists('source_location')) {
356 356
 				require_once(dirname(__FILE__).'/../require/class.Source.php');
357 357
 				$Source = new Source();
358 358
 				//$alllocations = $Source->getAllLocationInfo();
@@ -372,9 +372,9 @@  discard block
 block discarded – undo
372 372
 		
373 373
 		<?php
374 374
 				}
375
-			    }
375
+				}
376
+			}
376 377
 			}
377
-		    }
378 378
 		?>
379 379
 
380 380
 				<tr>
@@ -484,12 +484,12 @@  discard block
 block discarded – undo
484 484
 ?>
485 485
 							<tr>
486 486
 								<?php
487
-								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
487
+									if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
488 488
 								?>
489 489
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
490 490
 								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
491 491
 								<?php
492
-								    } else {
492
+									} else {
493 493
 									$hostport = explode(':',$source['host']);
494 494
 									if (isset($hostport[1])) {
495 495
 										$host = $hostport[0];
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 								<td><input type="text" name="host[]" id="host" value="<?php print $host; ?>" /></td>
503 503
 								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php print $port; ?>" /></td>
504 504
 								<?php
505
-								    }
505
+									}
506 506
 								?>
507 507
 								<td>
508 508
 									<select name="format[]" id="format">
@@ -639,9 +639,9 @@  discard block
 block discarded – undo
639 639
 			    </thead>
640 640
 			    <tbody>
641 641
 				<?php
642
-				    if (isset($globalNewsFeeds) && !empty($globalNewsFeeds)) {
642
+					if (isset($globalNewsFeeds) && !empty($globalNewsFeeds)) {
643 643
 					foreach ($globalNewsFeeds as $type => $feedslng) {
644
-					    foreach ($feedslng as $lng => $feeds) {
644
+						foreach ($feedslng as $lng => $feeds) {
645 645
 						foreach ($feeds as $feed) {
646 646
 				?>
647 647
 				<tr>
@@ -666,9 +666,9 @@  discard block
 block discarded – undo
666 666
 				
667 667
 				<?php
668 668
 						}
669
-					    }
669
+						}
670
+					}
670 671
 					}
671
-				    }
672 672
 				?>
673 673
 				<tr>
674 674
 				    <td><input type="url" name="newsurl[]" /></td>
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
 			<br />
1010 1010
 			<p>
1011 1011
 			<?php 
1012
-			    if (extension_loaded('gd') && function_exists('gd_info')) {
1012
+				if (extension_loaded('gd') && function_exists('gd_info')) {
1013 1013
 			?>
1014 1014
 				<label for="aircrafticoncolor">Color of aircraft icon on map</label>
1015 1015
 				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />
@@ -1019,11 +1019,11 @@  discard block
 block discarded – undo
1019 1019
 				<b>The directory cache is not writable, aircraft icon will not be cached</b>
1020 1020
 			<?php
1021 1021
 				}
1022
-			    } else {
1022
+				} else {
1023 1023
 			?>
1024 1024
 				<b>PHP GD is not installed, you can't change color of aircraft icon on map</b>
1025 1025
 			<?php
1026
-			    }
1026
+				}
1027 1027
 			?>
1028 1028
 			</p>
1029 1029
 			<br />
@@ -1047,7 +1047,7 @@  discard block
 block discarded – undo
1047 1047
 	</p>
1048 1048
 <?php
1049 1049
 	require('../footer.php');
1050
-        exit;
1050
+		exit;
1051 1051
 }
1052 1052
 // '	
1053 1053
 $settings = array();
@@ -1138,8 +1138,8 @@  discard block
 block discarded – undo
1138 1138
 	
1139 1139
 	$sources = array();
1140 1140
 	foreach ($source_name as $keys => $name) {
1141
-	    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]);
1142
-	    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]);
1141
+		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]);
1142
+		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]);
1143 1143
 	}
1144 1144
 	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1145 1145
 
@@ -1149,13 +1149,13 @@  discard block
 block discarded – undo
1149 1149
 	
1150 1150
 	$newsfeeds = array();
1151 1151
 	foreach($newsurl as $newskey => $url) {
1152
-	    if ($url != '') {
1152
+		if ($url != '') {
1153 1153
 		$type = $newstype[$newskey];
1154 1154
 		$lng = $newslng[$newskey];
1155 1155
 		if (isset($newsfeeds[$type][$lng])) {
1156
-		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1156
+			$newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1157 1157
 		} else $newsfeeds[$type][$lng] = array($url);
1158
-	    }
1158
+		}
1159 1159
 	}
1160 1160
 	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds));
1161 1161
 
@@ -1567,14 +1567,14 @@  discard block
 block discarded – undo
1567 1567
 
1568 1568
 	// Set some defaults values...
1569 1569
 	if (!isset($globalAircraftImageSources)) {
1570
-	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1571
-	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1570
+		$globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1571
+		$settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1572 1572
 	}
1573 1573
 
1574 1574
 	if (!isset($globalSchedulesSources)) {
1575
-	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1576
-    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1577
-    	}
1575
+		$globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1576
+			$settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1577
+		}
1578 1578
 
1579 1579
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1580 1580
 
@@ -1622,21 +1622,21 @@  discard block
 block discarded – undo
1622 1622
 	$popi = false;
1623 1623
 	$popw = false;
1624 1624
 	foreach ($_SESSION['done'] as $done) {
1625
-	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1626
-	    if ($done == 'Create database') $pop = true;
1627
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1628
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1629
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
1625
+		print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1626
+		if ($done == 'Create database') $pop = true;
1627
+		if ($_SESSION['install'] == 'database_create') $pop = true;
1628
+		if ($_SESSION['install'] == 'database_import') $popi = true;
1629
+		if ($_SESSION['install'] == 'waypoints') $popw = true;
1630 1630
 	}
1631 1631
 	if ($pop) {
1632
-	    sleep(5);
1633
-	    print '<li>Create database....<img src="../images/loading.gif" /></li>';
1632
+		sleep(5);
1633
+		print '<li>Create database....<img src="../images/loading.gif" /></li>';
1634 1634
 	} else if ($popi) {
1635
-	    sleep(5);
1636
-	    print '<li>Create and import tables....<img src="../images/loading.gif" /></li>';
1635
+		sleep(5);
1636
+		print '<li>Create and import tables....<img src="../images/loading.gif" /></li>';
1637 1637
 	} else if ($popw) {
1638
-	    sleep(5);
1639
-	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1638
+		sleep(5);
1639
+		print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1640 1640
 	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
1641 1641
 	print '</div></ul>';
1642 1642
 	print '<div id="error"></div>';
@@ -1702,7 +1702,7 @@  discard block
 block discarded – undo
1702 1702
 	unset($_COOKIE['install']);
1703 1703
 	print '<div class="info column"><ul>';
1704 1704
 	foreach ($_SESSION['done'] as $done) {
1705
-	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1705
+		print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1706 1706
 	}
1707 1707
 	print '<li>Reloading page to check all is now ok....<strong>SUCCESS</strong></li>';
1708 1708
 	print '</ul></div>';
Please login to merge, or discard this patch.
Spacing   +266 added lines, -266 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 require_once(dirname(__FILE__).'/class.create_db.php');
23 23
 require_once(dirname(__FILE__).'/class.update_schema.php');
24 24
 require_once(dirname(__FILE__).'/class.settings.php');
25
-$title="Install";
25
+$title = "Install";
26 26
 require(dirname(__FILE__).'/../require/settings.php');
27 27
 require_once(dirname(__FILE__).'/../require/class.Common.php');
28 28
 require(dirname(__FILE__).'/header.php');
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
 	if (!extension_loaded('curl')) {
96 96
 		$error[] = "Curl is not loaded.";
97 97
 	}
98
-	if(function_exists('apache_get_modules') ){
99
-		if(!in_array('mod_rewrite',apache_get_modules())) {
98
+	if (function_exists('apache_get_modules')) {
99
+		if (!in_array('mod_rewrite', apache_get_modules())) {
100 100
 			$error[] = "mod_rewrite is not available.";
101 101
 		}
102 102
 	/*
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 	print '<div class="info column"><p><strong>If you use MySQL or MariaDB, check that <i>max_allowed_packet</i> >= 8M, else import of some table can fail.</strong></p></div>';
113 113
 	if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) {
114 114
 		if (function_exists('get_headers')) {
115
-			$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/','search',str_replace('index.php',$_SERVER["REQUEST_URI"])));
116
-			if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) {
115
+			$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/', 'search', str_replace('index.php', $_SERVER["REQUEST_URI"])));
116
+			if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) {
117 117
 				print '<div class="info column"><p><strong>Check your configuration, rewrite don\'t seems to work.</strong></p></div>';
118 118
 			}
119 119
 		}
@@ -484,13 +484,13 @@  discard block
 block discarded – undo
484 484
 ?>
485 485
 							<tr>
486 486
 								<?php
487
-								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
487
+								    if (filter_var($source['host'], FILTER_VALIDATE_URL)) {
488 488
 								?>
489 489
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
490 490
 								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
491 491
 								<?php
492 492
 								    } else {
493
-									$hostport = explode(':',$source['host']);
493
+									$hostport = explode(':', $source['host']);
494 494
 									if (isset($hostport[1])) {
495 495
 										$host = $hostport[0];
496 496
 										$port = $hostport[1];
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 									<select name="timezones[]" id="timezones">
539 539
 								<?php
540 540
 									$timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
541
-									foreach($timezonelist as $timezones){
541
+									foreach ($timezonelist as $timezones) {
542 542
 										if (isset($source['timezone']) && $source['timezone'] == $timezones) {
543 543
 											print '<option selected>'.$timezones.'</option>';
544 544
 										} elseif (!isset($source['timezone']) && $timezones == 'UTC') {
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 									<select name="timezones[]" id="timezones">
592 592
 								<?php
593 593
 									$timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
594
-									foreach($timezonelist as $timezones){
594
+									foreach ($timezonelist as $timezones) {
595 595
 										if ($timezones == 'UTC') {
596 596
 											print '<option selected>'.$timezones.'</option>';
597 597
 										} else print '<option>'.$timezones.'</option>';
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
 			<br />
1001 1001
 			<p>
1002 1002
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
1003
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
1003
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" />
1004 1004
 			</p>
1005 1005
 			<br />
1006 1006
 			<p>
@@ -1062,14 +1062,14 @@  discard block
 block discarded – undo
1062 1062
 $error = '';
1063 1063
 
1064 1064
 if (isset($_POST['dbtype'])) {
1065
-	$dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING);
1066
-	$dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING);
1067
-	$dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING);
1068
-	$dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING);
1069
-	$dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING);
1070
-	$dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING);
1071
-	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
1072
-	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
1065
+	$dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING);
1066
+	$dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING);
1067
+	$dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING);
1068
+	$dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING);
1069
+	$dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING);
1070
+	$dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING);
1071
+	$dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING);
1072
+	$dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING);
1073 1073
 
1074 1074
 	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
1075 1075
 	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
@@ -1089,49 +1089,49 @@  discard block
 block discarded – undo
1089 1089
 	} else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
1090 1090
 	*/
1091 1091
 	
1092
-	$settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
1092
+	$settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname));
1093 1093
 
1094
-	$sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING);
1095
-	$siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING);
1096
-	$timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING);
1097
-	$language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING);
1098
-	$settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language));
1094
+	$sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING);
1095
+	$siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING);
1096
+	$timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING);
1097
+	$language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
1098
+	$settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language));
1099 1099
 
1100
-	$mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING);
1101
-	$mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING);
1102
-	$mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING);
1103
-	$googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING);
1104
-	$bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING);
1105
-	$openweathermapkey = filter_input(INPUT_POST,'openweathermapkey',FILTER_SANITIZE_STRING);
1106
-	$mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING);
1107
-	$hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING);
1108
-	$hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING);
1109
-	$settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey,'globalOpenWeatherMapKey' => $openweathermapkey));
1100
+	$mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING);
1101
+	$mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING);
1102
+	$mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING);
1103
+	$googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING);
1104
+	$bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING);
1105
+	$openweathermapkey = filter_input(INPUT_POST, 'openweathermapkey', FILTER_SANITIZE_STRING);
1106
+	$mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING);
1107
+	$hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING);
1108
+	$hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING);
1109
+	$settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey, 'globalOpenWeatherMapKey' => $openweathermapkey));
1110 1110
 	
1111
-	$latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING);
1112
-	$latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING);
1113
-	$longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING);
1114
-	$longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING);
1115
-	$livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT);
1116
-	$settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom));
1111
+	$latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING);
1112
+	$latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING);
1113
+	$longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING);
1114
+	$longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING);
1115
+	$livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT);
1116
+	$settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom));
1117 1117
 
1118
-	$squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING);
1119
-	$settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country));
1118
+	$squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING);
1119
+	$settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country));
1120 1120
 
1121
-	$latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING);
1122
-	$longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING);
1123
-	$settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter));
1121
+	$latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING);
1122
+	$longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING);
1123
+	$settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter));
1124 1124
 
1125
-	$acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING);
1125
+	$acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING);
1126 1126
 	if ($acars == 'acars') {
1127
-		$settings = array_merge($settings,array('globalACARS' => 'TRUE'));
1127
+		$settings = array_merge($settings, array('globalACARS' => 'TRUE'));
1128 1128
 	} else {
1129
-		$settings = array_merge($settings,array('globalACARS' => 'FALSE'));
1129
+		$settings = array_merge($settings, array('globalACARS' => 'FALSE'));
1130 1130
 	}
1131 1131
 
1132
-	$flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING);
1133
-	$flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING);
1134
-	$settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword));
1132
+	$flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING);
1133
+	$flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING);
1134
+	$settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword));
1135 1135
 	
1136 1136
 	$source_name = $_POST['source_name'];
1137 1137
 	$source_latitude = $_POST['source_latitude'];
@@ -1145,8 +1145,8 @@  discard block
 block discarded – undo
1145 1145
 	
1146 1146
 	$sources = array();
1147 1147
 	foreach ($source_name as $keys => $name) {
1148
-	    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]);
1149
-	    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]);
1148
+	    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]);
1149
+	    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]);
1150 1150
 	}
1151 1151
 	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1152 1152
 
@@ -1155,16 +1155,16 @@  discard block
 block discarded – undo
1155 1155
 	$newstype = $_POST['newstype'];
1156 1156
 	
1157 1157
 	$newsfeeds = array();
1158
-	foreach($newsurl as $newskey => $url) {
1158
+	foreach ($newsurl as $newskey => $url) {
1159 1159
 	    if ($url != '') {
1160 1160
 		$type = $newstype[$newskey];
1161 1161
 		$lng = $newslng[$newskey];
1162 1162
 		if (isset($newsfeeds[$type][$lng])) {
1163
-		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1163
+		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng], array($url));
1164 1164
 		} else $newsfeeds[$type][$lng] = array($url);
1165 1165
 	    }
1166 1166
 	}
1167
-	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds));
1167
+	$settings = array_merge($settings, array('globalNewsFeeds' => $newsfeeds));
1168 1168
 
1169 1169
 	//$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING);
1170 1170
 	//$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT);
@@ -1175,27 +1175,27 @@  discard block
 block discarded – undo
1175 1175
 	$sbsurl = $_POST['sbsurl'];
1176 1176
 	*/
1177 1177
 
1178
-	$globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING);
1179
-	$globalva = filter_input(INPUT_POST,'globalva',FILTER_SANITIZE_STRING);
1180
-	$globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING);
1181
-	$globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING);
1182
-	$globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING);
1183
-	$globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING);
1184
-	$globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING);
1185
-	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1178
+	$globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING);
1179
+	$globalva = filter_input(INPUT_POST, 'globalva', FILTER_SANITIZE_STRING);
1180
+	$globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING);
1181
+	$globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING);
1182
+	$globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING);
1183
+	$globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING);
1184
+	$globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING);
1185
+	$datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING);
1186 1186
 
1187
-	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1188
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1189
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1190
-	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1191
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1192
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1193
-	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1194
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1195
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1196
-	$globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING);
1197
-	if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1198
-	else $settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1187
+	$globalaircraft = filter_input(INPUT_POST, 'globalaircraft', FILTER_SANITIZE_STRING);
1188
+	if ($globalaircraft == 'aircraft') $settings = array_merge($settings, array('globalAircraft' => 'TRUE'));
1189
+	else $settings = array_merge($settings, array('globalAircraft' => 'FALSE'));
1190
+	$globaltracker = filter_input(INPUT_POST, 'globaltracker', FILTER_SANITIZE_STRING);
1191
+	if ($globaltracker == 'tracker') $settings = array_merge($settings, array('globalTracker' => 'TRUE'));
1192
+	else $settings = array_merge($settings, array('globalTracker' => 'FALSE'));
1193
+	$globalmarine = filter_input(INPUT_POST, 'globalmarine', FILTER_SANITIZE_STRING);
1194
+	if ($globalmarine == 'marine') $settings = array_merge($settings, array('globalMarine' => 'TRUE'));
1195
+	else $settings = array_merge($settings, array('globalMarine' => 'FALSE'));
1196
+	$globalsatellite = filter_input(INPUT_POST, 'globalsatellite', FILTER_SANITIZE_STRING);
1197
+	if ($globalsatellite == 'satellite') $settings = array_merge($settings, array('globalSatellite' => 'TRUE'));
1198
+	else $settings = array_merge($settings, array('globalSatellite' => 'FALSE'));
1199 1199
 
1200 1200
 /*	
1201 1201
 	$globalSBS1Hosts = array();
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
 	}
1212 1212
 	$settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts));
1213 1213
 */
1214
-	$settings_comment = array_merge($settings_comment,array('globalSBS1Hosts'));
1214
+	$settings_comment = array_merge($settings_comment, array('globalSBS1Hosts'));
1215 1215
 	$host = $_POST['host'];
1216 1216
 	$port = $_POST['port'];
1217 1217
 	$name = $_POST['name'];
@@ -1228,113 +1228,113 @@  discard block
 block discarded – undo
1228 1228
 		else $cov = 'FALSE';
1229 1229
 		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1230 1230
 		else $arch = 'FALSE';
1231
-		if (strpos($format[$key],'_callback')) {
1232
-			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE');
1231
+		if (strpos($format[$key], '_callback')) {
1232
+			$gSources[] = array('host' => $h, 'pass' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'TRUE');
1233 1233
 		} elseif ($h != '' || $name[$key] != '') {
1234
-			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE');
1234
+			$gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'FALSE');
1235 1235
 		}
1236 1236
 		if ($format[$key] == 'airwhere') $forcepilots = true;
1237 1237
 	}
1238
-	$settings = array_merge($settings,array('globalSources' => $gSources));
1238
+	$settings = array_merge($settings, array('globalSources' => $gSources));
1239 1239
 
1240 1240
 /*
1241 1241
 	$sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT);
1242 1242
 	$settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout));
1243 1243
 */
1244
-	$acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING);
1245
-	$acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT);
1246
-	$settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport));
1244
+	$acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING);
1245
+	$acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT);
1246
+	$settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport));
1247 1247
 
1248
-	$bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING);
1249
-	$settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly));
1248
+	$bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING);
1249
+	$settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly));
1250 1250
 
1251
-	$customcss = filter_input(INPUT_POST,'customcss',FILTER_SANITIZE_STRING);
1252
-	$settings = array_merge($settings,array('globalCustomCSS' => $customcss));
1251
+	$customcss = filter_input(INPUT_POST, 'customcss', FILTER_SANITIZE_STRING);
1252
+	$settings = array_merge($settings, array('globalCustomCSS' => $customcss));
1253 1253
 
1254
-	$map3dtile = filter_input(INPUT_POST,'map3dtileset',FILTER_SANITIZE_STRING);
1255
-	$settings = array_merge($settings,array('globalMap3DTiles' => $map3dtile));
1254
+	$map3dtile = filter_input(INPUT_POST, 'map3dtileset', FILTER_SANITIZE_STRING);
1255
+	$settings = array_merge($settings, array('globalMap3DTiles' => $map3dtile));
1256 1256
 
1257
-	$notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING);
1258
-	$settings = array_merge($settings,array('globalNOTAMSource' => $notamsource));
1259
-	$metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING);
1260
-	$settings = array_merge($settings,array('globalMETARurl' => $metarsource));
1257
+	$notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING);
1258
+	$settings = array_merge($settings, array('globalNOTAMSource' => $notamsource));
1259
+	$metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING);
1260
+	$settings = array_merge($settings, array('globalMETARurl' => $metarsource));
1261 1261
 
1262
-	$zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING);
1263
-	$zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING);
1264
-	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1262
+	$zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING);
1263
+	$zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING);
1264
+	$zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT);
1265 1265
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1266
-		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1267
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1266
+		$settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance)));
1267
+	} else $settings = array_merge($settings, array('globalDistanceIgnore' => array()));
1268 1268
 
1269
-	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1270
-	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
1271
-	$maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT);
1272
-	$settings = array_merge($settings,array('globalMapRefresh' => $maprefresh));
1273
-	$mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT);
1274
-	$settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle));
1275
-	$closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT);
1276
-	$settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist));
1269
+	$refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT);
1270
+	$settings = array_merge($settings, array('globalLiveInterval' => $refresh));
1271
+	$maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT);
1272
+	$settings = array_merge($settings, array('globalMapRefresh' => $maprefresh));
1273
+	$mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT);
1274
+	$settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle));
1275
+	$closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT);
1276
+	$settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist));
1277 1277
 
1278
-	$aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT);
1279
-	$settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize));
1278
+	$aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT);
1279
+	$settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize));
1280 1280
 
1281
-	$archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT);
1282
-	$settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths));
1281
+	$archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT);
1282
+	$settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths));
1283 1283
 	
1284
-	$archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING);
1284
+	$archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING);
1285 1285
 	if ($archiveyear == "archiveyear") {
1286
-		$settings = array_merge($settings,array('globalArchiveYear' => 'TRUE'));
1286
+		$settings = array_merge($settings, array('globalArchiveYear' => 'TRUE'));
1287 1287
 	} else {
1288
-		$settings = array_merge($settings,array('globalArchiveYear' => 'FALSE'));
1288
+		$settings = array_merge($settings, array('globalArchiveYear' => 'FALSE'));
1289 1289
 	}
1290
-	$archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT);
1291
-	$settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths));
1292
-	$archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT);
1293
-	$settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1290
+	$archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT);
1291
+	$settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths));
1292
+	$archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT);
1293
+	$settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1294 1294
 
1295
-	$britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING);
1296
-	$settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways));
1297
-	$transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING);
1298
-	$settings = array_merge($settings,array('globalTransaviaKey' => $transavia));
1295
+	$britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING);
1296
+	$settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways));
1297
+	$transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING);
1298
+	$settings = array_merge($settings, array('globalTransaviaKey' => $transavia));
1299 1299
 
1300
-	$lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING);
1301
-	$lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING);
1302
-	$settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret)));
1300
+	$lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING);
1301
+	$lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING);
1302
+	$settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret)));
1303 1303
 
1304 1304
 	// Create in settings.php keys not yet configurable if not already here
1305 1305
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1306
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1306
+	if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE'));
1307 1307
 
1308
-	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1308
+	$resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING);
1309 1309
 	if ($resetyearstats == 'resetyearstats') {
1310
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE'));
1310
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE'));
1311 1311
 	} else {
1312
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE'));
1312
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE'));
1313 1313
 	}
1314 1314
 
1315
-	$archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING);
1315
+	$archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING);
1316 1316
 	if ($archive == 'archive') {
1317
-		$settings = array_merge($settings,array('globalArchive' => 'TRUE'));
1317
+		$settings = array_merge($settings, array('globalArchive' => 'TRUE'));
1318 1318
 	} else {
1319
-		$settings = array_merge($settings,array('globalArchive' => 'FALSE'));
1319
+		$settings = array_merge($settings, array('globalArchive' => 'FALSE'));
1320 1320
 	}
1321
-	$archiveresults = filter_input(INPUT_POST,'archiveresults',FILTER_SANITIZE_STRING);
1321
+	$archiveresults = filter_input(INPUT_POST, 'archiveresults', FILTER_SANITIZE_STRING);
1322 1322
 	if ($archiveresults == 'archiveresults') {
1323
-		$settings = array_merge($settings,array('globalArchiveResults' => 'TRUE'));
1323
+		$settings = array_merge($settings, array('globalArchiveResults' => 'TRUE'));
1324 1324
 	} else {
1325
-		$settings = array_merge($settings,array('globalArchiveResults' => 'FALSE'));
1325
+		$settings = array_merge($settings, array('globalArchiveResults' => 'FALSE'));
1326 1326
 	}
1327
-	$daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING);
1327
+	$daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING);
1328 1328
 	if ($daemon == 'daemon') {
1329
-		$settings = array_merge($settings,array('globalDaemon' => 'TRUE'));
1329
+		$settings = array_merge($settings, array('globalDaemon' => 'TRUE'));
1330 1330
 	} else {
1331
-		$settings = array_merge($settings,array('globalDaemon' => 'FALSE'));
1331
+		$settings = array_merge($settings, array('globalDaemon' => 'FALSE'));
1332 1332
 	}
1333
-	$schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING);
1333
+	$schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING);
1334 1334
 	if ($schedules == 'schedules') {
1335
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE'));
1335
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE'));
1336 1336
 	} else {
1337
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE'));
1337
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE'));
1338 1338
 	}
1339 1339
 
1340 1340
 /*
@@ -1345,252 +1345,252 @@  discard block
 block discarded – undo
1345 1345
 		$settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE'));
1346 1346
 	}
1347 1347
 */
1348
-	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1349
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1350
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1351
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1352
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1348
+	$settings = array_merge($settings, array('globalFlightAware' => 'FALSE'));
1349
+	if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE'));
1350
+	else $settings = array_merge($settings, array('globalSBS1' => 'FALSE'));
1351
+	if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE'));
1352
+	else $settings = array_merge($settings, array('globalAPRS' => 'FALSE'));
1353 1353
 	$va = false;
1354 1354
 	if ($globalivao == 'ivao') {
1355
-		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1355
+		$settings = array_merge($settings, array('globalIVAO' => 'TRUE'));
1356 1356
 		$va = true;
1357
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1357
+	} else $settings = array_merge($settings, array('globalIVAO' => 'FALSE'));
1358 1358
 	if ($globalvatsim == 'vatsim') {
1359
-		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1359
+		$settings = array_merge($settings, array('globalVATSIM' => 'TRUE'));
1360 1360
 		$va = true;
1361
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1361
+	} else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE'));
1362 1362
 	if ($globalphpvms == 'phpvms') {
1363
-		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1363
+		$settings = array_merge($settings, array('globalphpVMS' => 'TRUE'));
1364 1364
 		$va = true;
1365
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1365
+	} else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE'));
1366 1366
 	if ($globalvam == 'vam') {
1367
-		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1367
+		$settings = array_merge($settings, array('globalVAM' => 'TRUE'));
1368 1368
 		$va = true;
1369
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1369
+	} else $settings = array_merge($settings, array('globalVAM' => 'FALSE'));
1370 1370
 	if ($va) {
1371
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1372
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1371
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE'));
1372
+	} else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE'));
1373 1373
 	if ($globalva == 'va' || $va) {
1374
-		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1375
-		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1374
+		$settings = array_merge($settings, array('globalVA' => 'TRUE'));
1375
+		$settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE'));
1376 1376
 	} else {
1377
-		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1378
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1379
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1377
+		$settings = array_merge($settings, array('globalVA' => 'FALSE'));
1378
+		if ($forcepilots) $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE'));
1379
+		else $settings = array_merge($settings, array('globalUsePilot' => 'FALSE', 'globalUseOwner' => 'TRUE'));
1380 1380
 	}
1381 1381
 	
1382 1382
 	
1383 1383
 
1384
-	$notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING);
1384
+	$notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING);
1385 1385
 	if ($notam == 'notam') {
1386
-		$settings = array_merge($settings,array('globalNOTAM' => 'TRUE'));
1386
+		$settings = array_merge($settings, array('globalNOTAM' => 'TRUE'));
1387 1387
 	} else {
1388
-		$settings = array_merge($settings,array('globalNOTAM' => 'FALSE'));
1388
+		$settings = array_merge($settings, array('globalNOTAM' => 'FALSE'));
1389 1389
 	}
1390
-	$owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING);
1390
+	$owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING);
1391 1391
 	if ($owner == 'owner') {
1392
-		$settings = array_merge($settings,array('globalOwner' => 'TRUE'));
1392
+		$settings = array_merge($settings, array('globalOwner' => 'TRUE'));
1393 1393
 	} else {
1394
-		$settings = array_merge($settings,array('globalOwner' => 'FALSE'));
1394
+		$settings = array_merge($settings, array('globalOwner' => 'FALSE'));
1395 1395
 	}
1396
-	$map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING);
1396
+	$map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING);
1397 1397
 	if ($map3d == 'map3d') {
1398
-		$settings = array_merge($settings,array('globalMap3D' => 'TRUE'));
1398
+		$settings = array_merge($settings, array('globalMap3D' => 'TRUE'));
1399 1399
 	} else {
1400
-		$settings = array_merge($settings,array('globalMap3D' => 'FALSE'));
1400
+		$settings = array_merge($settings, array('globalMap3D' => 'FALSE'));
1401 1401
 	}
1402
-	$crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING);
1402
+	$crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING);
1403 1403
 	if ($crash == 'crash') {
1404
-		$settings = array_merge($settings,array('globalAccidents' => 'TRUE'));
1404
+		$settings = array_merge($settings, array('globalAccidents' => 'TRUE'));
1405 1405
 	} else {
1406
-		$settings = array_merge($settings,array('globalAccidents' => 'FALSE'));
1406
+		$settings = array_merge($settings, array('globalAccidents' => 'FALSE'));
1407 1407
 	}
1408
-	$fires = filter_input(INPUT_POST,'fires',FILTER_SANITIZE_STRING);
1408
+	$fires = filter_input(INPUT_POST, 'fires', FILTER_SANITIZE_STRING);
1409 1409
 	if ($fires == 'fires') {
1410
-		$settings = array_merge($settings,array('globalMapFires' => 'TRUE'));
1410
+		$settings = array_merge($settings, array('globalMapFires' => 'TRUE'));
1411 1411
 	} else {
1412
-		$settings = array_merge($settings,array('globalMapFires' => 'FALSE'));
1412
+		$settings = array_merge($settings, array('globalMapFires' => 'FALSE'));
1413 1413
 	}
1414
-	$firessupport = filter_input(INPUT_POST,'firessupport',FILTER_SANITIZE_STRING);
1414
+	$firessupport = filter_input(INPUT_POST, 'firessupport', FILTER_SANITIZE_STRING);
1415 1415
 	if ($firessupport == 'firessupport') {
1416
-		$settings = array_merge($settings,array('globalFires' => 'TRUE'));
1416
+		$settings = array_merge($settings, array('globalFires' => 'TRUE'));
1417 1417
 	} else {
1418
-		$settings = array_merge($settings,array('globalFires' => 'FALSE'));
1418
+		$settings = array_merge($settings, array('globalFires' => 'FALSE'));
1419 1419
 	}
1420
-	$mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING);
1420
+	$mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING);
1421 1421
 	if ($mapsatellites == 'mapsatellites') {
1422
-		$settings = array_merge($settings,array('globalMapSatellites' => 'TRUE'));
1422
+		$settings = array_merge($settings, array('globalMapSatellites' => 'TRUE'));
1423 1423
 	} else {
1424
-		$settings = array_merge($settings,array('globalMapSatellites' => 'FALSE'));
1424
+		$settings = array_merge($settings, array('globalMapSatellites' => 'FALSE'));
1425 1425
 	}
1426
-	$map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING);
1426
+	$map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING);
1427 1427
 	if ($map3ddefault == 'map3ddefault') {
1428
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE'));
1428
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE'));
1429 1429
 	} else {
1430
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE'));
1430
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE'));
1431 1431
 	}
1432
-	$map3dliveries = filter_input(INPUT_POST,'map3dliveries',FILTER_SANITIZE_STRING);
1432
+	$map3dliveries = filter_input(INPUT_POST, 'map3dliveries', FILTER_SANITIZE_STRING);
1433 1433
 	if ($map3dliveries == 'map3dliveries') {
1434
-		$settings = array_merge($settings,array('globalMap3DLiveries' => 'TRUE'));
1434
+		$settings = array_merge($settings, array('globalMap3DLiveries' => 'TRUE'));
1435 1435
 	} else {
1436
-		$settings = array_merge($settings,array('globalMap3DLiveries' => 'FALSE'));
1436
+		$settings = array_merge($settings, array('globalMap3DLiveries' => 'FALSE'));
1437 1437
 	}
1438
-	$translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING);
1438
+	$translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING);
1439 1439
 	if ($translate == 'translate') {
1440
-		$settings = array_merge($settings,array('globalTranslate' => 'TRUE'));
1440
+		$settings = array_merge($settings, array('globalTranslate' => 'TRUE'));
1441 1441
 	} else {
1442
-		$settings = array_merge($settings,array('globalTranslate' => 'FALSE'));
1442
+		$settings = array_merge($settings, array('globalTranslate' => 'FALSE'));
1443 1443
 	}
1444
-	$realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING);
1444
+	$realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING);
1445 1445
 	if ($realairlines == 'realairlines') {
1446
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE'));
1446
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE'));
1447 1447
 	} else {
1448
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE'));
1448
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE'));
1449 1449
 	}
1450
-	$estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING);
1450
+	$estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING);
1451 1451
 	if ($estimation == 'estimation') {
1452
-		$settings = array_merge($settings,array('globalMapEstimation' => 'TRUE'));
1452
+		$settings = array_merge($settings, array('globalMapEstimation' => 'TRUE'));
1453 1453
 	} else {
1454
-		$settings = array_merge($settings,array('globalMapEstimation' => 'FALSE'));
1454
+		$settings = array_merge($settings, array('globalMapEstimation' => 'FALSE'));
1455 1455
 	}
1456
-	$metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING);
1456
+	$metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING);
1457 1457
 	if ($metar == 'metar') {
1458
-		$settings = array_merge($settings,array('globalMETAR' => 'TRUE'));
1458
+		$settings = array_merge($settings, array('globalMETAR' => 'TRUE'));
1459 1459
 	} else {
1460
-		$settings = array_merge($settings,array('globalMETAR' => 'FALSE'));
1460
+		$settings = array_merge($settings, array('globalMETAR' => 'FALSE'));
1461 1461
 	}
1462
-	$metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING);
1462
+	$metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING);
1463 1463
 	if ($metarcycle == 'metarcycle') {
1464
-		$settings = array_merge($settings,array('globalMETARcycle' => 'TRUE'));
1464
+		$settings = array_merge($settings, array('globalMETARcycle' => 'TRUE'));
1465 1465
 	} else {
1466
-		$settings = array_merge($settings,array('globalMETARcycle' => 'FALSE'));
1466
+		$settings = array_merge($settings, array('globalMETARcycle' => 'FALSE'));
1467 1467
 	}
1468
-	$fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING);
1468
+	$fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING);
1469 1469
 	if ($fork == 'fork') {
1470
-		$settings = array_merge($settings,array('globalFork' => 'TRUE'));
1470
+		$settings = array_merge($settings, array('globalFork' => 'TRUE'));
1471 1471
 	} else {
1472
-		$settings = array_merge($settings,array('globalFork' => 'FALSE'));
1472
+		$settings = array_merge($settings, array('globalFork' => 'FALSE'));
1473 1473
 	}
1474 1474
 
1475
-	$colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING);
1475
+	$colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING);
1476 1476
 	if ($colormap == 'colormap') {
1477
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE'));
1477
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE'));
1478 1478
 	} else {
1479
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE'));
1479
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE'));
1480 1480
 	}
1481 1481
 	
1482 1482
 	if (isset($_POST['aircrafticoncolor'])) {
1483
-		$aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING);
1484
-		$settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1)));
1483
+		$aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING);
1484
+		$settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1)));
1485 1485
 	}
1486 1486
 
1487
-	$airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT);
1488
-	$settings = array_merge($settings,array('globalAirportZoom' => $airportzoom));
1487
+	$airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT);
1488
+	$settings = array_merge($settings, array('globalAirportZoom' => $airportzoom));
1489 1489
 
1490
-	$unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING);
1491
-	$settings = array_merge($settings,array('globalUnitDistance' => $unitdistance));
1492
-	$unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING);
1493
-	$settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude));
1494
-	$unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING);
1495
-	$settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed));
1490
+	$unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING);
1491
+	$settings = array_merge($settings, array('globalUnitDistance' => $unitdistance));
1492
+	$unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING);
1493
+	$settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude));
1494
+	$unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING);
1495
+	$settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed));
1496 1496
 
1497
-	$mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING);
1497
+	$mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING);
1498 1498
 	if ($mappopup == 'mappopup') {
1499
-		$settings = array_merge($settings,array('globalMapPopup' => 'TRUE'));
1499
+		$settings = array_merge($settings, array('globalMapPopup' => 'TRUE'));
1500 1500
 	} else {
1501
-		$settings = array_merge($settings,array('globalMapPopup' => 'FALSE'));
1501
+		$settings = array_merge($settings, array('globalMapPopup' => 'FALSE'));
1502 1502
 	}
1503
-	$airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING);
1503
+	$airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING);
1504 1504
 	if ($airportpopup == 'airportpopup') {
1505
-		$settings = array_merge($settings,array('globalAirportPopup' => 'TRUE'));
1505
+		$settings = array_merge($settings, array('globalAirportPopup' => 'TRUE'));
1506 1506
 	} else {
1507
-		$settings = array_merge($settings,array('globalAirportPopup' => 'FALSE'));
1507
+		$settings = array_merge($settings, array('globalAirportPopup' => 'FALSE'));
1508 1508
 	}
1509
-	$maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING);
1509
+	$maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING);
1510 1510
 	if ($maphistory == 'maphistory') {
1511
-		$settings = array_merge($settings,array('globalMapHistory' => 'TRUE'));
1511
+		$settings = array_merge($settings, array('globalMapHistory' => 'TRUE'));
1512 1512
 	} else {
1513
-		$settings = array_merge($settings,array('globalMapHistory' => 'FALSE'));
1513
+		$settings = array_merge($settings, array('globalMapHistory' => 'FALSE'));
1514 1514
 	}
1515
-	$maptooltip = filter_input(INPUT_POST,'maptooltip',FILTER_SANITIZE_STRING);
1515
+	$maptooltip = filter_input(INPUT_POST, 'maptooltip', FILTER_SANITIZE_STRING);
1516 1516
 	if ($maptooltip == 'maptooltip') {
1517
-		$settings = array_merge($settings,array('globalMapTooltip' => 'TRUE'));
1517
+		$settings = array_merge($settings, array('globalMapTooltip' => 'TRUE'));
1518 1518
 	} else {
1519
-		$settings = array_merge($settings,array('globalMapTooltip' => 'FALSE'));
1519
+		$settings = array_merge($settings, array('globalMapTooltip' => 'FALSE'));
1520 1520
 	}
1521
-	$flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING);
1521
+	$flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING);
1522 1522
 	if ($flightroute == 'flightroute') {
1523
-		$settings = array_merge($settings,array('globalMapRoute' => 'TRUE'));
1523
+		$settings = array_merge($settings, array('globalMapRoute' => 'TRUE'));
1524 1524
 	} else {
1525
-		$settings = array_merge($settings,array('globalMapRoute' => 'FALSE'));
1525
+		$settings = array_merge($settings, array('globalMapRoute' => 'FALSE'));
1526 1526
 	}
1527
-	$flightremainingroute = filter_input(INPUT_POST,'flightremainingroute',FILTER_SANITIZE_STRING);
1527
+	$flightremainingroute = filter_input(INPUT_POST, 'flightremainingroute', FILTER_SANITIZE_STRING);
1528 1528
 	if ($flightremainingroute == 'flightremainingroute') {
1529
-		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'TRUE'));
1529
+		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'TRUE'));
1530 1530
 	} else {
1531
-		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'FALSE'));
1531
+		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'FALSE'));
1532 1532
 	}
1533
-	$allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING);
1533
+	$allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING);
1534 1534
 	if ($allflights == 'allflights') {
1535
-		$settings = array_merge($settings,array('globalAllFlights' => 'TRUE'));
1535
+		$settings = array_merge($settings, array('globalAllFlights' => 'TRUE'));
1536 1536
 	} else {
1537
-		$settings = array_merge($settings,array('globalAllFlights' => 'FALSE'));
1537
+		$settings = array_merge($settings, array('globalAllFlights' => 'FALSE'));
1538 1538
 	}
1539
-	$bbox = filter_input(INPUT_POST,'bbox',FILTER_SANITIZE_STRING);
1539
+	$bbox = filter_input(INPUT_POST, 'bbox', FILTER_SANITIZE_STRING);
1540 1540
 	if ($bbox == 'bbox') {
1541
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'TRUE'));
1541
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'TRUE'));
1542 1542
 	} else {
1543
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'FALSE'));
1543
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'FALSE'));
1544 1544
 	}
1545
-	$groundaltitude = filter_input(INPUT_POST,'groundaltitude',FILTER_SANITIZE_STRING);
1545
+	$groundaltitude = filter_input(INPUT_POST, 'groundaltitude', FILTER_SANITIZE_STRING);
1546 1546
 	if ($groundaltitude == 'groundaltitude') {
1547
-		$settings = array_merge($settings,array('globalGroundAltitude' => 'TRUE'));
1547
+		$settings = array_merge($settings, array('globalGroundAltitude' => 'TRUE'));
1548 1548
 	} else {
1549
-		$settings = array_merge($settings,array('globalGroundAltitude' => 'FALSE'));
1549
+		$settings = array_merge($settings, array('globalGroundAltitude' => 'FALSE'));
1550 1550
 	}
1551
-	$waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING);
1551
+	$waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING);
1552 1552
 	if ($waypoints == 'waypoints') {
1553
-		$settings = array_merge($settings,array('globalWaypoints' => 'TRUE'));
1553
+		$settings = array_merge($settings, array('globalWaypoints' => 'TRUE'));
1554 1554
 	} else {
1555
-		$settings = array_merge($settings,array('globalWaypoints' => 'FALSE'));
1555
+		$settings = array_merge($settings, array('globalWaypoints' => 'FALSE'));
1556 1556
 	}
1557
-	$geoid = filter_input(INPUT_POST,'geoid',FILTER_SANITIZE_STRING);
1557
+	$geoid = filter_input(INPUT_POST, 'geoid', FILTER_SANITIZE_STRING);
1558 1558
 	if ($geoid == 'geoid') {
1559
-		$settings = array_merge($settings,array('globalGeoid' => 'TRUE'));
1559
+		$settings = array_merge($settings, array('globalGeoid' => 'TRUE'));
1560 1560
 	} else {
1561
-		$settings = array_merge($settings,array('globalGeoid' => 'FALSE'));
1561
+		$settings = array_merge($settings, array('globalGeoid' => 'FALSE'));
1562 1562
 	}
1563
-	$geoid_source = filter_input(INPUT_POST,'geoid_source',FILTER_SANITIZE_STRING);
1564
-	$settings = array_merge($settings,array('globalGeoidSource' => $geoid_source));
1563
+	$geoid_source = filter_input(INPUT_POST, 'geoid_source', FILTER_SANITIZE_STRING);
1564
+	$settings = array_merge($settings, array('globalGeoidSource' => $geoid_source));
1565 1565
 
1566
-	$noairlines = filter_input(INPUT_POST,'noairlines',FILTER_SANITIZE_STRING);
1566
+	$noairlines = filter_input(INPUT_POST, 'noairlines', FILTER_SANITIZE_STRING);
1567 1567
 	if ($noairlines == 'noairlines') {
1568
-		$settings = array_merge($settings,array('globalNoAirlines' => 'TRUE'));
1568
+		$settings = array_merge($settings, array('globalNoAirlines' => 'TRUE'));
1569 1569
 	} else {
1570
-		$settings = array_merge($settings,array('globalNoAirlines' => 'FALSE'));
1570
+		$settings = array_merge($settings, array('globalNoAirlines' => 'FALSE'));
1571 1571
 	}
1572 1572
 
1573
-	$tsk = filter_input(INPUT_POST,'tsk',FILTER_SANITIZE_STRING);
1573
+	$tsk = filter_input(INPUT_POST, 'tsk', FILTER_SANITIZE_STRING);
1574 1574
 	if ($tsk == 'tsk') {
1575
-		$settings = array_merge($settings,array('globalTSK' => 'TRUE'));
1575
+		$settings = array_merge($settings, array('globalTSK' => 'TRUE'));
1576 1576
 	} else {
1577
-		$settings = array_merge($settings,array('globalTSK' => 'FALSE'));
1577
+		$settings = array_merge($settings, array('globalTSK' => 'FALSE'));
1578 1578
 	}
1579 1579
 
1580
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1580
+	if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE'));
1581 1581
 
1582 1582
 	// Set some defaults values...
1583 1583
 	if (!isset($globalAircraftImageSources)) {
1584
-	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1585
-	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1584
+	    $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters');
1585
+	    $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources));
1586 1586
 	}
1587 1587
 
1588 1588
 	if (!isset($globalSchedulesSources)) {
1589
-	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1590
-    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1589
+	    $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware');
1590
+    	    $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources));
1591 1591
     	}
1592 1592
 
1593
-	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1593
+	$settings = array_merge($settings, array('globalInstalled' => 'TRUE'));
1594 1594
 
1595 1595
 	if ($error == '') settings::modify_settings($settings);
1596 1596
 	if ($error == '') settings::comment_settings($settings_comment);
Please login to merge, or discard this patch.
Braces   +554 added lines, -150 removed lines patch added patch discarded remove patch
@@ -4,11 +4,19 @@  discard block
 block discarded – undo
4 4
 if (isset($_SESSION['error'])) {
5 5
 	header('Content-Encoding: none;');
6 6
 	echo 'Error : '.$_SESSION['error'].' - Resetting install... You need to fix the problem and run install again.';
7
-	if (isset($_SESSION['error'])) unset($_SESSION['error']);
8
-	if (isset($_SESSION['errorlst'])) unset($_SESSION['errorlst']);
9
-	if (isset($_SESSION['next'])) unset($_SESSION['next']);
10
-	if (isset($_SESSION['install'])) unset($_SESSION['install']);
11
-}
7
+	if (isset($_SESSION['error'])) {
8
+		unset($_SESSION['error']);
9
+	}
10
+	if (isset($_SESSION['errorlst'])) {
11
+		unset($_SESSION['errorlst']);
12
+	}
13
+	if (isset($_SESSION['next'])) {
14
+		unset($_SESSION['next']);
15
+	}
16
+	if (isset($_SESSION['install'])) {
17
+		unset($_SESSION['install']);
18
+	}
19
+	}
12 20
 /*
13 21
 if (isset($_SESSION['errorlst'])) {
14 22
 	header('Content-Encoding: none;');
@@ -159,45 +167,72 @@  discard block
 block discarded – undo
159 167
 			</div>
160 168
 			<p>
161 169
 				<label for="dbhost">Database hostname</label>
162
-				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" />
170
+				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) {
171
+	print $globalDBhost;
172
+}
173
+?>" />
163 174
 			</p>
164 175
 			<p>
165 176
 				<label for="dbport">Database port</label>
166
-				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" />
177
+				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) {
178
+	print $globalDBport;
179
+}
180
+?>" />
167 181
 				<p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p>
168 182
 			</p>
169 183
 			<p>
170 184
 				<label for="dbname">Database name</label>
171
-				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" />
185
+				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) {
186
+	print $globalDBname;
187
+}
188
+?>" />
172 189
 			</p>
173 190
 			<p>
174 191
 				<label for="dbuser">Database user</label>
175
-				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" />
192
+				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) {
193
+	print $globalDBuser;
194
+}
195
+?>" />
176 196
 			</p>
177 197
 			<p>
178 198
 				<label for="dbuserpass">Database user password</label>
179
-				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" />
199
+				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) {
200
+	print $globalDBpass;
201
+}
202
+?>" />
180 203
 			</p>
181 204
 		</fieldset>
182 205
 		<fieldset id="site">
183 206
 			<legend>Site configuration</legend>
184 207
 			<p>
185 208
 				<label for="sitename">Site name</label>
186
-				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" />
209
+				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) {
210
+	print $globalName;
211
+}
212
+?>" />
187 213
 			</p>
188 214
 			<p>
189 215
 				<label for="siteurl">Site directory</label>
190
-				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" />
216
+				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) {
217
+	print $globalURL;
218
+}
219
+?>" />
191 220
 				<p class="help-block">Can be null. ex : <i>flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p>
192 221
 			</p>
193 222
 			<p>
194 223
 				<label for="timezone">Timezone</label>
195
-				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" />
224
+				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) {
225
+	print $globalTimezone;
226
+}
227
+?>" />
196 228
 				<p class="help-block">ex : UTC, Europe/Paris,...</p>
197 229
 			</p>
198 230
 			<p>
199 231
 				<label for="language">Language</label>
200
-				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" />
232
+				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) {
233
+	print $globalLanguage;
234
+}
235
+?>" />
201 236
 				<p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p>
202 237
 			</p>
203 238
 		</fieldset>
@@ -218,11 +253,17 @@  discard block
 block discarded – undo
218 253
 			<div id="mapbox_data">
219 254
 				<p>
220 255
 					<label for="mapboxid">Mapbox id</label>
221
-					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" />
256
+					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) {
257
+	print $globalMapboxId;
258
+}
259
+?>" />
222 260
 				</p>
223 261
 				<p>
224 262
 					<label for="mapboxtoken">Mapbox token</label>
225
-					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" />
263
+					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) {
264
+	print $globalMapboxToken;
265
+}
266
+?>" />
226 267
 				</p>
227 268
 				<p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p>
228 269
 			</div>
@@ -230,7 +271,10 @@  discard block
 block discarded – undo
230 271
 			<div id="google_data">
231 272
 				<p>
232 273
 					<label for="googlekey">Google API key</label>
233
-					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" />
274
+					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) {
275
+	print $globalGoogleAPIKey;
276
+}
277
+?>" />
234 278
 					<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>
235 279
 				</p>
236 280
 			</div>
@@ -238,7 +282,10 @@  discard block
 block discarded – undo
238 282
 			<div id="bing_data">
239 283
 				<p>
240 284
 					<label for="bingkey">Bing Map key</label>
241
-					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" />
285
+					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) {
286
+	print $globalBingMapKey;
287
+}
288
+?>" />
242 289
 					<p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p>
243 290
 				</p>
244 291
 			</div>
@@ -246,7 +293,10 @@  discard block
 block discarded – undo
246 293
 			<div id="mapquest_data">
247 294
 				<p>
248 295
 					<label for="mapquestkey">MapQuest key</label>
249
-					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" />
296
+					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) {
297
+	print $globalMapQuestKey;
298
+}
299
+?>" />
250 300
 					<p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p>
251 301
 				</p>
252 302
 			</div>
@@ -254,11 +304,17 @@  discard block
 block discarded – undo
254 304
 			<div id="here_data">
255 305
 				<p>
256 306
 					<label for="hereappid">Here App_Id</label>
257
-					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" />
307
+					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) {
308
+	print $globalHereappId;
309
+}
310
+?>" />
258 311
 				</p>
259 312
 				<p>
260 313
 					<label for="hereappcode">Here App_Code</label>
261
-					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" />
314
+					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) {
315
+	print $globalHereappCode;
316
+}
317
+?>" />
262 318
 				</p>
263 319
 				<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>
264 320
 			</div>
@@ -266,7 +322,10 @@  discard block
 block discarded – undo
266 322
 			<div id="openweathermap_data">
267 323
 				<p>
268 324
 					<label for="openweathermapkey">OpenWeatherMap key (weather layer)</label>
269
-					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) print $globalOpenWeatherMapKey; ?>" />
325
+					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) {
326
+	print $globalOpenWeatherMapKey;
327
+}
328
+?>" />
270 329
 					<p class="help-block">Get a key <a href="https://openweathermap.org/">here</a></p>
271 330
 				</p>
272 331
 			</div>
@@ -276,42 +335,86 @@  discard block
 block discarded – undo
276 335
 			<legend>Coverage area</legend>
277 336
 			<p>
278 337
 				<label for="latitudemax">The maximum latitude (north)</label>
279
-				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" />
338
+				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) {
339
+	print $globalLatitudeMax;
340
+}
341
+?>" />
280 342
 			</p>
281 343
 			<p>
282 344
 				<label for="latitudemin">The minimum latitude (south)</label>
283
-				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" />
345
+				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) {
346
+	print $globalLatitudeMin;
347
+}
348
+?>" />
284 349
 			</p>
285 350
 			<p>
286 351
 				<label for="longitudemax">The maximum longitude (west)</label>
287
-				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" />
352
+				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) {
353
+	print $globalLongitudeMax;
354
+}
355
+?>" />
288 356
 			</p>
289 357
 			<p>
290 358
 				<label for="longitudemin">The minimum longitude (east)</label>
291
-				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" />
359
+				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) {
360
+	print $globalLongitudeMin;
361
+}
362
+?>" />
292 363
 			</p>
293 364
 			<p>
294 365
 				<label for="latitudecenter">The latitude center</label>
295
-				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" />
366
+				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) {
367
+	print $globalCenterLatitude;
368
+}
369
+?>" />
296 370
 			</p>
297 371
 			<p>
298 372
 				<label for="longitudecenter">The longitude center</label>
299
-				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" />
373
+				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) {
374
+	print $globalCenterLongitude;
375
+}
376
+?>" />
300 377
 			</p>
301 378
 			<p>
302 379
 				<label for="livezoom">Default Zoom on live map</label>
303
-				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" />
380
+				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) {
381
+	print $globalLiveZoom;
382
+} else {
383
+	print '9';
384
+}
385
+?>" />
304 386
 			</p>
305 387
 			<p>
306 388
 				<label for="squawk_country">Country for squawk usage</label>
307 389
 				<select name="squawk_country" id="squawk_country">
308
-					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option>
309
-					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option>
310
-					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option>
311
-					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option>
312
-					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option>
313
-					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option>
314
-					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option>
390
+					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') {
391
+	print ' selected ';
392
+}
393
+?>>UK</option>
394
+					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') {
395
+	print ' selected ';
396
+}
397
+?>>NZ</option>
398
+					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') {
399
+	print ' selected ';
400
+}
401
+?>>US</option>
402
+					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') {
403
+	print ' selected ';
404
+}
405
+?>>AU</option>
406
+					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') {
407
+	print ' selected ';
408
+}
409
+?>>NL</option>
410
+					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') {
411
+	print ' selected ';
412
+}
413
+?>>FR</option>
414
+					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') {
415
+	print ' selected ';
416
+}
417
+?>>TR</option>
315 418
 				</select>
316 419
 			</p>
317 420
 		</fieldset>
@@ -320,15 +423,24 @@  discard block
 block discarded – undo
320 423
 			<p><i>Only put in DB flights that are inside a circle</i></p>
321 424
 			<p>
322 425
 				<label for="latitude">Center latitude</label>
323
-				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" />
426
+				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) {
427
+	echo $globalDistanceIgnore['latitude'];
428
+}
429
+?>" />
324 430
 			</p>
325 431
 			<p>
326 432
 				<label for="longitude">Center longitude</label>
327
-				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" />
433
+				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) {
434
+	echo $globalDistanceIgnore['longitude'];
435
+}
436
+?>" />
328 437
 			</p>
329 438
 			<p>
330 439
 				<label for="Distance">Distance (in km)</label>
331
-				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" />
440
+				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) {
441
+	echo $globalDistanceIgnore['distance'];
442
+}
443
+?>" />
332 444
 			</p>
333 445
 		</fieldset>
334 446
 		<fieldset id="sourceloc">
@@ -441,11 +553,17 @@  discard block
 block discarded – undo
441 553
 			<div id="flightaware_data">
442 554
 				<p>
443 555
 					<label for="flightawareusername">FlightAware username</label>
444
-					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
556
+					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
557
+	print $globalFlightAwareUsername;
558
+}
559
+?>" />
445 560
 				</p>
446 561
 				<p>
447 562
 					<label for="flightawarepassword">FlightAware password/API key</label>
448
-					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
563
+					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
564
+	print $globalFlightAwarePassword;
565
+}
566
+?>" />
449 567
 				</p>
450 568
 			</div>
451 569
 -->
@@ -487,7 +605,10 @@  discard block
 block discarded – undo
487 605
 								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
488 606
 								?>
489 607
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
490
-								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
608
+								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) {
609
+	print $source['port'];
610
+}
611
+?>" /></td>
491 612
 								<?php
492 613
 								    } else {
493 614
 									$hostport = explode(':',$source['host']);
@@ -506,34 +627,106 @@  discard block
 block discarded – undo
506 627
 								?>
507 628
 								<td>
508 629
 									<select name="format[]" id="format">
509
-										<option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option>
510
-										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option>
511
-										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option>
512
-										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option>
513
-										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option>
514
-										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option>
515
-										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option>
516
-										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option>
517
-										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option>
518
-										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option>
519
-										<option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>Virtual Airline Operations System (VAOS)</option>
520
-										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option>
521
-										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option>
522
-										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option>
523
-										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option>
524
-										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
525
-										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option>
526
-										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option>
527
-										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') print 'selected'; ?>>AirWhere website</option>
528
-										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') print 'selected'; ?>>HidnSeek Callback</option>
529
-										<option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') print 'selected'; ?>>Blitzortung</option>
630
+										<option value="auto" <?php if (!isset($source['format'])) {
631
+	print 'selected';
632
+}
633
+?>>Auto</option>
634
+										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') {
635
+	print 'selected';
636
+}
637
+?>>SBS</option>
638
+										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') {
639
+	print 'selected';
640
+}
641
+?>>TSV</option>
642
+										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') {
643
+	print 'selected';
644
+}
645
+?>>Raw</option>
646
+										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') {
647
+	print 'selected';
648
+}
649
+?>>APRS</option>
650
+										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') {
651
+	print 'selected';
652
+}
653
+?>>Radarcape deltadb.txt</option>
654
+										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') {
655
+	print 'selected';
656
+}
657
+?>>Vatsim</option>
658
+										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') {
659
+	print 'selected';
660
+}
661
+?>>Virtual Radar Server AircraftList.json</option>
662
+										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') {
663
+	print 'selected';
664
+}
665
+?>>Virtual Radar Server TCP</option>
666
+										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
667
+	print 'selected';
668
+}
669
+?>>phpVMS</option>
670
+										<option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
671
+	print 'selected';
672
+}
673
+?>>Virtual Airline Operations System (VAOS)</option>
674
+										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') {
675
+	print 'selected';
676
+}
677
+?>>Virtual Airlines Manager</option>
678
+										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') {
679
+	print 'selected';
680
+}
681
+?>>IVAO</option>
682
+										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') {
683
+	print 'selected';
684
+}
685
+?>>FlightGear Multiplayer</option>
686
+										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') {
687
+	print 'selected';
688
+}
689
+?>>FlightGear Singleplayer</option>
690
+										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') {
691
+	print 'selected';
692
+}
693
+?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
694
+										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') {
695
+	print 'selected';
696
+}
697
+?>>ACARS SBS-3 over TCP</option>
698
+										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') {
699
+	print 'selected';
700
+}
701
+?>>NMEA AIS over TCP</option>
702
+										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') {
703
+	print 'selected';
704
+}
705
+?>>AirWhere website</option>
706
+										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') {
707
+	print 'selected';
708
+}
709
+?>>HidnSeek Callback</option>
710
+										<option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') {
711
+	print 'selected';
712
+}
713
+?>>Blitzortung</option>
530 714
 									</select>
531 715
 								</td>
532 716
 								<td>
533
-									<input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" />
717
+									<input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) {
718
+	print $source['name'];
719
+}
720
+?>" />
534 721
 								</td>
535
-								<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>
536
-								<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>
722
+								<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']) {
723
+	print 'checked';
724
+}
725
+?> /></td>
726
+								<td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) {
727
+	print 'checked';
728
+}
729
+?> /></td>
537 730
 								<td>
538 731
 									<select name="timezones[]" id="timezones">
539 732
 								<?php
@@ -543,7 +736,9 @@  discard block
 block discarded – undo
543 736
 											print '<option selected>'.$timezones.'</option>';
544 737
 										} elseif (!isset($source['timezone']) && $timezones == 'UTC') {
545 738
 											print '<option selected>'.$timezones.'</option>';
546
-										} else print '<option>'.$timezones.'</option>';
739
+										} else {
740
+											print '<option>'.$timezones.'</option>';
741
+										}
547 742
 									}
548 743
 								?>
549 744
 									</select>
@@ -594,7 +789,9 @@  discard block
 block discarded – undo
594 789
 									foreach($timezonelist as $timezones){
595 790
 										if ($timezones == 'UTC') {
596 791
 											print '<option selected>'.$timezones.'</option>';
597
-										} else print '<option>'.$timezones.'</option>';
792
+										} else {
793
+											print '<option>'.$timezones.'</option>';
794
+										}
598 795
 									}
599 796
 								?>
600 797
 									</select>
@@ -618,11 +815,17 @@  discard block
 block discarded – undo
618 815
 					<p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p>
619 816
 					<p>
620 817
 						<label for="acarshost">ACARS UDP host</label>
621
-						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" />
818
+						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) {
819
+	print $globalACARSHost;
820
+}
821
+?>" />
622 822
 					</p>
623 823
 					<p>
624 824
 						<label for="acarsport">ACARS UDP port</label>
625
-						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" />
825
+						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) {
826
+	print $globalACARSPort;
827
+}
828
+?>" />
626 829
 					</p>
627 830
 				</fieldset>
628 831
 			</div>
@@ -648,17 +851,38 @@  discard block
 block discarded – undo
648 851
 				    <td><input type="url" name="newsurl[]" value="<?php print $feed; ?>"/></td>
649 852
 				    <td>
650 853
 					<select name="newslang[]">
651
-					    <option value="en"<?php if ($lng == 'en') print ' selected'; ?>>English</option>
652
-					    <option value="fr"<?php if ($lng == 'fr') print ' selected'; ?>>French</option>
854
+					    <option value="en"<?php if ($lng == 'en') {
855
+	print ' selected';
856
+}
857
+?>>English</option>
858
+					    <option value="fr"<?php if ($lng == 'fr') {
859
+	print ' selected';
860
+}
861
+?>>French</option>
653 862
 					</select>
654 863
 				    </td>
655 864
 				    <td>
656 865
 					<select name="newstype[]">
657
-					    <option value="global"<?php if ($type == 'global') print ' selected'; ?>>Global</option>
658
-					    <option value="aircraft"<?php if ($type == 'aircraft') print ' selected'; ?>>Aircraft</option>
659
-					    <option value="marine"<?php if ($type == 'marine') print ' selected'; ?>>Marine</option>
660
-					    <option value="tracker"<?php if ($type == 'tracker') print ' selected'; ?>>Tracker</option>
661
-					    <option value="satellite"<?php if ($type == 'Satellite') print ' selected'; ?>>Satellite</option>
866
+					    <option value="global"<?php if ($type == 'global') {
867
+	print ' selected';
868
+}
869
+?>>Global</option>
870
+					    <option value="aircraft"<?php if ($type == 'aircraft') {
871
+	print ' selected';
872
+}
873
+?>>Aircraft</option>
874
+					    <option value="marine"<?php if ($type == 'marine') {
875
+	print ' selected';
876
+}
877
+?>>Marine</option>
878
+					    <option value="tracker"<?php if ($type == 'tracker') {
879
+	print ' selected';
880
+}
881
+?>>Tracker</option>
882
+					    <option value="satellite"<?php if ($type == 'Satellite') {
883
+	print ' selected';
884
+}
885
+?>>Satellite</option>
662 886
 					</select>
663 887
 				    </td>
664 888
 				    <td><input type="button" value="Delete" onclick="deleteRowNews(this)" /> <input type="button" value="Add" onclick="insRowNews()" /></td>
@@ -791,13 +1015,19 @@  discard block
 block discarded – undo
791 1015
 			<div id="schedules_options">
792 1016
 				<p>
793 1017
 					<label for="britishairways">British Airways API Key</label>
794
-					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" />
1018
+					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) {
1019
+	print $globalBritishAirwaysKey;
1020
+}
1021
+?>" />
795 1022
 					<p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p>
796 1023
 				</p>
797 1024
 				<!--
798 1025
 				<p>
799 1026
 					<label for="transavia">Transavia Test API Consumer Key</label>
800
-					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" />
1027
+					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) {
1028
+	print $globalTransaviaKey;
1029
+}
1030
+?>" />
801 1031
 					<p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p>
802 1032
 				</p>
803 1033
 				-->
@@ -806,10 +1036,16 @@  discard block
 block discarded – undo
806 1036
 						<b>Lufthansa API Key</b>
807 1037
 						<p>
808 1038
 							<label for="lufthansakey">Key</label>
809
-							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" />
1039
+							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) {
1040
+	print $globalLufthansaKey['key'];
1041
+}
1042
+?>" />
810 1043
 						</p><p>
811 1044
 							<label for="lufthansasecret">Secret</label>
812
-							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" />
1045
+							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) {
1046
+	print $globalLufthansaKey['secret'];
1047
+}
1048
+?>" />
813 1049
 						</p>
814 1050
 					</div>
815 1051
 					<p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p>
@@ -829,7 +1065,10 @@  discard block
 block discarded – undo
829 1065
 			</p>
830 1066
 			<p>
831 1067
 				<label for="notamsource">URL of your feed from notaminfo.com</label>
832
-				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" />
1068
+				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) {
1069
+	print $globalNOTAMSource;
1070
+}
1071
+?>" />
833 1072
 				<p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p>
834 1073
 			</p>
835 1074
 			<br />
@@ -845,14 +1084,20 @@  discard block
 block discarded – undo
845 1084
 			<div id="metarsrc">
846 1085
 				<p>
847 1086
 					<label for="metarsource">URL of your METAR source</label>
848
-					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" />
1087
+					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) {
1088
+	print $globalMETARurl;
1089
+}
1090
+?>" />
849 1091
 					<p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p>
850 1092
 				</p>
851 1093
 			</div>
852 1094
 			<br />
853 1095
 			<p>
854 1096
 				<label for="bitly">Bit.ly access token api (used in search page)</label>
855
-				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" />
1097
+				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) {
1098
+	print $globalBitlyAccessToken;
1099
+}
1100
+?>" />
856 1101
 			</p>
857 1102
 			<br />
858 1103
 			<p>
@@ -868,11 +1113,26 @@  discard block
 block discarded – undo
868 1113
 			<p>
869 1114
 				<label for="geoid_source">Geoid Source</label>
870 1115
 				<select name="geoid_source" id="geoid_source">
871
-					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') print ' selected="selected"'; ?>>EGM96 15' (2.1MB)</option>
872
-					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') print ' selected="selected"'; ?>>EGM96 5' (19MB)</option>
873
-					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') print ' selected="selected"'; ?>>EGM2008 5' (19MB)</option>
874
-					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') print ' selected="selected"'; ?>>EGM2008 2.5' (75MB)</option>
875
-					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') print ' selected="selected"'; ?>>EGM2008 1' (470MB)</option>
1116
+					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') {
1117
+	print ' selected="selected"';
1118
+}
1119
+?>>EGM96 15' (2.1MB)</option>
1120
+					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') {
1121
+	print ' selected="selected"';
1122
+}
1123
+?>>EGM96 5' (19MB)</option>
1124
+					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') {
1125
+	print ' selected="selected"';
1126
+}
1127
+?>>EGM2008 5' (19MB)</option>
1128
+					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') {
1129
+	print ' selected="selected"';
1130
+}
1131
+?>>EGM2008 2.5' (75MB)</option>
1132
+					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') {
1133
+	print ' selected="selected"';
1134
+}
1135
+?>>EGM2008 1' (470MB)</option>
876 1136
 				</select>
877 1137
 				<p class="help-block">The geoid is approximated by an "earth gravity model" (EGM).</p>
878 1138
 			</p>
@@ -894,7 +1154,12 @@  discard block
 block discarded – undo
894 1154
 			</p>
895 1155
 			<p>
896 1156
 				<label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label>
897
-				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '1'; ?>" />
1157
+				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) {
1158
+	print $globalArchiveMonths;
1159
+} else {
1160
+	echo '1';
1161
+}
1162
+?>" />
898 1163
 				<p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p>
899 1164
 			</p>
900 1165
 			<p>
@@ -904,12 +1169,22 @@  discard block
 block discarded – undo
904 1169
 			</p>
905 1170
 			<p>
906 1171
 				<label for="archivekeepmonths">Keep flights data for xx months in archive</label>
907
-				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '1'; ?>" />
1172
+				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) {
1173
+	print $globalArchiveKeepMonths;
1174
+} else {
1175
+	echo '1';
1176
+}
1177
+?>" />
908 1178
 				<p class="help-block">0 to disable</p>
909 1179
 			</p>
910 1180
 			<p>
911 1181
 				<label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label>
912
-				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '1'; ?>" />
1182
+				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) {
1183
+	print $globalArchiveKeepTrackMonths;
1184
+} else {
1185
+	echo '1';
1186
+}
1187
+?>" />
913 1188
 				<p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p>
914 1189
 			</p>
915 1190
 			<br />
@@ -919,7 +1194,12 @@  discard block
 block discarded – undo
919 1194
 				<p class="help-block">Uncheck if the script is running as cron job</p>
920 1195
 				<div id="cronends"> 
921 1196
 					<label for="cronend">Run script for xx seconds</label>
922
-					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" />
1197
+					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) {
1198
+	print $globalCronEnd;
1199
+} else {
1200
+	print '0';
1201
+}
1202
+?>" />
923 1203
 					<p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p>
924 1204
 				</div>
925 1205
 			</p>
@@ -972,15 +1252,30 @@  discard block
 block discarded – undo
972 1252
 			<br />
973 1253
 			<p>
974 1254
 				<label for="refresh">Show flights detected since xxx seconds</label>
975
-				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" />
1255
+				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) {
1256
+	echo $globalLiveInterval;
1257
+} else {
1258
+	echo '200';
1259
+}
1260
+?>" />
976 1261
 			</p>
977 1262
 			<p>
978 1263
 				<label for="maprefresh">Live map refresh (in seconds)</label>
979
-				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" />
1264
+				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) {
1265
+	echo $globalMapRefresh;
1266
+} else {
1267
+	echo '30';
1268
+}
1269
+?>" />
980 1270
 			</p>
981 1271
 			<p>
982 1272
 				<label for="mapidle">Map idle timeout (in minutes)</label>
983
-				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" />
1273
+				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) {
1274
+	echo $globalMapIdleTimeout;
1275
+} else {
1276
+	echo '30';
1277
+}
1278
+?>" />
984 1279
 				<p class="help-block">0 to disable</p>
985 1280
 			</p>
986 1281
 			<p>
@@ -995,12 +1290,20 @@  discard block
 block discarded – undo
995 1290
 			<br />
996 1291
 			<p>
997 1292
 				<label for="closestmindist">Distance to airport set as arrival (in km)</label>
998
-				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" />
1293
+				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) {
1294
+	echo $globalClosestMinDist;
1295
+} else {
1296
+	echo '50';
1297
+}
1298
+?>" />
999 1299
 			</p>
1000 1300
 			<br />
1001 1301
 			<p>
1002 1302
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
1003
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
1303
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) {
1304
+	echo $globalAircraftSize;
1305
+}
1306
+?>" />
1004 1307
 			</p>
1005 1308
 			<br />
1006 1309
 			<p>
@@ -1019,7 +1322,12 @@  discard block
 block discarded – undo
1019 1322
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
1020 1323
 			?>
1021 1324
 				<label for="aircrafticoncolor">Color of aircraft icon on map</label>
1022
-				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />
1325
+				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) {
1326
+	echo $globalAircraftIconColor;
1327
+} else {
1328
+	echo '1a3151';
1329
+}
1330
+?>" />
1023 1331
 			<?php
1024 1332
 				if (!is_writable('../cache')) {
1025 1333
 			?>
@@ -1037,14 +1345,27 @@  discard block
 block discarded – undo
1037 1345
 			<p>
1038 1346
 				<label for="airportzoom">Zoom level minimum to see airports icons</label>
1039 1347
 				<div class="range">
1040
-					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" />
1041
-					<output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output>
1348
+					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) {
1349
+	echo $globalAirportZoom;
1350
+} else {
1351
+	echo '7';
1352
+}
1353
+?>" />
1354
+					<output id="range"><?php if (isset($globalAirportZoom)) {
1355
+	echo $globalAirportZoom;
1356
+} else {
1357
+	echo '7';
1358
+}
1359
+?></output>
1042 1360
 				</div>
1043 1361
 			</p>
1044 1362
 			<br />
1045 1363
 			<p>
1046 1364
 				<label for="customcss">Custom CSS web path</label>
1047
-				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) echo $globalCustomCSS; ?>" />
1365
+				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) {
1366
+	echo $globalCustomCSS;
1367
+}
1368
+?>" />
1048 1369
 			</p>
1049 1370
 		</fieldset>
1050 1371
 		<input type="submit" name="submit" value="Create/Update database & write setup" />
@@ -1071,8 +1392,12 @@  discard block
 block discarded – undo
1071 1392
 	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
1072 1393
 	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
1073 1394
 
1074
-	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
1075
-	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
1395
+	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) {
1396
+		$error .= 'Mysql driver for PDO must be loaded';
1397
+	}
1398
+	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) {
1399
+		$error .= 'PosgreSQL driver for PDO must be loaded';
1400
+	}
1076 1401
 	
1077 1402
 	$_SESSION['database_root'] = $dbroot;
1078 1403
 	$_SESSION['database_rootpass'] = $dbrootpass;
@@ -1140,15 +1465,23 @@  discard block
 block discarded – undo
1140 1465
 	$source_city = $_POST['source_city'];
1141 1466
 	$source_country = $_POST['source_country'];
1142 1467
 	$source_ref = $_POST['source_ref'];
1143
-	if (isset($source_id)) $source_id = $_POST['source_id'];
1144
-	else $source_id = array();
1468
+	if (isset($source_id)) {
1469
+		$source_id = $_POST['source_id'];
1470
+	} else {
1471
+		$source_id = array();
1472
+	}
1145 1473
 	
1146 1474
 	$sources = array();
1147 1475
 	foreach ($source_name as $keys => $name) {
1148
-	    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]);
1149
-	    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]);
1476
+	    if (isset($source_id[$keys])) {
1477
+	    	$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]);
1478
+	    } else {
1479
+	    	$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]);
1480
+	    }
1481
+	}
1482
+	if (count($sources) > 0) {
1483
+		$_SESSION['sources'] = $sources;
1150 1484
 	}
1151
-	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1152 1485
 
1153 1486
 	$newsurl = $_POST['newsurl'];
1154 1487
 	$newslng = $_POST['newslang'];
@@ -1161,7 +1494,9 @@  discard block
 block discarded – undo
1161 1494
 		$lng = $newslng[$newskey];
1162 1495
 		if (isset($newsfeeds[$type][$lng])) {
1163 1496
 		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1164
-		} else $newsfeeds[$type][$lng] = array($url);
1497
+		} else {
1498
+			$newsfeeds[$type][$lng] = array($url);
1499
+		}
1165 1500
 	    }
1166 1501
 	}
1167 1502
 	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds));
@@ -1185,17 +1520,29 @@  discard block
 block discarded – undo
1185 1520
 	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1186 1521
 
1187 1522
 	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1188
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1189
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1523
+	if ($globalaircraft == 'aircraft') {
1524
+		$settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1525
+	} else {
1526
+		$settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1527
+	}
1190 1528
 	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1191
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1192
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1529
+	if ($globaltracker == 'tracker') {
1530
+		$settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1531
+	} else {
1532
+		$settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1533
+	}
1193 1534
 	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1194
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1195
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1535
+	if ($globalmarine == 'marine') {
1536
+		$settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1537
+	} else {
1538
+		$settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1539
+	}
1196 1540
 	$globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING);
1197
-	if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1198
-	else $settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1541
+	if ($globalsatellite == 'satellite') {
1542
+		$settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1543
+	} else {
1544
+		$settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1545
+	}
1199 1546
 
1200 1547
 /*	
1201 1548
 	$globalSBS1Hosts = array();
@@ -1217,23 +1564,37 @@  discard block
 block discarded – undo
1217 1564
 	$name = $_POST['name'];
1218 1565
 	$format = $_POST['format'];
1219 1566
 	$timezones = $_POST['timezones'];
1220
-	if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats'];
1221
-	else $sourcestats = array();
1222
-	if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive'];
1223
-	else $noarchive = array();
1567
+	if (isset($_POST['sourcestats'])) {
1568
+		$sourcestats = $_POST['sourcestats'];
1569
+	} else {
1570
+		$sourcestats = array();
1571
+	}
1572
+	if (isset($_POST['noarchive'])) {
1573
+		$noarchive = $_POST['noarchive'];
1574
+	} else {
1575
+		$noarchive = array();
1576
+	}
1224 1577
 	$gSources = array();
1225 1578
 	$forcepilots = false;
1226 1579
 	foreach ($host as $key => $h) {
1227
-		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE';
1228
-		else $cov = 'FALSE';
1229
-		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1230
-		else $arch = 'FALSE';
1580
+		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) {
1581
+			$cov = 'TRUE';
1582
+		} else {
1583
+			$cov = 'FALSE';
1584
+		}
1585
+		if (isset($noarchive[$key]) && $noarchive[$key] == 1) {
1586
+			$arch = 'TRUE';
1587
+		} else {
1588
+			$arch = 'FALSE';
1589
+		}
1231 1590
 		if (strpos($format[$key],'_callback')) {
1232 1591
 			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE');
1233 1592
 		} elseif ($h != '' || $name[$key] != '') {
1234 1593
 			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE');
1235 1594
 		}
1236
-		if ($format[$key] == 'airwhere') $forcepilots = true;
1595
+		if ($format[$key] == 'airwhere') {
1596
+			$forcepilots = true;
1597
+		}
1237 1598
 	}
1238 1599
 	$settings = array_merge($settings,array('globalSources' => $gSources));
1239 1600
 
@@ -1264,7 +1625,9 @@  discard block
 block discarded – undo
1264 1625
 	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1265 1626
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1266 1627
 		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1267
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1628
+	} else {
1629
+		$settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1630
+	}
1268 1631
 
1269 1632
 	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1270 1633
 	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
@@ -1303,7 +1666,9 @@  discard block
 block discarded – undo
1303 1666
 
1304 1667
 	// Create in settings.php keys not yet configurable if not already here
1305 1668
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1306
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1669
+	if (!isset($globalDebug)) {
1670
+		$settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1671
+	}
1307 1672
 
1308 1673
 	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1309 1674
 	if ($resetyearstats == 'resetyearstats') {
@@ -1346,37 +1711,56 @@  discard block
 block discarded – undo
1346 1711
 	}
1347 1712
 */
1348 1713
 	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1349
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1350
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1351
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1352
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1714
+	if ($globalsbs == 'sbs') {
1715
+		$settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1716
+	} else {
1717
+		$settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1718
+	}
1719
+	if ($globalaprs == 'aprs') {
1720
+		$settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1721
+	} else {
1722
+		$settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1723
+	}
1353 1724
 	$va = false;
1354 1725
 	if ($globalivao == 'ivao') {
1355 1726
 		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1356 1727
 		$va = true;
1357
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1728
+	} else {
1729
+		$settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1730
+	}
1358 1731
 	if ($globalvatsim == 'vatsim') {
1359 1732
 		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1360 1733
 		$va = true;
1361
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1734
+	} else {
1735
+		$settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1736
+	}
1362 1737
 	if ($globalphpvms == 'phpvms') {
1363 1738
 		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1364 1739
 		$va = true;
1365
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1740
+	} else {
1741
+		$settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1742
+	}
1366 1743
 	if ($globalvam == 'vam') {
1367 1744
 		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1368 1745
 		$va = true;
1369
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1746
+	} else {
1747
+		$settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1748
+	}
1370 1749
 	if ($va) {
1371 1750
 		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1372
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1751
+	} else {
1752
+		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1753
+	}
1373 1754
 	if ($globalva == 'va' || $va) {
1374 1755
 		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1375 1756
 		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1376 1757
 	} else {
1377 1758
 		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1378
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1379
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1759
+		if ($forcepilots) {
1760
+			$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1761
+		} else {
1762
+			$settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1763
+		}
1380 1764
 	}
1381 1765
 	
1382 1766
 	
@@ -1577,7 +1961,9 @@  discard block
 block discarded – undo
1577 1961
 		$settings = array_merge($settings,array('globalTSK' => 'FALSE'));
1578 1962
 	}
1579 1963
 
1580
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1964
+	if (!isset($globalTransaction)) {
1965
+		$settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1966
+	}
1581 1967
 
1582 1968
 	// Set some defaults values...
1583 1969
 	if (!isset($globalAircraftImageSources)) {
@@ -1592,15 +1978,23 @@  discard block
 block discarded – undo
1592 1978
 
1593 1979
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1594 1980
 
1595
-	if ($error == '') settings::modify_settings($settings);
1596
-	if ($error == '') settings::comment_settings($settings_comment);
1981
+	if ($error == '') {
1982
+		settings::modify_settings($settings);
1983
+	}
1984
+	if ($error == '') {
1985
+		settings::comment_settings($settings_comment);
1986
+	}
1597 1987
 	if ($error != '') {
1598 1988
 		print '<div class="info column">'.$error.'</div>';
1599 1989
 		require('../footer.php');
1600 1990
 		exit;
1601 1991
 	} else {
1602
-		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1;
1603
-		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1;
1992
+		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') {
1993
+			$_SESSION['waypoints'] = 1;
1994
+		}
1995
+		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') {
1996
+			$_SESSION['owner'] = 1;
1997
+		}
1604 1998
 		if (isset($_POST['createdb'])) {
1605 1999
 			$_SESSION['install'] = 'database_create';
1606 2000
 		} else {
@@ -1637,10 +2031,18 @@  discard block
 block discarded – undo
1637 2031
 	$popw = false;
1638 2032
 	foreach ($_SESSION['done'] as $done) {
1639 2033
 	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1640
-	    if ($done == 'Create database') $pop = true;
1641
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1642
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1643
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
2034
+	    if ($done == 'Create database') {
2035
+	    	$pop = true;
2036
+	    }
2037
+	    if ($_SESSION['install'] == 'database_create') {
2038
+	    	$pop = true;
2039
+	    }
2040
+	    if ($_SESSION['install'] == 'database_import') {
2041
+	    	$popi = true;
2042
+	    }
2043
+	    if ($_SESSION['install'] == 'waypoints') {
2044
+	    	$popw = true;
2045
+	    }
1644 2046
 	}
1645 2047
 	if ($pop) {
1646 2048
 	    sleep(5);
@@ -1651,7 +2053,9 @@  discard block
 block discarded – undo
1651 2053
 	} else if ($popw) {
1652 2054
 	    sleep(5);
1653 2055
 	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1654
-	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
2056
+	} else {
2057
+		print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
2058
+	}
1655 2059
 	print '</div></ul>';
1656 2060
 	print '<div id="error"></div>';
1657 2061
 /*	foreach ($_SESSION['done'] as $done) {
Please login to merge, or discard this patch.
news.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,18 +14,18 @@  discard block
 block discarded – undo
14 14
 else $type = 'global';
15 15
 
16 16
 //calculuation for the pagination
17
-if(!isset($_GET['limit']))
17
+if (!isset($_GET['limit']))
18 18
 {
19 19
   $limit_start = 0;
20 20
   $limit_end = 25;
21 21
   $absolute_difference = 25;
22
-}  else {
22
+} else {
23 23
 	$limit_explode = explode(",", $_GET['limit']);
24 24
 	$limit_start = $limit_explode[0];
25 25
 	$limit_end = $limit_explode[1];
26 26
 }
27 27
 
28
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
28
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
29 29
 
30 30
 $absolute_difference = abs($limit_start - $limit_end);
31 31
 $limit_next = $limit_end + $absolute_difference;
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 if (!empty($anews))
60 60
 {
61 61
 	$j = 0;
62
-	foreach($anews as $news) {
62
+	foreach ($anews as $news) {
63 63
 		if ($j > 10) break;
64 64
 		$j++;
65 65
 		print '<div class="news">';
Please login to merge, or discard this patch.
Braces   +21 added lines, -10 removed lines patch added patch discarded remove patch
@@ -7,11 +7,17 @@  discard block
 block discarded – undo
7 7
 $title = _("News");
8 8
 require_once('header.php');
9 9
 
10
-if (isset($_GET['tracker'])) $type = 'tracker';
11
-elseif (isset($_GET['marine'])) $type = 'marine';
12
-elseif (isset($_GET['aircraft'])) $type = 'aircraft';
13
-elseif (isset($_GET['satellite'])) $type = 'satellite';
14
-else $type = 'global';
10
+if (isset($_GET['tracker'])) {
11
+	$type = 'tracker';
12
+} elseif (isset($_GET['marine'])) {
13
+	$type = 'marine';
14
+} elseif (isset($_GET['aircraft'])) {
15
+	$type = 'aircraft';
16
+} elseif (isset($_GET['satellite'])) {
17
+	$type = 'satellite';
18
+} else {
19
+	$type = 'global';
20
+}
15 21
 
16 22
 //calculuation for the pagination
17 23
 if(!isset($_GET['limit']))
@@ -19,7 +25,7 @@  discard block
 block discarded – undo
19 25
   $limit_start = 0;
20 26
   $limit_end = 25;
21 27
   $absolute_difference = 25;
22
-}  else {
28
+} else {
23 29
 	$limit_explode = explode(",", $_GET['limit']);
24 30
 	$limit_start = $limit_explode[0];
25 31
 	$limit_end = $limit_explode[1];
@@ -46,9 +52,12 @@  discard block
 block discarded – undo
46 52
 	$feeds = $globalNewsFeeds[$type];
47 53
 } else {
48 54
 	$lg = $lang[1];
49
-	if (isset($globalNewsFeeds[$type][$lg])) $feeds = $globalNewsFeeds[$type][$lg];
50
-	else $feeds = array_shift($globalNewsFeeds[$type]);
51
-}
55
+	if (isset($globalNewsFeeds[$type][$lg])) {
56
+		$feeds = $globalNewsFeeds[$type][$lg];
57
+	} else {
58
+		$feeds = array_shift($globalNewsFeeds[$type]);
59
+	}
60
+	}
52 61
 
53 62
 $SimplePie->set_feed_url($feeds);
54 63
 $SimplePie->set_cache_duration(3600);
@@ -60,7 +69,9 @@  discard block
 block discarded – undo
60 69
 {
61 70
 	$j = 0;
62 71
 	foreach($anews as $news) {
63
-		if ($j > 10) break;
72
+		if ($j > 10) {
73
+			break;
74
+		}
64 75
 		$j++;
65 76
 		print '<div class="news">';
66 77
 		print '<h4><a href="'.$news->get_permalink().'">'.$news->get_title().'</a> <span>('.$news->get_date('j M Y, g:i a').')</span></h4>'."\n";
Please login to merge, or discard this patch.
owner-sub-menu.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 	</form>
8 8
 </div>
9 9
 <?php
10
-    if (isset($owner)) {
10
+	if (isset($owner)) {
11 11
 ?>
12 12
 <div class="sub-menu sub-menu-container">
13 13
 	<ul class="nav nav-pills">
@@ -38,5 +38,5 @@  discard block
 block discarded – undo
38 38
 	</ul>
39 39
 </div>
40 40
 <?php
41
-    }
41
+	}
42 42
 ?>
43 43
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
 ?>
12 12
 <div class="sub-menu sub-menu-container">
13 13
 	<ul class="nav nav-pills">
14
-		<li><a href="<?php print $globalURL; ?>/owner/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>" <?php if (strtolower($current_page) == "owner-detailed"){ print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li>
14
+		<li><a href="<?php print $globalURL; ?>/owner/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>" <?php if (strtolower($current_page) == "owner-detailed") { print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li>
15 15
 		<li class="dropdown">
16
-		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "owner-statistics-aircraft" || strtolower($current_page) == "owner-statistics-registration" || strtolower($current_page) == "owner-statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#">
16
+		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "owner-statistics-aircraft" || strtolower($current_page) == "owner-statistics-registration" || strtolower($current_page) == "owner-statistics-manufacturer") { print 'active'; } ?>" data-toggle="dropdown" href="#">
17 17
 		      <?php echo _("Aircraft"); ?> <span class="caret"></span>
18 18
 		    </a>
19 19
 		    <ul class="dropdown-menu" role="menu">
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 		    </ul>
24 24
 		</li>
25 25
 		<li class="dropdown">
26
-		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "owner-statistics-departure-airport" || strtolower($current_page) == "owner-statistics-departure-airport-country" || strtolower($current_page) == "owner-statistics-arrival-airport" || strtolower($current_page) == "owner-statistics-arrival-airport-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#">
26
+		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "owner-statistics-departure-airport" || strtolower($current_page) == "owner-statistics-departure-airport-country" || strtolower($current_page) == "owner-statistics-arrival-airport" || strtolower($current_page) == "owner-statistics-arrival-airport-country") { print 'active'; } ?>" data-toggle="dropdown" href="#">
27 27
 		      <?php echo _("Airport"); ?> <span class="caret"></span>
28 28
 		    </a>
29 29
 		    <ul class="dropdown-menu" role="menu">
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 			  <li><a href="<?php print $globalURL; ?>/owner/statistics/arrival-airport-country/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li>
34 34
 		    </ul>
35 35
 		</li>
36
-		<li><a href="<?php print $globalURL; ?>/owner/statistics/route/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>" <?php if (strtolower($current_page) == "owner-statistics-route"){ print 'class="active"'; } ?>><?php echo _("Route"); ?></a></li>
37
-		<li><a href="<?php print $globalURL; ?>/owner/statistics/time/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>" <?php if (strtolower($current_page) == "owner-statistics-time"){ print 'class="active"'; } ?>><?php echo _("Time"); ?></a></li>
36
+		<li><a href="<?php print $globalURL; ?>/owner/statistics/route/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>" <?php if (strtolower($current_page) == "owner-statistics-route") { print 'class="active"'; } ?>><?php echo _("Route"); ?></a></li>
37
+		<li><a href="<?php print $globalURL; ?>/owner/statistics/time/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>" <?php if (strtolower($current_page) == "owner-statistics-time") { print 'class="active"'; } ?>><?php echo _("Time"); ?></a></li>
38 38
 	</ul>
39 39
 </div>
40 40
 <?php
Please login to merge, or discard this patch.
Braces   +77 added lines, -11 removed lines patch added patch discarded remove patch
@@ -3,7 +3,13 @@  discard block
 block discarded – undo
3 3
 </span>
4 4
 <div class="stats_airline">
5 5
 	<form id="changedate" method="post">
6
-		<input type="month" name="date" onchange="statsdatechange(this);" value="<?php if (isset($year) && $year != '') echo $year.'-'; ?><?php if (isset($month) && $month != '') echo $month; ?>" />
6
+		<input type="month" name="date" onchange="statsdatechange(this);" value="<?php if (isset($year) && $year != '') {
7
+	echo $year.'-';
8
+}
9
+?><?php if (isset($month) && $month != '') {
10
+	echo $month;
11
+}
12
+?>" />
7 13
 	</form>
8 14
 </div>
9 15
 <?php
@@ -11,15 +17,39 @@  discard block
 block discarded – undo
11 17
 ?>
12 18
 <div class="sub-menu sub-menu-container">
13 19
 	<ul class="nav nav-pills">
14
-		<li><a href="<?php print $globalURL; ?>/owner/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>" <?php if (strtolower($current_page) == "owner-detailed"){ print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li>
20
+		<li><a href="<?php print $globalURL; ?>/owner/<?php print $owner; ?><?php if (isset($year) && $year != '') {
21
+	echo '/'.$year;
22
+}
23
+?><?php if (isset($month) && $month != '') {
24
+	echo '/'.$month;
25
+}
26
+?>" <?php if (strtolower($current_page) == "owner-detailed"){ print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li>
15 27
 		<li class="dropdown">
16 28
 		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "owner-statistics-aircraft" || strtolower($current_page) == "owner-statistics-registration" || strtolower($current_page) == "owner-statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#">
17 29
 		      <?php echo _("Aircraft"); ?> <span class="caret"></span>
18 30
 		    </a>
19 31
 		    <ul class="dropdown-menu" role="menu">
20
-		      <li><a href="<?php print $globalURL; ?>/owner/statistics/aircraft/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>"><?php echo _("Aircraft Type"); ?></a></li>
21
-					<li><a href="<?php print $globalURL; ?>/owner/statistics/registration/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>"><?php echo _("Registration"); ?></a></li>
22
-					<li><a href="<?php print $globalURL; ?>/owner/statistics/manufacturer/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>"><?php echo _("Manufacturer"); ?></a></li>
32
+		      <li><a href="<?php print $globalURL; ?>/owner/statistics/aircraft/<?php print $owner; ?><?php if (isset($year) && $year != '') {
33
+	echo '/'.$year;
34
+}
35
+?><?php if (isset($month) && $month != '') {
36
+	echo '/'.$month;
37
+}
38
+?>"><?php echo _("Aircraft Type"); ?></a></li>
39
+					<li><a href="<?php print $globalURL; ?>/owner/statistics/registration/<?php print $owner; ?><?php if (isset($year) && $year != '') {
40
+	echo '/'.$year;
41
+}
42
+?><?php if (isset($month) && $month != '') {
43
+	echo '/'.$month;
44
+}
45
+?>"><?php echo _("Registration"); ?></a></li>
46
+					<li><a href="<?php print $globalURL; ?>/owner/statistics/manufacturer/<?php print $owner; ?><?php if (isset($year) && $year != '') {
47
+	echo '/'.$year;
48
+}
49
+?><?php if (isset($month) && $month != '') {
50
+	echo '/'.$month;
51
+}
52
+?>"><?php echo _("Manufacturer"); ?></a></li>
23 53
 		    </ul>
24 54
 		</li>
25 55
 		<li class="dropdown">
@@ -27,14 +57,50 @@  discard block
 block discarded – undo
27 57
 		      <?php echo _("Airport"); ?> <span class="caret"></span>
28 58
 		    </a>
29 59
 		    <ul class="dropdown-menu" role="menu">
30
-		      <li><a href="<?php print $globalURL; ?>/owner/statistics/departure-airport/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>"><?php echo _("Departure Airport"); ?></a></li>
31
-		      <li><a href="<?php print $globalURL; ?>/owner/statistics/departure-airport-country/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>"><?php echo _("Departure Airport by Country"); ?></a></li>
32
-			  <li><a href="<?php print $globalURL; ?>/owner/statistics/arrival-airport/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>"><?php echo _("Arrival Airport"); ?></a></li>
33
-			  <li><a href="<?php print $globalURL; ?>/owner/statistics/arrival-airport-country/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li>
60
+		      <li><a href="<?php print $globalURL; ?>/owner/statistics/departure-airport/<?php print $owner; ?><?php if (isset($year) && $year != '') {
61
+	echo '/'.$year;
62
+}
63
+?><?php if (isset($month) && $month != '') {
64
+	echo '/'.$month;
65
+}
66
+?>"><?php echo _("Departure Airport"); ?></a></li>
67
+		      <li><a href="<?php print $globalURL; ?>/owner/statistics/departure-airport-country/<?php print $owner; ?><?php if (isset($year) && $year != '') {
68
+	echo '/'.$year;
69
+}
70
+?><?php if (isset($month) && $month != '') {
71
+	echo '/'.$month;
72
+}
73
+?>"><?php echo _("Departure Airport by Country"); ?></a></li>
74
+			  <li><a href="<?php print $globalURL; ?>/owner/statistics/arrival-airport/<?php print $owner; ?><?php if (isset($year) && $year != '') {
75
+	echo '/'.$year;
76
+}
77
+?><?php if (isset($month) && $month != '') {
78
+	echo '/'.$month;
79
+}
80
+?>"><?php echo _("Arrival Airport"); ?></a></li>
81
+			  <li><a href="<?php print $globalURL; ?>/owner/statistics/arrival-airport-country/<?php print $owner; ?><?php if (isset($year) && $year != '') {
82
+	echo '/'.$year;
83
+}
84
+?><?php if (isset($month) && $month != '') {
85
+	echo '/'.$month;
86
+}
87
+?>"><?php echo _("Arrival Airport by Country"); ?></a></li>
34 88
 		    </ul>
35 89
 		</li>
36
-		<li><a href="<?php print $globalURL; ?>/owner/statistics/route/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>" <?php if (strtolower($current_page) == "owner-statistics-route"){ print 'class="active"'; } ?>><?php echo _("Route"); ?></a></li>
37
-		<li><a href="<?php print $globalURL; ?>/owner/statistics/time/<?php print $owner; ?><?php if (isset($year) && $year != '') echo '/'.$year; ?><?php if (isset($month) && $month != '') echo '/'.$month; ?>" <?php if (strtolower($current_page) == "owner-statistics-time"){ print 'class="active"'; } ?>><?php echo _("Time"); ?></a></li>
90
+		<li><a href="<?php print $globalURL; ?>/owner/statistics/route/<?php print $owner; ?><?php if (isset($year) && $year != '') {
91
+	echo '/'.$year;
92
+}
93
+?><?php if (isset($month) && $month != '') {
94
+	echo '/'.$month;
95
+}
96
+?>" <?php if (strtolower($current_page) == "owner-statistics-route"){ print 'class="active"'; } ?>><?php echo _("Route"); ?></a></li>
97
+		<li><a href="<?php print $globalURL; ?>/owner/statistics/time/<?php print $owner; ?><?php if (isset($year) && $year != '') {
98
+	echo '/'.$year;
99
+}
100
+?><?php if (isset($month) && $month != '') {
101
+	echo '/'.$month;
102
+}
103
+?>" <?php if (strtolower($current_page) == "owner-statistics-time"){ print 'class="active"'; } ?>><?php echo _("Time"); ?></a></li>
38 104
 	</ul>
39 105
 </div>
40 106
 <?php
Please login to merge, or discard this patch.
manufacturer-detailed.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -4,16 +4,16 @@  discard block
 block discarded – undo
4 4
 require_once('require/class.Stats.php');
5 5
 require_once('require/class.Language.php');
6 6
 $Spotter = new Spotter();
7
-if (!isset($_GET['aircraft_manufacturer'])){
7
+if (!isset($_GET['aircraft_manufacturer'])) {
8 8
 	header('Location: '.$globalURL.'');
9 9
 } else {
10 10
 	//calculuation for the pagination
11
-	if(!isset($_GET['limit']))
11
+	if (!isset($_GET['limit']))
12 12
 	{
13 13
 		$limit_start = 0;
14 14
 		$limit_end = 25;
15 15
 		$absolute_difference = 25;
16
-	}  else {
16
+	} else {
17 17
 		$limit_explode = explode(",", $_GET['limit']);
18 18
 		if (isset($limit_explode[1])) {
19 19
 			$limit_start = $limit_explode[0];
@@ -32,19 +32,19 @@  discard block
 block discarded – undo
32 32
 	$limit_previous_1 = $limit_start - $absolute_difference;
33 33
 	$limit_previous_2 = $limit_end - $absolute_difference;
34 34
 	
35
-	$manufacturer = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))));
36
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
35
+	$manufacturer = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING))));
36
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
37 37
 	$page_url = $globalURL.'/manufacturer/'.$manufacturer;
38 38
 	
39 39
 	if ($sort != '') {
40
-		$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,$limit_start.",".$absolute_difference, $sort);
40
+		$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, $limit_start.",".$absolute_difference, $sort);
41 41
 	} else {
42
-		$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,$limit_start.",".$absolute_difference, '');
42
+		$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, $limit_start.",".$absolute_difference, '');
43 43
 	}
44 44
 	
45 45
 	if (!empty($spotter_array))
46 46
 	{
47
-		$title = sprintf(_("Detailed View for %s"),$manufacturer);
47
+		$title = sprintf(_("Detailed View for %s"), $manufacturer);
48 48
 
49 49
 		require_once('header.php');
50 50
 		print '<div class="select-item">';
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 		$Stats = new Stats();
54 54
 		$all_manufacturers = $Stats->getAllManufacturers();
55 55
 		if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers();
56
-		foreach($all_manufacturers as $all_manufacturer)
56
+		foreach ($all_manufacturers as $all_manufacturer)
57 57
 		{
58
-			if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
58
+			if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
59 59
 			{
60 60
 				print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>';
61 61
 			} else {
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 		print '</div>';
73 73
 
74 74
 		print '<div class="table column">';
75
-		print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s</strong>."),$manufacturer).'</p>';
75
+		print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s</strong>."), $manufacturer).'</p>';
76 76
 
77 77
 		include('manufacturer-sub-menu.php');
78 78
 		include('table-output.php'); 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 		$limit_start = 0;
14 14
 		$limit_end = 25;
15 15
 		$absolute_difference = 25;
16
-	}  else {
16
+	} else {
17 17
 		$limit_explode = explode(",", $_GET['limit']);
18 18
 		if (isset($limit_explode[1])) {
19 19
 			$limit_start = $limit_explode[0];
@@ -52,7 +52,9 @@  discard block
 block discarded – undo
52 52
 		print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">';
53 53
 		$Stats = new Stats();
54 54
 		$all_manufacturers = $Stats->getAllManufacturers();
55
-		if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers();
55
+		if (empty($all_manufacturers)) {
56
+			$all_manufacturers = $Spotter->getAllManufacturers();
57
+		}
56 58
 		foreach($all_manufacturers as $all_manufacturer)
57 59
 		{
58 60
 			if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
Please login to merge, or discard this patch.
tsk-geojson.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 		$id = $spotter_item['Waypoint']['@attributes']['id'];
24 24
 		if ($id == 0 || !is_numeric($id)) $id = $j;
25 25
 		$output .= '{"type": "Feature",';
26
-		    $output .= '"id": '.$id.',';
27
-		    $output .= '"properties": {';
26
+			$output .= '"id": '.$id.',';
27
+			$output .= '"properties": {';
28 28
 			$output .= '"type": "'.$spotter_item['@attributes']['type'].'",';
29 29
 			//$output .= '"id": "'.$spotter_item['Waypoint']['@attributes']['id'].'",';
30 30
 			$output .= '"name": "'.$spotter_item['Waypoint']['@attributes']['name'].'",';
@@ -35,31 +35,31 @@  discard block
 block discarded – undo
35 35
 			} elseif ($spotter_item['@attributes']['type'] == 'Finish') {
36 36
 				$output .= '"icon": "/images/tsk/tsk-finish.png"';
37 37
 			} else $output .= '"icon": "/images/tsk/number_'.$id.'.png"';
38
-		    $output .= '},';
39
-		    $output .= '"geometry": {';
38
+			$output .= '},';
39
+			$output .= '"geometry": {';
40 40
 			$output .= '"type": "Point",';
41 41
 			$output .= '"coordinates": [';
42
-			    $output .= $spotter_item['Waypoint']['Location']['@attributes']['longitude'].', '.$spotter_item['Waypoint']['Location']['@attributes']['latitude'];
42
+				$output .= $spotter_item['Waypoint']['Location']['@attributes']['longitude'].', '.$spotter_item['Waypoint']['Location']['@attributes']['latitude'];
43 43
 			$output .= ']';
44
-		    $output .= '}';
44
+			$output .= '}';
45 45
 		$output .= '},';
46 46
 		$j++;
47 47
 	}
48 48
 	// Lines
49 49
 	$output .= '{"type": "Feature",';
50
-	    $output .= '"properties": {';
50
+		$output .= '"properties": {';
51 51
 		$output .= '"type": "'.$spotter_array['@attributes']['type'].'"';
52
-	    $output .= '},';
53
-	    $output .= '"geometry": {';
52
+		$output .= '},';
53
+		$output .= '"geometry": {';
54 54
 		$output .= '"type": "LineString",';
55 55
 		$output .= '"coordinates": [';
56 56
 	foreach($spotter_array['Point'] as $spotter_item)
57 57
 	{
58
-			    $output .= '['.$spotter_item['Waypoint']['Location']['@attributes']['longitude'].', '.$spotter_item['Waypoint']['Location']['@attributes']['latitude'].'],';
58
+				$output .= '['.$spotter_item['Waypoint']['Location']['@attributes']['longitude'].', '.$spotter_item['Waypoint']['Location']['@attributes']['latitude'].'],';
59 59
 	}
60 60
 	$output  = substr($output, 0, -1);
61 61
 		$output .= ']';
62
-	    $output .= '}';
62
+		$output .= '}';
63 63
 	$output .= '},';
64 64
 	$output  = substr($output, 0, -1);
65 65
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 }
9 9
 header('Content-Type: text/javascript');
10 10
 
11
-$tskfile = filter_input(INPUT_GET,'tsk',FILTER_SANITIZE_URL);
11
+$tskfile = filter_input(INPUT_GET, 'tsk', FILTER_SANITIZE_URL);
12 12
 
13 13
 $spotter_array = $TSK->parse_xml($tskfile);
14 14
 
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 if (!empty($spotter_array))
17 17
 {	  
18 18
 	$j = 0;
19
-	foreach($spotter_array['Point'] as $spotter_item)
19
+	foreach ($spotter_array['Point'] as $spotter_item)
20 20
 	{
21 21
 		date_default_timezone_set('UTC');
22 22
 		//waypoint plotting
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	    $output .= '"geometry": {';
54 54
 		$output .= '"type": "LineString",';
55 55
 		$output .= '"coordinates": [';
56
-	foreach($spotter_array['Point'] as $spotter_item)
56
+	foreach ($spotter_array['Point'] as $spotter_item)
57 57
 	{
58 58
 			    $output .= '['.$spotter_item['Waypoint']['Location']['@attributes']['longitude'].', '.$spotter_item['Waypoint']['Location']['@attributes']['latitude'].'],';
59 59
 	}
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,9 @@  discard block
 block discarded – undo
21 21
 		date_default_timezone_set('UTC');
22 22
 		//waypoint plotting
23 23
 		$id = $spotter_item['Waypoint']['@attributes']['id'];
24
-		if ($id == 0 || !is_numeric($id)) $id = $j;
24
+		if ($id == 0 || !is_numeric($id)) {
25
+			$id = $j;
26
+		}
25 27
 		$output .= '{"type": "Feature",';
26 28
 		    $output .= '"id": '.$id.',';
27 29
 		    $output .= '"properties": {';
@@ -34,7 +36,9 @@  discard block
 block discarded – undo
34 36
 				$output .= '"icon": "/images/tsk/tsk-start.png"';
35 37
 			} elseif ($spotter_item['@attributes']['type'] == 'Finish') {
36 38
 				$output .= '"icon": "/images/tsk/tsk-finish.png"';
37
-			} else $output .= '"icon": "/images/tsk/number_'.$id.'.png"';
39
+			} else {
40
+				$output .= '"icon": "/images/tsk/number_'.$id.'.png"';
41
+			}
38 42
 		    $output .= '},';
39 43
 		    $output .= '"geometry": {';
40 44
 			$output .= '"type": "Point",';
Please login to merge, or discard this patch.
header.php 3 patches
Braces   +81 added lines, -18 removed lines patch added patch discarded remove patch
@@ -6,10 +6,15 @@  discard block
 block discarded – undo
6 6
 //gets the page file and stores it in a variable
7 7
 $file_path = pathinfo($_SERVER['SCRIPT_NAME']);
8 8
 $current_page = $file_path['filename'];
9
-if ($globalTimezone == '') $globalTimezone = 'UTC';
9
+if ($globalTimezone == '') {
10
+	$globalTimezone = 'UTC';
11
+}
10 12
 date_default_timezone_set($globalTimezone);
11
-if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') $MapType = $_COOKIE['MapType'];
12
-else $MapType = $globalMapProvider;
13
+if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') {
14
+	$MapType = $_COOKIE['MapType'];
15
+} else {
16
+	$MapType = $globalMapProvider;
17
+}
13 18
 
14 19
 
15 20
 if (isset($_GET['3d'])) {
@@ -201,7 +206,10 @@  discard block
 block discarded – undo
201 206
 <?php
202 207
 //		}
203 208
 ?>
204
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?<?php print time(); ?><?php if (isset($tsk)) print '&tsk='.$tsk; ?>"></script>
209
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?<?php print time(); ?><?php if (isset($tsk)) {
210
+	print '&tsk='.$tsk;
211
+}
212
+?>"></script>
205 213
 <?php
206 214
 		if (!isset($globalAircraft) || $globalAircraft) {
207 215
 ?>
@@ -246,7 +254,13 @@  discard block
 block discarded – undo
246 254
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
247 255
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
248 256
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
249
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
257
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) {
258
+	print '&latitude='.$latitude;
259
+}
260
+?><?php if(isset($longitude)) {
261
+	print '&longitude='.$longitude;
262
+}
263
+?>&<?php print time(); ?>"></script>
250 264
 <?php
251 265
 		if (!isset($type) || $type == 'aircraft') {
252 266
 ?>
@@ -319,7 +333,13 @@  discard block
 block discarded – undo
319 333
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
320 334
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
321 335
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
322
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
336
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) {
337
+	print '&latitude='.$latitude;
338
+}
339
+?><?php if(isset($longitude)) {
340
+	print '&longitude='.$longitude;
341
+}
342
+?>&<?php print time(); ?>"></script>
323 343
 <script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?flightaware_id=<?php print $flightaware_id; ?>&<?php print time(); ?>"></script>
324 344
 <?php
325 345
 		if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) {
@@ -400,7 +420,12 @@  discard block
 block discarded – undo
400 420
         <span class="icon-bar"></span>
401 421
       </button>
402 422
       <a href="<?php print $globalURL; ?>/search" class="navbar-toggle navbar-toggle-search"><i class="fa fa-search"></i></a>
403
-      <a class="navbar-brand" href="<?php if ($globalURL == '') print '/'; else print $globalURL; ?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a>
423
+      <a class="navbar-brand" href="<?php if ($globalURL == '') {
424
+	print '/';
425
+} else {
426
+	print $globalURL;
427
+}
428
+?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a>
404 429
     </div>
405 430
     <div class="collapse navbar-collapse">
406 431
 
@@ -455,7 +480,10 @@  discard block
 block discarded – undo
455 480
 	}
456 481
 ?>
457 482
 
458
-          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
483
+          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
484
+	echo 'right-';
485
+}
486
+?>caret"></b></a>
459 487
           <ul class="dropdown-menu">
460 488
           	<li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircrafts Types"); ?></a></li>
461 489
 <?php
@@ -526,8 +554,14 @@  discard block
 block discarded – undo
526 554
         </li>
527 555
       	<li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li>
528 556
       	<li><a href="<?php print $globalURL; ?>/statistics"><?php echo _("Statistics"); ?></a></li>
529
-        <li class="dropdown<?php if ($sub) echo '-submenu'; ?>">
530
-          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
557
+        <li class="dropdown<?php if ($sub) {
558
+	echo '-submenu';
559
+}
560
+?>">
561
+          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) {
562
+	echo 'right-';
563
+}
564
+?>caret"></b></a>
531 565
           <ul class="dropdown-menu">
532 566
           	<li><a href="<?php print $globalURL; ?>/tools/acars"><?php echo _("ACARS translator"); ?></a></li>
533 567
           	<li><a href="<?php print $globalURL; ?>/tools/metar"><?php echo _("METAR translator"); ?></a></li>
@@ -571,7 +605,10 @@  discard block
 block discarded – undo
571 605
 <?php
572 606
 	}
573 607
 ?>
574
-		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
608
+		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
609
+	echo 'right-';
610
+}
611
+?>caret"></b></a>
575 612
 		<ul class="dropdown-menu">
576 613
 		    <li><a href="<?php print $globalURL; ?>/marine/currently"><?php echo _("Current Activity"); ?></a></li>
577 614
 		    <li><a href="<?php print $globalURL; ?>/marine/latest"><?php echo _("Latest Activity"); ?></a></li>
@@ -612,7 +649,10 @@  discard block
 block discarded – undo
612 649
 <?php
613 650
 	}
614 651
 ?>
615
-		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
652
+		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
653
+	echo 'right-';
654
+}
655
+?>caret"></b></a>
616 656
 		<ul class="dropdown-menu">
617 657
 		    <li><a href="<?php print $globalURL; ?>/tracker/currently"><?php echo _("Current Activity"); ?></a></li>
618 658
 		    <li><a href="<?php print $globalURL; ?>/tracker/latest"><?php echo _("Latest Activity"); ?></a></li>
@@ -655,7 +695,10 @@  discard block
 block discarded – undo
655 695
 ?>
656 696
 
657 697
 <!--
658
-		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
698
+		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
699
+	echo 'right-';
700
+}
701
+?>caret"></b></a>
659 702
 		<ul class="dropdown-menu">
660 703
 		    <li><a href="<?php print $globalURL; ?>/satellite/currently"><?php echo _("Current Activity"); ?></a></li>
661 704
 		    <li><a href="<?php print $globalURL; ?>/satellite/latest"><?php echo _("Latest Activity"); ?></a></li>
@@ -712,7 +755,9 @@  discard block
 block discarded – undo
712 755
   		        $alllang = $Language->getLanguages();
713 756
   		        foreach ($alllang as $key => $lang) {
714 757
   		            print '<option value="'.$key.'"';
715
-  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
758
+  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) {
759
+  		            	print ' selected ';
760
+  		            }
716 761
   		            print '>'.$lang[0].'</option>';
717 762
   		        }
718 763
   		    ?>
@@ -853,9 +898,24 @@  discard block
 block discarded – undo
853 898
 	$customid = $globalMapProvider;
854 899
 ?>
855 900
     L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', {
856
-        maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '18'; ?>,
857
-        minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>,
858
-        noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>,
901
+        maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) {
902
+	print $globalMapCustomLayer[$customid]['maxZoom'];
903
+} else {
904
+	print '18';
905
+}
906
+?>,
907
+        minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) {
908
+	print $globalMapCustomLayer[$customid]['minZoom'];
909
+} else {
910
+	print '0';
911
+}
912
+?>,
913
+        noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) {
914
+	print 'false';
915
+} else {
916
+	print 'true';
917
+}
918
+?>,
859 919
         attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
860 920
     }).addTo(map);
861 921
 <?php
@@ -878,4 +938,7 @@  discard block
 block discarded – undo
878 938
 
879 939
 ?>
880 940
 
881
-<section class="container main-content <?php if (strtolower($current_page) == 'index') print 'index '; ?>clear">
941
+<section class="container main-content <?php if (strtolower($current_page) == 'index') {
942
+	print 'index ';
943
+}
944
+?>clear">
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -13,35 +13,35 @@  discard block
 block discarded – undo
13 13
 
14 14
 
15 15
 if (isset($_GET['3d'])) {
16
-	setcookie('MapFormat','3d');
16
+	setcookie('MapFormat', '3d');
17 17
 } else if (isset($_GET['2d'])) {
18
-	setcookie('MapFormat','2d');
18
+	setcookie('MapFormat', '2d');
19 19
 }
20 20
 
21 21
 if (isset($globalTSK) && $globalTSK && isset($_GET['tsk'])) {
22
-	$tsk = filter_input(INPUT_GET,'tsk',FILTER_SANITIZE_URL);
22
+	$tsk = filter_input(INPUT_GET, 'tsk', FILTER_SANITIZE_URL);
23 23
 }
24 24
 
25 25
 if (isset($_POST['archive'])) {
26
-	setcookie('archive','true');
27
-	setcookie('archive_begin',strtotime($_POST['start_date']));
28
-	setcookie('archive_end',strtotime($_POST['end_date']));
29
-	setcookie('archive_speed',$_POST['archivespeed']);
26
+	setcookie('archive', 'true');
27
+	setcookie('archive_begin', strtotime($_POST['start_date']));
28
+	setcookie('archive_end', strtotime($_POST['end_date']));
29
+	setcookie('archive_speed', $_POST['archivespeed']);
30 30
 }
31 31
 if (isset($_POST['noarchive'])) {
32
-	setcookie('archive','false',-1);
33
-	setcookie('archive_begin','',-1);
34
-	setcookie('archive_end','',-1);
35
-	setcookie('archive_speed','',-1);
32
+	setcookie('archive', 'false', -1);
33
+	setcookie('archive_begin', '', -1);
34
+	setcookie('archive_end', '', -1);
35
+	setcookie('archive_speed', '', -1);
36 36
 }
37 37
 // When button "Remove all filters" is clicked
38 38
 if (isset($_POST['removefilters'])) {
39
-	$allfilters = array_filter(array_keys($_COOKIE),function($key) {
40
-	    return strpos($key,'filter_') === 0;
39
+	$allfilters = array_filter(array_keys($_COOKIE), function($key) {
40
+	    return strpos($key, 'filter_') === 0;
41 41
 	});
42 42
 	foreach ($allfilters as $filt) {
43 43
 		unset($_COOKIE[$filt]);
44
-		setcookie($filt,null,-1);
44
+		setcookie($filt, null, -1);
45 45
 	}
46 46
 }
47 47
 ?>
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
247 247
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
248 248
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
249
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
249
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if (isset($latitude)) print '&latitude='.$latitude; ?><?php if (isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
250 250
 <?php
251 251
 		if (!isset($type) || $type == 'aircraft') {
252 252
 ?>
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
320 320
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
321 321
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
322
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
322
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if (isset($latitude)) print '&latitude='.$latitude; ?><?php if (isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
323 323
 <script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?flightaware_id=<?php print $flightaware_id; ?>&<?php print time(); ?>"></script>
324 324
 <?php
325 325
 		if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) {
@@ -724,8 +724,8 @@  discard block
 block discarded – undo
724 724
 ?>
725 725
       <div class="search">
726 726
       <form action="<?php print $globalURL; ?>/search" method="get">
727
-		<!--<input type="text" name="q" value="<?php if (isset($GET['q'])) { if ($_GET['q'] != ""){ print $_GET['q']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button>-->
728
-		<input type="text" name="callsign" value="<?php if (isset($GET['callsign'])) { if ($_GET['callsign'] != ""){ print $_GET['callsign']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button>
727
+		<!--<input type="text" name="q" value="<?php if (isset($GET['q'])) { if ($_GET['q'] != "") { print $_GET['q']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button>-->
728
+		<input type="text" name="callsign" value="<?php if (isset($GET['callsign'])) { if ($_GET['callsign'] != "") { print $_GET['callsign']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button>
729 729
 	</form>
730 730
 	</div>
731 731
   	<div class="social">
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
 	print '</div>';
744 744
 }
745 745
 
746
-if (strtolower($current_page) =='ident-detailed' || strtolower($current_page) == 'flightid-overview') {
746
+if (strtolower($current_page) == 'ident-detailed' || strtolower($current_page) == 'flightid-overview') {
747 747
 ?>
748 748
     <div class="top-header clear" role="main">
749 749
 <?php
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
     </div>
757 757
 <?php
758 758
 }
759
-if ((strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) || (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false))
759
+if ((strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false) || (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false))
760 760
 {
761 761
     ?>
762 762
     <div class="top-header clear" role="main">
@@ -769,15 +769,15 @@  discard block
 block discarded – undo
769 769
         var zoom = 13;
770 770
 //create the map
771 771
 <?php
772
-    if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
772
+    if (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($airport_array[0]['latitude'])) {
773 773
 ?>
774 774
   map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom);
775 775
 <?php
776
-    } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
776
+    } elseif (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false) {
777 777
 ?>
778 778
   map = L.map('map', { zoomControl:true });
779 779
 <?php
780
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
780
+    } elseif (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
781 781
 ?>
782 782
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]);
783 783
     var line = L.polyline([[<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>],[<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>]]).addTo(map);
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
     var departure_airport = L.marker([<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/departure_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map);
786 786
     var arrival_airport = L.marker([<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/arrival_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map);
787 787
 <?php
788
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) {
788
+    } elseif (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) {
789 789
 ?>
790 790
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]);
791 791
 <?php
Please login to merge, or discard this patch.
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 // When button "Remove all filters" is clicked
38 38
 if (isset($_POST['removefilters'])) {
39 39
 	$allfilters = array_filter(array_keys($_COOKIE),function($key) {
40
-	    return strpos($key,'filter_') === 0;
40
+		return strpos($key,'filter_') === 0;
41 41
 	});
42 42
 	foreach ($allfilters as $filt) {
43 43
 		unset($_COOKIE[$filt]);
@@ -187,17 +187,17 @@  discard block
 block discarded – undo
187 187
 	}
188 188
 ?>
189 189
 <?php 
190
-    if (isset($_POST['archive'])) {
190
+	if (isset($_POST['archive'])) {
191 191
 ?>
192 192
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
193 193
 <?php 
194
-	    if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
194
+		if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
195 195
 ?>
196 196
 
197 197
 <script src="<?php print $globalURL; ?>/js/map.js.php?<?php print time(); ?>&archive&begindate=<?php print strtotime($_POST['start_date']); ?>&enddate=<?php print strtotime($_POST['end_date']); ?>&archivespeed=<?php print $_POST['archivespeed']; ?>"></script>
198 198
 <?php    
199
-	    }
200
-    } else {
199
+		}
200
+	} else {
201 201
 ?>
202 202
 <?php
203 203
 /*	if (isset($globalBeta) && $globalBeta) {
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 */
210 210
 ?>
211 211
 <?php 
212
-	    if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
212
+		if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
213 213
 ?>
214 214
 <?php
215 215
 //		if (isset($globalBeta) && $globalBeta) {
@@ -240,13 +240,13 @@  discard block
 block discarded – undo
240 240
 <script src="<?php print $globalURL; ?>/js/map-satellite.2d.js.php?<?php print time(); ?>"></script>
241 241
 <?php
242 242
 		}
243
-	    }
243
+		}
244 244
 ?>
245 245
 <?php
246 246
 //	}
247 247
 ?>
248 248
 <?php
249
-    }
249
+	}
250 250
 }
251 251
 ?>
252 252
 <?php
@@ -423,34 +423,34 @@  discard block
 block discarded – undo
423 423
 
424 424
       <ul class="nav navbar-nav">
425 425
 <?php
426
-    if (isset($globalNewsFeeds['global']) && !empty($globalNewsFeeds['global'])) {
426
+	if (isset($globalNewsFeeds['global']) && !empty($globalNewsFeeds['global'])) {
427 427
 ?>
428 428
     <li><a href="<?php print $globalURL; ?>/news"><?php echo _("News"); ?></a></li>
429 429
 <?php
430
-    }
430
+	}
431 431
 ?>
432 432
 
433 433
 <?php 
434
-    $sub = false;
435
-    if (
434
+	$sub = false;
435
+	if (
436 436
 	(
437
-	    (!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
437
+		(!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
438 438
 	) || 
439 439
 	(
440
-	    isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
440
+		isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
441 441
 	) || 
442 442
 	(
443
-	    isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
443
+		isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
444 444
 	) || 
445 445
 	(
446
-	    isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))
446
+		isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))
447 447
 	)
448
-    ) {
448
+	) {
449 449
 	$sub = true;
450
-    }
450
+	}
451 451
 ?>
452 452
 <?php
453
-    if (!isset($globalAircraft) || $globalAircraft === TRUE) {
453
+	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
454 454
 ?>
455 455
     <li class="dropdown">
456 456
 <?php
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 	<ul class="dropdown-menu multi-level">
462 462
       	<li class="dropdown-submenu">
463 463
 <?php
464
-        }
464
+		}
465 465
 ?>
466 466
 <?php
467 467
 	if (isset($globalNewsFeeds['aircraft']) && !empty($globalNewsFeeds['aircraft'])) {
@@ -476,25 +476,25 @@  discard block
 block discarded – undo
476 476
           <ul class="dropdown-menu">
477 477
           	<li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircrafts Types"); ?></a></li>
478 478
 <?php
479
-    if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
479
+	if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
480 480
 ?>
481 481
 			<li><a href="<?php print $globalURL; ?>/airline"><?php echo _("Airlines"); ?></a></li>
482 482
 <?php
483
-    }
483
+	}
484 484
 ?>
485 485
 			<li><a href="<?php print $globalURL; ?>/airport"><?php echo _("Airports"); ?></a></li>
486 486
 <?php
487
-    if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
487
+	if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
488 488
 ?>
489 489
 			<li><a href="<?php print $globalURL; ?>/owner"><?php echo _("Owners"); ?></a></li>
490 490
 <?php
491
-    } 
492
-    if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
491
+	} 
492
+	if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
493 493
 
494 494
 ?>
495 495
 			<li><a href="<?php print $globalURL; ?>/pilot"><?php echo _("Pilots"); ?></a></li>
496 496
 <?php
497
-    }
497
+	}
498 498
 ?>
499 499
 			<li><hr /></li>
500 500
             <li><a href="<?php print $globalURL; ?>/currently"><?php echo _("Current Activity"); ?></a></li>
@@ -502,43 +502,43 @@  discard block
 block discarded – undo
502 502
             <li><a href="<?php print $globalURL; ?>/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li>
503 503
             <li><a href="<?php print $globalURL; ?>/newest"><?php echo _("Newest by Category"); ?></a></li>
504 504
             <?php
505
-        	if ($globalACARS) {
506
-        	    if (isset($globalDemo) && $globalDemo) {
507
-    	    ?>
505
+			if ($globalACARS) {
506
+				if (isset($globalDemo) && $globalDemo) {
507
+			?>
508 508
             <li><hr /></li>
509 509
             <li><i><?php echo _('ACARS data not available publicly'); ?></i></li>
510 510
             <li><a href=""><?php echo _('Latest ACARS messages'); ?></a></li>
511 511
             <li><a href=""><?php echo _('Archive ACARS messages'); ?></a></li>
512 512
             <?php
513
-        	    } else {
514
-    	    ?>
513
+				} else {
514
+			?>
515 515
             <li><hr /></li>
516 516
             <li><a href="<?php print $globalURL; ?>/acars-latest"><?php echo _("Latest ACARS messages"); ?></a></li>
517 517
             <li><a href="<?php print $globalURL; ?>/acars-archive"><?php echo _("Archive ACARS messages"); ?></a></li>
518 518
             <?php
519
-        	    }
520
-        	}
521
-    	    ?>
519
+				}
520
+			}
521
+			?>
522 522
     	    <?php
523
-    	        if (isset($globalAccidents) && $globalAccidents) {
524
-    	    ?>
523
+				if (isset($globalAccidents) && $globalAccidents) {
524
+			?>
525 525
             <li><hr /></li>
526 526
             <li><a href="<?php print $globalURL; ?>/accident-latest"><?php echo _("Latest accident"); ?></a></li>
527 527
             <li><a href="<?php print $globalURL; ?>/accident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Accident"); ?></a></li>
528 528
             <li><a href="<?php print $globalURL; ?>/incident-latest"><?php echo _("Latest incident"); ?></a></li>
529 529
             <li><a href="<?php print $globalURL; ?>/incident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Incident"); ?></a></li>
530 530
             <?php
531
-        	}
532
-    	    ?>
531
+			}
532
+			?>
533 533
             <li><hr /></li>
534 534
             <li><a href="<?php print $globalURL; ?>/highlights/table"><?php echo _("Special Highlights"); ?></a></li>
535 535
             <?php
536 536
 		if (!isset($globalNoUpcoming) || $globalNoUpcoming === FALSE) {
537
-	    ?>
537
+		?>
538 538
             <li><a href="<?php print $globalURL; ?>/upcoming"><?php echo _("Upcoming Flights"); ?></a></li>
539 539
 	    <?php
540 540
 		}
541
-	    ?>
541
+		?>
542 542
           </ul>
543 543
         </li>
544 544
       	<li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li>
@@ -565,14 +565,14 @@  discard block
 block discarded – undo
565 565
     </ul>
566 566
 <?php
567 567
 	}
568
-    }
568
+	}
569 569
 ?>
570 570
 <?php
571
-    if (isset($globalMarine) && $globalMarine) {
571
+	if (isset($globalMarine) && $globalMarine) {
572 572
 ?>
573 573
     <li class="dropdown">
574 574
 <?php
575
-        if ($sub) {
575
+		if ($sub) {
576 576
 ?>
577 577
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Marines"); ?> <b class="caret"></b></a>
578 578
 	<ul class="dropdown-menu multi-level">
@@ -606,14 +606,14 @@  discard block
 block discarded – undo
606 606
 	}
607 607
 ?>
608 608
 <?php
609
-    }
609
+	}
610 610
 ?>
611 611
 <?php
612
-    if (isset($globalTracker) && $globalTracker) {
612
+	if (isset($globalTracker) && $globalTracker) {
613 613
 ?>
614 614
     <li class="dropdown">
615 615
 <?php
616
-        if ($sub) {
616
+		if ($sub) {
617 617
 ?>
618 618
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Trackers"); ?> <b class="caret"></b></a>
619 619
 	<ul class="dropdown-menu multi-level">
@@ -647,14 +647,14 @@  discard block
 block discarded – undo
647 647
 	}
648 648
 ?>
649 649
 <?php
650
-    }
650
+	}
651 651
 ?>
652 652
 <?php
653
-    if (isset($globalSatellite) && $globalSatellite) {
653
+	if (isset($globalSatellite) && $globalSatellite) {
654 654
 ?>
655 655
     <li class="dropdown">
656 656
 <?php
657
-        if ($sub) {
657
+		if ($sub) {
658 658
 ?>
659 659
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Satellites"); ?> <b class="caret"></b></a>
660 660
 	<ul class="dropdown-menu multi-level">
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
 	}
691 691
 ?>
692 692
 <?php
693
-    }
693
+	}
694 694
 ?>
695 695
 
696 696
         <li class="dropdown">
@@ -699,12 +699,12 @@  discard block
 block discarded – undo
699 699
           	<li><a href="<?php print $globalURL; ?>/about"><?php echo _("About The Project"); ?></a></li>
700 700
           	<li><a href="<?php print $globalURL; ?>/about/export"><?php echo _("Exporting Data"); ?></a></li>
701 701
 <?php
702
-    if (!isset($globalAircraft) || $globalAircraft === TRUE) {
702
+	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
703 703
 ?>
704 704
 		<li><hr /></li>
705 705
 		<li><a href="<?php print $globalURL; ?>/about/tv"><?php echo _("Spotter TV"); ?></a></li>
706 706
 <?php
707
-    }
707
+	}
708 708
 ?>
709 709
 	    <?php if (isset($globalContribute) && $globalContribute) { ?>
710 710
                 <li><hr /></li>
@@ -725,14 +725,14 @@  discard block
 block discarded – undo
725 725
   	    <form>
726 726
   		<select class="selectpicker" data-width="120px" onchange="language(this);">
727 727
   		    <?php
728
-  		        $Language = new Language();
729
-  		        $alllang = $Language->getLanguages();
730
-  		        foreach ($alllang as $key => $lang) {
731
-  		            print '<option value="'.$key.'"';
732
-  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
733
-  		            print '>'.$lang[0].'</option>';
734
-  		        }
735
-  		    ?>
728
+  				$Language = new Language();
729
+  				$alllang = $Language->getLanguages();
730
+  				foreach ($alllang as $key => $lang) {
731
+  					print '<option value="'.$key.'"';
732
+  					if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
733
+  					print '>'.$lang[0].'</option>';
734
+  				}
735
+  			?>
736 736
   		</select>
737 737
   	    </form>
738 738
   	</div>
@@ -764,18 +764,18 @@  discard block
 block discarded – undo
764 764
 ?>
765 765
     <div class="top-header clear" role="main">
766 766
 <?php
767
-    if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) {
767
+	if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) {
768 768
 ?>
769 769
     <div id="archive-map"></div>
770 770
 <?php
771
-    }
771
+	}
772 772
 ?>
773 773
     </div>
774 774
 <?php
775 775
 }
776 776
 if ((strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) || (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false))
777 777
 {
778
-    ?>
778
+	?>
779 779
     <div class="top-header clear" role="main">
780 780
         <div id="map"></div>
781 781
 	<link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" />
@@ -786,15 +786,15 @@  discard block
 block discarded – undo
786 786
         var zoom = 13;
787 787
 //create the map
788 788
 <?php
789
-    if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
789
+	if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
790 790
 ?>
791 791
   map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom);
792 792
 <?php
793
-    } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
793
+	} elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
794 794
 ?>
795 795
   map = L.map('map', { zoomControl:true });
796 796
 <?php
797
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
797
+	} elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
798 798
 ?>
799 799
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]);
800 800
     var line = L.polyline([[<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>],[<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>]]).addTo(map);
@@ -802,22 +802,22 @@  discard block
 block discarded – undo
802 802
     var departure_airport = L.marker([<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/departure_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map);
803 803
     var arrival_airport = L.marker([<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/arrival_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map);
804 804
 <?php
805
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) {
805
+	} elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) {
806 806
 ?>
807 807
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]);
808 808
 <?php
809
-    } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) {
809
+	} elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) {
810 810
 ?>
811 811
   map = L.map('map', { zoomControl:true });
812 812
 <?php
813
-    }
813
+	}
814 814
 ?>
815 815
   //initialize the layer group for the aircrft markers
816 816
   var layer_data = L.layerGroup();
817 817
 
818 818
   //a few title layers
819 819
 <?php
820
-    if ($globalMapProvider == 'Mapbox') {
820
+	if ($globalMapProvider == 'Mapbox') {
821 821
 ?>
822 822
   L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', {
823 823
     maxZoom: 18,
@@ -828,14 +828,14 @@  discard block
 block discarded – undo
828 828
     token : '<?php print $globalMapboxToken; ?>'
829 829
   }).addTo(map);
830 830
 <?php
831
-    } elseif ($globalMapProvider == 'Mapbox-GL') {
831
+	} elseif ($globalMapProvider == 'Mapbox-GL') {
832 832
 ?>
833 833
     L.mapboxGL({
834 834
 	accessToken: '<?php print $globalMapboxToken; ?>',
835 835
 	style: 'mapbox://styles/mapbox/bright-v8'
836 836
   }).addTo(map);
837 837
 <?php
838
-    } elseif ($globalMapProvider == 'MapQuest-OSM') {
838
+	} elseif ($globalMapProvider == 'MapQuest-OSM') {
839 839
 ?>
840 840
   L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {
841 841
     maxZoom: 18,
@@ -844,7 +844,7 @@  discard block
 block discarded – undo
844 844
       'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>'
845 845
   }).addTo(map);
846 846
 <?php
847
-    } elseif ($globalMapProvider == 'MapQuest-Aerial') {
847
+	} elseif ($globalMapProvider == 'MapQuest-Aerial') {
848 848
 ?>
849 849
   L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', {
850 850
     maxZoom: 18,
@@ -853,27 +853,27 @@  discard block
 block discarded – undo
853 853
       'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>, Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency"'
854 854
   }).addTo(map);
855 855
 <?php
856
-    } elseif ($globalMapProvider == 'Google-Roadmap') {
856
+	} elseif ($globalMapProvider == 'Google-Roadmap') {
857 857
 ?>
858 858
     var googleLayer = new L.Google('ROADMAP');
859 859
     map.addLayer(googleLayer);
860 860
 <?php
861
-    } elseif ($globalMapProvider == 'Google-Satellite') {
861
+	} elseif ($globalMapProvider == 'Google-Satellite') {
862 862
 ?>
863 863
     var googleLayer = new L.Google('SATELLITE');
864 864
     map.addLayer(googleLayer);
865 865
 <?php
866
-    } elseif ($globalMapProvider == 'Google-Hybrid') {
866
+	} elseif ($globalMapProvider == 'Google-Hybrid') {
867 867
 ?>
868 868
     var googleLayer = new L.Google('HYBRID');
869 869
     map.addLayer(googleLayer);
870 870
 <?php
871
-    } elseif ($globalMapProvider == 'Google-Terrain') {
871
+	} elseif ($globalMapProvider == 'Google-Terrain') {
872 872
 ?>
873 873
     var googleLayer = new L.Google('Terrain');
874 874
     map.addLayer(googleLayer);
875 875
 <?php
876
-    } elseif (isset($globalMapCustomLayer[$globalMapProvider])) {
876
+	} elseif (isset($globalMapCustomLayer[$globalMapProvider])) {
877 877
 	$customid = $globalMapProvider;
878 878
 ?>
879 879
     L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', {
@@ -883,8 +883,8 @@  discard block
 block discarded – undo
883 883
         attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
884 884
     }).addTo(map);
885 885
 <?php
886
-    //} elseif ($globalMapProvider == 'OpenStreetMap') {
887
-    } else {
886
+	//} elseif ($globalMapProvider == 'OpenStreetMap') {
887
+	} else {
888 888
 ?>
889 889
   L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
890 890
     maxZoom: 18,
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
   }).addTo(map);
894 894
 
895 895
 <?php
896
-    }
896
+	}
897 897
 ?>
898 898
         </script>
899 899
     </div>
Please login to merge, or discard this patch.
require/class.Common.php 4 patches
Doc Comments   +15 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,6 +97,10 @@  discard block
 block discarded – undo
97 97
 		return strlen($headerLine); // Needed by curl
98 98
 	}
99 99
 
100
+	/**
101
+	 * @param string $url
102
+	 * @param string $file
103
+	 */
100 104
 	public static function download($url, $file, $referer = '') {
101 105
 		global $globalDebug, $globalProxy, $globalForceIPv4;
102 106
 		$fp = fopen($file, 'w');
@@ -121,6 +125,9 @@  discard block
 block discarded – undo
121 125
 		fclose($fp);
122 126
 	}
123 127
 
128
+	/**
129
+	 * @param string $in_file
130
+	 */
124 131
 	public static function gunzip($in_file,$out_file_name = '') {
125 132
 		//echo $in_file.' -> '.$out_file_name."\n";
126 133
 		$buffer_size = 4096; // read 4kb at a time
@@ -272,7 +279,7 @@  discard block
 block discarded – undo
272 279
 	* Check is distance realistic
273 280
 	* @param int $timeDifference the time between the reception of both messages
274 281
 	* @param float $distance distance covered
275
-	* @return whether distance is realistic
282
+	* @return boolean distance is realistic
276 283
 	*/
277 284
 	public function withinThreshold ($timeDifference, $distance) {
278 285
 		$x = abs($timeDifference);
@@ -295,6 +302,9 @@  discard block
 block discarded – undo
295 302
 	}
296 303
 
297 304
 
305
+	/**
306
+	 * @param string $latlong
307
+	 */
298 308
 	public function convertDec($dms,$latlong) {
299 309
 		if ($latlong == 'latitude') {
300 310
 			$deg = substr($dms, 0, 2);
@@ -306,6 +316,9 @@  discard block
 block discarded – undo
306 316
 		return $deg+(($min*60)/3600);
307 317
 	}
308 318
 	
319
+	/**
320
+	 * @param string $latlong
321
+	 */
309 322
 	public function convertDM($coord,$latlong) {
310 323
 		if ($latlong == 'latitude') {
311 324
 			if ($coord < 0) $NSEW = 'S';
@@ -443,7 +456,7 @@  discard block
 block discarded – undo
443 456
 	/**
444 457
 	* Returns list of available locales
445 458
 	*
446
-	* @return array
459
+	* @return string[]
447 460
 	 */
448 461
 	public function listLocaleDir()
449 462
 	{
Please login to merge, or discard this patch.
Indentation   +156 added lines, -156 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
 	//protected $cookies = array();
8 8
 	
9 9
 	/**
10
-	* Get data from form result
11
-	* @param String $url form URL
12
-	* @param String $type type of submit form method (get or post)
13
-	* @param String|Array $data values form post method
14
-	* @param Array $headers header to submit with the form
15
-	* @return String the result
16
-	*/
10
+	 * Get data from form result
11
+	 * @param String $url form URL
12
+	 * @param String $type type of submit form method (get or post)
13
+	 * @param String|Array $data values form post method
14
+	 * @param Array $headers header to submit with the form
15
+	 * @return String the result
16
+	 */
17 17
 	public function getData($url, $type = 'get', $data = '', $headers = '',$cookie = '',$referer = '',$timeout = '',$useragent = '', $sizelimit = false, $async = false) {
18 18
 		global $globalProxy, $globalForceIPv4;
19 19
 		$ch = curl_init();
@@ -166,10 +166,10 @@  discard block
 block discarded – undo
166 166
 	}
167 167
 
168 168
 	/**
169
-	* Convert a HTML table to an array
170
-	* @param String $data HTML page
171
-	* @return Array array of the tables in HTML page
172
-	*/
169
+	 * Convert a HTML table to an array
170
+	 * @param String $data HTML page
171
+	 * @return Array array of the tables in HTML page
172
+	 */
173 173
 	public function table2array($data) {
174 174
 		if (!is_string($data)) return array();
175 175
 		if ($data == '') return array();
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
 	}
204 204
 	
205 205
 	/**
206
-	* Convert <p> part of a HTML page to an array
207
-	* @param String $data HTML page
208
-	* @return Array array of the <p> in HTML page
209
-	*/
206
+	 * Convert <p> part of a HTML page to an array
207
+	 * @param String $data HTML page
208
+	 * @return Array array of the <p> in HTML page
209
+	 */
210 210
 	public function text2array($data) {
211 211
 		$html = str_get_html($data);
212 212
 		if ($html === false) return array();
@@ -221,14 +221,14 @@  discard block
 block discarded – undo
221 221
 	}
222 222
 
223 223
 	/**
224
-	* Give distance between 2 coordonnates
225
-	* @param Float $lat latitude of first point
226
-	* @param Float $lon longitude of first point
227
-	* @param Float $latc latitude of second point
228
-	* @param Float $lonc longitude of second point
229
-	* @param String $unit km else no unit used
230
-	* @return Float Distance in $unit
231
-	*/
224
+	 * Give distance between 2 coordonnates
225
+	 * @param Float $lat latitude of first point
226
+	 * @param Float $lon longitude of first point
227
+	 * @param Float $latc latitude of second point
228
+	 * @param Float $lonc longitude of second point
229
+	 * @param String $unit km else no unit used
230
+	 * @return Float Distance in $unit
231
+	 */
232 232
 	public function distance($lat, $lon, $latc, $lonc, $unit = 'km') {
233 233
 		if ($lat == $latc && $lon == $lonc) return 0;
234 234
 		$dist = rad2deg(acos(sin(deg2rad(floatval($lat)))*sin(deg2rad(floatval($latc)))+ cos(deg2rad(floatval($lat)))*cos(deg2rad(floatval($latc)))*cos(deg2rad(floatval($lon)-floatval($lonc)))))*60*1.1515;
@@ -246,25 +246,25 @@  discard block
 block discarded – undo
246 246
 	}
247 247
 
248 248
 	/**
249
-	* Give plunge between 2 altitudes and distance
250
-	* @param Float $initial_altitude altitude of first point in m
251
-	* @param Float $final_altitude altitude of second point in m
252
-	* @param String $distance distance between two points in m
253
-	* @return Float plunge
254
-	*/
249
+	 * Give plunge between 2 altitudes and distance
250
+	 * @param Float $initial_altitude altitude of first point in m
251
+	 * @param Float $final_altitude altitude of second point in m
252
+	 * @param String $distance distance between two points in m
253
+	 * @return Float plunge
254
+	 */
255 255
 	public function plunge($initial_altitude,$final_altitude,$distance) {
256 256
 		$plunge = rad2deg(asin(($final_altitude-$initial_altitude)/$distance));
257 257
 		return $plunge;
258 258
 	}
259 259
 
260 260
 	/**
261
-	* Give azimuth between 2 coordonnates
262
-	* @param Float $lat latitude of first point
263
-	* @param Float $lon longitude of first point
264
-	* @param Float $latc latitude of second point
265
-	* @param Float $lonc longitude of second point
266
-	* @return Float Azimuth
267
-	*/
261
+	 * Give azimuth between 2 coordonnates
262
+	 * @param Float $lat latitude of first point
263
+	 * @param Float $lon longitude of first point
264
+	 * @param Float $latc latitude of second point
265
+	 * @param Float $lonc longitude of second point
266
+	 * @return Float Azimuth
267
+	 */
268 268
 	public function azimuth($lat, $lon, $latc, $lonc) {
269 269
 		$dX = $latc - $lat;
270 270
 		$dY = $lonc - $lon;
@@ -275,11 +275,11 @@  discard block
 block discarded – undo
275 275
 	
276 276
 	
277 277
 	/**
278
-	* Check is distance realistic
279
-	* @param int $timeDifference the time between the reception of both messages
280
-	* @param float $distance distance covered
281
-	* @return whether distance is realistic
282
-	*/
278
+	 * Check is distance realistic
279
+	 * @param int $timeDifference the time between the reception of both messages
280
+	 * @param float $distance distance covered
281
+	 * @return whether distance is realistic
282
+	 */
283 283
 	public function withinThreshold ($timeDifference, $distance) {
284 284
 		$x = abs($timeDifference);
285 285
 		$d = abs($distance);
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	}
298 298
 
299 299
 	public function isInteger($input){
300
-	    return(ctype_digit(strval($input)));
300
+		return(ctype_digit(strval($input)));
301 301
 	}
302 302
 
303 303
 
@@ -328,11 +328,11 @@  discard block
 block discarded – undo
328 328
 	}
329 329
 	
330 330
 	/**
331
-	* Copy folder contents
332
-	* @param       string   $source    Source path
333
-	* @param       string   $dest      Destination path
334
-	* @return      bool     Returns true on success, false on failure
335
-	*/
331
+	 * Copy folder contents
332
+	 * @param       string   $source    Source path
333
+	 * @param       string   $dest      Destination path
334
+	 * @return      bool     Returns true on success, false on failure
335
+	 */
336 336
 	public function xcopy($source, $dest)
337 337
 	{
338 338
 		$files = glob($source.'*.*');
@@ -344,20 +344,20 @@  discard block
 block discarded – undo
344 344
 	}
345 345
 	
346 346
 	/**
347
-	* Check if an url exist
348
-	* @param	String $url url to check
349
-	* @return	bool Return true on succes false on failure
350
-	*/
347
+	 * Check if an url exist
348
+	 * @param	String $url url to check
349
+	 * @return	bool Return true on succes false on failure
350
+	 */
351 351
 	public function urlexist($url){
352 352
 		$headers=get_headers($url);
353 353
 		return stripos($headers[0],"200 OK")?true:false;
354 354
 	}
355 355
 	
356 356
 	/**
357
-	* Convert hexa to string
358
-	* @param	String $hex data in hexa
359
-	* @return	String Return result
360
-	*/
357
+	 * Convert hexa to string
358
+	 * @param	String $hex data in hexa
359
+	 * @return	String Return result
360
+	 */
361 361
 	public function hex2str($hex) {
362 362
 		$str = '';
363 363
 		$hexln = strlen($hex);
@@ -366,10 +366,10 @@  discard block
 block discarded – undo
366 366
 	}
367 367
 	
368 368
 	/**
369
-	* Convert hexa color to rgb
370
-	* @param	String $hex data in hexa
371
-	* @return	String Return result
372
-	*/
369
+	 * Convert hexa color to rgb
370
+	 * @param	String $hex data in hexa
371
+	 * @return	String Return result
372
+	 */
373 373
 	public function hex2rgb($hex) {
374 374
 		$hex = str_replace('#','',$hex);
375 375
 		return sscanf($hex, "%02x%02x%02x"); 
@@ -447,9 +447,9 @@  discard block
 block discarded – undo
447 447
 	}
448 448
 	
449 449
 	/**
450
-	* Returns list of available locales
451
-	*
452
-	* @return array
450
+	 * Returns list of available locales
451
+	 *
452
+	 * @return array
453 453
 	 */
454 454
 	public function listLocaleDir()
455 455
 	{
@@ -548,100 +548,100 @@  discard block
 block discarded – undo
548 548
 	public function remove_accents($string) {
549 549
 		if ( !preg_match('/[\x80-\xff]/', $string) ) return $string;
550 550
 		$chars = array(
551
-		    // Decompositions for Latin-1 Supplement
552
-		    chr(195).chr(128) => 'A', chr(195).chr(129) => 'A',
553
-		    chr(195).chr(130) => 'A', chr(195).chr(131) => 'A',
554
-		    chr(195).chr(132) => 'A', chr(195).chr(133) => 'A',
555
-		    chr(195).chr(135) => 'C', chr(195).chr(136) => 'E',
556
-		    chr(195).chr(137) => 'E', chr(195).chr(138) => 'E',
557
-		    chr(195).chr(139) => 'E', chr(195).chr(140) => 'I',
558
-		    chr(195).chr(141) => 'I', chr(195).chr(142) => 'I',
559
-		    chr(195).chr(143) => 'I', chr(195).chr(145) => 'N',
560
-		    chr(195).chr(146) => 'O', chr(195).chr(147) => 'O',
561
-		    chr(195).chr(148) => 'O', chr(195).chr(149) => 'O',
562
-		    chr(195).chr(150) => 'O', chr(195).chr(153) => 'U',
563
-		    chr(195).chr(154) => 'U', chr(195).chr(155) => 'U',
564
-		    chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y',
565
-		    chr(195).chr(159) => 's', chr(195).chr(160) => 'a',
566
-		    chr(195).chr(161) => 'a', chr(195).chr(162) => 'a',
567
-		    chr(195).chr(163) => 'a', chr(195).chr(164) => 'a',
568
-		    chr(195).chr(165) => 'a', chr(195).chr(167) => 'c',
569
-		    chr(195).chr(168) => 'e', chr(195).chr(169) => 'e',
570
-		    chr(195).chr(170) => 'e', chr(195).chr(171) => 'e',
571
-		    chr(195).chr(172) => 'i', chr(195).chr(173) => 'i',
572
-		    chr(195).chr(174) => 'i', chr(195).chr(175) => 'i',
573
-		    chr(195).chr(177) => 'n', chr(195).chr(178) => 'o',
574
-		    chr(195).chr(179) => 'o', chr(195).chr(180) => 'o',
575
-		    chr(195).chr(181) => 'o', chr(195).chr(182) => 'o',
576
-		    chr(195).chr(182) => 'o', chr(195).chr(185) => 'u',
577
-		    chr(195).chr(186) => 'u', chr(195).chr(187) => 'u',
578
-		    chr(195).chr(188) => 'u', chr(195).chr(189) => 'y',
579
-		    chr(195).chr(191) => 'y',
580
-		    // Decompositions for Latin Extended-A
581
-		    chr(196).chr(128) => 'A', chr(196).chr(129) => 'a',
582
-		    chr(196).chr(130) => 'A', chr(196).chr(131) => 'a',
583
-		    chr(196).chr(132) => 'A', chr(196).chr(133) => 'a',
584
-		    chr(196).chr(134) => 'C', chr(196).chr(135) => 'c',
585
-		    chr(196).chr(136) => 'C', chr(196).chr(137) => 'c',
586
-		    chr(196).chr(138) => 'C', chr(196).chr(139) => 'c',
587
-		    chr(196).chr(140) => 'C', chr(196).chr(141) => 'c',
588
-		    chr(196).chr(142) => 'D', chr(196).chr(143) => 'd',
589
-		    chr(196).chr(144) => 'D', chr(196).chr(145) => 'd',
590
-		    chr(196).chr(146) => 'E', chr(196).chr(147) => 'e',
591
-		    chr(196).chr(148) => 'E', chr(196).chr(149) => 'e',
592
-		    chr(196).chr(150) => 'E', chr(196).chr(151) => 'e',
593
-		    chr(196).chr(152) => 'E', chr(196).chr(153) => 'e',
594
-		    chr(196).chr(154) => 'E', chr(196).chr(155) => 'e',
595
-		    chr(196).chr(156) => 'G', chr(196).chr(157) => 'g',
596
-		    chr(196).chr(158) => 'G', chr(196).chr(159) => 'g',
597
-		    chr(196).chr(160) => 'G', chr(196).chr(161) => 'g',
598
-		    chr(196).chr(162) => 'G', chr(196).chr(163) => 'g',
599
-		    chr(196).chr(164) => 'H', chr(196).chr(165) => 'h',
600
-		    chr(196).chr(166) => 'H', chr(196).chr(167) => 'h',
601
-		    chr(196).chr(168) => 'I', chr(196).chr(169) => 'i',
602
-		    chr(196).chr(170) => 'I', chr(196).chr(171) => 'i',
603
-		    chr(196).chr(172) => 'I', chr(196).chr(173) => 'i',
604
-		    chr(196).chr(174) => 'I', chr(196).chr(175) => 'i',
605
-		    chr(196).chr(176) => 'I', chr(196).chr(177) => 'i',
606
-		    chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij',
607
-		    chr(196).chr(180) => 'J', chr(196).chr(181) => 'j',
608
-		    chr(196).chr(182) => 'K', chr(196).chr(183) => 'k',
609
-		    chr(196).chr(184) => 'k', chr(196).chr(185) => 'L',
610
-		    chr(196).chr(186) => 'l', chr(196).chr(187) => 'L',
611
-		    chr(196).chr(188) => 'l', chr(196).chr(189) => 'L',
612
-		    chr(196).chr(190) => 'l', chr(196).chr(191) => 'L',
613
-		    chr(197).chr(128) => 'l', chr(197).chr(129) => 'L',
614
-		    chr(197).chr(130) => 'l', chr(197).chr(131) => 'N',
615
-		    chr(197).chr(132) => 'n', chr(197).chr(133) => 'N',
616
-		    chr(197).chr(134) => 'n', chr(197).chr(135) => 'N',
617
-		    chr(197).chr(136) => 'n', chr(197).chr(137) => 'N',
618
-		    chr(197).chr(138) => 'n', chr(197).chr(139) => 'N',
619
-		    chr(197).chr(140) => 'O', chr(197).chr(141) => 'o',
620
-		    chr(197).chr(142) => 'O', chr(197).chr(143) => 'o',
621
-		    chr(197).chr(144) => 'O', chr(197).chr(145) => 'o',
622
-		    chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe',
623
-		    chr(197).chr(148) => 'R',chr(197).chr(149) => 'r',
624
-		    chr(197).chr(150) => 'R',chr(197).chr(151) => 'r',
625
-		    chr(197).chr(152) => 'R',chr(197).chr(153) => 'r',
626
-		    chr(197).chr(154) => 'S',chr(197).chr(155) => 's',
627
-		    chr(197).chr(156) => 'S',chr(197).chr(157) => 's',
628
-		    chr(197).chr(158) => 'S',chr(197).chr(159) => 's',
629
-		    chr(197).chr(160) => 'S', chr(197).chr(161) => 's',
630
-		    chr(197).chr(162) => 'T', chr(197).chr(163) => 't',
631
-		    chr(197).chr(164) => 'T', chr(197).chr(165) => 't',
632
-		    chr(197).chr(166) => 'T', chr(197).chr(167) => 't',
633
-		    chr(197).chr(168) => 'U', chr(197).chr(169) => 'u',
634
-		    chr(197).chr(170) => 'U', chr(197).chr(171) => 'u',
635
-		    chr(197).chr(172) => 'U', chr(197).chr(173) => 'u',
636
-		    chr(197).chr(174) => 'U', chr(197).chr(175) => 'u',
637
-		    chr(197).chr(176) => 'U', chr(197).chr(177) => 'u',
638
-		    chr(197).chr(178) => 'U', chr(197).chr(179) => 'u',
639
-		    chr(197).chr(180) => 'W', chr(197).chr(181) => 'w',
640
-		    chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y',
641
-		    chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z',
642
-		    chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z',
643
-		    chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z',
644
-		    chr(197).chr(190) => 'z', chr(197).chr(191) => 's'
551
+			// Decompositions for Latin-1 Supplement
552
+			chr(195).chr(128) => 'A', chr(195).chr(129) => 'A',
553
+			chr(195).chr(130) => 'A', chr(195).chr(131) => 'A',
554
+			chr(195).chr(132) => 'A', chr(195).chr(133) => 'A',
555
+			chr(195).chr(135) => 'C', chr(195).chr(136) => 'E',
556
+			chr(195).chr(137) => 'E', chr(195).chr(138) => 'E',
557
+			chr(195).chr(139) => 'E', chr(195).chr(140) => 'I',
558
+			chr(195).chr(141) => 'I', chr(195).chr(142) => 'I',
559
+			chr(195).chr(143) => 'I', chr(195).chr(145) => 'N',
560
+			chr(195).chr(146) => 'O', chr(195).chr(147) => 'O',
561
+			chr(195).chr(148) => 'O', chr(195).chr(149) => 'O',
562
+			chr(195).chr(150) => 'O', chr(195).chr(153) => 'U',
563
+			chr(195).chr(154) => 'U', chr(195).chr(155) => 'U',
564
+			chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y',
565
+			chr(195).chr(159) => 's', chr(195).chr(160) => 'a',
566
+			chr(195).chr(161) => 'a', chr(195).chr(162) => 'a',
567
+			chr(195).chr(163) => 'a', chr(195).chr(164) => 'a',
568
+			chr(195).chr(165) => 'a', chr(195).chr(167) => 'c',
569
+			chr(195).chr(168) => 'e', chr(195).chr(169) => 'e',
570
+			chr(195).chr(170) => 'e', chr(195).chr(171) => 'e',
571
+			chr(195).chr(172) => 'i', chr(195).chr(173) => 'i',
572
+			chr(195).chr(174) => 'i', chr(195).chr(175) => 'i',
573
+			chr(195).chr(177) => 'n', chr(195).chr(178) => 'o',
574
+			chr(195).chr(179) => 'o', chr(195).chr(180) => 'o',
575
+			chr(195).chr(181) => 'o', chr(195).chr(182) => 'o',
576
+			chr(195).chr(182) => 'o', chr(195).chr(185) => 'u',
577
+			chr(195).chr(186) => 'u', chr(195).chr(187) => 'u',
578
+			chr(195).chr(188) => 'u', chr(195).chr(189) => 'y',
579
+			chr(195).chr(191) => 'y',
580
+			// Decompositions for Latin Extended-A
581
+			chr(196).chr(128) => 'A', chr(196).chr(129) => 'a',
582
+			chr(196).chr(130) => 'A', chr(196).chr(131) => 'a',
583
+			chr(196).chr(132) => 'A', chr(196).chr(133) => 'a',
584
+			chr(196).chr(134) => 'C', chr(196).chr(135) => 'c',
585
+			chr(196).chr(136) => 'C', chr(196).chr(137) => 'c',
586
+			chr(196).chr(138) => 'C', chr(196).chr(139) => 'c',
587
+			chr(196).chr(140) => 'C', chr(196).chr(141) => 'c',
588
+			chr(196).chr(142) => 'D', chr(196).chr(143) => 'd',
589
+			chr(196).chr(144) => 'D', chr(196).chr(145) => 'd',
590
+			chr(196).chr(146) => 'E', chr(196).chr(147) => 'e',
591
+			chr(196).chr(148) => 'E', chr(196).chr(149) => 'e',
592
+			chr(196).chr(150) => 'E', chr(196).chr(151) => 'e',
593
+			chr(196).chr(152) => 'E', chr(196).chr(153) => 'e',
594
+			chr(196).chr(154) => 'E', chr(196).chr(155) => 'e',
595
+			chr(196).chr(156) => 'G', chr(196).chr(157) => 'g',
596
+			chr(196).chr(158) => 'G', chr(196).chr(159) => 'g',
597
+			chr(196).chr(160) => 'G', chr(196).chr(161) => 'g',
598
+			chr(196).chr(162) => 'G', chr(196).chr(163) => 'g',
599
+			chr(196).chr(164) => 'H', chr(196).chr(165) => 'h',
600
+			chr(196).chr(166) => 'H', chr(196).chr(167) => 'h',
601
+			chr(196).chr(168) => 'I', chr(196).chr(169) => 'i',
602
+			chr(196).chr(170) => 'I', chr(196).chr(171) => 'i',
603
+			chr(196).chr(172) => 'I', chr(196).chr(173) => 'i',
604
+			chr(196).chr(174) => 'I', chr(196).chr(175) => 'i',
605
+			chr(196).chr(176) => 'I', chr(196).chr(177) => 'i',
606
+			chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij',
607
+			chr(196).chr(180) => 'J', chr(196).chr(181) => 'j',
608
+			chr(196).chr(182) => 'K', chr(196).chr(183) => 'k',
609
+			chr(196).chr(184) => 'k', chr(196).chr(185) => 'L',
610
+			chr(196).chr(186) => 'l', chr(196).chr(187) => 'L',
611
+			chr(196).chr(188) => 'l', chr(196).chr(189) => 'L',
612
+			chr(196).chr(190) => 'l', chr(196).chr(191) => 'L',
613
+			chr(197).chr(128) => 'l', chr(197).chr(129) => 'L',
614
+			chr(197).chr(130) => 'l', chr(197).chr(131) => 'N',
615
+			chr(197).chr(132) => 'n', chr(197).chr(133) => 'N',
616
+			chr(197).chr(134) => 'n', chr(197).chr(135) => 'N',
617
+			chr(197).chr(136) => 'n', chr(197).chr(137) => 'N',
618
+			chr(197).chr(138) => 'n', chr(197).chr(139) => 'N',
619
+			chr(197).chr(140) => 'O', chr(197).chr(141) => 'o',
620
+			chr(197).chr(142) => 'O', chr(197).chr(143) => 'o',
621
+			chr(197).chr(144) => 'O', chr(197).chr(145) => 'o',
622
+			chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe',
623
+			chr(197).chr(148) => 'R',chr(197).chr(149) => 'r',
624
+			chr(197).chr(150) => 'R',chr(197).chr(151) => 'r',
625
+			chr(197).chr(152) => 'R',chr(197).chr(153) => 'r',
626
+			chr(197).chr(154) => 'S',chr(197).chr(155) => 's',
627
+			chr(197).chr(156) => 'S',chr(197).chr(157) => 's',
628
+			chr(197).chr(158) => 'S',chr(197).chr(159) => 's',
629
+			chr(197).chr(160) => 'S', chr(197).chr(161) => 's',
630
+			chr(197).chr(162) => 'T', chr(197).chr(163) => 't',
631
+			chr(197).chr(164) => 'T', chr(197).chr(165) => 't',
632
+			chr(197).chr(166) => 'T', chr(197).chr(167) => 't',
633
+			chr(197).chr(168) => 'U', chr(197).chr(169) => 'u',
634
+			chr(197).chr(170) => 'U', chr(197).chr(171) => 'u',
635
+			chr(197).chr(172) => 'U', chr(197).chr(173) => 'u',
636
+			chr(197).chr(174) => 'U', chr(197).chr(175) => 'u',
637
+			chr(197).chr(176) => 'U', chr(197).chr(177) => 'u',
638
+			chr(197).chr(178) => 'U', chr(197).chr(179) => 'u',
639
+			chr(197).chr(180) => 'W', chr(197).chr(181) => 'w',
640
+			chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y',
641
+			chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z',
642
+			chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z',
643
+			chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z',
644
+			chr(197).chr(190) => 'z', chr(197).chr(191) => 's'
645 645
 		);
646 646
 		$string = strtr($string, $chars);
647 647
 		return $string;
Please login to merge, or discard this patch.
Spacing   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -14,12 +14,12 @@  discard block
 block discarded – undo
14 14
 	* @param Array $headers header to submit with the form
15 15
 	* @return String the result
16 16
 	*/
17
-	public function getData($url, $type = 'get', $data = '', $headers = '',$cookie = '',$referer = '',$timeout = '',$useragent = '', $sizelimit = false, $async = false) {
17
+	public function getData($url, $type = 'get', $data = '', $headers = '', $cookie = '', $referer = '', $timeout = '', $useragent = '', $sizelimit = false, $async = false) {
18 18
 		global $globalProxy, $globalForceIPv4;
19 19
 		$ch = curl_init();
20 20
 		curl_setopt($ch, CURLOPT_URL, $url);
21 21
 		if (isset($globalForceIPv4) && $globalForceIPv4) {
22
-			if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')){
22
+			if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')) {
23 23
 				curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
24 24
 			}
25 25
 		}
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
30 30
 		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
31 31
 		curl_setopt($ch, CURLINFO_HEADER_OUT, true); 
32
-		curl_setopt($ch,CURLOPT_ENCODING , "gzip");
32
+		curl_setopt($ch, CURLOPT_ENCODING, "gzip");
33 33
 		//curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5');
34 34
 //		curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0');
35 35
 		if ($useragent == '') {
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
 		}
40 40
 		if ($timeout == '') curl_setopt($ch, CURLOPT_TIMEOUT, 10); 
41 41
 		else curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); 
42
-		curl_setopt($ch, CURLOPT_HEADERFUNCTION, array('Common',"curlResponseHeaderCallback"));
42
+		curl_setopt($ch, CURLOPT_HEADERFUNCTION, array('Common', "curlResponseHeaderCallback"));
43 43
 		if ($type == 'post') {
44 44
 			curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
45 45
 			if (is_array($data)) {
46 46
 				curl_setopt($ch, CURLOPT_POST, count($data));
47 47
 				$data_string = '';
48
-				foreach($data as $key=>$value) { $data_string .= $key.'='.$value.'&'; }
48
+				foreach ($data as $key=>$value) { $data_string .= $key.'='.$value.'&'; }
49 49
 				rtrim($data_string, '&');
50 50
 				curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
51 51
 			} else {
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		}
58 58
 		if ($cookie != '') {
59 59
 			if (is_array($cookie)) {
60
-				curl_setopt($ch, CURLOPT_COOKIE, implode($cookie,';'));
60
+				curl_setopt($ch, CURLOPT_COOKIE, implode($cookie, ';'));
61 61
 			} else {
62 62
 				curl_setopt($ch, CURLOPT_COOKIE, $cookie);
63 63
 			}
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 		if ($sizelimit === true) {
69 69
 			curl_setopt($ch, CURLOPT_BUFFERSIZE, 128);
70 70
 			curl_setopt($ch, CURLOPT_NOPROGRESS, false);
71
-			curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, function($curlr,$downloadsize, $downloaded, $uploadsize, $uploaded){
71
+			curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, function($curlr, $downloadsize, $downloaded, $uploadsize, $uploaded) {
72 72
 				return ($downloaded > (3*1024)) ? 1 : 0;
73 73
 			});
74 74
 		}
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
 		$result = curl_exec($ch);
80 80
 		$info = curl_getinfo($ch);
81 81
 		curl_close($ch);
82
-		if ($info['http_code'] == '503' && strstr($result,'DDoS protection by CloudFlare')) {
82
+		if ($info['http_code'] == '503' && strstr($result, 'DDoS protection by CloudFlare')) {
83 83
 			echo "Cloudflare Detected\n";
84 84
 			require_once(dirname(__FILE__).'/libs/cloudflare-bypass/libraries/cloudflareClass.php');
85 85
 			$useragent = UAgent::random();
86 86
 			cloudflare::useUserAgent($useragent);
87 87
 			if ($clearanceCookie = cloudflare::bypass($url)) {
88
-				return $this->getData($url,'get',$data,$headers,$clearanceCookie,$referer,$timeout,$useragent);
88
+				return $this->getData($url, 'get', $data, $headers, $clearanceCookie, $referer, $timeout, $useragent);
89 89
 			}
90 90
 		} else {
91 91
 			return $result;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
110 110
 		if ($referer != '') curl_setopt($ch, CURLOPT_REFERER, $referer);
111 111
 		if (isset($globalForceIPv4) && $globalForceIPv4) {
112
-			if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')){
112
+			if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')) {
113 113
 				curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
114 114
 			}
115 115
 		}
@@ -124,20 +124,20 @@  discard block
 block discarded – undo
124 124
 		fclose($fp);
125 125
 	}
126 126
 
127
-	public static function gunzip($in_file,$out_file_name = '') {
127
+	public static function gunzip($in_file, $out_file_name = '') {
128 128
 		//echo $in_file.' -> '.$out_file_name."\n";
129 129
 		$buffer_size = 4096; // read 4kb at a time
130 130
 		if ($out_file_name == '') $out_file_name = str_replace('.gz', '', $in_file); 
131 131
 		if ($in_file != '' && file_exists($in_file)) {
132 132
 			// PHP version of Ubuntu use gzopen64 instead of gzopen
133
-			if (function_exists('gzopen')) $file = gzopen($in_file,'rb');
134
-			elseif (function_exists('gzopen64')) $file = gzopen64($in_file,'rb');
133
+			if (function_exists('gzopen')) $file = gzopen($in_file, 'rb');
134
+			elseif (function_exists('gzopen64')) $file = gzopen64($in_file, 'rb');
135 135
 			else {
136 136
 				echo 'gzopen not available';
137 137
 				die;
138 138
 			}
139 139
 			$out_file = fopen($out_file_name, 'wb'); 
140
-			while(!gzeof($file)) {
140
+			while (!gzeof($file)) {
141 141
 				fwrite($out_file, gzread($file, $buffer_size));
142 142
 			}  
143 143
 			fclose($out_file);
@@ -145,19 +145,19 @@  discard block
 block discarded – undo
145 145
 		}
146 146
 	}
147 147
 
148
-	public static function bunzip2($in_file,$out_file_name = '') {
148
+	public static function bunzip2($in_file, $out_file_name = '') {
149 149
 		//echo $in_file.' -> '.$out_file_name."\n";
150 150
 		$buffer_size = 4096; // read 4kb at a time
151 151
 		if ($out_file_name == '') $out_file_name = str_replace('.bz2', '', $in_file); 
152 152
 		if ($in_file != '' && file_exists($in_file)) {
153 153
 			// PHP version of Ubuntu use gzopen64 instead of gzopen
154
-			if (function_exists('bzopen')) $file = bzopen($in_file,'rb');
154
+			if (function_exists('bzopen')) $file = bzopen($in_file, 'rb');
155 155
 			else {
156 156
 				echo 'bzopen not available';
157 157
 				die;
158 158
 			}
159 159
 			$out_file = fopen($out_file_name, 'wb'); 
160
-			while(!feof($file)) {
160
+			while (!feof($file)) {
161 161
 				fwrite($out_file, bzread($file, $buffer_size));
162 162
 			}  
163 163
 			fclose($out_file);
@@ -175,27 +175,27 @@  discard block
 block discarded – undo
175 175
 		if ($data == '') return array();
176 176
 		$html = str_get_html($data);
177 177
 		if ($html === false) return array();
178
-		$tabledata=array();
179
-		foreach($html->find('tr') as $element)
178
+		$tabledata = array();
179
+		foreach ($html->find('tr') as $element)
180 180
 		{
181 181
 			$td = array();
182
-			foreach( $element->find('th') as $row)
182
+			foreach ($element->find('th') as $row)
183 183
 			{
184 184
 				$td [] = trim($row->plaintext);
185 185
 			}
186
-			$td=array_filter($td);
186
+			$td = array_filter($td);
187 187
 			$tabledata[] = $td;
188 188
 
189 189
 			$td = array();
190 190
 			$tdi = array();
191
-			foreach( $element->find('td') as $row)
191
+			foreach ($element->find('td') as $row)
192 192
 			{
193 193
 				$td [] = trim($row->plaintext);
194 194
 				$tdi [] = trim($row->innertext);
195 195
 			}
196
-			$td=array_filter($td);
197
-			$tdi=array_filter($tdi);
198
-			$tabledata[]=array_merge($td,$tdi);
196
+			$td = array_filter($td);
197
+			$tdi = array_filter($tdi);
198
+			$tabledata[] = array_merge($td, $tdi);
199 199
 		}
200 200
 		$html->clear();
201 201
 		unset($html);
@@ -210,8 +210,8 @@  discard block
 block discarded – undo
210 210
 	public function text2array($data) {
211 211
 		$html = str_get_html($data);
212 212
 		if ($html === false) return array();
213
-		$tabledata=array();
214
-		foreach($html->find('p') as $element)
213
+		$tabledata = array();
214
+		foreach ($html->find('p') as $element)
215 215
 		{
216 216
 			$tabledata [] = trim($element->plaintext);
217 217
 		}
@@ -231,11 +231,11 @@  discard block
 block discarded – undo
231 231
 	*/
232 232
 	public function distance($lat, $lon, $latc, $lonc, $unit = 'km') {
233 233
 		if ($lat == $latc && $lon == $lonc) return 0;
234
-		$dist = rad2deg(acos(sin(deg2rad(floatval($lat)))*sin(deg2rad(floatval($latc)))+ cos(deg2rad(floatval($lat)))*cos(deg2rad(floatval($latc)))*cos(deg2rad(floatval($lon)-floatval($lonc)))))*60*1.1515;
234
+		$dist = rad2deg(acos(sin(deg2rad(floatval($lat)))*sin(deg2rad(floatval($latc))) + cos(deg2rad(floatval($lat)))*cos(deg2rad(floatval($latc)))*cos(deg2rad(floatval($lon) - floatval($lonc)))))*60*1.1515;
235 235
 		if ($unit == "km") {
236
-			return round($dist * 1.609344);
236
+			return round($dist*1.609344);
237 237
 		} elseif ($unit == "m") {
238
-			return round($dist * 1.609344 * 1000);
238
+			return round($dist*1.609344*1000);
239 239
 		} elseif ($unit == "mile" || $unit == "mi") {
240 240
 			return round($dist);
241 241
 		} elseif ($unit == "nm") {
@@ -252,8 +252,8 @@  discard block
 block discarded – undo
252 252
 	* @param String $distance distance between two points in m
253 253
 	* @return Float plunge
254 254
 	*/
255
-	public function plunge($initial_altitude,$final_altitude,$distance) {
256
-		$plunge = rad2deg(asin(($final_altitude-$initial_altitude)/$distance));
255
+	public function plunge($initial_altitude, $final_altitude, $distance) {
256
+		$plunge = rad2deg(asin(($final_altitude - $initial_altitude)/$distance));
257 257
 		return $plunge;
258 258
 	}
259 259
 
@@ -268,8 +268,8 @@  discard block
 block discarded – undo
268 268
 	public function azimuth($lat, $lon, $latc, $lonc) {
269 269
 		$dX = $latc - $lat;
270 270
 		$dY = $lonc - $lon;
271
-		$azimuth = rad2deg(atan2($dY,$dX));
272
-		if ($azimuth < 0) return $azimuth+360;
271
+		$azimuth = rad2deg(atan2($dY, $dX));
272
+		if ($azimuth < 0) return $azimuth + 360;
273 273
 		return $azimuth;
274 274
 	}
275 275
 	
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	* @param float $distance distance covered
281 281
 	* @return whether distance is realistic
282 282
 	*/
283
-	public function withinThreshold ($timeDifference, $distance) {
283
+	public function withinThreshold($timeDifference, $distance) {
284 284
 		$x = abs($timeDifference);
285 285
 		$d = abs($distance);
286 286
 		if ($x == 0 || $d == 0) return true;
@@ -296,12 +296,12 @@  discard block
 block discarded – undo
296 296
 		return ($array !== array_values($array));
297 297
 	}
298 298
 
299
-	public function isInteger($input){
299
+	public function isInteger($input) {
300 300
 	    return(ctype_digit(strval($input)));
301 301
 	}
302 302
 
303 303
 
304
-	public function convertDec($dms,$latlong) {
304
+	public function convertDec($dms, $latlong) {
305 305
 		if ($latlong == 'latitude') {
306 306
 			$deg = substr($dms, 0, 2);
307 307
 			$min = substr($dms, 2, 4);
@@ -309,10 +309,10 @@  discard block
 block discarded – undo
309 309
 			$deg = substr($dms, 0, 3);
310 310
 			$min = substr($dms, 3, 5);
311 311
 		}
312
-		return $deg+(($min*60)/3600);
312
+		return $deg + (($min*60)/3600);
313 313
 	}
314 314
 	
315
-	public function convertDM($coord,$latlong) {
315
+	public function convertDM($coord, $latlong) {
316 316
 		if ($latlong == 'latitude') {
317 317
 			if ($coord < 0) $NSEW = 'S';
318 318
 			else $NSEW = 'N';
@@ -322,9 +322,9 @@  discard block
 block discarded – undo
322 322
 		}
323 323
 		$coord = abs($coord);
324 324
 		$deg = floor($coord);
325
-		$coord = ($coord-$deg)*60;
325
+		$coord = ($coord - $deg)*60;
326 326
 		$min = $coord;
327
-		return array('deg' => $deg,'min' => $min,'NSEW' => $NSEW);
327
+		return array('deg' => $deg, 'min' => $min, 'NSEW' => $NSEW);
328 328
 	}
329 329
 	
330 330
 	/**
@@ -336,8 +336,8 @@  discard block
 block discarded – undo
336 336
 	public function xcopy($source, $dest)
337 337
 	{
338 338
 		$files = glob($source.'*.*');
339
-		foreach($files as $file){
340
-			$file_to_go = str_replace($source,$dest,$file);
339
+		foreach ($files as $file) {
340
+			$file_to_go = str_replace($source, $dest, $file);
341 341
 			copy($file, $file_to_go);
342 342
 		}
343 343
 		return true;
@@ -348,9 +348,9 @@  discard block
 block discarded – undo
348 348
 	* @param	String $url url to check
349 349
 	* @return	bool Return true on succes false on failure
350 350
 	*/
351
-	public function urlexist($url){
352
-		$headers=get_headers($url);
353
-		return stripos($headers[0],"200 OK")?true:false;
351
+	public function urlexist($url) {
352
+		$headers = get_headers($url);
353
+		return stripos($headers[0], "200 OK") ?true:false;
354 354
 	}
355 355
 	
356 356
 	/**
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 	public function hex2str($hex) {
362 362
 		$str = '';
363 363
 		$hexln = strlen($hex);
364
-		for($i=0;$i<$hexln;$i+=2) $str .= chr(hexdec(substr($hex,$i,2)));
364
+		for ($i = 0; $i < $hexln; $i += 2) $str .= chr(hexdec(substr($hex, $i, 2)));
365 365
 		return $str;
366 366
 	}
367 367
 	
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 	* @return	String Return result
372 372
 	*/
373 373
 	public function hex2rgb($hex) {
374
-		$hex = str_replace('#','',$hex);
374
+		$hex = str_replace('#', '', $hex);
375 375
 		return sscanf($hex, "%02x%02x%02x"); 
376 376
 	}
377 377
 	
@@ -379,33 +379,33 @@  discard block
 block discarded – undo
379 379
 		//difference in longitudinal coordinates
380 380
 		$dLon = deg2rad($lon2) - deg2rad($lon1);
381 381
 		//difference in the phi of latitudinal coordinates
382
-		$dPhi = log(tan(deg2rad($lat2) / 2 + pi() / 4) / tan(deg2rad($lat1) / 2 + pi() / 4));
382
+		$dPhi = log(tan(deg2rad($lat2)/2 + pi()/4)/tan(deg2rad($lat1)/2 + pi()/4));
383 383
 		//we need to recalculate $dLon if it is greater than pi
384
-		if(abs($dLon) > pi()) {
385
-			if($dLon > 0) {
386
-				$dLon = (2 * pi() - $dLon) * -1;
384
+		if (abs($dLon) > pi()) {
385
+			if ($dLon > 0) {
386
+				$dLon = (2*pi() - $dLon)*-1;
387 387
 			} else {
388
-				$dLon = 2 * pi() + $dLon;
388
+				$dLon = 2*pi() + $dLon;
389 389
 			}
390 390
 		}
391 391
 		//return the angle, normalized
392
-		return (rad2deg(atan2($dLon, $dPhi)) + 360) % 360;
392
+		return (rad2deg(atan2($dLon, $dPhi)) + 360)%360;
393 393
 	}
394 394
 
395
-	public function checkLine($lat1,$lon1,$lat2,$lon2,$lat3,$lon3,$approx = 0.15) {
395
+	public function checkLine($lat1, $lon1, $lat2, $lon2, $lat3, $lon3, $approx = 0.15) {
396 396
 		//$a = ($lon2-$lon1)*$lat3+($lat2-$lat1)*$lon3+($lat1*$lon2+$lat2*$lon1);
397
-		$a = -($lon2-$lon1);
397
+		$a = -($lon2 - $lon1);
398 398
 		$b = $lat2 - $lat1;
399
-		$c = -($a*$lat1+$b*$lon1);
400
-		$d = $a*$lat3+$b*$lon3+$c;
399
+		$c = -($a*$lat1 + $b*$lon1);
400
+		$d = $a*$lat3 + $b*$lon3 + $c;
401 401
 		if ($d > -$approx && $d < $approx) return true;
402 402
 		else return false;
403 403
 	}
404 404
 	
405 405
 	public function array_merge_noappend() {
406 406
 		$output = array();
407
-		foreach(func_get_args() as $array) {
408
-			foreach($array as $key => $value) {
407
+		foreach (func_get_args() as $array) {
408
+			foreach ($array as $key => $value) {
409 409
 				$output[$key] = isset($output[$key]) ?
410 410
 				array_merge($output[$key], $value) : $value;
411 411
 			}
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 		return $result;
470 470
 	}
471 471
 
472
-	public function nextcoord($latitude, $longitude, $speed, $heading, $archivespeed = 1, $seconds = ''){
472
+	public function nextcoord($latitude, $longitude, $speed, $heading, $archivespeed = 1, $seconds = '') {
473 473
 		global $globalMapRefresh;
474 474
 		if ($seconds == '') {
475 475
 			$distance = ($speed*0.514444*$globalMapRefresh*$archivespeed)/1000;
@@ -480,27 +480,27 @@  discard block
 block discarded – undo
480 480
 		$latitude = deg2rad($latitude);
481 481
 		$longitude = deg2rad($longitude);
482 482
 		$bearing = deg2rad($heading); 
483
-		$latitude2 =  asin( (sin($latitude) * cos($distance/$r)) + (cos($latitude) * sin($distance/$r) * cos($bearing)) );
484
-		$longitude2 = $longitude + atan2( sin($bearing)*sin($distance/$r)*cos($latitude), cos($distance/$r)-(sin($latitude)*sin($latitude2)) );
485
-		return array('latitude' => number_format(rad2deg($latitude2),5,'.',''),'longitude' => number_format(rad2deg($longitude2),5,'.',''));
483
+		$latitude2 = asin((sin($latitude)*cos($distance/$r)) + (cos($latitude)*sin($distance/$r)*cos($bearing)));
484
+		$longitude2 = $longitude + atan2(sin($bearing)*sin($distance/$r)*cos($latitude), cos($distance/$r) - (sin($latitude)*sin($latitude2)));
485
+		return array('latitude' => number_format(rad2deg($latitude2), 5, '.', ''), 'longitude' => number_format(rad2deg($longitude2), 5, '.', ''));
486 486
 	}
487 487
 	
488
-	public function getCoordfromDistanceBearing($latitude,$longitude,$bearing,$distance) {
488
+	public function getCoordfromDistanceBearing($latitude, $longitude, $bearing, $distance) {
489 489
 		// distance in meter
490 490
 		$R = 6378.14;
491
-		$latitude1 = $latitude * (M_PI/180);
492
-		$longitude1 = $longitude * (M_PI/180);
493
-		$brng = $bearing * (M_PI/180);
491
+		$latitude1 = $latitude*(M_PI/180);
492
+		$longitude1 = $longitude*(M_PI/180);
493
+		$brng = $bearing*(M_PI/180);
494 494
 		$d = $distance;
495 495
 
496 496
 		$latitude2 = asin(sin($latitude1)*cos($d/$R) + cos($latitude1)*sin($d/$R)*cos($brng));
497
-		$longitude2 = $longitude1 + atan2(sin($brng)*sin($d/$R)*cos($latitude1),cos($d/$R)-sin($latitude1)*sin($latitude2));
497
+		$longitude2 = $longitude1 + atan2(sin($brng)*sin($d/$R)*cos($latitude1), cos($d/$R) - sin($latitude1)*sin($latitude2));
498 498
 
499
-		$latitude2 = $latitude2 * (180/M_PI);
500
-		$longitude2 = $longitude2 * (180/M_PI);
499
+		$latitude2 = $latitude2*(180/M_PI);
500
+		$longitude2 = $longitude2*(180/M_PI);
501 501
 
502
-		$flat = round ($latitude2,6);
503
-		$flong = round ($longitude2,6);
502
+		$flat = round($latitude2, 6);
503
+		$flong = round($longitude2, 6);
504 504
 /*
505 505
 		$dx = $distance*cos($bearing);
506 506
 		$dy = $distance*sin($bearing);
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 		$flong = $longitude + $dlong;
510 510
 		$flat = $latitude + $dlat;
511 511
 */
512
-		return array('latitude' => $flat,'longitude' => $flong);
512
+		return array('latitude' => $flat, 'longitude' => $flong);
513 513
 	}
514 514
 
515 515
 	/**
@@ -523,14 +523,14 @@  discard block
 block discarded – undo
523 523
 	 * @param integer $level GZIP compression level (default: 9)
524 524
 	 * @return string New filename (with .gz appended) if success, or false if operation fails
525 525
 	 */
526
-	public function gzCompressFile($source, $level = 9){ 
527
-		$dest = $source . '.gz'; 
528
-		$mode = 'wb' . $level; 
526
+	public function gzCompressFile($source, $level = 9) { 
527
+		$dest = $source.'.gz'; 
528
+		$mode = 'wb'.$level; 
529 529
 		$error = false; 
530 530
 		if ($fp_out = gzopen($dest, $mode)) { 
531
-			if ($fp_in = fopen($source,'rb')) { 
531
+			if ($fp_in = fopen($source, 'rb')) { 
532 532
 				while (!feof($fp_in)) 
533
-					gzwrite($fp_out, fread($fp_in, 1024 * 512)); 
533
+					gzwrite($fp_out, fread($fp_in, 1024*512)); 
534 534
 				fclose($fp_in); 
535 535
 			} else {
536 536
 				$error = true; 
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 	} 
547 547
 	
548 548
 	public function remove_accents($string) {
549
-		if ( !preg_match('/[\x80-\xff]/', $string) ) return $string;
549
+		if (!preg_match('/[\x80-\xff]/', $string)) return $string;
550 550
 		$chars = array(
551 551
 		    // Decompositions for Latin-1 Supplement
552 552
 		    chr(195).chr(128) => 'A', chr(195).chr(129) => 'A',
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 		    chr(196).chr(172) => 'I', chr(196).chr(173) => 'i',
604 604
 		    chr(196).chr(174) => 'I', chr(196).chr(175) => 'i',
605 605
 		    chr(196).chr(176) => 'I', chr(196).chr(177) => 'i',
606
-		    chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij',
606
+		    chr(196).chr(178) => 'IJ', chr(196).chr(179) => 'ij',
607 607
 		    chr(196).chr(180) => 'J', chr(196).chr(181) => 'j',
608 608
 		    chr(196).chr(182) => 'K', chr(196).chr(183) => 'k',
609 609
 		    chr(196).chr(184) => 'k', chr(196).chr(185) => 'L',
@@ -619,13 +619,13 @@  discard block
 block discarded – undo
619 619
 		    chr(197).chr(140) => 'O', chr(197).chr(141) => 'o',
620 620
 		    chr(197).chr(142) => 'O', chr(197).chr(143) => 'o',
621 621
 		    chr(197).chr(144) => 'O', chr(197).chr(145) => 'o',
622
-		    chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe',
623
-		    chr(197).chr(148) => 'R',chr(197).chr(149) => 'r',
624
-		    chr(197).chr(150) => 'R',chr(197).chr(151) => 'r',
625
-		    chr(197).chr(152) => 'R',chr(197).chr(153) => 'r',
626
-		    chr(197).chr(154) => 'S',chr(197).chr(155) => 's',
627
-		    chr(197).chr(156) => 'S',chr(197).chr(157) => 's',
628
-		    chr(197).chr(158) => 'S',chr(197).chr(159) => 's',
622
+		    chr(197).chr(146) => 'OE', chr(197).chr(147) => 'oe',
623
+		    chr(197).chr(148) => 'R', chr(197).chr(149) => 'r',
624
+		    chr(197).chr(150) => 'R', chr(197).chr(151) => 'r',
625
+		    chr(197).chr(152) => 'R', chr(197).chr(153) => 'r',
626
+		    chr(197).chr(154) => 'S', chr(197).chr(155) => 's',
627
+		    chr(197).chr(156) => 'S', chr(197).chr(157) => 's',
628
+		    chr(197).chr(158) => 'S', chr(197).chr(159) => 's',
629 629
 		    chr(197).chr(160) => 'S', chr(197).chr(161) => 's',
630 630
 		    chr(197).chr(162) => 'T', chr(197).chr(163) => 't',
631 631
 		    chr(197).chr(164) => 'T', chr(197).chr(165) => 't',
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 		for ($i = 0, $int = '', $concat_flag = true; $i < $length; $i++) {
660 660
 			if (is_numeric($string[$i]) && $concat_flag) {
661 661
 				$int .= $string[$i];
662
-			} elseif(!$concat && $concat_flag && strlen($int) > 0) {
662
+			} elseif (!$concat && $concat_flag && strlen($int) > 0) {
663 663
 				$concat_flag = false;
664 664
 			}
665 665
 		}
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 			$slice = array_slice($arr, $offset + 1, $length);
706 706
 			return implode("", $slice);
707 707
 		} else {
708
-			return mb_substr($string,$offset,$length,'UTF-8');
708
+			return mb_substr($string, $offset, $length, 'UTF-8');
709 709
 		}
710 710
 	}
711 711
 
@@ -715,14 +715,14 @@  discard block
 block discarded – undo
715 715
 		//NOTE: use a trailing slash for folders!!!
716 716
 		//see http://bugs.php.net/bug.php?id=27609
717 717
 		//see http://bugs.php.net/bug.php?id=30931
718
-		if ($path{strlen($path)-1}=='/') // recursively return a temporary file path
718
+		if ($path{strlen($path) - 1} == '/') // recursively return a temporary file path
719 719
 			return $this->is__writable($path.uniqid(mt_rand()).'.tmp');
720 720
 		else if (is_dir($path))
721 721
 			return $this->is__writable($path.'/'.uniqid(mt_rand()).'.tmp');
722 722
 		// check tmp file for read/write capabilities
723 723
 		$rm = file_exists($path);
724 724
 		$f = @fopen($path, 'a');
725
-		if ($f===false)
725
+		if ($f === false)
726 726
 			return false;
727 727
 		fclose($f);
728 728
 		if (!$rm)
Please login to merge, or discard this patch.
Braces   +101 added lines, -45 removed lines patch added patch discarded remove patch
@@ -37,8 +37,11 @@  discard block
 block discarded – undo
37 37
 		} else {
38 38
 			curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
39 39
 		}
40
-		if ($timeout == '') curl_setopt($ch, CURLOPT_TIMEOUT, 10); 
41
-		else curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); 
40
+		if ($timeout == '') {
41
+			curl_setopt($ch, CURLOPT_TIMEOUT, 10);
42
+		} else {
43
+			curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
44
+		}
42 45
 		curl_setopt($ch, CURLOPT_HEADERFUNCTION, array('Common',"curlResponseHeaderCallback"));
43 46
 		if ($type == 'post') {
44 47
 			curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
@@ -95,8 +98,9 @@  discard block
 block discarded – undo
95 98
 	private function curlResponseHeaderCallback($ch, $headerLine) {
96 99
 		//global $cookies;
97 100
 		$cookies = array();
98
-		if (preg_match('/^Set-Cookie:\s*([^;]*)/mi', $headerLine, $cookie) == 1)
99
-			$cookies[] = $cookie;
101
+		if (preg_match('/^Set-Cookie:\s*([^;]*)/mi', $headerLine, $cookie) == 1) {
102
+					$cookies[] = $cookie;
103
+		}
100 104
 		return strlen($headerLine); // Needed by curl
101 105
 	}
102 106
 
@@ -107,7 +111,9 @@  discard block
 block discarded – undo
107 111
 		curl_setopt($ch, CURLOPT_URL, $url);
108 112
 		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
109 113
 		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
110
-		if ($referer != '') curl_setopt($ch, CURLOPT_REFERER, $referer);
114
+		if ($referer != '') {
115
+			curl_setopt($ch, CURLOPT_REFERER, $referer);
116
+		}
111 117
 		if (isset($globalForceIPv4) && $globalForceIPv4) {
112 118
 			if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')){
113 119
 				curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
@@ -119,7 +125,9 @@  discard block
 block discarded – undo
119 125
 		curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5');
120 126
 		curl_setopt($ch, CURLOPT_FILE, $fp);
121 127
 		curl_exec($ch);
122
-		if (curl_errno($ch) && $globalDebug) echo 'Download error: '.curl_error($ch);
128
+		if (curl_errno($ch) && $globalDebug) {
129
+			echo 'Download error: '.curl_error($ch);
130
+		}
123 131
 		curl_close($ch);
124 132
 		fclose($fp);
125 133
 	}
@@ -127,12 +135,16 @@  discard block
 block discarded – undo
127 135
 	public static function gunzip($in_file,$out_file_name = '') {
128 136
 		//echo $in_file.' -> '.$out_file_name."\n";
129 137
 		$buffer_size = 4096; // read 4kb at a time
130
-		if ($out_file_name == '') $out_file_name = str_replace('.gz', '', $in_file); 
138
+		if ($out_file_name == '') {
139
+			$out_file_name = str_replace('.gz', '', $in_file);
140
+		}
131 141
 		if ($in_file != '' && file_exists($in_file)) {
132 142
 			// PHP version of Ubuntu use gzopen64 instead of gzopen
133
-			if (function_exists('gzopen')) $file = gzopen($in_file,'rb');
134
-			elseif (function_exists('gzopen64')) $file = gzopen64($in_file,'rb');
135
-			else {
143
+			if (function_exists('gzopen')) {
144
+				$file = gzopen($in_file,'rb');
145
+			} elseif (function_exists('gzopen64')) {
146
+				$file = gzopen64($in_file,'rb');
147
+			} else {
136 148
 				echo 'gzopen not available';
137 149
 				die;
138 150
 			}
@@ -148,11 +160,14 @@  discard block
 block discarded – undo
148 160
 	public static function bunzip2($in_file,$out_file_name = '') {
149 161
 		//echo $in_file.' -> '.$out_file_name."\n";
150 162
 		$buffer_size = 4096; // read 4kb at a time
151
-		if ($out_file_name == '') $out_file_name = str_replace('.bz2', '', $in_file); 
163
+		if ($out_file_name == '') {
164
+			$out_file_name = str_replace('.bz2', '', $in_file);
165
+		}
152 166
 		if ($in_file != '' && file_exists($in_file)) {
153 167
 			// PHP version of Ubuntu use gzopen64 instead of gzopen
154
-			if (function_exists('bzopen')) $file = bzopen($in_file,'rb');
155
-			else {
168
+			if (function_exists('bzopen')) {
169
+				$file = bzopen($in_file,'rb');
170
+			} else {
156 171
 				echo 'bzopen not available';
157 172
 				die;
158 173
 			}
@@ -171,10 +186,16 @@  discard block
 block discarded – undo
171 186
 	* @return Array array of the tables in HTML page
172 187
 	*/
173 188
 	public function table2array($data) {
174
-		if (!is_string($data)) return array();
175
-		if ($data == '') return array();
189
+		if (!is_string($data)) {
190
+			return array();
191
+		}
192
+		if ($data == '') {
193
+			return array();
194
+		}
176 195
 		$html = str_get_html($data);
177
-		if ($html === false) return array();
196
+		if ($html === false) {
197
+			return array();
198
+		}
178 199
 		$tabledata=array();
179 200
 		foreach($html->find('tr') as $element)
180 201
 		{
@@ -209,7 +230,9 @@  discard block
 block discarded – undo
209 230
 	*/
210 231
 	public function text2array($data) {
211 232
 		$html = str_get_html($data);
212
-		if ($html === false) return array();
233
+		if ($html === false) {
234
+			return array();
235
+		}
213 236
 		$tabledata=array();
214 237
 		foreach($html->find('p') as $element)
215 238
 		{
@@ -230,7 +253,9 @@  discard block
 block discarded – undo
230 253
 	* @return Float Distance in $unit
231 254
 	*/
232 255
 	public function distance($lat, $lon, $latc, $lonc, $unit = 'km') {
233
-		if ($lat == $latc && $lon == $lonc) return 0;
256
+		if ($lat == $latc && $lon == $lonc) {
257
+			return 0;
258
+		}
234 259
 		$dist = rad2deg(acos(sin(deg2rad(floatval($lat)))*sin(deg2rad(floatval($latc)))+ cos(deg2rad(floatval($lat)))*cos(deg2rad(floatval($latc)))*cos(deg2rad(floatval($lon)-floatval($lonc)))))*60*1.1515;
235 260
 		if ($unit == "km") {
236 261
 			return round($dist * 1.609344);
@@ -269,7 +294,9 @@  discard block
 block discarded – undo
269 294
 		$dX = $latc - $lat;
270 295
 		$dY = $lonc - $lon;
271 296
 		$azimuth = rad2deg(atan2($dY,$dX));
272
-		if ($azimuth < 0) return $azimuth+360;
297
+		if ($azimuth < 0) {
298
+			return $azimuth+360;
299
+		}
273 300
 		return $azimuth;
274 301
 	}
275 302
 	
@@ -283,10 +310,16 @@  discard block
 block discarded – undo
283 310
 	public function withinThreshold ($timeDifference, $distance) {
284 311
 		$x = abs($timeDifference);
285 312
 		$d = abs($distance);
286
-		if ($x == 0 || $d == 0) return true;
313
+		if ($x == 0 || $d == 0) {
314
+			return true;
315
+		}
287 316
 		// may be due to Internet jitter; distance is realistic
288
-		if ($x < 0.7 && $d < 2000) return true;
289
-		else return $d/$x < 1500*0.27778; // 1500 km/h max
317
+		if ($x < 0.7 && $d < 2000) {
318
+			return true;
319
+		} else {
320
+			return $d/$x < 1500*0.27778;
321
+		}
322
+		// 1500 km/h max
290 323
 	}
291 324
 
292 325
 
@@ -314,11 +347,17 @@  discard block
 block discarded – undo
314 347
 	
315 348
 	public function convertDM($coord,$latlong) {
316 349
 		if ($latlong == 'latitude') {
317
-			if ($coord < 0) $NSEW = 'S';
318
-			else $NSEW = 'N';
350
+			if ($coord < 0) {
351
+				$NSEW = 'S';
352
+			} else {
353
+				$NSEW = 'N';
354
+			}
319 355
 		} else {
320
-			if ($coord < 0) $NSEW = 'W';
321
-			else $NSEW = 'E';
356
+			if ($coord < 0) {
357
+				$NSEW = 'W';
358
+			} else {
359
+				$NSEW = 'E';
360
+			}
322 361
 		}
323 362
 		$coord = abs($coord);
324 363
 		$deg = floor($coord);
@@ -361,7 +400,9 @@  discard block
 block discarded – undo
361 400
 	public function hex2str($hex) {
362 401
 		$str = '';
363 402
 		$hexln = strlen($hex);
364
-		for($i=0;$i<$hexln;$i+=2) $str .= chr(hexdec(substr($hex,$i,2)));
403
+		for($i=0;$i<$hexln;$i+=2) {
404
+			$str .= chr(hexdec(substr($hex,$i,2)));
405
+		}
365 406
 		return $str;
366 407
 	}
367 408
 	
@@ -398,8 +439,11 @@  discard block
 block discarded – undo
398 439
 		$b = $lat2 - $lat1;
399 440
 		$c = -($a*$lat1+$b*$lon1);
400 441
 		$d = $a*$lat3+$b*$lon3+$c;
401
-		if ($d > -$approx && $d < $approx) return true;
402
-		else return false;
442
+		if ($d > -$approx && $d < $approx) {
443
+			return true;
444
+		} else {
445
+			return false;
446
+		}
403 447
 	}
404 448
 	
405 449
 	public function array_merge_noappend() {
@@ -458,7 +502,9 @@  discard block
 block discarded – undo
458 502
 			return $result;
459 503
 		}
460 504
 		$handle = @opendir('./locale');
461
-		if ($handle === false) return $result;
505
+		if ($handle === false) {
506
+			return $result;
507
+		}
462 508
 		while (false !== ($file = readdir($handle))) {
463 509
 			$path = './locale'.'/'.$file.'/LC_MESSAGES/fam.mo';
464 510
 			if ($file != "." && $file != ".." && @file_exists($path)) {
@@ -529,8 +575,9 @@  discard block
 block discarded – undo
529 575
 		$error = false; 
530 576
 		if ($fp_out = gzopen($dest, $mode)) { 
531 577
 			if ($fp_in = fopen($source,'rb')) { 
532
-				while (!feof($fp_in)) 
533
-					gzwrite($fp_out, fread($fp_in, 1024 * 512)); 
578
+				while (!feof($fp_in)) {
579
+									gzwrite($fp_out, fread($fp_in, 1024 * 512));
580
+				}
534 581
 				fclose($fp_in); 
535 582
 			} else {
536 583
 				$error = true; 
@@ -539,14 +586,17 @@  discard block
 block discarded – undo
539 586
 		} else {
540 587
 			$error = true; 
541 588
 		}
542
-		if ($error)
543
-			return false; 
544
-		else
545
-			return $dest; 
589
+		if ($error) {
590
+					return false;
591
+		} else {
592
+					return $dest;
593
+		}
546 594
 	} 
547 595
 	
548 596
 	public function remove_accents($string) {
549
-		if ( !preg_match('/[\x80-\xff]/', $string) ) return $string;
597
+		if ( !preg_match('/[\x80-\xff]/', $string) ) {
598
+			return $string;
599
+		}
550 600
 		$chars = array(
551 601
 		    // Decompositions for Latin-1 Supplement
552 602
 		    chr(195).chr(128) => 'A', chr(195).chr(129) => 'A',
@@ -670,7 +720,9 @@  discard block
 block discarded – undo
670 720
 		$ip = gethostbyname($host);
671 721
 		$s = socket_create(AF_INET, SOCK_STREAM, 0);
672 722
 		$r = @socket_connect($s, $ip, $port);
673
-		if (!socket_set_nonblock($s)) echo "Unable to set nonblock on socket\n";
723
+		if (!socket_set_nonblock($s)) {
724
+			echo "Unable to set nonblock on socket\n";
725
+		}
674 726
 		if ($r || socket_last_error() == 114 || socket_last_error() == 115) {
675 727
 			return $s;
676 728
 		}
@@ -715,18 +767,22 @@  discard block
 block discarded – undo
715 767
 		//NOTE: use a trailing slash for folders!!!
716 768
 		//see http://bugs.php.net/bug.php?id=27609
717 769
 		//see http://bugs.php.net/bug.php?id=30931
718
-		if ($path{strlen($path)-1}=='/') // recursively return a temporary file path
770
+		if ($path{strlen($path)-1}=='/') {
771
+			// recursively return a temporary file path
719 772
 			return $this->is__writable($path.uniqid(mt_rand()).'.tmp');
720
-		else if (is_dir($path))
721
-			return $this->is__writable($path.'/'.uniqid(mt_rand()).'.tmp');
773
+		} else if (is_dir($path)) {
774
+					return $this->is__writable($path.'/'.uniqid(mt_rand()).'.tmp');
775
+		}
722 776
 		// check tmp file for read/write capabilities
723 777
 		$rm = file_exists($path);
724 778
 		$f = @fopen($path, 'a');
725
-		if ($f===false)
726
-			return false;
779
+		if ($f===false) {
780
+					return false;
781
+		}
727 782
 		fclose($f);
728
-		if (!$rm)
729
-			unlink($path);
783
+		if (!$rm) {
784
+					unlink($path);
785
+		}
730 786
 		return true;
731 787
 	}
732 788
 }
Please login to merge, or discard this patch.
require/class.TSK.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 class TSK {
4 4
 	public function parse_xml($url) {
5 5
 		$Common = new Common();
6
-		$filedata = $Common->getData($url,'get','','','','','','',true);
6
+		$filedata = $Common->getData($url, 'get', '', '', '', '', '', '', true);
7 7
 		if ($filedata != '' && $filedata !== false) {
8 8
 			$xml = simplexml_load_string($filedata);
9 9
 			if ($xml !== false) {
Please login to merge, or discard this patch.
js/map.3d.js.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -329,15 +329,15 @@  discard block
 block discarded – undo
329 329
     }
330 330
 
331 331
 <?php
332
-    if (isset($globalMapUseBbox) && $globalMapUseBbox) {
332
+	if (isset($globalMapUseBbox) && $globalMapUseBbox) {
333 333
 ?>
334 334
     var loc_geojson = Cesium.loadJson("<?php print $globalURL; ?>/location-geojson.php?coord="+bbox());
335 335
 <?php
336
-    } else {
336
+	} else {
337 337
 ?>
338 338
     var loc_geojson = Cesium.loadJson("<?php print $globalURL; ?>/location-geojson.php");
339 339
 <?php
340
-    }
340
+	}
341 341
 ?>
342 342
     loc_geojson.then(function(geojsondata) {
343 343
 	loc = new Cesium.CustomDataSource('location');
@@ -560,11 +560,11 @@  discard block
 block discarded – undo
560 560
 }
561 561
 
562 562
 <?php
563
-    if (isset($globalTSK) && $globalTSK && isset($_GET['tsk'])) {
563
+	if (isset($globalTSK) && $globalTSK && isset($_GET['tsk'])) {
564 564
 ?>
565 565
 update_tsk();
566 566
 <?php
567
-    }
567
+	}
568 568
 ?>
569 569
 
570 570
 update_locationsLayer();
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 	}
370 370
     }
371 371
 
372
-    var tsk_geojson = Cesium.loadJson("<?php print $globalURL; ?>/tsk-geojson.php?tsk=<?php print filter_input(INPUT_GET,'tsk',FILTER_SANITIZE_URL); ?>");
372
+    var tsk_geojson = Cesium.loadJson("<?php print $globalURL; ?>/tsk-geojson.php?tsk=<?php print filter_input(INPUT_GET, 'tsk', FILTER_SANITIZE_URL); ?>");
373 373
     tsk_geojson.then(function(geojsondata) {
374 374
 	tsk = new Cesium.CustomDataSource('tsk');
375 375
 	for (var i =0;i < geojsondata.features.length; i++) {
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 <?php
457 457
 	if (isset($_COOKIE['lastcentercoord']) || (isset($globalCenterLatitude) && isset($globalCenterLongitude) && $globalCenterLatitude != '' && $globalCenterLongitude != '')) {
458 458
 		if (isset($_COOKIE['lastcentercoord'])) {
459
-			$lastcentercoord = explode(',',$_COOKIE['lastcentercoord']);
459
+			$lastcentercoord = explode(',', $_COOKIE['lastcentercoord']);
460 460
 			if (!isset($lastcentercoord[3])) $zoom = $lastcentercoord[2]*1000000.0;
461 461
 			else $zoom = $lastcentercoord[3];
462 462
 			$viewcenterlatitude = $lastcentercoord[0];
Please login to merge, or discard this patch.
Braces   +40 added lines, -13 removed lines patch added patch discarded remove patch
@@ -5,21 +5,30 @@  discard block
 block discarded – undo
5 5
 
6 6
 document.cookie =  'MapFormat=3d; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'
7 7
 <?php
8
-	if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType'];
9
-	else $MapType = $globalMapProvider;
8
+	if (isset($_COOKIE['MapType'])) {
9
+		$MapType = $_COOKIE['MapType'];
10
+	} else {
11
+		$MapType = $globalMapProvider;
12
+	}
10 13
 
11 14
 //	unset($_COOKIE['MapType']);
12 15
 	if ($MapType != 'Mapbox' && $MapType != 'OpenStreetMap' && $MapType != 'Bing-Aerial' && $MapType != 'Bing-Hybrid' && $MapType != 'Bing-Road') {
13
-		if (isset($globalBingMapKey) && $globalBingMapKey != '') $MapType = 'Bing-Aerial';
14
-		else $MapType = 'OpenStreetMap';
16
+		if (isset($globalBingMapKey) && $globalBingMapKey != '') {
17
+			$MapType = 'Bing-Aerial';
18
+		} else {
19
+			$MapType = 'OpenStreetMap';
20
+		}
15 21
 	}
16 22
 	if (($MapType == 'Bing-Aerial' || $MapType == 'Bing-Hybrid' || $MapType == 'Bing-Road') && (!isset($globalBingMapKey) || $globalBingMapKey == '')) {
17 23
 		$MapType = 'OpenStreetMap';
18 24
 	}
19 25
 	if ($MapType == 'Mapbox') {
20
-		if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId;
21
-		else $MapBoxId = $_COOKIE['MapTypeId'];
22
-?>
26
+		if ($_COOKIE['MapTypeId'] == 'default') {
27
+			$MapBoxId = $globalMapboxId;
28
+		} else {
29
+			$MapBoxId = $_COOKIE['MapTypeId'];
30
+		}
31
+		?>
23 32
 	var imProv = Cesium.MapboxImageryProvider({
24 33
 		credit: 'Map data © OpenStreetMap contributors, ' +
25 34
 	      'CC-BY-SA, ' +
@@ -124,13 +133,23 @@  discard block
 block discarded – undo
124 133
 */
125 134
 ?>
126 135
 <?php
127
-	}  elseif (isset($globalMapCustomLayer[$MapType])) {
136
+	} elseif (isset($globalMapCustomLayer[$MapType])) {
128 137
 		$customid = $MapType;
129 138
 ?>
130 139
 	var imProv = Cesium.createOpenStreetMapImageryProvider({
131 140
 		url : '<?php print $globalMapCustomLayer[$customid]['url']; ?>',
132
-		maximumLevel: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '99'; ?>,
133
-		minimumLevel: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>,
141
+		maximumLevel: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) {
142
+	print $globalMapCustomLayer[$customid]['maxZoom'];
143
+} else {
144
+	print '99';
145
+}
146
+?>,
147
+		minimumLevel: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) {
148
+	print $globalMapCustomLayer[$customid]['minZoom'];
149
+} else {
150
+	print '0';
151
+}
152
+?>,
134 153
 		credit: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
135 154
 	});
136 155
 <?php
@@ -457,8 +476,11 @@  discard block
 block discarded – undo
457 476
 	if (isset($_COOKIE['lastcentercoord']) || (isset($globalCenterLatitude) && isset($globalCenterLongitude) && $globalCenterLatitude != '' && $globalCenterLongitude != '')) {
458 477
 		if (isset($_COOKIE['lastcentercoord'])) {
459 478
 			$lastcentercoord = explode(',',$_COOKIE['lastcentercoord']);
460
-			if (!isset($lastcentercoord[3])) $zoom = $lastcentercoord[2]*1000000.0;
461
-			else $zoom = $lastcentercoord[3];
479
+			if (!isset($lastcentercoord[3])) {
480
+				$zoom = $lastcentercoord[2]*1000000.0;
481
+			} else {
482
+				$zoom = $lastcentercoord[3];
483
+			}
462 484
 			$viewcenterlatitude = $lastcentercoord[0];
463 485
 			$viewcenterlongitude = $lastcentercoord[1];
464 486
 		} else {
@@ -568,7 +590,12 @@  discard block
 block discarded – undo
568 590
 ?>
569 591
 
570 592
 update_locationsLayer();
571
-setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>);
593
+setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) {
594
+	print $globalMapRefresh*1000*2;
595
+} else {
596
+	print '60000';
597
+}
598
+?>);
572 599
 /*
573 600
 var handlera = new Cesium.ScreenSpaceEventHandler(viewer.canvas, false);
574 601
 handlera.setInputAction(
Please login to merge, or discard this patch.