Completed
Push — master ( 46434e...ad133e )
by Yannick
32:08 queued 16:03
created
header.php 3 patches
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -14,35 +14,35 @@  discard block
 block discarded – undo
14 14
 if (isset($globalMapOffline) && $globalMapOffline) $MapType = 'offline';
15 15
 
16 16
 if (isset($_GET['3d'])) {
17
-	setcookie('MapFormat','3d');
17
+	setcookie('MapFormat', '3d');
18 18
 } else if (isset($_GET['2d'])) {
19
-	setcookie('MapFormat','2d');
19
+	setcookie('MapFormat', '2d');
20 20
 }
21 21
 
22 22
 if (isset($globalTSK) && $globalTSK && isset($_GET['tsk'])) {
23
-	$tsk = filter_input(INPUT_GET,'tsk',FILTER_SANITIZE_URL);
23
+	$tsk = filter_input(INPUT_GET, 'tsk', FILTER_SANITIZE_URL);
24 24
 }
25 25
 
26 26
 if (isset($_POST['archive'])) {
27
-	setcookie('archive','true');
28
-	setcookie('archive_begin',strtotime($_POST['start_date']));
29
-	setcookie('archive_end',strtotime($_POST['end_date']));
30
-	setcookie('archive_speed',$_POST['archivespeed']);
27
+	setcookie('archive', 'true');
28
+	setcookie('archive_begin', strtotime($_POST['start_date']));
29
+	setcookie('archive_end', strtotime($_POST['end_date']));
30
+	setcookie('archive_speed', $_POST['archivespeed']);
31 31
 }
32 32
 if (isset($_POST['noarchive'])) {
33
-	setcookie('archive','false',-1);
34
-	setcookie('archive_begin','',-1);
35
-	setcookie('archive_end','',-1);
36
-	setcookie('archive_speed','',-1);
33
+	setcookie('archive', 'false', -1);
34
+	setcookie('archive_begin', '', -1);
35
+	setcookie('archive_end', '', -1);
36
+	setcookie('archive_speed', '', -1);
37 37
 }
38 38
 // When button "Remove all filters" is clicked
39 39
 if (isset($_POST['removefilters'])) {
40
-	$allfilters = array_filter(array_keys($_COOKIE),function($key) {
41
-	    return strpos($key,'filter_') === 0;
40
+	$allfilters = array_filter(array_keys($_COOKIE), function($key) {
41
+	    return strpos($key, 'filter_') === 0;
42 42
 	});
43 43
 	foreach ($allfilters as $filt) {
44 44
 		unset($_COOKIE[$filt]);
45
-		setcookie($filt,null,-1);
45
+		setcookie($filt, null, -1);
46 46
 	}
47 47
 }
48 48
 ?>
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
265 265
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
266 266
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
267
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
267
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if (isset($latitude)) print '&latitude='.$latitude; ?><?php if (isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
268 268
 <?php
269 269
 		if (!isset($type) || $type == 'aircraft') {
270 270
 ?>
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
338 338
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
339 339
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
340
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
340
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if (isset($latitude)) print '&latitude='.$latitude; ?><?php if (isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
341 341
 <script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?flightaware_id=<?php print $flightaware_id; ?>&<?php print time(); ?>"></script>
342 342
 <?php
343 343
 		if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) {
@@ -742,8 +742,8 @@  discard block
 block discarded – undo
742 742
 ?>
743 743
       <div class="search">
744 744
 	<form action="<?php print $globalURL; ?>/search" method="get">
745
-		<!--<input type="text" name="q" value="<?php if (isset($GET['q'])) { if ($_GET['q'] != ""){ print $_GET['q']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button>-->
746
-		<input type="text" name="callsign" value="<?php if (isset($GET['callsign'])) { if ($_GET['callsign'] != ""){ print $_GET['callsign']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button>
745
+		<!--<input type="text" name="q" value="<?php if (isset($GET['q'])) { if ($_GET['q'] != "") { print $_GET['q']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button>-->
746
+		<input type="text" name="callsign" value="<?php if (isset($GET['callsign'])) { if ($_GET['callsign'] != "") { print $_GET['callsign']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button>
747 747
 	</form>
748 748
 	</div>
749 749
   	<div class="social">
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
 	print '</div>';
762 762
 }
763 763
 
764
-if (strtolower($current_page) =='ident-detailed' || strtolower($current_page) == 'flightid-overview') {
764
+if (strtolower($current_page) == 'ident-detailed' || strtolower($current_page) == 'flightid-overview') {
765 765
 ?>
766 766
     <div class="top-header clear" role="main">
767 767
 <?php
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
     </div>
775 775
 <?php
776 776
 }
777
-if ((strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) || (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false))
777
+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))
778 778
 {
779 779
     ?>
780 780
     <div class="top-header clear" role="main">
@@ -787,15 +787,15 @@  discard block
 block discarded – undo
787 787
         var zoom = 13;
788 788
 //create the map
789 789
 <?php
790
-    if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
790
+    if (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($airport_array[0]['latitude'])) {
791 791
 ?>
792 792
   map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom);
793 793
 <?php
794
-    } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
794
+    } elseif (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false) {
795 795
 ?>
796 796
   map = L.map('map', { zoomControl:true });
797 797
 <?php
798
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
798
+    } elseif (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
799 799
 ?>
800 800
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]);
801 801
     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);
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
     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);
804 804
     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);
805 805
 <?php
806
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) {
806
+    } elseif (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) {
807 807
 ?>
808 808
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]);
809 809
 <?php
Please login to merge, or discard this patch.
Indentation   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 // When button "Remove all filters" is clicked
39 39
 if (isset($_POST['removefilters'])) {
40 40
 	$allfilters = array_filter(array_keys($_COOKIE),function($key) {
41
-	    return strpos($key,'filter_') === 0;
41
+		return strpos($key,'filter_') === 0;
42 42
 	});
43 43
 	foreach ($allfilters as $filt) {
44 44
 		unset($_COOKIE[$filt]);
@@ -409,34 +409,34 @@  discard block
 block discarded – undo
409 409
 
410 410
       <ul class="nav navbar-nav">
411 411
 <?php
412
-    if (isset($globalNewsFeeds['global']) && !empty($globalNewsFeeds['global'])) {
412
+	if (isset($globalNewsFeeds['global']) && !empty($globalNewsFeeds['global'])) {
413 413
 ?>
414 414
     <li><a href="<?php print $globalURL; ?>/news"><?php echo _("News"); ?></a></li>
415 415
 <?php
416
-    }
416
+	}
417 417
 ?>
418 418
 
419 419
 <?php 
420
-    $sub = false;
421
-    if (
420
+	$sub = false;
421
+	if (
422 422
 	(
423
-	    (!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
423
+		(!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
424 424
 	) || 
425 425
 	(
426
-	    isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
426
+		isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
427 427
 	) || 
428 428
 	(
429
-	    isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
429
+		isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
430 430
 	) || 
431 431
 	(
432
-	    isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))
432
+		isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))
433 433
 	)
434
-    ) {
434
+	) {
435 435
 	$sub = true;
436
-    }
436
+	}
437 437
 ?>
438 438
 <?php
439
-    if (!isset($globalAircraft) || $globalAircraft === TRUE) {
439
+	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
440 440
 ?>
441 441
     <li class="dropdown">
442 442
 <?php
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 	<ul class="dropdown-menu multi-level">
448 448
       	<li class="dropdown-submenu">
449 449
 <?php
450
-        }
450
+		}
451 451
 ?>
452 452
 <?php
453 453
 	if (isset($globalNewsFeeds['aircraft']) && !empty($globalNewsFeeds['aircraft'])) {
@@ -462,25 +462,25 @@  discard block
 block discarded – undo
462 462
           <ul class="dropdown-menu">
463 463
           	<li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircraft Types"); ?></a></li>
464 464
 <?php
465
-    if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
465
+	if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
466 466
 ?>
467 467
 			<li><a href="<?php print $globalURL; ?>/airline"><?php echo _("Airlines"); ?></a></li>
468 468
 <?php
469
-    }
469
+	}
470 470
 ?>
471 471
 			<li><a href="<?php print $globalURL; ?>/airport"><?php echo _("Airports"); ?></a></li>
472 472
 <?php
473
-    if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
473
+	if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
474 474
 ?>
475 475
 			<li><a href="<?php print $globalURL; ?>/owner"><?php echo _("Owners"); ?></a></li>
476 476
 <?php
477
-    } 
478
-    if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
477
+	} 
478
+	if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
479 479
 
480 480
 ?>
481 481
 			<li><a href="<?php print $globalURL; ?>/pilot"><?php echo _("Pilots"); ?></a></li>
482 482
 <?php
483
-    }
483
+	}
484 484
 ?>
485 485
 			<li><hr /></li>
486 486
             <li><a href="<?php print $globalURL; ?>/currently"><?php echo _("Current Activity"); ?></a></li>
@@ -488,43 +488,43 @@  discard block
 block discarded – undo
488 488
             <li><a href="<?php print $globalURL; ?>/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li>
489 489
             <li><a href="<?php print $globalURL; ?>/newest"><?php echo _("Newest by Category"); ?></a></li>
490 490
             <?php
491
-        	if ($globalACARS) {
492
-        	    if (isset($globalDemo) && $globalDemo) {
493
-    	    ?>
491
+			if ($globalACARS) {
492
+				if (isset($globalDemo) && $globalDemo) {
493
+			?>
494 494
             <li><hr /></li>
495 495
             <li><i><?php echo _('ACARS data not available publicly'); ?></i></li>
496 496
             <li><a href=""><?php echo _('Latest ACARS messages'); ?></a></li>
497 497
             <li><a href=""><?php echo _('Archive ACARS messages'); ?></a></li>
498 498
             <?php
499
-        	    } else {
500
-    	    ?>
499
+				} else {
500
+			?>
501 501
             <li><hr /></li>
502 502
             <li><a href="<?php print $globalURL; ?>/acars-latest"><?php echo _("Latest ACARS messages"); ?></a></li>
503 503
             <li><a href="<?php print $globalURL; ?>/acars-archive"><?php echo _("Archive ACARS messages"); ?></a></li>
504 504
             <?php
505
-        	    }
506
-        	}
507
-    	    ?>
505
+				}
506
+			}
507
+			?>
508 508
     	    <?php
509
-    	        if (isset($globalAccidents) && $globalAccidents) {
510
-    	    ?>
509
+				if (isset($globalAccidents) && $globalAccidents) {
510
+			?>
511 511
             <li><hr /></li>
512 512
             <li><a href="<?php print $globalURL; ?>/accident-latest"><?php echo _("Latest accident"); ?></a></li>
513 513
             <li><a href="<?php print $globalURL; ?>/accident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Accident"); ?></a></li>
514 514
             <li><a href="<?php print $globalURL; ?>/incident-latest"><?php echo _("Latest incident"); ?></a></li>
515 515
             <li><a href="<?php print $globalURL; ?>/incident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Incident"); ?></a></li>
516 516
             <?php
517
-        	}
518
-    	    ?>
517
+			}
518
+			?>
519 519
             <li><hr /></li>
520 520
             <li><a href="<?php print $globalURL; ?>/highlights/table"><?php echo _("Special Highlights"); ?></a></li>
521 521
             <?php
522 522
 		if (!isset($globalNoUpcoming) || $globalNoUpcoming === FALSE) {
523
-	    ?>
523
+		?>
524 524
             <li><a href="<?php print $globalURL; ?>/upcoming"><?php echo _("Upcoming Flights"); ?></a></li>
525 525
 	    <?php
526 526
 		}
527
-	    ?>
527
+		?>
528 528
           </ul>
529 529
         </li>
530 530
       	<li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li>
@@ -551,14 +551,14 @@  discard block
 block discarded – undo
551 551
     </ul>
552 552
 <?php
553 553
 	}
554
-    }
554
+	}
555 555
 ?>
556 556
 <?php
557
-    if (isset($globalMarine) && $globalMarine) {
557
+	if (isset($globalMarine) && $globalMarine) {
558 558
 ?>
559 559
     <li class="dropdown">
560 560
 <?php
561
-        if ($sub) {
561
+		if ($sub) {
562 562
 ?>
563 563
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Marines"); ?> <b class="caret"></b></a>
564 564
 	<ul class="dropdown-menu multi-level">
@@ -601,14 +601,14 @@  discard block
 block discarded – undo
601 601
 	}
602 602
 ?>
603 603
 <?php
604
-    }
604
+	}
605 605
 ?>
606 606
 <?php
607
-    if (isset($globalTracker) && $globalTracker) {
607
+	if (isset($globalTracker) && $globalTracker) {
608 608
 ?>
609 609
     <li class="dropdown">
610 610
 <?php
611
-        if ($sub) {
611
+		if ($sub) {
612 612
 ?>
613 613
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Trackers"); ?> <b class="caret"></b></a>
614 614
 	<ul class="dropdown-menu multi-level">
@@ -642,14 +642,14 @@  discard block
 block discarded – undo
642 642
 	}
643 643
 ?>
644 644
 <?php
645
-    }
645
+	}
646 646
 ?>
647 647
 <?php
648
-    if (isset($globalSatellite) && $globalSatellite) {
648
+	if (isset($globalSatellite) && $globalSatellite) {
649 649
 ?>
650 650
     <li class="dropdown">
651 651
 <?php
652
-        if ($sub) {
652
+		if ($sub) {
653 653
 ?>
654 654
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Satellites"); ?> <b class="caret"></b></a>
655 655
 	<ul class="dropdown-menu multi-level">
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
 	}
686 686
 ?>
687 687
 <?php
688
-    }
688
+	}
689 689
 ?>
690 690
 
691 691
         <li class="dropdown">
@@ -693,13 +693,13 @@  discard block
 block discarded – undo
693 693
           <ul class="dropdown-menu">
694 694
           	<li><a href="<?php print $globalURL; ?>/about"><?php echo _("About The Project"); ?></a></li>
695 695
 <?php
696
-    if (!isset($globalAircraft) || $globalAircraft === TRUE) {
696
+	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
697 697
 ?>
698 698
           	<li><a href="<?php print $globalURL; ?>/about/export"><?php echo _("Exporting Data"); ?></a></li>
699 699
 		<li><hr /></li>
700 700
 		<li><a href="<?php print $globalURL; ?>/about/tv"><?php echo _("Spotter TV"); ?></a></li>
701 701
 <?php
702
-    }
702
+	}
703 703
 ?>
704 704
 	    <?php if (isset($globalContribute) && $globalContribute) { ?>
705 705
                 <li><hr /></li>
@@ -723,13 +723,13 @@  discard block
 block discarded – undo
723 723
   	    <form>
724 724
   		<select class="selectpicker" data-width="120px" onchange="language(this);">
725 725
   		    <?php
726
-  		        foreach ($alllang as $key => $lang) {
727
-  		            print '<option value="'.$key.'"';
728
-  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
729
-  		            if ($lang[0] == 'Deutsch') print '>'.$lang[0].' (&beta;eta)</option>';
730
-  		            else print '>'.$lang[0].'</option>';
731
-  		        }
732
-  		    ?>
726
+  				foreach ($alllang as $key => $lang) {
727
+  					print '<option value="'.$key.'"';
728
+  					if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
729
+  					if ($lang[0] == 'Deutsch') print '>'.$lang[0].' (&beta;eta)</option>';
730
+  					else print '>'.$lang[0].'</option>';
731
+  				}
732
+  			?>
733 733
   		</select>
734 734
   	    </form>
735 735
   	</div>
@@ -762,18 +762,18 @@  discard block
 block discarded – undo
762 762
 ?>
763 763
     <div class="top-header clear" role="main">
764 764
 <?php
765
-    if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) {
765
+	if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) {
766 766
 ?>
767 767
     <div id="archive-map"></div>
768 768
 <?php
769
-    }
769
+	}
770 770
 ?>
771 771
     </div>
772 772
 <?php
773 773
 }
774 774
 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))
775 775
 {
776
-    ?>
776
+	?>
777 777
     <div class="top-header clear" role="main">
778 778
         <div id="map"></div>
779 779
 	<link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" />
@@ -784,15 +784,15 @@  discard block
 block discarded – undo
784 784
         var zoom = 13;
785 785
 //create the map
786 786
 <?php
787
-    if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
787
+	if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
788 788
 ?>
789 789
   map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom);
790 790
 <?php
791
-    } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
791
+	} elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
792 792
 ?>
793 793
   map = L.map('map', { zoomControl:true });
794 794
 <?php
795
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
795
+	} elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
796 796
 ?>
797 797
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]);
798 798
     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);
@@ -800,22 +800,22 @@  discard block
 block discarded – undo
800 800
     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);
801 801
     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);
802 802
 <?php
803
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) {
803
+	} elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) {
804 804
 ?>
805 805
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]);
806 806
 <?php
807
-    } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) {
807
+	} elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) {
808 808
 ?>
809 809
   map = L.map('map', { zoomControl:true });
810 810
 <?php
811
-    }
811
+	}
812 812
 ?>
813 813
   //initialize the layer group for the aircrft markers
814 814
   var layer_data = L.layerGroup();
815 815
 
816 816
   //a few title layers
817 817
 <?php
818
-    if ($globalMapProvider == 'Mapbox') {
818
+	if ($globalMapProvider == 'Mapbox') {
819 819
 ?>
820 820
   L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', {
821 821
     maxZoom: 18,
@@ -826,14 +826,14 @@  discard block
 block discarded – undo
826 826
     token : '<?php print $globalMapboxToken; ?>'
827 827
   }).addTo(map);
828 828
 <?php
829
-    } elseif ($globalMapProvider == 'Mapbox-GL') {
829
+	} elseif ($globalMapProvider == 'Mapbox-GL') {
830 830
 ?>
831 831
     L.mapboxGL({
832 832
 	accessToken: '<?php print $globalMapboxToken; ?>',
833 833
 	style: 'mapbox://styles/mapbox/bright-v8'
834 834
   }).addTo(map);
835 835
 <?php
836
-    } elseif ($globalMapProvider == 'MapQuest-OSM') {
836
+	} elseif ($globalMapProvider == 'MapQuest-OSM') {
837 837
 ?>
838 838
   L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {
839 839
     maxZoom: 18,
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
       'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>'
843 843
   }).addTo(map);
844 844
 <?php
845
-    } elseif ($globalMapProvider == 'MapQuest-Aerial') {
845
+	} elseif ($globalMapProvider == 'MapQuest-Aerial') {
846 846
 ?>
847 847
   L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', {
848 848
     maxZoom: 18,
@@ -851,27 +851,27 @@  discard block
 block discarded – undo
851 851
       '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"'
852 852
   }).addTo(map);
853 853
 <?php
854
-    } elseif ($globalMapProvider == 'Google-Roadmap') {
854
+	} elseif ($globalMapProvider == 'Google-Roadmap') {
855 855
 ?>
856 856
     var googleLayer = new L.Google('ROADMAP');
857 857
     map.addLayer(googleLayer);
858 858
 <?php
859
-    } elseif ($globalMapProvider == 'Google-Satellite') {
859
+	} elseif ($globalMapProvider == 'Google-Satellite') {
860 860
 ?>
861 861
     var googleLayer = new L.Google('SATELLITE');
862 862
     map.addLayer(googleLayer);
863 863
 <?php
864
-    } elseif ($globalMapProvider == 'Google-Hybrid') {
864
+	} elseif ($globalMapProvider == 'Google-Hybrid') {
865 865
 ?>
866 866
     var googleLayer = new L.Google('HYBRID');
867 867
     map.addLayer(googleLayer);
868 868
 <?php
869
-    } elseif ($globalMapProvider == 'Google-Terrain') {
869
+	} elseif ($globalMapProvider == 'Google-Terrain') {
870 870
 ?>
871 871
     var googleLayer = new L.Google('Terrain');
872 872
     map.addLayer(googleLayer);
873 873
 <?php
874
-    } elseif (isset($globalMapCustomLayer[$globalMapProvider])) {
874
+	} elseif (isset($globalMapCustomLayer[$globalMapProvider])) {
875 875
 	$customid = $globalMapProvider;
876 876
 ?>
877 877
     L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', {
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
         attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
882 882
     }).addTo(map);
