Completed
Push — master ( 708bc7...3d67e6 )
by Yannick
30:22
created
country.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 
5 5
 if (isset($_POST['country']) && $_POST['country'] != "")
6 6
 {
7
-	$country = filter_input(INPUT_POST,'country',FILTER_SANITIZE_STRING);
7
+	$country = filter_input(INPUT_POST, 'country', FILTER_SANITIZE_STRING);
8 8
 	header('Location: '.$globalURL.'/country/'.$country);
9 9
 } else {
10 10
 	if ($globalURL == '') {
Please login to merge, or discard this patch.
header.php 3 patches
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 // When button "Remove all filters" is clicked
29 29
 if (isset($_POST['removefilters'])) {
30 30
 	$allfilters = array_filter(array_keys($_COOKIE),function($key) {
31
-	    return strpos($key,'filter_') === 0;
31
+		return strpos($key,'filter_') === 0;
32 32
 	});
33 33
 	foreach ($allfilters as $filt) {
34 34
 		unset($_COOKIE[$filt]);
@@ -160,17 +160,17 @@  discard block
 block discarded – undo
160 160
 	}
161 161
 ?>
162 162
 <?php 
163
-    if (isset($_POST['archive'])) {
163
+	if (isset($_POST['archive'])) {
164 164
 ?>
165 165
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
166 166
 <?php 
167
-	    if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
167
+		if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
168 168
 ?>
169 169
 
170 170
 <script src="<?php print $globalURL; ?>/js/map.js.php?<?php print time(); ?>&archive&begindate=<?php print strtotime($_POST['start_date']); ?>&enddate=<?php print strtotime($_POST['end_date']); ?>&archivespeed=<?php print $_POST['archivespeed']; ?>"></script>
171 171
 <?php    
172
-	    }
173
-    } else {
172
+		}
173
+	} else {
174 174
 ?>
175 175
 <?php
176 176
 /*	if (isset($globalBeta) && $globalBeta) {
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 */
183 183
 ?>
184 184
 <?php 
185
-	    if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
185
+		if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
186 186
 ?>
187 187
 <?php
188 188
 //		if (isset($globalBeta) && $globalBeta) {
@@ -213,13 +213,13 @@  discard block
 block discarded – undo
213 213
 <script src="<?php print $globalURL; ?>/js/map-satellite.2d.js.php?<?php print time(); ?>"></script>
214 214
 <?php
215 215
 		}
216
-	    }
216
+		}
217 217
 ?>
218 218
 <?php
219 219
 //	}
220 220
 ?>
221 221
 <?php
222
-    }
222
+	}
223 223
 }
224 224
 ?>
225 225
 <?php
@@ -397,61 +397,61 @@  discard block
 block discarded – undo
397 397
       <ul class="nav navbar-nav">
398 398
 
399 399
 <?php 
400
-    $sub = false;
401
-    if (
400
+	$sub = false;
401
+	if (
402 402
 	(
403
-	    (!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
403
+		(!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
404 404
 	) || 
405 405
 	(
406
-	    isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
406
+		isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
407 407
 	) || 
408 408
 	(
409
-	    isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
409
+		isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
410 410
 	) || 
411 411
 	(
412
-	    isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))
412
+		isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))
413 413
 	)
414
-    ) {
414
+	) {
415 415
 	$sub = true;
416
-    }
416
+	}
417 417
 ?>
418 418
 <?php
419
-    if (!isset($globalAircraft) || $globalAircraft === TRUE) {
419
+	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
420 420
 ?>
421 421
     <li class="dropdown">
422 422
 <?php
423
-    if ($sub) {
423
+	if ($sub) {
424 424
 ?>
425 425
       	<li class="dropdown">
426 426
           <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Aircrafts"); ?> <b class="caret"></b></a>
427 427
 	<ul class="dropdown-menu multi-level">
428 428
       	<li class="dropdown-submenu">
429 429
 <?php
430
-    }
430
+	}
431 431
 ?>
432 432
           <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
433 433
           <ul class="dropdown-menu">
434 434
           	<li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircrafts Types"); ?></a></li>
435 435
 <?php
436
-    if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
436
+	if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
437 437
 ?>
438 438
 			<li><a href="<?php print $globalURL; ?>/airline"><?php echo _("Airlines"); ?></a></li>
439 439
 <?php
440
-    }
440
+	}
441 441
 ?>
442 442
 			<li><a href="<?php print $globalURL; ?>/airport"><?php echo _("Airports"); ?></a></li>
443 443
 <?php
444
-    if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
444
+	if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
445 445
 ?>
446 446
 			<li><a href="<?php print $globalURL; ?>/owner"><?php echo _("Owners"); ?></a></li>
447 447
 <?php
448
-    } 
449
-    if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
448
+	} 
449
+	if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
450 450
 
451 451
 ?>
452 452
 			<li><a href="<?php print $globalURL; ?>/pilot"><?php echo _("Pilots"); ?></a></li>
453 453
 <?php
454
-    }
454
+	}
455 455
 ?>
456 456
 			<li><hr /></li>
457 457
             <li><a href="<?php print $globalURL; ?>/currently"><?php echo _("Current Activity"); ?></a></li>
@@ -459,43 +459,43 @@  discard block
 block discarded – undo
459 459
             <li><a href="<?php print $globalURL; ?>/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li>
460 460
             <li><a href="<?php print $globalURL; ?>/newest"><?php echo _("Newest by Category"); ?></a></li>
461 461
             <?php
462
-        	if ($globalACARS) {
463
-        	    if (isset($globalDemo) && $globalDemo) {
464
-    	    ?>
462
+			if ($globalACARS) {
463
+				if (isset($globalDemo) && $globalDemo) {
464
+			?>
465 465
             <li><hr /></li>
466 466
             <li><i><?php echo _('ACARS data not available publicly'); ?></i></li>
467 467
             <li><a href=""><?php echo _('Latest ACARS messages'); ?></a></li>
468 468
             <li><a href=""><?php echo _('Archive ACARS messages'); ?></a></li>
469 469
             <?php
470
-        	    } else {
471
-    	    ?>
470
+				} else {
471
+			?>
472 472
             <li><hr /></li>
473 473
             <li><a href="<?php print $globalURL; ?>/acars-latest"><?php echo _("Latest ACARS messages"); ?></a></li>
474 474
             <li><a href="<?php print $globalURL; ?>/acars-archive"><?php echo _("Archive ACARS messages"); ?></a></li>
475 475
             <?php
476
-        	    }
477
-        	}
478
-    	    ?>
476
+				}
477
+			}
478
+			?>
479 479
     	    <?php
480
-    	        if (isset($globalAccidents) && $globalAccidents) {
481
-    	    ?>
480
+				if (isset($globalAccidents) && $globalAccidents) {
481
+			?>
482 482
             <li><hr /></li>
483 483
             <li><a href="<?php print $globalURL; ?>/accident-latest"><?php echo _("Latest accident"); ?></a></li>
484 484
             <li><a href="<?php print $globalURL; ?>/accident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Accident"); ?></a></li>
485 485
             <li><a href="<?php print $globalURL; ?>/incident-latest"><?php echo _("Latest incident"); ?></a></li>
486 486
             <li><a href="<?php print $globalURL; ?>/incident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Incident"); ?></a></li>
487 487
             <?php
488
-        	}
489
-    	    ?>
488
+			}
489
+			?>
490 490
             <li><hr /></li>
491 491
             <li><a href="<?php print $globalURL; ?>/highlights/table"><?php echo _("Special Highlights"); ?></a></li>
492 492
             <?php
493 493
 		if (!isset($globalNoUpcoming) || $globalNoUpcoming === FALSE) {
494
-	    ?>
494
+		?>
495 495
             <li><a href="<?php print $globalURL; ?>/upcoming"><?php echo _("Upcoming Flights"); ?></a></li>
496 496
 	    <?php
497 497
 		}
498
-	    ?>
498
+		?>
499 499
           </ul>
500 500
         </li>
501 501
       	<li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li>
@@ -522,14 +522,14 @@  discard block
 block discarded – undo
522 522
     </ul>
523 523
 <?php
524 524
 	}
525
-    }
525
+	}
526 526
 ?>
527 527
 <?php
528
-    if (isset($globalMarine) && $globalMarine) {
528
+	if (isset($globalMarine) && $globalMarine) {
529 529
 ?>
530 530
     <li class="dropdown">
531 531
 <?php
532
-        if ($sub) {
532
+		if ($sub) {
533 533
 ?>
534 534
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Vessels"); ?> <b class="caret"></b></a>
535 535
 	<ul class="dropdown-menu multi-level">
@@ -555,14 +555,14 @@  discard block
 block discarded – undo
555 555
 	}
556 556
 ?>
557 557
 <?php
558
-    }
558
+	}
559 559
 ?>
560 560
 <?php
561
-    if (isset($globalTracker) && $globalTracker) {
561
+	if (isset($globalTracker) && $globalTracker) {
562 562
 ?>
563 563
     <li class="dropdown">
564 564
 <?php
565
-        if ($sub) {
565
+		if ($sub) {
566 566
 ?>
567 567
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Trackers"); ?> <b class="caret"></b></a>
568 568
 	<ul class="dropdown-menu multi-level">
@@ -588,14 +588,14 @@  discard block
 block discarded – undo
588 588
 	}
589 589
 ?>
590 590
 <?php
591
-    }
591
+	}
592 592
 ?>
593 593
 <?php
594
-    if (isset($globalSatellite) && $globalSatellite) {
594
+	if (isset($globalSatellite) && $globalSatellite) {
595 595
 ?>
596 596
     <li class="dropdown">
597 597
 <?php
598
-        if ($sub) {
598
+		if ($sub) {
599 599
 ?>
600 600
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Satellite"); ?> <b class="caret"></b></a>
601 601
 	<ul class="dropdown-menu multi-level">
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
 	}
623 623
 ?>
624 624
 <?php
625
-    }
625
+	}
626 626
 ?>
627 627
 
628 628
         <li class="dropdown">
@@ -631,12 +631,12 @@  discard block
 block discarded – undo
631 631
           	<li><a href="<?php print $globalURL; ?>/about"><?php echo _("About The Project"); ?></a></li>
632 632
           	<li><a href="<?php print $globalURL; ?>/about/export"><?php echo _("Exporting Data"); ?></a></li>
633 633
 <?php
634
-    if (!isset($globalAircraft) || $globalAircraft === TRUE) {
634
+	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
635 635
 ?>
636 636
 		<li><hr /></li>
637 637
 		<li><a href="<?php print $globalURL; ?>/about/tv"><?php echo _("Spotter TV"); ?></a></li>
638 638
 <?php
639
-    }
639
+	}
640 640
 ?>
641 641
 	    <?php if (isset($globalContribute) && $globalContribute) { ?>
642 642
                 <li><hr /></li>
@@ -657,14 +657,14 @@  discard block
 block discarded – undo
657 657
   	    <form>
658 658
   		<select class="selectpicker" data-width="120px" onchange="language(this);">
659 659
   		    <?php
660
-  		        $Language = new Language();
661
-  		        $alllang = $Language->getLanguages();
662
-  		        foreach ($alllang as $key => $lang) {
663
-  		            print '<option value="'.$key.'"';
664
-  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
665
-  		            print '>'.$lang[0].'</option>';
666
-  		        }
667
-  		    ?>
660
+  				$Language = new Language();
661
+  				$alllang = $Language->getLanguages();
662
+  				foreach ($alllang as $key => $lang) {
663
+  					print '<option value="'.$key.'"';
664
+  					if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
665
+  					print '>'.$lang[0].'</option>';
666
+  				}
667
+  			?>
668 668
   		</select>
669 669
   	    </form>
670 670
   	</div>
@@ -695,18 +695,18 @@  discard block
 block discarded – undo
695 695
 ?>
696 696
     <div class="top-header clear" role="main">
697 697
 <?php
698
-    if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) {
698
+	if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) {
699 699
 ?>
700 700
     <div id="archive-map"></div>
701 701
 <?php
702
-    }
702
+	}
703 703
 ?>
704 704
     </div>
705 705
 <?php
706 706
 }
707 707
 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))
708 708
 {
709
-    ?>
709
+	?>
710 710
     <div class="top-header clear" role="main">
711 711
         <div id="map"></div>
712 712
 	<link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" />
@@ -717,15 +717,15 @@  discard block
 block discarded – undo
717 717
         var zoom = 13;
718 718
 //create the map
719 719
 <?php
720
-    if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
720
+	if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
721 721
 ?>
722 722
   map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom);
723 723
 <?php
724
-    } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
724
+	} elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
725 725
 ?>
726 726
   map = L.map('map', { zoomControl:true });
727 727
 <?php
728
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
728
+	} elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
729 729
 ?>
730 730
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]);
731 731
     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);
@@ -733,22 +733,22 @@  discard block
 block discarded – undo
733 733
     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);
734 734
     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);
735 735
 <?php
736
-    } 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'])) {
736
+	} 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'])) {
737 737
 ?>
738 738
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]);
739 739
 <?php
740
-    } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) {
740
+	} elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) {
741 741
 ?>
742 742
   map = L.map('map', { zoomControl:true });
743 743
 <?php
744
-    }
744
+	}
745 745
 ?>
746 746
   //initialize the layer group for the aircrft markers
747 747
   var layer_data = L.layerGroup();
748 748
 
749 749
   //a few title layers
750 750
 <?php
751
-    if ($globalMapProvider == 'Mapbox') {
751
+	if ($globalMapProvider == 'Mapbox') {
752 752
 ?>
753 753
   L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', {
754 754
     maxZoom: 18,
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
     token : '<?php print $globalMapboxToken; ?>'
760 760
   }).addTo(map);
761 761
 <?php
762
-    } elseif ($globalMapProvider == 'MapQuest-OSM') {
762
+	} elseif ($globalMapProvider == 'MapQuest-OSM') {
763 763
 ?>
764 764
   L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {
765 765
     maxZoom: 18,
@@ -768,7 +768,7 @@  discard block
 block discarded – undo
768 768
       'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>'
769 769
   }).addTo(map);
770 770
 <?php
771
-    } elseif ($globalMapProvider == 'MapQuest-Aerial') {
771
+	} elseif ($globalMapProvider == 'MapQuest-Aerial') {
772 772
 ?>
773 773
   L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', {
774 774
     maxZoom: 18,
@@ -777,27 +777,27 @@  discard block
 block discarded – undo
777 777
       '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"'
778 778
   }).addTo(map);
779 779
 <?php
