Completed
Push — master ( abe207...090b05 )
by Yannick
07:26
created
live-geojson.php 1 patch
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -5,23 +5,23 @@  discard block
 block discarded – undo
5 5
 $marine = false;
6 6
 $usecoord = false;
7 7
 if (isset($_GET['tracker'])) {
8
-    $tracker = true;
8
+	$tracker = true;
9 9
 }
10 10
 if (isset($_GET['marine'])) {
11
-    $marine = true;
11
+	$marine = true;
12 12
 }
13 13
 if ($tracker) {
14
-    require_once('require/class.Tracker.php');
15
-    require_once('require/class.TrackerLive.php');
16
-    require_once('require/class.TrackerArchive.php');
14
+	require_once('require/class.Tracker.php');
15
+	require_once('require/class.TrackerLive.php');
16
+	require_once('require/class.TrackerArchive.php');
17 17
 } elseif ($marine) {
18
-    require_once('require/class.Marine.php');
19
-    require_once('require/class.MarineLive.php');
20
-    require_once('require/class.MarineArchive.php');
18
+	require_once('require/class.Marine.php');
19
+	require_once('require/class.MarineLive.php');
20
+	require_once('require/class.MarineArchive.php');
21 21
 } else {
22
-    require_once('require/class.Spotter.php');
23
-    require_once('require/class.SpotterLive.php');
24
-    require_once('require/class.SpotterArchive.php');
22
+	require_once('require/class.Spotter.php');
23
+	require_once('require/class.SpotterLive.php');
24
+	require_once('require/class.SpotterArchive.php');
25 25
 }
26 26
 
27 27
 $begintime = microtime(true);
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
 $Common = new Common();
42 42
 
43 43
 if (isset($_GET['download'])) {
44
-    if ($_GET['download'] == "true")
45
-    {
44
+	if ($_GET['download'] == "true")
45
+	{
46 46
 	header('Content-disposition: attachment; filename="flightairmap.json"');
47
-    }
47
+	}
48 48
 }
49 49
 header('Content-Type: text/javascript');
50 50
 
@@ -498,17 +498,17 @@  discard block
 block discarded – undo
498 498
 				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
499 499
 				
500 500
 				if (
501
-				    (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') 
502
-				    || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)
501
+					(isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') 
502
+					|| ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)
503 503
 				//    || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))
504 504
 				//    || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident'])
505
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
506
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])
507
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id']))
508
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])
509
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid']))
510
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])
511
-				    ) {
505
+					|| (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
506
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])
507
+					|| (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id']))
508
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])
509
+					|| (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid']))
510
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])
511
+					) {
512 512
 					if ($tracker) {
513 513
 						if ($from_archive || $globalArchive) {
514 514
 							$spotter_history_array = $TrackerArchive->getAllArchiveTrackerDataById($spotter_item['famtrackid']);
@@ -597,65 +597,65 @@  discard block
 block discarded – undo
597 597
 				}
598 598
 				
599 599
 				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
600
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
601
-				     && (isset($spotter_item['departure_airport']) 
602
-				        && $spotter_item['departure_airport'] != 'NA' 
603
-				        && isset($spotter_item['arrival_airport']) 
604
-				        && $spotter_item['arrival_airport'] != 'NA' 
605
-				        && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") 
606
-				    	    || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) {
607
-				    if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
608
-				    else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
609
-				    if (isset($spotter_item['departure_airport_latitude'])) {
600
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
601
+					 && (isset($spotter_item['departure_airport']) 
602
+						&& $spotter_item['departure_airport'] != 'NA' 
603
+						&& isset($spotter_item['arrival_airport']) 
604
+						&& $spotter_item['arrival_airport'] != 'NA' 
605
+						&& ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") 
606
+							|| (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) {
607
+					if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
608
+					else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
609
+					if (isset($spotter_item['departure_airport_latitude'])) {
610 610
 					$output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],';
611
-				    } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') {
611
+					} elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') {
612 612
 					$dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']);
613 613
 					if (isset($dairport[0]['latitude'])) {
614
-					    $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],';
614
+						$output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],';
615 615
 					}
616
-				    }
617
-				    if (isset($spotter_item['arrival_airport_latitude'])) {
616
+					}
617
+					if (isset($spotter_item['arrival_airport_latitude'])) {
618 618
 					$output_air .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].'],';
619
-				    } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
619
+					} elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
620 620
 					$aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);
621 621
 					if (isset($aairport[0]['latitude'])) {
622
-					    $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],';
622
+						$output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],';
623 623
 					}
624
-				    }
625
-				    $output_air  = substr($output_air, 0, -1);
626
-				    $output_air .= ']}},';
627
-				    $output .= $output_air;
628
-				    unset($output_air);
624
+					}
625
+					$output_air  = substr($output_air, 0, -1);
626
+					$output_air .= ']}},';
627
+					$output .= $output_air;
628
+					unset($output_air);
629 629
 				}
630 630
 
631 631
 				//if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) {
632 632
 				//if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) {
633 633
 				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
634
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
635
-				     && (isset($spotter_item['arrival_airport']) 
636
-				        && $spotter_item['arrival_airport'] != 'NA' 
637
-				        && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") 
638
-				    	    || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) 
639
-				    	    || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) {
640
-				    $havedata = false;
641
-				    if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
642
-				    else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
643
-				    $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';
634
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
635
+					 && (isset($spotter_item['arrival_airport']) 
636
+						&& $spotter_item['arrival_airport'] != 'NA' 
637
+						&& ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") 
638
+							|| (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) 
639
+							|| (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) {
640
+					$havedata = false;
641
+					if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
642
+					else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
643
+					$output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';
644 644
 
645
-				    if (isset($spotter_item['arrival_airport_latitude'])) {
645
+					if (isset($spotter_item['arrival_airport_latitude'])) {
646 646
 					$output_dest .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].']';
647 647
 					$havedata = true;
648
-				    } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
648
+					} elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
649 649
 					$aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);
650 650
 					if (isset($aairport[0]['latitude'])) {
651
-					    $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']';
652
-					    $havedata = true;
651
+						$output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']';
652
+						$havedata = true;
653 653
 					}
654
-				    }
655
-				    //$output_dest  = substr($output_dest, 0, -1);
656
-				    $output_dest .= ']}},';
657
-				    if ($havedata) $output .= $output_dest;
658
-				    unset($output_dest);
654
+					}
655
+					//$output_dest  = substr($output_dest, 0, -1);
656
+					$output_dest .= ']}},';
657
+					if ($havedata) $output .= $output_dest;
658
+					unset($output_dest);
659 659
 				}
660 660
 			}
661 661
 			$output  = substr($output, 0, -1);
Please login to merge, or discard this patch.
install/index.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -308,18 +308,18 @@  discard block
 block discarded – undo
308 308
 				</tr>
309 309
 				<!--
310 310
 		<?php
311
-		    require_once(dirname(__FILE__).'/../require/class.Connection.php');
312
-		    $Connection = new Connection();
311
+			require_once(dirname(__FILE__).'/../require/class.Connection.php');
312
+			$Connection = new Connection();
313 313
 		?>
314 314
 				-->
315 315
 		<?php
316
-		    if ($Connection->db != NULL) {
316
+			if ($Connection->db != NULL) {
317 317
 			if ($Connection->tableExists('source_location')) {
318
-			    require_once(dirname(__FILE__).'/../require/class.Source.php');
319
-			    $Source = new Source();
320
-			    //$alllocations = $Source->getAllLocationInfo();
321
-			    $alllocations = $Source->getLocationInfobyType('');
322
-			    foreach ($alllocations as $location) {
318
+				require_once(dirname(__FILE__).'/../require/class.Source.php');
319
+				$Source = new Source();
320
+				//$alllocations = $Source->getAllLocationInfo();
321
+				$alllocations = $Source->getLocationInfobyType('');
322
+				foreach ($alllocations as $location) {
323 323
 		?>
324 324
 				<tr>
325 325
 	    				<input type="hidden" name="source_id[]" value="<?php print $location['id']; ?>" />
@@ -333,9 +333,9 @@  discard block
 block discarded – undo
333 333
 				</tr>
334 334
 		
335 335
 		<?php
336
-			    }
336
+				}
337
+			}
337 338
 			}
338
-		    }
339 339
 		?>
340 340
 
341 341
 				<tr>
@@ -442,12 +442,12 @@  discard block
 block discarded – undo
442 442
 ?>
443 443
 							<tr>
444 444
 								<?php
445
-								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
445
+									if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
446 446
 								?>
447 447
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
448 448
 								<td><input type="number" name="port[]" id="port" value="<?php print $source['port']; ?>" /></td>
449 449
 								<?php
450
-								    } else {
450
+									} else {
451 451
 									$hostport = explode(':',$source['host']);
452 452
 									if (isset($hostport[1])) {
453 453
 										$host = $hostport[0];
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 								<td><input type="text" name="host[]" id="host" value="<?php print $host; ?>" /></td>
461 461
 								<td><input type="number" name="port[]" id="port" value="<?php print $port; ?>" /></td>
462 462
 								<?php
463
-								    }
463
+									}
464 464
 								?>
465 465
 								<td>
466 466
 									<select name="format[]" id="format">
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
 			<br />
813 813
 			<p>
814 814
 			<?php 
815
-			    if (extension_loaded('gd') && function_exists('gd_info')) {
815
+				if (extension_loaded('gd') && function_exists('gd_info')) {
816 816
 			?>
817 817
 				<label for="aircrafticoncolor">Color of aircraft icon on map</label>
818 818
 				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />
@@ -822,11 +822,11 @@  discard block
 block discarded – undo
822 822
 				<b>The directory cache is not writable, aircraft icon will not be cached</b>
823 823
 			<?php
824 824
 				}
825
-			    } else {
825
+				} else {
826 826
 			?>
827 827
 				<b>PHP GD is not installed, you can t change color of aircraft icon on map</b>
828 828
 			<?php
829
-			    }
829
+				}
830 830
 			?>
831 831
 			</p>
832 832
 			<br />
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
 	</p>
851 851
 <?php
852 852
 	require('../footer.php');
853
-        exit;
853
+		exit;
854 854
 }
855 855
 	
856 856
 $settings = array();
@@ -940,8 +940,8 @@  discard block
 block discarded – undo
940 940
 	
941 941
 	$sources = array();
942 942
 	foreach ($source_name as $keys => $name) {
943
-	    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]);
944
-	    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]);
943
+		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]);
944
+		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]);
945 945
 	}
946 946
 	if (count($sources) > 0) $_SESSION['sources'] = $sources;
947 947
 
@@ -1296,14 +1296,14 @@  discard block
 block discarded – undo
1296 1296
 
1297 1297
 	// Set some defaults values...
1298 1298
 	if (!isset($globalAircraftImageSources)) {
1299
-	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1300
-	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1299
+		$globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1300
+		$settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1301 1301
 	}
1302 1302
 
1303 1303
 	if (!isset($globalSchedulesSources)) {
1304
-	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1305
-    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1306
-    	}
1304
+		$globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1305
+			$settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1306
+		}
1307 1307
 
1308 1308
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1309 1309
 
@@ -1355,21 +1355,21 @@  discard block
 block discarded – undo
1355 1355
 	$popi = false;
1356 1356
 	$popw = false;
1357 1357
 	foreach ($_SESSION['done'] as $done) {
1358
-	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1359
-	    if ($done == 'Create database') $pop = true;
1360
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1361
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1362
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
1358
+		print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1359
+		if ($done == 'Create database') $pop = true;
1360
+		if ($_SESSION['install'] == 'database_create') $pop = true;
1361
+		if ($_SESSION['install'] == 'database_import') $popi = true;
1362
+		if ($_SESSION['install'] == 'waypoints') $popw = true;
1363 1363
 	}
1364 1364
 	if ($pop) {
1365
-	    sleep(5);
1366
-	    print '<li>Create database....<img src="../images/loading.gif" /></li>';
1365
+		sleep(5);
1366
+		print '<li>Create database....<img src="../images/loading.gif" /></li>';
1367 1367
 	} else if ($popi) {
1368
-	    sleep(5);
1369
-	    print '<li>Create and import tables....<img src="../images/loading.gif" /></li>';
1368
+		sleep(5);
1369
+		print '<li>Create and import tables....<img src="../images/loading.gif" /></li>';
1370 1370
 	} else if ($popw) {
1371
-	    sleep(5);
1372
-	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1371
+		sleep(5);
1372
+		print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1373 1373
 	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
1374 1374
 	print '</div></ul>';
1375 1375
 	print '<div id="error"></div>';
@@ -1432,7 +1432,7 @@  discard block
 block discarded – undo
1432 1432
 	unset($_COOKIE['install']);
1433 1433
 	print '<div class="info column"><ul>';
1434 1434
 	foreach ($_SESSION['done'] as $done) {
1435
-	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1435
+		print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1436 1436
 	}
1437 1437
 	print '<li>Reloading page to check all is now ok....<strong>SUCCESS</strong></li>';
1438 1438
 	print '</ul></div>';
Please login to merge, or discard this patch.
table-output.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 				print '<th class="arrival"><span class="nomobile">'._("Going to").'</span><span class="mobile">'._("To").'</span></th>';
278 278
 			}
279 279
 		}
280
-    		if ($type == 'aircraft') {
280
+			if ($type == 'aircraft') {
281 281
 			if ((isset($globalUsePilot) && $globalUsePilot) || (!isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalVAM) && $globalVAM) || (isset($globalphpVMS) && $globalphpVMS)))) {
282 282
 				print '<th class="pilot"><span class="nomobile">'._("Pilot name").'</span><span class="mobile">'._("Pilot").'</span></a></th>';
283 283
 			}
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 	} elseif(strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive" && strtolower($current_page) != "accident-latest" && strtolower($current_page) != "incident-latest" && strtolower($current_page) != "accident-detailed" && strtolower($current_page) != "incident-detailed"){
580 580
 		if ($type == 'aircraft') {
581 581
 			if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) {
582
-			    $spotter_item['squawk'] = '-';
582
+				$spotter_item['squawk'] = '-';
583 583
 			}
584 584
 			if ($spotter_item['image_thumbnail'] != "")
585 585
 			{
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 				print '</td>'."\n";
619 619
 			} else {
620 620
 				print '<td class="aircraft_thumbnail">'."\n";
621
-	       //   	 	print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>';
621
+		   //   	 	print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>';
622 622
 		//}
623 623
 				if (!isset($spotter_item['airline_name']) && !isset($spotter_item['aircraft_name'])) {
624 624
 					print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '._("Not available").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n";
Please login to merge, or discard this patch.
header.php 1 patch
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 // When button "Remove all filters" is clicked
29 29
 if (isset($_POST['removefilters'])) {
30 30
 	$allfilters = array_filter(array_keys($_COOKIE),function($key) {
31
-	    return strpos($key,'filter_') === 0;
31
+		return strpos($key,'filter_') === 0;
32 32
 	});
33 33
 	foreach ($allfilters as $filt) {
34 34
 		unset($_COOKIE[$filt]);
@@ -167,17 +167,17 @@  discard block
 block discarded – undo
167 167
 	}
168 168
 ?>
169 169
 <?php 
170
-    if (isset($_POST['archive'])) {
170
+	if (isset($_POST['archive'])) {
171 171
 ?>
172 172
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
173 173
 <?php 
174
-	    if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
174
+		if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
175 175
 ?>
176 176
 
177 177
 <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>
178 178
 <?php    
179
-	    }
180
-    } else {
179
+		}
180
+	} else {
181 181
 ?>
182 182
 <?php
183 183
 /*	if (isset($globalBeta) && $globalBeta) {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 */
190 190
 ?>
191 191
 <?php 
192
-	    if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
192
+		if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
193 193
 ?>
194 194
 <?php
195 195
 //		if (isset($globalBeta) && $globalBeta) {
@@ -216,13 +216,13 @@  discard block
 block discarded – undo
216 216
 <script src="<?php print $globalURL; ?>/js/map-marine.2d.js.php?<?php print time(); ?>"></script>
217 217
 <?php
218 218
 		}
219
-	    }
219
+		}
220 220
 ?>
221 221
 <?php
222 222
 //	}
223 223
 ?>
224 224
 <?php
225
-    }
225
+	}
226 226
 }
227 227
 ?>
228 228
 <?php
@@ -398,48 +398,48 @@  discard block
 block discarded – undo
398 398
       <ul class="nav navbar-nav">
399 399
 
400 400
 <?php 
401
-    $sub = false;
402
-    if (((!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))) || (isset($globalMarine) && $globalMarine === TRUE && isset($globalTracker) && $globalTracker === TRUE)) {
401
+	$sub = false;
402
+	if (((!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))) || (isset($globalMarine) && $globalMarine === TRUE && isset($globalTracker) && $globalTracker === TRUE)) {
403 403
 	$sub = true;
404
-    }
404
+	}
405 405
 ?>
406 406
 <?php
407
-    if (!isset($globalAircraft) || $globalAircraft === TRUE) {
407
+	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
408 408
 ?>
409 409
     <li class="dropdown">
410 410
 <?php
411
-    if ($sub) {
411
+	if ($sub) {
412 412
 ?>
413 413
       	<li class="dropdown">
414 414
           <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Aircrafts"); ?> <b class="caret"></b></a>
415 415
 	<ul class="dropdown-menu multi-level">
416 416
       	<li class="dropdown-submenu">
417 417
 <?php
418
-    }
418
+	}
419 419
 ?>
420 420
           <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
421 421
           <ul class="dropdown-menu">
422 422
           	<li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircrafts Types"); ?></a></li>
423 423
 <?php
424
-    if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
424
+	if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
425 425
 ?>
426 426
 			<li><a href="<?php print $globalURL; ?>/airline"><?php echo _("Airlines"); ?></a></li>
427 427
 <?php
428
-    }
428
+	}
429 429
 ?>
430 430
 			<li><a href="<?php print $globalURL; ?>/airport"><?php echo _("Airports"); ?></a></li>
431 431
 <?php
432
-    if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
432
+	if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
433 433
 ?>
434 434
 			<li><a href="<?php print $globalURL; ?>/owner"><?php echo _("Owners"); ?></a></li>
435 435
 <?php
436
-    } 
437
-    if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
436
+	} 
437
+	if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
438 438
 
439 439
 ?>
440 440
 			<li><a href="<?php print $globalURL; ?>/pilot"><?php echo _("Pilots"); ?></a></li>
441 441
 <?php
442
-    }
442
+	}
443 443
 ?>
444 444
 			<li><hr /></li>
445 445
             <li><a href="<?php print $globalURL; ?>/currently"><?php echo _("Current Activity"); ?></a></li>
@@ -447,43 +447,43 @@  discard block
 block discarded – undo
447 447
             <li><a href="<?php print $globalURL; ?>/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li>
448 448
             <li><a href="<?php print $globalURL; ?>/newest"><?php echo _("Newest by Category"); ?></a></li>
449 449
             <?php