883 883
 <?php
884
-    } elseif ($globalMapProvider == 'offline' || (isset($globalMapOffline) && $globalMapOffline === TRUE)) {
884
+	} elseif ($globalMapProvider == 'offline' || (isset($globalMapOffline) && $globalMapOffline === TRUE)) {
885 885
 ?>
886 886
     var center = map.getCenter();
887 887
     map.options.crs = L.CRS.EPSG4326;
@@ -896,8 +896,8 @@  discard block
 block discarded – undo
896 896
         attribution: 'Natural Earth'
897 897
     }).addTo(map);
898 898
 <?php
899
-    //} elseif ($globalMapProvider == 'OpenStreetMap') {
900
-    } else {
899
+	//} elseif ($globalMapProvider == 'OpenStreetMap') {
900
+	} else {
901 901
 ?>
902 902
   L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
903 903
     maxZoom: 18,
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
   }).addTo(map);
907 907
 
908 908
 <?php
909
-    }
909
+	}
910 910
 ?>
911 911
         </script>
912 912
     </div>
Please login to merge, or discard this patch.
Braces   +98 added lines, -23 removed lines patch added patch discarded remove patch
@@ -6,12 +6,19 @@  discard block
 block discarded – undo
6 6
 //gets the page file and stores it in a variable
7 7
 $file_path = pathinfo($_SERVER['SCRIPT_NAME']);
8 8
 $current_page = $file_path['filename'];
9
-if ($globalTimezone == '') $globalTimezone = 'UTC';
9
+if ($globalTimezone == '') {
10
+	$globalTimezone = 'UTC';
11
+}
10 12
 date_default_timezone_set($globalTimezone);
11
-if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') $MapType = $_COOKIE['MapType'];
12
-else $MapType = $globalMapProvider;
13
+if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') {
14
+	$MapType = $_COOKIE['MapType'];
15
+} else {
16
+	$MapType = $globalMapProvider;
17
+}
13 18
 
14
-if (isset($globalMapOffline) && $globalMapOffline) $MapType = 'offline';
19
+if (isset($globalMapOffline) && $globalMapOffline) {
20
+	$MapType = 'offline';
21
+}
15 22
 
16 23
 if (isset($_GET['3d'])) {
17 24
 	setcookie('MapFormat','3d');
@@ -210,7 +217,10 @@  discard block
 block discarded – undo
210 217
 <?php
211 218
 		} else {
212 219
 ?>
213
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?<?php print time(); ?><?php if (isset($tsk)) print '&tsk='.$tsk; ?>"></script>
220
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?<?php print time(); ?><?php if (isset($tsk)) {
221
+	print '&tsk='.$tsk;
222
+}
223
+?>"></script>
214 224
 <?php
215 225
 		}
216 226
 		if (!isset($globalAircraft) || $globalAircraft) {
@@ -250,7 +260,13 @@  discard block
 block discarded – undo
250 260
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
251 261
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
252 262
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
253
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
263
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) {
264
+	print '&latitude='.$latitude;
265
+}
266
+?><?php if(isset($longitude)) {
267
+	print '&longitude='.$longitude;
268
+}
269
+?>&<?php print time(); ?>"></script>
254 270
 <?php
255 271
 		if (!isset($type) || $type == 'aircraft') {
256 272
 ?>
@@ -323,7 +339,13 @@  discard block
 block discarded – undo
323 339
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
324 340
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
325 341
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
326
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
342
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) {
343
+	print '&latitude='.$latitude;
344
+}
345
+?><?php if(isset($longitude)) {
346
+	print '&longitude='.$longitude;
347
+}
348
+?>&<?php print time(); ?>"></script>
327 349
 <script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?flightaware_id=<?php print $flightaware_id; ?>&<?php print time(); ?>"></script>
328 350
 <?php
329 351
 		if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) {
@@ -389,7 +411,9 @@  discard block
 block discarded – undo
389 411
 }
390 412
 ?>
391 413
 <?php
392
-if (isset($globalPubHeader)) print $globalPubHeader;
414
+if (isset($globalPubHeader)) {
415
+	print $globalPubHeader;
416
+}
393 417
 ?>
394 418
 
395 419
 <meta property="og:title" content="<?php print $title; ?> | <?php print $globalName; ?>"/>
@@ -407,7 +431,12 @@  discard block
 block discarded – undo
407 431
         <span class="icon-bar"></span>
408 432
       </button>
409 433
       <a href="<?php print $globalURL; ?>/search" class="navbar-toggle search"><i class="fa fa-search"></i></a>
410
-      <a class="navbar-brand" href="<?php if ($globalURL == '') print '/'; else print $globalURL; ?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a>
434
+      <a class="navbar-brand" href="<?php if ($globalURL == '') {
435
+	print '/';
436
+} else {
437
+	print $globalURL;
438
+}
439
+?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a>
411 440
     </div>
412 441
     <div class="collapse navbar-collapse">
413 442
 
@@ -462,7 +491,10 @@  discard block
 block discarded – undo
462 491
 	}
463 492
 ?>
464 493
 
465
-          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
494
+          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
495
+	echo 'right-';
496
+}
497
+?>caret"></b></a>
466 498
           <ul class="dropdown-menu">
467 499
           	<li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircraft Types"); ?></a></li>
468 500
 <?php
@@ -533,8 +565,14 @@  discard block
 block discarded – undo
533 565
         </li>
534 566
       	<li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li>
535 567
       	<li><a href="<?php print $globalURL; ?>/statistics"><?php echo _("Statistics"); ?></a></li>
536
-        <li class="dropdown<?php if ($sub) echo '-submenu'; ?>">
537
-          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
568
+        <li class="dropdown<?php if ($sub) {
569
+	echo '-submenu';
570
+}
571
+?>">
572
+          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) {
573
+	echo 'right-';
574
+}
575
+?>caret"></b></a>
538 576
           <ul class="dropdown-menu">
539 577
           	<li><a href="<?php print $globalURL; ?>/tools/acars"><?php echo _("ACARS translator"); ?></a></li>
540 578
           	<li><a href="<?php print $globalURL; ?>/tools/metar"><?php echo _("METAR translator"); ?></a></li>
@@ -578,7 +616,10 @@  discard block
 block discarded – undo
578 616
 <?php
579 617
 	}
580 618
 ?>
581
-		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
619
+		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
620
+	echo 'right-';
621
+}
622
+?>caret"></b></a>
582 623
 		<ul class="dropdown-menu">
583 624
 <?php
584 625
 	if (isset($globalVM) && $globalVM) {
@@ -628,7 +669,10 @@  discard block
 block discarded – undo
628 669
 <?php
629 670
 	}
630 671
 ?>
631
-		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
672
+		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
673
+	echo 'right-';
674
+}
675
+?>caret"></b></a>
632 676
 		<ul class="dropdown-menu">
633 677
 		    <li><a href="<?php print $globalURL; ?>/tracker/currently"><?php echo _("Current Activity"); ?></a></li>
634 678
 		    <li><a href="<?php print $globalURL; ?>/tracker/latest"><?php echo _("Latest Activity"); ?></a></li>
@@ -671,7 +715,10 @@  discard block
 block discarded – undo
671 715
 ?>
672 716
 
673 717
 <!--
674
-		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
718
+		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
719
+	echo 'right-';
720
+}
721
+?>caret"></b></a>
675 722
 		<ul class="dropdown-menu">
676 723
 		    <li><a href="<?php print $globalURL; ?>/satellite/currently"><?php echo _("Current Activity"); ?></a></li>
677 724
 		    <li><a href="<?php print $globalURL; ?>/satellite/latest"><?php echo _("Latest Activity"); ?></a></li>
@@ -729,9 +776,14 @@  discard block
 block discarded – undo
729 776
   		    <?php
730 777
   		        foreach ($alllang as $key => $lang) {
731 778
   		            print '<option value="'.$key.'"';
732
-  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
733
-  		            if ($lang[0] == 'Deutsch') print '>'.$lang[0].' (&beta;eta)</option>';
734
-  		            else print '>'.$lang[0].'</option>';
779
+  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) {
780
+  		            	print ' selected ';
781
+  		            }
782
+  		            if ($lang[0] == 'Deutsch') {
783
+  		            	print '>'.$lang[0].' (&beta;eta)</option>';
784
+  		            } else {
785
+  		            	print '>'.$lang[0].'</option>';
786
+  		            }
735 787
   		        }
736 788
   		    ?>
737 789
   		</select>
@@ -879,9 +931,24 @@  discard block
 block discarded – undo
879 931
 	$customid = $globalMapProvider;
880 932
 ?>
881 933
     L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', {
882
-        maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '18'; ?>,
883
-        minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>,
884
-        noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>,
934
+        maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) {
935
+	print $globalMapCustomLayer[$customid]['maxZoom'];
936
+} else {
937
+	print '18';
938
+}
939
+?>,
940
+        minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) {
941
+	print $globalMapCustomLayer[$customid]['minZoom'];
942
+} else {
943
+	print '0';
944
+}
945
+?>,
946
+        noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) {
947
+	print 'false';
948
+} else {
949
+	print 'true';
950
+}
951
+?>,
885 952
         attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
886 953
     }).addTo(map);
887 954
 <?php
@@ -896,7 +963,12 @@  discard block
 block discarded – undo
896 963
         maxZoom: 5,
897 964
         tms : true,
898 965
         zindex : 3,
899
-        noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>,
966
+        noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) {
967
+	print 'false';
968
+} else {
969
+	print 'true';
970
+}
971
+?>,
900 972
         attribution: 'Natural Earth'
901 973
     }).addTo(map);
902 974
 <?php
@@ -919,4 +991,7 @@  discard block
 block discarded – undo
919 991
 
920 992
 ?>
921 993
 
922
-<section class="container main-content <?php if (strtolower($current_page) == 'index') print 'index '; ?>clear">
994
+<section class="container main-content <?php if (strtolower($current_page) == 'index') {
995
+	print 'index ';
996
+}
997
+?>clear">
Please login to merge, or discard this patch.
require/class.MapMatching.php 2 patches
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -44,10 +44,10 @@  discard block
 block discarded – undo
44 44
 		$gpx .= '<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:gpsies="http://www.gpsies.com/GPX/1/0" creator="GPSies http://www.gpsies.com - Sendl.-O&amp;apos;sch-heim" version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.gpsies.com/GPX/1/0 http://www.gpsies.com/gpsies.xsd">';
45 45
 		$gpx .= '<trk>';
46 46
 		$gpx .= '<trkseg>';
47
-		foreach($spotter_history_array as $spotter_data) {
48
-			$gpx .= '<trkpt lat="'.sprintf("%.8f",$spotter_data['latitude']).'" lon="'.sprintf("%.8f",$spotter_data['longitude']).'">';
49
-			if (isset($spotter_data['altitude'])) $gpx .= '<ele>'.sprintf("%.6f",$spotter_data['altitude']).'</ele>';
50
-			$gpx .= '<time>'.date("Y-m-d\TH:i:s\Z",strtotime($spotter_data['date'])).'</time>';
47
+		foreach ($spotter_history_array as $spotter_data) {
48
+			$gpx .= '<trkpt lat="'.sprintf("%.8f", $spotter_data['latitude']).'" lon="'.sprintf("%.8f", $spotter_data['longitude']).'">';
49
+			if (isset($spotter_data['altitude'])) $gpx .= '<ele>'.sprintf("%.6f", $spotter_data['altitude']).'</ele>';
50
+			$gpx .= '<time>'.date("Y-m-d\TH:i:s\Z", strtotime($spotter_data['date'])).'</time>';
51 51
 			$gpx .= '</trkpt>';
52 52
 		}
53 53
 		$gpx .= '</trkseg>';
@@ -84,18 +84,18 @@  discard block
 block discarded – undo
84 84
 		global $globalMapMatchingMaxPts, $globalTrackMatchingAppKey, $globalTrackMatchingAppId;
85 85
 		if (!isset($globalMapMatchingMaxPts)) $globalMapMatchingMaxPts = 100;
86 86
 		if (count($spotter_history_array) < 2) return $spotter_history_array;
87
-		if (count($spotter_history_array) > $globalMapMatchingMaxPts) $spotter_history_array = array_slice($spotter_history_array,-$globalMapMatchingMaxPts);
87
+		if (count($spotter_history_array) > $globalMapMatchingMaxPts) $spotter_history_array = array_slice($spotter_history_array, -$globalMapMatchingMaxPts);
88 88
 		$data = $this->create_gpx($spotter_history_array);
89 89
 		$url = 'https://test.roadmatching.com/rest/mapmatch/?app_id='.$globalTrackMatchingAppId.'&app_key='.$globalTrackMatchingAppKey.'&output.waypoints=true';
90 90
 		$Common = new Common();
91
-		$matching = $Common->getData($url,'post',$data,array('Content-Type: application/gpx+xml','Accept: application/json'));
92
-		$matching = json_decode($matching,true);
91
+		$matching = $Common->getData($url, 'post', $data, array('Content-Type: application/gpx+xml', 'Accept: application/json'));
92
+		$matching = json_decode($matching, true);
93 93
 		if (isset($matching['diary']['entries'][0]['route']['links'])) {
94 94
 			$spotter_history_array = array();
95 95
 			foreach ($matching['diary']['entries'][0]['route']['links'] as $match) {
96 96
 				if (isset($match['wpts'])) {
97 97
 					foreach ($match['wpts'] as $coord) {
98
-						$spotter_history_array[] = array('longitude' => $coord['x'],'latitude' => $coord['y']);
98
+						$spotter_history_array[] = array('longitude' => $coord['x'], 'latitude' => $coord['y']);
99 99
 					}
100 100
 				}
101 101
 			}
@@ -115,22 +115,22 @@  discard block
 block discarded – undo
115 115
 		if (count($spotter_history_array) < 2) return $spotter_history_array;
116 116
 		$spotter_history_initial_array = array();
117 117
 		if (count($spotter_history_array) > $globalMapMatchingMaxPts) {
118
-			$spotter_history_array = array_slice($spotter_history_array,-$globalMapMatchingMaxPts);
119
-			$spotter_history_initial_array = array_slice($spotter_history_array,0,count($spotter_history_array)-$globalMapMatchingMaxPts);
118
+			$spotter_history_array = array_slice($spotter_history_array, -$globalMapMatchingMaxPts);
119
+			$spotter_history_initial_array = array_slice($spotter_history_array, 0, count($spotter_history_array) - $globalMapMatchingMaxPts);
120 120
 		}
121 121
 		$data = $this->create_gpx($spotter_history_array);
122 122
 		$url = 'https://graphhopper.com/api/1/match?vehicle=car&points_encoded=0&instructions=false&key='.$globalGraphHopperKey;
123 123
 		$Common = new Common();
124
-		$matching = $Common->getData($url,'post',$data,array('Content-Type: application/gpx+xml'));
125
-		$matching = json_decode($matching,true);
124
+		$matching = $Common->getData($url, 'post', $data, array('Content-Type: application/gpx+xml'));
125
+		$matching = json_decode($matching, true);
126 126
 		if (isset($matching['paths'][0]['points']['coordinates'])) {
127 127
 			$spotter_history_array = array();
128 128
 			foreach ($matching['paths'][0]['points']['coordinates'] as $match) {
129 129
 				$coord = $match;
130
-				$spotter_history_array[] = array('longitude' => $coord[0],'latitude' => $coord[1]);
130
+				$spotter_history_array[] = array('longitude' => $coord[0], 'latitude' => $coord[1]);
131 131
 			}
132 132
 		}
133
-		$spotter_history_array = array_merge($spotter_history_initial_array,$spotter_history_array);
133
+		$spotter_history_array = array_merge($spotter_history_initial_array, $spotter_history_array);
134 134
 		$spotter_history_array[0]['mapmatching_engine'] = 'graphhopper';
135 135
 		return $spotter_history_array;
136 136
 	}
@@ -146,23 +146,23 @@  discard block
 block discarded – undo
146 146
 		if (count($spotter_history_array) < 2) return $spotter_history_array;
147 147
 		$spotter_history_initial_array = array();
148 148
 		if (count($spotter_history_array) > $globalMapMatchingMaxPts) {
149
-			$spotter_history_array = array_slice($spotter_history_array,-$globalMapMatchingMaxPts);
150
-			$spotter_history_initial_array = array_slice($spotter_history_array,0,count($spotter_history_array)-$globalMapMatchingMaxPts);
149
+			$spotter_history_array = array_slice($spotter_history_array, -$globalMapMatchingMaxPts);
150
+			$spotter_history_initial_array = array_slice($spotter_history_array, 0, count($spotter_history_array) - $globalMapMatchingMaxPts);
151 151
 		}
152 152
 		$data = $this->create_gpx($spotter_history_array);
153 153
 		$url = 'https://mapmatching.flightairmap.com/api/1/match?vehicle=car&points_encoded=0&instructions=false';
154 154
 		//$url = 'https://mapmatching.flightairmap.com/api/1/match?vehicle=car&points_encoded=0';
155 155
 		$Common = new Common();
156
-		$matching = $Common->getData($url,'post',$data,array('Content-Type: application/gpx+xml'));
157
-		$matching = json_decode($matching,true);
156
+		$matching = $Common->getData($url, 'post', $data, array('Content-Type: application/gpx+xml'));
157
+		$matching = json_decode($matching, true);
158 158
 		if (isset($matching['paths'][0]['points']['coordinates'])) {
159 159
 			$spotter_history_array = array();
160 160
 			foreach ($matching['paths'][0]['points']['coordinates'] as $match) {
161 161
 				$coord = $match;
162
-				$spotter_history_array[] = array('longitude' => $coord[0],'latitude' => $coord[1]);
162
+				$spotter_history_array[] = array('longitude' => $coord[0], 'latitude' => $coord[1]);
163 163
 			}
164 164
 		}
165
-		$spotter_history_array = array_merge($spotter_history_initial_array,$spotter_history_array);
165
+		$spotter_history_array = array_merge($spotter_history_initial_array, $spotter_history_array);
166 166
 		$spotter_history_array[0]['mapmatching_engine'] = 'fam';
167 167
 		return $spotter_history_array;
168 168
 	}
@@ -178,8 +178,8 @@  discard block
 block discarded – undo
178 178
 		if (count($spotter_history_array) < 2) return $spotter_history_array;
179 179
 		$spotter_history_initial_array = array();
180 180
 		if (count($spotter_history_array) > $globalMapMatchingMaxPts) {
181
-			$spotter_history_array = array_slice($spotter_history_array,-$globalMapMatchingMaxPts);
182
-			$spotter_history_initial_array = array_slice($spotter_history_array,0,count($spotter_history_array)-$globalMapMatchingMaxPts);
181
+			$spotter_history_array = array_slice($spotter_history_array, -$globalMapMatchingMaxPts);
182
+			$spotter_history_initial_array = array_slice($spotter_history_array, 0, count($spotter_history_array) - $globalMapMatchingMaxPts);
183 183
 		}
184 184
 		$coord = '';
185 185
 		$ts = '';
@@ -195,15 +195,15 @@  discard block
 block discarded – undo
195 195
 		$url = 'https://router.project-osrm.org/match/v1/driving/'.$coord.'?timestamps='.$ts.'&overview=full&geometries=geojson&tidy=true&gaps=ignore';
196 196
 		$Common = new Common();
197 197
 		$matching = $Common->getData($url);
198
-		$matching  = json_decode($matching,true);
198
+		$matching = json_decode($matching, true);
199 199
 		if (isset($matching['matchings'][0]['geometry']['coordinates'])) {
200 200
 			$spotter_history_array = array();
201 201
 			foreach ($matching['matchings'][0]['geometry']['coordinates'] as $match) {
202 202
 				$coord = $match;
203
-				$spotter_history_array[] = array('longitude' => $coord[0],'latitude' => $coord[1]);
203
+				$spotter_history_array[] = array('longitude' => $coord[0], 'latitude' => $coord[1]);
204 204
 			}
205 205
 		}