780
-    } elseif ($globalMapProvider == 'Google-Roadmap') {
780
+	} elseif ($globalMapProvider == 'Google-Roadmap') {
781 781
 ?>
782 782
     var googleLayer = new L.Google('ROADMAP');
783 783
     map.addLayer(googleLayer);
784 784
 <?php
785
-    } elseif ($globalMapProvider == 'Google-Satellite') {
785
+	} elseif ($globalMapProvider == 'Google-Satellite') {
786 786
 ?>
787 787
     var googleLayer = new L.Google('SATELLITE');
788 788
     map.addLayer(googleLayer);
789 789
 <?php
790
-    } elseif ($globalMapProvider == 'Google-Hybrid') {
790
+	} elseif ($globalMapProvider == 'Google-Hybrid') {
791 791
 ?>
792 792
     var googleLayer = new L.Google('HYBRID');
793 793
     map.addLayer(googleLayer);
794 794
 <?php
795
-    } elseif ($globalMapProvider == 'Google-Terrain') {
795
+	} elseif ($globalMapProvider == 'Google-Terrain') {
796 796
 ?>
797 797
     var googleLayer = new L.Google('Terrain');
798 798
     map.addLayer(googleLayer);
799 799
 <?php
800
-    } elseif (isset($globalMapCustomLayer[$globalMapProvider])) {
800
+	} elseif (isset($globalMapCustomLayer[$globalMapProvider])) {
801 801
 	$customid = $globalMapProvider;
802 802
 ?>
803 803
     L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', {
@@ -807,8 +807,8 @@  discard block
 block discarded – undo
807 807
         attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
808 808
     }).addTo(map);
809 809
 <?php
810
-    //} elseif ($globalMapProvider == 'OpenStreetMap') {
811
-    } else {
810
+	//} elseif ($globalMapProvider == 'OpenStreetMap') {
811
+	} else {
812 812
 ?>
813 813
   L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
814 814
     maxZoom: 18,
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
   }).addTo(map);
818 818
 
819 819
 <?php
820
-    }
820
+	}
821 821
 ?>
822 822
         </script>
823 823
     </div>
Please login to merge, or discard this patch.
Braces   +77 added lines, -17 removed lines patch added patch discarded remove patch
@@ -6,10 +6,15 @@  discard block
 block discarded – undo
6 6
 //gets the page file and stores it in a variable
7 7
 $file_path = pathinfo($_SERVER['SCRIPT_NAME']);
8 8
 $current_page = $file_path['filename'];
9
-if ($globalTimezone == '') $globalTimezone = 'UTC';
9
+if ($globalTimezone == '') {
10
+	$globalTimezone = 'UTC';
11
+}
10 12
 date_default_timezone_set($globalTimezone);
11
-if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') $MapType = $_COOKIE['MapType'];
12
-else $MapType = $globalMapProvider;
13
+if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') {
14
+	$MapType = $_COOKIE['MapType'];
15
+} else {
16
+	$MapType = $globalMapProvider;
17
+}
13 18
 
14 19
 
15 20
 if (isset($_GET['3d'])) {
@@ -241,7 +246,13 @@  discard block
 block discarded – undo
241 246
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
242 247
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
243 248
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
244
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
249
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) {
250
+	print '&latitude='.$latitude;
251
+}
252
+?><?php if(isset($longitude)) {
253
+	print '&longitude='.$longitude;
254
+}
255
+?>&<?php print time(); ?>"></script>
245 256
 <?php
246 257
 		if (!isset($type) || $type == 'aircraft') {
247 258
 ?>
@@ -314,7 +325,13 @@  discard block
 block discarded – undo
314 325
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
315 326
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
316 327
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
317
-<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>
328
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) {
329
+	print '&latitude='.$latitude;
330
+}
331
+?><?php if(isset($longitude)) {
332
+	print '&longitude='.$longitude;
333
+}
334
+?>&<?php print time(); ?>"></script>
318 335
 <script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?flightaware_id=<?php print $flightaware_id; ?>&<?php print time(); ?>"></script>
319 336
 <?php
320 337
 		if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) {
@@ -395,7 +412,12 @@  discard block
 block discarded – undo
395 412
         <span class="icon-bar"></span>
396 413
       </button>
397 414
       <a href="<?php print $globalURL; ?>/search" class="navbar-toggle navbar-toggle-search"><i class="fa fa-search"></i></a>
398
-      <a class="navbar-brand" href="<?php if ($globalURL == '') print '/'; else print $globalURL; ?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a>
415
+      <a class="navbar-brand" href="<?php if ($globalURL == '') {
416
+	print '/';
417
+} else {
418
+	print $globalURL;
419
+}
420
+?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a>
399 421
     </div>
400 422
     <div class="collapse navbar-collapse">
401 423
 
@@ -434,7 +456,10 @@  discard block
 block discarded – undo
434 456
 <?php
435 457
     }
436 458
 ?>
437
-          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
459
+          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
460
+	echo 'right-';
461
+}
462
+?>caret"></b></a>
438 463
           <ul class="dropdown-menu">
439 464
           	<li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircrafts Types"); ?></a></li>
440 465
 <?php
@@ -505,8 +530,14 @@  discard block
 block discarded – undo
505 530
         </li>
506 531
       	<li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li>
507 532
       	<li><a href="<?php print $globalURL; ?>/statistics"><?php echo _("Statistics"); ?></a></li>
508
-        <li class="dropdown<?php if ($sub) echo '-submenu'; ?>">
509
-          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
533
+        <li class="dropdown<?php if ($sub) {
534
+	echo '-submenu';
535
+}
536
+?>">
537
+          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) {
538
+	echo 'right-';
539
+}
540
+?>caret"></b></a>
510 541
           <ul class="dropdown-menu">
511 542
           	<li><a href="<?php print $globalURL; ?>/tools/acars"><?php echo _("ACARS translator"); ?></a></li>
512 543
           	<li><a href="<?php print $globalURL; ?>/tools/metar"><?php echo _("METAR translator"); ?></a></li>
@@ -542,7 +573,10 @@  discard block
 block discarded – undo
542 573
 <?php
543 574
 	}
544 575
 ?>
545
-		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
576
+		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
577
+	echo 'right-';
578
+}
579
+?>caret"></b></a>
546 580
 		<ul class="dropdown-menu">
547 581
 		    <li><a href="<?php print $globalURL; ?>/marine/currently"><?php echo _("Current Activity"); ?></a></li>
548 582
 		    <li><a href="<?php print $globalURL; ?>/marine/latest"><?php echo _("Latest Activity"); ?></a></li>
@@ -575,7 +609,10 @@  discard block
 block discarded – undo
575 609
 <?php
576 610
 	}
577 611
 ?>
578
-		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
612
+		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
613
+	echo 'right-';
614
+}
615
+?>caret"></b></a>
579 616
 		<ul class="dropdown-menu">
580 617
 		    <li><a href="<?php print $globalURL; ?>/tracker/currently"><?php echo _("Current Activity"); ?></a></li>
581 618
 		    <li><a href="<?php print $globalURL; ?>/tracker/latest"><?php echo _("Latest Activity"); ?></a></li>
@@ -609,7 +646,10 @@  discard block
 block discarded – undo
609 646
 	}
610 647
 ?>
611 648
 <!--
612
-		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
649
+		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
650
+	echo 'right-';
651
+}
652
+?>caret"></b></a>
613 653
 		<ul class="dropdown-menu">
614 654
 		    <li><a href="<?php print $globalURL; ?>/satellite/currently"><?php echo _("Current Activity"); ?></a></li>
615 655
 		    <li><a href="<?php print $globalURL; ?>/satellite/latest"><?php echo _("Latest Activity"); ?></a></li>
@@ -666,7 +706,9 @@  discard block
 block discarded – undo
666 706
   		        $alllang = $Language->getLanguages();
667 707
   		        foreach ($alllang as $key => $lang) {
668 708
   		            print '<option value="'.$key.'"';
669
-  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
709
+  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) {
710
+  		            	print ' selected ';
711
+  		            }
670 712
   		            print '>'.$lang[0].'</option>';
671 713
   		        }
672 714
   		    ?>
@@ -806,9 +848,24 @@  discard block
 block discarded – undo
806 848
 	$customid = $globalMapProvider;
807 849
 ?>
808 850
     L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', {
809
-        maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '18'; ?>,
810
-        minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>,
811
-        noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>,
851
+        maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) {
852
+	print $globalMapCustomLayer[$customid]['maxZoom'];
853
+} else {
854
+	print '18';
855
+}
856
+?>,
857
+        minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) {
858
+	print $globalMapCustomLayer[$customid]['minZoom'];
859
+} else {
860
+	print '0';
861
+}
862
+?>,
863
+        noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) {
864
+	print 'false';
865
+} else {
866
+	print 'true';
867
+}
868
+?>,
812 869
         attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
813 870
     }).addTo(map);
814 871
 <?php
@@ -831,4 +888,7 @@  discard block
 block discarded – undo
831 888
 
832 889
 ?>
833 890
 
834
-<section class="container main-content <?php if (strtolower($current_page) == 'index') print 'index '; ?>clear">
891
+<section class="container main-content <?php if (strtolower($current_page) == 'index') {
892
+	print 'index ';
893
+}
894
+?>clear">
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -13,31 +13,31 @@  discard block
 block discarded – undo
13 13
 
14 14
 
15 15
 if (isset($_GET['3d'])) {
16
-	setcookie('MapFormat','3d');
16
+	setcookie('MapFormat', '3d');
17 17
 } else if (isset($_GET['2d'])) {
18
-	setcookie('MapFormat','2d');
18
+	setcookie('MapFormat', '2d');
19 19
 }
20 20
 
21 21
 if (isset($_POST['archive'])) {
22
-	setcookie('archive','true');
23
-	setcookie('archive_begin',strtotime($_POST['start_date']));
24
-	setcookie('archive_end',strtotime($_POST['end_date']));
25
-	setcookie('archive_speed',$_POST['archivespeed']);
22
+	setcookie('archive', 'true');
23
+	setcookie('archive_begin', strtotime($_POST['start_date']));
24
+	setcookie('archive_end', strtotime($_POST['end_date']));
25
+	setcookie('archive_speed', $_POST['archivespeed']);
26 26
 }
27 27
 if (isset($_POST['noarchive'])) {
28
-	setcookie('archive','false',-1);
29
-	setcookie('archive_begin','',-1);
30
-	setcookie('archive_end','',-1);
31
-	setcookie('archive_speed','',-1);
28
+	setcookie('archive', 'false', -1);
29
+	setcookie('archive_begin', '', -1);
30
+	setcookie('archive_end', '', -1);
31
+	setcookie('archive_speed', '', -1);
32 32
 }
33 33
 // When button "Remove all filters" is clicked
34 34
 if (isset($_POST['removefilters'])) {
35
-	$allfilters = array_filter(array_keys($_COOKIE),function($key) {
36
-	    return strpos($key,'filter_') === 0;
35
+	$allfilters = array_filter(array_keys($_COOKIE), function($key) {
36
+	    return strpos($key, 'filter_') === 0;
37 37
 	});
38 38
 	foreach ($allfilters as $filt) {
39 39
 		unset($_COOKIE[$filt]);
40
-		setcookie($filt,null,-1);
40
+		setcookie($filt, null, -1);
41 41
 	}
42 42
 }
43 43
 ?>
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
242 242
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
243 243
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
244
-<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>
244
+<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>
245 245
 <?php
246 246
 		if (!isset($type) || $type == 'aircraft') {
247 247
 ?>
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
315 315
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
316 316
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
317
-<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>
317
+<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>
318 318
 <script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?flightaware_id=<?php print $flightaware_id; ?>&<?php print time(); ?>"></script>
319 319
 <?php
320 320
 		if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) {
@@ -678,8 +678,8 @@  discard block
 block discarded – undo
678 678
 ?>
679 679
       <div class="search">
680 680
       <form action="<?php print $globalURL; ?>/search" method="get">
681
-		<!--<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>-->
682
-		<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>
681
+		<!--<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>-->
682
+		<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>
683 683
 	</form>
684 684
 	</div>
685 685
   	<div class="social">
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
 	print '</div>';
698 698
 }
699 699
 
700
-if (strtolower($current_page) =='ident-detailed' || strtolower($current_page) == 'flightid-overview') {
700
+if (strtolower($current_page) == 'ident-detailed' || strtolower($current_page) == 'flightid-overview') {
701 701
 ?>
702 702
     <div class="top-header clear" role="main">
703 703
 <?php
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
     </div>
711 711
 <?php
712 712
 }
713
-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))
713
+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))
714 714
 {
715 715
     ?>
716 716
     <div class="top-header clear" role="main">
@@ -723,15 +723,15 @@  discard block
 block discarded – undo
723 723
         var zoom = 13;
724 724
 //create the map
725 725
 <?php
726
-    if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
726
+    if (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($airport_array[0]['latitude'])) {
727 727
 ?>
728 728
   map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom);
729 729
 <?php
730
-    } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
730
+    } elseif (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false) {
731 731
 ?>
732 732
   map = L.map('map', { zoomControl:true });
733 733
 <?php
734
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
734
+    } elseif (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
735 735
 ?>
736 736
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]);
737 737
     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);
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
     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);
740 740
     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);
741 741
 <?php
742
-    } 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'])) {
742
+    } 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'])) {
743 743
 ?>
744 744
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]);
745 745
 <?php
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">'._("Aircrafts 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">'._("Aircrafts").'</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">'._("Aircrafts 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.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@
 block discarded – undo
5 5
 
6 6
 if (isset($_POST['departure_airport']) && $_POST['departure_airport'] != '')
7 7
 {
8
-	$departure_airport = filter_input(INPUT_POST,'departure_airport',FILTER_SANITIZE_STRING);
9
-	$arrival_airport = filter_input(INPUT_POST,'arrival_airport',FILTER_SANITIZE_STRING);
8
+	$departure_airport = filter_input(INPUT_POST, 'departure_airport', FILTER_SANITIZE_STRING);
9
+	$arrival_airport = filter_input(INPUT_POST, 'arrival_airport', FILTER_SANITIZE_STRING);
10 10
 	header('Location: '.$globalURL.'/route/'.$departure_airport.'/'.$arrival_airport);
11 11
 } else {
12 12
 	if ($globalURL == '') {
Please login to merge, or discard this patch.
country-detailed.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -3,17 +3,17 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 
6
-if (!isset($_GET['country'])){
6
+if (!isset($_GET['country'])) {
7 7
 	header('Location: '.$globalURL.'');
8 8
 } else {
9 9
 	$Spotter = new Spotter();
10 10
 	//calculuation for the pagination
11
-	if(!isset($_GET['limit']))
11
+	if (!isset($_GET['limit']))
12 12
 	{
13 13
 		$limit_start = 0;
14 14
 		$limit_end = 25;
15 15
 		$absolute_difference = 25;
16
-	}  else {
16
+	} else {
17 17
 		$limit_explode = explode(",", $_GET['limit']);
18 18
 		if (isset($limit_explode[1])) {
19 19
 			$limit_start = $limit_explode[0];
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
 	$limit_previous_1 = $limit_start - $absolute_difference;
33 33
 	$limit_previous_2 = $limit_end - $absolute_difference;
34 34
 	
35
-	$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))));
35
+	$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING))));
36 36
 	