450
-        	if ($globalACARS) {
451
-        	    if (isset($globalDemo) && $globalDemo) {
452
-    	    ?>
450
+			if ($globalACARS) {
451
+				if (isset($globalDemo) && $globalDemo) {
452
+			?>
453 453
             <li><hr /></li>
454 454
             <li><i><?php echo _('ACARS data not available publicly'); ?></i></li>
455 455
             <li><a href=""><?php echo _('Latest ACARS messages'); ?></a></li>
456 456
             <li><a href=""><?php echo _('Archive ACARS messages'); ?></a></li>
457 457
             <?php
458
-        	    } else {
459
-    	    ?>
458
+				} else {
459
+			?>
460 460
             <li><hr /></li>
461 461
             <li><a href="<?php print $globalURL; ?>/acars-latest"><?php echo _("Latest ACARS messages"); ?></a></li>
462 462
             <li><a href="<?php print $globalURL; ?>/acars-archive"><?php echo _("Archive ACARS messages"); ?></a></li>
463 463
             <?php
464
-        	    }
465
-        	}
466
-    	    ?>
464
+				}
465
+			}
466
+			?>
467 467
     	    <?php
468
-    	        if (isset($globalAccidents) && $globalAccidents) {
469
-    	    ?>
468
+				if (isset($globalAccidents) && $globalAccidents) {
469
+			?>
470 470
             <li><hr /></li>
471 471
             <li><a href="<?php print $globalURL; ?>/accident-latest"><?php echo _("Latest accident"); ?></a></li>
472 472
             <li><a href="<?php print $globalURL; ?>/accident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Accident"); ?></a></li>
473 473
             <li><a href="<?php print $globalURL; ?>/incident-latest"><?php echo _("Latest incident"); ?></a></li>
474 474
             <li><a href="<?php print $globalURL; ?>/incident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Incident"); ?></a></li>
475 475
             <?php
476
-        	}
477
-    	    ?>
476
+			}
477
+			?>
478 478
             <li><hr /></li>
479 479
             <li><a href="<?php print $globalURL; ?>/highlights/table"><?php echo _("Special Highlights"); ?></a></li>
480 480
             <?php
481 481
 		if (!isset($globalNoUpcoming) || $globalNoUpcoming === FALSE) {
482
-	    ?>
482
+		?>
483 483
             <li><a href="<?php print $globalURL; ?>/upcoming"><?php echo _("Upcoming Flights"); ?></a></li>
484 484
 	    <?php
485 485
 		}
486
-	    ?>
486
+		?>
487 487
           </ul>
488 488
         </li>
489 489
       	<li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li>
@@ -503,14 +503,14 @@  discard block
 block discarded – undo
503 503
     </ul>
504 504
 <?php
505 505
 	}
506
-    }
506
+	}
507 507
 ?>
508 508
 <?php
509
-    if (isset($globalMarine) && $globalMarine) {
509
+	if (isset($globalMarine) && $globalMarine) {
510 510
 ?>
511 511
     <li class="dropdown">
512 512
 <?php
513
-        if ($sub) {
513
+		if ($sub) {
514 514
 ?>
515 515
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Vessels"); ?> <b class="caret"></b></a>
516 516
 	<ul class="dropdown-menu multi-level">
@@ -535,14 +535,14 @@  discard block
 block discarded – undo
535 535
 	}
536 536
 ?>
537 537
 <?php
538
-    }
538
+	}
539 539
 ?>
540 540
 <?php
541
-    if (isset($globalTracker) && $globalTracker) {
541
+	if (isset($globalTracker) && $globalTracker) {
542 542
 ?>
543 543
     <li class="dropdown">
544 544
 <?php
545
-        if ($sub) {
545
+		if ($sub) {
546 546
 ?>
547 547
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Trackers"); ?> <b class="caret"></b></a>
548 548
 	<ul class="dropdown-menu multi-level">
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 	}
568 568
 ?>
569 569
 <?php
570
-    }
570
+	}
571 571
 ?>
572 572
 
573 573
         <li class="dropdown">
@@ -576,12 +576,12 @@  discard block
 block discarded – undo
576 576
           	<li><a href="<?php print $globalURL; ?>/about"><?php echo _("About The Project"); ?></a></li>
577 577
           	<li><a href="<?php print $globalURL; ?>/about/export"><?php echo _("Exporting Data"); ?></a></li>
578 578
 <?php
579
-    if (!isset($globalAircraft) || $globalAircraft === TRUE) {
579
+	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
580 580
 ?>
581 581
 		<li><hr /></li>
582 582
 		<li><a href="<?php print $globalURL; ?>/about/tv"><?php echo _("Spotter TV"); ?></a></li>
583 583
 <?php
584
-    }
584
+	}
585 585
 ?>
586 586
 	    <?php if (isset($globalContribute) && $globalContribute) { ?>
587 587
                 <li><hr /></li>
@@ -602,14 +602,14 @@  discard block
 block discarded – undo
602 602
   	    <form>
603 603
   		<select class="selectpicker" data-width="120px" onchange="language(this);">
604 604
   		    <?php
605
-  		        $Language = new Language();
606
-  		        $alllang = $Language->getLanguages();
607
-  		        foreach ($alllang as $key => $lang) {
608
-  		            print '<option value="'.$key.'"';
609
-  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
610
-  		            print '>'.$lang[0].'</option>';
611
-  		        }
612
-  		    ?>
605
+  				$Language = new Language();
606
+  				$alllang = $Language->getLanguages();
607
+  				foreach ($alllang as $key => $lang) {
608
+  					print '<option value="'.$key.'"';
609
+  					if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
610
+  					print '>'.$lang[0].'</option>';
611
+  				}
612
+  			?>
613 613
   		</select>
614 614
   	    </form>
615 615
   	</div>
@@ -640,18 +640,18 @@  discard block
 block discarded – undo
640 640
 ?>
641 641
     <div class="top-header clear" role="main">
642 642
 <?php
643
-    if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) {
643
+	if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) {
644 644
 ?>
645 645
     <div id="archive-map"></div>
646 646
 <?php
647
-    }
647
+	}
648 648
 ?>
649 649
     </div>
650 650
 <?php
651 651
 }
652 652
 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))
653 653
 {
654
-    ?>
654
+	?>
655 655
     <div class="top-header clear" role="main">
656 656
         <div id="map"></div>
657 657
 	<link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" />
@@ -662,15 +662,15 @@  discard block
 block discarded – undo
662 662
         var zoom = 13;
663 663
 //create the map
664 664
 <?php
665
-    if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
665
+	if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
666 666
 ?>
667 667
   map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom);
668 668
 <?php
669
-    } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
669
+	} elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
670 670
 ?>
671 671
   map = L.map('map', { zoomControl:true });
672 672
 <?php
673
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
673
+	} elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
674 674
 ?>
675 675
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]);
676 676
     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);
@@ -678,22 +678,22 @@  discard block
 block discarded – undo
678 678
     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);
679 679
     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);
680 680
 <?php
681
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) {
681
+	} elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) {
682 682
 ?>
683 683
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]);
684 684
 <?php
685
-    } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) {
685
+	} elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) {
686 686
 ?>
687 687
   map = L.map('map', { zoomControl:true });
688 688
 <?php
689
-    }
689
+	}
690 690
 ?>
691 691
   //initialize the layer group for the aircrft markers
692 692
   var layer_data = L.layerGroup();
693 693
 
694 694
   //a few title layers
695 695
 <?php
696
-    if ($globalMapProvider == 'Mapbox') {
696
+	if ($globalMapProvider == 'Mapbox') {
697 697
 ?>
698 698
   L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', {
699 699
     maxZoom: 18,
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
     token : '<?php print $globalMapboxToken; ?>'
705 705
   }).addTo(map);
706 706
 <?php
707
-    } elseif ($globalMapProvider == 'MapQuest-OSM') {
707
+	} elseif ($globalMapProvider == 'MapQuest-OSM') {
708 708
 ?>
709 709
   L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {
710 710
     maxZoom: 18,
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
       'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>'
714 714
   }).addTo(map);
715 715
 <?php
716
-    } elseif ($globalMapProvider == 'MapQuest-Aerial') {
716
+	} elseif ($globalMapProvider == 'MapQuest-Aerial') {
717 717
 ?>
718 718
   L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', {
719 719
     maxZoom: 18,
@@ -722,27 +722,27 @@  discard block
 block discarded – undo
722 722
       '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"'
723 723
   }).addTo(map);
724 724
 <?php
725
-    } elseif ($globalMapProvider == 'Google-Roadmap') {
725
+	} elseif ($globalMapProvider == 'Google-Roadmap') {
726 726
 ?>
727 727
     var googleLayer = new L.Google('ROADMAP');
728 728
     map.addLayer(googleLayer);
729 729
 <?php
730
-    } elseif ($globalMapProvider == 'Google-Satellite') {
730
+	} elseif ($globalMapProvider == 'Google-Satellite') {
731 731
 ?>
732 732
     var googleLayer = new L.Google('SATELLITE');
733 733
     map.addLayer(googleLayer);
734 734
 <?php
735
-    } elseif ($globalMapProvider == 'Google-Hybrid') {
735
+	} elseif ($globalMapProvider == 'Google-Hybrid') {
736 736
 ?>
737 737
     var googleLayer = new L.Google('HYBRID');
738 738
     map.addLayer(googleLayer);
739 739
 <?php
740
-    } elseif ($globalMapProvider == 'Google-Terrain') {
740
+	} elseif ($globalMapProvider == 'Google-Terrain') {
741 741
 ?>
742 742
     var googleLayer = new L.Google('Terrain');
743 743
     map.addLayer(googleLayer);
744 744
 <?php
745
-    } elseif (isset($globalMapCustomLayer[$globalMapProvider])) {
745
+	} elseif (isset($globalMapCustomLayer[$globalMapProvider])) {
746 746
 	$customid = $globalMapProvider;
747 747
 ?>
748 748
     L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', {
@@ -752,8 +752,8 @@  discard block
 block discarded – undo
752 752
         attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
753 753
     }).addTo(map);
754 754
 <?php
755
-    //} elseif ($globalMapProvider == 'OpenStreetMap') {
756
-    } else {
755
+	//} elseif ($globalMapProvider == 'OpenStreetMap') {
756
+	} else {
757 757
 ?>
758 758
   L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
759 759
     maxZoom: 18,
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
   }).addTo(map);
763 763
 
764 764
 <?php
765
-    }
765
+	}
766 766
 ?>
767 767
         </script>
768 768
     </div>
Please login to merge, or discard this patch.
require/class.APRS.php 1 patch
Indentation   +146 added lines, -146 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@  discard block
 block discarded – undo
2 2
 require_once(dirname(__FILE__).'/settings.php');
3 3
 require_once(dirname(__FILE__).'/class.Common.php');