206
-		$spotter_history_array = array_merge($spotter_history_initial_array,$spotter_history_array);
206
+		$spotter_history_array = array_merge($spotter_history_initial_array, $spotter_history_array);
207 207
 		$spotter_history_array[0]['mapmatching_engine'] = 'osmr';
208 208
 		return $spotter_history_array;
209 209
 	}
@@ -219,8 +219,8 @@  discard block
 block discarded – undo
219 219
 		if (count($spotter_history_array) < 2) return $spotter_history_array;
220 220
 		$spotter_history_initial_array = array();
221 221
 		if (count($spotter_history_array) > $globalMapMatchingMaxPts) {
222
-			$spotter_history_array = array_slice($spotter_history_array,-$globalMapMatchingMaxPts);
223
-			$spotter_history_initial_array = array_slice($spotter_history_array,0,count($spotter_history_array)-$globalMapMatchingMaxPts);
222
+			$spotter_history_array = array_slice($spotter_history_array, -$globalMapMatchingMaxPts);
223
+			$spotter_history_initial_array = array_slice($spotter_history_array, 0, count($spotter_history_array) - $globalMapMatchingMaxPts);
224 224
 		}
225 225
 		$coord = '';
226 226
 		$ts = '';
@@ -237,15 +237,15 @@  discard block
 block discarded – undo
237 237
 		$url = 'https://api.mapbox.com/matching/v5/mapbox/driving/'.$coord.'?access_token='.$globalMapboxToken.'&timestamps='.$ts.'&overview=full&tidy=true&geometries=geojson';
238 238
 		$Common = new Common();
239 239
 		$matching = $Common->getData($url);
240
-		$matching  = json_decode($matching,true);
240
+		$matching = json_decode($matching, true);
241 241
 		if (isset($matching['matchings'][0]['geometry']['coordinates'])) {
242 242
 			$spotter_history_array = array();
243 243
 			foreach ($matching['matchings'][0]['geometry']['coordinates'] as $match) {
244 244
 				$coord = $match;
245
-				$spotter_history_array[] = array('longitude' => $coord[0],'latitude' => $coord[1]);
245
+				$spotter_history_array[] = array('longitude' => $coord[0], 'latitude' => $coord[1]);
246 246
 			}
247 247
 		}
248
-		$spotter_history_array = array_merge($spotter_history_initial_array,$spotter_history_array);
248
+		$spotter_history_array = array_merge($spotter_history_initial_array, $spotter_history_array);
249 249
 		$spotter_history_array[0]['mapmatching_engine'] = 'mapbox';
250 250
 		return $spotter_history_array;
251 251
 	}
Please login to merge, or discard this patch.
Braces   +54 added lines, -18 removed lines patch added patch discarded remove patch
@@ -46,7 +46,9 @@  discard block
 block discarded – undo
46 46
 		$gpx .= '<trkseg>';
47 47
 		foreach($spotter_history_array as $spotter_data) {
48 48
 			$gpx .= '<trkpt lat="'.sprintf("%.8f",$spotter_data['latitude']).'" lon="'.sprintf("%.8f",$spotter_data['longitude']).'">';
49
-			if (isset($spotter_data['altitude'])) $gpx .= '<ele>'.sprintf("%.6f",$spotter_data['altitude']).'</ele>';
49
+			if (isset($spotter_data['altitude'])) {
50
+				$gpx .= '<ele>'.sprintf("%.6f",$spotter_data['altitude']).'</ele>';
51
+			}
50 52
 			$gpx .= '<time>'.date("Y-m-d\TH:i:s\Z",strtotime($spotter_data['date'])).'</time>';
51 53
 			$gpx .= '</trkpt>';
52 54
 		}
@@ -82,9 +84,15 @@  discard block
 block discarded – undo
82 84
 
83 85
 	public function TrackMatching($spotter_history_array) {
84 86
 		global $globalMapMatchingMaxPts, $globalTrackMatchingAppKey, $globalTrackMatchingAppId;
85
-		if (!isset($globalMapMatchingMaxPts)) $globalMapMatchingMaxPts = 100;
86
-		if (count($spotter_history_array) < 2) return $spotter_history_array;
87
-		if (count($spotter_history_array) > $globalMapMatchingMaxPts) $spotter_history_array = array_slice($spotter_history_array,-$globalMapMatchingMaxPts);
87
+		if (!isset($globalMapMatchingMaxPts)) {
88
+			$globalMapMatchingMaxPts = 100;
89
+		}
90
+		if (count($spotter_history_array) < 2) {
91
+			return $spotter_history_array;
92
+		}
93
+		if (count($spotter_history_array) > $globalMapMatchingMaxPts) {
94
+			$spotter_history_array = array_slice($spotter_history_array,-$globalMapMatchingMaxPts);
95
+		}
88 96
 		$data = $this->create_gpx($spotter_history_array);
89 97
 		$url = 'https://test.roadmatching.com/rest/mapmatch/?app_id='.$globalTrackMatchingAppId.'&app_key='.$globalTrackMatchingAppKey.'&output.waypoints=true';
90 98
 		$Common = new Common();
@@ -111,8 +119,12 @@  discard block
 block discarded – undo
111 119
 	*/
112 120
 	public function GraphHopper($spotter_history_array) {
113 121
 		global $globalMapMatchingMaxPts, $globalGraphHopperKey;
114
-		if (!isset($globalMapMatchingMaxPts)) $globalMapMatchingMaxPts = 100;
115
-		if (count($spotter_history_array) < 2) return $spotter_history_array;
122
+		if (!isset($globalMapMatchingMaxPts)) {
123
+			$globalMapMatchingMaxPts = 100;
124
+		}
125
+		if (count($spotter_history_array) < 2) {
126
+			return $spotter_history_array;
127
+		}
116 128
 		$spotter_history_initial_array = array();
117 129
 		if (count($spotter_history_array) > $globalMapMatchingMaxPts) {
118 130
 			$spotter_history_array = array_slice($spotter_history_array,-$globalMapMatchingMaxPts);
@@ -142,8 +154,12 @@  discard block
 block discarded – undo
142 154
 	*/
143 155
 	public function FAMMapMatching($spotter_history_array) {
144 156
 		global $globalMapMatchingMaxPts;
145
-		if (!isset($globalMapMatchingMaxPts)) $globalMapMatchingMaxPts = 100;
146
-		if (count($spotter_history_array) < 2) return $spotter_history_array;
157
+		if (!isset($globalMapMatchingMaxPts)) {
158
+			$globalMapMatchingMaxPts = 100;
159
+		}
160
+		if (count($spotter_history_array) < 2) {
161
+			return $spotter_history_array;
162
+		}
147 163
 		$spotter_history_initial_array = array();
148 164
 		if (count($spotter_history_array) > $globalMapMatchingMaxPts) {
149 165
 			$spotter_history_array = array_slice($spotter_history_array,-$globalMapMatchingMaxPts);
@@ -174,8 +190,12 @@  discard block
 block discarded – undo
174 190
 	*/
175 191
 	public function osmr($spotter_history_array) {
176 192
 		global $globalMapMatchingMaxPts;
177
-		if (!isset($globalMapMatchingMaxPts)) $globalMapMatchingMaxPts = 50;
178
-		if (count($spotter_history_array) < 2) return $spotter_history_array;
193
+		if (!isset($globalMapMatchingMaxPts)) {
194
+			$globalMapMatchingMaxPts = 50;
195
+		}
196
+		if (count($spotter_history_array) < 2) {
197
+			return $spotter_history_array;
198
+		}
179 199
 		$spotter_history_initial_array = array();
180 200
 		if (count($spotter_history_array) > $globalMapMatchingMaxPts) {
181 201
 			$spotter_history_array = array_slice($spotter_history_array,-$globalMapMatchingMaxPts);
@@ -185,11 +205,17 @@  discard block
 block discarded – undo
185 205
 		$ts = '';
186 206
 		$rd = '';
187 207
 		foreach ($spotter_history_array as $spotter_data) {
188
-			if ($coord != '') $coord .= ';';
208
+			if ($coord != '') {
209
+				$coord .= ';';
210
+			}
189 211
 			$coord .= $spotter_data['longitude'].','.$spotter_data['latitude'];
190
-			if ($ts != '') $ts .= ';';
212
+			if ($ts != '') {
213
+				$ts .= ';';
214
+			}
191 215
 			$ts .= strtotime($spotter_data['date']);
192
-			if ($rd != '') $rd .= ';';
216
+			if ($rd != '') {
217
+				$rd .= ';';
218
+			}
193 219
 			$rd .= '20';
194 220
 		}
195 221
 		$url = 'https://router.project-osrm.org/match/v1/driving/'.$coord.'?timestamps='.$ts.'&overview=full&geometries=geojson&tidy=true&gaps=ignore';
@@ -215,8 +241,12 @@  discard block
 block discarded – undo
215 241
 	*/
216 242
 	public function mapbox($spotter_history_array) {
217 243
 		global $globalMapMatchingMaxPts, $globalMapboxToken;
218
-		if (!isset($globalMapMatchingMaxPts)) $globalMapMatchingMaxPts = 60;
219
-		if (count($spotter_history_array) < 2) return $spotter_history_array;
244
+		if (!isset($globalMapMatchingMaxPts)) {
245
+			$globalMapMatchingMaxPts = 60;
246
+		}
247
+		if (count($spotter_history_array) < 2) {
248
+			return $spotter_history_array;
249
+		}
220 250
 		$spotter_history_initial_array = array();
221 251
 		if (count($spotter_history_array) > $globalMapMatchingMaxPts) {
222 252
 			$spotter_history_array = array_slice($spotter_history_array,-$globalMapMatchingMaxPts);
@@ -226,11 +256,17 @@  discard block
 block discarded – undo
226 256
 		$ts = '';
227 257
 		$rd = '';
228 258
 		foreach ($spotter_history_array as $spotter_data) {
229
-			if ($coord != '') $coord .= ';';
259
+			if ($coord != '') {
260
+				$coord .= ';';
261
+			}
230 262
 			$coord .= $spotter_data['longitude'].','.$spotter_data['latitude'];
231
-			if ($ts != '') $ts .= ';';
263
+			if ($ts != '') {
264
+				$ts .= ';';
265
+			}
232 266
 			$ts .= strtotime($spotter_data['date']);
233
-			if ($rd != '') $rd .= ';';
267
+			if ($rd != '') {
268
+				$rd .= ';';
269
+			}
234 270
 			$rd .= '20';
235 271
 		}
236 272
 		//$url = 'https://api.mapbox.com/matching/v5/mapbox/driving/'.$coord.'?access_token='.$globalMapboxToken.'&timestamps='.$ts.'&overview=full&tidy=true&geometries=geojson&radiuses='.$rd;
Please login to merge, or discard this patch.
highlights-display.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@  discard block
 block discarded – undo
7 7
 require_once('header.php');
8 8
 
9 9
 //calculuation for the pagination
10
-if(!isset($_GET['limit']))
10
+if (!isset($_GET['limit']))
11 11
 {
12 12
 	$limit_start = 0;
13 13
 	$limit_end = 28;
14 14
 	$absolute_difference = 28;
15 15
 } else {
16 16
 	$limit_explode = explode(",", $_GET['limit']);
17
-	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
18
-	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
17
+	$limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT);
18
+	$limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT);
19 19
 	if (!ctype_digit(strval($limit_start)) || !ctype_digit(strval($limit_end))) {
20 20
 		$limit_start = 0;
21 21
 		$limit_end = 25;
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 print '<div class="column">';	
40 40
 print '<p>'._("The view below shows all aircraft that have been selected to have some sort of special characteristic about them, such as unique liveries, destinations etc.").'</p>';
41 41
 
42
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
42
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
43 43
 if ($sort != '') {
44 44
 	$spotter_array = $Spotter->getSpotterDataByHighlight($limit_start.",".$absolute_difference, $sort);
45 45
 } else {
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 if (!empty($spotter_array))
49 49
 {
50 50
 	print '<div class="dispay-view">';
51
-	foreach($spotter_array as $spotter_item)
51
+	foreach ($spotter_array as $spotter_item)
52 52
 	{
53 53
 		if (isset($spotter_item['image']) && $spotter_item['image'] != "")
54 54
 		{
Please login to merge, or discard this patch.
pilot-detailed.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@  discard block
 block discarded – undo
5 5
 require_once('require/class.Language.php');
6 6
 require_once('require/class.SpotterArchive.php');
7 7
 
8
-if (!isset($_GET['pilot'])){
8
+if (!isset($_GET['pilot'])) {
9 9
 	header('Location: '.$globalURL.'/');
10 10
 } else {
11 11
 	$Spotter = new Spotter();
12 12
 	$SpotterArchive = new SpotterArchive();
13 13
 	//calculuation for the pagination
14
-	if(!isset($_GET['limit']))
14
+	if (!isset($_GET['limit']))
15 15
 	{
16 16
 		$limit_start = 0;
17 17
 		$limit_end = 25;
@@ -32,29 +32,29 @@  discard block
 block discarded – undo
32 32
 	
33 33
 	$page_url = $globalURL.'/pilot/'.$_GET['pilot'];
34 34
 	
35
-	$pilot = filter_input(INPUT_GET,'pilot',FILTER_SANITIZE_STRING);
36
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
37
-	$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
38
-	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
35
+	$pilot = filter_input(INPUT_GET, 'pilot', FILTER_SANITIZE_STRING);
36
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
37
+	$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
38
+	$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
39 39
 	$filter = array();
40
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
41
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
40
+	if ($year != '') $filter = array_merge($filter, array('year' => $year));
41
+	if ($month != '') $filter = array_merge($filter, array('month' => $month));
42 42
 	if ($sort != '') 
43 43
 	{
44
-		$spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter);
44
+		$spotter_array = $Spotter->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, $sort, $filter);
45 45
 		if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
46
-			$spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter);
46
+			$spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, $sort, $filter);
47 47
 		}
48 48
 	} else {
49
-		$spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference,'',$filter);
49
+		$spotter_array = $Spotter->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, '', $filter);
50 50
 		if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
51
-			$spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference,'',$filter);
51
+			$spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, '', $filter);
52 52
 		}
53 53
 	}
54 54
 
55 55
 	if (!empty($spotter_array))
56 56
 	{
57
-		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['pilot_name']);
57
+		$title = sprintf(_("Detailed View for %s"), $spotter_array[0]['pilot_name']);
58 58
 		$ident = $spotter_array[0]['ident'];
59 59
 		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
60 60
 		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
@@ -115,23 +115,23 @@  discard block
 block discarded – undo
115 115
 			$Stats = new Stats();
116 116
 			$flights = $Stats->getStatsPilot($pilot);
117 117
 		} else $flights = 0;
118
-		if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot,$filter);
118
+		if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot, $filter);
119 119
 		print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>';
120
-		$aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot,$filter));
120
+		$aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot, $filter));
121 121
 		print '<div><span class="label">'._("Aircraft type").'</span>'.$aircraft_type.'</div>';
122
-		$aircraft_registration = count($Spotter->countAllAircraftRegistrationByPilot($pilot,$filter));
122
+		$aircraft_registration = count($Spotter->countAllAircraftRegistrationByPilot($pilot, $filter));
123 123
 		print '<div><span class="label">'._("Aircraft").'</span>'.$aircraft_registration.'</div>';
124
-		$aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByPilot($pilot,$filter));
124
+		$aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByPilot($pilot, $filter));
125 125
 		print '<div><span class="label">'._("Manufacturers").'</span>'.$aircraft_manufacturer.'</div>';
126
-		$airlines = count($Spotter->countAllAirlinesByPilot($pilot,$filter));
126
+		$airlines = count($Spotter->countAllAirlinesByPilot($pilot, $filter));
127 127
 		print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>';
128
-		$duration = $Spotter->getFlightDurationByPilot($pilot,$filter);
128
+		$duration = $Spotter->getFlightDurationByPilot($pilot, $filter);
129 129
 		if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
130 130
 		print '</div>';
131 131
 	
132 132
 		include('pilot-sub-menu.php');
133 133
 		print '<div class="table column">';
134
-		print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the pilot <strong>%s</strong>."),$spotter_array[0]['pilot_name']).'</p>';
134
+		print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the pilot <strong>%s</strong>."), $spotter_array[0]['pilot_name']).'</p>';
135 135
 
136 136
 		include('table-output.php'); 
137 137
 		print '<div class="pagination">';
Please login to merge, or discard this patch.
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,8 +37,12 @@  discard block
 block discarded – undo
37 37
 	$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
38 38
 	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
39 39
 	$filter = array();
40
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
41
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
40
+	if ($year != '') {
41
+		$filter = array_merge($filter,array('year' => $year));
42
+	}
43
+	if ($month != '') {
44
+		$filter = array_merge($filter,array('month' => $month));
45
+	}
42 46
 	if ($sort != '') 
43 47
 	{
44 48
 		$spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter);
@@ -56,8 +60,12 @@  discard block
 block discarded – undo
56 60
 	{
57 61
 		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['pilot_name']);
58 62
 		$ident = $spotter_array[0]['ident'];
59
-		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
60
-		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
63
+		if (isset($spotter_array[0]['latitude'])) {
64
+			$latitude = $spotter_array[0]['latitude'];
65
+		}
66
+		if (isset($spotter_array[0]['longitude'])) {
67
+			$longitude = $spotter_array[0]['longitude'];
68
+		}
61 69
 		require_once('header.php');
62 70
 		/*
63 71
 		if (isset($globalArchive) && $globalArchive) {
@@ -110,12 +118,18 @@  discard block
 block discarded – undo
110 118
 		*/
111 119
 		print '<div class="info column">';
112 120
 		print '<h1>'.$spotter_array[0]['pilot_name'].'</h1>';
113
-		if (isset($spotter_array[0]['pilot_id']) && $spotter_array[0]['pilot_id'] != '') print '<div><span class="label">'._("Pilot ID").'</span>'.$spotter_array[0]['pilot_id'].'</div>';
121
+		if (isset($spotter_array[0]['pilot_id']) && $spotter_array[0]['pilot_id'] != '') {
122
+			print '<div><span class="label">'._("Pilot ID").'</span>'.$spotter_array[0]['pilot_id'].'</div>';
123
+		}
114 124
 		if ($year == '' && $month == '') {
115 125
 			$Stats = new Stats();
116 126
 			$flights = $Stats->getStatsPilot($pilot);
117
-		} else $flights = 0;
118
-		if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot,$filter);
127
+		} else {
128
+			$flights = 0;
129
+		}
130
+		if ($flights == 0) {
131
+			$flights = $Spotter->countFlightsByPilot($pilot,$filter);
132
+		}
119 133
 		print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>';
120 134
 		$aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot,$filter));
121 135
 		print '<div><span class="label">'._("Aircraft type").'</span>'.$aircraft_type.'</div>';
@@ -126,7 +140,9 @@  discard block
 block discarded – undo
126 140
 		$airlines = count($Spotter->countAllAirlinesByPilot($pilot,$filter));
127 141
 		print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>';
128 142
 		$duration = $Spotter->getFlightDurationByPilot($pilot,$filter);
129
-		if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
143
+		if ($duration != '0') {
144
+			print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
145
+		}
130 146
 		print '</div>';
131 147
 	
132 148
 		include('pilot-sub-menu.php');
Please login to merge, or discard this patch.
route-statistics-aircraft.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@  discard block
 block discarded – undo
7 7
 require_once('require/class.Connection.php');
8 8
 require_once('require/class.Spotter.php');
9 9
 require_once('require/class.Language.php');
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$departure_airport = filter_input(INPUT_GET,'departure_airport',FILTER_SANITIZE_STRING);
12
-$arrival_airport = filter_input(INPUT_GET,'arrival_airport',FILTER_SANITIZE_STRING);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$departure_airport = filter_input(INPUT_GET, 'departure_airport', FILTER_SANITIZE_STRING);
12
+$arrival_airport = filter_input(INPUT_GET, 'arrival_airport', FILTER_SANITIZE_STRING);
13 13
 $Spotter = new Spotter();
14 14
 $spotter_array = $Spotter->getSpotterDataByRoute($departure_airport, $arrival_airport, "0,1", $sort);