37 37
 	$page_url = $globalURL.'/country/'.$_GET['country'];
38
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
38
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
39 39
 	if ($country == 'Na') {
40 40
 		$spotter_array = array();
41 41
 	} else {
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
 	if (!empty($spotter_array))
50 50
 	{
51
-		$title = sprintf(_("Detailed View for Airports &amp; Airlines from %s"),$country);
51
+		$title = sprintf(_("Detailed View for Airports &amp; Airlines from %s"), $country);
52 52
 
53 53
 		require_once('header.php');
54 54
 		print '<div class="select-item">';
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
 		print '<select name="country" class="selectpicker" data-live-search="true">';
57 57
 		print '<option></option>';
58 58
 		$all_countries = $Spotter->getAllCountries();
59
-		foreach($all_countries as $all_country)
59
+		foreach ($all_countries as $all_country)
60 60
 		{
61
-			if($country == $all_country['country'])
61
+			if ($country == $all_country['country'])
62 62
 			{
63 63
 				print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>';
64 64
 			} else {
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 		if ($_GET['country'] != "NA")
74 74
 		{
75 75
 			print '<div class="info column">';
76
-			print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"),$country).'</h1>';
76
+			print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"), $country).'</h1>';
77 77
 			print '</div>';
78 78
 		} else {
79 79
 			print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>';
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
 		include('country-sub-menu.php');
83 83
 		print '<div class="table column">';
84
-		print '<p>'.sprintf(_("The table below shows the detailed information of all flights of airports (both departure &amp; arrival) OR airlines from <strong>%s</strong>."),$country).'</p>';
84
+		print '<p>'.sprintf(_("The table below shows the detailed information of all flights of airports (both departure &amp; arrival) OR airlines from <strong>%s</strong>."), $country).'</p>';
85 85
 
86 86
 		include('table-output.php');
87 87
 		print '<div class="pagination">';
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 		$limit_start = 0;
14 14
 		$limit_end = 25;
15 15
 		$absolute_difference = 25;
16
-	}  else {
16
+	} else {
17 17
 		$limit_explode = explode(",", $_GET['limit']);
18 18
 		if (isset($limit_explode[1])) {
19 19
 			$limit_start = $limit_explode[0];
Please login to merge, or discard this patch.
search-kml.php 2 patches
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  discard block
 block discarded – undo
5 5
 $Spotter = new Spotter();
6 6
 if (isset($_GET['start_date'])) {
7 7
 	//for the date manipulation into the query
8
-	if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
8
+	if ($_GET['start_date'] != "" && $_GET['end_date'] != "") {
9 9
 		$start_date = $_GET['start_date'].":00";
10 10
 		$end_date = $_GET['end_date'].":00";
11 11
 		$sql_date = $start_date.",".$end_date;
12
-	} else if($_GET['start_date'] != ""){
12
+	} else if ($_GET['start_date'] != "") {
13 13
 		$start_date = $_GET['start_date'].":00";
14 14
 		$sql_date = $start_date;
15
-	} else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
15
+	} else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") {
16 16
 		$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17 17
 		$sql_date = $end_date;
18 18
 	} else $sql_date = '';
@@ -20,38 +20,38 @@  discard block
 block discarded – undo
20 20
 
21 21
 if (isset($_GET['highest_altitude'])) {
22 22
 	//for altitude manipulation
23
-	if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
24
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
25
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT);
23
+	if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
24
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
25
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT);
26 26
 		$sql_altitude = $start_altitude.",".$end_altitude;
27
-	} else if($_GET['highest_altitude'] != ""){
28
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
27
+	} else if ($_GET['highest_altitude'] != "") {
28
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
29 29
 		$sql_altitude = $end_altitude;
30
-	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
30
+	} else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
31
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000";
32 32
 		$sql_altitude = $start_altitude;
33 33
 	} else $sql_altitude = '';
34 34
 } else $sql_altitude = '';
35 35
 
36 36
 //calculuation for the pagination
37
-if(!isset($_GET['limit']))
37
+if (!isset($_GET['limit']))
38 38
 {
39 39
 	if (!isset($_GET['number_results'])) {
40 40
 		$limit_start = 0;
41 41
 		$limit_end = 25;
42 42
 		$absolute_difference = 25;
43 43
 	} else {
44
-		if ($_GET['number_results'] > 1000){
44
+		if ($_GET['number_results'] > 1000) {
45 45
 			$_GET['number_results'] = 1000;
46 46
 		}
47 47
 		$limit_start = 0;
48
-		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
49
-		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
48
+		$limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
49
+		$absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
50 50
 	}
51
-}  else {
51
+} else {
52 52
 	$limit_explode = explode(",", $_GET['limit']);
53
-	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
54
-	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
53
+	$limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT);
54
+	$limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT);
55 55
 }
56 56
 
57 57
 $absolute_difference = abs($limit_start - $limit_end);
@@ -68,23 +68,23 @@  discard block
 block discarded – undo
68 68
 
69 69
 if (isset($_GET['sort'])) $sort = $_GET['sort'];
70 70
 else $sort = '';
71
-$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
72
-$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
73
-$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
74
-$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING);
75
-$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING);
76
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
77
-$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING);
78
-$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING);
79
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
80
-$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING);
81
-$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING);
82
-$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
83
-$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING);
84
-$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING);
85
-$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING);
86
-$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING);
87
-$spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'');
71
+$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
72
+$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING);
73
+$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
74
+$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
75
+$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
76
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
77
+$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
78
+$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
79
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
80
+$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
81
+$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
82
+$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
83
+$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
84
+$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
85
+$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
86
+$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
87
+$spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, '');
88 88
 
89 89
 $output = '<?xml version="1.0" encoding="UTF-8"?>';
90 90
 $output .= '<kml xmlns="http://www.opengis.net/kml/2.2">';
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 $output .= '</Style>';
113 113
 
114 114
 if (!empty($spotter_array)) {
115
-	foreach($spotter_array as $spotter_item) {
115
+	foreach ($spotter_array as $spotter_item) {
116 116
 		$altitude = $spotter_item['altitude'].'00';
117 117
 		if ($spotter_item['waypoints'] != '') {
118 118
 			//waypoint plotting
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 			$waypoint_pieces = explode(' ', $spotter_item['waypoints']);
124 124
 			$waypoint_pieces = array_chunk($waypoint_pieces, 2);
125 125
 			foreach ($waypoint_pieces as $waypoint_coordinate) {
126
-				if (isset($waypoint_coordinate[1])) $output .=  $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' ';
126
+				if (isset($waypoint_coordinate[1])) $output .= $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' ';
127 127
 			}
128 128
 			$output .= '</coordinates>';
129 129
 			$output .= '<altitudeMode>absolute</altitudeMode>';
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		$output .= ' ]]></description>';
168 168
 		$output .= '<styleUrl>#departureAirport</styleUrl>';
169 169
 		$output .= '<Point>';
170
-		$output .=  '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>';
170
+		$output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>';
171 171
 		$output .= '<altitudeMode>absolute</altitudeMode>';
172 172
 		$output .= '</Point>';
173 173
 		$output .= '</Placemark>'; 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 		$output .= ' ]]></description>';
209 209
 		$output .= '<styleUrl>#arrivalAirport</styleUrl>';
210 210
 		$output .= '<Point>';
211
-		$output .=  '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>';
211
+		$output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>';
212 212
 		$output .= '<altitudeMode>absolute</altitudeMode>';
213 213
 		$output .= '</Point>';
214 214
 		$output .= '</Placemark>'; 
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 		$output .= ' ]]></description>';
253 253
 		$output .= '<styleUrl>#aircraft_'.$spotter_item['spotter_id'].'</styleUrl>';
254 254
 		$output .= '<Point>';
255
-		$output .=  '<coordinates>'.$spotter_item['longitude'].', '.$spotter_item['latitude'].', '.$altitude.'</coordinates>';
255
+		$output .= '<coordinates>'.$spotter_item['longitude'].', '.$spotter_item['latitude'].', '.$altitude.'</coordinates>';
256 256
 		$output .= '<altitudeMode>absolute</altitudeMode>';
257 257
 		$output .= '</Point>';
258 258
 		$output .= '</Placemark>'; 
Please login to merge, or discard this patch.
Braces   +21 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,8 +15,12 @@  discard block
 block discarded – undo
15 15
 	} else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16 16
 		$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17 17
 		$sql_date = $end_date;
18
-	} else $sql_date = '';
19
-} else $sql_date = '';
18
+	} else {
19
+		$sql_date = '';
20
+	}
21
+	} else {
22
+	$sql_date = '';
23
+}
20 24
 
21 25
 if (isset($_GET['highest_altitude'])) {
22 26
 	//for altitude manipulation
@@ -30,8 +34,12 @@  discard block
 block discarded – undo
30 34
 	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31 35
 		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
32 36
 		$sql_altitude = $start_altitude;
33
-	} else $sql_altitude = '';
34
-} else $sql_altitude = '';
37
+	} else {
38
+		$sql_altitude = '';
39
+	}
40
+	} else {
41
+	$sql_altitude = '';
42
+}
35 43
 
36 44
 //calculuation for the pagination
37 45
 if(!isset($_GET['limit']))
@@ -48,7 +56,7 @@  discard block
 block discarded – undo
48 56
 		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
49 57
 		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
50 58
 	}
51
-}  else {
59
+} else {
52 60
 	$limit_explode = explode(",", $_GET['limit']);
53 61
 	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
54 62
 	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
@@ -66,8 +74,11 @@  discard block
 block discarded – undo
66 74
 
67 75
 header('Content-Type: text/xml');
68 76
 
69
-if (isset($_GET['sort'])) $sort = $_GET['sort'];
70
-else $sort = '';
77
+if (isset($_GET['sort'])) {
78
+	$sort = $_GET['sort'];
79
+} else {
80
+	$sort = '';
81
+}
71 82
 $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
72 83
 $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
73 84
 $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
@@ -123,7 +134,9 @@  discard block
 block discarded – undo
123 134
 			$waypoint_pieces = explode(' ', $spotter_item['waypoints']);
124 135
 			$waypoint_pieces = array_chunk($waypoint_pieces, 2);
125 136
 			foreach ($waypoint_pieces as $waypoint_coordinate) {
126
-				if (isset($waypoint_coordinate[1])) $output .=  $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' ';
137
+				if (isset($waypoint_coordinate[1])) {
138
+					$output .=  $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' ';
139
+				}
127 140
 			}
128 141
 			$output .= '</coordinates>';
129 142
 			$output .= '<altitudeMode>absolute</altitudeMode>';
Please login to merge, or discard this patch.
live-czml.php 3 patches
Braces   +119 added lines, -43 removed lines patch added patch discarded remove patch
@@ -8,8 +8,12 @@  discard block
 block discarded – undo
8 8
 }
9 9
 $tracker = false;
10 10
 $marine = false;
11
-if (isset($_GET['tracker'])) $tracker = true;
12
-if (isset($_GET['marine'])) $marine = true;
11
+if (isset($_GET['tracker'])) {
12
+	$tracker = true;
13
+}
14
+if (isset($_GET['marine'])) {
15
+	$marine = true;
16
+}
13 17
 if ($tracker) {
14 18
 	require_once('require/class.Tracker.php');
15 19
 	require_once('require/class.TrackerLive.php');
@@ -66,24 +70,49 @@  discard block
 block discarded – undo
66 70
 }
67 71
 header('Content-Type: text/javascript');
68 72
 
69
-if (!isset($globalJsonCompress)) $compress = true;
70
-else $compress = $globalJsonCompress;
73
+if (!isset($globalJsonCompress)) {
74
+	$compress = true;
75
+} else {
76
+	$compress = $globalJsonCompress;
77
+}
71 78
 
72 79
 $from_archive = false;
73 80
 $min = false;
74 81
 $allhistory = false;
75 82
 $filter['source'] = array();