4 4
 class aprs {
5
-    private $socket;
6
-    private $connected = false;
5
+	private $socket;
6
+	private $connected = false;
7 7
 
8
-    protected $symbols = array('!' => 'Police',
8
+	protected $symbols = array('!' => 'Police',
9 9
 	'#' => 'DIGI',
10 10
 	'$' => 'Phone',
11 11
 	'%' => 'DX Cluster',
@@ -89,13 +89,13 @@  discard block
 block discarded – undo
89 89
 	'y' => 'Yagi At QTH');
90 90
 	
91 91
 
92
-    private function urshift($n, $s) {
92
+	private function urshift($n, $s) {
93 93
 	return ($n >= 0) ? ($n >> $s) :
94
-	    (($n & 0x7fffffff) >> $s) | 
94
+		(($n & 0x7fffffff) >> $s) | 
95 95
 		(0x40000000 >> ($s - 1));
96
-    }
96
+	}
97 97
 
98
-    public function parse($input) {
98
+	public function parse($input) {
99 99
 	global $globalDebug;
100 100
 	$debug = false;
101 101
 	$result = array();
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
 	
108 108
 	/* Check that end was found and body has at least one byte. */
109 109
 	if ($splitpos == 0 || $splitpos + 1 == $input_len || $splitpos === FALSE) {
110
-	    if ($globalDebug) echo '!!! APRS invalid : '.$input."\n";
111
-	    return false;
110
+		if ($globalDebug) echo '!!! APRS invalid : '.$input."\n";
111
+		return false;
112 112
 	}
113 113
 	
114 114
 	if ($debug) echo 'input : '.$input."\n";
@@ -122,34 +122,34 @@  discard block
 block discarded – undo
122 122
 	/* Parse source, target and path. */
123 123
 	//FLRDF0A52>APRS,qAS,LSTB
124 124
 	if (preg_match('/^([A-Z0-9\\-]{1,9})>(.*)$/',$header,$matches)) {
125
-	    $ident = $matches[1];
126
-	    $all_elements = $matches[2];
127
-	    if ($ident == 'AIRCRAFT') {
125
+		$ident = $matches[1];
126
+		$all_elements = $matches[2];
127
+		if ($ident == 'AIRCRAFT') {
128 128
 		$result['format_source'] = 'famaprs';
129 129
 		$result['source_type'] = 'modes';
130
-	    } elseif ($ident == 'MARINE') {
130
+		} elseif ($ident == 'MARINE') {
131 131
 		$result['format_source'] = 'famaprs';
132 132
 		$result['source_type'] = 'ais';
133
-	    } else {
133
+		} else {
134 134
 		if ($debug) echo 'ident : '.$ident."\n";
135 135
 		$result['ident'] = $ident;
136
-	    }
136
+		}
137 137
 	} else {
138
-	    if ($debug) 'No ident'."\n";
139
-	    return false;
138
+		if ($debug) 'No ident'."\n";
139
+		return false;
140 140
 	}
141 141
 	$elements = explode(',',$all_elements);
142 142
 	$source = end($elements);
143 143
 	$result['source'] = $source;
144 144
 	foreach ($elements as $element) {
145
-	    if (preg_match('/^([a-zA-Z0-9-]{1,9})([*]?)$/',$element)) {
146
-	        //echo "ok";
147
-	        //if ($element == 'TCPIP*') return false;
148
-	    } elseif (!preg_match('/^([0-9A-F]{32})$/',$element)) {
145
+		if (preg_match('/^([a-zA-Z0-9-]{1,9})([*]?)$/',$element)) {
146
+			//echo "ok";
147
+			//if ($element == 'TCPIP*') return false;
148
+		} elseif (!preg_match('/^([0-9A-F]{32})$/',$element)) {
149 149
 		if ($debug) echo 'element : '.$element."\n";
150 150
 		return false;
151
-	    }
152
-	    /*
151
+		}
152
+		/*
153 153
 	    } elseif (preg_match('/^([0-9A-F]{32})$/',$element)) {
154 154
 		//echo "ok";
155 155
 	    } else {
@@ -176,49 +176,49 @@  discard block
 block discarded – undo
176 176
 	$body_parse = substr($body,1);
177 177
 	//echo 'Body : '.$body."\n";
178 178
 	if (preg_match('/^;(.){9}\*/',$body,$matches)) {
179
-	    $body_parse = substr($body_parse,10);
180
-	    $find = true;
181
-	    //echo $body_parse."\n";
179
+		$body_parse = substr($body_parse,10);
180
+		$find = true;
181
+		//echo $body_parse."\n";
182 182
 	}
183 183
 	if (preg_match('/^`(.*)\//',$body,$matches)) {
184
-	    $body_parse = substr($body_parse,strlen($matches[1])-1);
185
-	    $find = true;
186
-	    //echo $body_parse."\n";
184
+		$body_parse = substr($body_parse,strlen($matches[1])-1);
185
+		$find = true;
186
+		//echo $body_parse."\n";
187 187
 	}
188 188
 	if (preg_match("/^'(.*)\//",$body,$matches)) {
189
-	    $body_parse = substr($body_parse,strlen($matches[1])-1);
190
-	    $find = true;
191
-	    //echo $body_parse."\n";
189
+		$body_parse = substr($body_parse,strlen($matches[1])-1);
190
+		$find = true;
191
+		//echo $body_parse."\n";
192 192
 	}
193 193
 	if (preg_match('/^([0-9]{2})([0-9]{2})([0-9]{2})([zh\\/])/',$body_parse,$matches)) {
194
-	    $find = true;
195
-	    //print_r($matches);
196
-	    $timestamp = $matches[0];
197
-	    if ($matches[4] == 'h') {
194
+		$find = true;
195
+		//print_r($matches);
196
+		$timestamp = $matches[0];
197
+		if ($matches[4] == 'h') {
198 198
 		$timestamp = strtotime(date('Ymd').' '.$matches[1].':'.$matches[2].':'.$matches[3]);
199 199
 		//echo 'timestamp : '.$timestamp.' - now : '.time()."\n";
200 200
 		/*
201 201
 		if (time() + 3900 < $timestamp) $timestamp -= 86400;
202 202
 		elseif (time() - 82500 > $timestamp) $timestamp += 86400;
203 203
 		*/
204
-	    } elseif ($matches[4] == 'z' || $matches[4] == '/') {
204
+		} elseif ($matches[4] == 'z' || $matches[4] == '/') {
205 205
 		// This work or not ?
206 206
 		$timestamp = strtotime(date('Ym').$matches[1].' '.$matches[2].':'.$matches[3]);
207
-	    }
208
-	    $body_parse = substr($body_parse,7);
209
-	    $result['timestamp'] = $timestamp;
210
-	    //echo date('Ymd H:i:s',$timestamp);
207
+		}
208
+		$body_parse = substr($body_parse,7);
209
+		$result['timestamp'] = $timestamp;
210
+		//echo date('Ymd H:i:s',$timestamp);
211 211
 	}
212 212
 	if (preg_match('/^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/',$body_parse,$matches)) {
213
-	    $find = true;
214
-	    $timestamp = strtotime(date('Y').$matches[1].$matches[2].' '.$matches[3].':'.$matches[4]);
215
-	    $body_parse = substr($body_parse,8);
216
-	    $result['timestamp'] = $timestamp;
217
-	    //echo date('Ymd H:i:s',$timestamp);
213
+		$find = true;
214
+		$timestamp = strtotime(date('Y').$matches[1].$matches[2].' '.$matches[3].':'.$matches[4]);
215
+		$body_parse = substr($body_parse,8);
216
+		$result['timestamp'] = $timestamp;
217
+		//echo date('Ymd H:i:s',$timestamp);
218 218
 	}
219 219
 	//if (strlen($body_parse) > 19) {
220
-	    if (preg_match('/^([0-9]{2})([0-7 ][0-9 ]\\.[0-9 ]{2})([NnSs])(.)([0-9]{3})([0-7 ][0-9 ]\\.[0-9 ]{2})([EeWw])(.)/',$body_parse,$matches)) {
221
-	    $find = true;
220
+		if (preg_match('/^([0-9]{2})([0-7 ][0-9 ]\\.[0-9 ]{2})([NnSs])(.)([0-9]{3})([0-7 ][0-9 ]\\.[0-9 ]{2})([EeWw])(.)/',$body_parse,$matches)) {
221
+		$find = true;
222 222
 		// 4658.70N/00707.78Ez
223 223
 		//print_r(str_split($body_parse));
224 224
 		
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 		$lon = intval($lon_deg);
236 236
 		if ($lat > 89 || $lon > 179) return false;
237 237
 	    
238
-	    /*
238
+		/*
239 239
 	    $tmp_5b = str_replace('.','',$lat_min);
240 240
 	    if (preg_match('/^([0-9]{0,4})( {0,4})$/',$tmp_5b,$matches)) {
241 241
 	        print_r($matches);
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
 		$result['longitude'] = $longitude;
250 250
 		$body_parse = substr($body_parse,18);
251 251
 		$body_parse_len = strlen($body_parse);
252
-	    }
253
-	    $body_parse_len = strlen($body_parse);
254
-	    if ($body_parse_len > 0) {
252
+		}
253
+		$body_parse_len = strlen($body_parse);
254
+		if ($body_parse_len > 0) {
255 255
 		/*
256 256
 		if (!isset($result['timestamp']) && !isset($result['latitude'])) {
257 257
 			$body_split = str_split($body);
@@ -281,95 +281,95 @@  discard block
 block discarded – undo
281 281
 			if (isset($this->symbols[$symbol_code])) $result['symbol'] = $this->symbols[$symbol_code];
282 282
 			if ($symbol_code != '_') {
283 283
 			}
284
-		    //$body_parse = substr($body_parse,1);
285
-		    //$body_parse = trim($body_parse);
286
-		    //$body_parse_len = strlen($body_parse);
287
-		    if ($body_parse_len >= 7) {
284
+			//$body_parse = substr($body_parse,1);
285
+			//$body_parse = trim($body_parse);
286
+			//$body_parse_len = strlen($body_parse);
287
+			if ($body_parse_len >= 7) {
288 288
 			
289
-		        if (preg_match('/^([0-9\\. ]{3})\\/([0-9\\. ]{3})/',$body_parse)) {
290
-		    	    $course = substr($body_parse,0,3);
291
-		    	    $tmp_s = intval($course);
292
-		    	    if ($tmp_s >= 1 && $tmp_s <= 360) $result['heading'] = intval($course);
293
-		    	    $speed = substr($body_parse,4,3);
294
-		    	    if ($speed != '...') {
295
-		    		//$result['speed'] = round($speed*1.852);
296
-		    		$result['speed'] = intval($speed);
297
-		    	    }
298
-		    	    $body_parse = substr($body_parse,7);
299
-		        }
300
-		        // Check PHGR, PHG, RNG
301
-		    } 
302
-		    /*
289
+				if (preg_match('/^([0-9\\. ]{3})\\/([0-9\\. ]{3})/',$body_parse)) {
290
+					$course = substr($body_parse,0,3);
291
+					$tmp_s = intval($course);
292
+					if ($tmp_s >= 1 && $tmp_s <= 360) $result['heading'] = intval($course);
293
+					$speed = substr($body_parse,4,3);
294
+					if ($speed != '...') {
295
+					//$result['speed'] = round($speed*1.852);
296
+					$result['speed'] = intval($speed);
297
+					}
298
+					$body_parse = substr($body_parse,7);
299
+				}
300
+				// Check PHGR, PHG, RNG
301
+			} 
302
+			/*
303 303
 		    else if ($body_parse_len > 0) {
304 304
 			$rest = $body_parse;
305 305
 		    }
306 306
 		    */
307
-		    if (strlen($body_parse) > 0) {
308
-		        if (preg_match('/\\/A=(-[0-9]{5}|[0-9]{6})/',$body_parse,$matches)) {
309
-		            $altitude = intval($matches[1]);
310
-		            //$result['altitude'] = round($altitude*0.3048);
311
-		            $result['altitude'] = $altitude;
312
-		            //$body_parse = trim(substr($body_parse,strlen($matches[0])));
313
-		            $body_parse = trim(preg_replace('/\\/A=(-[0-9]{5}|[0-9]{6})/','',$body_parse));
314
-		        }
315
-		    }
307
+			if (strlen($body_parse) > 0) {
308
+				if (preg_match('/\\/A=(-[0-9]{5}|[0-9]{6})/',$body_parse,$matches)) {
309
+					$altitude = intval($matches[1]);
310
+					//$result['altitude'] = round($altitude*0.3048);
311
+					$result['altitude'] = $altitude;
312
+					//$body_parse = trim(substr($body_parse,strlen($matches[0])));
313
+					$body_parse = trim(preg_replace('/\\/A=(-[0-9]{5}|[0-9]{6})/','',$body_parse));
314
+				}
315
+			}
316 316
 		    
317
-		    // Telemetry
318
-		    /*
317
+			// Telemetry
318
+			/*
319 319
 		    if (preg_match('/^([0-9]+),(-?)([0-9]{1,6}|[0-9]+\\.[0-9]+|\\.[0-9]+)?,(-?)([0-9]{1,6}|[0-9]+\\.[0-9]+|\\.[0-9]+)?,(-?)([0-9]{1,6}|[0-9]+\\.[0-9]+|\\.[0-9]+)?,(-?)([0-9]{1,6}|[0-9]+\\.[0-9]+|\\.[0-9]+)?,(-?)([0-9]{1,6}|[0-9]+\\.[0-9]+|\\.[0-9]+)?,([01]{0,8})/',$body_parse,$matches)) {
320 320
 		        // Nothing yet...
321 321
 		    }
322 322
 		    */
323
-		    // DAO
323
+			// DAO
324 324
 		    
325
-		    if (preg_match('/^!([0-9A-Z]{3})/',$body_parse,$matches)) {
325
+			if (preg_match('/^!([0-9A-Z]{3})/',$body_parse,$matches)) {
326 326
 			    
327
-			    $dao = $matches[1];
328
-			    if (preg_match('/^([A-Z])([0-9]{2})/',$dao)) {
327
+				$dao = $matches[1];
328
+				if (preg_match('/^([A-Z])([0-9]{2})/',$dao)) {
329 329
 				$dao_split = str_split($dao);
330
-			        $lat_off = (($dao_split[1])-48.0)*0.001/60.0;
331
-			        $lon_off = (($dao_split[2])-48.0)*0.001/60.0;
330
+					$lat_off = (($dao_split[1])-48.0)*0.001/60.0;
331
+					$lon_off = (($dao_split[2])-48.0)*0.001/60.0;
332 332
 			    
333 333
 				if ($result['latitude'] < 0) $result['latitude'] -= $lat_off;
334 334
 				else $result['latitude'] += $lat_off;
335 335
 				if ($result['longitude'] < 0) $result['longitude'] -= $lon_off;
336 336
 				else $result['longitude'] += $lon_off;
337
-			    }
337
+				}
338 338
 			    
339
-		            $body_parse = substr($body_parse,6);
340
-		    }
339
+					$body_parse = substr($body_parse,6);
340
+			}
341 341
 		    
342
-		    if (preg_match('/CS=([0-9A-Z_]*)/',$body_parse,$matches)) {
342
+			if (preg_match('/CS=([0-9A-Z_]*)/',$body_parse,$matches)) {
343 343
 			$result['ident'] = str_replace('_',' ',$matches[1]);
344
-		    }
345
-		    if (preg_match('/SQ=([0-9]{4})/',$body_parse,$matches)) {
344
+			}
345
+			if (preg_match('/SQ=([0-9]{4})/',$body_parse,$matches)) {
346 346
 			$result['squawk'] = $matches[1];
347
-		    }
348
-		    if (preg_match('/AI=([0-9A-Z]{4})/',$body_parse,$matches)) {
347
+			}
348
+			if (preg_match('/AI=([0-9A-Z]{4})/',$body_parse,$matches)) {
349 349
 			$result['aircraft_icao'] = $matches[1];
350
-		    }
351
-		    if (preg_match('/VR=([0-9]*)/',$body_parse,$matches)) {
350
+			}
351
+			if (preg_match('/VR=([0-9]*)/',$body_parse,$matches)) {
352 352
 			$result['verticalrate'] = $matches[1];
353
-		    }
354
-		    if (preg_match('/TI=([0-9]*)/',$body_parse,$matches)) {
353
+			}
354
+			if (preg_match('/TI=([0-9]*)/',$body_parse,$matches)) {
355 355
 			$result['typeid'] = $matches[1];
356
-		    }
357
-		    if (preg_match('/SI=([0-9]*)/',$body_parse,$matches)) {
356
+			}
357
+			if (preg_match('/SI=([0-9]*)/',$body_parse,$matches)) {
358 358
 			$result['statusid'] = $matches[1];
359
-		    }
360
-		    if (preg_match('/IMO=([0-9]{7})/',$body_parse,$matches)) {
359
+			}
360
+			if (preg_match('/IMO=([0-9]{7})/',$body_parse,$matches)) {
361 361
 			$result['imo'] = $matches[1];
362
-		    }
363
-		    if (preg_match('/AD=([0-9]*)/',$body_parse,$matches)) {
362
+			}
363
+			if (preg_match('/AD=([0-9]*)/',$body_parse,$matches)) {
364 364
 			$result['arrival_date'] = $matches[1];
365
-		    }
366
-		    if (preg_match('/AC=([0-9A-Z_]*)/',$body_parse,$matches)) {
365
+			}
366
+			if (preg_match('/AC=([0-9A-Z_]*)/',$body_parse,$matches)) {
367 367
 			$result['arrival_code'] = str_replace('_',' ',$matches[1]);
368
-		    }
369
-		    // OGN comment
368
+			}
369
+			// OGN comment
370 370
 		   // echo "Before OGN : ".$body_parse."\n";
371
-		    //if (preg_match('/^id([0-9A-F]{8}) ([+-])([0-9]{3,4})fpm ([+-])([0-9.]{3,4})rot (.*)$/',$body_parse,$matches)) {
372
-		    if (preg_match('/^id([0-9A-F]{8})/',$body_parse,$matches)) {
371
+			//if (preg_match('/^id([0-9A-F]{8}) ([+-])([0-9]{3,4})fpm ([+-])([0-9.]{3,4})rot (.*)$/',$body_parse,$matches)) {
372
+			if (preg_match('/^id([0-9A-F]{8})/',$body_parse,$matches)) {
373 373
 			$id = $matches[1];
374 374
 			//$mode = substr($id,0,2);
375 375
 			$address = substr($id,2);
@@ -399,53 +399,53 @@  discard block
 block discarded – undo
399 399
 			$stealth = (intval(substr($id,0,2), 16) & 0b10000000) != 0;
400 400
 			$result['stealth'] = $stealth;
401 401
 			$result['address'] = $address;
402
-		    }
402
+			}
403 403
 		    
404
-		    //Comment
405
-		    $result['comment'] = trim($body_parse);
404
+			//Comment
405
+			$result['comment'] = trim($body_parse);
406 406
 		} else {
407
-		    // parse weather
408
-		    //$body_parse = substr($body_parse,1);
409
-		    //$body_parse_len = strlen($body_parse);
407
+			// parse weather
408
+			//$body_parse = substr($body_parse,1);
409
+			//$body_parse_len = strlen($body_parse);
410 410
 
411
-		    if (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})g([0-9 \\.]+)t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) {
412
-			    $result['wind_dir'] = intval($matches[1]);
413
-			    $result['wind_speed'] = round(intval($matches[2])*1.60934,1);
414
-			    $result['wind_gust'] = round(intval($matches[3])*1.60934,1);
415
-			    $result['temp'] = round(5/9*((intval($matches[4]))-32),1);
416
-		    	    $body_parse = substr($body_parse,strlen($matches[0])+1);
417
-		    } elseif (preg_match('/^_{0,1}c([0-9 \\.\\-]{3})s([0-9 \\.]{3})g([0-9 \\.]+)t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) {
411
+			if (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})g([0-9 \\.]+)t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) {
412
+				$result['wind_dir'] = intval($matches[1]);
413
+				$result['wind_speed'] = round(intval($matches[2])*1.60934,1);
414
+				$result['wind_gust'] = round(intval($matches[3])*1.60934,1);
415
+				$result['temp'] = round(5/9*((intval($matches[4]))-32),1);
416
+					$body_parse = substr($body_parse,strlen($matches[0])+1);
417
+			} elseif (preg_match('/^_{0,1}c([0-9 \\.\\-]{3})s([0-9 \\.]{3})g([0-9 \\.]+)t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) {
418 418
 			$result['wind_dir'] = intval($matches[1]);
419 419
 			$result['wind_speed'] = round($matches[2]*1.60934,1);
420 420
 			$result['wind_gust'] = round($matches[3]*1.60934,1);
421 421
 			$result['temp'] = round(5/9*(($matches[4])-32),1);
422
-		        $body_parse = substr($body_parse,strlen($matches[0])+1);
423
-		    } elseif (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) {
422
+				$body_parse = substr($body_parse,strlen($matches[0])+1);
423
+			} elseif (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) {
424 424
 			$result['wind_dir'] = intval($matches[1]);
425 425
 			$result['wind_speed'] = round($matches[2]*1.60934,1);
426 426
 			$result['wind_gust'] = round($matches[3]*1.60934,1);
427
-		        $body_parse = substr($body_parse,strlen($matches[0])+1);
428
-		    } elseif (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})g([0-9 \\.]+)/',$body_parse,$matches)) {
427
+				$body_parse = substr($body_parse,strlen($matches[0])+1);
428
+			} elseif (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})g([0-9 \\.]+)/',$body_parse,$matches)) {
429 429
 			$result['wind_dir'] = intval($matches[1]);
430 430
 			$result['wind_speed'] = round($matches[2]*1.60934,1);
431 431
 			$result['wind_gust'] = round($matches[3]*1.60934,1);
432
-		        $body_parse = substr($body_parse,strlen($matches[0])+1);
433
-		    }
434
-		    if (!isset($result['temp']) && strlen($body_parse) > 0 && preg_match('/^g([0-9]+)t(-?[0-9 \\.]{1,3})/',$body_parse,$matches)) {
432
+				$body_parse = substr($body_parse,strlen($matches[0])+1);
433
+			}
434
+			if (!isset($result['temp']) && strlen($body_parse) > 0 && preg_match('/^g([0-9]+)t(-?[0-9 \\.]{1,3})/',$body_parse,$matches)) {
435 435
 			$result['temp'] = round(5/9*(($matches[1])-32),1);
436
-		    }
436
+			}
437 437
 		}
438 438
 		} else $result['comment'] = trim($body_parse);
439 439
 
440
-	    }
440
+		}
441 441
 	//}
442 442
 	if (isset($result['latitude'])) $result['latitude'] = round($result['latitude'],4);
443 443
 	if (isset($result['longitude'])) $result['longitude'] = round($result['longitude'],4);
444 444
 	if ($debug) print_r($result);
445 445
 	return $result;
446
-    }
446
+	}
447 447
     
448
-    public function connect() {
448
+	public function connect() {
449 449
 	global $globalAPRSversion, $globalServerAPRSssid, $globalServerAPRSpass,$globalName, $globalServerAPRShost, $globalServerAPRSport;
450 450
 	$aprs_connect = 0;
451 451
 	$aprs_keep = 120;
@@ -469,24 +469,24 @@  discard block
 block discarded – undo
469 469
 		socket_set_option($this->socket,SOL_SOCKET,SO_KEEPALIVE,1);
470 470
 		while ($msgin = socket_read($this->socket, 1000,PHP_NORMAL_READ)) {
471 471
 			if (strpos($msgin, "$aprs_ssid verified") !== FALSE) {
472
-			    echo 'APRS user verified !'."\n";
473
-			    $this->connected = true;
474
-			    return true;
475
-			    break;
472
+				echo 'APRS user verified !'."\n";
473
+				$this->connected = true;
474
+				return true;
475
+				break;
476 476
 			}
477 477
 			if (time()-$authstart > 5) {
478
-			    echo 'APRS timeout'."\n";
479
-			    break;
478
+				echo 'APRS timeout'."\n";
479
+				break;
480 480
 			}
481 481
 		}
482 482
 	}
483
-    }
483
+	}
484 484
 
485
-    public function disconnect() {
485
+	public function disconnect() {
486 486
 	socket_close($this->socket);
487
-    }
487
+	}
488 488
     
489
-    public function send($data) {
489
+	public function send($data) {
490 490
 	global $globalDebug;
491 491
 	if ($this->connected === false) $this->connect();
492 492
 	$send = socket_send( $this->socket  , $data , strlen($data),0);
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 		socket_close($this->socket);
496 496
 		$this->connect();
497 497
 	}
498
-    }
498
+	}
499 499
 }
500 500
 
501 501
 class APRSSpotter extends APRS {
Please login to merge, or discard this patch.
location-data.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,9 +46,9 @@
 block discarded – undo
46 46
 print '</div>';
47 47
 
48 48
 if ($spotter_item['description'] != '') {
49
-    print '<div class="notamtext"><span>'._("Info").'</span>';
50
-    print $spotter_item['description'];
51
-    print '</div>';
49
+	print '<div class="notamtext"><span>'._("Info").'</span>';
50
+	print $spotter_item['description'];
51
+	print '</div>';
52 52
 }
53 53
 
54 54
 print '</div>';
Please login to merge, or discard this patch.
index.php 1 patch
Indentation   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     <?php }; if (isset($globalTracker) && $globalTracker) { ?><td><div id="ibxtracker"><h4><?php echo _("Trackers Detected"); ?></h4><br /><i class="fa fa-spinner fa-pulse fa-fw"></i></div></td><?php } ?>
41 41
 </tr></table></div>
42 42
 <?php
43
-    if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
43
+	if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
44 44
 
45 45
 ?>
46 46
 <script src="<?php echo $globalURL; ?>/js/map.3d.js.php"></script>
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 <script src="<?php echo $globalURL; ?>/js/map-marine.3d.js.php"></script>
61 61
 <?php
62 62
 	}
63
-    }
63
+	}
64 64
 ?>
65 65
 <div id="dialog" title="<?php echo _("Session has timed-out"); ?>">
66 66
   <p><?php echo _("In order to save data consumption web page times out after 30 minutes. Close this dialog to continue."); ?></p>
@@ -74,34 +74,34 @@  discard block
 block discarded – undo
74 74
 	<li><a href="#" onclick="getUserLocation(); return false;" title="<?php echo _("Plot your Location"); ?>"><i class="fa fa-map-marker"></i></a></li>
75 75
 	<li><a href="#" onclick="getCompassDirection(); return false;" title="<?php echo _("Compass Mode"); ?>"><i class="fa fa-compass"></i></a></li>
76 76
 <?php
77
-    if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
77
+	if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
78 78
 	if (isset($globalArchive) && $globalArchive == TRUE) {
79 79
 ?>
80 80
 	<li><a href="#archive" role="tab" title="<?php echo _("Archive"); ?>"><i class="fa fa-archive"></i></a></li>
81 81
 <?php
82 82
 	}
83
-    }
83
+	}
84 84
 ?>
85 85
 	<li><a href="#home" role="tab" title="<?php echo _("Layers"); ?>"><i class="fa fa-map"></i></a></li>
86 86
 	<li><a href="#filters" role="tab" title="<?php echo _("Filters"); ?>"><i class="fa fa-filter"></i></a></li>
87 87
 	<li><a href="#settings" role="tab" title="<?php echo _("Settings"); ?>"><i class="fa fa-gears"></i></a></li>
88 88
 <?php