15 15
   
16 16
 if (!empty($spotter_array))
17 17
 {
18
-	$title = sprintf(_("Most Common Aircraft between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']);
18
+	$title = sprintf(_("Most Common Aircraft between %s (%s), %s - %s (%s), %s"), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']);
19 19
 	require_once('header.php');
20 20
 	print '<div class="info column">';
21 21
 	print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>';
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	include('route-sub-menu.php');
27 27
 	print '<div class="column">';
28 28
 	print '<h2>'._("Most Common Aircraft").'</h2>';
29
-	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']).'</p>';
29
+	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']).'</p>';
30 30
 
31 31
 	$aircraft_array = $Spotter->countAllAircraftTypesByRoute($departure_airport, $arrival_airport);
32 32
 	if (!empty($aircraft_array))
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		print '</thead>';
42 42
 		print '<tbody>';
43 43
 		$i = 1;
44
-		foreach($aircraft_array as $aircraft_item)
44
+		foreach ($aircraft_array as $aircraft_item)
45 45
 		{
46 46
 			print '<tr>';
47 47
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
live-geojson.php 3 patches
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -14,23 +14,23 @@  discard block
 block discarded – undo
14 14
 $usecoord = false;
15 15
 if (isset($_GET['test'])) exit();
16 16
 if (isset($_GET['tracker'])) {
17
-    $tracker = true;
17
+	$tracker = true;
18 18
 }
19 19
 if (isset($_GET['marine'])) {
20
-    $marine = true;
20
+	$marine = true;
21 21
 }
22 22
 if ($tracker) {
23
-    require_once('require/class.Tracker.php');
24
-    require_once('require/class.TrackerLive.php');
25
-    require_once('require/class.TrackerArchive.php');
23
+	require_once('require/class.Tracker.php');
24
+	require_once('require/class.TrackerLive.php');
25
+	require_once('require/class.TrackerArchive.php');
26 26
 } elseif ($marine) {
27
-    require_once('require/class.Marine.php');
28
-    require_once('require/class.MarineLive.php');
29
-    require_once('require/class.MarineArchive.php');
27
+	require_once('require/class.Marine.php');
28
+	require_once('require/class.MarineLive.php');
29
+	require_once('require/class.MarineArchive.php');
30 30
 } else {
31
-    require_once('require/class.Spotter.php');
32
-    require_once('require/class.SpotterLive.php');
33
-    require_once('require/class.SpotterArchive.php');
31
+	require_once('require/class.Spotter.php');
32
+	require_once('require/class.SpotterLive.php');
33
+	require_once('require/class.SpotterArchive.php');
34 34
 }
35 35
 
36 36
 $begintime = microtime(true);
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
 $Common = new Common();
51 51
 
52 52
 if (isset($_GET['download'])) {
53
-    if ($_GET['download'] == "true")
54
-    {
53
+	if ($_GET['download'] == "true")
54
+	{
55 55
 	header('Content-disposition: attachment; filename="flightairmap.json"');
56
-    }
56
+	}
57 57
 }
58 58
 header('Content-Type: text/javascript');
59 59
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	$usecoord = true;
132 132
 	$coord = explode(',',$_GET['coord']);
133 133
 	if (filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
134
-	    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) {
134
+		&& $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) {
135 135
 		if ($tracker) {
136 136
 			$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter);
137 137
 		} elseif ($marine) {
@@ -635,17 +635,17 @@  discard block
 block discarded – undo
635 635
 				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
636 636
 				
637 637
 				if (
638
-				    (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') 
639
-				    || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)
638
+					(isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') 
639
+					|| ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)
640 640
 				//    || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))
641 641
 				//    || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident'])
642
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
643
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])
644
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id']))
645
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])
646
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid']))
647
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])
648
-				    ) {
642
+					|| (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
643
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])
644
+					|| (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id']))
645
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])
646
+					|| (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid']))
647
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])
648
+					) {
649 649
 					if ($tracker) {
650 650
 						if ($from_archive || $globalArchive) {
651 651
 							$spotter_history_array = $TrackerArchive->getAllArchiveTrackerDataById($spotter_item['famtrackid']);
@@ -653,9 +653,9 @@  discard block
 block discarded – undo
653 653
 							$spotter_history_array = $TrackerLive->getAllLiveTrackerDataById($spotter_item['famtrackid']);
654 654
 						}
655 655
 						if (((isset($_COOKIE['mapmatching']) && $_COOKIE['mapmatching'] == 'true') ||
656
-						    (!isset($_COOKIE['mapmatching']) && $globalMapMatching === TRUE)) && 
657
-						    isset($_GET['zoom']) && $_GET['zoom'] > 12 && 
658
-						    isset($spotter_item['type']) && (
656
+							(!isset($_COOKIE['mapmatching']) && $globalMapMatching === TRUE)) && 
657
+							isset($_GET['zoom']) && $_GET['zoom'] > 12 && 
658
+							isset($spotter_item['type']) && (
659 659
 							$spotter_item['type'] == 'Firetruck' ||
660 660
 							$spotter_item['type'] == 'Ambulance' ||
661 661
 							$spotter_item['type'] == 'Truck (18 Wheeler)' ||
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 							$spotter_item['type'] == 'Jeep' ||
668 668
 							$spotter_item['type'] == 'Motorcycle' ||
669 669
 							$spotter_item['type'] == 'Car'
670
-						    )
670
+							)
671 671
 						) {
672 672
 							require(dirname(__FILE__).'/require/class.MapMatching.php');
673 673
 							$MapMatching = new MapMatching();
@@ -770,75 +770,75 @@  discard block
 block discarded – undo
770 770
 				}
771 771
 				
772 772
 				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
773
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
774
-				     && (isset($spotter_item['departure_airport']) 
775
-				        && $spotter_item['departure_airport'] != 'NA' 
776
-				        && isset($spotter_item['arrival_airport']) 
777
-				        && $spotter_item['arrival_airport'] != 'NA' 
778
-				        && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") 
779
-				    	    || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) {
780
-				    if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
781
-				    else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
782
-				    if (isset($spotter_item['departure_airport_latitude'])) {
773
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
774
+					 && (isset($spotter_item['departure_airport']) 
775
+						&& $spotter_item['departure_airport'] != 'NA' 
776
+						&& isset($spotter_item['arrival_airport']) 
777
+						&& $spotter_item['arrival_airport'] != 'NA' 
778
+						&& ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") 
779
+							|| (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) {
780
+					if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
781
+					else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
782
+					if (isset($spotter_item['departure_airport_latitude'])) {
783 783
 					$output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],';
784
-				    } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') {
784
+					} elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') {
785 785
 					$dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']);
786 786
 					if (isset($dairport[0]['latitude'])) {
787
-					    $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],';
787
+						$output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],';
788 788
 					}
789
-				    }
790
-				    if (isset($spotter_item['arrival_airport_latitude'])) {
789
+					}
790
+					if (isset($spotter_item['arrival_airport_latitude'])) {
791 791
 					$output_air .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].'],';
792
-				    } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
792
+					} elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
793 793
 					$aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);
794 794
 					if (isset($aairport[0]['latitude'])) {
795
-					    $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],';
795
+						$output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],';
796 796
 					}
797
-				    }
798
-				    $output_air  = substr($output_air, 0, -1);
799
-				    $output_air .= ']}},';
800
-				    $output .= $output_air;
801
-				    unset($output_air);
797
+					}
798
+					$output_air  = substr($output_air, 0, -1);
799
+					$output_air .= ']}},';
800
+					$output .= $output_air;
801
+					unset($output_air);
802 802
 				}
803 803
 
804 804
 				//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))))) {
805 805
 				//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))))) {
806 806
 				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
807
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
808
-				     && (isset($spotter_item['arrival_airport']) 
809
-				        && $spotter_item['arrival_airport'] != 'NA' 
810
-				        && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") 
811
-				    	    || (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute) 
812
-				    	    || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) {
813
-				    $havedata = false;
814
-				    if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
815
-				    else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
807
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
808
+					 && (isset($spotter_item['arrival_airport']) 
809
+						&& $spotter_item['arrival_airport'] != 'NA' 
810
+						&& ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") 
811
+							|| (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute) 
812
+							|| (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) {
813
+					$havedata = false;
814
+					if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
815
+					else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
816 816
 				    
817
-				    //$output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';
818
-				    if (isset($spotter_item['arrival_airport_latitude'])) {
817
+					//$output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';
818
+					if (isset($spotter_item['arrival_airport_latitude'])) {
819 819
 					//$output_dest .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].']';
820 820
 					$end_lon = $spotter_item['arrival_airport_longitude'];
821 821
 					$end_lat = $spotter_item['arrival_airport_latitude'];
822 822
 					$havedata = true;
823
-				    } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
823
+					} elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
824 824
 					$aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);
825 825
 					if (isset($aairport[0]['latitude'])) {
826
-					    //$output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']';
827
-					    $end_lon = $aairport[0]['longitude'];
828
-					    $end_lat = $aairport[0]['latitude'];
829
-					    $havedata = true;
826
+						//$output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']';
827
+						$end_lon = $aairport[0]['longitude'];
828
+						$end_lat = $aairport[0]['latitude'];
829
+						$havedata = true;
830 830
 					}
831
-				    }
832
-				    if ($havedata) {
831
+					}
832
+					if ($havedata) {
833 833
 					$line = $Common->greatCircle($spotter_item['latitude'],$spotter_item['longitude'],$end_lat,$end_lon);
834 834
 					foreach ($line[0] as $coord) {
835 835
 						$output_dest .= '['.$coord[0].','.$coord[1].'],';
836 836
 					}
837 837
 					$output_dest  = substr($output_dest, 0, -1);
838
-				    }
839
-				    $output_dest .= ']}},';
840
-				    if ($havedata) $output .= $output_dest;
841
-				    unset($output_dest);
838
+					}
839
+					$output_dest .= ']}},';
840
+					if ($havedata) $output .= $output_dest;
841
+					unset($output_dest);
842 842
 				}
843 843
 			}
844 844
 			$output  = substr($output, 0, -1);
Please login to merge, or discard this patch.
Spacing   +95 added lines, -95 removed lines patch added patch discarded remove patch
@@ -65,18 +65,18 @@  discard block
 block discarded – undo
65 65
 $min = true;
66 66
 $allhistory = false;
67 67
 $filter['source'] = array();
68
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
69
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
70
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
71
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
72
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
73
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
74
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
75
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
76
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
77
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
78
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
79
-if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_NUMBER_INT);
68
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt'));
69
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup'));
70
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars'));
71
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs'));
72
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs'));
73
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING);
74
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING);
75
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING);
76
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING);
77
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING);
78
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING);
79
+if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'], FILTER_SANITIZE_NUMBER_INT);
80 80
 if (isset($_COOKIE['filter_blocked']) && $_COOKIE['filter_blocked'] == 'true') $filter['blocked'] = true;
81 81
 
82 82
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
@@ -85,13 +85,13 @@  discard block
 block discarded – undo
85 85
 
86 86
 
87 87
 if (isset($_COOKIE['map_2d_limit'])) {
88
-	$limit = filter_var($_COOKIE['map_2d_limit'],FILTER_SANITIZE_NUMBER_INT);
88
+	$limit = filter_var($_COOKIE['map_2d_limit'], FILTER_SANITIZE_NUMBER_INT);
89 89
 }
90 90
 
91 91
 $spotter_array = array();
92 92
 
93 93
 if (isset($_GET['ident'])) {
94
-	$ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING));
94
+	$ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING));
95 95
 	if ($tracker) {
96 96
 		$spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident);
97 97
 	} elseif ($marine) {
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	}
106 106
 	$allhistory = true;
107 107
 } elseif (isset($_GET['flightaware_id'])) {
108
-	$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
108
+	$flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING);
109 109
 	$spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id);
110 110
 	if (empty($spotter_array)) {
111 111
 		$from_archive = true;
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
113 113
 	}
114 114
 	$allhistory = true;
115 115
 } elseif (isset($_GET['famtrack_id'])) {
116
-	$famtrack_id = urldecode(filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING));
116
+	$famtrack_id = urldecode(filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING));
117 117
 	$spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id);
118 118
 	$allhistory = true;
119 119
 } elseif (isset($_GET['fammarine_id'])) {
120
-	$fammarine_id = urldecode(filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING));
120
+	$fammarine_id = urldecode(filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING));
121 121
 	$spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id);
122 122
 	$allhistory = true;
123 123
 /*
@@ -137,15 +137,15 @@  discard block
 block discarded – undo
137 137
 */
138 138
 } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min && !isset($_GET['archive'])) {
139 139
 	$usecoord = true;
140
-	$coord = explode(',',$_GET['coord']);
141
-	if (filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
140
+	$coord = explode(',', $_GET['coord']);
141
+	if (filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) 
142 142
 	    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) {
143 143
 		if ($tracker) {
144
-			$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter);
144
+			$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter);
145 145
 		} elseif ($marine) {
146
-			$spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter);
146
+			$spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter);
147 147
 		} else {
148
-			$spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$limit,$filter);
148
+			$spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $limit, $filter);
149 149
 		}
150 150
 	} else {
151 151
 		if ($tracker) {
@@ -153,41 +153,41 @@  discard block
 block discarded – undo
153 153
 		} elseif ($marine) {
154 154
 			$spotter_array = $MarineLive->getMinLiveMarineData($filter);
155 155
 		} else {
156
-			$spotter_array = $SpotterLive->getMinLiveSpotterData($limit,$filter);
156
+			$spotter_array = $SpotterLive->getMinLiveSpotterData($limit, $filter);
157 157
 		}
158 158
 	}
159 159
 } elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed']) && !isset($_GET['tracker']) && !isset($_GET['marine'])) {
160 160
 	$from_archive = true;
161 161
 //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
162 162
 //	$enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
163
-	$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
164
-	$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
165
-	$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
166
-	$begindate = date('Y-m-d H:i:s',$begindate);
167
-	$enddate = date('Y-m-d H:i:s',$enddate);
168
-	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
163
+	$begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT);
164
+	$enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT);
165
+	$archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT);
166
+	$begindate = date('Y-m-d H:i:s', $begindate);
167
+	$enddate = date('Y-m-d H:i:s', $enddate);
168
+	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter);
169 169
 } elseif ($min) {
170 170
 	if ($tracker) {
171 171
 		$spotter_array = $TrackerLive->getMinLiveTrackerData($filter);
172 172
 	} elseif ($marine) {
173 173
 		$spotter_array = $MarineLive->getMinLiveMarineData($filter);
174 174
 	} else {
175
-		$spotter_array = $SpotterLive->getMinLiveSpotterData($limit,$filter);
175
+		$spotter_array = $SpotterLive->getMinLiveSpotterData($limit, $filter);
176 176
 	}
177 177
 #	$min = true;
178 178
 } else {
179 179
 	if ($tracker) {
180
-		$spotter_array = $TrackerLive->getLiveTrackerData('','',$filter);
180
+		$spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter);
181 181
 	} elseif ($marine) {
182
-		$spotter_array = $marineLive->getLiveMarineData('','',$filter);
182
+		$spotter_array = $marineLive->getLiveMarineData('', '', $filter);
183 183
 	} else {
184
-		$spotter_array = $SpotterLive->getLiveSpotterData('','',$filter);
184
+		$spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter);
185 185
 	}
186 186
 }
187 187
 
188 188
 if ($usecoord) {
189 189
 	if (isset($_GET['archive'])) {
190
-		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);
190
+		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter);
191 191
 	} else {
192 192
 		if ($tracker) {
193 193
 			$flightcnt = $TrackerLive->getLiveTrackerCount($filter);
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
 	if ($flightcnt == '') $flightcnt = 0;
201 201
 } else $flightcnt = 0;
202 202
 
203
-$sqltime = round(microtime(true)-$begintime,2);
203
+$sqltime = round(microtime(true) - $begintime, 2);
204 204
 
205
-$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
205
+$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
206 206
 if ($currenttime != '') $currenttime = round($currenttime/1000);
207 207
 
208 208
 if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation === FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false;
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 		if (!empty($spotter_array) && is_array($spotter_array))
222 222
 		{
223 223
 			$output .= '"features": [';
224
-			foreach($spotter_array as $spotter_item)
224
+			foreach ($spotter_array as $spotter_item)
225 225
 			{
226 226
 				$j++;
227 227
 				unset($idistance);
@@ -278,8 +278,8 @@  discard block
 block discarded – undo
278 278
 */
279 279
 							//$output .= '"fc": "'.$spotter_item['nb'].'",';
280 280
 						if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') {
281
-							if ($compress) $output .= '"c": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
282
-							else $output .= '"callsign": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
281
+							if ($compress) $output .= '"c": '.json_encode(str_replace('\\', '', $spotter_item['ident'])).',';
282
+							else $output .= '"callsign": '.json_encode(str_replace('\\', '', $spotter_item['ident'])).',';
283 283
 							//'
284 284
 						} else {
285 285
 							if ($compress) $output .= '"c": "NA",';
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 						}
292 292
 						if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) {
293 293
 							$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",';
294
-							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",';
294
+							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",';
295 295
 						} elseif (isset($spotter_item['aircraft_type'])) {
296 296
 							$output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",';
297 297
 						} elseif (!$min) {
@@ -377,25 +377,25 @@  discard block
 block discarded – undo
377 377
 									else $output .= '"aircraft_shadow": "car.png",';
378 378
 								}
379 379
 							} elseif ($marine) {
380
-								if (isset($spotter_item['type']) && ($spotter_item['type']  == '50&#39; Performance Cruiser' || $spotter_item['type']  == '50\' Performance Cruiser' || $spotter_item['type'] == 'Sail')) {
380
+								if (isset($spotter_item['type']) && ($spotter_item['type'] == '50&#39; Performance Cruiser' || $spotter_item['type'] == '50\' Performance Cruiser' || $spotter_item['type'] == 'Sail')) {
381 381
 									if ($compress) $output .= '"as": "50perfcruiser.png",';
382 382
 									else $output .= '"aircraft_shadow": "50perfcruiser.png",';
383
-								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == 'Sailaway Cruiser 38') {
383
+								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Sailaway Cruiser 38') {
384 384
 									if ($compress) $output .= '"as": "cruiser38.png",';
385 385
 									else $output .= '"aircraft_shadow": "cruiser38.png",';
386
-								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == 'Mini Transat') {
386
+								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Mini Transat') {
387 387
 									if ($compress) $output .= '"as": "transat.png",';
388 388
 									else $output .= '"aircraft_shadow": "transat.png",';
389
-								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == '52&#39; Cruising Cat') {
389
+								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == '52&#39; Cruising Cat') {
390 390
 									if ($compress) $output .= '"as": "catamaran.png",';
391 391
 									else $output .= '"aircraft_shadow": "catamaran.png",';
392
-								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == 'Caribbean Rose') {
392
+								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Caribbean Rose') {
393 393
 									if ($compress) $output .= '"as": "carib.png",';
394 394
 									else $output .= '"aircraft_shadow": "carib.png",';
395
-								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == 'Nordic Folkboat') {
395
+								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Nordic Folkboat') {
396 396
 									if ($compress) $output .= '"as": "nordic.png",';
397 397
 									else $output .= '"aircraft_shadow": "nordic.png",';
398
-								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == '32&#39; Offshore Racer') {
398
+								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == '32&#39; Offshore Racer') {
399 399
 									if ($compress) $output .= '"as": "nordic.png",';
400 400
 									else $output .= '"aircraft_shadow": "50perfcruiser.png",';
401 401
 								} else {
@@ -461,15 +461,15 @@  discard block
 block discarded – undo
461 461
 						if (isset($archivespeed) || $usenextlatlon) {
462 462
 							if (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
463 463
 								if (isset($spotter_item['arrival_airport_latitude'])) {
464
-									$cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']);
465
-									$idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']);
464
+									$cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']);
465
+									$idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']);
466 466
 									$farr_lat = $spotter_item['arrival_airport_latitude'];
467 467
 									$farr_lon = $spotter_item['arrival_airport_longitude'];
468 468
 								} else {
469 469
 									$aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);
470 470
 									if (isset($aairport[0]['latitude'])) {
471
-										$cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']);
472
-										$idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']);
471
+										$cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']);
472
+										$idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']);
473 473
 										$farr_lat = $aairport[0]['latitude'];
474 474
 										$farr_lon = $aairport[0]['longitude'];
475 475
 									}
@@ -482,59 +482,59 @@  discard block
 block discarded – undo
482 482
 						if ($currenttime != '') {
483 483
 							if (strtotime($spotter_item['date']) < $currenttime) {
484 484
 								if (isset($archivespeed)) {
485
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
486
-									$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
485
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
486
+									$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
487 487
 									if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
488 488
 									else {
489
-										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
490
-										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
489
+										$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
490
+										$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
491 491
 										if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
492 492
 										else {
493
-											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);
493
+											$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed);
494 494
 											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
495 495
 										}
496 496
 									}
497 497
 								} elseif ($usenextlatlon) {
498
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
499
-									$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
498
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
499
+									$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
500 500
 									if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
501 501
 									else {
502
-										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
503
-										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
502
+										$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
503
+										$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
504 504
 										if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
505 505
 										else {
506
-											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);
506
+											$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading);
507 507
 											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
508 508
 										}
509 509
 									}
510 510
 								}
511 511
 							} else {
512 512
 								if (isset($archivespeed)) {
513
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);
513
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed);
514 514
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
515 515
 								} elseif ($usenextlatlon) {
516
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);
516
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading);
517 517
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
518 518
 								}