76
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
77
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
78
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
79
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
80
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
81
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
82
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
83
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
84
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
85
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
86
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
83
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') {
84
+	$filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
85
+}
86
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') {
87
+	$filter['source'] = array_merge($filter['source'],array('whazzup'));
88
+}
89
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') {
90
+	$filter['source'] = array_merge($filter['source'],array('phpvmacars'));
91
+}
92
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') {
93
+	$filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
94
+}
95
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') {
96
+	$filter['source'] = array_merge($filter['source'],array('aprs'));
97
+}
98
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') {
99
+	$filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
100
+}
101
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') {
102
+	$filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
103
+}
104
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') {
105
+	$filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
106
+}
107
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') {
108
+	$filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
109
+}
110
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') {
111
+	$filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
112
+}
113
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') {
114
+	$filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
115
+}
87 116
 /*
88 117
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
89 118
 	$min = true;
@@ -180,8 +209,12 @@  discard block
 block discarded – undo
180 209
 	} else {
181 210
 		$flightcnt = $SpotterLive->getLiveSpotterCount($filter);
182 211
 	}
183
-	if ($flightcnt == '') $flightcnt = 0;
184
-} else $flightcnt = 0;
212
+	if ($flightcnt == '') {
213
+		$flightcnt = 0;
214
+	}
215
+	} else {
216
+	$flightcnt = 0;
217
+}
185 218
 
186 219
 $sqltime = round(microtime(true)-$begintime,2);
187 220
 $minitime = time();
@@ -217,7 +250,9 @@  discard block
 block discarded – undo
217 250
 $prev_flightaware_id = '';
218 251
 $speed = 1;
219 252
 $gltf2 = false;
220
-if (isset($archivespeed)) $speed = $archivespeed;
253
+if (isset($archivespeed)) {
254
+	$speed = $archivespeed;
255
+}
221 256
 $output = '[';
222 257
 if ($tracker) {
223 258
 	$output .= '{"id" : "document", "name" : "tracker","version" : "1.0"';
@@ -253,9 +288,13 @@  discard block
 block discarded – undo
253 288
 			$image = "images/placeholder_thumb.png";
254 289
 		}
255 290
 
256
-                if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id'];
257
-                elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid'];
258
-                elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id'];
291
+                if (isset($spotter_item['flightaware_id'])) {
292
+                	$id = $spotter_item['flightaware_id'];
293
+                } elseif (isset($spotter_item['famtrackid'])) {
294
+                	$id = $spotter_item['famtrackid'];
295
+                } elseif (isset($spotter_item['fammarine_id'])) {
296
+                	$id = $spotter_item['fammarine_id'];
297
+                }
259 298
                 if ($prev_flightaware_id != $id) {
260 299
 			if ($prev_flightaware_id != '') {
261 300
 				/*
@@ -303,7 +342,9 @@  discard block
 block discarded – undo
303 342
 							}
304 343
 						}
305 344
 					}
306
-					if ($ident != '') $output.= '"ident": "'.$ident.'",';
345
+					if ($ident != '') {
346
+						$output.= '"ident": "'.$ident.'",';
347
+					}
307 348
 				}
308 349
 				$output.= '"gltf2": %gltf2%,';
309 350
 				$output.= '"type": "flight"';
@@ -335,7 +376,9 @@  discard block
 block discarded – undo
335 376
 							$spotter_item['engine_type'] = $aircraft_info[0]['engine_type'];
336 377
 							$spotter_item['wake_category'] = $aircraft_info[0]['wake_category'];
337 378
 							$spotter_item['engine_count'] = $aircraft_info[0]['engine_count'];
338
-						} else $aircraft_shadow = '';
379
+						} else {
380
+							$aircraft_shadow = '';
381
+						}
339 382
 	    					$output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5';
340 383
 						if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
341 384
 							$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
@@ -343,7 +386,9 @@  discard block
 block discarded – undo
343 386
 						}
344 387
 						$output .= '},';
345 388
 					}
346
-				} else $output .= ' "billboard" : {"image" : "data:image/png;base64,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","scale" : 0.5},';
389
+				} else {
390
+					$output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAA7VJREFUeNrEl2uIlWUQx39nXUu0m2uQbZYrbabdLKMs/VBkmHQjioqFIhBS+hKEQpQRgVAf2u5RQkGBRUllRH4I2e5ZUBJlEZVt5i0tTfHStrZ6fn35L70d9n7Obg88vOedmWfmf2bmmZkXlRrtq9V16mZ1iVqqhd5agXvQf1c5zw/V8dXqrqO6dQKwBrgdWApsCb0VqAc2AnOrMVANwIsD4BLgTOBPYB2wHJgEzAG+ANqAu4ZsZYiuX5QwfqI2hvaNulA9J7zLQn8o76vUuuHOwXHqSzH4aIF+TWjnBkSH+nCBf716SP1KPWO4AJ6ltgfIjRW8p9U/1KPz/ry6RT2mIDNF3Zjz19Ya4G1R/J16dgWvQd2pPlXhMdVZPUTgxfCW1wJgXUJpQlvfg8zs8K8r0Caom9QHetG7NGfa1ElDBThRXRtFd/Qh16puKIS3e7+clBjdy7kL1b3q4fzJQQGck5z6Nb97kxujblWf64HXov7Vl/E4YXWccP9AAd6dAx+ox/WTArNzY1t64B0f8K0DyLXuUvRGZfcpCo1VX4tg6wB76WMB0dALf526foAX8cqUot2pGP8B2Kz+krBeNYjS8636dh/8Beo2deoA9TWp76pd6g0q9cDNwKvAD8A84EfglLRBe2g+JWAfcEF68bPABOCoAl/gIPA5MA64FVgGnNhP292W3r0SeB1YVlJXAjcBP8XwyQUj9AKwAzg2+/fQSsBhoJxBAaALaIzenZGnD911wA7gEDAD2FFSpwOzgDHZ5T7+ZSlGd2d6AXgi5+qAn+O5U0PbBVwKtAD3AHuB8f3YGBUdncCGoQ4LE9XtGRqK9LnduVPRIu2BPqwD65IYbS7Qpql7Ql9YoJcy9bwzkgPrfOCj5G33+h54E/g0PAr5thq4ApgyEgNrc27aWwVaPTA1QJ4BjgTGFvhteV40EgPrgvTP7qlmZqFnl9WD+b2posN83E/NrEkOjlI/U1fkfUYa/pe5IE3qZPW8jFOqiyN7p3pAPX04c7AxYSoDDcAjKT2LgLXA6IR2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 0.5},';
391
+				}
347 392
 			} elseif ($one3dmodel) {
348 393
 				if (isset($globalMap3DForceModel) && $globalMap3DForceModel != '') {
349 394
 					$output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$globalMap3DForceModel.'","scale" : 1.0,"minimumPixelSize": 20';
@@ -383,7 +428,9 @@  discard block
 block discarded – undo
383 428
 							$spotter_item['engine_type'] = $aircraft_info[0]['engine_type'];
384 429
 							$spotter_item['wake_category'] = $aircraft_info[0]['wake_category'];
385 430
 							$spotter_item['engine_count'] = $aircraft_info[0]['engine_count'];
386
-						} else $aircraft_shadow = '';
431
+						} else {
432
+							$aircraft_shadow = '';
433
+						}
387 434
 						if ($aircraft_shadow != '') {
388 435
 							if (isset($modelsdb[$aircraft_shadow])) {
389 436
 								$output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_shadow].'","scale" : 1.0,"minimumPixelSize": 20';
@@ -520,7 +567,9 @@  discard block
 block discarded – undo
520 567
 								}
521 568
 								$output .= '},';
522 569
 								//if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
523
-								if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
570
+								if ($spotter_item['aircraft_icao'] != '') {
571
+									$output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
572
+								}
524 573
 								$modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
525 574
 							}
526 575
 						} elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') {
@@ -542,7 +591,9 @@  discard block
 block discarded – undo
542 591
 							}
543 592
 							$output .= '},';
544 593
 							//if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
545
-							if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
594
+							if ($spotter_item['aircraft_icao'] != '') {
595
+								$output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
596
+							}
546 597
 							$modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
547 598
 						}
548 599
 					} else {
@@ -555,7 +606,9 @@  discard block
 block discarded – undo
555 606
 						}
556 607
 						$output .= '},';
557 608
 						//if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
558
-						if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
609
+						if ($spotter_item['aircraft_icao'] != '') {
610
+							$output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
611
+						}
559 612
 						$modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
560 613
 					}
561 614
 				} elseif ($tracker && isset($spotter_item['type'])) {
@@ -659,8 +712,11 @@  discard block
 block discarded – undo
659 712
 					$output .= '},';
660 713
 				}
661 714
 			}
662
-			if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output);
663
-			else $output = str_replace('%onground%','false',$output);
715
+			if (isset($onground) && $onground) {
716
+				$output = str_replace('%onground%','true',$output);
717
+			} else {
718
+				$output = str_replace('%onground%','false',$output);
719
+			}
664 720
 
665 721
 	//		$output .= '"heightReference": "CLAMP_TO_GROUND",';
666 722
 			//$output .= '"heightReference": "'.$heightrelative.'",';
@@ -673,8 +729,12 @@  discard block
 block discarded – undo
673 729
 	//		$output .= '"interpolationDegree" : 5,';
674 730
 	//		$output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", ';
675 731
 			$output .= '"cartographicDegrees": [';
676
-			if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']);
677
-			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
732
+			if ($minitime > strtotime($spotter_item['date'])) {
733
+				$minitime = strtotime($spotter_item['date']);
734
+			}
735
+			if ($maxitime < strtotime($spotter_item['date'])) {
736
+				$maxitime = strtotime($spotter_item['date']);
737
+			}
678 738
 			$output .= '"'.date("c",strtotime($spotter_item['date'])).'", ';
679 739
 			$output .= $spotter_item['longitude'].', ';
680 740
 			$output .= $spotter_item['latitude'];
@@ -697,7 +757,9 @@  discard block
 block discarded – undo
697 757
 					$output .= ', '.round($spotter_item['altitude']*30.48);
698 758
 					$prevalt = round($spotter_item['altitude']*30.48);
699 759
 				}
700
-			} else $output .= ', 0';
760
+			} else {
761
+				$output .= ', 0';
762
+			}
701 763
 			//$orientation = '"orientation" : { ';
702 764
 			//$orientation .= '"unitQuaternion": [';
703 765
 			//$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0));
@@ -705,13 +767,18 @@  discard block
 block discarded – undo
705 767
 		} else {
706 768
 			$nblatlong = $nblatlong+1;
707 769
 			$output .= ',"'.date("c",strtotime($spotter_item['date'])).'", ';
708
-			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
770
+			if ($maxitime < strtotime($spotter_item['date'])) {
771
+				$maxitime = strtotime($spotter_item['date']);
772
+			}
709 773
 			if ($spotter_item['ground_speed'] == 0) {
710 774
 				$output .= $prevlong.', ';
711 775
 				$output .= $prevlat;
712 776
 				//if (!$marine && (!isset($onground) || !$onground)) $output .= ', '.$prevalt;
713
-				if (!$marine) $output .= ', '.$prevalt;
714
-				else $output .= ', 0';
777
+				if (!$marine) {
778
+					$output .= ', '.$prevalt;
779
+				} else {
780
+					$output .= ', 0';
781
+				}
715 782
 			} else {
716 783
 				$output .= $spotter_item['longitude'].', ';
717 784
 				$output .= $spotter_item['latitude'];
@@ -724,14 +791,17 @@  discard block
 block discarded – undo
724 791
 							$output .= ', 0';
725 792
 						}
726 793
 					} else {
727
-						if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') $output .= ', '.round($spotter_item['real_altitude']*0.3048);
728
-						elseif ($tracker) {
794
+						if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') {
795
+							$output .= ', '.round($spotter_item['real_altitude']*0.3048);
796
+						} elseif ($tracker) {
729 797
 							$output .= ', '.round($spotter_item['altitude']*0.3048);
730 798
 						} else {
731 799
 							$output .= ', '.round($spotter_item['altitude']*30.48);
732 800
 						}
733 801
 					}
734
-				} else $output .= ', 0';
802
+				} else {
803
+					$output .= ', 0';
804
+				}
735 805
 			}
736 806
 			//$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0));
737 807
 			//$orientation .= ',"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w'];
@@ -750,11 +820,17 @@  discard block
 block discarded – undo
750 820
 		} else {
751 821
 			$output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output);
752 822
 		}
823
+	} else {
824
+		$output = str_replace('%minitime%',date("c",$minitime),$output);
753 825
 	}
754
-	else $output = str_replace('%minitime%',date("c",$minitime),$output);
755
-} else $output = str_replace('%minitime%',date("c",$minitime),$output);
826
+	} else {
827
+	$output = str_replace('%minitime%',date("c",$minitime),$output);
828
+}
756 829
 $output = str_replace('%maxitime%',date("c",$maxitime),$output);
757
-if ($gltf2) $output = str_replace('%gltf2%','true',$output);
758
-else $output = str_replace('%gltf2%','false',$output);
830
+if ($gltf2) {
831
+	$output = str_replace('%gltf2%','true',$output);
832
+} else {
833
+	$output = str_replace('%gltf2%','false',$output);
834
+}
759 835
 print $output;
760 836
 ?>
Please login to merge, or discard this patch.
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -39,30 +39,30 @@  discard block
 block discarded – undo
39 39
 
40 40
 
41 41
 function quaternionrotate($heading, $attitude = 0, $bank = 0) {
42
-    // Assuming the angles are in radians.
43
-    $c1 = cos($heading/2);
44
-    $s1 = sin($heading/2);
45
-    $c2 = cos($attitude/2);
46
-    $s2 = sin($attitude/2);
47
-    $c3 = cos($bank/2);
48
-    $s3 = sin($bank/2);
49
-    $c1c2 = $c1*$c2;
50
-    $s1s2 = $s1*$s2;
51
-    $w =$c1c2*$c3 - $s1s2*$s3;
52
-    $x =$c1c2*$s3 + $s1s2*$c3;
53
-    $y =$s1*$c2*$c3 + $c1*$s2*$s3;
54
-    $z =$c1*$s2*$c3 - $s1*$c2*$s3;
55
-    return array('x' => $x,'y' => $y,'z' => $z,'w' => $w);
42
+	// Assuming the angles are in radians.
43
+	$c1 = cos($heading/2);
44
+	$s1 = sin($heading/2);
45
+	$c2 = cos($attitude/2);
46
+	$s2 = sin($attitude/2);
47
+	$c3 = cos($bank/2);
48
+	$s3 = sin($bank/2);
49
+	$c1c2 = $c1*$c2;
50
+	$s1s2 = $s1*$s2;
51
+	$w =$c1c2*$c3 - $s1s2*$s3;
52
+	$x =$c1c2*$s3 + $s1s2*$c3;
53
+	$y =$s1*$c2*$c3 + $c1*$s2*$s3;
54
+	$z =$c1*$s2*$c3 - $s1*$c2*$s3;
55
+	return array('x' => $x,'y' => $y,'z' => $z,'w' => $w);
56 56
 //    return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365');
57 57
 
58 58
 }
59 59
 
60 60
 
61 61
 if (isset($_GET['download'])) {
62
-    if ($_GET['download'] == "true")
63
-    {
62
+	if ($_GET['download'] == "true")
63
+	{
64 64
 	header('Content-disposition: attachment; filename="flightairmap.json"');
65
-    }
65
+	}
66 66
 }
67 67
 header('Content-Type: text/javascript');
68 68
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	if (isset($_GET['coord']) && $_GET['coord'] != '') {
156 156
 		$coord = explode(',',$_GET['coord']);
157 157
 		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) 
158
-		    && $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)) {
158
+			&& $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)) {
159 159
 			$coord = array();
160 160
 		}
161 161
 	}
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	if (isset($_GET['coord']) && $_GET['coord'] != '') {
166 166
 		$coord = explode(',',$_GET['coord']);
167 167
 		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) 
168
-		    && $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)) {
168
+			&& $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)) {
169 169
 			$coord = array();
170 170
 		}
171 171
 	}
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 	if (isset($_GET['coord']) && $_GET['coord'] != '') {
176 176
 		$coord = explode(',',$_GET['coord']);
177 177
 		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) 
178
-		    && $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)) {
178
+			&& $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)) {
179 179
 			$coord = array();
180 180
 		}
181 181
 	}
@@ -265,10 +265,10 @@  discard block
 block discarded – undo
265 265
 			$image = "images/placeholder_thumb.png";
266 266
 		}
267 267
 
268
-                if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id'];
269
-                elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid'];
270
-                elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id'];
271
-                if ($prev_flightaware_id != $id) {
268
+				if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id'];
269
+				elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid'];
270
+				elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id'];
271
+				if ($prev_flightaware_id != $id) {
272 272
 			if ($prev_flightaware_id != '') {
273 273
 				/*
274 274
 				if ($nblatlong == 1) {
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 							$spotter_item['wake_category'] = $aircraft_info[0]['wake_category'];
349 349
 							$spotter_item['engine_count'] = $aircraft_info[0]['engine_count'];
350 350
 						} else $aircraft_shadow = '';
351
-	    					$output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5';
351
+							$output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5';
352 352
 						if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
353 353
 							$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
354 354
 							$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 							$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
380 380
 							$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
381 381
 						}
382
-    						$output .= '},';
382
+							$output .= '},';
383 383
 					} elseif (isset($modelsdb[$aircraft_icao]) && $aircraft_icao != '') {
384 384
 						$output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_icao].'","scale" : 1.0,"minimumPixelSize": 20';
385 385
 						$output .= ',"heightReference": "'.$heightrelative.'"';
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 							$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
388 388
 							$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
389 389
 						}
390
-    						$output .= '},';
390
+							$output .= '},';
391 391
 					} elseif ($aircraft_icao != '') {
392 392
 						$aircraft_info = $Spotter->getAllAircraftInfo($aircraft_icao);
393 393
 						if (isset($aircraft_info[0]['engine_type'])) {
Please login to merge, or discard this patch.
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
     $s3 = sin($bank/2);
49 49
     $c1c2 = $c1*$c2;
50 50
     $s1s2 = $s1*$s2;
51
-    $w =$c1c2*$c3 - $s1s2*$s3;
52
-    $x =$c1c2*$s3 + $s1s2*$c3;
53
-    $y =$s1*$c2*$c3 + $c1*$s2*$s3;
54
-    $z =$c1*$s2*$c3 - $s1*$c2*$s3;
55
-    return array('x' => $x,'y' => $y,'z' => $z,'w' => $w);
51
+    $w = $c1c2*$c3 - $s1s2*$s3;
52
+    $x = $c1c2*$s3 + $s1s2*$c3;
53
+    $y = $s1*$c2*$c3 + $c1*$s2*$s3;
54
+    $z = $c1*$s2*$c3 - $s1*$c2*$s3;
55
+    return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w);
56 56
 //    return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365');
57 57
 
58 58
 }
@@ -73,17 +73,17 @@  discard block
 block discarded – undo
73 73
 $min = false;
74 74
 $allhistory = false;
75 75
 $filter['source'] = array();
76
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
77
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
78
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
79
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
80
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
81
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
82
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
83
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
84
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
85
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
86
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
76
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt'));
77
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup'));
78
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars'));
79
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs'));
80
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs'));
81
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING);
82
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING);
83
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING);
84
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING);
85
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING);
86
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING);
87 87
 /*
88 88
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
89 89
 	$min = true;
@@ -130,12 +130,12 @@  discard block
 block discarded – undo
130 130
 	$from_archive = true;
131 131
 //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
132 132
 //	$enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
133
-	$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
134
-	$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
135
-	$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
136
-	$begindate = date('Y-m-d H:i:s',$begindate);
137
-	$enddate = date('Y-m-d H:i:s',$enddate);
138
-	$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter);
133
+	$begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT);
134
+	$enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT);
135
+	$archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT);
136
+	$begindate = date('Y-m-d H:i:s', $begindate);
137
+	$enddate = date('Y-m-d H:i:s', $enddate);
138
+	$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter);
139 139
 } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) {
140 140
 	$from_archive = true;
141 141
 //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
@@ -145,46 +145,46 @@  discard block
 block discarded – undo
145 145
 	$begindate = $_COOKIE['archive_begin'];
146 146
 	$enddate = $_COOKIE['archive_end'];
147 147
 
148
-	$archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT);
149
-	$begindate = date('Y-m-d H:i:s',$begindate);
150
-	$enddate = date('Y-m-d H:i:s',$enddate);
148
+	$archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT);
149
+	$begindate = date('Y-m-d H:i:s', $begindate);
150
+	$enddate = date('Y-m-d H:i:s', $enddate);
151 151
 //	echo 'Begin : '.$begindate.' - End : '.$enddate."\n";
152
-	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
152
+	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter);
153 153
 } elseif ($tracker) {
154 154
 	$coord = array();
155 155
 	if (isset($_GET['coord']) && $_GET['coord'] != '') {
156
-		$coord = explode(',',$_GET['coord']);
157
-		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) 
156
+		$coord = explode(',', $_GET['coord']);
157
+		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) 
158 158
 		    && $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)) {
159 159
 			$coord = array();
160 160
 		}
161 161
 	}
162
-	$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true);
162
+	$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, true);
163 163
 } elseif ($marine) {
164 164
 	$coord = array();
165 165
 	if (isset($_GET['coord']) && $_GET['coord'] != '') {
166
-		$coord = explode(',',$_GET['coord']);
167
-		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) 
166
+		$coord = explode(',', $_GET['coord']);
167
+		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) 
168 168
 		    && $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)) {
169 169
 			$coord = array();
170 170
 		}
171 171
 	}
172
-	$spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,true);
172
+	$spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, true);
173 173
 } else {
174 174
 	$coord = array();
175 175
 	if (isset($_GET['coord']) && $_GET['coord'] != '') {
176
-		$coord = explode(',',$_GET['coord']);
177
-		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) 
176
+		$coord = explode(',', $_GET['coord']);
177
+		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) 
178 178
 		    && $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)) {
179 179
 			$coord = array();
180 180
 		}
181 181
 	}
182
-	$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true);
182
+	$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true);
183 183
 }
184 184
 //print_r($spotter_array);
185 185
 if (!empty($spotter_array) && isset($coord)) {
186 186
 	if (isset($_GET['archive'])) {
187
-		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);
187
+		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter);
188 188
 	} elseif ($tracker) {
189 189
 		$flightcnt = $TrackerLive->getLiveTrackerCount($filter);
190 190
 	} elseif ($marine) {
@@ -195,15 +195,15 @@  discard block
 block discarded – undo
195 195
 	if ($flightcnt == '') $flightcnt = 0;
196 196
 } else $flightcnt = 0;
197 197
 
198
-$sqltime = round(microtime(true)-$begintime,2);
198
+$sqltime = round(microtime(true) - $begintime, 2);
199 199
 $minitime = time();
200 200
 $maxitime = 0;
201
-$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT);
201
+$lastupdate = filter_input(INPUT_GET, 'update', FILTER_SANITIZE_NUMBER_INT);
202 202
 $modelsdb = array();
203 203
 if (file_exists(dirname(__FILE__).'/models/modelsdb')) {
204
-	if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) {
205
-		while (($row = fgetcsv($handle,1000)) !== FALSE) {
206
-			if (isset($row[1]) ){
204
+	if (($handle = fopen(dirname(__FILE__).'/models/modelsdb', 'r')) !== FALSE) {
205
+		while (($row = fgetcsv($handle, 1000)) !== FALSE) {
206
+			if (isset($row[1])) {
207 207
 				$model = $row[0];
208 208
 				$modelsdb[$model] = $row[1];
209 209
 			}
@@ -213,9 +213,9 @@  discard block
 block discarded – undo
213 213
 }
214 214
 $modelsdb2 = array();
215 215
 if (file_exists(dirname(__FILE__).'/models/gltf2/modelsdb')) {
216
-	if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb','r')) !== FALSE) {
217
-		while (($row = fgetcsv($handle,1000)) !== FALSE) {
218
-			if (isset($row[1]) ){
216
+	if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb', 'r')) !== FALSE) {
217
+		while (($row = fgetcsv($handle, 1000)) !== FALSE) {
218
+			if (isset($row[1])) {
219 219
 				$model = $row[0];
220 220
 				$modelsdb2[$model] = $row[1];
221 221
 			}
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 if (!empty($spotter_array) && is_array($spotter_array))
254 254
 {
255 255
 	$nblatlong = 0;
256
-	foreach($spotter_array as $spotter_item)
256
+	foreach ($spotter_array as $spotter_item)
257 257
 	{
258 258
 		$j++;
259 259
 		//if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND';
@@ -295,9 +295,9 @@  discard block
 block discarded – undo
295 295
 			$output .= '"lastupdate": "'.$lastupdate.'",';
296 296
 			$output .= '"format": "'.$spotter_item['format_source'].'",';
297 297
 			if ($tracker) {
298
-				$output.= '"type": "tracker"';
298
+				$output .= '"type": "tracker"';
299 299
 			} elseif ($marine) {
300
-				$output.= '"type": "marine"';
300
+				$output .= '"type": "marine"';
301 301
 			} else {
302 302
 				if (isset($globalMap3DLiveries) && $globalMap3DLiveries) {
303 303
 					$aircraft_icao = $spotter_item['aircraft_icao'];
@@ -311,14 +311,14 @@  discard block
 block discarded – undo
311 311
 						if (isset($airline_icao)) {
312 312
 							$imagefile = $aircraft_icao.'-'.$airline_icao.'.png';
313 313
 							if (file_exists(dirname(__FILE__).'/models/gltf2/liveries/'.$imagefile)) {
314
-								$output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",';
314
+								$output .= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",';
315 315
 							}
316 316
 						}
317 317
 					}
318
-					if ($ident != '') $output.= '"ident": "'.$ident.'",';
318
+					if ($ident != '') $output .= '"ident": "'.$ident.'",';
319 319
 				}
320
-				$output.= '"gltf2": %gltf2%,';
321
-				$output.= '"type": "flight"';
320
+				$output .= '"gltf2": %gltf2%,';
321
+				$output .= '"type": "flight"';
322 322
 			}
323 323
 			$output .= '},';
324 324
 
@@ -671,8 +671,8 @@  discard block
 block discarded – undo
671 671
 					$output .= '},';
672 672
 				}
673 673
 			}
674
-			if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output);
675
-			else $output = str_replace('%onground%','false',$output);
674
+			if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output);
675
+			else $output = str_replace('%onground%', 'false', $output);
676 676
 
677 677
 	//		$output .= '"heightReference": "CLAMP_TO_GROUND",';
678 678
 			//$output .= '"heightReference": "'.$heightrelative.'",';
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
 			$output .= '"cartographicDegrees": [';
688 688
 			if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']);
689 689
 			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
690
-			$output .= '"'.date("c",strtotime($spotter_item['date'])).'", ';
690
+			$output .= '"'.date("c", strtotime($spotter_item['date'])).'", ';
691 691
 			$output .= $spotter_item['longitude'].', ';
692 692
 			$output .= $spotter_item['latitude'];
693 693
 			$prevlong = $spotter_item['longitude'];
@@ -715,8 +715,8 @@  discard block
 block discarded – undo
715 715
 			//$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0));
716 716
 			//$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w'];
717 717
 		} else {
718
-			$nblatlong = $nblatlong+1;
719
-			$output .= ',"'.date("c",strtotime($spotter_item['date'])).'", ';
718
+			$nblatlong = $nblatlong + 1;
719
+			$output .= ',"'.date("c", strtotime($spotter_item['date'])).'", ';
720 720
 			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
721 721
 			if ($spotter_item['ground_speed'] == 0) {
722 722
 				$output .= $prevlong.', ';
@@ -756,17 +756,17 @@  discard block
 block discarded – undo
756 756
 }
757 757
 $output .= ']';
758 758
 if (isset($globalArchive) && $globalArchive === TRUE) {
759
-	if ((time()-$globalLiveInterval) > $minitime) {
760
-		if (time()-$globalLiveInterval > $maxitime) {
761
-			$output = str_replace('%minitime%',date("c",$maxitime),$output);
759
+	if ((time() - $globalLiveInterval) > $minitime) {
760
+		if (time() - $globalLiveInterval > $maxitime) {
761
+			$output = str_replace('%minitime%', date("c", $maxitime), $output);
762 762
 		} else {
763
-			$output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output);
763
+			$output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output);
764 764
 		}
765 765
 	}
766
-	else $output = str_replace('%minitime%',date("c",$minitime),$output);
767
-} else $output = str_replace('%minitime%',date("c",$minitime),$output);
768
-$output = str_replace('%maxitime%',date("c",$maxitime),$output);
769
-if ($gltf2) $output = str_replace('%gltf2%','true',$output);
770
-else $output = str_replace('%gltf2%','false',$output);
766
+	else $output = str_replace('%minitime%', date("c", $minitime), $output);
767
+} else $output = str_replace('%minitime%', date("c", $minitime), $output);
768
+$output = str_replace('%maxitime%', date("c", $maxitime), $output);
769
+if ($gltf2) $output = str_replace('%gltf2%', 'true', $output);
770
+else $output = str_replace('%gltf2%', 'false', $output);
771 771
 print $output;
772 772
 ?>
Please login to merge, or discard this patch.
live-geojson.php 3 patches
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -5,23 +5,23 @@  discard block
 block discarded – undo
5 5
 $marine = false;
6 6
 $usecoord = false;
7 7
 if (isset($_GET['tracker'])) {
8
-    $tracker = true;
8
+	$tracker = true;
9 9
 }
10 10
 if (isset($_GET['marine'])) {
11
-    $marine = true;
11
+	$marine = true;
12 12
 }
13 13
 if ($tracker) {
14
-    require_once('require/class.Tracker.php');
15
-    require_once('require/class.TrackerLive.php');
16
-    require_once('require/class.TrackerArchive.php');
14
+	require_once('require/class.Tracker.php');
15
+	require_once('require/class.TrackerLive.php');
16
+	require_once('require/class.TrackerArchive.php');
17 17
 } elseif ($marine) {
18
-    require_once('require/class.Marine.php');
19
-    require_once('require/class.MarineLive.php');
20
-    require_once('require/class.MarineArchive.php');
18
+	require_once('require/class.Marine.php');
19
+	require_once('require/class.MarineLive.php');
20
+	require_once('require/class.MarineArchive.php');
21 21
 } else {
22
-    require_once('require/class.Spotter.php');
23
-    require_once('require/class.SpotterLive.php');
24
-    require_once('require/class.SpotterArchive.php');
22
+	require_once('require/class.Spotter.php');
23
+	require_once('require/class.SpotterLive.php');
24
+	require_once('require/class.SpotterArchive.php');
25 25
 }
26 26
 
27 27
 $begintime = microtime(true);
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
 $Common = new Common();
42 42
 
43 43
 if (isset($_GET['download'])) {
44
-    if ($_GET['download'] == "true")
45
-    {
44
+	if ($_GET['download'] == "true")
45
+	{
46 46
 	header('Content-disposition: attachment; filename="flightairmap.json"');
47
-    }
47
+	}
48 48
 }
49 49
 header('Content-Type: text/javascript');
50 50
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	$usecoord = true;
109 109
 	$coord = explode(',',$_GET['coord']);
110 110
 	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) 
111
-	    && $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) {
111
+		&& $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) {
112 112
 		if ($tracker) {
113 113
 			$spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord,$filter);
114 114
 		} elseif ($marine) {
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	$usecoord = true;
122 122
 	$coord = explode(',',$_GET['coord']);
123 123
 	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) 
124
-	    && $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) {
124
+		&& $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) {
125 125
 		if ($tracker) {
126 126
 			$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter);
127 127
 		} elseif ($marine) {
@@ -538,17 +538,17 @@  discard block
 block discarded – undo
538 538
 				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
539 539
 				
540 540
 				if (
541
-				    (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') 
542
-				    || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)
541
+					(isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') 
542
+					|| ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)
543 543
 				//    || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))
544 544
 				//    || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident'])
545
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
546
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])
547
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id']))
548
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])
549
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid']))
550
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])
551
-				    ) {
545
+					|| (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
546
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])
547
+					|| (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id']))
548
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])
549
+					|| (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid']))
550
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])
551
+					) {
552 552
 					if ($tracker) {
553 553
 						if ($from_archive || $globalArchive) {
554 554
 							$spotter_history_array = $TrackerArchive->getAllArchiveTrackerDataById($spotter_item['famtrackid']);
@@ -637,65 +637,65 @@  discard block
 block discarded – undo
637 637
 				}
638 638
 				
639 639
 				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
640
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
641
-				     && (isset($spotter_item['departure_airport']) 
642
-				        && $spotter_item['departure_airport'] != 'NA' 
643
-				        && isset($spotter_item['arrival_airport']) 
644
-				        && $spotter_item['arrival_airport'] != 'NA' 
645
-				        && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") 
646
-				    	    || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) {
647
-				    if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
648
-				    else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
649
-				    if (isset($spotter_item['departure_airport_latitude'])) {
640
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
641
+					 && (isset($spotter_item['departure_airport']) 
642
+						&& $spotter_item['departure_airport'] != 'NA' 
643
+						&& isset($spotter_item['arrival_airport']) 
644
+						&& $spotter_item['arrival_airport'] != 'NA' 
645
+						&& ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") 
646
+							|| (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) {
647
+					if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
648
+					else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
649
+					if (isset($spotter_item['departure_airport_latitude'])) {
650 650
 					$output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],';
651
-				    } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') {
651
+					} elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') {
652 652
 					$dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']);
653 653
 					if (isset($dairport[0]['latitude'])) {
654
-					    $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],';
654
+						$output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],';
655 655
 					}
656
-				    }
657
-				    if (isset($spotter_item['arrival_airport_latitude'])) {
656
+					}
657
+					if (isset($spotter_item['arrival_airport_latitude'])) {
658 658
 					$output_air .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].'],';
659
-				    } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
659
+					} elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
660 660
 					$aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);
661 661
 					if (isset($aairport[0]['latitude'])) {
662
-					    $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],';
662
+						$output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],';
663 663
 					}
664
-				    }
665
-				    $output_air  = substr($output_air, 0, -1);
666
-				    $output_air .= ']}},';
667
-				    $output .= $output_air;
668
-				    unset($output_air);
664
+					}
665
+					$output_air  = substr($output_air, 0, -1);
666
+					$output_air .= ']}},';
667
+					$output .= $output_air;
668
+					unset($output_air);
669 669
 				}
670 670
 
671 671
 				//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))))) {
672 672
 				//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))))) {
673 673
 				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
674
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
675
-				     && (isset($spotter_item['arrival_airport']) 
676
-				        && $spotter_item['arrival_airport'] != 'NA' 
677
-				        && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") 
678
-				    	    || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) 
679
-				    	    || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) {
680
-				    $havedata = false;
681
-				    if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
682
-				    else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
683
-				    $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';
674
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
675
+					 && (isset($spotter_item['arrival_airport']) 
676
+						&& $spotter_item['arrival_airport'] != 'NA' 
677
+						&& ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") 
678
+							|| (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) 
679
+							|| (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) {
680
+					$havedata = false;
681
+					if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
682
+					else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
683
+					$output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';
684 684
 
685
-				    if (isset($spotter_item['arrival_airport_latitude'])) {
685
+					if (isset($spotter_item['arrival_airport_latitude'])) {
686 686
 					$output_dest .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].']';
687 687
 					$havedata = true;
688
-				    } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
688
+					} elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
689 689
 					$aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);
690 690
 					if (isset($aairport[0]['latitude'])) {
691
-					    $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']';
692
-					    $havedata = true;
691
+						$output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']';
692
+						$havedata = true;
693 693
 					}
694
-				    }
695
-				    //$output_dest  = substr($output_dest, 0, -1);
696
-				    $output_dest .= ']}},';
697
-				    if ($havedata) $output .= $output_dest;
698
-				    unset($output_dest);
694
+					}
695
+					//$output_dest  = substr($output_dest, 0, -1);
696
+					$output_dest .= ']}},';
697
+					if ($havedata) $output .= $output_dest;
698
+					unset($output_dest);
699 699
 				}
700 700
 			}
701 701
 			$output  = substr($output, 0, -1);
Please login to merge, or discard this patch.
Braces   +300 added lines, -117 removed lines patch added patch discarded remove patch
@@ -48,28 +48,55 @@  discard block
 block discarded – undo
48 48
 }
49 49
 header('Content-Type: text/javascript');
50 50
 
51
-if (!isset($globalJsonCompress)) $compress = true;
52
-else $compress = $globalJsonCompress;
51
+if (!isset($globalJsonCompress)) {
52
+	$compress = true;
53
+} else {
54
+	$compress = $globalJsonCompress;
55
+}
53 56
 
54 57
 $from_archive = false;
55 58
 $min = true;
56 59
 $allhistory = false;
57 60
 $filter['source'] = array();
58
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
59
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
60
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
61
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
62
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
63
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
64
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
65
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
66
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
67
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
68
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
61
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') {
62
+	$filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
63
+}
64
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') {
65
+	$filter['source'] = array_merge($filter['source'],array('whazzup'));
66
+}
67
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') {
68
+	$filter['source'] = array_merge($filter['source'],array('phpvmacars'));
69
+}
70
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') {
71
+	$filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
72
+}
73
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') {
74
+	$filter['source'] = array_merge($filter['source'],array('aprs'));
75
+}
76
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') {
77
+	$filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
78
+}
79
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') {
80
+	$filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
81
+}
82
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') {
83
+	$filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
84
+}
85
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') {
86
+	$filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
87
+}
88
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') {
89
+	$filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
90
+}
91
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') {
92
+	$filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
93
+}
69 94
 
70 95
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
71 96
 	$min = true;
72
-} else $min = false;
97
+} else {
98
+	$min = false;
99
+}
73 100
 
74 101
 $spotter_array = array();
75 102
 
@@ -171,24 +198,38 @@  discard block
 block discarded – undo
171 198
 			$flightcnt = $SpotterLive->getLiveSpotterCount($filter);
172 199
 		}
173 200
 	}
174
-	if ($flightcnt == '') $flightcnt = 0;
175
-} else $flightcnt = 0;
201
+	if ($flightcnt == '') {
202
+		$flightcnt = 0;
203
+	}
204
+	} else {
205
+	$flightcnt = 0;
206
+}
176 207
 
177 208
 $sqltime = round(microtime(true)-$begintime,2);
178 209
 
179 210
 $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
180
-if ($currenttime != '') $currenttime = round($currenttime/1000);
211
+if ($currenttime != '') {
212
+	$currenttime = round($currenttime/1000);
213
+}
181 214
 
182
-if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false;
183
-else $usenextlatlon = true;
184
-if ($usenextlatlon === false) $currenttime = '';
215
+if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) {
216
+	$usenextlatlon = false;
217
+} else {
218
+	$usenextlatlon = true;
219
+}
220
+if ($usenextlatlon === false) {
221
+	$currenttime = '';
222
+}
185 223
 $j = 0;
186 224
 $prev_flightaware_id = '';
187 225
 $aircrafts_shadow = array();
188 226
 $output = '{';
189 227
 	$output .= '"type": "FeatureCollection",';
190
-		if ($min) $output .= '"minimal": "true",';
191
-		else $output .= '"minimal": "false",';
228
+		if ($min) {
229
+			$output .= '"minimal": "true",';
230
+		} else {
231
+			$output .= '"minimal": "false",';
232
+		}
192 233
 		//$output .= '"fc": "'.$flightcnt.'",';
193 234
 		$output .= '"sqt": "'.$sqltime.'",';
194 235
 
@@ -232,18 +273,29 @@  discard block
 block discarded – undo
232 273
 						}
233 274
 						$output .= '"properties": {';
234 275
 						if (isset($spotter_item['flightaware_id'])) {
235
-							if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",';
236
-							else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",';
276
+							if ($compress) {
277
+								$output .= '"fi": "'.$spotter_item['flightaware_id'].'",';
278
+							} else {
279
+								$output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",';
280
+							}
237 281
 						} elseif (isset($spotter_item['famtrackid'])) {
238
-							if ($compress) $output .= '"fti": "'.$spotter_item['famtrackid'].'",';
239
-							else $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",';
282
+							if ($compress) {
283
+								$output .= '"fti": "'.$spotter_item['famtrackid'].'",';
284
+							} else {
285
+								$output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",';
286
+							}
240 287
 						} elseif (isset($spotter_item['fammarine_id'])) {
241
-							if ($compress) $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",';
242
-							else $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",';
288
+							if ($compress) {
289
+								$output .= '"fmi": "'.$spotter_item['fammarine_id'].'",';
290
+							} else {
291
+								$output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",';
292
+							}
243 293
 						}
244 294
 							$output .= '"fc": "'.$flightcnt.'",';
245 295
 							$output .= '"sqt": "'.$sqltime.'",';
246
-							if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
296
+							if (isset($begindate)) {
297
+								$output .= '"archive_date": "'.$begindate.'",';
298
+							}
247 299
 
248 300
 /*
249 301
 							if ($min) $output .= '"minimal": "true",';
@@ -251,14 +303,22 @@  discard block
 block discarded – undo
251 303
 */