89
-    if (isset($globalMap3D) && $globalMap3D) {
89
+	if (isset($globalMap3D) && $globalMap3D) {
90 90
 	if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
91 91
 ?>
92 92
 	<li><a href="#" onclick="show3D(); return false;" role="tab" title="3D"><b>3D</b></a></li>
93 93
 <?php
94
-        } else {
95
-    	    if (isset($globalMapSatellites) && $globalMapSatellites) {
94
+		} else {
95
+			if (isset($globalMapSatellites) && $globalMapSatellites) {
96 96
 ?>
97 97
 	<li><a href="#satellites" role="tab" title="<?php echo _("Satellites"); ?>"><i class="satellite"></i></a></li>
98 98
 <?php
99
-	    }
99
+		}
100 100
 ?>
101 101
 	<li><a href="#" onclick="show2D(); return false;" role="tab" title="2D"><b>2D</b></a></li>
102 102
 <?php
103 103
 	}
104
-    }
104
+	}
105 105
 ?>
106 106
     </ul>
107 107
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 ?>
176 176
         </div>
177 177
 <?php
178
-    if (isset($globalArchive) && $globalArchive == TRUE) {
178
+	if (isset($globalArchive) && $globalArchive == TRUE) {
179 179
 ?>
180 180
         <div class="sidebar-pane" id="archive">
181 181
 	    <h1 class="sidebar-header"><?php echo _("Playback"); ?> <i>Bêta</i><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 	    </form>
236 236
 	</div>
237 237
 <?php
238
-    }
238
+	}
239 239
 ?>
240 240
         <div class="sidebar-pane" id="settings">
241 241
 	    <h1 class="sidebar-header"><?php echo _("Settings"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
@@ -246,56 +246,56 @@  discard block
 block discarded – undo
246 246
 			    <?php
247 247
 				if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider;
248 248
 				else $MapType = $_COOKIE['MapType'];
249
-			    ?>
249
+				?>
250 250
 			    <?php
251 251
 				if (isset($globalBingMapKey) && $globalBingMapKey != '') {
252
-			    ?>
252
+				?>
253 253
 			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option>
254 254
 			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option>
255 255
 			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option>
256 256
 			    <?php
257 257
 				}
258
-			    ?>
258
+				?>
259 259
 			    <?php
260
-			        if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
261
-			    ?>
260
+					if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
261
+				?>
262 262
 			    <?php
263
-				    if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
264
-			    ?>
263
+					if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
264
+				?>
265 265
 			    <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option>
266 266
 			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option>
267 267
 			    <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option>
268 268
 			    <?php
269
-				    }
270
-			    ?>
269
+					}
270
+				?>
271 271
 			    <?php
272
-				    if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
273
-			    ?>
272
+					if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
273
+				?>
274 274
 			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option>
275 275
 			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option>
276 276
 			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option>
277 277
 			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option>
278 278
 			    <?php
279
-				    }
280
-			    ?>
279
+					}
280
+				?>
281 281
 			    <?php
282
-				    if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
283
-			    ?>
282
+					if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
283
+				?>
284 284
 			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option>
285 285
 			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option>
286 286
 			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option>
287 287
 			    <?php
288
-				    }
289
-			    ?>
288
+					}
289
+				?>
290 290
 			    <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option>
291 291
 			    <?php
292 292
 				}
293
-			    ?>
293
+				?>
294 294
 			    <?php
295
-				    if (isset($globalMapboxToken) && $globalMapboxToken != '') {
295
+					if (isset($globalMapboxToken) && $globalMapboxToken != '') {
296 296
 					if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default';
297 297
 					else $MapBoxId = $_COOKIE['MapTypeId'];
298
-			    ?>
298
+				?>
299 299
 			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option>
300 300
 			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option>
301 301
 			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option>
@@ -309,13 +309,13 @@  discard block
 block discarded – undo
309 309
 			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option>
310 310
 			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option>
311 311
 			    <?php
312
-				    }
313
-			    ?>
312
+					}
313
+				?>
314 314
 			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option>
315 315
 			</select>
316 316
 		    </li>
317 317
 <?php
318
-    if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
318
+	if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
319 319
 ?>
320 320
 		    <li><?php echo _("Type of Terrain:"); ?>
321 321
 			<select  class="selectpicker" onchange="terrainType(this);">
@@ -325,10 +325,10 @@  discard block
 block discarded – undo
325 325
 			</select>
326 326
 		    </li>
327 327
 <?php
328
-    }
328
+	}
329 329
 ?>
330 330
 <?php
331
-    if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
331
+	if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
332 332
 ?>
333 333
 		    
334 334
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') print 'checked'; ?> ><?php echo _("Display flight info as popup"); ?></label></div></li>
@@ -337,76 +337,76 @@  discard block
 block discarded – undo
337 337
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || !isset($_COOKIE['MapRemainingRoute']) || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) print 'checked'; ?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li>
338 338
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
339 339
 <?php
340
-    }
340
+	}
341 341
 ?>
342 342
 		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true') print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li>
343 343
 		    <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) print 'checked'; ?> ><?php echo _("Display ground station on map"); ?></label></div></li>
344 344
 <?php
345
-    if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
345
+	if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
346 346
 ?>
347 347
 		    <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li>
348 348
 <?php
349
-    }
350
-    if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) {
349
+	}
350
+	if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) {
351 351
 ?>
352 352
 		    <li><div class="checkbox"><label><input type="checkbox" name="displaysanta" value="1" onclick="clickSanta(this)"><i class="fa fa-snowflake-o" aria-hidden="true"></i> <?php echo _("Show Santa Claus now"); ?> <i class="fa fa-snowflake-o" aria-hidden="true"></i></label></div></li>
353 353
 <?php
354
-    }
354
+	}
355 355
 ?>
356 356
 
357 357
 		    <?php
358 358
 			if (function_exists('array_column')) {
359
-			    if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
360
-		    ?>
359
+				if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
360
+			?>
361 361
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
362 362
 		    <?php
363
-			    }
363
+				}
364 364
 			} elseif (isset($globalSources)) {
365
-			    $dispolar = false;
366
-			    foreach ($globalSources as $testsource) {
367
-			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
368
-			    }
369
-			    if ($dispolar) {
370
-		    ?>
365
+				$dispolar = false;
366
+				foreach ($globalSources as $testsource) {
367
+					if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
368
+				}
369
+				if ($dispolar) {
370
+			?>
371 371
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
372 372
 		    <?php
373
-			    }
374
-		        }
375
-		    ?>
373
+				}
374
+				}
375
+			?>
376 376
 <?php
377
-    if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
377
+	if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
378 378
 ?>
379 379
 
380 380
 		    <?php
381 381
 			if (!isset($globalAircraft) || $globalAircraft === TRUE) {
382
-		    	    if (extension_loaded('gd') && function_exists('gd_info')) {
383
-		    ?>
382
+					if (extension_loaded('gd') && function_exists('gd_info')) {
383
+			?>
384 384
 		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
385 385
 		    <?php 
386 386
 				if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') {
387
-		    ?>
387
+			?>
388 388
 		    <li><?php echo _("Aircraft icon color:"); ?>
389 389
 			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>">
390 390
 		    </li>
391 391
 		    <?php
392 392
 				}
393
-			    }
394
-		        }
395
-		    ?>
393
+				}
394
+				}
395
+			?>
396 396
 		    <?php
397 397
 			if (isset($globalMarine) && $globalMarine === TRUE) {
398
-			    if (extension_loaded('gd') && function_exists('gd_info')) {
399
-		    ?>
398
+				if (extension_loaded('gd') && function_exists('gd_info')) {
399
+			?>
400 400
 		    <li><?php echo _("Marine icon color:"); ?>
401 401
 			<input type="color" name="marinecolor" id="html5colorpicker" onchange="iconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>">
402 402
 		    </li>
403 403
 		    <?php
404
-			    }
405
-		        }
406
-		    ?>
404
+				}
405
+				}
406
+			?>
407 407
 		    <?php
408 408
 			if (!isset($globalAircraft) || $globalAircraft === TRUE) {
409
-		    ?>
409
+			?>
410 410
 		    <li><?php echo _("Show airport icon at zoom level:"); ?>
411 411
 			<div class="range">
412 412
 			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>">
@@ -415,9 +415,9 @@  discard block
 block discarded – undo
415 415
 		    </li>
416 416
 		    <?php
417 417
 			}
418
-		    ?>
418
+			?>
419 419
 <?php
420
-    } elseif (isset($_COOKIE['MapFormat']) || $_COOKIE['MapFOrmat'] == '3d') {
420
+	} elseif (isset($_COOKIE['MapFormat']) || $_COOKIE['MapFOrmat'] == '3d') {
421 421
 ?>
422 422
 <?php
423 423
 	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 		    </li>
439 439
 <?php
440 440
 	}
441
-    }
441
+	}
442 442
 ?>
443 443
 		    <li><?php echo _("Distance unit:"); ?>
444 444
 			<select class="selectpicker" onchange="unitdistance(this);">
@@ -471,19 +471,19 @@  discard block
 block discarded – undo
471 471
 		    <ul>
472 472
 		    <?php
473 473
 			if (!isset($globalAircraft) || $globalAircraft) {
474
-		    ?>
474
+			?>
475 475
 		    <?php
476 476
 			if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) {
477
-		    ?>
477
+			?>
478 478
 			<?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
479 479
 			<?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
480 480
 			<?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
481 481
 		    <?php
482 482
 			}
483
-		    ?>
483
+			?>
484 484
 		    <?php
485 485
 			if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) {
486
-		    ?>
486
+			?>
487 487
 			<?php if (isset($globalSBS1) && $globalSBS1) { ?>
488 488
 			    <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
489 489
 			<?php } ?>
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 			<?php } ?>
493 493
 		    <?php
494 494
 			}
495
-		    ?>
495
+			?>
496 496
 		    <li><?php echo _("Display airlines:"); ?>
497 497
 		    <br/>
498 498
 			<select class="selectpicker" multiple onchange="airlines(this);" id="display_airlines">
@@ -512,14 +512,14 @@  discard block
 block discarded – undo
512 512
 						echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>';
513 513
 					}
514 514
 				}
515
-			    ?>
515
+				?>
516 516
 			</select>
517 517
 		    </li>
518 518
 		    <?php
519 519
 			$Spotter = new Spotter();
520 520
 			$allalliancenames = $Spotter->getAllAllianceNames();
521 521
 			if (!empty($allalliancenames)) {
522
-		    ?>
522
+			?>
523 523
 		    <li><?php echo _("Display alliance:"); ?>
524 524
 		    <br/>
525 525
 			<select class="selectpicker" onchange="alliance(this);" id="display_alliance">
@@ -533,18 +533,18 @@  discard block
 block discarded – undo
533 533
 						echo '<option value="'.$alliance_name.'">'.$alliance_name.'</option>';
534 534
 					}
535 535
 				}
536
-			    ?>
536
+				?>
537 537
 			</select>
538 538
 		    </li>
539 539
 		    <?php
540 540
 			}
541
-		    ?>
541
+			?>
542 542
 		    <?php
543 543
 			}
544
-		    ?>
544
+			?>
545 545
 		    <?php
546 546
 			if (isset($globalAPRS) && $globalAPRS) {
547
-		    ?>
547
+			?>
548 548
 		    <li><?php echo _("Display APRS sources name:"); ?>
549 549
 			<select class="selectpicker" multiple onchange="sources(this);">
550 550
 			    <?php
@@ -556,18 +556,18 @@  discard block
 block discarded – undo
556 556
 						echo '<option value="'.$source['source_name'].'">'.$source['source_name'].'</option>';
557 557
 					}
558 558
 				}
559
-			    ?>
559
+				?>
560 560
 			</select>
561 561
 		    </li>
562 562
 		    <?php
563 563
 			}
564
-		    ?>
564
+			?>
565 565
 		    <?php
566 566
 			if (!isset($globalAircraft) && $globalAircraft) {
567
-		    ?>
567
+			?>
568 568
 		    <?php
569 569
 			if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) {
570
-		    ?>
570
+			?>
571 571
 		    <li><?php echo _("Display airlines of type:"); ?><br/>
572 572
 			<select class="selectpicker" onchange="airlinestype(this);">
573 573
 			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
@@ -578,14 +578,14 @@  discard block
 block discarded – undo
578 578
 		    </li>
579 579
 		    <?php
580 580
 			}
581
-		    ?>
581
+			?>
582 582
 		    <li>
583 583
 			<?php echo _("Display flight with ident:"); ?>
584 584
 			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" />
585 585
 		    </li>
586 586
 		    <?php
587 587
 			}
588
-		    ?>
588
+			?>
589 589
 		</ul>
590 590
 	    </form>
591 591
 	    <form method="post">
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 	    </form>
595 595
     	</div>
596 596
 <?php
597
-    if (isset($globalMapSatellites) && $globalMapSatellites && isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
597
+	if (isset($globalMapSatellites) && $globalMapSatellites && isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
598 598
 ?>
599 599
         <div class="sidebar-pane" id="satellites">
600 600
 	    <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
@@ -634,14 +634,14 @@  discard block
 block discarded – undo
634 634
 						print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>';
635 635
 					}
636 636
 				}
637
-			    ?>
637
+				?>
638 638
 			</select>
639 639
 		    </li>
640 640
 		</ul>
641 641
 	    </form>
642 642
 	</div>
643 643
 <?php
644
-    }
644
+	}
645 645
 ?>
646 646
     </div>
647 647
 </div>
Please login to merge, or discard this patch.
location-geojson.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
 		$coords = explode(',',$_GET['coord']);
17 17
 //		$spotter_array = Source::getAllLocationInfobyCoord($coords);
18 18
 		if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') 
19
-		    || (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) {
19
+			|| (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) {
20 20
 			$spotter_array = $Source->getAllLocationInfo();
21 21
 		} else {
22 22
 			$spotter_array = $Source->getLocationInfoByType('');
23 23
 		}
24 24
 	} else {
25 25
 		if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') 
26
-		    || (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) {
26
+			|| (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) {
27 27
 			$spotter_array = $Source->getAllLocationInfo();
28 28
 		} else {
29 29
 			$spotter_array = $Source->getLocationInfoByType('');
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 		date_default_timezone_set('UTC');
40 40
 		//waypoint plotting
41 41
 		$output .= '{"type": "Feature",';
42
-		    $output .= '"properties": {';
42
+			$output .= '"properties": {';
43 43
 			$output .= '"id": "'.$spotter_item['id'].'",';
44 44
 			$output .= '"location_id": "'.$spotter_item['location_id'].'",';
45 45
 			$output .= '"name": "'.$spotter_item['name'].'",';
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
 			$output .= '"icon": "'.$globalURL.'/images/'.$spotter_item['logo'].'",';
54 54
 			$output .= '"type": "'.$spotter_item['type'].'",';
55 55
 			$output .= '"image_thumb": "'.$spotter_item['image_thumb'].'"';
56
-		    $output .= '},';
57
-		    $output .= '"geometry": {';
56
+			$output .= '},';
57
+			$output .= '"geometry": {';
58 58
 			$output .= '"type": "Point",';
59 59
 			$output .= '"coordinates": [';
60
-			    $output .= $spotter_item['longitude'].', '.$spotter_item['latitude'];
60
+				$output .= $spotter_item['longitude'].', '.$spotter_item['latitude'];
61 61
 			$output .= ']';
62
-		    $output .= '}';
62
+			$output .= '}';
63 63
 		$output .= '},';
64 64
 	}
65 65
 	$output  = substr($output, 0, -1);
Please login to merge, or discard this patch.
install/class.update_db.php 1 patch
Indentation   +460 added lines, -460 removed lines patch added patch discarded remove patch
@@ -76,38 +76,38 @@  discard block
 block discarded – undo
76 76
 		try {
77 77
 			//$Connection = new Connection();
78 78
 			$sth = $Connection->db->prepare($query);
79
-                        $sth->execute(array(':source' => $database_file));
80
-                } catch(PDOException $e) {
81
-                        return "error : ".$e->getMessage();
82
-                }
79
+						$sth->execute(array(':source' => $database_file));
80
+				} catch(PDOException $e) {
81
+						return "error : ".$e->getMessage();
82
+				}
83 83
 
84
-    		if ($globalDebug) echo " - Add routes to DB -";
85
-    		update_db::connect_sqlite($database_file);
84
+			if ($globalDebug) echo " - Add routes to DB -";
85
+			update_db::connect_sqlite($database_file);
86 86
 		//$query = 'select Route.RouteID, Route.callsign, operator.Icao AS operator_icao, FromAir.Icao AS FromAirportIcao, ToAir.Icao AS ToAirportIcao from Route inner join operator ON Route.operatorId = operator.operatorId LEFT JOIN Airport AS FromAir ON route.FromAirportId = FromAir.AirportId LEFT JOIN Airport AS ToAir ON ToAir.AirportID = route.ToAirportID';
87 87
 		$query = "select Route.RouteID, Route.callsign, operator.Icao AS operator_icao, FromAir.Icao AS FromAirportIcao, ToAir.Icao AS ToAirportIcao, rstp.allstop AS AllStop from Route inner join operator ON Route.operatorId = operator.operatorId LEFT JOIN Airport AS FromAir ON route.FromAirportId = FromAir.AirportId LEFT JOIN Airport AS ToAir ON ToAir.AirportID = route.ToAirportID LEFT JOIN (select RouteId,GROUP_CONCAT(icao,' ') as allstop from routestop left join Airport as air ON routestop.AirportId = air.AirportID group by RouteID) AS rstp ON Route.RouteID = rstp.RouteID";
88 88
 		try {
89
-                        $sth = update_db::$db_sqlite->prepare($query);
90
-                        $sth->execute();
91
-                } catch(PDOException $e) {
92
-                        return "error : ".$e->getMessage();
93
-                }
89
+						$sth = update_db::$db_sqlite->prepare($query);
90
+						$sth->execute();
91
+				} catch(PDOException $e) {
92
+						return "error : ".$e->getMessage();
93
+				}
94 94
 		//$query_dest = 'INSERT INTO routes (`RouteID`,`CallSign`,`Operator_ICAO`,`FromAirport_ICAO`,`ToAirport_ICAO`,`RouteStop`,`Source`) VALUES (:RouteID, :CallSign, :Operator_ICAO, :FromAirport_ICAO, :ToAirport_ICAO, :routestop, :source)';
95 95
 		$query_dest = 'INSERT INTO routes (CallSign,Operator_ICAO,FromAirport_ICAO,ToAirport_ICAO,RouteStop,Source) VALUES (:CallSign, :Operator_ICAO, :FromAirport_ICAO, :ToAirport_ICAO, :routestop, :source)';
96 96
 		$Connection = new Connection();
97 97
 		$sth_dest = $Connection->db->prepare($query_dest);
98 98
 		try {
99 99
 			if ($globalTransaction) $Connection->db->beginTransaction();
100
-            		while ($values = $sth->fetch(PDO::FETCH_ASSOC)) {
100
+					while ($values = $sth->fetch(PDO::FETCH_ASSOC)) {
101 101
 				//$query_dest_values = array(':RouteID' => $values['RouteId'],':CallSign' => $values['Callsign'],':Operator_ICAO' => $values['operator_icao'],':FromAirport_ICAO' => $values['FromAirportIcao'],':ToAirport_ICAO' => $values['ToAirportIcao'],':routestop' => $values['AllStop'],':source' => $database_file);
102 102
 				$query_dest_values = array(':CallSign' => $values['Callsign'],':Operator_ICAO' => $values['operator_icao'],':FromAirport_ICAO' => $values['FromAirportIcao'],':ToAirport_ICAO' => $values['ToAirportIcao'],':routestop' => $values['AllStop'],':source' => $database_file);
103 103
 				$sth_dest->execute($query_dest_values);
104
-            		}
104
+					}
105 105
 			if ($globalTransaction) $Connection->db->commit();
106 106
 		} catch(PDOException $e) {
107 107
 			if ($globalTransaction) $Connection->db->rollBack(); 
108 108
 			return "error : ".$e->getMessage();
109 109
 		}