519 519
 							}
520 520
 						} else {
521 521
 							if (isset($archivespeed)) {
522
-								$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);
523
-								$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
522
+								$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed);
523
+								$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
524 524
 								if (!isset($idistance) || $fdistance < $idistance) {
525 525
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
526 526
 								} else {
527
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed);
527
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed);
528 528
 									//$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
529 529
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
530 530
 								}
531 531
 							} elseif ($usenextlatlon) {
532
-								$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);
533
-								$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
532
+								$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading);
533
+								$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
534 534
 								if (!isset($idistance) || $fdistance < $idistance) {
535 535
 										$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
536 536
 								} else {
537
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading);
537
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading);
538 538
 									//$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
539 539
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
540 540
 								}
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 
544 544
 						if (!$min) $output .= '"image": "'.$image.'",';
545 545
 						if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') {
546
-							$output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",';
546
+							$output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",';
547 547
 						}
548 548
 						if (isset($spotter_item['image_source_website'])) {
549 549
 							$output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",';
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 							$output .= '"waypoints": "'.$spotter_item['waypoints'].'",';
578 578
 						}
579 579
 						if (isset($spotter_item['acars'])) {
580
-							$output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",';
580
+							$output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",';
581 581
 						}
582 582
 						// type when not aircraft ?
583 583
 						if (isset($spotter_item['type'])) {
@@ -597,12 +597,12 @@  discard block
 block discarded – undo
597 597
 								if ($currenttime != '') {
598 598
 									if (strtotime($spotter_item['date']) < $currenttime) {
599 599
 										if (!isset($archivespeed)) $archivespeed = 1;
600
-										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));
601
-										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
600
+										$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date'])));
601
+										$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
602 602
 										if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
603 603
 										else {
604
-											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));
605
-											$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
604
+											$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date'])));
605
+											$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
606 606
 											if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
607 607
 											else {
608 608
 												$output .= $spotter_item['longitude'].', ';
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
                 
682 682
 			}
683 683
 */
684
-				$history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING);
684
+				$history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING);
685 685
 				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
686 686
 				
687 687
 				if (
@@ -689,11 +689,11 @@  discard block
 block discarded – undo
689 689
 				    || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)
690 690
 				//    || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))
691 691
 				//    || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident'])
692
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
692
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
693 693
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])
694
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id']))
694
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id']))
695 695
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])
696
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid']))
696
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid']))
697 697
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])
698 698
 				    ) {
699 699
 					if ($tracker) {
@@ -722,9 +722,9 @@  discard block
 block discarded – undo
722 722
 							require(dirname(__FILE__).'/require/class.MapMatching.php');
723 723
 							$MapMatching = new MapMatching();
724 724
 							if (isset($spotter_item['date_iso_8601'])) {
725
-								$spotter_history_array_mm = array_merge($spotter_history_array,array(array('latitude' => $spotter_item['latitude'],'longitude' => $spotter_item['longitude'],'date' => date('c',strtotime($spotter_item['date_iso_8601'])))));
725
+								$spotter_history_array_mm = array_merge($spotter_history_array, array(array('latitude' => $spotter_item['latitude'], 'longitude' => $spotter_item['longitude'], 'date' => date('c', strtotime($spotter_item['date_iso_8601'])))));
726 726
 							} else {
727
-								$spotter_history_array_mm = array_merge($spotter_history_array,array(array('latitude' => $spotter_item['latitude'],'longitude' => $spotter_item['longitude'],'date' => date('c',strtotime($spotter_item['date'])))));
727
+								$spotter_history_array_mm = array_merge($spotter_history_array, array(array('latitude' => $spotter_item['latitude'], 'longitude' => $spotter_item['longitude'], 'date' => date('c', strtotime($spotter_item['date'])))));
728 728
 							}
729 729
 							$spotter_history_array = $MapMatching->match($spotter_history_array_mm);
730 730
 						}
@@ -757,9 +757,9 @@  discard block
 block discarded – undo
757 757
 								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
758 758
 							}
759 759
 							$output_history .= '[';
760
-							$output_history .=  $spotter_history['longitude'].', ';
761
-							$output_history .=  $spotter_history['latitude'].', ';
762
-							$output_history .=  $spotter_history['altitude']*30.48;
760
+							$output_history .= $spotter_history['longitude'].', ';
761
+							$output_history .= $spotter_history['latitude'].', ';
762
+							$output_history .= $spotter_history['altitude']*30.48;
763 763
 							$output_history .= '],';
764 764
 							/*
765 765
 							if ($from_archive === false) {
@@ -782,8 +782,8 @@  discard block
 block discarded – undo
782 782
 								$d = true;
783 783
 							}
784 784
 							$output_history .= '[';
785
-							$output_history .=  $spotter_history['longitude'].', ';
786
-							$output_history .=  $spotter_history['latitude'];
785
+							$output_history .= $spotter_history['longitude'].', ';
786
+							$output_history .= $spotter_history['latitude'];
787 787
 							$output_history .= '],';
788 788
 							/*
789 789
 							if ($from_archive === false) {
@@ -799,9 +799,9 @@  discard block
 block discarded – undo
799 799
 						//echo $output_history;
800 800
 						if ($from_archive === false && !isset($spotter_history_array[0]['mapmatching_engine'])) {
801 801
 							$output_historyd = '[';
802
-							$output_historyd .=  $spotter_item['longitude'].', ';
803
-							$output_historyd .=  $spotter_item['latitude'];
804
-							if (isset($spotter_history['altitude'])) $output_historyd .=  ','.$spotter_item['altitude']*30.48;
802
+							$output_historyd .= $spotter_item['longitude'].', ';
803
+							$output_historyd .= $spotter_item['latitude'];
804
+							if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48;
805 805
 							$output_historyd .= '],';
806 806
 							//$output_history = $output_historyd.$output_history;
807 807
 							$output_history = $output_history.$output_historyd;
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 							$last = array_pop($spotter_history_array);
810 810
 							$latitude = $last['latitude'];
811 811
 							$longitude = $last['longitude'];
812
-							$output = str_replace('"coordinates": ['.$spotter_item['longitude'].', '.$spotter_item['latitude'].']}','"coordinates": ['.$longitude.', '.$latitude.']}',$output);
812
+							$output = str_replace('"coordinates": ['.$spotter_item['longitude'].', '.$spotter_item['latitude'].']}', '"coordinates": ['.$longitude.', '.$latitude.']}', $output);
813 813
 						}
814 814
 						
815 815
 						$output_history  = substr($output_history, 0, -1);
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
 					
822 822
 				}
823 823
 				
824
-				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
824
+				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
825 825
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
826 826
 				     && (isset($spotter_item['departure_airport']) 
827 827
 				        && $spotter_item['departure_airport'] != 'NA' 
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
 
856 856
 				//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))))) {
857 857
 				//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))))) {
858
-				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
858
+				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
859 859
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
860 860
 				     && (isset($spotter_item['arrival_airport']) 
861 861
 				        && $spotter_item['arrival_airport'] != 'NA' 
@@ -882,11 +882,11 @@  discard block
 block discarded – undo
882 882
 					}
883 883
 				    }
884 884
 				    if ($havedata) {
885
-					$line = $Common->greatCircle($spotter_item['latitude'],$spotter_item['longitude'],$end_lat,$end_lon);
885
+					$line = $Common->greatCircle($spotter_item['latitude'], $spotter_item['longitude'], $end_lat, $end_lon);
886 886
 					foreach ($line[0] as $coord) {
887 887
 						$output_dest .= '['.$coord[0].','.$coord[1].'],';
888 888
 					}
889
-					$output_dest  = substr($output_dest, 0, -1);
889
+					$output_dest = substr($output_dest, 0, -1);
890 890
 				    }
891 891
 				    $output_dest .= ']}},';
892 892
 				    if ($havedata) $output .= $output_dest;
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
 			$output  = substr($output, 0, -1);
897 897
 			$output .= ']';
898 898
 			$output .= ',"initial_sqltime": "'.$sqltime.'",';
899
-			$output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';
899
+			$output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",';
900 900
 			if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
901 901
 			$output .= '"fc": "'.$j.'"';
902 902
 		} else {
Please login to merge, or discard this patch.
Braces   +374 added lines, -151 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@  discard block
 block discarded – undo
12 12
 $tracker = false;
13 13
 $marine = false;
14 14
 $usecoord = false;
15
-if (isset($_GET['test'])) exit();
15
+if (isset($_GET['test'])) {
16
+	exit();
17
+}
16 18
 if (isset($_GET['tracker'])) {
17 19
     $tracker = true;
18 20
 }
@@ -57,31 +59,62 @@  discard block
 block discarded – undo
57 59
 }
58 60
 header('Content-Type: text/javascript');
59 61
 
60
-if (!isset($globalJsonCompress)) $compress = true;
61
-else $compress = $globalJsonCompress;
62
+if (!isset($globalJsonCompress)) {
63
+	$compress = true;
64
+} else {
65
+	$compress = $globalJsonCompress;
66
+}
62 67
 
63 68
 $limit = 0;
64 69
 $from_archive = false;
65 70
 $min = true;
66 71
 $allhistory = false;
67 72
 $filter['source'] = array();
68
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
69
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
70
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
71
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
72
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
73
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
74
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
75
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
76
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
77
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
78
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
79
-if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_NUMBER_INT);
80
-if (isset($_COOKIE['filter_blocked']) && $_COOKIE['filter_blocked'] == 'true') $filter['blocked'] = true;
73
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') {
74
+	$filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
75
+}
76
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') {
77
+	$filter['source'] = array_merge($filter['source'],array('whazzup'));
78
+}
79
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') {
80
+	$filter['source'] = array_merge($filter['source'],array('phpvmacars'));
81
+}
82
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') {
83
+	$filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
84
+}
85
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') {
86
+	$filter['source'] = array_merge($filter['source'],array('aprs'));
87
+}
88
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') {
89
+	$filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
90
+}
91
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') {
92
+	$filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
93
+}
94
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') {
95
+	$filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
96
+}
97
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') {
98
+	$filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
99
+}
100
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') {
101
+	$filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
102
+}
103
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') {
104
+	$filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
105
+}
106
+if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') {
107
+	$filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_NUMBER_INT);
108
+}
109
+if (isset($_COOKIE['filter_blocked']) && $_COOKIE['filter_blocked'] == 'true') {
110
+	$filter['blocked'] = true;
111
+}
81 112
 
82 113
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
83 114
 	$min = true;
84
-} else $min = false;
115
+} else {
116
+	$min = false;
117
+}
85 118
 
86 119
 
87 120
 if (isset($_COOKIE['map_2d_limit'])) {
@@ -197,24 +230,38 @@  discard block
 block discarded – undo
197 230
 			$flightcnt = $SpotterLive->getLiveSpotterCount($filter);
198 231
 		}
199 232
 	}
200
-	if ($flightcnt == '') $flightcnt = 0;
201
-} else $flightcnt = 0;
233
+	if ($flightcnt == '') {
234
+		$flightcnt = 0;
235
+	}
236
+	} else {
237
+	$flightcnt = 0;
238
+}
202 239
 
203 240
 $sqltime = round(microtime(true)-$begintime,2);
204 241
 
205 242
 $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
206
-if ($currenttime != '') $currenttime = round($currenttime/1000);
243
+if ($currenttime != '') {
244
+	$currenttime = round($currenttime/1000);
245
+}
207 246
 
208
-if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation === FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false;
209
-else $usenextlatlon = true;
210
-if ($usenextlatlon === false) $currenttime = '';
247
+if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation === FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) {
248
+	$usenextlatlon = false;
249
+} else {
250
+	$usenextlatlon = true;
251
+}
252
+if ($usenextlatlon === false) {
253
+	$currenttime = '';
254
+}
211 255
 $j = 0;
212 256
 $prev_flightaware_id = '';
213 257
 $aircrafts_shadow = array();
214 258
 $output = '{';
215 259
 	$output .= '"type": "FeatureCollection",';
216
-		if ($min) $output .= '"minimal": "true",';
217
-		else $output .= '"minimal": "false",';
260
+		if ($min) {
261
+			$output .= '"minimal": "true",';
262
+		} else {
263
+			$output .= '"minimal": "false",';
264
+		}
218 265
 		//$output .= '"fc": "'.$flightcnt.'",';
219 266
 		$output .= '"sqt": "'.$sqltime.'",';
220 267
 
@@ -259,18 +306,29 @@  discard block
 block discarded – undo
259 306
 						}
260 307
 						$output .= '"properties": {';
261 308
 						if (isset($spotter_item['flightaware_id'])) {
262
-							if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",';
263
-							else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",';
309
+							if ($compress) {
310
+								$output .= '"fi": "'.$spotter_item['flightaware_id'].'",';
311
+							} else {
312
+								$output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",';
313
+							}
264 314
 						} elseif (isset($spotter_item['famtrackid'])) {
265
-							if ($compress) $output .= '"fti": "'.$spotter_item['famtrackid'].'",';
266
-							else $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",';
315
+							if ($compress) {
316
+								$output .= '"fti": "'.$spotter_item['famtrackid'].'",';
317
+							} else {
318
+								$output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",';
319
+							}
267 320
 						} elseif (isset($spotter_item['fammarine_id'])) {
268
-							if ($compress) $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",';
269
-							else $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",';
321
+							if ($compress) {
322
+								$output .= '"fmi": "'.$spotter_item['fammarine_id'].'",';
323
+							} else {
324
+								$output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",';
325
+							}
270 326
 						}
271 327
 						$output .= '"fc": "'.$flightcnt.'",';
272 328
 						$output .= '"sqt": "'.$sqltime.'",';
273
-						if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
329
+						if (isset($begindate)) {
330
+							$output .= '"archive_date": "'.$begindate.'",';
331
+						}
274 332
 
275 333
 /*
276 334
 							if ($min) $output .= '"minimal": "true",';
@@ -278,16 +336,25 @@  discard block
 block discarded – undo
278 336
 */
279 337
 							//$output .= '"fc": "'.$spotter_item['nb'].'",';
280 338
 						if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') {
281
-							if ($compress) $output .= '"c": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
282
-							else $output .= '"callsign": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
339
+							if ($compress) {
340
+								$output .= '"c": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
341
+							} else {
342
+								$output .= '"callsign": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
343
+							}
283 344
 							//'
284 345
 						} else {
285
-							if ($compress) $output .= '"c": "NA",';
286
-							else $output .= '"callsign": "NA",';
346
+							if ($compress) {
347
+								$output .= '"c": "NA",';
348
+							} else {
349
+								$output .= '"callsign": "NA",';
350
+							}
287 351
 						}
288 352
 						if (isset($spotter_item['registration'])) {
289
-							if ($compress) $output .= '"reg": '.json_encode($spotter_item['registration']).',';
290
-							else $output .= '"registration": '.json_encode($spotter_item['registration']).',';
353
+							if ($compress) {
354
+								$output .= '"reg": '.json_encode($spotter_item['registration']).',';
355
+							} else {
356
+								$output .= '"registration": '.json_encode($spotter_item['registration']).',';
357
+							}
291 358
 						}
292 359
 						if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) {
293 360
 							$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",';
@@ -298,20 +365,30 @@  discard block
 block discarded – undo
298 365
 							$output .= '"aircraft_name": "NA",';
299 366
 						}
300 367
 						if (isset($spotter_item['aircraft_icao'])) {
301
-							if ($compress) $output .= '"ai": "'.$spotter_item['aircraft_icao'].'",';
302
-							else $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
368
+							if ($compress) {
369
+								$output .= '"ai": "'.$spotter_item['aircraft_icao'].'",';
370
+							} else {
371
+								$output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
372
+							}
303 373
 						}
304 374
 						if (!isset($spotter_item['aircraft_shadow']) && !$tracker && !$marine) {
305
-							if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = '';
306
-							else {
375
+							if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') {
376
+								$spotter_item['aircraft_shadow'] = '';
377
+							} else {
307 378
 								$aircraft_icao = $spotter_item['aircraft_icao'];
308
-								if (isset($aircrafts_shadow[$aircraft_icao])) $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao];
309
-								else {
379
+								if (isset($aircrafts_shadow[$aircraft_icao])) {
380
+									$spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao];
381
+								} else {
310 382
 									$aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']);
311
-									if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow'];
312
-									elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png';
313
-									elseif ($aircraft_icao == 'PARAGLIDER') $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png';
314
-									else $spotter_item['aircraft_shadow'] = '';
383
+									if (count($aircraft_info) > 0) {
384
+										$spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow'];
385
+									} elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') {
386
+										$spotter_item['aircraft_shadow'] = 'PA18.png';
387
+									} elseif ($aircraft_icao == 'PARAGLIDER') {
388
+										$spotter_item['aircraft_shadow'] = 'PARAGLIDER.png';
389
+									} else {
390
+										$spotter_item['aircraft_shadow'] = '';
391
+									}
315 392
 									$aircrafts_shadow[$aircraft_icao] = $spotter_item['aircraft_shadow'];
316 393
 								}
317 394
 							}
@@ -319,96 +396,183 @@  discard block
 block discarded – undo