252 304
 							//$output .= '"fc": "'.$spotter_item['nb'].'",';
253 305
 						if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') {
254
-							if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",';
255
-							else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",';
306
+							if ($compress) {
307
+								$output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",';
308
+							} else {
309
+								$output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",';
310
+							}
256 311
 							//"
257 312
 						} else {
258
-							if ($compress) $output .= '"c": "NA",';
259
-							else $output .= '"callsign": "NA",';
313
+							if ($compress) {
314
+								$output .= '"c": "NA",';
315
+							} else {
316
+								$output .= '"callsign": "NA",';
317
+							}
318
+						}
319
+						if (isset($spotter_item['registration'])) {
320
+							$output .= '"registration": "'.$spotter_item['registration'].'",';
260 321
 						}
261
-						if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",';
262 322
 						if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) {
263 323
 							$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",';
264 324
 							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",';
@@ -271,16 +331,23 @@  discard block
 block discarded – undo
271 331
 							$output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
272 332
 						}
273 333
 						if (!isset($spotter_item['aircraft_shadow']) && !$tracker) {
274
-							if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = '';
275
-							else {
334
+							if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') {
335
+								$spotter_item['aircraft_shadow'] = '';
336
+							} else {
276 337
 								$aircraft_icao = $spotter_item['aircraft_icao'];
277
-								if (isset($aircrafts_shadow[$aircraft_icao])) $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao];
278
-								else {
338
+								if (isset($aircrafts_shadow[$aircraft_icao])) {
339
+									$spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao];
340
+								} else {
279 341
 									$aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']);
280
-									if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow'];
281
-									elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png';
282
-									elseif ($aircraft_icao == 'PARAGLIDER') $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png';
283
-									else $spotter_item['aircraft_shadow'] = '';
342
+									if (count($aircraft_info) > 0) {
343
+										$spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow'];
344
+									} elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') {
345
+										$spotter_item['aircraft_shadow'] = 'PA18.png';
346
+									} elseif ($aircraft_icao == 'PARAGLIDER') {
347
+										$spotter_item['aircraft_shadow'] = 'PARAGLIDER.png';
348
+									} else {
349
+										$spotter_item['aircraft_shadow'] = '';
350
+									}
284 351
 									$aircrafts_shadow[$aircraft_icao] = $spotter_item['aircraft_shadow'];
285 352
 								}