110
-                return '';
110
+				return '';
111 111
 	}
112 112
 	public static function retrieve_route_oneworld($database_file) {
113 113
 		global $globalDebug, $globalTransaction;
@@ -118,12 +118,12 @@  discard block
 block discarded – undo
118 118
 		try {
119 119
 			//$Connection = new Connection();
120 120
 			$sth = $Connection->db->prepare($query);
121
-                        $sth->execute(array(':source' => 'oneworld'));
122
-                } catch(PDOException $e) {
123
-                        return "error : ".$e->getMessage();
124
-                }
121
+						$sth->execute(array(':source' => 'oneworld'));
122
+				} catch(PDOException $e) {
123
+						return "error : ".$e->getMessage();
124
+				}
125 125
 
126
-    		if ($globalDebug) echo " - Add routes to DB -";
126
+			if ($globalDebug) echo " - Add routes to DB -";
127 127
 		require_once(dirname(__FILE__).'/../require/class.Spotter.php');
128 128
 		$Spotter = new Spotter();
129 129
 		if ($fh = fopen($database_file,"r")) {
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 			}
148 148
 			if ($globalTransaction) $Connection->db->commit();
149 149
 		}
150
-                return '';
150
+				return '';
151 151
 	}
152 152
 	
153 153
 	public static function retrieve_route_skyteam($database_file) {
@@ -159,12 +159,12 @@  discard block
 block discarded – undo
159 159
 		try {
160 160
 			//$Connection = new Connection();
161 161
 			$sth = $Connection->db->prepare($query);
162
-                        $sth->execute(array(':source' => 'skyteam'));
163
-                } catch(PDOException $e) {
164
-                        return "error : ".$e->getMessage();
165
-                }
162
+						$sth->execute(array(':source' => 'skyteam'));
163
+				} catch(PDOException $e) {
164
+						return "error : ".$e->getMessage();
165
+				}
166 166
 
167
-    		if ($globalDebug) echo " - Add routes to DB -";
167
+			if ($globalDebug) echo " - Add routes to DB -";
168 168
 
169 169
 		require_once(dirname(__FILE__).'/../require/class.Spotter.php');
170 170
 		$Spotter = new Spotter();
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 				return "error : ".$e->getMessage();
191 191
 			}
192 192
 		}
193
-                return '';
193
+				return '';
194 194
 	}
195 195
 	public static function retrieve_modes_sqlite_to_dest($database_file) {
196 196
 		global $globalTransaction;
@@ -199,27 +199,27 @@  discard block
 block discarded – undo
199 199
 		try {
200 200
 			$Connection = new Connection();
201 201
 			$sth = $Connection->db->prepare($query);
202
-                        $sth->execute(array(':source' => $database_file));
203
-                } catch(PDOException $e) {
204
-                        return "error : ".$e->getMessage();
205
-                }
202
+						$sth->execute(array(':source' => $database_file));
203
+				} catch(PDOException $e) {
204
+						return "error : ".$e->getMessage();
205
+				}
206 206
 		$query = "DELETE FROM aircraft_owner WHERE Source = '' OR Source IS NULL OR Source = :source";
207 207
 		try {
208 208
 			$Connection = new Connection();
209 209
 			$sth = $Connection->db->prepare($query);
210
-                        $sth->execute(array(':source' => $database_file));
211
-                } catch(PDOException $e) {
212
-                        return "error : ".$e->getMessage();
213
-                }
210
+						$sth->execute(array(':source' => $database_file));
211
+				} catch(PDOException $e) {
212
+						return "error : ".$e->getMessage();
213
+				}
214 214
 
215
-    		update_db::connect_sqlite($database_file);
215
+			update_db::connect_sqlite($database_file);
216 216
 		$query = 'select * from Aircraft';
217 217
 		try {
218
-                        $sth = update_db::$db_sqlite->prepare($query);
219
-                        $sth->execute();
220
-                } catch(PDOException $e) {
221
-                        return "error : ".$e->getMessage();
222
-                }
218
+						$sth = update_db::$db_sqlite->prepare($query);
219
+						$sth->execute();
220
+				} catch(PDOException $e) {
221
+						return "error : ".$e->getMessage();
222
+				}
223 223
 		//$query_dest = 'INSERT INTO aircraft_modes (`AircraftID`,`FirstCreated`,`LastModified`, `ModeS`,`ModeSCountry`,`Registration`,`ICAOTypeCode`,`SerialNo`, `OperatorFlagCode`, `Manufacturer`, `Type`, `FirstRegDate`, `CurrentRegDate`, `Country`, `PreviousID`, `DeRegDate`, `Status`, `PopularName`,`GenericName`,`AircraftClass`, `Engines`, `OwnershipStatus`,`RegisteredOwners`,`MTOW`, `TotalHours`, `YearBuilt`, `CofACategory`, `CofAExpiry`, `UserNotes`, `Interested`, `UserTag`, `InfoUrl`, `PictureUrl1`, `PictureUrl2`, `PictureUrl3`, `UserBool1`, `UserBool2`, `UserBool3`, `UserBool4`, `UserBool5`, `UserString1`, `UserString2`, `UserString3`, `UserString4`, `UserString5`, `UserInt1`, `UserInt2`, `UserInt3`, `UserInt4`, `UserInt5`) VALUES (:AircraftID,:FirstCreated,:LastModified,:ModeS,:ModeSCountry,:Registration,:ICAOTypeCode,:SerialNo, :OperatorFlagCode, :Manufacturer, :Type, :FirstRegDate, :CurrentRegDate, :Country, :PreviousID, :DeRegDate, :Status, :PopularName,:GenericName,:AircraftClass, :Engines, :OwnershipStatus,:RegisteredOwners,:MTOW, :TotalHours,:YearBuilt, :CofACategory, :CofAExpiry, :UserNotes, :Interested, :UserTag, :InfoUrl, :PictureUrl1, :PictureUrl2, :PictureUrl3, :UserBool1, :UserBool2, :UserBool3, :UserBool4, :UserBool5, :UserString1, :UserString2, :UserString3, :UserString4, :UserString5, :UserInt1, :UserInt2, :UserInt3, :UserInt4, :UserInt5)';
224 224
 		$query_dest = 'INSERT INTO aircraft_modes (LastModified, ModeS,ModeSCountry,Registration,ICAOTypeCode,type_flight,Source) VALUES (:LastModified,:ModeS,:ModeSCountry,:Registration,:ICAOTypeCode,:type,:source)';
225 225
 		
@@ -230,17 +230,17 @@  discard block
 block discarded – undo
230 230
 		$sth_dest_owner = $Connection->db->prepare($query_dest_owner);
231 231
 		try {
232 232
 			if ($globalTransaction) $Connection->db->beginTransaction();
233
-            		while ($values = $sth->fetch(PDO::FETCH_ASSOC)) {
233
+					while ($values = $sth->fetch(PDO::FETCH_ASSOC)) {
234 234
 			//$query_dest_values = array(':AircraftID' => $values['AircraftID'],':FirstCreated' => $values['FirstCreated'],':LastModified' => $values['LastModified'],':ModeS' => $values['ModeS'],':ModeSCountry' => $values['ModeSCountry'],':Registration' => $values['Registration'],':ICAOTypeCode' => $values['ICAOTypeCode'],':SerialNo' => $values['SerialNo'], ':OperatorFlagCode' => $values['OperatorFlagCode'], ':Manufacturer' => $values['Manufacturer'], ':Type' => $values['Type'], ':FirstRegDate' => $values['FirstRegDate'], ':CurrentRegDate' => $values['CurrentRegDate'], ':Country' => $values['Country'], ':PreviousID' => $values['PreviousID'], ':DeRegDate' => $values['DeRegDate'], ':Status' => $values['Status'], ':PopularName' => $values['PopularName'],':GenericName' => $values['GenericName'],':AircraftClass' => $values['AircraftClass'], ':Engines' => $values['Engines'], ':OwnershipStatus' => $values['OwnershipStatus'],':RegisteredOwners' => $values['RegisteredOwners'],':MTOW' => $values['MTOW'], ':TotalHours' => $values['TotalHours'],':YearBuilt' => $values['YearBuilt'], ':CofACategory' => $values['CofACategory'], ':CofAExpiry' => $values['CofAExpiry'], ':UserNotes' => $values['UserNotes'], ':Interested' => $values['Interested'], ':UserTag' => $values['UserTag'], ':InfoUrl' => $values['InfoURL'], ':PictureUrl1' => $values['PictureURL1'], ':PictureUrl2' => $values['PictureURL2'], ':PictureUrl3' => $values['PictureURL3'], ':UserBool1' => $values['UserBool1'], ':UserBool2' => $values['UserBool2'], ':UserBool3' => $values['UserBool3'], ':UserBool4' => $values['UserBool4'], ':UserBool5' => $values['UserBool5'], ':UserString1' => $values['UserString1'], ':UserString2' => $values['UserString2'], ':UserString3' => $values['UserString3'], ':UserString4' => $values['UserString4'], ':UserString5' => $values['UserString5'], ':UserInt1' => $values['UserInt1'], ':UserInt2' => $values['UserInt2'], ':UserInt3' => $values['UserInt3'], ':UserInt4' => $values['UserInt4'], ':UserInt5' => $values['UserInt5']);
235 235
 				if ($values['UserString4'] == 'M') $type = 'military';
236 236
 				else $type = null;
237 237
 				$query_dest_values = array(':LastModified' => $values['LastModified'],':ModeS' => $values['ModeS'],':ModeSCountry' => $values['ModeSCountry'],':Registration' => $values['Registration'],':ICAOTypeCode' => $values['ICAOTypeCode'],':source' => $database_file,':type' => $type);
238 238
 				$sth_dest->execute($query_dest_values);
239 239
 				if ($values['RegisteredOwners'] != '' && $values['RegisteredOwners'] != NULL && $values['RegisteredOwners'] != 'Private') {
240
-				    $query_dest_owner_values = array(':registration' => $values['Registration'],':source' => $database_file,':owner' => $values['RegisteredOwners']);
241
-				    $sth_dest_owner->execute($query_dest_owner_values);
240
+					$query_dest_owner_values = array(':registration' => $values['Registration'],':source' => $database_file,':owner' => $values['RegisteredOwners']);
241
+					$sth_dest_owner->execute($query_dest_owner_values);
242 242
 				}
243
-            		}
243
+					}
244 244
 			if ($globalTransaction) $Connection->db->commit();
245 245
 		} catch(PDOException $e) {
246 246
 			return "error : ".$e->getMessage();
@@ -251,10 +251,10 @@  discard block
 block discarded – undo
251 251
 		try {
252 252
 			$Connection = new Connection();
253 253
 			$sth = $Connection->db->prepare($query);
254
-                        $sth->execute(array(':source' => $database_file));
255
-                } catch(PDOException $e) {
256
-                        return "error : ".$e->getMessage();
257
-                }
254
+						$sth->execute(array(':source' => $database_file));
255
+				} catch(PDOException $e) {
256
+						return "error : ".$e->getMessage();
257
+				}
258 258
 		return '';
259 259
 	}
260 260
 
@@ -266,10 +266,10 @@  discard block
 block discarded – undo
266 266
 		try {
267 267
 			$Connection = new Connection();
268 268
 			$sth = $Connection->db->prepare($query);
269
-                        $sth->execute(array(':source' => $database_file));
270
-                } catch(PDOException $e) {
271
-                        return "error : ".$e->getMessage();
272
-                }
269
+						$sth->execute(array(':source' => $database_file));
270
+				} catch(PDOException $e) {
271
+						return "error : ".$e->getMessage();
272
+				}
273 273
 		