319 396
 						if (!isset($spotter_item['aircraft_shadow']) || $spotter_item['aircraft_shadow'] == '') {
320 397
 							if ($tracker) {
321 398
 								if (isset($spotter_item['type']) && $spotter_item['type'] == 'Ambulance') {
322
-									if ($compress) $output .= '"as": "ambulance.png",';
323
-									else $output .= '"aircraft_shadow": "ambulance.png",';
399
+									if ($compress) {
400
+										$output .= '"as": "ambulance.png",';
401
+									} else {
402
+										$output .= '"aircraft_shadow": "ambulance.png",';
403
+									}
324 404
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') {
325
-									if ($compress) $output .= '"as": "police.png",';
326
-									else $output .= '"aircraft_shadow": "police.png",';
405
+									if ($compress) {
406
+										$output .= '"as": "police.png",';
407
+									} else {
408
+										$output .= '"aircraft_shadow": "police.png",';
409
+									}
327 410
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') {
328
-									if ($compress) $output .= '"as": "ship.png",';
329
-									else $output .= '"aircraft_shadow": "ship.png",';
411
+									if ($compress) {
412
+										$output .= '"as": "ship.png",';
413
+									} else {
414
+										$output .= '"aircraft_shadow": "ship.png",';
415
+									}
330 416
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') {
331
-									if ($compress) $output .= '"as": "ship.png",';
332
-									else $output .= '"aircraft_shadow": "ship.png",';
417
+									if ($compress) {
418
+										$output .= '"as": "ship.png",';
419
+									} else {
420
+										$output .= '"aircraft_shadow": "ship.png",';
421
+									}
333 422
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') {
334
-									if ($compress) $output .= '"as": "ship.png",';
335
-									else $output .= '"aircraft_shadow": "ship.png",';
423
+									if ($compress) {
424
+										$output .= '"as": "ship.png",';
425
+									} else {
426
+										$output .= '"aircraft_shadow": "ship.png",';
427
+									}
336 428
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') {
337
-									if ($compress) $output .= '"as": "truck.png",';
338
-									else $output .= '"aircraft_shadow": "truck.png",';
429
+									if ($compress) {
430
+										$output .= '"as": "truck.png",';
431
+									} else {
432
+										$output .= '"aircraft_shadow": "truck.png",';
433
+									}
339 434
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') {
340
-									if ($compress) $output .= '"as": "truck.png",';
341
-									else $output .= '"aircraft_shadow": "truck.png",';
435
+									if ($compress) {
436
+										$output .= '"as": "truck.png",';
437
+									} else {
438
+										$output .= '"aircraft_shadow": "truck.png",';
439
+									}
342 440
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') {
343
-									if ($compress) $output .= '"as": "aircraft.png",';
344
-									else $output .= '"aircraft_shadow": "aircraft.png",';
441
+									if ($compress) {
442
+										$output .= '"as": "aircraft.png",';
443
+									} else {
444
+										$output .= '"aircraft_shadow": "aircraft.png",';
445
+									}
345 446
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') {
346
-									if ($compress) $output .= '"as": "aircraft.png",';
347
-									else $output .= '"aircraft_shadow": "aircraft.png",';
447
+									if ($compress) {
448
+										$output .= '"as": "aircraft.png",';
449
+									} else {
450
+										$output .= '"aircraft_shadow": "aircraft.png",';
451
+									}
348 452
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') {
349
-									if ($compress) $output .= '"as": "helico.png",';
350
-									else $output .= '"aircraft_shadow": "helico.png",';
453
+									if ($compress) {
454
+										$output .= '"as": "helico.png",';
455
+									} else {
456
+										$output .= '"aircraft_shadow": "helico.png",';
457
+									}
351 458
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') {
352
-									if ($compress) $output .= '"as": "rail.png",';
353
-									else $output .= '"aircraft_shadow": "rail.png",';
459
+									if ($compress) {
460
+										$output .= '"as": "rail.png",';
461
+									} else {
462
+										$output .= '"aircraft_shadow": "rail.png",';
463
+									}
354 464
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') {
355
-									if ($compress) $output .= '"as": "firetruck.png",';
356
-									else $output .= '"aircraft_shadow": "firetruck.png",';
465
+									if ($compress) {
466
+										$output .= '"as": "firetruck.png",';
467
+									} else {
468
+										$output .= '"aircraft_shadow": "firetruck.png",';
469
+									}
357 470
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') {
358
-									if ($compress) $output .= '"as": "bus.png",';
359
-									else $output .= '"aircraft_shadow": "bus.png",';
471
+									if ($compress) {
472
+										$output .= '"as": "bus.png",';
473
+									} else {
474
+										$output .= '"aircraft_shadow": "bus.png",';
475
+									}
360 476
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') {
361
-									if ($compress) $output .= '"as": "phone.png",';
362
-									else $output .= '"aircraft_shadow": "phone.png",';
477
+									if ($compress) {
478
+										$output .= '"as": "phone.png",';
479
+									} else {
480
+										$output .= '"aircraft_shadow": "phone.png",';
481
+									}
363 482
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') {
364
-									if ($compress) $output .= '"as": "jogger.png",';
365
-									else $output .= '"aircraft_shadow": "jogger.png",';
483
+									if ($compress) {
484
+										$output .= '"as": "jogger.png",';
485
+									} else {
486
+										$output .= '"aircraft_shadow": "jogger.png",';
487
+									}
366 488
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') {
367
-									if ($compress) $output .= '"as": "bike.png",';
368
-									else $output .= '"aircraft_shadow": "bike.png",';
489
+									if ($compress) {
490
+										$output .= '"as": "bike.png",';
491
+									} else {
492
+										$output .= '"aircraft_shadow": "bike.png",';
493
+									}
369 494
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') {
370
-									if ($compress) $output .= '"as": "motorcycle.png",';
371
-									else $output .= '"aircraft_shadow": "motorcycle.png",';
495
+									if ($compress) {
496
+										$output .= '"as": "motorcycle.png",';
497
+									} else {
498
+										$output .= '"aircraft_shadow": "motorcycle.png",';
499
+									}
372 500
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') {
373
-									if ($compress) $output .= '"as": "balloon.png",';
374
-									else $output .= '"aircraft_shadow": "balloon.png",';
501
+									if ($compress) {
502
+										$output .= '"as": "balloon.png",';
503
+									} else {
504
+										$output .= '"aircraft_shadow": "balloon.png",';
505
+									}
375 506
 								} else {
376
-									if ($compress) $output .= '"as": "car.png",';
377
-									else $output .= '"aircraft_shadow": "car.png",';
507
+									if ($compress) {
508
+										$output .= '"as": "car.png",';
509
+									} else {
510
+										$output .= '"aircraft_shadow": "car.png",';
511
+									}
378 512
 								}
379 513
 							} elseif ($marine) {
380 514
 								if (isset($spotter_item['type']) && ($spotter_item['type']  == '50&#39; Performance Cruiser' || $spotter_item['type']  == '50\' Performance Cruiser' || $spotter_item['type'] == 'Sail')) {
381
-									if ($compress) $output .= '"as": "50perfcruiser.png",';
382
-									else $output .= '"aircraft_shadow": "50perfcruiser.png",';
515
+									if ($compress) {
516
+										$output .= '"as": "50perfcruiser.png",';
517
+									} else {
518
+										$output .= '"aircraft_shadow": "50perfcruiser.png",';
519
+									}
383 520
 								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == 'Sailaway Cruiser 38') {
384
-									if ($compress) $output .= '"as": "cruiser38.png",';
385
-									else $output .= '"aircraft_shadow": "cruiser38.png",';
521
+									if ($compress) {
522
+										$output .= '"as": "cruiser38.png",';
523
+									} else {
524
+										$output .= '"aircraft_shadow": "cruiser38.png",';
525
+									}
386 526
 								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == 'Mini Transat') {
387
-									if ($compress) $output .= '"as": "transat.png",';
388
-									else $output .= '"aircraft_shadow": "transat.png",';
527
+									if ($compress) {
528
+										$output .= '"as": "transat.png",';
529
+									} else {
530
+										$output .= '"aircraft_shadow": "transat.png",';
531
+									}
389 532
 								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == '52&#39; Cruising Cat') {
390
-									if ($compress) $output .= '"as": "catamaran.png",';
391
-									else $output .= '"aircraft_shadow": "catamaran.png",';
533
+									if ($compress) {
534
+										$output .= '"as": "catamaran.png",';
535
+									} else {
536
+										$output .= '"aircraft_shadow": "catamaran.png",';
537
+									}
392 538
 								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == 'Caribbean Rose') {
393
-									if ($compress) $output .= '"as": "carib.png",';
394
-									else $output .= '"aircraft_shadow": "carib.png",';
539
+									if ($compress) {
540
+										$output .= '"as": "carib.png",';
541
+									} else {
542
+										$output .= '"aircraft_shadow": "carib.png",';
543
+									}
395 544
 								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == 'Nordic Folkboat') {
396
-									if ($compress) $output .= '"as": "nordic.png",';
397
-									else $output .= '"aircraft_shadow": "nordic.png",';
545
+									if ($compress) {
546
+										$output .= '"as": "nordic.png",';
547
+									} else {
548
+										$output .= '"aircraft_shadow": "nordic.png",';
549
+									}
398 550
 								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == '32&#39; Offshore Racer') {
399
-									if ($compress) $output .= '"as": "nordic.png",';
400
-									else $output .= '"aircraft_shadow": "50perfcruiser.png",';
551
+									if ($compress) {
552
+										$output .= '"as": "nordic.png",';
553
+									} else {
554
+										$output .= '"aircraft_shadow": "50perfcruiser.png",';
555
+									}
401 556
 								} else {
402
-									if ($compress) $output .= '"as": "ship.png",';
403
-									else $output .= '"aircraft_shadow": "ship.png",';
557
+									if ($compress) {
558
+										$output .= '"as": "ship.png",';
559
+									} else {
560
+										$output .= '"aircraft_shadow": "ship.png",';
561
+									}
404 562
 								}
405 563
 							} else {
406
-								if ($compress) $output .= '"as": "default.png",';
407
-								else $output .= '"aircraft_shadow": "default.png",';
564
+								if ($compress) {
565
+									$output .= '"as": "default.png",';
566
+								} else {
567
+									$output .= '"aircraft_shadow": "default.png",';
568
+								}
408 569
 							}
409 570
 						} else {
410
-							if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",';
411
-							else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
571
+							if ($compress) {
572
+								$output .= '"as": "'.$spotter_item['aircraft_shadow'].'",';
573
+							} else {
574
+								$output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
575
+							}
412 576
 						}
413 577
 						if (isset($spotter_item['airline_name'])) {
414 578
 							$output .= '"airline_name": "'.$spotter_item['airline_name'].'",';
@@ -416,8 +580,11 @@  discard block
 block discarded – undo
416 580
 							$output .= '"airline_name": "NA",';
417 581
 						}
418 582
 						if (isset($spotter_item['departure_airport'])) {
419
-							if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",';
420
-							else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",';
583
+							if ($compress) {
584
+								$output .= '"dac": "'.$spotter_item['departure_airport'].'",';
585
+							} else {
586
+								$output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",';
587
+							}
421 588
 						}
422 589
 						if (isset($spotter_item['departure_airport_city'])) {
423 590
 							$output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",';
@@ -429,8 +596,11 @@  discard block
 block discarded – undo
429 596
 							$output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",';
430 597
 						}
431 598
 						if (isset($spotter_item['arrival_airport'])) {
432
-							if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",';
433
-							else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",';
599
+							if ($compress) {
600
+								$output .= '"aac": "'.$spotter_item['arrival_airport'].'",';
601
+							} else {
602
+								$output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",';
603
+							}
434 604
 						}
435 605
 						if (isset($spotter_item['arrival_airport_city'])) {
436 606
 							$output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",';
@@ -449,11 +619,17 @@  discard block
 block discarded – undo
449 619
 						}
450 620
 						
451 621
 						if (isset($spotter_item['real_altitude'])) {
452
-							if ($compress) $output .= '"a": "'.($spotter_item['real_altitude']/100).'",';
453
-							else $output .= '"altitude": "'.($spotter_item['real_altitude']/100).'",';
622
+							if ($compress) {
623
+								$output .= '"a": "'.($spotter_item['real_altitude']/100).'",';
624
+							} else {
625
+								$output .= '"altitude": "'.($spotter_item['real_altitude']/100).'",';
626
+							}
454 627
 						} elseif (isset($spotter_item['altitude'])) {
455
-							if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",';
456
-							else $output .= '"altitude": "'.$spotter_item['altitude'].'",';
628
+							if ($compress) {
629
+								$output .= '"a": "'.$spotter_item['altitude'].'",';
630
+							} else {
631
+								$output .= '"altitude": "'.$spotter_item['altitude'].'",';
632
+							}
457 633
 						}
458 634
 						
459 635
 						$heading = $spotter_item['heading'];
@@ -477,19 +653,24 @@  discard block
 block discarded – undo
477 653
 							}
478 654
 						}
479 655
 						
480
-						if ($compress)$output .= '"h": "'.$heading.'",';
481
-						else $output .= '"heading": "'.$heading.'",';
656
+						if ($compress) {
657
+							$output .= '"h": "'.$heading.'",';
658
+						} else {
659
+							$output .= '"heading": "'.$heading.'",';
660
+						}
482 661
 						if ($currenttime != '') {
483 662
 							if (strtotime($spotter_item['date']) < $currenttime) {
484 663
 								if (isset($archivespeed)) {
485 664
 									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
486 665
 									$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
487
-									if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
488
-									else {
666
+									if (!isset($idistance) || $fdistance < $idistance) {
667
+										$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
668
+									} else {
489 669
 										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
490 670
 										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
491
-										if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
492
-										else {
671
+										if (!isset($idistance) || $fdistance < $idistance) {
672
+											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
673
+										} else {
493 674
 											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);
494 675
 											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
495 676
 										}
@@ -497,12 +678,14 @@  discard block
 block discarded – undo
497 678
 								} elseif ($usenextlatlon) {
498 679
 									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
499 680
 									$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
500
-									if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
501
-									else {
681
+									if (!isset($idistance) || $fdistance < $idistance) {
682
+										$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
683
+									} else {
502 684
 										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
503 685
 										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
504
-										if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
505
-										else {
686
+										if (!isset($idistance) || $fdistance < $idistance) {
687
+											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
688
+										} else {
506 689
 											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);
507 690
 											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
508 691
 										}
@@ -541,7 +724,9 @@  discard block
 block discarded – undo
541 724
 							}
542 725
 						}
543 726
 
544
-						if (!$min) $output .= '"image": "'.$image.'",';
727
+						if (!$min) {
728
+							$output .= '"image": "'.$image.'",';
729
+						}
545 730
 						if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') {
546 731
 							$output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",';
547 732
 						}
@@ -549,8 +734,11 @@  discard block
 block discarded – undo
549 734
 							$output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",';
550 735
 						}
551 736
 						if (isset($spotter_item['squawk'])) {
552
-							if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",';
553
-							else $output .= '"squawk": "'.$spotter_item['squawk'].'",';
737
+							if ($compress) {
738
+								$output .= '"sq": "'.$spotter_item['squawk'].'",';
739
+							} else {
740
+								$output .= '"squawk": "'.$spotter_item['squawk'].'",';
741
+							}
554 742
 						}
555 743
 						if (isset($spotter_item['squawk_usage'])) {
556 744
 							$output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",';
@@ -581,14 +769,23 @@  discard block
 block discarded – undo
581 769
 						}
582 770
 						// type when not aircraft ?
583 771
 						if (isset($spotter_item['type'])) {
584
-							if ($compress) $output .= '"t": "'.$spotter_item['type'].'"';
585
-							else $output .= '"type": "'.$spotter_item['type'].'"';
772
+							if ($compress) {
773
+								$output .= '"t": "'.$spotter_item['type'].'"';
774
+							} else {
775
+								$output .= '"type": "'.$spotter_item['type'].'"';
776
+							}
586 777
 						} elseif ($marine) {
587
-							if ($compress) $output .= '"t": "ship"';
588
-							else $output .= '"type": "ship"';
778
+							if ($compress) {
779
+								$output .= '"t": "ship"';
780
+							} else {
781
+								$output .= '"type": "ship"';
782
+							}
589 783
 						} else {
590
-							if ($compress) $output .= '"t": "aircraft"';
591
-							else $output .= '"type": "aircraft"';
784
+							if ($compress) {
785
+								$output .= '"t": "aircraft"';
786
+							} else {
787
+								$output .= '"type": "aircraft"';
788
+							}
592 789
 						}
593 790
 						$output .= '},';
594 791
 						$output .= '"geometry": {';
@@ -596,15 +793,19 @@  discard block
 block discarded – undo
596 793
 								$output .= '"coordinates": [';
597 794
 								if ($currenttime != '') {
598 795
 									if (strtotime($spotter_item['date']) < $currenttime) {
599
-										if (!isset($archivespeed)) $archivespeed = 1;
796
+										if (!isset($archivespeed)) {
797
+											$archivespeed = 1;
798
+										}
600 799
 										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));
601 800
 										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
602
-										if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
603
-										else {
801
+										if (!isset($idistance) || $fdistance < $idistance) {
802
+											$output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
803
+										} else {
604 804
 											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));
605 805
 											$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
606
-											if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
607
-											else {
806
+											if (!isset($idistance) || $fdistance < $idistance) {
807
+												$output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
808
+											} else {
608 809
 												$output .= $spotter_item['longitude'].', ';
609 810
 												$output .= $spotter_item['latitude'];
610 811
 											}
@@ -682,7 +883,9 @@  discard block
 block discarded – undo
682 883
 			}
683 884
 */
684 885
 				$history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING);
685
-				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
886
+				if ($history == '' && isset($_COOKIE['history'])) {
887
+					$history = $_COOKIE['history'];
888
+				}
686 889
 				
687 890
 				if (
688 891
 				    (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') 
@@ -753,8 +956,11 @@  discard block
 block discarded – undo
753 956
 									$output_history .= ']}},';
754 957
 									$output .= $output_history;
755 958
 								}
756
-								if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
757
-								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
959
+								if ($compress) {
960
+									$output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
961
+								} else {
962
+									$output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
963
+								}
758 964
 							}
759 965
 							$output_history .= '[';
760 966
 							$output_history .=  $spotter_history['longitude'].', ';
@@ -775,10 +981,15 @@  discard block
 block discarded – undo
775 981
 							if ($d === false) {
776 982
 								if ($compress) {
777 983
 									$output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'",';
778
-									if (isset($spotter_history_array[0]['mapmatching_engine']) && $spotter_history_array[0]['mapmatching_engine'] == 'graphhopper') $output_history .= '"atr": "Powered by <a href=\"https://www.graphhopper.com/\">GraphHopper API</a>", Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",';
779
-									elseif (isset($spotter_history_array[0]['mapmatching_engine'])) $output_history .= '"atr": "Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",';
984
+									if (isset($spotter_history_array[0]['mapmatching_engine']) && $spotter_history_array[0]['mapmatching_engine'] == 'graphhopper') {
985
+										$output_history .= '"atr": "Powered by <a href=\"https://www.graphhopper.com/\">GraphHopper API</a>", Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",';
986
+									} elseif (isset($spotter_history_array[0]['mapmatching_engine'])) {
987
+										$output_history .= '"atr": "Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",';
988
+									}
780 989
 									$output_history .= '"t": "history"},"geometry": {"type": "LineString","coordinates": [';
781
-								} else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": [';
990
+								} else {
991
+									$output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": [';
992
+								}
782 993
 								$d = true;
783 994
 							}
784 995
 							$output_history .= '[';
@@ -801,7 +1012,9 @@  discard block
 block discarded – undo
801 1012
 							$output_historyd = '[';
802 1013
 							$output_historyd .=  $spotter_item['longitude'].', ';
803 1014
 							$output_historyd .=  $spotter_item['latitude'];
804
-							if (isset($spotter_history['altitude'])) $output_historyd .=  ','.$spotter_item['altitude']*30.48;
1015
+							if (isset($spotter_history['altitude'])) {
1016
+								$output_historyd .=  ','.$spotter_item['altitude']*30.48;
1017
+							}
805 1018
 							$output_historyd .= '],';
806 1019
 							//$output_history = $output_historyd.$output_history;
807 1020
 							$output_history = $output_history.$output_historyd;
@@ -829,8 +1042,11 @@  discard block
 block discarded – undo
829 1042
 				        && $spotter_item['arrival_airport'] != 'NA' 
830 1043
 				        && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") 
831 1044
 				    	    || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) {
832
-				    if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
833
-				    else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
1045
+				    if ($compress) {
1046
+				    	$output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
1047
+				    } else {
1048
+				    	$output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
1049
+				    }
834 1050
 				    if (isset($spotter_item['departure_airport_latitude'])) {
835 1051
 					$output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],';
836 1052
 				    } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') {
@@ -863,8 +1079,11 @@  discard block
 block discarded – undo
863 1079
 				    	    || (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute) 
864 1080
 				    	    || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) {
865 1081
 				    $havedata = false;
866
-				    if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
867
-				    else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
1082
+				    if ($compress) {
1083
+				    	$output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
1084
+				    } else {
1085
+				    	$output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
1086
+				    }
868 1087
 				    
869 1088
 				    //$output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';
870 1089
 				    if (isset($spotter_item['arrival_airport_latitude'])) {
@@ -889,7 +1108,9 @@  discard block
 block discarded – undo
889 1108
 					$output_dest  = substr($output_dest, 0, -1);
890 1109
 				    }
891 1110
 				    $output_dest .= ']}},';
892
-				    if ($havedata) $output .= $output_dest;
1111
+				    if ($havedata) {
1112
+				    	$output .= $output_dest;
1113
+				    }
893 1114
 				    unset($output_dest);
894 1115
 				}