286 353
 							}
@@ -288,73 +355,139 @@  discard block
 block discarded – undo
288 355
 						if (!isset($spotter_item['aircraft_shadow']) || $spotter_item['aircraft_shadow'] == '') {
289 356
 							if ($tracker) {
290 357
 								if (isset($spotter_item['type']) && $spotter_item['type'] == 'Ambulance') {
291
-									if ($compress) $output .= '"as": "ambulance.png",';
292
-									else $output .= '"aircraft_shadow": "ambulance.png",';
358
+									if ($compress) {
359
+										$output .= '"as": "ambulance.png",';
360
+									} else {
361
+										$output .= '"aircraft_shadow": "ambulance.png",';
362
+									}
293 363
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') {
294
-									if ($compress) $output .= '"as": "police.png",';
295
-									else $output .= '"aircraft_shadow": "police.png",';
364
+									if ($compress) {
365
+										$output .= '"as": "police.png",';
366
+									} else {
367
+										$output .= '"aircraft_shadow": "police.png",';
368
+									}
296 369
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') {
297
-									if ($compress) $output .= '"as": "ship.png",';
298
-									else $output .= '"aircraft_shadow": "ship.png",';
370
+									if ($compress) {
371
+										$output .= '"as": "ship.png",';
372
+									} else {
373
+										$output .= '"aircraft_shadow": "ship.png",';
374
+									}
299 375
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') {
300
-									if ($compress) $output .= '"as": "ship.png",';
301
-									else $output .= '"aircraft_shadow": "ship.png",';
376
+									if ($compress) {
377
+										$output .= '"as": "ship.png",';
378
+									} else {
379
+										$output .= '"aircraft_shadow": "ship.png",';
380
+									}
302 381
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') {
303
-									if ($compress) $output .= '"as": "ship.png",';
304
-									else $output .= '"aircraft_shadow": "ship.png",';
382
+									if ($compress) {
383
+										$output .= '"as": "ship.png",';
384
+									} else {
385
+										$output .= '"aircraft_shadow": "ship.png",';
386
+									}
305 387
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') {
306
-									if ($compress) $output .= '"as": "truck.png",';
307
-									else $output .= '"aircraft_shadow": "truck.png",';
388
+									if ($compress) {
389
+										$output .= '"as": "truck.png",';
390
+									} else {
391
+										$output .= '"aircraft_shadow": "truck.png",';
392
+									}
308 393
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') {
309
-									if ($compress) $output .= '"as": "truck.png",';
310
-									else $output .= '"aircraft_shadow": "truck.png",';
394
+									if ($compress) {
395
+										$output .= '"as": "truck.png",';
396
+									} else {
397
+										$output .= '"aircraft_shadow": "truck.png",';
398
+									}
311 399
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') {
312
-									if ($compress) $output .= '"as": "aircraft.png",';
313
-									else $output .= '"aircraft_shadow": "aircraft.png",';
400
+									if ($compress) {
401
+										$output .= '"as": "aircraft.png",';
402
+									} else {
403
+										$output .= '"aircraft_shadow": "aircraft.png",';
404
+									}
314 405
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') {
315
-									if ($compress) $output .= '"as": "aircraft.png",';
316
-									else $output .= '"aircraft_shadow": "aircraft.png",';
406
+									if ($compress) {
407
+										$output .= '"as": "aircraft.png",';
408
+									} else {
409
+										$output .= '"aircraft_shadow": "aircraft.png",';
410
+									}
317 411
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') {
318
-									if ($compress) $output .= '"as": "helico.png",';
319
-									else $output .= '"aircraft_shadow": "helico.png",';
412
+									if ($compress) {
413
+										$output .= '"as": "helico.png",';
414
+									} else {
415
+										$output .= '"aircraft_shadow": "helico.png",';
416
+									}
320 417
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') {
321
-									if ($compress) $output .= '"as": "rail.png",';
322
-									else $output .= '"aircraft_shadow": "rail.png",';
418
+									if ($compress) {
419
+										$output .= '"as": "rail.png",';
420
+									} else {
421
+										$output .= '"aircraft_shadow": "rail.png",';
422
+									}
323 423
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') {
324
-									if ($compress) $output .= '"as": "firetruck.png",';
325
-									else $output .= '"aircraft_shadow": "firetruck.png",';
424
+									if ($compress) {
425
+										$output .= '"as": "firetruck.png",';
426
+									} else {
427
+										$output .= '"aircraft_shadow": "firetruck.png",';
428
+									}
326 429
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') {
327
-									if ($compress) $output .= '"as": "bus.png",';
328
-									else $output .= '"aircraft_shadow": "bus.png",';
430
+									if ($compress) {
431
+										$output .= '"as": "bus.png",';
432
+									} else {
433
+										$output .= '"aircraft_shadow": "bus.png",';
434
+									}
329 435
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') {
330
-									if ($compress) $output .= '"as": "phone.png",';
331
-									else $output .= '"aircraft_shadow": "phone.png",';
436
+									if ($compress) {
437
+										$output .= '"as": "phone.png",';
438
+									} else {
439
+										$output .= '"aircraft_shadow": "phone.png",';
440
+									}
332 441
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') {
333
-									if ($compress) $output .= '"as": "jogger.png",';
334
-									else $output .= '"aircraft_shadow": "jogger.png",';
442
+									if ($compress) {
443
+										$output .= '"as": "jogger.png",';
444
+									} else {
445
+										$output .= '"aircraft_shadow": "jogger.png",';
446
+									}
335 447
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') {
336
-									if ($compress) $output .= '"as": "bike.png",';
337
-									else $output .= '"aircraft_shadow": "bike.png",';
448
+									if ($compress) {
449
+										$output .= '"as": "bike.png",';
450
+									} else {
451
+										$output .= '"aircraft_shadow": "bike.png",';
452
+									}
338 453
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') {
339
-									if ($compress) $output .= '"as": "motorcycle.png",';
340
-									else $output .= '"aircraft_shadow": "motorcycle.png",';
454
+									if ($compress) {
455
+										$output .= '"as": "motorcycle.png",';
456
+									} else {
457
+										$output .= '"aircraft_shadow": "motorcycle.png",';
458
+									}
341 459
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') {
342
-									if ($compress) $output .= '"as": "balloon.png",';
343
-									else $output .= '"aircraft_shadow": "balloon.png",';
460
+									if ($compress) {
461
+										$output .= '"as": "balloon.png",';
462
+									} else {
463
+										$output .= '"aircraft_shadow": "balloon.png",';
464
+									}
344 465
 								} else {
345
-									if ($compress) $output .= '"as": "car.png",';
346
-									else $output .= '"aircraft_shadow": "car.png",';
466
+									if ($compress) {
467
+										$output .= '"as": "car.png",';
468
+									} else {
469
+										$output .= '"aircraft_shadow": "car.png",';
470
+									}
347 471
 								}
348 472
 							} elseif ($marine) {
349
-								if ($compress) $output .= '"as": "ship.png",';
350
-								else $output .= '"aircraft_shadow": "ship.png",';
473
+								if ($compress) {
474
+									$output .= '"as": "ship.png",';
475
+								} else {
476
+									$output .= '"aircraft_shadow": "ship.png",';
477
+								}
351 478
 							} else {
352
-								if ($compress) $output .= '"as": "default.png",';
353
-								else $output .= '"aircraft_shadow": "default.png",';
479
+								if ($compress) {
480
+									$output .= '"as": "default.png",';
481
+								} else {
482
+									$output .= '"aircraft_shadow": "default.png",';
483
+								}
354 484
 							}
355 485
 						} else {
356
-							if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",';
357
-							else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
486
+							if ($compress) {
487
+								$output .= '"as": "'.$spotter_item['aircraft_shadow'].'",';
488
+							} else {
489
+								$output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
490
+							}
358 491
 						}