274 274
 		if ($fh = fopen($database_file,"r")) {
275 275
 			//$query_dest = 'INSERT INTO aircraft_modes (`AircraftID`,`FirstCreated`,`LastModified`, `ModeS`,`ModeSCountry`,`Registration`,`ICAOTypeCode`,`SerialNo`, `OperatorFlagCode`, `Manufacturer`, `Type`, `FirstRegDate`, `CurrentRegDate`, `Country`, `PreviousID`, `DeRegDate`, `Status`, `PopularName`,`GenericName`,`AircraftClass`, `Engines`, `OwnershipStatus`,`RegisteredOwners`,`MTOW`, `TotalHours`, `YearBuilt`, `CofACategory`, `CofAExpiry`, `UserNotes`, `Interested`, `UserTag`, `InfoUrl`, `PictureUrl1`, `PictureUrl2`, `PictureUrl3`, `UserBool1`, `UserBool2`, `UserBool3`, `UserBool4`, `UserBool5`, `UserString1`, `UserString2`, `UserString3`, `UserString4`, `UserString5`, `UserInt1`, `UserInt2`, `UserInt3`, `UserInt4`, `UserInt5`) VALUES (:AircraftID,:FirstCreated,:LastModified,:ModeS,:ModeSCountry,:Registration,:ICAOTypeCode,:SerialNo, :OperatorFlagCode, :Manufacturer, :Type, :FirstRegDate, :CurrentRegDate, :Country, :PreviousID, :DeRegDate, :Status, :PopularName,:GenericName,:AircraftClass, :Engines, :OwnershipStatus,:RegisteredOwners,:MTOW, :TotalHours,:YearBuilt, :CofACategory, :CofAExpiry, :UserNotes, :Interested, :UserTag, :InfoUrl, :PictureUrl1, :PictureUrl2, :PictureUrl3, :UserBool1, :UserBool2, :UserBool3, :UserBool4, :UserBool5, :UserString1, :UserString2, :UserString3, :UserString4, :UserString5, :UserInt1, :UserInt2, :UserInt3, :UserInt4, :UserInt5)';
@@ -279,26 +279,26 @@  discard block
 block discarded – undo
279 279
 			$sth_dest = $Connection->db->prepare($query_dest);
280 280
 			try {
281 281
 				if ($globalTransaction) $Connection->db->beginTransaction();
282
-            			while (!feof($fh)) {
283
-            				$values = array();
284
-            				$line = $Common->hex2str(fgets($fh,9999));
282
+						while (!feof($fh)) {
283
+							$values = array();
284
+							$line = $Common->hex2str(fgets($fh,9999));
285 285
 					//FFFFFF                     RIDEAU VALLEY SOARINGASW-20               C-FBKN MZ 123.400
286
-            				$values['ModeS'] = substr($line,0,6);
287
-            				$values['Registration'] = trim(substr($line,69,6));
288
-            				$aircraft_name = trim(substr($line,48,6));
289
-            				// Check if we can find ICAO, else set it to GLID
290
-            				$aircraft_name_split = explode(' ',$aircraft_name);
291
-            				$search_more = '';
292
-            				if (count($aircraft_name) > 1 && strlen($aircraft_name_split[1]) > 3) $search_more .= " AND LIKE '%".$aircraft_name_split[0]."%'";
293
-            				$query_search = "SELECT * FROM aircraft WHERE type LIKE '%".$aircraft_name."%'".$search_more;
294
-            				$sth_search = $Connection->db->prepare($query_search);
286
+							$values['ModeS'] = substr($line,0,6);
287
+							$values['Registration'] = trim(substr($line,69,6));
288
+							$aircraft_name = trim(substr($line,48,6));
289
+							// Check if we can find ICAO, else set it to GLID
290
+							$aircraft_name_split = explode(' ',$aircraft_name);
291
+							$search_more = '';
292
+							if (count($aircraft_name) > 1 && strlen($aircraft_name_split[1]) > 3) $search_more .= " AND LIKE '%".$aircraft_name_split[0]."%'";
293
+							$query_search = "SELECT * FROM aircraft WHERE type LIKE '%".$aircraft_name."%'".$search_more;
294
+							$sth_search = $Connection->db->prepare($query_search);
295 295
 					try {
296
-                                    		$sth_search->execute();
297
-	            				$result = $sth_search->fetch(PDO::FETCH_ASSOC);
298
-	            				//if (count($result) > 0) {
299
-	            				if (isset($result['icao']) && $result['icao'] != '') {
300
-	            				    $values['ICAOTypeCode'] = $result['icao'];
301
-	            				} 
296
+											$sth_search->execute();
297
+								$result = $sth_search->fetch(PDO::FETCH_ASSOC);
298
+								//if (count($result) > 0) {
299
+								if (isset($result['icao']) && $result['icao'] != '') {
300
+									$values['ICAOTypeCode'] = $result['icao'];
301
+								} 
302 302
 					} catch(PDOException $e) {
303 303
 						return "error : ".$e->getMessage();
304 304
 					}
@@ -321,10 +321,10 @@  discard block
 block discarded – undo
321 321
 		try {
322 322
 			$Connection = new Connection();
323 323
 			$sth = $Connection->db->prepare($query);
324
-                        $sth->execute(array(':source' => $database_file));
325
-                } catch(PDOException $e) {
326
-                        return "error : ".$e->getMessage();
327
-                }
324
+						$sth->execute(array(':source' => $database_file));
325
+				} catch(PDOException $e) {
326
+						return "error : ".$e->getMessage();
327
+				}
328 328
 		return '';
329 329
 	}
330 330
 
@@ -335,10 +335,10 @@  discard block
 block discarded – undo
335 335
 		try {
336 336
 			$Connection = new Connection();
337 337
 			$sth = $Connection->db->prepare($query);
338
-                        $sth->execute(array(':source' => $database_file));
339
-                } catch(PDOException $e) {
340
-                        return "error : ".$e->getMessage();
341
-                }
338
+						$sth->execute(array(':source' => $database_file));
339
+				} catch(PDOException $e) {
340
+						return "error : ".$e->getMessage();
341
+				}
342 342
 		
343 343
 		if ($fh = fopen($database_file,"r")) {
344 344
 			//$query_dest = 'INSERT INTO aircraft_modes (`AircraftID`,`FirstCreated`,`LastModified`, `ModeS`,`ModeSCountry`,`Registration`,`ICAOTypeCode`,`SerialNo`, `OperatorFlagCode`, `Manufacturer`, `Type`, `FirstRegDate`, `CurrentRegDate`, `Country`, `PreviousID`, `DeRegDate`, `Status`, `PopularName`,`GenericName`,`AircraftClass`, `Engines`, `OwnershipStatus`,`RegisteredOwners`,`MTOW`, `TotalHours`, `YearBuilt`, `CofACategory`, `CofAExpiry`, `UserNotes`, `Interested`, `UserTag`, `InfoUrl`, `PictureUrl1`, `PictureUrl2`, `PictureUrl3`, `UserBool1`, `UserBool2`, `UserBool3`, `UserBool4`, `UserBool5`, `UserString1`, `UserString2`, `UserString3`, `UserString4`, `UserString5`, `UserInt1`, `UserInt2`, `UserInt3`, `UserInt4`, `UserInt5`) VALUES (:AircraftID,:FirstCreated,:LastModified,:ModeS,:ModeSCountry,:Registration,:ICAOTypeCode,:SerialNo, :OperatorFlagCode, :Manufacturer, :Type, :FirstRegDate, :CurrentRegDate, :Country, :PreviousID, :DeRegDate, :Status, :PopularName,:GenericName,:AircraftClass, :Engines, :OwnershipStatus,:RegisteredOwners,:MTOW, :TotalHours,:YearBuilt, :CofACategory, :CofAExpiry, :UserNotes, :Interested, :UserTag, :InfoUrl, :PictureUrl1, :PictureUrl2, :PictureUrl3, :UserBool1, :UserBool2, :UserBool3, :UserBool4, :UserBool5, :UserString1, :UserString2, :UserString3, :UserString4, :UserString5, :UserInt1, :UserInt2, :UserInt3, :UserInt4, :UserInt5)';
@@ -349,25 +349,25 @@  discard block
 block discarded – undo
349 349
 			try {
350 350
 				if ($globalTransaction) $Connection->db->beginTransaction();
351 351
 				$tmp = fgetcsv($fh,9999,',',"'");
352
-            			while (!feof($fh)) {
353
-            				$line = fgetcsv($fh,9999,',',"'");
352
+						while (!feof($fh)) {
353
+							$line = fgetcsv($fh,9999,',',"'");
354 354
             				
355 355
 					//FFFFFF                     RIDEAU VALLEY SOARINGASW-20               C-FBKN MZ 123.400
356 356
 					//print_r($line);
357
-            				$values['ModeS'] = $line[1];
358
-            				$values['Registration'] = $line[3];
359
-            				$values['ICAOTypeCode'] = '';
360
-            				$aircraft_name = $line[2];
361
-            				// Check if we can find ICAO, else set it to GLID
362
-            				$aircraft_name_split = explode(' ',$aircraft_name);
363
-            				$search_more = '';
364
-            				if (count($aircraft_name) > 1 && strlen($aircraft_name_split[1]) > 3) $search_more .= " AND LIKE '%".$aircraft_name_split[0]."%'";
365
-            				$query_search = "SELECT * FROM aircraft WHERE type LIKE '%".$aircraft_name."%'".$search_more;
366
-            				$sth_search = $Connection->db->prepare($query_search);
357
+							$values['ModeS'] = $line[1];
358
+							$values['Registration'] = $line[3];
359
+							$values['ICAOTypeCode'] = '';
360
+							$aircraft_name = $line[2];
361
+							// Check if we can find ICAO, else set it to GLID
362
+							$aircraft_name_split = explode(' ',$aircraft_name);
363
+							$search_more = '';
364
+							if (count($aircraft_name) > 1 && strlen($aircraft_name_split[1]) > 3) $search_more .= " AND LIKE '%".$aircraft_name_split[0]."%'";
365
+							$query_search = "SELECT * FROM aircraft WHERE type LIKE '%".$aircraft_name."%'".$search_more;
366
+							$sth_search = $Connection->db->prepare($query_search);
367 367
 					try {
368
-                                    		$sth_search->execute();
369
-	            				$result = $sth_search->fetch(PDO::FETCH_ASSOC);
370
-	            				if (isset($result['icao']) && $result['icao'] != '') $values['ICAOTypeCode'] = $result['icao'];
368
+											$sth_search->execute();
369
+								$result = $sth_search->fetch(PDO::FETCH_ASSOC);
370
+								if (isset($result['icao']) && $result['icao'] != '') $values['ICAOTypeCode'] = $result['icao'];
371 371
 					} catch(PDOException $e) {
372 372
 						return "error : ".$e->getMessage();
373 373
 					}
@@ -390,10 +390,10 @@  discard block
 block discarded – undo
390 390
 		try {
391 391
 			$Connection = new Connection();
392 392
 			$sth = $Connection->db->prepare($query);
393
-                        $sth->execute(array(':source' => $database_file));
394
-                } catch(PDOException $e) {
395
-                        return "error : ".$e->getMessage();
396
-                }
393
+						$sth->execute(array(':source' => $database_file));
394
+				} catch(PDOException $e) {
395
+						return "error : ".$e->getMessage();
396
+				}
397 397
 		return '';
398 398
 	}
399 399
 
@@ -404,16 +404,16 @@  discard block
 block discarded – undo
404 404
 		try {
405 405
 			$Connection = new Connection();
406 406
 			$sth = $Connection->db->prepare($query);
407
-                        $sth->execute(array(':source' => $database_file));
408
-                } catch(PDOException $e) {
409
-                        return "error : ".$e->getMessage();
410
-                }
407
+						$sth->execute(array(':source' => $database_file));
408
+				} catch(PDOException $e) {
409
+						return "error : ".$e->getMessage();
410
+				}
411 411
 		require_once(dirname(__FILE__).'/../require/class.Spotter.php');
412 412
 		$Spotter = new Spotter();
413 413
 		if ($fh = fopen($database_file,"r")) {
414 414
 			//$query_dest = 'INSERT INTO aircraft_modes (`AircraftID`,`FirstCreated`,`LastModified`, `ModeS`,`ModeSCountry`,`Registration`,`ICAOTypeCode`,`SerialNo`, `OperatorFlagCode`, `Manufacturer`, `Type`, `FirstRegDate`, `CurrentRegDate`, `Country`, `PreviousID`, `DeRegDate`, `Status`, `PopularName`,`GenericName`,`AircraftClass`, `Engines`, `OwnershipStatus`,`RegisteredOwners`,`MTOW`, `TotalHours`, `YearBuilt`, `CofACategory`, `CofAExpiry`, `UserNotes`, `Interested`, `UserTag`, `InfoUrl`, `PictureUrl1`, `PictureUrl2`, `PictureUrl3`, `UserBool1`, `UserBool2`, `UserBool3`, `UserBool4`, `UserBool5`, `UserString1`, `UserString2`, `UserString3`, `UserString4`, `UserString5`, `UserInt1`, `UserInt2`, `UserInt3`, `UserInt4`, `UserInt5`) VALUES (:AircraftID,:FirstCreated,:LastModified,:ModeS,:ModeSCountry,:Registration,:ICAOTypeCode,:SerialNo, :OperatorFlagCode, :Manufacturer, :Type, :FirstRegDate, :CurrentRegDate, :Country, :PreviousID, :DeRegDate, :Status, :PopularName,:GenericName,:AircraftClass, :Engines, :OwnershipStatus,:RegisteredOwners,:MTOW, :TotalHours,:YearBuilt, :CofACategory, :CofAExpiry, :UserNotes, :Interested, :UserTag, :InfoUrl, :PictureUrl1, :PictureUrl2, :PictureUrl3, :UserBool1, :UserBool2, :UserBool3, :UserBool4, :UserBool5, :UserString1, :UserString2, :UserString3, :UserString4, :UserString5, :UserInt1, :UserInt2, :UserInt3, :UserInt4, :UserInt5)';
415 415
 			$query_dest = 'INSERT INTO aircraft_owner (registration,base,owner,date_first_reg,Source) VALUES (:registration,:base,:owner,:date_first_reg,:source)';
416
-		        $query_modes = 'INSERT INTO aircraft_modes (ModeS,ModeSCountry,Registration,ICAOTypeCode,Source) VALUES (:modes,:modescountry,:registration,:icaotypecode,:source)';
416
+				$query_modes = 'INSERT INTO aircraft_modes (ModeS,ModeSCountry,Registration,ICAOTypeCode,Source) VALUES (:modes,:modescountry,:registration,:icaotypecode,:source)';
417 417
 		        
418 418
 			$Connection = new Connection();
419 419
 			$sth_dest = $Connection->db->prepare($query_dest);
@@ -421,126 +421,126 @@  discard block
 block discarded – undo
421 421
 			try {
422 422
 				if ($globalTransaction) $Connection->db->beginTransaction();
423 423
 				$tmp = fgetcsv($fh,9999,',','"');
424
-            			while (!feof($fh)) {
425
-            				$line = fgetcsv($fh,9999,',','"');
426
-            				$values = array();
427
-            				//print_r($line);
428
-            				if ($country == 'F') {
429
-            				    $values['registration'] = $line[0];
430
-            				    $values['base'] = $line[4];
431
-            				    $values['owner'] = $line[5];
432
-            				    if ($line[6] == '') $values['date_first_reg'] = null;
433
-					    else $values['date_first_reg'] = date("Y-m-d",strtotime($line[6]));
434
-					    $values['cancel'] = $line[7];
424
+						while (!feof($fh)) {
425
+							$line = fgetcsv($fh,9999,',','"');
426
+							$values = array();
427
+							//print_r($line);
428
+							if ($country == 'F') {
429
+								$values['registration'] = $line[0];
430
+								$values['base'] = $line[4];
431
+								$values['owner'] = $line[5];
432
+								if ($line[6] == '') $values['date_first_reg'] = null;
433
+						else $values['date_first_reg'] = date("Y-m-d",strtotime($line[6]));
434
+						$values['cancel'] = $line[7];
435 435
 					} elseif ($country == 'EI') {
436
-					    // TODO : add modeS & reg to aircraft_modes
437
-            				    $values['registration'] = $line[0];
438
-            				    $values['base'] = $line[3];
439
-            				    $values['owner'] = $line[2];
440
-            				    if ($line[1] == '') $values['date_first_reg'] = null;
441
-					    else $values['date_first_reg'] = date("Y-m-d",strtotime($line[1]));
442
-					    $values['cancel'] = '';
443
-					    $values['modes'] = $line[7];
444
-					    $values['icao'] = $line[8];
436
+						// TODO : add modeS & reg to aircraft_modes
437
+								$values['registration'] = $line[0];
438
+								$values['base'] = $line[3];
439
+								$values['owner'] = $line[2];
440
+								if ($line[1] == '') $values['date_first_reg'] = null;
441
+						else $values['date_first_reg'] = date("Y-m-d",strtotime($line[1]));
442
+						$values['cancel'] = '';
443
+						$values['modes'] = $line[7];
444
+						$values['icao'] = $line[8];
445 445
 					    
446 446
 					} elseif ($country == 'HB') {
447
-					    // TODO : add modeS & reg to aircraft_modes
448
-            				    $values['registration'] = $line[0];
449
-            				    $values['base'] = null;
450
-            				    $values['owner'] = $line[5];
451
-            				    $values['date_first_reg'] = null;
452
-					    $values['cancel'] = '';
453
-					    $values['modes'] = $line[4];
454
-					    $values['icao'] = $line[7];
447
+						// TODO : add modeS & reg to aircraft_modes
448
+								$values['registration'] = $line[0];
449
+								$values['base'] = null;
450
+								$values['owner'] = $line[5];
451
+								$values['date_first_reg'] = null;
452
+						$values['cancel'] = '';
453
+						$values['modes'] = $line[4];
454
+						$values['icao'] = $line[7];
455 455
 					} elseif ($country == 'OK') {
456
-					    // TODO : add modeS & reg to aircraft_modes
457
-            				    $values['registration'] = $line[3];
458
-            				    $values['base'] = null;
459
-            				    $values['owner'] = $line[5];
460
-            				    if ($line[18] == '') $values['date_first_reg'] = null;
461
-					    else $values['date_first_reg'] = date("Y-m-d",strtotime($line[18]));
462
-					    $values['cancel'] = '';
456
+						// TODO : add modeS & reg to aircraft_modes
457
+								$values['registration'] = $line[3];
458
+								$values['base'] = null;
459
+								$values['owner'] = $line[5];
460
+								if ($line[18] == '') $values['date_first_reg'] = null;
461
+						else $values['date_first_reg'] = date("Y-m-d",strtotime($line[18]));
462
+						$values['cancel'] = '';
463 463
 					} elseif ($country == 'VH') {
464
-					    // TODO : add modeS & reg to aircraft_modes
465
-            				    $values['registration'] = $line[0];
466
-            				    $values['base'] = null;
467
-            				    $values['owner'] = $line[12];
468
-            				    if ($line[28] == '') $values['date_first_reg'] = null;
469
-					    else $values['date_first_reg'] = date("Y-m-d",strtotime($line[28]));
470
-
471
-					    $values['cancel'] = $line[39];
464
+						// TODO : add modeS & reg to aircraft_modes
465
+								$values['registration'] = $line[0];
466
+								$values['base'] = null;
467
+								$values['owner'] = $line[12];
468
+								if ($line[28] == '') $values['date_first_reg'] = null;
469
+						else $values['date_first_reg'] = date("Y-m-d",strtotime($line[28]));
470
+
471
+						$values['cancel'] = $line[39];
472 472
 					} elseif ($country == 'OE' || $country == '9A' || $country == 'VP' || $country == 'LX' || $country == 'P2' || $country == 'HC') {
473
-            				    $values['registration'] = $line[0];
474
-            				    $values['base'] = null;
475
-            				    $values['owner'] = $line[4];
476
-            				    $values['date_first_reg'] = null;
477
-					    $values['cancel'] = '';
473
+								$values['registration'] = $line[0];
474
+								$values['base'] = null;
475
+								$values['owner'] = $line[4];
476
+								$values['date_first_reg'] = null;
477
+						$values['cancel'] = '';
478 478
 					} elseif ($country == 'CC') {
479
-            				    $values['registration'] = $line[0];
480
-            				    $values['base'] = null;
481
-            				    $values['owner'] = $line[6];
482
-            				    $values['date_first_reg'] = null;
483
-					    $values['cancel'] = '';
479
+								$values['registration'] = $line[0];
480
+								$values['base'] = null;
481
+								$values['owner'] = $line[6];
482
+								$values['date_first_reg'] = null;
483
+						$values['cancel'] = '';
484 484
 					} elseif ($country == 'HJ') {
485
-            				    $values['registration'] = $line[0];
486
-            				    $values['base'] = null;
487
-            				    $values['owner'] = $line[8];
488
-            				    if ($line[7] == '') $values['date_first_reg'] = null;
489
-					    else $values['date_first_reg'] = date("Y-m-d",strtotime($line[7]));
490
-					    $values['cancel'] = '';
485
+								$values['registration'] = $line[0];
486
+								$values['base'] = null;
487
+								$values['owner'] = $line[8];
488
+								if ($line[7] == '') $values['date_first_reg'] = null;
489
+						else $values['date_first_reg'] = date("Y-m-d",strtotime($line[7]));
490
+						$values['cancel'] = '';
491 491
 					} elseif ($country == 'PP') {
492
-            				    $values['registration'] = $line[0];
493
-            				    $values['base'] = null;
494
-            				    $values['owner'] = $line[4];
495
-            				    if ($line[6] == '') $values['date_first_reg'] = null;
496
-					    else $values['date_first_reg'] = date("Y-m-d",strtotime($line[6]));
497
-					    $values['cancel'] = $line[7];
492
+								$values['registration'] = $line[0];
493
+								$values['base'] = null;
494
+								$values['owner'] = $line[4];
495
+								if ($line[6] == '') $values['date_first_reg'] = null;
496
+						else $values['date_first_reg'] = date("Y-m-d",strtotime($line[6]));
497
+						$values['cancel'] = $line[7];
498 498
 					} elseif ($country == 'E7') {
499
-            				    $values['registration'] = $line[0];
500
-            				    $values['base'] = null;
501
-            				    $values['owner'] = $line[4];
502
-            				    if ($line[5] == '') $values['date_first_reg'] = null;
503
-					    else $values['date_first_reg'] = date("Y-m-d",strtotime($line[5]));
504
-					    $values['cancel'] = '';
499
+								$values['registration'] = $line[0];
500
+								$values['base'] = null;
501
+								$values['owner'] = $line[4];
502
+								if ($line[5] == '') $values['date_first_reg'] = null;
503
+						else $values['date_first_reg'] = date("Y-m-d",strtotime($line[5]));
504
+						$values['cancel'] = '';
505 505
 					} elseif ($country == '8Q') {
506
-            				    $values['registration'] = $line[0];
507
-            				    $values['base'] = null;
508
-            				    $values['owner'] = $line[3];
509
-            				    if ($line[7] == '') $values['date_first_reg'] = null;
510
-					    else $values['date_first_reg'] = date("Y-m-d",strtotime($line[7]));
511
-					    $values['cancel'] = '';
506
+								$values['registration'] = $line[0];
507
+								$values['base'] = null;
508
+								$values['owner'] = $line[3];
509
+								if ($line[7] == '') $values['date_first_reg'] = null;
510
+						else $values['date_first_reg'] = date("Y-m-d",strtotime($line[7]));
511
+						$values['cancel'] = '';
512 512
 					} elseif ($country == 'ZK') {
513
-            				    $values['registration'] = $line[0];
514
-            				    $values['base'] = null;
515
-            				    $values['owner'] = $line[3];
516
-            				    $values['date_first_reg'] = null;
517
-					    $values['cancel'] = '';
518
-					    $values['modes'] = $line[5];
519
-					    $values['icao'] = $line[9];
513
+								$values['registration'] = $line[0];
514
+								$values['base'] = null;
515
+								$values['owner'] = $line[3];
516
+								$values['date_first_reg'] = null;
517
+						$values['cancel'] = '';
518
+						$values['modes'] = $line[5];
519
+						$values['icao'] = $line[9];
520 520
 					} elseif ($country == 'M') {
521
-            				    $values['registration'] = $line[0];
522
-            				    $values['base'] = null;
523
-            				    $values['owner'] = $line[6];
524
-            				    $values['date_first_reg'] = date("Y-m-d",strtotime($line[5]));
525
-					    $values['cancel'] = date("Y-m-d",strtotime($line[8]));
526
-					    $values['modes'] = $line[4];
527
-					    $values['icao'] = $line[10];
521
+								$values['registration'] = $line[0];
522
+								$values['base'] = null;
523
+								$values['owner'] = $line[6];
524
+								$values['date_first_reg'] = date("Y-m-d",strtotime($line[5]));
525
+						$values['cancel'] = date("Y-m-d",strtotime($line[8]));
526
+						$values['modes'] = $line[4];
527
+						$values['icao'] = $line[10];
528 528
 					} elseif ($country == 'OY') {
529
-            				    $values['registration'] = $line[0];
530
-            				    $values['date_first_reg'] = date("Y-m-d",strtotime($line[4]));
531
-					    $values['modes'] = $line[5];
532
-					    $values['icao'] = $line[6];
529
+								$values['registration'] = $line[0];
530
+								$values['date_first_reg'] = date("Y-m-d",strtotime($line[4]));
531
+						$values['modes'] = $line[5];
532
+						$values['icao'] = $line[6];
533 533
 					} elseif ($country == 'PH') {
534
-            				    $values['registration'] = $line[0];
535
-            				    $values['date_first_reg'] = date("Y-m-d",strtotime($line[3]));
536
-					    $values['modes'] = $line[4];
537
-					    $values['icao'] = $line[5];
534
+								$values['registration'] = $line[0];
535
+								$values['date_first_reg'] = date("Y-m-d",strtotime($line[3]));
536
+						$values['modes'] = $line[4];
537
+						$values['icao'] = $line[5];
538 538
 					} elseif ($country == 'OM' || $country == 'TF') {
539
-            				    $values['registration'] = $line[0];
540
-            				    $values['base'] = null;
541
-            				    $values['owner'] = $line[3];
542
-            				    $values['date_first_reg'] = null;
543
-					    $values['cancel'] = '';
539
+								$values['registration'] = $line[0];
540
+								$values['base'] = null;
541
+								$values['owner'] = $line[3];
542
+								$values['date_first_reg'] = null;
543
+						$values['cancel'] = '';
544 544
 					}
545 545
 					if (isset($values['cancel']) && $values['cancel'] == '' && $values['registration'] != null && isset($values['owner'])) {
546 546
 						$query_dest_values = array(':registration' => $values['registration'],':base' => $values['base'],':date_first_reg' => $values['date_first_reg'],':owner' => $values['owner'],':source' => $database_file);
@@ -667,20 +667,20 @@  discard block
 block discarded – undo
667 667
 		try {
668 668
 			$Connection = new Connection();
669 669
 			$sth = $Connection->db->prepare($query);
670
-                        $sth->execute();
671
-                } catch(PDOException $e) {
672
-                        return "error : ".$e->getMessage();
673
-                }
670
+						$sth->execute();
671
+				} catch(PDOException $e) {
672
+						return "error : ".$e->getMessage();
673
+				}
674 674
 
675 675
 
676 676
 		$query = 'ALTER TABLE airport DROP INDEX icaoidx';
677 677
 		try {
678 678
 			$Connection = new Connection();
679 679
 			$sth = $Connection->db->prepare($query);
680
-                        $sth->execute();
681
-                } catch(PDOException $e) {
682
-                        return "error : ".$e->getMessage();
683
-                }
680
+						$sth->execute();
681
+				} catch(PDOException $e) {
682
+						return "error : ".$e->getMessage();
683
+				}
684 684
 
685 685
 		$query_dest = "INSERT INTO airport (`airport_id`,`name`,`city`,`country`,`iata`,`icao`,`latitude`,`longitude`,`altitude`,`type`,`home_link`,`wikipedia_link`,`image_thumb`,`image`)
686 686
 		    VALUES (:airport_id, :name, :city, :country, :iata, :icao, :latitude, :longitude, :altitude, :type, :home_link, :wikipedia_link, :image_thumb, :image)";
@@ -746,10 +746,10 @@  discard block
 block discarded – undo
746 746
 		try {
747 747
 			$Connection = new Connection();
748 748
 			$sth = $Connection->db->prepare($query);
749
-                        $sth->execute();
750
-                } catch(PDOException $e) {
751
-                        return "error : ".$e->getMessage();
752
-                }
749
+						$sth->execute();
750
+				} catch(PDOException $e) {
751
+						return "error : ".$e->getMessage();
752
+				}
753 753
 
754 754
 
755 755
 		if ($globalDebug) echo "Insert Not available Airport...\n";
@@ -759,10 +759,10 @@  discard block
 block discarded – undo
759 759
 		try {
760 760
 			$Connection = new Connection();
761 761
 			$sth = $Connection->db->prepare($query);
762
-                        $sth->execute($query_values);
763
-                } catch(PDOException $e) {
764
-                        return "error : ".$e->getMessage();
765
-                }
762
+						$sth->execute($query_values);
763
+				} catch(PDOException $e) {
764
+						return "error : ".$e->getMessage();
765
+				}
766 766
 		$i++;
767 767
 /*
768 768
 		$query = 'DELETE FROM airport WHERE airport_id IN (SELECT * FROM (SELECT min(a.airport_id) FROM airport a GROUP BY a.icao) x)';
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
 
877 877
 
878 878
 
879
-                return "success";
879
+				return "success";
880 880
 	}
881 881
 	
882 882
 	public static function translation() {
@@ -892,10 +892,10 @@  discard block
 block discarded – undo
892 892
 		try {
893 893
 			$Connection = new Connection();
894 894
 			$sth = $Connection->db->prepare($query);
895
-                        $sth->execute(array(':source' => 'translation.csv'));
896
-                } catch(PDOException $e) {
897
-                        return "error : ".$e->getMessage();
898
-                }
895
+						$sth->execute(array(':source' => 'translation.csv'));
896
+				} catch(PDOException $e) {
897
+						return "error : ".$e->getMessage();
898
+				}
899 899
 
900 900
 		
901 901
 		//update_db::unzip($out_file);
@@ -914,21 +914,21 @@  discard block
 block discarded – undo
914 914
 					$data = $row;
915 915
 					$operator = $data[2];
916 916
 					if ($operator != '' && is_numeric(substr(substr($operator, 0, 3), -1, 1))) {
917
-                                                $airline_array = $Spotter->getAllAirlineInfo(substr($operator, 0, 2));
918
-                                                //echo substr($operator, 0, 2)."\n";;
919
-                                                if (count($airline_array) > 0) {
917
+												$airline_array = $Spotter->getAllAirlineInfo(substr($operator, 0, 2));
918
+												//echo substr($operator, 0, 2)."\n";;
919
+												if (count($airline_array) > 0) {
920 920
 							//print_r($airline_array);
921 921
 							$operator = $airline_array[0]['icao'].substr($operator,2);
922
-                                                }
923
-                                        }
922
+												}
923
+										}
924 924
 					
925 925
 					$operator_correct = $data[3];
926 926
 					if ($operator_correct != '' && is_numeric(substr(substr($operator_correct, 0, 3), -1, 1))) {
927
-                                                $airline_array = $Spotter->getAllAirlineInfo(substr($operator_correct, 0, 2));
928
-                                                if (count($airline_array) > 0) {
929
-                                            		$operator_correct = $airline_array[0]['icao'].substr($operator_correct,2);
930
-                                            	}
931
-                                        }
927
+												$airline_array = $Spotter->getAllAirlineInfo(substr($operator_correct, 0, 2));
928
+												if (count($airline_array) > 0) {
929
+													$operator_correct = $airline_array[0]['icao'].substr($operator_correct,2);
930
+												}
931
+										}
932 932
 					$query = 'INSERT INTO translation (Reg,Reg_correct,Operator,Operator_correct,Source) VALUES (:Reg, :Reg_correct, :Operator, :Operator_correct, :source)';
933 933
 					try {
934 934
 						$sth = $Connection->db->prepare($query);
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
 			//$Connection->db->commit();
943 943
 		}
944 944
 		return '';
945
-        }
945
+		}
946 946
 	
947 947
 	public static function translation_fam() {
948 948
 		require_once(dirname(__FILE__).'/../require/class.Spotter.php');
@@ -952,10 +952,10 @@  discard block
 block discarded – undo
952 952
 		try {
953 953
 			$Connection = new Connection();
954 954
 			$sth = $Connection->db->prepare($query);
955
-                        $sth->execute(array(':source' => 'website_fam'));
956
-                } catch(PDOException $e) {
957
-                        return "error : ".$e->getMessage();
958
-                }
955
+						$sth->execute(array(':source' => 'website_fam'));
956
+				} catch(PDOException $e) {
957
+						return "error : ".$e->getMessage();
958
+				}
959 959
 
960 960
 		
961 961
 		//update_db::unzip($out_file);
@@ -984,7 +984,7 @@  discard block
 block discarded – undo
984 984
 			//$Connection->db->commit();
985 985
 		}
986 986
 		return '';
987
-        }
987
+		}
988 988
 
989 989
 	/*
990 990
 	* This function use FAA public data.
@@ -996,19 +996,19 @@  discard block
 block discarded – undo
996 996
 		try {
997 997
 			$Connection = new Connection();
998 998
 			$sth = $Connection->db->prepare($query);
999
-                        $sth->execute(array(':source' => 'website_faa'));
1000
-                } catch(PDOException $e) {
1001
-                        return "error : ".$e->getMessage();
1002
-                }
999
+						$sth->execute(array(':source' => 'website_faa'));
1000
+				} catch(PDOException $e) {
1001
+						return "error : ".$e->getMessage();
1002
+				}
1003 1003
 
1004 1004
 		$query = "DELETE FROM aircraft_owner WHERE Source = '' OR Source = :source";
1005 1005
 		try {
1006 1006
 			$Connection = new Connection();
1007 1007
 			$sth = $Connection->db->prepare($query);
1008
-                        $sth->execute(array(':source' => 'website_faa'));
1009
-                } catch(PDOException $e) {
1010
-                        return "error : ".$e->getMessage();
1011
-                }
1008
+						$sth->execute(array(':source' => 'website_faa'));
1009
+				} catch(PDOException $e) {
1010
+						return "error : ".$e->getMessage();
1011
+				}
1012 1012
 
1013 1013
 		$delimiter = ",";
1014 1014
 		$mfr = array();
@@ -1084,17 +1084,17 @@  discard block
 block discarded – undo
1084 1084
 		}
1085 1085
 		print_r($mfr);
1086 1086
 		return '';
1087
-        }
1087
+		}
1088 1088
 	public static function modes_fam() {
1089 1089
 		global $tmp_dir, $globalTransaction;
1090 1090
 		$query = "DELETE FROM aircraft_modes WHERE Source = '' OR Source = :source";
1091 1091
 		try {
1092 1092
 			$Connection = new Connection();
1093 1093
 			$sth = $Connection->db->prepare($query);
1094
-                        $sth->execute(array(':source' => 'website_fam'));
1095
-                } catch(PDOException $e) {
1096
-                        return "error : ".$e->getMessage();
1097
-                }
1094
+						$sth->execute(array(':source' => 'website_fam'));
1095
+				} catch(PDOException $e) {
1096
+						return "error : ".$e->getMessage();
1097
+				}
1098 1098
 
1099 1099
 		
1100 1100
 		//update_db::unzip($out_file);
@@ -1124,7 +1124,7 @@  discard block
 block discarded – undo
1124 1124
 			if ($globalTransaction) $Connection->db->commit();
1125 1125
 		}
1126 1126
 		return '';
1127
-        }
1127
+		}
1128 1128
         
1129 1129
 	public static function owner_fam() {
1130 1130
 		global $tmp_dir, $globalTransaction;
@@ -1132,10 +1132,10 @@  discard block
 block discarded – undo
1132 1132
 		try {
1133 1133
 			$Connection = new Connection();
1134 1134
 			$sth = $Connection->db->prepare($query);
1135
-                        $sth->execute(array(':source' => 'website_fam'));
1136
-                } catch(PDOException $e) {
1137
-                        return "error : ".$e->getMessage();
1138
-                }
1135
+						$sth->execute(array(':source' => 'website_fam'));
1136
+				} catch(PDOException $e) {
1137
+						return "error : ".$e->getMessage();
1138
+				}
1139 1139
 
1140 1140
 		$delimiter = "\t";
1141 1141
 		$Connection = new Connection();
@@ -1161,7 +1161,7 @@  discard block
 block discarded – undo
1161 1161
 			if ($globalTransaction) $Connection->db->commit();
1162 1162
 		}
1163 1163
 		return '';
1164
-        }
1164
+		}
1165 1165
 
1166 1166
 	public static function routes_fam() {
1167 1167
 		global $tmp_dir, $globalTransaction;
@@ -1169,10 +1169,10 @@  discard block
 block discarded – undo
1169 1169
 		try {
1170 1170
 			$Connection = new Connection();
1171 1171
 			$sth = $Connection->db->prepare($query);
1172
-                        $sth->execute(array(':source' => 'website_fam'));
1173
-                } catch(PDOException $e) {
1174
-                        return "error : ".$e->getMessage();
1175
-                }
1172
+						$sth->execute(array(':source' => 'website_fam'));
1173
+				} catch(PDOException $e) {
1174
+						return "error : ".$e->getMessage();
1175
+				}
1176 1176
 
1177 1177
 		
1178 1178
 		//update_db::unzip($out_file);
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 			if ($globalTransaction) $Connection->db->commit();
1202 1202
 		}
1203 1203
 		return '';
1204
-        }
1204
+		}
1205 1205
 
1206 1206
 	public static function marine_identity_fam() {
1207 1207
 		global $tmp_dir, $globalTransaction;
@@ -1209,10 +1209,10 @@  discard block
 block discarded – undo
1209 1209
 		try {
1210 1210
 			$Connection = new Connection();
1211 1211
 			$sth = $Connection->db->prepare($query);
1212
-                        $sth->execute();
1213
-                } catch(PDOException $e) {
1214
-                        return "error : ".$e->getMessage();
1215
-                }
1212
+						$sth->execute();
1213
+				} catch(PDOException $e) {
1214
+						return "error : ".$e->getMessage();
1215
+				}
1216 1216
 
1217 1217
 		
1218 1218
 		//update_db::unzip($out_file);
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 			if ($globalTransaction) $Connection->db->commit();
1243 1243
 		}
1244 1244
 		return '';
1245
-        }
1245
+		}
1246 1246
 
1247 1247
 	public static function banned_fam() {
1248 1248
 		global $tmp_dir, $globalTransaction;
@@ -1276,7 +1276,7 @@  discard block
 block discarded – undo
1276 1276
 			if ($globalTransaction) $Connection->db->commit();
1277 1277
 		}
1278 1278
 		return '';
1279
-        }
1279
+		}
1280 1280
 
1281 1281
 	public static function tle($filename,$tletype) {
1282 1282
 		require_once(dirname(__FILE__).'/../require/class.Spotter.php');
@@ -1287,10 +1287,10 @@  discard block
 block discarded – undo
1287 1287
 		try {
1288 1288
 			$Connection = new Connection();
1289 1289
 			$sth = $Connection->db->prepare($query);
1290
-                        $sth->execute(array(':source' => $filename));
1291
-                } catch(PDOException $e) {
1292
-                        return "error : ".$e->getMessage();
1293
-                }
1290
+						$sth->execute(array(':source' => $filename));
1291
+				} catch(PDOException $e) {
1292
+						return "error : ".$e->getMessage();
1293
+				}
1294 1294
 		
1295 1295
 		$Connection = new Connection();
1296 1296
 		if (($handle = fopen($filename, 'r')) !== FALSE)
@@ -1325,54 +1325,54 @@  discard block
 block discarded – undo
1325 1325
 			//$Connection->db->commit();
1326 1326
 		}
1327 1327
 		return '';
1328
-        }
1328
+		}
1329 1329
 
1330 1330
 	/**
1331
-        * Convert a HTML table to an array
1332
-        * @param String $data HTML page
1333
-        * @return Array array of the tables in HTML page
1334
-        */
1335
-        private static function table2array($data) {
1336
-                $html = str_get_html($data);
1337
-                $tabledata=array();
1338
-                foreach($html->find('tr') as $element)
1339
-                {
1340
-                        $td = array();
1341
-                        foreach( $element->find('th') as $row)
1342
-                        {
1343
-                                $td [] = trim($row->plaintext);
1344
-                        }
1345
-                        $td=array_filter($td);
1346
-                        $tabledata[] = $td;
1347
-
1348
-                        $td = array();
1349
-                        $tdi = array();
1350
-                        foreach( $element->find('td') as $row)
1351
-                        {
1352
-                                $td [] = trim($row->plaintext);
1353
-                                $tdi [] = trim($row->innertext);
1354
-                        }
1355
-                        $td=array_filter($td);
1356
-                        $tdi=array_filter($tdi);
1357
-                    //    $tabledata[]=array_merge($td,$tdi);
1358
-                        $tabledata[]=$td;
1359
-                }
1360
-                return(array_filter($tabledata));
1361
-        }
1362
-
1363
-       /**
1364
-        * Get data from form result
1365
-        * @param String $url form URL
1366
-        * @return String the result
1367
-        */
1368
-        private static function getData($url) {
1369
-                $ch = curl_init();
1370
-                curl_setopt($ch, CURLOPT_URL, $url);
1371
-                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1372
-                curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
1373
-                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');
1374
-                return curl_exec($ch);
1375
-        }
1331
+	 * Convert a HTML table to an array
1332
+	 * @param String $data HTML page
1333
+	 * @return Array array of the tables in HTML page
1334
+	 */
1335
+		private static function table2array($data) {
1336
+				$html = str_get_html($data);
1337
+				$tabledata=array();
1338
+				foreach($html->find('tr') as $element)
1339
+				{
1340
+						$td = array();
1341
+						foreach( $element->find('th') as $row)
1342
+						{
1343
+								$td [] = trim($row->plaintext);
1344
+						}
1345
+						$td=array_filter($td);
1346
+						$tabledata[] = $td;
1347
+
1348
+						$td = array();
1349
+						$tdi = array();
1350
+						foreach( $element->find('td') as $row)
1351
+						{
1352
+								$td [] = trim($row->plaintext);
1353
+								$tdi [] = trim($row->innertext);
1354
+						}
1355
+						$td=array_filter($td);
1356
+						$tdi=array_filter($tdi);
1357
+					//    $tabledata[]=array_merge($td,$tdi);
1358
+						$tabledata[]=$td;
1359
+				}
1360
+				return(array_filter($tabledata));
1361
+		}
1362
+
1363
+	   /**
1364
+	    * Get data from form result
1365
+	    * @param String $url form URL
1366
+	    * @return String the result
1367
+	    */
1368
+		private static function getData($url) {
1369
+				$ch = curl_init();
1370
+				curl_setopt($ch, CURLOPT_URL, $url);
1371
+				curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1372
+				curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
1373
+				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');
1374
+				return curl_exec($ch);
1375
+		}
1376 1376
 /*
1377 1377
 	public static function waypoints() {
1378 1378
 		$data = update_db::getData('http://www.fallingrain.com/world/FR/waypoints.html');
@@ -1455,7 +1455,7 @@  discard block
 block discarded – undo
1455 1455
 			if ($globalTransaction) $Connection->db->commit();
1456 1456
 		}
1457 1457
 		return '';
1458
-        }
1458
+		}
1459 1459
 
1460 1460
 	public static function ivao_airlines($filename) {
1461 1461
 		//require_once(dirname(__FILE__).'/../require/class.Spotter.php');
@@ -1465,10 +1465,10 @@  discard block
 block discarded – undo
1465 1465
 		try {
1466 1466
 			$Connection = new Connection();
1467 1467
 			$sth = $Connection->db->prepare($query);
1468
-                        $sth->execute();
1469
-                } catch(PDOException $e) {
1470
-                        return "error : ".$e->getMessage();
1471
-                }
1468
+						$sth->execute();
1469
+				} catch(PDOException $e) {
1470
+						return "error : ".$e->getMessage();
1471
+				}
1472 1472
 
1473 1473
 		$header = NULL;
1474 1474
 		$delimiter = ':';
@@ -1492,7 +1492,7 @@  discard block
 block discarded – undo
1492 1492
 			if ($globalTransaction) $Connection->db->commit();
1493 1493
 		}
1494 1494
 		return '';
1495
-        }
1495
+		}
1496 1496
 	
1497 1497
 	public static function update_airspace() {
1498 1498
 		global $tmp_dir, $globalDBdriver;
@@ -1502,11 +1502,11 @@  discard block
 block discarded – undo
1502 1502
 			$query = 'DROP TABLE airspace';
1503 1503
 			try {
1504 1504
 				$sth = $Connection->db->prepare($query);
1505
-                    		$sth->execute();
1506
-	                } catch(PDOException $e) {
1505
+							$sth->execute();
1506
+					} catch(PDOException $e) {
1507 1507
 				return "error : ".$e->getMessage();
1508
-	                }
1509
-	        }
1508
+					}
1509
+			}
1510 1510
 
1511 1511
 
1512 1512
 		if ($globalDBdriver == 'mysql') update_db::gunzip('../db/airspace.sql.gz',$tmp_dir.'airspace.sql');
@@ -1561,10 +1561,10 @@  discard block
 block discarded – undo
1561 1561
 			$query = 'DROP TABLE countries';
1562 1562
 			try {
1563 1563
 				$sth = $Connection->db->prepare($query);
1564
-            	        	$sth->execute();
1565
-	                } catch(PDOException $e) {
1566
-    	                	echo "error : ".$e->getMessage();
1567
-	                }
1564
+							$sth->execute();
1565
+					} catch(PDOException $e) {
1566
+							echo "error : ".$e->getMessage();
1567
+					}
1568 1568
 		}
1569 1569
 		if ($globalDBdriver == 'mysql') {
1570 1570
 			update_db::gunzip('../db/countries.sql.gz',$tmp_dir.'countries.sql');
@@ -2093,11 +2093,11 @@  discard block
 block discarded – undo
2093 2093
 						$query = 'DROP TABLE airspace';
2094 2094
 						try {
2095 2095
 							$sth = $Connection->db->prepare($query);
2096
-    	    	    					$sth->execute();
2097
-			            		} catch(PDOException $e) {
2096
+										$sth->execute();
2097
+								} catch(PDOException $e) {
2098 2098
 							return "error : ".$e->getMessage();
2099
-		            			}
2100
-		    			}
2099
+								}
2100
+						}
2101 2101
 					$error = create_db::import_file($tmp_dir.'airspace.sql');
2102 2102
 					update_db::insert_airspace_version($airspace_md5);
2103 2103
 				} else $error = "File ".$tmp_dir.'airpsace.sql.gz'." doesn't exist. Download failed.";
@@ -2254,12 +2254,12 @@  discard block
 block discarded – undo
2254 2254
 		echo $data;
2255 2255
 		*/
2256 2256
 		if (file_exists($tmp_dir.'aircrafts.html')) {
2257
-		    //var_dump(file_get_html($tmp_dir.'aircrafts.html'));
2258
-		    $fh = fopen($tmp_dir.'aircrafts.html',"r");
2259
-		    $result = fread($fh,100000000);
2260
-		    //echo $result;
2261
-		    //var_dump(str_get_html($result));
2262
-		    //print_r(self::table2array($result));
2257
+			//var_dump(file_get_html($tmp_dir.'aircrafts.html'));
2258
+			$fh = fopen($tmp_dir.'aircrafts.html',"r");
2259
+			$result = fread($fh,100000000);
2260
+			//echo $result;
2261
+			//var_dump(str_get_html($result));
2262
+			//print_r(self::table2array($result));
2263 2263
 		}
2264 2264
 
2265 2265
 	}
@@ -2273,10 +2273,10 @@  discard block
 block discarded – undo
2273 2273
 		try {
2274 2274
 			$Connection = new Connection();
2275 2275
 			$sth = $Connection->db->prepare($query);
2276
-                        $sth->execute();
2277
-                } catch(PDOException $e) {
2278
-                        return "error : ".$e->getMessage();
2279
-                }
2276
+						$sth->execute();
2277
+				} catch(PDOException $e) {
2278
+						return "error : ".$e->getMessage();
2279
+				}
2280 2280
 
2281 2281
 		$error = '';
2282 2282
 		if ($globalDebug) echo "Notam : Download...";
@@ -2332,8 +2332,8 @@  discard block
 block discarded – undo
2332 2332
 					$data['date_end'] = date("Y-m-d H:i:s",strtotime($to));
2333 2333
 					$data['permanent'] = 0;
2334 2334
 				} else {
2335
-				    $data['date_end'] = NULL;
2336
-				    $data['permanent'] = 1;
2335
+					$data['date_end'] = NULL;
2336
+					$data['permanent'] = 1;
2337 2337
 				}
2338 2338
 				$data['full_notam'] = $notam['title'].'<br>'.$notam['description'];
2339 2339
 				$NOTAM = new NOTAM();
@@ -2407,13 +2407,13 @@  discard block
 block discarded – undo
2407 2407
 		try {
2408 2408
 			$Connection = new Connection();
2409 2409
 			$sth = $Connection->db->prepare($query);
2410
-                        $sth->execute();
2411
-                } catch(PDOException $e) {
2412
-                        return "error : ".$e->getMessage();
2413
-                }
2414
-                $row = $sth->fetch(PDO::FETCH_ASSOC);
2415
-                if ($row['nb'] > 0) return false;
2416
-                else return true;
2410
+						$sth->execute();
2411
+				} catch(PDOException $e) {
2412
+						return "error : ".$e->getMessage();
2413
+				}
2414
+				$row = $sth->fetch(PDO::FETCH_ASSOC);
2415
+				if ($row['nb'] > 0) return false;
2416
+				else return true;
2417 2417
 	}