895 1116
 			}
@@ -897,7 +1118,9 @@  discard block
 block discarded – undo
897 1118
 			$output .= ']';
898 1119
 			$output .= ',"initial_sqltime": "'.$sqltime.'",';
899 1120
 			$output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';
900
-			if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
1121
+			if (isset($begindate)) {
1122
+				$output .= '"archive_date": "'.$begindate.'",';
1123
+			}
901 1124
 			$output .= '"fc": "'.$j.'"';
902 1125
 		} else {
903 1126
 			$output .= '"features": ';
Please login to merge, or discard this patch.
airspace-geojson.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@  discard block
 block discarded – undo
11 11
 $Connection = new Connection();
12 12
 
13 13
 if (!$Connection->tableExists('airspace')) {
14
-    die;
14
+	die;
15 15
 }
16 16
 
17 17
 if (isset($_GET['coord'])) 
18 18
 {
19 19
 	$coords = explode(',',$_GET['coord']);
20
-        if ($globalDBdriver == 'mysql') {
20
+		if ($globalDBdriver == 'mysql') {
21 21
 		$query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace WHERE ST_Intersects(SHAPE, ST_Envelope(linestring(point(:minlon,:minlat), point(:maxlon,:maxlat))))";
22 22
 		try {
23 23
 			$sth = $Connection->db->prepare($query);
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		}
38 38
 	}
39 39
 } else {
40
-        if ($globalDBdriver == 'mysql') {
40
+		if ($globalDBdriver == 'mysql') {
41 41
 		$query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace";
42 42
 	} else {
43 43
 		$query = "SELECT *, ST_AsBinary(wkb_geometry,'NDR') AS wkb FROM airspace";
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 }
52 52
 
53 53
 $geojson = array(
54
-    'type' => 'FeatureCollection',
55
-    'features' => array()
54
+	'type' => 'FeatureCollection',
55
+	'features' => array()
56 56
 );
57 57
 
58 58
 while ($row = $sth->fetch(PDO::FETCH_ASSOC))
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
 		}
116 116
 		if (isset($properties['type']) && $properties['type'] != '') {
117 117
 			$feature = array(
118
-			    'type' => 'Feature',
119
-			    'geometry' => json_decode($geom->out('json')),
120
-			    'properties' => $properties
118
+				'type' => 'Feature',
119
+				'geometry' => json_decode($geom->out('json')),
120
+				'properties' => $properties
121 121
 			);
122 122
 			array_push($geojson['features'], $feature);
123 123
 		}
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
 
17 17
 if (isset($_GET['coord'])) 
18 18
 {
19
-	$coords = explode(',',$_GET['coord']);
19
+	$coords = explode(',', $_GET['coord']);
20 20
         if ($globalDBdriver == 'mysql') {
21 21
 		$query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace WHERE ST_Intersects(SHAPE, ST_Envelope(linestring(point(:minlon,:minlat), point(:maxlon,:maxlat))))";
22 22
 		try {
23 23
 			$sth = $Connection->db->prepare($query);
24
-			$sth->execute(array(':minlon' => $coords[0],':minlat' => $coords[1],':maxlon' => $coords[2],':maxlat' => $coords[3]));
24
+			$sth->execute(array(':minlon' => $coords[0], ':minlat' => $coords[1], ':maxlon' => $coords[2], ':maxlat' => $coords[3]));
25 25
 			//$sth->execute();
26
-		} catch(PDOException $e) {
26
+		} catch (PDOException $e) {
27 27
 			echo "error";
28 28
 		}
29 29
 	} else {
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 			$sth = $Connection->db->prepare($query);
33 33
 			//$sth->execute(array(':minlon' => $coords[0],':minlat' => $coords[1],':maxlon' => $coords[2],':maxlat' => $coords[3]));
34 34
 			$sth->execute();
35
-		} catch(PDOException $e) {
35
+		} catch (PDOException $e) {
36 36
 			echo "error";
37 37
 		}
38 38
 	}
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	try {
46 46
 		$sth = $Connection->db->prepare($query);
47 47
 		$sth->execute();
48
-	} catch(PDOException $e) {
48
+	} catch (PDOException $e) {
49 49
 		echo "error";
50 50
 	}
51 51
 }
@@ -75,22 +75,22 @@  discard block
 block discarded – undo
75 75
 		if (isset($properties['ceiling'])) $properties['tops'] = $properties['ceiling'];
76 76
 		if (isset($properties['floor'])) $properties['base'] = $properties['floor'];
77 77
 		if (isset($properties['tops'])) {
78
-			if (preg_match('/^FL(\s)*(?<alt>\d+)/',strtoupper($properties['tops']),$matches)) {
78
+			if (preg_match('/^FL(\s)*(?<alt>\d+)/', strtoupper($properties['tops']), $matches)) {
79 79
 				$properties['upper_limit'] = round($matches['alt']*100*0.38048);
80
-			} elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/',strtoupper($properties['tops']),$matches)) {
80
+			} elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/', strtoupper($properties['tops']), $matches)) {
81 81
 				$properties['upper_limit'] = round($matches['alt']*0.38048);
82
-			} elseif (preg_match('/^(?<alt>\d+)(\s)*M/',strtoupper($properties['tops']),$matches)) {
82
+			} elseif (preg_match('/^(?<alt>\d+)(\s)*M/', strtoupper($properties['tops']), $matches)) {
83 83
 				$properties['upper_limit'] = $matches['alt'];
84 84
 			}
85 85
 		}
86 86
 		if (isset($properties['base'])) {
87 87
 			if ($properties['base'] == 'SFC' || $properties['base'] == 'MSL' || $properties['base'] == 'GROUND' || $properties['base'] == 'GND') {
88 88
 				$properties['lower_limit'] = 0;
89
-			} elseif (preg_match('/^FL(\s)*(?<alt>\d+)/',strtoupper($properties['base']),$matches)) {
89
+			} elseif (preg_match('/^FL(\s)*(?<alt>\d+)/', strtoupper($properties['base']), $matches)) {
90 90
 				$properties['lower_limit'] = round($matches['alt']*100*0.38048);
91
-			} elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/',strtoupper($properties['base']),$matches)) {
91
+			} elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/', strtoupper($properties['base']), $matches)) {
92 92
 				$properties['lower_limit'] = round($matches['alt']*0.38048);
93
-			} elseif (preg_match('/^(?<alt>\d+)(\s)*M/',strtoupper($properties['base']),$matches)) {
93
+			} elseif (preg_match('/^(?<alt>\d+)(\s)*M/', strtoupper($properties['base']), $matches)) {
94 94
 				$properties['lower_limit'] = $matches['alt'];
95 95
 			}
96 96
 		}
Please login to merge, or discard this patch.
Braces   +16 added lines, -6 removed lines patch added patch discarded remove patch
@@ -68,12 +68,22 @@
 block discarded – undo
68 68
 		} else {
69 69
 			$geom = geoPHP::load(stream_get_contents($row['wkb']));
70 70
 		}
71
-		if (isset($properties['type'])) $properties['type'] = trim($properties['type']);
72
-		elseif (isset($properties['class'])) $properties['type'] = trim($properties['class']);
73
-		if (isset($properties['ogr_fid'])) $properties['id'] = $properties['ogr_fid'];
74
-		elseif (isset($properties['ogc_fid'])) $properties['id'] = $properties['ogc_fid'];
75
-		if (isset($properties['ceiling'])) $properties['tops'] = $properties['ceiling'];
76
-		if (isset($properties['floor'])) $properties['base'] = $properties['floor'];
71
+		if (isset($properties['type'])) {
72
+			$properties['type'] = trim($properties['type']);
73
+		} elseif (isset($properties['class'])) {
74
+			$properties['type'] = trim($properties['class']);
75
+		}
76
+		if (isset($properties['ogr_fid'])) {
77
+			$properties['id'] = $properties['ogr_fid'];
78
+		} elseif (isset($properties['ogc_fid'])) {
79
+			$properties['id'] = $properties['ogc_fid'];
80
+		}
81
+		if (isset($properties['ceiling'])) {
82
+			$properties['tops'] = $properties['ceiling'];
83
+		}
84
+		if (isset($properties['floor'])) {
85
+			$properties['base'] = $properties['floor'];
86
+		}
77 87
 		if (isset($properties['tops'])) {
78 88
 			if (preg_match('/^FL(\s)*(?<alt>\d+)/',strtoupper($properties['tops']),$matches)) {
79 89
 				$properties['upper_limit'] = round($matches['alt']*100*0.38048);
Please login to merge, or discard this patch.
archive-geojson.php 2 patches
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // This script can be slow...
3 3
 set_time_limit(0);
4
-ini_set('max_execution_time',6000);
4
+ini_set('max_execution_time', 6000);
5 5
 require_once('require/class.Connection.php');
6 6
 require_once('require/class.Common.php');
7 7
 
@@ -63,24 +63,24 @@  discard block
 block discarded – undo
63 63
 $min = false;
64 64
 $allhistory = false;
65 65
 $filter['source'] = array();
66
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
67
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
68
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
69
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
70
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
71
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
72
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
73
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
74
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
75
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
76
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
66
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt'));
67
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup'));
68
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars'));
69
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs'));
70
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs'));
71
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING);
72
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING);
73
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING);
74
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING);
75
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING);
76
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING);
77 77
 
78 78
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
79 79
 	$min = true;
80 80
 } else $min = false;
81 81
 
82 82
 if (isset($_GET['ident'])) {
83
-	$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
83
+	$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
84 84
 	$from_archive = true;
85 85
 	if ($tracker) {
86 86
 		$spotter_array = $TrackerArchive->getLastArchiveTrackerDataByIdent($ident);
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	$allhistory = true;
95 95
 }
96 96
 elseif (isset($_GET['flightaware_id'])) {
97
-	$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
97
+	$flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING);
98 98
 	$from_archive = true;
99 99
 	if ($tracker) {
100 100
 		$spotter_array = $TrackerArchive->getLastArchiveTrackerDataById($flightaware_id);
@@ -109,26 +109,26 @@  discard block
 block discarded – undo
109 109
 }
110 110
 elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed'])) {
111 111
 	$from_archive = true;
112
-	$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
112
+	$begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT);
113 113
 	if (isset($globalAircraftMaxUpdate)) $begindate = $begindate - $globalAircraftMaxUpdate;
114 114
 	else $begindate = $begindate - 3000;
115
-	$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
116
-	$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
117
-	$part = filter_input(INPUT_GET,'part',FILTER_SANITIZE_NUMBER_INT);
115
+	$enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT);
116
+	$archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT);
117
+	$part = filter_input(INPUT_GET, 'part', FILTER_SANITIZE_NUMBER_INT);
118 118
 	if ($part == '') $part = 0;
119 119
 	
120 120
 	if ($begindate != '' && $enddate != '') {
121
-		$begindate = date('Y-m-d H:i:s',$begindate);
122
-		$enddate = date('Y-m-d H:i:s',$enddate);
121
+		$begindate = date('Y-m-d H:i:s', $begindate);
122
+		$enddate = date('Y-m-d H:i:s', $enddate);
123 123
 		//$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter);
124 124
 		if ($tracker) {
125
-			$spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate,$enddate,$filter);
125
+			$spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate, $enddate, $filter);
126 126
 		}
127 127
 		elseif ($marine) {
128
-			$spotter_array = $MarineArchive->getMinLiveMarineData($begindate,$enddate,$filter);
128
+			$spotter_array = $MarineArchive->getMinLiveMarineData($begindate, $enddate, $filter);
129 129
 		}
130 130
 		else {
131
-			$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter,$part);
131
+			$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter, $part);
132 132
 		}
133 133
 	}
134 134
 }
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	if ($flightcnt == '') $flightcnt = 0;
140 140
 } else $flightcnt = 0;
141 141
 
142
-$sqltime = round(microtime(true)-$begintime,2);
142
+$sqltime = round(microtime(true) - $begintime, 2);
143 143
 
144 144
 $pfi = '';
145 145
 //var_dump($spotter_array);
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 $begin = true;
155 155
 if (!empty($spotter_array) && is_array($spotter_array)) {
156 156
 	$output .= '"features": [';
157
-	foreach($spotter_array as $spotter_item) {
157
+	foreach ($spotter_array as $spotter_item) {
158 158
 		$j++;
159 159
 		date_default_timezone_set('UTC');
160 160
 		if ($tracker) {
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 		if ($begin) {
179 179
 			if ($j > 1) {
180 180
 				if (isset($output_time)) {
181
-					$output_time  = substr($output_time, 0, -1);
181
+					$output_time = substr($output_time, 0, -1);
182 182
 					$output .= '"time": ['.$output_time.']';
183 183
 				}
184 184
 				$output .= '},';
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 				$output .= '"type": "LineString",';
188 188
 				$output .= '"coordinates": [';
189 189
 				if (isset($output_history)) {
190
-					$output_history  = substr($output_history, 0, -1);
190
+					$output_history = substr($output_history, 0, -1);
191 191
 					$output .= $output_history;
192 192
 				}
193 193
 				$output .= ']}},';
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 			$output .= '"fi": "'.$pfi.'",';
219 219
 			if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
220 220
 			if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') {
221
-				$output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",';
221
+				$output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",';
222 222
 				//"
223 223
 			} else {
224 224
 				$output .= '"c": "NA",';
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 
353 353
 	if ($j > 1) {
354 354
 		if (isset($output_time)) {
355
-			$output_time  = substr($output_time, 0, -1);
355
+			$output_time = substr($output_time, 0, -1);
356 356
 			$output .= '"time": ['.$output_time.']';
357 357
 		}
358 358
 		$output .= '},';
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 		$output .= '"type": "LineString",';
362 362
 		$output .= '"coordinates": [';
363 363
 		if (isset($output_history)) {
364
-			$output_history  = substr($output_history, 0, -1);
364
+			$output_history = substr($output_history, 0, -1);
365 365
 			$output .= $output_history;
366 366
 		}
367 367
 		$output .= ']';
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 	$output  = substr($output, 0, -1);
373 373
 	$output .= ']';
374 374
 	$output .= ',"initial_sqltime": "'.$sqltime.'",';
375
-	$output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';
375
+	$output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",';
376 376
 	if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
377 377
 	$output .= '"fc": "'.$flightcnt.'"';
378 378
 } else {
Please login to merge, or discard this patch.
Braces   +229 added lines, -142 removed lines patch added patch discarded remove patch
@@ -25,12 +25,10 @@  discard block
 block discarded – undo
25 25
 if ($tracker) {
26 26
 	require_once('require/class.Tracker.php');
27 27
 	require_once('require/class.TrackerArchive.php');
28
-}
29
-elseif ($marine) {
28
+} elseif ($marine) {
30 29
 	require_once('require/class.Marine.php');
31 30
 	require_once('require/class.MarineArchive.php');
32
-}
33
-else {
31
+} else {
34 32
 	require_once('require/class.Spotter.php');
35 33
 	require_once('require/class.SpotterArchive.php');
36 34
 }
@@ -38,12 +36,10 @@  discard block
 block discarded – undo
38 36
 if ($tracker) {
39 37
 	$Tracker = new Tracker();
40 38
 	$TrackerArchive = new TrackerArchive();
41
-}
42
-elseif ($marine) {
39
+} elseif ($marine) {
43 40
 	$Marine = new Marine();
44 41
 	$MarineArchive = new MarineArchive();
45
-}
46
-else {
42
+} else {
47 43
 	$Spotter = new Spotter();
48 44
 	$SpotterArchive = new SpotterArchive();
49 45
 }
@@ -56,66 +52,92 @@  discard block
 block discarded – undo
56 52
 }
57 53
 header('Content-Type: text/javascript');
58 54
 
59
-if (!isset($globalJsonCompress)) $compress = true;
60
-else $compress = $globalJsonCompress;
55
+if (!isset($globalJsonCompress)) {
56
+	$compress = true;
57
+} else {
58
+	$compress = $globalJsonCompress;
59
+}
61 60
 
62 61
 $from_archive = false;
63 62
 $min = false;
64 63
 $allhistory = false;
65 64
 $filter['source'] = array();
66
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
67
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
68
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
69
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
70
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
71
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
72
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
73
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
74
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
75
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
76
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
65
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') {
66
+	$filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
67
+}
68
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') {
69
+	$filter['source'] = array_merge($filter['source'],array('whazzup'));
70
+}
71
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') {
72
+	$filter['source'] = array_merge($filter['source'],array('phpvmacars'));
73
+}
74
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') {
75
+	$filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
76
+}
77
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') {
78
+	$filter['source'] = array_merge($filter['source'],array('aprs'));
79
+}
80
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') {
81
+	$filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
82
+}
83
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') {
84
+	$filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
85
+}
86
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') {
87
+	$filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
88
+}
89
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') {
90
+	$filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
91
+}
92
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') {
93
+	$filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
94
+}
95
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') {
96
+	$filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
97
+}
77 98
 
78 99
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
79 100
 	$min = true;
80
-} else $min = false;
101
+} else {
102
+	$min = false;
103
+}
81 104
 
82 105
 if (isset($_GET['ident'])) {
83 106
 	$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
84 107
 	$from_archive = true;
85 108
 	if ($tracker) {
86 109
 		$spotter_array = $TrackerArchive->getLastArchiveTrackerDataByIdent($ident);
87
-	}
88
-	elseif ($marine) {
110
+	} elseif ($marine) {
89 111
 		$spotter_array = $MarineArchive->getLastArchiveMarineDataByIdent($ident);
90
-	}
91
-	else {
112
+	} else {
92 113
 		$spotter_array = $SpotterArchive->getLastArchiveSpotterDataByIdent($ident);
93 114
 	}
94 115
 	$allhistory = true;
95
-}
96
-elseif (isset($_GET['flightaware_id'])) {
116
+} elseif (isset($_GET['flightaware_id'])) {
97 117
 	$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
98 118
 	$from_archive = true;
99 119
 	if ($tracker) {
100 120
 		$spotter_array = $TrackerArchive->getLastArchiveTrackerDataById($flightaware_id);
101
-	}
102
-	elseif ($marine) {
121
+	} elseif ($marine) {
103 122
 		$spotter_array = $MarineArchive->getLastArchiveMarineDataById($flightaware_id);
104
-	}
105
-	else {
123
+	} else {
106 124
 		$spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id);
107 125
 	}
108 126
 	$allhistory = true;
109
-}
110
-elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed'])) {
127
+} elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed'])) {
111 128
 	$from_archive = true;
112 129
 	$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
113
-	if (isset($globalAircraftMaxUpdate)) $begindate = $begindate - $globalAircraftMaxUpdate;
114
-	else $begindate = $begindate - 3000;
130
+	if (isset($globalAircraftMaxUpdate)) {
131
+		$begindate = $begindate - $globalAircraftMaxUpdate;
132
+	} else {
133
+		$begindate = $begindate - 3000;
134
+	}
115 135
 	$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
116 136
 	$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
117 137
 	$part = filter_input(INPUT_GET,'part',FILTER_SANITIZE_NUMBER_INT);
118
-	if ($part == '') $part = 0;
138
+	if ($part == '') {
139
+		$part = 0;
140
+	}
119 141
 	
120 142
 	if ($begindate != '' && $enddate != '') {
121 143
 		$begindate = date('Y-m-d H:i:s',$begindate);
@@ -123,11 +145,9 @@  discard block
 block discarded – undo
123 145
 		//$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter);
124 146
 		if ($tracker) {
125 147
 			$spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate,$enddate,$filter);
126
-		}
127
-		elseif ($marine) {
148
+		} elseif ($marine) {
128 149
 			$spotter_array = $MarineArchive->getMinLiveMarineData($begindate,$enddate,$filter);
129
-		}
130
-		else {
150
+		} else {
131 151
 			$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter,$part);