359 492
 						if (isset($spotter_item['airline_name'])) {
360 493
 							$output .= '"airline_name": "'.$spotter_item['airline_name'].'",';
@@ -362,8 +495,11 @@  discard block
 block discarded – undo
362 495
 							$output .= '"airline_name": "NA",';
363 496
 						}
364 497
 						if (isset($spotter_item['departure_airport'])) {
365
-							if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",';
366
-							else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",';
498
+							if ($compress) {
499
+								$output .= '"dac": "'.$spotter_item['departure_airport'].'",';
500
+							} else {
501
+								$output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",';
502
+							}
367 503
 						}
368 504
 						if (isset($spotter_item['departure_airport_city'])) {
369 505
 							$output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",';
@@ -375,8 +511,11 @@  discard block
 block discarded – undo
375 511
 							$output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",';
376 512
 						}
377 513
 						if (isset($spotter_item['arrival_airport'])) {
378
-							if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",';
379
-							else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",';
514
+							if ($compress) {
515
+								$output .= '"aac": "'.$spotter_item['arrival_airport'].'",';
516
+							} else {
517
+								$output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",';
518
+							}
380 519
 						}
381 520
 						if (isset($spotter_item['arrival_airport_city'])) {
382 521
 							$output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",';
@@ -395,11 +534,17 @@  discard block
 block discarded – undo
395 534
 						}
396 535
 						
397 536
 						if (isset($spotter_item['altitude'])) {
398
-							if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",';
399
-							else $output .= '"altitude": "'.$spotter_item['altitude'].'",';
537
+							if ($compress) {
538
+								$output .= '"a": "'.$spotter_item['altitude'].'",';
539
+							} else {
540
+								$output .= '"altitude": "'.$spotter_item['altitude'].'",';
541
+							}
542
+						}
543
+						if ($compress) {
544
+							$output .= '"h": "'.$spotter_item['heading'].'",';
545
+						} else {
546
+							$output .= '"heading": "'.$spotter_item['heading'].'",';
400 547
 						}
401
-						if ($compress)$output .= '"h": "'.$spotter_item['heading'].'",';
402
-						else $output .= '"heading": "'.$spotter_item['heading'].'",';
403 548
 						
404 549
 						if ($currenttime != '') {
405 550
 							if (strtotime($spotter_item['date']) < $currenttime) {
@@ -421,7 +566,9 @@  discard block
 block discarded – undo
421 566
 							}
422 567
 						}
423 568
 
424
-						if (!$min) $output .= '"image": "'.$image.'",';
569
+						if (!$min) {
570
+							$output .= '"image": "'.$image.'",';
571
+						}
425 572
 						if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') {
426 573
 							$output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",';
427 574
 						}
@@ -429,8 +576,11 @@  discard block
 block discarded – undo
429 576
 							$output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",';
430 577
 						}
431 578
 						if (isset($spotter_item['squawk'])) {
432
-							if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",';
433
-							else $output .= '"squawk": "'.$spotter_item['squawk'].'",';
579
+							if ($compress) {
580
+								$output .= '"sq": "'.$spotter_item['squawk'].'",';
581
+							} else {
582
+								$output .= '"squawk": "'.$spotter_item['squawk'].'",';
583
+							}
434 584
 						}
435 585
 						if (isset($spotter_item['squawk_usage'])) {
436 586
 							$output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",';
@@ -449,14 +599,23 @@  discard block
 block discarded – undo
449 599
 						}
450 600
 						// type when not aircraft ?
451 601
 						if (isset($spotter_item['type'])) {
452
-							if ($compress) $output .= '"t": "'.$spotter_item['type'].'"';
453
-							else $output .= '"type": "'.$spotter_item['type'].'"';
602
+							if ($compress) {
603
+								$output .= '"t": "'.$spotter_item['type'].'"';
604
+							} else {
605
+								$output .= '"type": "'.$spotter_item['type'].'"';
606
+							}
454 607
 						} elseif ($marine) {
455
-							if ($compress) $output .= '"t": "ship"';
456
-							else $output .= '"type": "ship"';
608
+							if ($compress) {
609
+								$output .= '"t": "ship"';
610
+							} else {
611
+								$output .= '"type": "ship"';
612
+							}
457 613
 						} else {
458
-							if ($compress) $output .= '"t": "aircraft"';
459
-							else $output .= '"type": "aircraft"';
614
+							if ($compress) {
615
+								$output .= '"t": "aircraft"';
616
+							} else {
617
+								$output .= '"type": "aircraft"';
618
+							}
460 619
 						}
461 620
 						$output .= '},';
462 621
 						$output .= '"geometry": {';
@@ -464,7 +623,9 @@  discard block
 block discarded – undo
464 623
 								$output .= '"coordinates": [';
465 624
 								if ($currenttime != '') {
466 625
 									if (strtotime($spotter_item['date']) < $currenttime) {
467
-										if (!isset($archivespeed)) $archivespeed = 1;
626
+										if (!isset($archivespeed)) {
627
+											$archivespeed = 1;
628
+										}
468 629
 										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed,$currenttime-strtotime($spotter_item['date']));
469 630
 										$output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
470 631
 									} else {
@@ -535,7 +696,9 @@  discard block
 block discarded – undo
535 696
 			}
536 697
 */
537 698
 				$history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING);
538
-				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
699
+				if ($history == '' && isset($_COOKIE['history'])) {
700
+					$history = $_COOKIE['history'];
701
+				}
539 702
 				
540 703
 				if (
541 704
 				    (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') 
@@ -579,8 +742,11 @@  discard block
 block discarded – undo
579 742
 									$output_history .= ']}},';
580 743
 									$output .= $output_history;
581 744
 								}
582
-								if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
583
-								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
745
+								if ($compress) {
746
+									$output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
747
+								} else {
748
+									$output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
749
+								}
584 750
 							}
585 751
 							$output_history .= '[';
586 752
 							$output_history .=  $spotter_history['longitude'].', ';
@@ -599,9 +765,14 @@  discard block
 block discarded – undo
599 765
 							$prev_alt = $alt;
600 766
 						} else {
601 767
 							if ($d == false) {
602
-								if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history"},"geometry": {"type": "LineString","coordinates": [';
603
-								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": [';
604
-							} else $d = true;
768
+								if ($compress) {
769
+									$output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history"},"geometry": {"type": "LineString","coordinates": [';
770
+								} else {
771
+									$output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": [';
772
+								}
773
+							} else {
774
+								$d = true;
775
+							}
605 776
 							$output_history .= '[';
606 777
 							$output_history .=  $spotter_history['longitude'].', ';
607 778
 							$output_history .=  $spotter_history['latitude'];
@@ -622,7 +793,9 @@  discard block
 block discarded – undo
622 793
 							$output_historyd = '[';
623 794
 							$output_historyd .=  $spotter_item['longitude'].', ';
624 795
 							$output_historyd .=  $spotter_item['latitude'];
625
-							if (isset($spotter_history['altitude'])) $output_historyd .=  ','.$spotter_item['altitude']*30.48;
796
+							if (isset($spotter_history['altitude'])) {
797
+								$output_historyd .=  ','.$spotter_item['altitude']*30.48;
798
+							}
626 799
 							$output_historyd .= '],';
627 800
 							//$output_history = $output_historyd.$output_history;
628 801
 							$output_history = $output_history.$output_historyd;
@@ -644,8 +817,11 @@  discard block
 block discarded – undo
644 817
 				        && $spotter_item['arrival_airport'] != 'NA' 
645 818
 				        && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") 
646 819
 				    	    || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) {
647
-				    if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
648
-				    else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
820
+				    if ($compress) {
821
+				    	$output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
822
+				    } else {
823
+				    	$output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
824
+				    }
649 825
 				    if (isset($spotter_item['departure_airport_latitude'])) {
650 826
 					$output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],';
651 827
 				    } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') {
@@ -678,8 +854,11 @@  discard block
 block discarded – undo
678 854
 				    	    || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) 
679 855
 				    	    || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) {
680 856
 				    $havedata = false;
681
-				    if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
682
-				    else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
857
+				    if ($compress) {
858
+				    	$output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
859
+				    } else {
860
+				    	$output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
861
+				    }
683 862
 				    $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';
684 863
 
685 864
 				    if (isset($spotter_item['arrival_airport_latitude'])) {
@@ -694,7 +873,9 @@  discard block
 block discarded – undo
694 873
 				    }
695 874
 				    //$output_dest  = substr($output_dest, 0, -1);
696 875
 				    $output_dest .= ']}},';
697
-				    if ($havedata) $output .= $output_dest;
876
+				    if ($havedata) {
877
+				    	$output .= $output_dest;
878
+				    }
698 879
 				    unset($output_dest);
699 880
 				}
700 881
 			}
@@ -702,7 +883,9 @@  discard block
 block discarded – undo
702 883
 			$output .= ']';
703 884
 			$output .= ',"initial_sqltime": "'.$sqltime.'",';
704 885
 			$output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';
705
-			if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
886
+			if (isset($begindate)) {
887
+				$output .= '"archive_date": "'.$begindate.'",';
888
+			}
706 889
 			$output .= '"fc": "'.$j.'"';
707 890
 		} else {
708 891
 			$output .= '"features": ';
Please login to merge, or discard this patch.
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -55,17 +55,17 @@  discard block
 block discarded – undo
55 55
 $min = true;
56 56
 $allhistory = false;
57 57
 $filter['source'] = array();
58
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
59
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
60
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
61
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
62
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
63
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
64
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
65
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
66
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
67
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
68
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
58
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt'));
59
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup'));
60
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars'));
61
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs'));
62
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs'));
63
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING);
64
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING);
65
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING);
66
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING);
67
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING);
68
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING);
69 69
 
70 70
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
71 71
 	$min = true;
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 $spotter_array = array();
75 75
 
76 76
 if (isset($_GET['ident'])) {
77
-	$ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING));
77
+	$ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING));
78 78
 	if ($tracker) {
79 79
 		$spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident);
80 80
 	} elseif ($marine) {
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	}
89 89
 	$allhistory = true;
90 90
 } elseif (isset($_GET['flightaware_id'])) {
91
-	$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
91
+	$flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING);
92 92
 	$spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id);
93 93
 	if (empty($spotter_array)) {
94 94
 		$from_archive = true;
@@ -96,38 +96,38 @@  discard block
 block discarded – undo
96 96
 	}
97 97
 	$allhistory = true;
98 98
 } elseif (isset($_GET['famtrack_id'])) {
99
-	$famtrack_id = urldecode(filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING));
99
+	$famtrack_id = urldecode(filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING));
100 100
 	$spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id);
101 101
 	$allhistory = true;
102 102
 } elseif (isset($_GET['fammarine_id'])) {
103
-	$fammarine_id = urldecode(filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING));
103
+	$fammarine_id = urldecode(filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING));
104 104
 	$spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id);
105 105
 	$allhistory = true;