2418 2418
 
2419 2419
 	public static function insert_last_update() {
@@ -2422,10 +2422,10 @@  discard block
 block discarded – undo
2422 2422
 		try {
2423 2423
 			$Connection = new Connection();
2424 2424
 			$sth = $Connection->db->prepare($query);
2425
-                        $sth->execute();
2426
-                } catch(PDOException $e) {
2427
-                        return "error : ".$e->getMessage();
2428
-                }
2425
+						$sth->execute();
2426
+				} catch(PDOException $e) {
2427
+						return "error : ".$e->getMessage();
2428
+				}
2429 2429
 	}
2430 2430
 
2431 2431
 	public static function check_airspace_version($version) {
@@ -2433,13 +2433,13 @@  discard block
 block discarded – undo
2433 2433
 		try {
2434 2434
 			$Connection = new Connection();
2435 2435
 			$sth = $Connection->db->prepare($query);
2436
-                        $sth->execute(array(':version' => $version));
2437
-                } catch(PDOException $e) {
2438
-                        return "error : ".$e->getMessage();
2439
-                }
2440
-                $row = $sth->fetch(PDO::FETCH_ASSOC);
2441
-                if ($row['nb'] > 0) return true;
2442
-                else return false;
2436
+						$sth->execute(array(':version' => $version));
2437
+				} catch(PDOException $e) {
2438
+						return "error : ".$e->getMessage();
2439
+				}
2440
+				$row = $sth->fetch(PDO::FETCH_ASSOC);
2441
+				if ($row['nb'] > 0) return true;
2442
+				else return false;
2443 2443
 	}