132 152
 		}
133 153
 	}
@@ -136,8 +156,12 @@  discard block
 block discarded – undo
136 156
 if (!empty($spotter_array)) {
137 157
 	//$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);
138 158
 	$flightcnt = 0;
139
-	if ($flightcnt == '') $flightcnt = 0;
140
-} else $flightcnt = 0;
159
+	if ($flightcnt == '') {
160
+		$flightcnt = 0;
161
+	}
162
+	} else {
163
+	$flightcnt = 0;
164
+}
141 165
 
142 166
 $sqltime = round(microtime(true)-$begintime,2);
143 167
 
@@ -147,8 +171,11 @@  discard block
 block discarded – undo
147 171
 $aircrafts_shadow = array();
148 172
 $output = '{';
149 173
 $output .= '"type": "FeatureCollection",';
150
-if ($min) $output .= '"minimal": "true",';
151
-else $output .= '"minimal": "false",';
174
+if ($min) {
175
+	$output .= '"minimal": "true",';
176
+} else {
177
+	$output .= '"minimal": "false",';
178
+}
152 179
 $output .= '"fc": "'.$flightcnt.'",';
153 180
 $output .= '"sqt": "'.$sqltime.'",';
154 181
 $begin = true;
@@ -161,15 +188,17 @@  discard block
 block discarded – undo
161 188
 			if ($pfi != $spotter_item['famtrackid']) {
162 189
 				$pfi = $spotter_item['famtrackid'];
163 190
 				$begin = true;
164
-			} else $spotter_history_array = 0;
165
-		}
166
-		elseif ($marine) {
191
+			} else {
192
+				$spotter_history_array = 0;
193
+			}
194
+		} elseif ($marine) {
167 195
 			if ($pfi != $spotter_item['fammarine_d']) {
168 196
 				$pfi = $spotter_item['fammarine_id'];
169 197
 				$begin = true;
170
-			} else $spotter_history_array = 0;
171
-		}
172
-		else {
198
+			} else {
199
+				$spotter_history_array = 0;
200
+			}
201
+		} else {
173 202
 			if ($pfi != $spotter_item['flightaware_id']) {
174 203
 				$pfi = $spotter_item['flightaware_id'];
175 204
 				$begin = true;
@@ -206,7 +235,9 @@  discard block
 block discarded – undo
206 235
 			$output_history .= '['.$spotter_item['longitude'].', '.$spotter_item['latitude'].'],';
207 236
 			$output_time .= (strtotime($spotter_item['date'])*1000).',';
208 237
 			$previousts = strtotime($spotter_item['date']);
209
-			if ($k > 1 && (strtotime($spotter_item['date'])*1000 > $enddate)) $end = true;
238
+			if ($k > 1 && (strtotime($spotter_item['date'])*1000 > $enddate)) {
239
+				$end = true;
240
+			}
210 241
 		}
211 242
 
212 243
 		if ($begin) {
@@ -216,7 +247,9 @@  discard block
 block discarded – undo
216 247
 			$output .= '"type": "Feature",';
217 248
 			$output .= '"properties": {';
218 249
 			$output .= '"fi": "'.$pfi.'",';
219
-			if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
250
+			if (isset($begindate)) {
251
+				$output .= '"archive_date": "'.$begindate.'",';
252
+			}
220 253
 			if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') {
221 254
 				$output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",';
222 255
 				//"
@@ -224,14 +257,20 @@  discard block
 block discarded – undo
224 257
 				$output .= '"c": "NA",';
225 258
 			}
226 259
 			if (!isset($spotter_item['aircraft_shadow']) && !$tracker && !$marine) {
227
-				if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = '';
228
-				else {
260
+				if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') {
261
+					$spotter_item['aircraft_shadow'] = '';
262
+				} else {
229 263
 					$aircraft_icao = $spotter_item['aircraft_icao'];
230 264
 					$aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']);
231
-					if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow'];
232
-					elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png';
233
-					elseif ($aircraft_icao == 'PARAGLIDER') $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png';
234
-					else $spotter_item['aircraft_shadow'] = '';
265
+					if (count($aircraft_info) > 0) {
266
+						$spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow'];
267
+					} elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') {
268
+						$spotter_item['aircraft_shadow'] = 'PA18.png';
269
+					} elseif ($aircraft_icao == 'PARAGLIDER') {
270
+						$spotter_item['aircraft_shadow'] = 'PARAGLIDER.png';
271
+					} else {
272
+						$spotter_item['aircraft_shadow'] = '';
273
+					}
235 274
 					$aircrafts_shadow[$aircraft_icao] = $spotter_item['aircraft_shadow'];
236 275
 				}
237 276
 			}
@@ -239,93 +278,139 @@  discard block
 block discarded – undo
239 278
 			if (!isset($spotter_item['aircraft_shadow']) || $spotter_item['aircraft_shadow'] == '') {
240 279
 				if ($tracker) {
241 280
 					if (isset($spotter_item['type']) && $spotter_item['type'] == 'Ambulance') {
242
-						if ($compress) $output .= '"as": "ambulance.png",';
243
-						else $output .= '"aircraft_shadow": "ambulance.png",';
244
-					}
245
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') {
246
-						if ($compress) $output .= '"as": "police.png",';
247
-						else $output .= '"aircraft_shadow": "police.png",';
248
-					}
249
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') {
250
-						if ($compress) $output .= '"as": "ship.png",';
251
-						else $output .= '"aircraft_shadow": "ship.png",';
252
-					}
253
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') {
254
-						if ($compress) $output .= '"as": "ship.png",';
255
-						else $output .= '"aircraft_shadow": "ship.png",';
256
-					}
257
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') {
258
-						if ($compress) $output .= '"as": "ship.png",';
259
-						else $output .= '"aircraft_shadow": "ship.png",';
281
+						if ($compress) {
282
+							$output .= '"as": "ambulance.png",';
283
+						} else {
284
+							$output .= '"aircraft_shadow": "ambulance.png",';
285
+						}
286
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') {
287
+						if ($compress) {
288
+							$output .= '"as": "police.png",';
289
+						} else {
290
+							$output .= '"aircraft_shadow": "police.png",';
291
+						}
292
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') {
293
+						if ($compress) {
294
+							$output .= '"as": "ship.png",';
295
+						} else {
296
+							$output .= '"aircraft_shadow": "ship.png",';
297
+						}
298
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') {
299
+						if ($compress) {
300
+							$output .= '"as": "ship.png",';
301
+						} else {
302
+							$output .= '"aircraft_shadow": "ship.png",';
303
+						}
304
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') {
305
+						if ($compress) {
306
+							$output .= '"as": "ship.png",';
307
+						} else {
308
+							$output .= '"aircraft_shadow": "ship.png",';
309
+						}
310
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') {
311
+						if ($compress) {
312
+							$output .= '"as": "truck.png",';
313
+						} else {
314
+							$output .= '"aircraft_shadow": "truck.png",';
315
+						}
316
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') {
317
+						if ($compress) {
318
+							$output .= '"as": "truck.png",';
319
+						} else {
320
+							$output .= '"aircraft_shadow": "truck.png",';
321
+						}
322
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') {
323
+						if ($compress) {
324
+							$output .= '"as": "aircraft.png",';
325
+						} else {
326
+							$output .= '"aircraft_shadow": "aircraft.png",';
327
+						}
328
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') {
329
+						if ($compress) {
330
+							$output .= '"as": "aircraft.png",';
331
+						} else {
332
+							$output .= '"aircraft_shadow": "aircraft.png",';
333
+						}
334
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') {
335
+						if ($compress) {
336
+							$output .= '"as": "helico.png",';
337
+						} else {
338
+							$output .= '"aircraft_shadow": "helico.png",';
339
+						}
340
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') {
341
+						if ($compress) {
342
+							$output .= '"as": "rail.png",';
343
+						} else {
344
+							$output .= '"aircraft_shadow": "rail.png",';
345
+						}
346
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') {
347
+						if ($compress) {
348
+							$output .= '"as": "firetruck.png",';
349
+						} else {
350
+							$output .= '"aircraft_shadow": "firetruck.png",';
351
+						}
352
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') {
353
+						if ($compress) {
354
+							$output .= '"as": "bus.png",';
355
+						} else {
356
+							$output .= '"aircraft_shadow": "bus.png",';
357
+						}
358
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') {
359
+						if ($compress) {
360
+							$output .= '"as": "phone.png",';
361
+						} else {
362
+							$output .= '"aircraft_shadow": "phone.png",';
363
+						}
364
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') {
365
+						if ($compress) {
366
+							$output .= '"as": "jogger.png",';
367
+						} else {
368
+							$output .= '"aircraft_shadow": "jogger.png",';
369
+						}
370
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') {
371
+						if ($compress) {
372
+							$output .= '"as": "bike.png",';
373
+						} else {
374
+							$output .= '"aircraft_shadow": "bike.png",';
375
+						}
376
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') {
377
+						if ($compress) {
378
+							$output .= '"as": "motorcycle.png",';
379
+						} else {
380
+							$output .= '"aircraft_shadow": "motorcycle.png",';
381
+						}
382
+					} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') {
383
+						if ($compress) {
384
+							$output .= '"as": "balloon.png",';
385
+						} else {
386
+							$output .= '"aircraft_shadow": "balloon.png",';
387
+						}
388
+					} else {
389
+						if ($compress) {
390
+							$output .= '"as": "car.png",';
391
+						} else {
392
+							$output .= '"aircraft_shadow": "car.png",';
393
+						}
260 394
 					}
261
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') {
262
-						if ($compress) $output .= '"as": "truck.png",';
263
-						else $output .= '"aircraft_shadow": "truck.png",';
395
+				} elseif ($marine) {
396
+					if ($compress) {
397
+						$output .= '"as": "ship.png",';
398
+					} else {
399
+						$output .= '"aircraft_shadow": "ship.png",';
264 400
 					}
265
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') {
266
-						if ($compress) $output .= '"as": "truck.png",';
267
-						else $output .= '"aircraft_shadow": "truck.png",';
268
-					}
269
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') {
270
-						if ($compress) $output .= '"as": "aircraft.png",';
271
-						else $output .= '"aircraft_shadow": "aircraft.png",';
272
-					}
273
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') {
274
-						if ($compress) $output .= '"as": "aircraft.png",';
275
-						else $output .= '"aircraft_shadow": "aircraft.png",';
276
-					}
277
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') {
278
-						if ($compress) $output .= '"as": "helico.png",';
279
-						else $output .= '"aircraft_shadow": "helico.png",';
280
-					}
281
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') {
282
-						if ($compress) $output .= '"as": "rail.png",';
283
-						else $output .= '"aircraft_shadow": "rail.png",';
284
-					}
285
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') {
286
-						if ($compress) $output .= '"as": "firetruck.png",';
287
-						else $output .= '"aircraft_shadow": "firetruck.png",';
288
-					}
289
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') {
290
-						if ($compress) $output .= '"as": "bus.png",';
291
-						else $output .= '"aircraft_shadow": "bus.png",';
292
-					}
293
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') {
294
-						if ($compress) $output .= '"as": "phone.png",';
295
-						else $output .= '"aircraft_shadow": "phone.png",';
296
-					}
297
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') {
298
-						if ($compress) $output .= '"as": "jogger.png",';
299
-						else $output .= '"aircraft_shadow": "jogger.png",';
300
-					}
301
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') {
302
-						if ($compress) $output .= '"as": "bike.png",';
303
-						else $output .= '"aircraft_shadow": "bike.png",';
304
-					}
305
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') {
306
-						if ($compress) $output .= '"as": "motorcycle.png",';
307
-						else $output .= '"aircraft_shadow": "motorcycle.png",';
308
-					}
309
-					elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') {
310
-						if ($compress) $output .= '"as": "balloon.png",';
311
-						else $output .= '"aircraft_shadow": "balloon.png",';
312
-					}
313
-					else {
314
-						if ($compress) $output .= '"as": "car.png",';
315
-						else $output .= '"aircraft_shadow": "car.png",';
401
+				} else {
402
+					if ($compress) {
403
+						$output .= '"as": "default.png",';
404
+					} else {
405
+						$output .= '"aircraft_shadow": "default.png",';
316 406
 					}
317 407
 				}
318
-				elseif ($marine) {
319
-					if ($compress) $output .= '"as": "ship.png",';
320
-					else $output .= '"aircraft_shadow": "ship.png",';
321
-				}
322
-				else {
323
-					if ($compress) $output .= '"as": "default.png",';
324
-					else $output .= '"aircraft_shadow": "default.png",';
325
-				}
326 408
 			} else {
327
-				if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",';
328
-				else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
409
+				if ($compress) {
410
+					$output .= '"as": "'.$spotter_item['aircraft_shadow'].'",';
411
+				} else {
412
+					$output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
413
+				}
329 414
 			}
330 415
 
331 416
 			if (isset($spotter_item['date_iso_8601'])) {
@@ -373,7 +458,9 @@  discard block
 block discarded – undo
373 458
 	$output .= ']';
374 459
 	$output .= ',"initial_sqltime": "'.$sqltime.'",';
375 460
 	$output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';
376
-	if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
461
+	if (isset($begindate)) {
462
+		$output .= '"archive_date": "'.$begindate.'",';
463
+	}
377 464
 	$output .= '"fc": "'.$flightcnt.'"';
378 465
 } else {
379 466
 	$output .= '"features": ';
Please login to merge, or discard this patch.
js/map-aircraft.2d.js.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 if (!isset($globalJsonCompress)) $compress = true;
7 7
 else $compress = $globalJsonCompress;
8 8
 
9
-if (isset($_GET['ident'])) $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
10
-if (isset($_GET['flightaware_id'])) $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
9
+if (isset($_GET['ident'])) $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
10
+if (isset($_GET['flightaware_id'])) $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING);
11 11
 ?>
12 12
 <?php
13 13
 if (isset($_COOKIE['IconColor'])) $IconColor = $_COOKIE['IconColor'];
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 			if (typeof props != 'undefined') {
227 227
 				var thedate = new Date(props);
228 228
 				$("#thedate").html(thedate.toUTCString());
229
-			//	$("#archivebox").html('<h4><?php echo str_replace("'","\'",_("Archive Date & Time")); ?></h4>' +  '<b><i class="fa fa-spinner fa-pulse fa-2x fa-fw margin-bottom"></i></b>');
229
+			//	$("#archivebox").html('<h4><?php echo str_replace("'", "\'", _("Archive Date & Time")); ?></h4>' +  '<b><i class="fa fa-spinner fa-pulse fa-2x fa-fw margin-bottom"></i></b>');
230 230
 			}
231 231
 		}
232 232
 	}
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 <?php
374 374
 		} else {
375 375
 ?>
376
-					var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
376
+					var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000);
377 377
 					return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
378 378
 <?php
379 379
 		}
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 							/*
391 391
 							shadowUrl: iconURLShadowpath,
392 392
 							shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>],
393
-							shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>]
393
+							shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>]
394 394
 							*/
395 395
 						})
396 396
 					})
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 <?php
425 425
 		} else {
426 426
 ?>
427
-						var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
427
+						var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000);
428 428
 						return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
429 429
 <?php
430 430
 		}
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 <?php
473 473
 		} else {
474 474
 ?>
475
-							var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
475
+							var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000);
476 476
 							return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
477 477
 <?php
478 478
 		}
Please login to merge, or discard this patch.
Braces   +60 added lines, -16 removed lines patch added patch discarded remove patch
@@ -13,16 +13,27 @@  discard block
 block discarded – undo
13 13
 <?php
14 14
 
15 15
 // Compressed GeoJson is used if true
16
-if (!isset($globalJsonCompress)) $compress = true;
17
-else $compress = $globalJsonCompress;
16
+if (!isset($globalJsonCompress)) {
17
+	$compress = true;
18
+} else {
19
+	$compress = $globalJsonCompress;
20
+}
18 21
 
19
-if (isset($_GET['ident'])) $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
20
-if (isset($_GET['flightaware_id'])) $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
22
+if (isset($_GET['ident'])) {
23
+	$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
24
+}
25
+if (isset($_GET['flightaware_id'])) {
26
+	$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
27
+}
21 28
 ?>
22 29
 <?php
23
-if (isset($_COOKIE['IconColor'])) $IconColor = $_COOKIE['IconColor'];
24
-elseif (isset($globalAircraftIconColor)) $IconColor = $globalAircraftIconColor;
25
-else $IconColor = '1a3151';
30
+if (isset($_COOKIE['IconColor'])) {
31
+	$IconColor = $_COOKIE['IconColor'];
32
+} elseif (isset($globalAircraftIconColor)) {
33
+	$IconColor = $globalAircraftIconColor;
34
+} else {
35
+	$IconColor = '1a3151';
36
+}
26 37
 ?>
27 38
 <?php
28 39
 if (isset($globalDebug) && $globalDebug === TRUE) {
@@ -99,9 +110,12 @@  discard block
 block discarded – undo
99 110
 
100 111
 function update_airportsLayer() {
101 112
 <?php
102
-	if (isset($_COOKIE['AirportZoom'])) $getZoom = $_COOKIE['AirportZoom'];
103
-	else $getZoom = '7';
104
-?>
113
+	if (isset($_COOKIE['AirportZoom'])) {
114
+		$getZoom = $_COOKIE['AirportZoom'];
115
+	} else {
116
+		$getZoom = '7';
117
+	}
118
+	?>
105 119
 	if (typeof airportsLayer != 'undefined') {
106 120
 		if (map.hasLayer(airportsLayer) == true) {
107 121
 			map.removeLayer(airportsLayer);
@@ -382,7 +396,12 @@  discard block
 block discarded – undo
382 396
 <?php
383 397
 		} else {
384 398
 ?>
385
-					var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
399
+					var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
400
+	print $archiveupdatetime*1000;
401
+} else {
402
+	print $globalMapRefresh*1000+20000;
403
+}
404
+?>+feature.properties.sqt*1000);
386 405
 					return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
387 406
 <?php
388 407
 		}
@@ -433,7 +452,12 @@  discard block
 block discarded – undo
433 452
 <?php
434 453
 		} else {
435 454
 ?>
436
-						var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
455
+						var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
456
+	print $archiveupdatetime*1000;
457
+} else {
458
+	print $globalMapRefresh*1000+20000;
459
+}
460
+?>+feature.properties.sqt*1000);
437 461
 						return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
438 462
 <?php
439 463
 		}
@@ -481,7 +505,12 @@  discard block
 block discarded – undo
481 505
 <?php
482 506
 		} else {
483 507
 ?>
484
-							var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
508
+							var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
509
+	print $archiveupdatetime*1000;
510
+} else {
511
+	print $globalMapRefresh*1000+20000;
512
+}
513
+?>+feature.properties.sqt*1000);
485 514
 							return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
486 515
 <?php
487 516
 		}
@@ -1000,12 +1029,22 @@  discard block
 block discarded – undo
1000 1029
 		update_archiveLayer(0);
1001 1030
 	} else {
1002 1031
 		//then load it again every 30 seconds
1003
-		var reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>);
1032
+		var reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) {
1033
+	print $globalMapRefresh*1000;
1034
+} else {
1035
+	print '30000';
1036
+}
1037
+?>);
1004 1038
 <?php
1005 1039
 		if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
1006 1040
 ?>
1007 1041
 		update_polarLayer();
1008
-		setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>);
1042
+		setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) {
1043
+	print $globalMapRefresh*1000*2;
1044
+} else {
1045
+	print '60000';
1046
+}
1047
+?>);
1009 1048
 <?php
1010 1049
 		}
1011 1050
 ?>
@@ -1018,7 +1057,12 @@  discard block
 block discarded – undo
1018 1057
 	if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) {
1019 1058
 ?>
1020 1059
 	update_atcLayer();
1021
-	setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>);
1060
+	setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) {
1061
+	print $globalMapRefresh*1000*2;
1062
+} else {
1063
+	print '60000';
1064
+}
1065
+?>);
1022 1066
 <?php
1023 1067
 	}
1024 1068
 ?>
Please login to merge, or discard this patch.