106 106
 } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && (!isset($globalMapPopup) || $globalMapPopup || (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true'))) {
107 107
 //} elseif (isset($_GET['coord'])) {
108 108
 	$usecoord = true;
109
-	$coord = explode(',',$_GET['coord']);
110
-	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) 
109
+	$coord = explode(',', $_GET['coord']);
110
+	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) 
111 111
 	    && $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) {
112 112
 		if ($tracker) {
113
-			$spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord,$filter);
113
+			$spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord, $filter);
114 114
 		} elseif ($marine) {
115
-			$spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord,$filter);
115
+			$spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord, $filter);
116 116
 		} else {
117
-			$spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord,$filter);
117
+			$spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord, $filter);
118 118
 		}
119 119
 	}
120 120
 } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min) {
121 121
 	$usecoord = true;
122
-	$coord = explode(',',$_GET['coord']);
123
-	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) 
122
+	$coord = explode(',', $_GET['coord']);
123
+	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) 
124 124
 	    && $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) {
125 125
 		if ($tracker) {
126
-			$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter);
126
+			$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter);
127 127
 		} elseif ($marine) {
128
-			$spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter);
128
+			$spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter);
129 129
 		} else {
130
-			$spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$filter);
130
+			$spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $filter);
131 131
 		}
132 132
 	} else {
133 133
 		if ($tracker) {
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
 	$from_archive = true;
143 143
 //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
144 144
 //	$enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
145
-	$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
146
-	$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
147
-	$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
148
-	$begindate = date('Y-m-d H:i:s',$begindate);
149
-	$enddate = date('Y-m-d H:i:s',$enddate);
150
-	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
145
+	$begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT);
146
+	$enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT);
147
+	$archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT);
148
+	$begindate = date('Y-m-d H:i:s', $begindate);
149
+	$enddate = date('Y-m-d H:i:s', $enddate);
150
+	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter);
151 151
 } elseif ($min) {
152 152
 	if ($tracker) {
153 153
 		$spotter_array = $TrackerLive->getMinLiveTrackerData($filter);
@@ -159,17 +159,17 @@  discard block
 block discarded – undo
159 159
 #	$min = true;
160 160
 } else {
161 161
 	if ($tracker) {
162
-		$spotter_array = $TrackerLive->getLiveTrackerData('','',$filter);
162
+		$spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter);
163 163
 	} elseif ($marine) {
164
-		$spotter_array = $marineLive->getLiveMarineData('','',$filter);
164
+		$spotter_array = $marineLive->getLiveMarineData('', '', $filter);
165 165
 	} else {
166
-		$spotter_array = $SpotterLive->getLiveSpotterData('','',$filter);
166
+		$spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter);
167 167
 	}
168 168
 }
169 169
 
170 170
 if ($usecoord) {
171 171
 	if (isset($_GET['archive'])) {
172
-		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);
172
+		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter);
173 173
 	} else {
174 174
 		if ($tracker) {
175 175
 			$flightcnt = $TrackerLive->getLiveTrackerCount($filter);
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
 	if ($flightcnt == '') $flightcnt = 0;
183 183
 } else $flightcnt = 0;
184 184
 
185
-$sqltime = round(microtime(true)-$begintime,2);
185
+$sqltime = round(microtime(true) - $begintime, 2);
186 186
 
187
-$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
187
+$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
188 188
 if ($currenttime != '') $currenttime = round($currenttime/1000);
189 189
 
190 190
 if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false;
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 		if (!empty($spotter_array) && is_array($spotter_array))
204 204
 		{
205 205
 			$output .= '"features": [';
206
-			foreach($spotter_array as $spotter_item)
206
+			foreach ($spotter_array as $spotter_item)
207 207
 			{
208 208
 				$j++;
209 209
 				date_default_timezone_set('UTC');
@@ -259,8 +259,8 @@  discard block
 block discarded – undo
259 259
 */
260 260
 							//$output .= '"fc": "'.$spotter_item['nb'].'",';
261 261
 						if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') {
262
-							if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",';
263
-							else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",';
262
+							if ($compress) $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",';
263
+							else $output .= '"callsign": "'.str_replace('\\', '', $spotter_item['ident']).'",';
264 264
 							//"
265 265
 						} else {
266 266
 							if ($compress) $output .= '"c": "NA",';
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 						if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",';
270 270
 						if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) {
271 271
 							$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",';
272
-							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",';
272
+							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",';
273 273
 						} elseif (isset($spotter_item['aircraft_type'])) {
274 274
 							$output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",';
275 275
 						} elseif (!$min) {
@@ -412,34 +412,34 @@  discard block
 block discarded – undo
412 412
 						if ($currenttime != '') {
413 413
 							if (strtotime($spotter_item['date']) < $currenttime) {
414 414
 								if (isset($archivespeed)) {
415
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
415
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
416 416
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
417 417
 								} elseif ($usenextlatlon) {
418
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
418
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
419 419
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
420 420
 								}
421 421
 							} else {
422 422
 								if (isset($archivespeed)) {
423
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed);
423
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed);
424 424
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
425 425
 								} elseif ($usenextlatlon) {
426
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']);
426
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']);
427 427
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
428 428
 								}
429 429
 							}
430 430
 						} else {
431 431
 							if (isset($archivespeed)) {
432
-								$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed);
432
+								$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed);
433 433
 								$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
434 434
 							} elseif ($usenextlatlon) {
435
-								$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']);
435
+								$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']);
436 436
 								$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
437 437
 							}
438 438
 						}
439 439
 
440 440
 						if (!$min) $output .= '"image": "'.$image.'",';
441 441
 						if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') {
442
-							$output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",';
442
+							$output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",';
443 443
 						}
444 444
 						if (isset($spotter_item['image_source_website'])) {
445 445
 							$output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",';
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 							$output .= '"waypoints": "'.$spotter_item['waypoints'].'",';
462 462
 						}
463 463
 						if (isset($spotter_item['acars'])) {
464
-							$output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",';
464
+							$output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",';
465 465
 						}
466 466
 						// type when not aircraft ?
467 467
 						if (isset($spotter_item['type'])) {
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 								if ($currenttime != '') {
482 482
 									if (strtotime($spotter_item['date']) < $currenttime) {
483 483
 										if (!isset($archivespeed)) $archivespeed = 1;
484
-										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed,$currenttime-strtotime($spotter_item['date']));
484
+										$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed, $currenttime - strtotime($spotter_item['date']));
485 485
 										$output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
486 486
 									} else {
487 487
 										$output .= $spotter_item['longitude'].', ';
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
                 
551 551
 			}
552 552
 */
553
-				$history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING);
553
+				$history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING);
554 554
 				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
555 555
 				
556 556
 				if (
@@ -558,11 +558,11 @@  discard block
 block discarded – undo
558 558
 				    || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)
559 559
 				//    || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))
560 560
 				//    || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident'])
561
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
561
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
562 562
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])
563
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id']))
563
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id']))
564 564
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])
565
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid']))
565
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid']))
566 566
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])
567 567
 				    ) {
568 568
 					if ($tracker) {
@@ -599,9 +599,9 @@  discard block
 block discarded – undo
599 599
 								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
600 600
 							}
601 601
 							$output_history .= '[';
602
-							$output_history .=  $spotter_history['longitude'].', ';
603
-							$output_history .=  $spotter_history['latitude'].', ';
604
-							$output_history .=  $spotter_history['altitude']*30.48;
602
+							$output_history .= $spotter_history['longitude'].', ';
603
+							$output_history .= $spotter_history['latitude'].', ';
604
+							$output_history .= $spotter_history['altitude']*30.48;
605 605
 							$output_history .= '],';
606 606
 							/*
607 607
 							if ($from_archive === false) {
@@ -619,8 +619,8 @@  discard block
 block discarded – undo
619 619
 								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": [';
620 620
 							} else $d = true;
621 621
 							$output_history .= '[';
622
-							$output_history .=  $spotter_history['longitude'].', ';
623
-							$output_history .=  $spotter_history['latitude'];
622
+							$output_history .= $spotter_history['longitude'].', ';
623
+							$output_history .= $spotter_history['latitude'];
624 624
 							$output_history .= '],';
625 625
 							/*
626 626
 							if ($from_archive === false) {
@@ -636,9 +636,9 @@  discard block
 block discarded – undo
636 636
 					
637 637
 						if ($from_archive === false) {
638 638
 							$output_historyd = '[';
639
-							$output_historyd .=  $spotter_item['longitude'].', ';
640
-							$output_historyd .=  $spotter_item['latitude'];
641
-							if (isset($spotter_history['altitude'])) $output_historyd .=  ','.$spotter_item['altitude']*30.48;
639
+							$output_historyd .= $spotter_item['longitude'].', ';
640
+							$output_historyd .= $spotter_item['latitude'];
641
+							if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48;
642 642
 							$output_historyd .= '],';
643 643
 							//$output_history = $output_historyd.$output_history;
644 644
 							$output_history = $output_history.$output_historyd;
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
 					}
653 653
 				}
654 654
 				
655
-				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
655
+				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
656 656
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
657 657
 				     && (isset($spotter_item['departure_airport']) 
658 658
 				        && $spotter_item['departure_airport'] != 'NA' 
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 
687 687
 				//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))))) {
688 688
 				//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))))) {
689
-				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
689
+				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
690 690
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
691 691
 				     && (isset($spotter_item['arrival_airport']) 
692 692
 				        && $spotter_item['arrival_airport'] != 'NA' 
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 			$output  = substr($output, 0, -1);
718 718
 			$output .= ']';
719 719
 			$output .= ',"initial_sqltime": "'.$sqltime.'",';
720
-			$output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';
720
+			$output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",';
721 721
 			if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
722 722
 			$output .= '"fc": "'.$j.'"';
723 723
 		} else {
Please login to merge, or discard this patch.
airline-statistics-registration.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -8,21 +8,21 @@  discard block
 block discarded – undo
8 8
 	header('Location: '.$globalURL.'/airline');
9 9
 	die();
10 10
 }
11
-$airline = urldecode(filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING));
11
+$airline = urldecode(filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING));
12 12
 $Spotter = new Spotter();
13 13
 $alliance = false;
14
-if (strpos($airline,'alliance_') !== FALSE) {
14
+if (strpos($airline, 'alliance_') !== FALSE) {
15 15
 	$alliance = true;
16 16
 } else {
17
-	$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");
17
+	$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");
18 18
 }
19 19
 
20 20
 if (!empty($spotter_array) || $alliance === true)
21 21
 {
22 22
 	if ($alliance) {
23
-		$title = sprintf(_("Most Common Aircraft by Registration from %s"),str_replace('_',' ',str_replace('alliance_','',$airline)));
23
+		$title = sprintf(_("Most Common Aircraft by Registration from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline)));
24 24
 	} else {
25
-		$title = sprintf(_("Most Common Aircraft by Registration from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
25
+		$title = sprintf(_("Most Common Aircraft by Registration from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
26 26
 	}
27 27
 	require_once('header.php');
28 28
 
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
 	$alliances = $Spotter->getAllAllianceNames();
34 34
 	if (!empty($alliances)) {
35 35
 		foreach ($alliances as $al) {
36
-			if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) {
37
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>';
36
+			if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) {
37
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>';
38 38
 			} else {
39
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>';
39
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>';
40 40
 			}
41 41
 		}
42 42
 		print '<option disabled>──────────────────</option>';
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
 	$Stats = new Stats($Spotter->db);
45 45
 	$airline_names = $Stats->getAllAirlineNames();
46 46
 	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
47
-	foreach($airline_names as $airline_name)
47
+	foreach ($airline_names as $airline_name)
48 48
 	{
49
-		if($airline == $airline_name['airline_icao'])
49
+		if ($airline == $airline_name['airline_icao'])
50 50
 		{
51 51
 			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
52 52
 		} else {
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
 			print '</div>';
81 81
 		} else {
82 82
 			print '<div class="info column">';
83
-			print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>';
84
-			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png'))
83
+			print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>';
84
+			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png'))
85 85
 			{
86
-				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />';
86
+				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />';
87 87
 			}
88
-			print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>';
88
+			print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>';
89 89
 			print '</div>';
90 90
 		}
91 91
 	} else {
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
 	print '<div class="column">';
97 97
 	print '<h2>'._("Most Common Aircraft by Registration").'</h2>';
98 98
 	if ($alliance) {
99
-		print '<p>'.sprintf(_("The statistic below shows the most common aircraft by their registration of flights from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>';
99
+		print '<p>'.sprintf(_("The statistic below shows the most common aircraft by their registration of flights from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>';
100 100
 	} else {
101
-		print '<p>'.sprintf(_("The statistic below shows the most common aircraft by their registration of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
101
+		print '<p>'.sprintf(_("The statistic below shows the most common aircraft by their registration of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
102 102
 	}
103 103
 	/*
104 104
 	if ($alliance) {
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		$aircraft_array = $Spotter->countAllAircraftRegistrationByAirline($airline);
108 108
 	}
109 109
 	*/
110
-	$aircraft_array = $Stats->countAllAircraftRegistrations(true,$airline);
110
+	$aircraft_array = $Stats->countAllAircraftRegistrations(true, $airline);
111 111
 	if (!empty($aircraft_array))
112 112
 	{
113 113
 		print '<div class="table-responsive">';
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		print '</thead>';
123 123
 		print '<tbody>';
124 124
 		$i = 1;
125
-		foreach($aircraft_array as $aircraft_item)
125
+		foreach ($aircraft_array as $aircraft_item)
126 126
 		{
127 127
 			print '<tr>';
128 128
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,9 @@  discard block
 block discarded – undo
43 43
 	}
44 44
 	$Stats = new Stats($Spotter->db);
45 45
 	$airline_names = $Stats->getAllAirlineNames();
46
-	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
46
+	if (empty($airline_names)) {
47
+		$airline_names = $Spotter->getAllAirlineNames();
48
+	}
47 49
 	foreach($airline_names as $airline_name)
48 50
 	{
49 51
 		if($airline == $airline_name['airline_icao'])
@@ -66,8 +68,7 @@  discard block
 block discarded – undo
66 68
 			if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif'))
67 69
 			{
68 70
 				print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />';
69
-			}
70
-			elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
71
+			} elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
71 72
 			{
72 73
 				print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />';
73 74
 			}
@@ -131,7 +132,9 @@  discard block
 block discarded – undo
131 132
 				$images = $Image->getSpotterImage($aircraft_item['registration']);
132 133
 				if (isset($images['image_thumbnail'])) {
133 134
 					$aircraft_item['image_thumbnail'] = $images['image_thumbnail'];
134
-				} else $aircraft_item['image_thumbnail'] = '';
135
+				} else {
136
+					$aircraft_item['image_thumbnail'] = '';
137
+				}
135 138
 			}
136 139
 			if ($aircraft_item['image_thumbnail'] != "")
137 140
 			{
Please login to merge, or discard this patch.