2444 2444
 
2445 2445
 	public static function check_marine_identity_version($version) {
@@ -2447,13 +2447,13 @@  discard block
 block discarded – undo
2447 2447
 		try {
2448 2448
 			$Connection = new Connection();
2449 2449
 			$sth = $Connection->db->prepare($query);
2450
-                        $sth->execute(array(':version' => $version));
2451
-                } catch(PDOException $e) {
2452
-                        return "error : ".$e->getMessage();
2453
-                }
2454
-                $row = $sth->fetch(PDO::FETCH_ASSOC);
2455
-                if ($row['nb'] > 0) return true;
2456
-                else return false;
2450
+						$sth->execute(array(':version' => $version));
2451
+				} catch(PDOException $e) {
2452
+						return "error : ".$e->getMessage();
2453
+				}
2454
+				$row = $sth->fetch(PDO::FETCH_ASSOC);
2455
+				if ($row['nb'] > 0) return true;
2456
+				else return false;
2457 2457
 	}
2458 2458
 
2459 2459
 
@@ -2463,10 +2463,10 @@  discard block
 block discarded – undo
2463 2463
 		try {
2464 2464
 			$Connection = new Connection();
2465 2465
 			$sth = $Connection->db->prepare($query);
2466
-                        $sth->execute(array(':version' => $version));
2467
-                } catch(PDOException $e) {
2468
-                        return "error : ".$e->getMessage();
2469
-                }
2466
+						$sth->execute(array(':version' => $version));
2467
+				} catch(PDOException $e) {
2468
+						return "error : ".$e->getMessage();
2469
+				}
2470 2470
 	}
2471 2471
 
2472 2472
 	public static function insert_marine_identity_version($version) {
@@ -2475,10 +2475,10 @@  discard block
 block discarded – undo
2475 2475
 		try {
2476 2476
 			$Connection = new Connection();
2477 2477
 			$sth = $Connection->db->prepare($query);
2478
-                        $sth->execute(array(':version' => $version));
2479
-                } catch(PDOException $e) {
2480
-                        return "error : ".$e->getMessage();
2481
-                }
2478
+						$sth->execute(array(':version' => $version));
2479
+				} catch(PDOException $e) {
2480
+						return "error : ".$e->getMessage();
2481
+				}
2482 2482
 	}
2483 2483
 
2484 2484
 	public static function check_last_notam_update() {
@@ -2491,13 +2491,13 @@  discard block
 block discarded – undo
2491 2491
 		try {
2492 2492
 			$Connection = new Connection();
2493 2493
 			$sth = $Connection->db->prepare($query);
2494
-                        $sth->execute();
2495
-                } catch(PDOException $e) {
2496
-                        return "error : ".$e->getMessage();
2497
-                }
2498
-                $row = $sth->fetch(PDO::FETCH_ASSOC);
2499
-                if ($row['nb'] > 0) return false;
2500
-                else return true;
2494
+						$sth->execute();
2495
+				} catch(PDOException $e) {
2496
+						return "error : ".$e->getMessage();
2497
+				}
2498
+				$row = $sth->fetch(PDO::FETCH_ASSOC);
2499
+				if ($row['nb'] > 0) return false;
2500
+				else return true;
2501 2501
 	}
2502 2502
 
2503 2503
 	public static function insert_last_notam_update() {
@@ -2506,10 +2506,10 @@  discard block
 block discarded – undo
2506 2506
 		try {
2507 2507
 			$Connection = new Connection();
2508 2508
 			$sth = $Connection->db->prepare($query);
2509
-                        $sth->execute();
2510
-                } catch(PDOException $e) {
2511
-                        return "error : ".$e->getMessage();
2512
-                }
2509
+						$sth->execute();
2510
+				} catch(PDOException $e) {
2511
+						return "error : ".$e->getMessage();
2512
+				}
2513 2513
 	}
2514 2514
 	public static function check_last_airspace_update() {
2515 2515
 		global $globalDBdriver;
@@ -2521,13 +2521,13 @@  discard block
 block discarded – undo
2521 2521
 		try {
2522 2522
 			$Connection = new Connection();
2523 2523
 			$sth = $Connection->db->prepare($query);
2524
-                        $sth->execute();
2525
-                } catch(PDOException $e) {
2526
-                        return "error : ".$e->getMessage();
2527
-                }
2528
-                $row = $sth->fetch(PDO::FETCH_ASSOC);
2529
-                if ($row['nb'] > 0) return false;
2530
-                else return true;
2524
+						$sth->execute();
2525
+				} catch(PDOException $e) {
2526
+						return "error : ".$e->getMessage();
2527
+				}
2528
+				$row = $sth->fetch(PDO::FETCH_ASSOC);
2529
+				if ($row['nb'] > 0) return false;
2530
+				else return true;
2531 2531
 	}
2532 2532
 
2533 2533
 	public static function insert_last_airspace_update() {
@@ -2536,10 +2536,10 @@  discard block
 block discarded – undo
2536 2536
 		try {
2537 2537
 			$Connection = new Connection();
2538 2538
 			$sth = $Connection->db->prepare($query);
2539
-                        $sth->execute();
2540
-                } catch(PDOException $e) {
2541
-                        return "error : ".$e->getMessage();
2542
-                }
2539
+						$sth->execute();
2540
+				} catch(PDOException $e) {
2541
+						return "error : ".$e->getMessage();
2542
+				}
2543 2543
 	}
2544 2544
 
2545 2545
 	public static function check_last_owner_update() {
@@ -2552,13 +2552,13 @@  discard block
 block discarded – undo
2552 2552
 		try {
2553 2553
 			$Connection = new Connection();
2554 2554
 			$sth = $Connection->db->prepare($query);
2555
-                        $sth->execute();
2556
-                } catch(PDOException $e) {
2557
-                        return "error : ".$e->getMessage();
2558
-                }
2559
-                $row = $sth->fetch(PDO::FETCH_ASSOC);
2560
-                if ($row['nb'] > 0) return false;
2561
-                else return true;
2555
+						$sth->execute();
2556
+				} catch(PDOException $e) {
2557
+						return "error : ".$e->getMessage();
2558
+				}
2559
+				$row = $sth->fetch(PDO::FETCH_ASSOC);
2560
+				if ($row['nb'] > 0) return false;
2561
+				else return true;
2562 2562
 	}
2563 2563
 
2564 2564
 	public static function insert_last_owner_update() {
@@ -2567,10 +2567,10 @@  discard block
 block discarded – undo
2567 2567
 		try {
2568 2568
 			$Connection = new Connection();
2569 2569
 			$sth = $Connection->db->prepare($query);
2570
-                        $sth->execute();
2571
-                } catch(PDOException $e) {
2572
-                        return "error : ".$e->getMessage();
2573
-                }
2570
+						$sth->execute();
2571
+				} catch(PDOException $e) {
2572
+						return "error : ".$e->getMessage();
2573
+				}
2574 2574
 	}
2575 2575
 	public static function check_last_schedules_update() {
2576 2576
 		global $globalDBdriver;
@@ -2582,13 +2582,13 @@  discard block
 block discarded – undo
2582 2582
 		try {
2583 2583
 			$Connection = new Connection();
2584 2584
 			$sth = $Connection->db->prepare($query);
2585
-                        $sth->execute();
2586
-                } catch(PDOException $e) {
2587
-                        return "error : ".$e->getMessage();
2588
-                }
2589
-                $row = $sth->fetch(PDO::FETCH_ASSOC);
2590
-                if ($row['nb'] > 0) return false;
2591
-                else return true;
2585
+						$sth->execute();
2586
+				} catch(PDOException $e) {
2587
+						return "error : ".$e->getMessage();
2588
+				}
2589
+				$row = $sth->fetch(PDO::FETCH_ASSOC);
2590
+				if ($row['nb'] > 0) return false;
2591
+				else return true;
2592 2592
 	}
2593 2593
 
2594 2594
 	public static function insert_last_schedules_update() {
@@ -2597,10 +2597,10 @@  discard block
 block discarded – undo
2597 2597
 		try {
2598 2598
 			$Connection = new Connection();
2599 2599
 			$sth = $Connection->db->prepare($query);
2600
-                        $sth->execute();
2601
-                } catch(PDOException $e) {
2602
-                        return "error : ".$e->getMessage();
2603
-                }
2600
+						$sth->execute();
2601
+				} catch(PDOException $e) {
2602
+						return "error : ".$e->getMessage();
2603
+				}
2604 2604
 	}
2605 2605
 	public static function check_last_tle_update() {
2606 2606
 		global $globalDBdriver;
@@ -2612,13 +2612,13 @@  discard block
 block discarded – undo
2612 2612
 		try {
2613 2613
 			$Connection = new Connection();
2614 2614
 			$sth = $Connection->db->prepare($query);
2615
-                        $sth->execute();
2616
-                } catch(PDOException $e) {
2617
-                        return "error : ".$e->getMessage();
2618
-                }
2619
-                $row = $sth->fetch(PDO::FETCH_ASSOC);
2620
-                if ($row['nb'] > 0) return false;
2621
-                else return true;
2615
+						$sth->execute();
2616
+				} catch(PDOException $e) {
2617
+						return "error : ".$e->getMessage();
2618
+				}
2619
+				$row = $sth->fetch(PDO::FETCH_ASSOC);
2620
+				if ($row['nb'] > 0) return false;
2621
+				else return true;
2622 2622
 	}
2623 2623
 
2624 2624
 	public static function insert_last_tle_update() {
@@ -2627,10 +2627,10 @@  discard block
 block discarded – undo
2627 2627
 		try {
2628 2628
 			$Connection = new Connection();
2629 2629
 			$sth = $Connection->db->prepare($query);
2630
-                        $sth->execute();
2631
-                } catch(PDOException $e) {
2632
-                        return "error : ".$e->getMessage();
2633
-                }
2630
+						$sth->execute();
2631
+				} catch(PDOException $e) {
2632
+						return "error : ".$e->getMessage();
2633
+				}
2634 2634
 	}
2635 2635
 	public static function check_last_marine_identity_update() {
2636 2636
 		global $globalDBdriver;
@@ -2642,13 +2642,13 @@  discard block
 block discarded – undo
2642 2642
 		try {
2643 2643
 			$Connection = new Connection();
2644 2644
 			$sth = $Connection->db->prepare($query);
2645
-                        $sth->execute();
2646
-                } catch(PDOException $e) {
2647
-                        return "error : ".$e->getMessage();
2648
-                }
2649
-                $row = $sth->fetch(PDO::FETCH_ASSOC);
2650
-                if ($row['nb'] > 0) return false;
2651
-                else return true;
2645
+						$sth->execute();
2646
+				} catch(PDOException $e) {
2647
+						return "error : ".$e->getMessage();
2648
+				}
2649
+				$row = $sth->fetch(PDO::FETCH_ASSOC);
2650
+				if ($row['nb'] > 0) return false;
2651
+				else return true;
2652 2652
 	}
2653 2653
 
2654 2654
 	public static function insert_last_marine_identity_update() {
@@ -2657,10 +2657,10 @@  discard block
 block discarded – undo
2657 2657
 		try {
2658 2658
 			$Connection = new Connection();
2659 2659
 			$sth = $Connection->db->prepare($query);
2660
-                        $sth->execute();
2661
-                } catch(PDOException $e) {
2662
-                        return "error : ".$e->getMessage();
2663
-                }
2660
+						$sth->execute();
2661
+				} catch(PDOException $e) {
2662
+						return "error : ".$e->getMessage();
2663
+				}
2664 2664
 	}
2665 2665
 	public static function delete_duplicatemodes() {
2666 2666
 		global $globalDBdriver;
@@ -2672,10 +2672,10 @@  discard block
 block discarded – undo
2672 2672
 		try {
2673 2673
 			$Connection = new Connection();
2674 2674
 			$sth = $Connection->db->prepare($query);
2675
-                        $sth->execute();
2676
-                } catch(PDOException $e) {
2677
-                        return "error : ".$e->getMessage();
2678
-                }
2675
+						$sth->execute();
2676
+				} catch(PDOException $e) {
2677
+						return "error : ".$e->getMessage();
2678
+				}
2679 2679
 	}
2680 2680
 	public static function delete_duplicateowner() {
2681 2681
 		global $globalDBdriver;
@@ -2687,10 +2687,10 @@  discard block
 block discarded – undo
2687 2687
 		try {
2688 2688
 			$Connection = new Connection();
2689 2689
 			$sth = $Connection->db->prepare($query);
2690
-                        $sth->execute();
2691
-                } catch(PDOException $e) {
2692
-                        return "error : ".$e->getMessage();
2693
-                }
2690
+						$sth->execute();
2691
+				} catch(PDOException $e) {
2692
+						return "error : ".$e->getMessage();
2693
+				}
2694 2694
 	}
2695 2695
 	
2696 2696
 	public static function update_all() {
Please login to merge, or discard this patch.