Completed
Push — master ( 6f3189...838cce )
by Yannick
27:05
created
table-output.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 				print '<th class="arrival"><span class="nomobile">'._("Going to").'</span><span class="mobile">'._("To").'</span></th>';
278 278
 			}
279 279
 		}
280
-    		if ($type == 'aircraft') {
280
+			if ($type == 'aircraft') {
281 281
 			if ((isset($globalUsePilot) && $globalUsePilot) || (!isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalVAM) && $globalVAM) || (isset($globalphpVMS) && $globalphpVMS)))) {
282 282
 				print '<th class="pilot"><span class="nomobile">'._("Pilot name").'</span><span class="mobile">'._("Pilot").'</span></a></th>';
283 283
 			}
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 	} elseif(strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive" && strtolower($current_page) != "accident-latest" && strtolower($current_page) != "incident-latest" && strtolower($current_page) != "accident-detailed" && strtolower($current_page) != "incident-detailed"){
580 580
 		if ($type == 'aircraft') {
581 581
 			if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) {
582
-			    $spotter_item['squawk'] = '-';
582
+				$spotter_item['squawk'] = '-';
583 583
 			}
584 584
 			if ($spotter_item['image_thumbnail'] != "")
585 585
 			{
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 				print '</td>'."\n";
619 619
 			} else {
620 620
 				print '<td class="aircraft_thumbnail">'."\n";
621
-	       //   	 	print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>';
621
+		   //   	 	print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>';
622 622
 		//}
623 623
 				if (!isset($spotter_item['airline_name']) && !isset($spotter_item['aircraft_name'])) {
624 624
 					print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '._("Not available").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n";
Please login to merge, or discard this patch.
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 require_once(dirname(__FILE__).'/require/class.Common.php');
6 6
 $Common = new Common();
7
-$showRouteStop = $Common->multiKeyExists($spotter_array,'route_stop');
8
-$showDuration = $Common->multiKeyExists($spotter_array,'duration');
7
+$showRouteStop = $Common->multiKeyExists($spotter_array, 'route_stop');
8
+$showDuration = $Common->multiKeyExists($spotter_array, 'duration');
9 9
 
10 10
 if (!isset($type)) $type = 'aircraft';
11 11
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	}
140 140
 	print '<th class="more"></th>';
141 141
 	print '</thead>';
142
-} else if (strtolower($current_page) == "upcoming"){
142
+} else if (strtolower($current_page) == "upcoming") {
143 143
 	print '<thead>';
144 144
 	if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
145 145
 		if ($_GET['sort'] == "airline_name_asc")
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	}
194 194
 	*/
195 195
 	print '</thead>';
196
-} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive"){
196
+} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") {
197 197
 	print '<thead>';
198 198
 	print '<th class="aircraft_thumbnail"></th>';
199 199
 	print '<th class="logo">'._("Airline").'</th>';
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 	print '</thead>';
231 231
 } else {
232 232
 
233
-	if ($hide_th_links === true){
233
+	if ($hide_th_links === true) {
234 234
 		print '<thead>';
235 235
 		print '<th class="aircraft_thumbnail"></th>';
236 236
 		if ($type == 'aircraft') {
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 }
488 488
 
489 489
 print '<tbody>'."\n";
490
-foreach($spotter_array as $spotter_item)
490
+foreach ($spotter_array as $spotter_item)
491 491
 {
492 492
 	if (isset($globalTimezone))
493 493
 	{
@@ -522,13 +522,13 @@  discard block
 block discarded – undo
522 522
 						$image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
523 523
 					}
524 524
 					if (isset($spotter_item['airline_name'])) {
525
-						print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
525
+						print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
526 526
 					} else {
527
-						print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '._("Not available").'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
527
+						print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '._("Not available").'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
528 528
 					}
529 529
 				} else {
530 530
 					if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
531
-						$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
531
+						$image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']);
532 532
 					} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
533 533
 					if (isset($spotter_item['airline_name'])) {
534 534
 						print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 			{
548 548
 				print '<td class="aircraft_thumbnail">'."\n";
549 549
 				if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
550
-					$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
550
+					$image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']);
551 551
 				} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
552 552
 				if (isset($spotter_item['airline_name'])) {
553 553
 					print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['mmsi'].'" alt="'.$spotter_item['mmsi'].'" data-content="'._("MMSI:").' '.$spotter_item['mmsi'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 			{
566 566
 				print '<td class="aircraft_thumbnail">'."\n";
567 567
 				if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
568
-					$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
568
+					$image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']);
569 569
 				} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
570 570
 				print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['type'].'" data-content="'._("Type:").' '.$spotter_item['type'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
571 571
 				print '</td>'."\n";
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
 				print '</td>'."\n";
610 610
 			}
611 611
 		}
612
-	} elseif(strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive" && strtolower($current_page) != "accident-latest" && strtolower($current_page) != "incident-latest" && strtolower($current_page) != "accident-detailed" && strtolower($current_page) != "incident-detailed"){
612
+	} elseif (strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive" && strtolower($current_page) != "accident-latest" && strtolower($current_page) != "incident-latest" && strtolower($current_page) != "accident-detailed" && strtolower($current_page) != "incident-detailed") {
613 613
 		if ($type == 'aircraft') {
614 614
 			if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) {
615 615
 			    $spotter_item['squawk'] = '-';
@@ -626,17 +626,17 @@  discard block
 block discarded – undo
626 626
 						$image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
627 627
 					}
628 628
 					if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) {
629
-						print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
629
+						print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
630 630
 					} elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) {
631
-						print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
631
+						print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
632 632
 					} elseif (!isset($spotter_item['aircraft_name']) && !isset($spotter_item['airline_name'])) {
633
-						print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
633
+						print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
634 634
 					} else {
635
-						print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
635
+						print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
636 636
 					}
637 637
 				} else {
638 638
 					if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
639
-						$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
639
+						$image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']);
640 640
 					} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
641 641
 					if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) {
642 642
 						print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
@@ -669,7 +669,7 @@  discard block
 block discarded – undo
669 669
 			{
670 670
 				print '<td class="aircraft_thumbnail">'."\n";
671 671
 				if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
672
-					$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
672
+					$image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']);
673 673
 				} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
674 674
 				print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['mmsi'].'" alt="'.$spotter_item['mmsi'].'" data-content="'._("MMSI:").' '.$spotter_item['mmsi'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
675 675
 				print '</td>'."\n";
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
 			{
684 684
 				print '<td class="aircraft_thumbnail">'."\n";
685 685
 				if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
686
-					$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
686
+					$image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']);
687 687
 				} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
688 688
 				print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['type'].'" data-content="'._("Type:").' '.$spotter_item['type'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
689 689
 				print '</td>'."\n";
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 		print '</td>'."\n";
793 793
 	}
794 794
 	// Aircraft type
795
-	if(strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive"){
795
+	if (strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive") {
796 796
 		print '<td class="type">'."\n";
797 797
 		if ($type == 'aircraft') {
798 798
 			if (!isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_name'])) {
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
 				//print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'._("Not available").'</a></span>'."\n";
802 802
 				print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a></span>'."\n";
803 803
 			} else {
804
-				$aircraft_names = explode('/',$spotter_item['aircraft_name']);
804
+				$aircraft_names = explode('/', $spotter_item['aircraft_name']);
805 805
 				if (count($aircraft_names) == 1) print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</a></span>'."\n";
806 806
 				else print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].'</a></span>'."\n";
807 807
 			}
@@ -845,22 +845,22 @@  discard block
 block discarded – undo
845 845
 			}
846 846
 			if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) {
847 847
 				if ($spotter_item['departure_airport_time'] > 2460) {
848
-					$departure_airport_time = date('H:m',$spotter_item['departure_airport_time']);
849
-				} else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2);
848
+					$departure_airport_time = date('H:m', $spotter_item['departure_airport_time']);
849
+				} else $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2);
850 850
 				if ($spotter_item['real_departure_airport_time'] > 2460) {
851
-					$real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']);
851
+					$real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']);
852 852
 				} else $real_departure_airport_time = $spotter_item['real_departure_airport_time'];
853 853
 				print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n";
854 854
 			} elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') {
855 855
 				if ($spotter_item['real_departure_airport_time'] > 2460) {
856
-					$real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']);
856
+					$real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']);
857 857
 				} else $real_departure_airport_time = $spotter_item['real_departure_airport_time'];
858 858
 				print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n";
859 859
 			} elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') {
860 860
 				if ($spotter_item['departure_airport_time'] > 2460) {
861
-					$departure_airport_time = date('H:m',$spotter_item['departure_airport_time']);
861
+					$departure_airport_time = date('H:m', $spotter_item['departure_airport_time']);
862 862
 				} else {
863
-					$departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2);
863
+					$departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2);
864 864
 				}
865 865
 				print '<br /><span class="airport_time">'.$departure_airport_time.'</span>'."\n";
866 866
 			}
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
 						$latitude = $spotter_item['latitude'];
876 876
 						$longitude = $spotter_item['longitude'];
877 877
 					}
878
-					$distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude);
878
+					$distance = $Spotter->getAirportDistance($spotter_item['departure_airport'], $latitude, $longitude);
879 879
 				} else $distance = '';
880 880
 				if ($distance != '') {
881 881
 					if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
@@ -918,20 +918,20 @@  discard block
 block discarded – undo
918 918
 			}
919 919
 			if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) {
920 920
 				if ($spotter_item['arrival_airport_time'] > 2460) {
921
-					$arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']);
921
+					$arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']);
922 922
 				} else $arrival_airport_time = $spotter_item['arrival_airport_time'];
923 923
 				if ($spotter_item['real_arrival_airport_time'] > 2460) {
924
-					$real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']);
924
+					$real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']);
925 925
 				} else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
926 926
 				print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n";
927 927
 			} elseif (isset($spotter_item['real_arrival_airport_time'])) {
928 928
 				if ($spotter_item['real_arrival_airport_time'] > 2460) {
929
-					$real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']);
929
+					$real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']);
930 930
 				} else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
931 931
 				print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n";
932 932
 			} elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') {
933 933
 				if ($spotter_item['arrival_airport_time'] > 2460) {
934
-					$arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']);
934
+					$arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']);
935 935
 				} else $arrival_airport_time = $spotter_item['arrival_airport_time'];
936 936
 				print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n";
937 937
 			}
@@ -944,7 +944,7 @@  discard block
 block discarded – undo
944 944
 						$latitude = $spotter_item['latitude'];
945 945
 						$longitude = $spotter_item['longitude'];
946 946
 					}
947
-					$distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude);
947
+					$distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'], $latitude, $longitude);
948 948
 				} else $distance = '';
949 949
 				if ($distance != '') {
950 950
 					if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
@@ -987,19 +987,19 @@  discard block
 block discarded – undo
987 987
 				print '<span class="mobile">-</span>'."\n";
988 988
 			} else {
989 989
 				if ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
990
-					print '<span class="nomobile">'.round($spotter_item['distance'],2).' km</span>'."\n";
991
-					print '<span class="mobile">'.round($spotter_item['distance'],2).' km</span><br />'."\n";
990
+					print '<span class="nomobile">'.round($spotter_item['distance'], 2).' km</span>'."\n";
991
+					print '<span class="mobile">'.round($spotter_item['distance'], 2).' km</span><br />'."\n";
992 992
 				} elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
993
-					print '<span class="nomobile">'.round($spotter_item['distance']*0.621371,2).' mi</span>'."\n";
994
-					print '<span class="mobile">'.round($spotter_item['distance']*0.621371,2).' mi</span><br />'."\n";
993
+					print '<span class="nomobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span>'."\n";
994
+					print '<span class="mobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span><br />'."\n";
995 995
 				} elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
996
-					print '<span class="nomobile">'.round($spotter_item['distance']*0.539957,2).' nm</span>'."\n";
997
-					print '<span class="mobile">'.round($spotter_item['distance']*0.539957,2).' nm</span><br />'."\n";
996
+					print '<span class="nomobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span>'."\n";
997
+					print '<span class="mobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span><br />'."\n";
998 998
 				}
999 999
 			}
1000 1000
 			print '</td>'."\n";
1001 1001
 		}
1002
-		if(strtolower($current_page) != "upcoming"){
1002
+		if (strtolower($current_page) != "upcoming") {
1003 1003
 			if ($type == 'aircraft') {
1004 1004
 				//if ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
1005 1005
 				if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
 		
1043 1043
 		if ($showRouteStop) {
1044 1044
 		// Route stop
1045
-			if(strtolower($current_page) != "upcoming"){
1045
+			if (strtolower($current_page) != "upcoming") {
1046 1046
 				print '<td class="route_stop">'."\n";
1047 1047
 				if (!isset($spotter_item['route_stop']) || $spotter_item['route_stop'] == '' || $spotter_item['route_stop'] == 'NULL') {
1048 1048
 					print '<span class="nomobile">-</span>'."\n";
@@ -1061,11 +1061,11 @@  discard block
 block discarded – undo
1061 1061
 		}
1062 1062
 		if ($showDuration) {
1063 1063
 		// Duration
1064
-			if(strtolower($current_page) != "upcoming"){
1064
+			if (strtolower($current_page) != "upcoming") {
1065 1065
 				print '<td class="duration">'."\n";
1066 1066
 				if (isset($spotter_item['duration'])) {
1067
-					print '<span class="nomobile">'.gmdate('H:i:s',$spotter_item['duration']).'</span>'."\n";
1068
-					print '<span class="mobile">'.gmdate('H:i:s',$spotter_item['duration']).'</span>'."\n";
1067
+					print '<span class="nomobile">'.gmdate('H:i:s', $spotter_item['duration']).'</span>'."\n";
1068
+					print '<span class="mobile">'.gmdate('H:i:s', $spotter_item['duration']).'</span>'."\n";
1069 1069
 				} else {
1070 1070
 					print '<span class="nomobile">-</span>'."\n";
1071 1071
 					print '<span class="mobile">-</span>'."\n";
@@ -1078,7 +1078,7 @@  discard block
 block discarded – undo
1078 1078
 	if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") {
1079 1079
 		if (isset($spotter_item['decode']) && $spotter_item['decode'] != '') {
1080 1080
 			print '<td class="message"><p>'."\n";
1081
-			print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']);
1081
+			print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']);
1082 1082
 			print '</p><p class="decode">';
1083 1083
 			$decode_array = json_decode($spotter_item['decode']);
1084 1084
 			foreach ($decode_array as $key => $value) {
@@ -1088,7 +1088,7 @@  discard block
 block discarded – undo
1088 1088
 			print '</td>'."\n";
1089 1089
 		} else {
1090 1090
 			print '<td class="message">'."\n";
1091
-			print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']);
1091
+			print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']);
1092 1092
 			print '</td>'."\n";
1093 1093
 		}
1094 1094
 	}
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
 		}
1114 1114
 		print '</td>'."\n";
1115 1115
 		print '<td class="message">'."\n";
1116
-		print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']);
1116
+		print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']);
1117 1117
 		print '</td>'."\n";
1118 1118
 	}
1119 1119
 	if (strtolower($current_page) == "incident-latest" || strtolower($current_page) == "incident-detailed") {
@@ -1139,7 +1139,7 @@  discard block
 block discarded – undo
1139 1139
 		print '</td>'."\n";
1140 1140
 		*/
1141 1141
 		print '<td class="message">'."\n";
1142
-		print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']);
1142
+		print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']);
1143 1143
 		print '</td>'."\n";
1144 1144
 	}
1145 1145
 
Please login to merge, or discard this patch.
Braces   +68 added lines, -25 removed lines patch added patch discarded remove patch
@@ -7,7 +7,9 @@  discard block
 block discarded – undo
7 7
 $showRouteStop = $Common->multiKeyExists($spotter_array,'route_stop');
8 8
 $showDuration = $Common->multiKeyExists($spotter_array,'duration');
9 9
 
10
-if (!isset($type)) $type = 'aircraft';
10
+if (!isset($type)) {
11
+	$type = 'aircraft';
12
+}
11 13
 
12 14
 if (!isset($_GET['sort'])) 
13 15
 {
@@ -492,7 +494,9 @@  discard block
 block discarded – undo
492 494
 	if (isset($globalTimezone))
493 495
 	{
494 496
 		date_default_timezone_set($globalTimezone);
495
-	} else date_default_timezone_set('UTC');
497
+	} else {
498
+		date_default_timezone_set('UTC');
499
+	}
496 500
 	if ($showSpecial === true)
497 501
 	{
498 502
 		print '<tr class="special">'."\n";
@@ -507,7 +511,9 @@  discard block
 block discarded – undo
507 511
 			print '<tr class="active">';
508 512
 		} elseif (isset($spotter_item['spotted_registration'])) {
509 513
 			print '<tr class="info">';
510
-		} else print '<tr>';
514
+		} else {
515
+			print '<tr>';
516
+		}
511 517
 	}
512 518
 	if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive" || strtolower($current_page) == "currently" || strtolower($current_page) == "accident-latest" || strtolower($current_page) == "incident-latest" || strtolower($current_page) == "accident-detailed" || strtolower($current_page) == "incident-detailed") {
513 519
 		if ($type == 'aircraft') {
@@ -515,8 +521,9 @@  discard block
 block discarded – undo
515 521
 			{
516 522
 				print '<td class="aircraft_thumbnail">'."\n";
517 523
 				if ($spotter_item['image_source'] == 'planespotters') {
518
-					if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website'];
519
-					else {
524
+					if ($spotter_item['image_source_website'] != '') {
525
+						$image_src = $spotter_item['image_source_website'];
526
+					} else {
520 527
 						$planespotter_url_array = explode("_", $spotter_item['image']);
521 528
 						$planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]);
522 529
 						$image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
@@ -529,7 +536,9 @@  discard block
 block discarded – undo
529 536
 				} else {
530 537
 					if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
531 538
 						$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
532
-					} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
539
+					} else {
540
+						$image_thumbnail = $spotter_item['image_thumbnail'];
541
+					}
533 542
 					if (isset($spotter_item['airline_name'])) {
534 543
 						print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
535 544
 					} else {
@@ -548,7 +557,9 @@  discard block
 block discarded – undo
548 557
 				print '<td class="aircraft_thumbnail">'."\n";
549 558
 				if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
550 559
 					$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
551
-				} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
560
+				} else {
561
+					$image_thumbnail = $spotter_item['image_thumbnail'];
562
+				}
552 563
 				if (isset($spotter_item['airline_name'])) {
553 564
 					print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['mmsi'].'" alt="'.$spotter_item['mmsi'].'" data-content="'._("MMSI:").' '.$spotter_item['mmsi'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
554 565
 				} else {
@@ -566,7 +577,9 @@  discard block
 block discarded – undo
566 577
 				print '<td class="aircraft_thumbnail">'."\n";
567 578
 				if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
568 579
 					$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
569
-				} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
580
+				} else {
581
+					$image_thumbnail = $spotter_item['image_thumbnail'];
582
+				}
570 583
 				print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['type'].'" data-content="'._("Type:").' '.$spotter_item['type'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
571 584
 				print '</td>'."\n";
572 585
 			} else {
@@ -619,8 +632,9 @@  discard block
 block discarded – undo
619 632
 				print '<td class="aircraft_thumbnail">'."\n";
620 633
 				//print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$spotter_item['image_thumbnail'].'" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>';
621 634
 				if ($spotter_item['image_source'] == 'planespotters') {
622
-					if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website'];
623
-					else {
635
+					if ($spotter_item['image_source_website'] != '') {
636
+						$image_src = $spotter_item['image_source_website'];
637
+					} else {
624 638
 						$planespotter_url_array = explode("_", $spotter_array[0]['image']);
625 639
 						$planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]);
626 640
 						$image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
@@ -637,7 +651,9 @@  discard block
 block discarded – undo
637 651
 				} else {
638 652
 					if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
639 653
 						$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
640
-					} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
654
+					} else {
655
+						$image_thumbnail = $spotter_item['image_thumbnail'];
656
+					}
641 657
 					if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) {
642 658
 						print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
643 659
 					} elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) {
@@ -670,7 +686,9 @@  discard block
 block discarded – undo
670 686
 				print '<td class="aircraft_thumbnail">'."\n";
671 687
 				if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
672 688
 					$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
673
-				} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
689
+				} else {
690
+					$image_thumbnail = $spotter_item['image_thumbnail'];
691
+				}
674 692
 				print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['mmsi'].'" alt="'.$spotter_item['mmsi'].'" data-content="'._("MMSI:").' '.$spotter_item['mmsi'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
675 693
 				print '</td>'."\n";
676 694
 			} else {
@@ -684,7 +702,9 @@  discard block
 block discarded – undo
684 702
 				print '<td class="aircraft_thumbnail">'."\n";
685 703
 				if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
686 704
 					$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
687
-				} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
705
+				} else {
706
+					$image_thumbnail = $spotter_item['image_thumbnail'];
707
+				}
688 708
 				print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['type'].'" data-content="'._("Type:").' '.$spotter_item['type'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
689 709
 				print '</td>'."\n";
690 710
 			} else {
@@ -802,8 +822,11 @@  discard block
 block discarded – undo
802 822
 				print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a></span>'."\n";
803 823
 			} else {
804 824
 				$aircraft_names = explode('/',$spotter_item['aircraft_name']);
805
-				if (count($aircraft_names) == 1) print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</a></span>'."\n";
806
-				else print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].'</a></span>'."\n";
825
+				if (count($aircraft_names) == 1) {
826
+					print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</a></span>'."\n";
827
+				} else {
828
+					print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].'</a></span>'."\n";
829
+				}
807 830
 			}
808 831
 			print '<span class="mobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a></span>'."\n";
809 832
 		} elseif ($type == 'marine') {
@@ -846,15 +869,21 @@  discard block
 block discarded – undo
846 869
 			if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) {
847 870
 				if ($spotter_item['departure_airport_time'] > 2460) {
848 871
 					$departure_airport_time = date('H:m',$spotter_item['departure_airport_time']);
849
-				} else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2);
872
+				} else {
873
+					$departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2);
874
+				}
850 875
 				if ($spotter_item['real_departure_airport_time'] > 2460) {
851 876
 					$real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']);
852
-				} else $real_departure_airport_time = $spotter_item['real_departure_airport_time'];
877
+				} else {
878
+					$real_departure_airport_time = $spotter_item['real_departure_airport_time'];
879
+				}
853 880
 				print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n";
854 881
 			} elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') {
855 882
 				if ($spotter_item['real_departure_airport_time'] > 2460) {
856 883
 					$real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']);
857
-				} else $real_departure_airport_time = $spotter_item['real_departure_airport_time'];
884
+				} else {
885
+					$real_departure_airport_time = $spotter_item['real_departure_airport_time'];
886
+				}
858 887
 				print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n";
859 888
 			} elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') {
860 889
 				if ($spotter_item['departure_airport_time'] > 2460) {
@@ -876,7 +905,9 @@  discard block
 block discarded – undo
876 905
 						$longitude = $spotter_item['longitude'];
877 906
 					}
878 907
 					$distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude);
879
-				} else $distance = '';
908
+				} else {
909
+					$distance = '';
910
+				}
880 911
 				if ($distance != '') {
881 912
 					if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
882 913
 						echo '<br/><i>'.round($distance*0.539957).' nm</i>';
@@ -903,7 +934,9 @@  discard block
 block discarded – undo
903 934
 			} else {
904 935
 				if (isset($spotter_item['real_arrival_airport']) && $spotter_item['real_arrival_airport'] != $spotter_item['arrival_airport']) {
905 936
 					print '<span class="nomobile">Scheduled : <a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'">'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</a></span>'."\n";
906
-					if (!isset($Spotter)) $Spotter = new Spotter();
937
+					if (!isset($Spotter)) {
938
+						$Spotter = new Spotter();
939
+					}
907 940
 					$arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['real_arrival_airport']);
908 941
 					print '<br /><span class="nomobile">'._("Real:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$arrival_airport_info[0]['city'].','.$arrival_airport_info[0]['country'].' ('.$spotter_item['real_arrival_airport'].')</a></span>'."\n";
909 942
 					print '<span class="mobile">'._("Scheduled:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$spotter_item['real_arrival_airport'].'</a></span>'."\n";
@@ -919,20 +952,28 @@  discard block
 block discarded – undo
919 952
 			if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) {
920 953
 				if ($spotter_item['arrival_airport_time'] > 2460) {
921 954
 					$arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']);
922
-				} else $arrival_airport_time = $spotter_item['arrival_airport_time'];
955
+				} else {
956
+					$arrival_airport_time = $spotter_item['arrival_airport_time'];
957
+				}
923 958
 				if ($spotter_item['real_arrival_airport_time'] > 2460) {
924 959
 					$real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']);
925
-				} else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
960
+				} else {
961
+					$real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
962
+				}
926 963
 				print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n";
927 964
 			} elseif (isset($spotter_item['real_arrival_airport_time'])) {
928 965
 				if ($spotter_item['real_arrival_airport_time'] > 2460) {
929 966
 					$real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']);
930
-				} else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
967
+				} else {
968
+					$real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
969
+				}
931 970
 				print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n";
932 971
 			} elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') {
933 972
 				if ($spotter_item['arrival_airport_time'] > 2460) {
934 973
 					$arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']);
935
-				} else $arrival_airport_time = $spotter_item['arrival_airport_time'];
974
+				} else {
975
+					$arrival_airport_time = $spotter_item['arrival_airport_time'];
976
+				}
936 977
 				print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n";
937 978
 			}
938 979
 			if (!isset($spotter_item['real_arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
@@ -945,7 +986,9 @@  discard block
 block discarded – undo
945 986
 						$longitude = $spotter_item['longitude'];
946 987
 					}
947 988
 					$distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude);
948
-				} else $distance = '';
989
+				} else {
990
+					$distance = '';
991
+				}
949 992
 				if ($distance != '') {
950 993
 					if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
951 994
 						echo '<br/><i>'.round($distance*0.539957).' nm</i>';
Please login to merge, or discard this patch.
require/class.Elevation.php 3 patches
Doc Comments   +11 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,6 +52,10 @@  discard block
 block discarded – undo
52 52
 		$this->openedFiles = [];
53 53
 	}
54 54
 
55
+	/**
56
+	 * @param double $row
57
+	 * @param double $column
58
+	 */
55 59
 	private function getElevationAtPosition($fileName, $row, $column) {
56 60
 		if (!array_key_exists($fileName, $this->openedFiles)) {
57 61
 			if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) {
@@ -85,7 +89,7 @@  discard block
 block discarded – undo
85 89
 	 * @param float $lon
86 90
 	 * @param null  $fName
87 91
 	 *
88
-	 * @return mixed
92
+	 * @return double
89 93
 	 * @throws \Exception
90 94
 	 */
91 95
 	public function getElevation($lat, $lon, &$fName = null) {
@@ -142,6 +146,9 @@  discard block
 block discarded – undo
142 146
 		return $zN;
143 147
 	}
144 148
 
149
+	/**
150
+	 * @param integer $numPrefix
151
+	 */
145 152
 	private function getDeg($deg, $numPrefix) {
146 153
 		$deg = abs($deg);
147 154
 		$d   = floor($deg);     // round degrees
@@ -156,6 +163,9 @@  discard block
 block discarded – undo
156 163
 		return $d;
157 164
 	}
158 165
 
166
+	/**
167
+	 * @param double $deg
168
+	 */
159 169
 	private function getSec($deg) {
160 170
 		$deg = abs($deg);
161 171
 		$sec = round($deg * 3600, 4);
Please login to merge, or discard this patch.
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,7 +28,9 @@  discard block
 block discarded – undo
28 28
 	private $openedFiles = [];
29 29
 
30 30
 	public function __construct($htgFilesDestination = '', $resolution = 3) {
31
-		if ($htgFilesDestination == '') $htgFilesDestination = dirname(__FILE__).'/../data/';
31
+		if ($htgFilesDestination == '') {
32
+			$htgFilesDestination = dirname(__FILE__).'/../data/';
33
+		}
32 34
 		$this->htgFilesDestination = $htgFilesDestination;
33 35
 		$this->resolution          = $resolution;
34 36
 		switch ($resolution) {
@@ -171,16 +173,26 @@  discard block
 block discarded – undo
171 173
 		$fileName  = "N{$N}E{$E}.hgt";
172 174
 		if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) {
173 175
 			$Common = new Common();
174
-			if ($debug) echo 'Downloading '.$fileName.'.gz ...';
176
+			if ($debug) {
177
+				echo 'Downloading '.$fileName.'.gz ...';
178
+			}
175 179
 			$Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz');
176 180
 			if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz')) {
177
-				if ($debug) echo "File '{$fileName}.gz' not exists.";
181
+				if ($debug) {
182
+					echo "File '{$fileName}.gz' not exists.";
183
+				}
178 184
 				return false;
179 185
 			}
180
-			if ($debug) echo 'Done'."\n";
181
-			if ($debug) echo 'Decompress '.$fileName.' ....';
186
+			if ($debug) {
187
+				echo 'Done'."\n";
188
+			}
189
+			if ($debug) {
190
+				echo 'Decompress '.$fileName.' ....';
191
+			}
182 192
 			$Common->gunzip($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName);
183
-			if ($debug) echo 'Done'."\n";
193
+			if ($debug) {
194
+				echo 'Done'."\n";
195
+			}
184 196
 			unlink($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz');
185 197
 		}
186 198
 		return true;
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 			default:
42 42
 				throw new \Exception("bad resolution can be only one of 1,3");
43 43
 		}
44
-		register_shutdown_function(function () {
44
+		register_shutdown_function(function() {
45 45
 			$this->closeAllFiles();
46 46
 		});
47 47
 	}
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 
56 56
 	private function getElevationAtPosition($fileName, $row, $column) {
57 57
 		if (!array_key_exists($fileName, $this->openedFiles)) {
58
-			if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) {
58
+			if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName)) {
59 59
 				throw new \Exception("File '{$fileName}' not exists.");
60 60
 			}
61
-			$file = fopen($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName, "r");
61
+			$file = fopen($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName, "r");
62 62
 			if ($file === false) {
63 63
 				throw new \Exception("Cant open file '{$fileName}' for reading.");
64 64
 			}
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 			throw new \Exception("Not implemented yet");
73 73
 		}
74 74
 		$aRow     = $this->measPerDeg - $row;
75
-		$position = ($this->measPerDeg * ($aRow - 1)) + $column;
75
+		$position = ($this->measPerDeg*($aRow - 1)) + $column;
76 76
 		$position *= 2;
77 77
 		fseek($file, $position);
78 78
 		$short  = fread($file, 2);
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 		$latSec = $this->getSec($lat);
101 101
 		$lonSec = $this->getSec($lon);
102 102
 
103
-		$Xn = round($latSec / $this->resolution, 3);
104
-		$Yn = round($lonSec / $this->resolution, 3);
103
+		$Xn = round($latSec/$this->resolution, 3);
104
+		$Yn = round($lonSec/$this->resolution, 3);
105 105
 
106 106
 		$a1 = round($Xn);
107 107
 		$a2 = round($Yn);
@@ -133,55 +133,55 @@  discard block
 block discarded – undo
133 133
 		$b3 = $this->getElevationAtPosition($fName, $b1, $b2);
134 134
 		$c3 = $this->getElevationAtPosition($fName, $c1, $c2);
135 135
 
136
-		$n1 = ($c2 - $a2) * ($b3 - $a3) - ($c3 - $a3) * ($b2 - $a2);
137
-		$n2 = ($c3 - $a3) * ($b1 - $a1) - ($c1 - $a1) * ($b3 - $a3);
138
-		$n3 = ($c1 - $a1) * ($b2 - $a2) - ($c2 - $a2) * ($b1 - $a1);
136
+		$n1 = ($c2 - $a2)*($b3 - $a3) - ($c3 - $a3)*($b2 - $a2);
137
+		$n2 = ($c3 - $a3)*($b1 - $a1) - ($c1 - $a1)*($b3 - $a3);
138
+		$n3 = ($c1 - $a1)*($b2 - $a2) - ($c2 - $a2)*($b1 - $a1);
139 139
 
140
-		$d  = -$n1 * $a1 - $n2 * $a2 - $n3 * $a3;
141
-		$zN = (-$n1 * $Xn - $n2 * $Yn - $d) / $n3;
140
+		$d  = -$n1*$a1 - $n2*$a2 - $n3*$a3;
141
+		$zN = (-$n1*$Xn - $n2*$Yn - $d)/$n3;
142 142
 
143 143
 		return $zN;
144 144
 	}
145 145
 
146 146
 	private function getDeg($deg, $numPrefix) {
147 147
 		$deg = abs($deg);
148
-		$d   = floor($deg);     // round degrees
148
+		$d   = floor($deg); // round degrees
149 149
 		if ($numPrefix >= 3) {
150 150
 			if ($d < 100) {
151
-				$d = '0' . $d;
151
+				$d = '0'.$d;
152 152
 			}
153 153
 		} // pad with leading zeros
154 154
 		if ($d < 10) {
155
-			$d = '0' . $d;
155
+			$d = '0'.$d;
156 156
 		}
157 157
 		return $d;
158 158
 	}
159 159
 
160 160
 	private function getSec($deg) {
161 161
 		$deg = abs($deg);
162
-		$sec = round($deg * 3600, 4);
163
-		$m   = fmod(floor($sec / 60), 60);
162
+		$sec = round($deg*3600, 4);
163
+		$m   = fmod(floor($sec/60), 60);
164 164
 		$s   = round(fmod($sec, 60), 4);
165
-		return ($m * 60) + $s;
165
+		return ($m*60) + $s;
166 166
 	}
167 167
 
168
-	public function download($lat,$lon, $debug = false) {
168
+	public function download($lat, $lon, $debug = false) {
169 169
 		$N      = $this->getDeg($lat, 2);
170 170
 		$E      = $this->getDeg($lon, 3);
171
-		$fileName  = "N{$N}E{$E}.hgt";
172
-		if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) {
171
+		$fileName = "N{$N}E{$E}.hgt";
172
+		if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName)) {
173 173
 			$Common = new Common();
174 174
 			if ($debug) echo 'Downloading '.$fileName.'.gz ...';
175
-			$Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz');
176
-			if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz')) {
175
+			$Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz', $this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz');
176
+			if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz')) {
177 177
 				if ($debug) echo "File '{$fileName}.gz' not exists.";
178 178
 				return false;
179 179
 			}
180 180
 			if ($debug) echo 'Done'."\n";
181 181
 			if ($debug) echo 'Decompress '.$fileName.' ....';
182
-			$Common->gunzip($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName);
182
+			$Common->gunzip($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz', $this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName);
183 183
 			if ($debug) echo 'Done'."\n";
184
-			unlink($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz');
184
+			unlink($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz');
185 185
 		}
186 186
 		return true;
187 187
 	}
@@ -194,22 +194,22 @@  discard block
 block discarded – undo
194 194
 		try {
195 195
 			$sth = $db->prepare($query);
196 196
 			$sth->execute($query_values);
197
-		} catch(PDOException $e) {
197
+		} catch (PDOException $e) {
198 198
 			return "error : ".$e->getMessage();
199 199
 		}
200 200
 		while ($data = $sth->fetch(PDO::FETCH_ASSOC)) {
201
-			$this->download($data['latitude'],$data['longitude'],true);
201
+			$this->download($data['latitude'], $data['longitude'], true);
202 202
 		}
203 203
 		$query = 'SELECT latitude, longitude FROM tracker_output WHERE latitude <> 0 AND longitude <> 0 ORDER BY date DESC LIMIT 10';
204 204
 		$query_values = array();
205 205
 		try {
206 206
 			$sth = $db->prepare($query);
207 207
 			$sth->execute($query_values);
208
-		} catch(PDOException $e) {
208
+		} catch (PDOException $e) {
209 209
 			return "error : ".$e->getMessage();
210 210
 		}
211 211
 		while ($data = $sth->fetch(PDO::FETCH_ASSOC)) {
212
-			$this->download($data['latitude'],$data['longitude'],true);
212
+			$this->download($data['latitude'], $data['longitude'], true);
213 213
 		}
214 214
 	}
215 215
 }
Please login to merge, or discard this patch.
require/class.GeoidHeight.php 3 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -91,6 +91,10 @@
 block discarded – undo
91 91
 		$this->rlatres = (($this->height - 1) / 180.0);
92 92
 	}
93 93
 
94
+	/**
95
+	 * @param integer $ix
96
+	 * @param integer $iy
97
+	 */
94 98
 	private function _rawval($ix,$iy) {
95 99
 		if (($iy < 0)) {
96 100
 			$iy = -$iy;
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 * Translated to PHP of GeographicLib/src/Geoid.cpp
12 12
 * by Ycarus <[email protected]> in 2017
13 13
 */
14
-class GeoidHeight  {
14
+class GeoidHeight {
15 15
 	private $c0 = 240;
16 16
 	private $c3 = [[9, -18, -88, 0, 96, 90, 0, 0, -60, -20], [-9, 18, 8, 0, -96, 30, 0, 0, 60, -20], [9, -88, -18, 90, 96, 0, -20, -60, 0, 0], [186, -42, -42, -150, -96, -150, 60, 60, 60, 60], [54, 162, -78, 30, -24, -90, -60, 60, -60, 60], [-9, -32, 18, 30, 24, 0, 20, -60, 0, 0], [-9, 8, 18, 30, -96, 0, -20, 60, 0, 0], [54, -78, 162, -90, -24, 30, 60, -60, 60, -60], [-54, 78, 78, 90, 144, 90, -60, -60, -60, -60], [9, -8, -18, -30, -24, 0, 20, 60, 0, 0], [-9, 18, -32, 0, 24, 30, 0, 0, -60, 20], [9, -18, -8, 0, -24, -30, 0, 0, 60, 20]];
17 17
 	private $c0n = 372;
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	private $v10 = null;
35 35
 	private $v11 = null;
36 36
 
37
-	public function __construct($name='') {
37
+	public function __construct($name = '') {
38 38
 		global $globalGeoidSource;
39 39
 		//if ($name == '') $name = dirname(__FILE__).'/../install/tmp/egm2008-1.pgm';
40 40
 		if ($name == '') {
@@ -42,35 +42,35 @@  discard block
 block discarded – undo
42 42
 			else $name = dirname(__FILE__).'/../data/egm96-15.pgm';
43 43
 		}
44 44
 
45
-		$f = @fopen($name,"r");
45
+		$f = @fopen($name, "r");
46 46
 		if ($f === FALSE) {
47 47
 			throw new Exception("Can't open ".$name);
48 48
 		}
49
-		$line = fgets($f,4096);
49
+		$line = fgets($f, 4096);
50 50
 		if (trim($line) != 'P5') {
51 51
 			throw new Exception('No PGM header');
52 52
 		}
53 53
 		$headerlen = strlen($line);
54 54
 		while (true) {
55
-			$line = fgets($f,4096);
55
+			$line = fgets($f, 4096);
56 56
 			if ((strlen($line) == 0)) {
57 57
 				throw new Exception('EOF before end of file header');
58 58
 			}
59 59
 			$headerlen += strlen($line);
60
-			if (strpos($line,'# Offset ') !== FALSE) {
60
+			if (strpos($line, '# Offset ') !== FALSE) {
61 61
 				$this->offset = substr($line, 9);
62
-			} else if (strpos($line,'# Scale ') !== FALSE) {
62
+			} else if (strpos($line, '# Scale ') !== FALSE) {
63 63
 				$this->scale = substr($line, 8);
64
-			} else if ((strpos($line,'#') === FALSE)) {
65
-				list($this->width, $this->height) = preg_split('/\s+/',$line);
64
+			} else if ((strpos($line, '#') === FALSE)) {
65
+				list($this->width, $this->height) = preg_split('/\s+/', $line);
66 66
 				break;
67 67
 			}
68 68
 		}
69
-		$line = fgets($f,4096);
69
+		$line = fgets($f, 4096);
70 70
 		$headerlen += strlen($line);
71
-		$levels = (int)$line;
72
-		$this->width = (int)$this->width;
73
-		$this->height = (int)$this->height;
71
+		$levels = (int) $line;
72
+		$this->width = (int) $this->width;
73
+		$this->height = (int) $this->height;
74 74
 		if (($levels != 65535)) {
75 75
 			throw new Exception('PGM file must have 65535 gray levels ('.$levels.')');
76 76
 		}
@@ -85,42 +85,42 @@  discard block
 block discarded – undo
85 85
 		}
86 86
 
87 87
 		$fullsize = filesize($name);
88
-		if ((($fullsize - $headerlen) != (($this->width * $this->height) * 2))) {
88
+		if ((($fullsize - $headerlen) != (($this->width*$this->height)*2))) {
89 89
 			throw new Exception('File has the wrong length');
90 90
 		}
91 91
 
92 92
 		$this->headerlen = $headerlen;
93
-		$this->raw= $f;
94
-		$this->rlonres = ($this->width / 360.0);
95
-		$this->rlatres = (($this->height - 1) / 180.0);
93
+		$this->raw = $f;
94
+		$this->rlonres = ($this->width/360.0);
95
+		$this->rlatres = (($this->height - 1)/180.0);
96 96
 	}
97 97
 
98
-	private function _rawval($ix,$iy) {
98
+	private function _rawval($ix, $iy) {
99 99
 		if (($iy < 0)) {
100 100
 			$iy = -$iy;
101
-			$ix += ($this->width / 2);
101
+			$ix += ($this->width/2);
102 102
 		} else if (($iy >= $this->height)) {
103
-			$iy = ((2 * ($this->height - 1)) - $iy);
104
-			$ix += ($this->width / 2);
103
+			$iy = ((2*($this->height - 1)) - $iy);
104
+			$ix += ($this->width/2);
105 105
 		}
106 106
 		if (($ix < 0)) {
107 107
 			$ix += $this->width;
108 108
 		} else if (($ix >= $this->width)) {
109 109
 			$ix -= $this->width;
110 110
 		}
111
-		$k = ((($iy * $this->width) + $ix) * 2) + $this->headerlen;
112
-		fseek($this->raw,$k);
113
-		return unpack('n',fread($this->raw,2))[1];
111
+		$k = ((($iy*$this->width) + $ix)*2) + $this->headerlen;
112
+		fseek($this->raw, $k);
113
+		return unpack('n', fread($this->raw, 2))[1];
114 114
 	}
115 115
 
116
-	public function get($lat,$lon,$cubic=true) {
116
+	public function get($lat, $lon, $cubic = true) {
117 117
 		if (($lon < 0)) {
118 118
 			$lon += 360;
119 119
 		}
120
-		$fy = ((90 - $lat) * $this->rlatres);
121
-		$fx = ($lon * $this->rlonres);
122
-		$iy = (int)$fy;
123
-		$ix = (int)$fx;
120
+		$fy = ((90 - $lat)*$this->rlatres);
121
+		$fx = ($lon*$this->rlonres);
122
+		$iy = (int) $fy;
123
+		$ix = (int) $fx;
124 124
 		$fx -= $ix;
125 125
 		$fy -= $iy;
126 126
 		$t = array();
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 					$c3x = $this->c3;
148 148
 					$c0x = $this->c0;
149 149
 				}
150
-				for ($i = 0; $i < 10;++$i) {
150
+				for ($i = 0; $i < 10; ++$i) {
151 151
 					$t[$i] = 0;
152 152
 					for ($j = 0; $j < 12; ++$j) {
153 153
 						$t[$i] += $v[$j]*$c3x[$j][$i];
@@ -158,13 +158,13 @@  discard block
 block discarded – undo
158 158
 			$this->t = $t;
159 159
 		} else $t = $this->t;
160 160
 		if (!($cubic)) {
161
-			$a = (((1 - $fx) * $this->v00) + ($fx * $this->v01));
162
-			$b = (((1 - $fx) * $this->v10) + ($fx * $this->v11));
163
-			$h = (((1 - $fy) * $a) + ($fy * $b));
161
+			$a = (((1 - $fx)*$this->v00) + ($fx*$this->v01));
162
+			$b = (((1 - $fx)*$this->v10) + ($fx*$this->v11));
163
+			$h = (((1 - $fy)*$a) + ($fy*$b));
164 164
 		} else {
165
-			$h = (($t[0] + ($fx * ($t[1] + ($fx * ($t[3] + ($fx * $t[6])))))) + ($fy * (($t[2] + ($fx * ($t[4] + ($fx * $t[7])))) + ($fy * (($t[5] + ($fx * $t[8])) + ($fy * $t[9]))))));
165
+			$h = (($t[0] + ($fx*($t[1] + ($fx*($t[3] + ($fx*$t[6])))))) + ($fy*(($t[2] + ($fx*($t[4] + ($fx*$t[7])))) + ($fy*(($t[5] + ($fx*$t[8])) + ($fy*$t[9]))))));
166 166
 		}
167
-		return ((float)$this->offset + ((float)$this->scale * (float)$h));
167
+		return ((float) $this->offset + ((float) $this->scale*(float) $h));
168 168
 	}
169 169
 }
170 170
 /*
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,8 +38,11 @@  discard block
 block discarded – undo
38 38
 		global $globalGeoidSource;
39 39
 		//if ($name == '') $name = dirname(__FILE__).'/../install/tmp/egm2008-1.pgm';
40 40
 		if ($name == '') {
41
-			if (isset($globalGeoidSource) && $globalGeoidSource != '') $name = dirname(__FILE__).'/../data/'.$globalGeoidSource.'.pgm';
42
-			else $name = dirname(__FILE__).'/../data/egm96-15.pgm';
41
+			if (isset($globalGeoidSource) && $globalGeoidSource != '') {
42
+				$name = dirname(__FILE__).'/../data/'.$globalGeoidSource.'.pgm';
43
+			} else {
44
+				$name = dirname(__FILE__).'/../data/egm96-15.pgm';
45
+			}
43 46
 		}
44 47
 
45 48
 		$f = @fopen($name,"r");
@@ -156,7 +159,9 @@  discard block
 block discarded – undo
156 159
 				}
157 160
 			}
158 161
 			$this->t = $t;
159
-		} else $t = $this->t;
162
+		} else {
163
+			$t = $this->t;
164
+		}
160 165
 		if (!($cubic)) {
161 166
 			$a = (((1 - $fx) * $this->v00) + ($fx * $this->v01));
162 167
 			$b = (((1 - $fx) * $this->v10) + ($fx * $this->v11));
Please login to merge, or discard this patch.
require/settings.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 $globalLongitudeMin = '1.0'; //the minimum longitude (east)
43 43
 
44 44
 $globalCenterLatitude = '46.38'; //the latitude center of your coverage area
45
-$globalCenterLongitude = '5.29';//the longitude center of your coverage area
45
+$globalCenterLongitude = '5.29'; //the longitude center of your coverage area
46 46
 
47 47
 $globalLiveZoom = '9'; //default zoom on Live Map
48 48
 $globalAirportZoom = '7'; //default zoom to begin to display airports icons
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 $globalACARS = FALSE;
152 152
 $globalACARSHost = '0.0.0.0'; // Local IP to listen
153 153
 $globalACARSPort = '9999';
154
-$globalACARSArchive = array('10','80','81','82','3F'); // labels of messages to archive
154
+$globalACARSArchive = array('10', '80', '81', '82', '3F'); // labels of messages to archive
155 155
 $globalACARSArchiveKeepMonths = '0';
156 156
 
157 157
 //APRS configuration (for glidernet)
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 //Check by aircraft ICAO if image is not found by registration
249 249
 $globalAircraftImageCheckICAO = TRUE;
250 250
 //Sources for Aircraft image
251
-$globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters','customsources');
251
+$globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters', 'customsources');
252 252
 // Custom source configuration {registration} will be replaced by aircraft registration (exif get copyright from exif data for each pic)
253 253
 // example of config : $globalAircraftImageCustomSources = array('thumbnail' => 'http://pics.myurl.com/thumbnail/{registration}.jpg','original' => 'http://myurl/original/{registration}.jpg','source_website' => 'https://www.myurl.com', 'source' => 'customsite', 'copyright' => 'myself','exif' => true);
254 254
 // ************************
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 //Retrieve Image from externals sources
258 258
 $globalMarineImageFetch = TRUE;
259 259
 //Sources for Marine image
260
-$globalMarineImageSources = array('wikimedia','flickr','deviantart','bing','customsources');
260
+$globalMarineImageSources = array('wikimedia', 'flickr', 'deviantart', 'bing', 'customsources');
261 261
 // Custom source configuration {mmsi} will be replaced by vessel mmsi, {name} by it's name (exif get copyright from exif data for each pic)
262 262
 // example of config : $globalMarineImageCustomSources = array('thumbnail' => 'http://pics.myurl.com/thumbnail/{name}.jpg','original' => 'http://myurl/original/{name}.jpg','source_website' => 'https://www.myurl.com', 'source' => 'customsite', 'copyright' => 'myself','exif' => true);
263 263
 // ************************
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 //Retrieve schedules from externals sources (set to FALSE for IVAO or if $globalFork = FALSE)
266 266
 $globalSchedulesFetch = TRUE;
267 267
 //Sources for airline schedule if not official airline site
268
-$globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
268
+$globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware');
269 269
 
270 270
 //Retrieve translation from external sources (set to FALSE for IVAO)
271 271
 $globalTranslationFetch = TRUE;
Please login to merge, or discard this patch.
import/callback.php 2 patches
Braces   +39 added lines, -13 removed lines patch added patch discarded remove patch
@@ -27,15 +27,21 @@  discard block
 block discarded – undo
27 27
 		}
28 28
 	}
29 29
 }
30
-if ($authorize === false) die;
30
+if ($authorize === false) {
31
+	die;
32
+}
31 33
 
32
-if (isset($globalTracker) && $globalTracker) require_once(dirname(__FILE__).'/../require/class.TrackerImport.php');
34
+if (isset($globalTracker) && $globalTracker) {
35
+	require_once(dirname(__FILE__).'/../require/class.TrackerImport.php');
36
+}
33 37
 if (isset($globalMarine) && $globalMarine) {
34 38
 	require_once(dirname(__FILE__).'/../require/class.AIS.php');
35 39
 	require_once(dirname(__FILE__).'/../require/class.MarineImport.php');
36 40
 }
37 41
 
38
-if (!isset($globalDebug)) $globalDebug = FALSE;
42
+if (!isset($globalDebug)) {
43
+	$globalDebug = FALSE;
44
+}
39 45
 
40 46
 // Check if schema is at latest version
41 47
 $Connection = new Connection();
@@ -45,10 +51,16 @@  discard block
 block discarded – undo
45 51
 }
46 52
 
47 53
 if (isset($globalServer) && $globalServer) {
48
-	if ($globalDebug) echo "Using Server Mode\n";
54
+	if ($globalDebug) {
55
+		echo "Using Server Mode\n";
56
+	}
49 57
 	$SI=new SpotterServer();
50
-} else $SI=new SpotterImport($Connection->db);
51
-if (isset($globalTracker) && $globalTracker) $TI = new TrackerImport($Connection->db);
58
+} else {
59
+	$SI=new SpotterImport($Connection->db);
60
+}
61
+if (isset($globalTracker) && $globalTracker) {
62
+	$TI = new TrackerImport($Connection->db);
63
+}
52 64
 if (isset($globalMarine) && $globalMarine) {
53 65
 	$AIS = new AIS();
54 66
 	$MI = new MarineImport($Connection->db);
@@ -57,7 +69,9 @@  discard block
 block discarded – undo
57 69
 date_default_timezone_set('UTC');
58 70
 
59 71
 $buffer = '';
60
-if (isset($_POST)) $buffer = $_POST;
72
+if (isset($_POST)) {
73
+	$buffer = $_POST;
74
+}
61 75
 $data = array();
62 76
 if (isset($buffer['type_event']) && isset($buffer['lat']) && isset($buffer['lon'])) {
63 77
 	$data['ident'] = $buffer['device_id'];
@@ -68,15 +82,27 @@  discard block
 block discarded – undo
68 82
 	//$data['heading'] = $buffer['cap']; // Only N/S/E/W
69 83
 	$data['datetime'] = date('Y-m-d H:i:s',$buffer['timestamp']);
70 84
 	$data['comment'] = '';
71
-	if (isset($buffer['battery']) && $buffer['battery'] != '') $data['comment'] .= 'Battery: '.$buffer['battery'].'% ';
85
+	if (isset($buffer['battery']) && $buffer['battery'] != '') {
86
+		$data['comment'] .= 'Battery: '.$buffer['battery'].'% ';
87
+	}
72 88
 	//if (isset($buffer['snr']) && $buffer['snr'] != '') $data['comment'] .= 'SNR: '.$buffer['snr'].' ';
73
-	if (isset($buffer['temp']) && $buffer['temp'] != '') $data['comment'] .= 'Temperature: '.$buffer['temp'].'°C ';
74
-	if (isset($buffer['press']) && $buffer['press'] != '') $data['comment'] .= 'Pressure: '.$buffer['press'].'hPa ';
89
+	if (isset($buffer['temp']) && $buffer['temp'] != '') {
90
+		$data['comment'] .= 'Temperature: '.$buffer['temp'].'°C ';
91
+	}
92
+	if (isset($buffer['press']) && $buffer['press'] != '') {
93
+		$data['comment'] .= 'Pressure: '.$buffer['press'].'hPa ';
94
+	}
75 95
 	$TI->add($data);
76 96
 	unset($data);
77 97
 }
78
-if (isset($SI)) $SI->checkAll();
79
-if (isset($MI)) $MI->checkAll();
80
-if (isset($TI)) $TI->checkAll();
98
+if (isset($SI)) {
99
+	$SI->checkAll();
100
+}
101
+if (isset($MI)) {
102
+	$MI->checkAll();
103
+}
104
+if (isset($TI)) {
105
+	$TI->checkAll();
106
+}
81 107
 
82 108
 ?>
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 require_once(dirname(__FILE__).'/../require/class.Source.php');
10 10
 require_once(dirname(__FILE__).'/../require/class.Connection.php');
11 11
 require_once(dirname(__FILE__).'/../require/class.Common.php');
12
-$Common=new Common();
12
+$Common = new Common();
13 13
 $authorize = false;
14 14
 $params = array();
15 15
 $userip = $Common->getUserIP();
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 			$authorize = true;
21 21
 			break;
22 22
 		}
23
-		if ($userip != '' && isset($cb['host']) && in_array($userip,explode(',',$cb['host']))) {
23
+		if ($userip != '' && isset($cb['host']) && in_array($userip, explode(',', $cb['host']))) {
24 24
 			$params = $globalSources[$key];
25 25
 			$authorize = true;
26 26
 			break;
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
 
47 47
 if (isset($globalServer) && $globalServer) {
48 48
 	if ($globalDebug) echo "Using Server Mode\n";
49
-	$SI=new SpotterServer();
50
-} else $SI=new SpotterImport($Connection->db);
49
+	$SI = new SpotterServer();
50
+} else $SI = new SpotterImport($Connection->db);
51 51
 if (isset($globalTracker) && $globalTracker) $TI = new TrackerImport($Connection->db);
52 52
 if (isset($globalMarine) && $globalMarine) {
53 53
 	$AIS = new AIS();
54 54
 	$MI = new MarineImport($Connection->db);
55 55
 }
56
-$Source=new Source($Connection->db);
56
+$Source = new Source($Connection->db);
57 57
 date_default_timezone_set('UTC');
58 58
 
59 59
 $buffer = '';
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	$data['altitude'] = round($buffer['altitude']*3.28084);
67 67
 	$data['speed'] = $buffer['speed'];
68 68
 	//$data['heading'] = $buffer['cap']; // Only N/S/E/W
69
-	$data['datetime'] = date('Y-m-d H:i:s',$buffer['timestamp']);
69
+	$data['datetime'] = date('Y-m-d H:i:s', $buffer['timestamp']);
70 70
 	$data['comment'] = '';
71 71
 	if (isset($buffer['battery']) && $buffer['battery'] != '') $data['comment'] .= 'Battery: '.$buffer['battery'].'% ';
72 72
 	//if (isset($buffer['snr']) && $buffer['snr'] != '') $data['comment'] .= 'SNR: '.$buffer['snr'].' ';
Please login to merge, or discard this patch.
require/class.ATC.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 	/**
15 15
 	* Get SQL query part for filter used
16 16
 	* @param Array $filter the filter
17
-	* @return Array the SQL part
17
+	* @return string the SQL part
18 18
 	*/
19 19
 	public function getFilter($filter = array(),$where = false,$and = false) {
20 20
 		global $globalFilter, $globalStatsFilters, $globalFilterName;
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
 	}
11 11
 
12 12
 	/**
13
-	* Get SQL query part for filter used
14
-	* @param Array $filter the filter
15
-	* @return Array the SQL part
16
-	*/
13
+	 * Get SQL query part for filter used
14
+	 * @param Array $filter the filter
15
+	 * @return Array the SQL part
16
+	 */
17 17
 	public function getFilter($filter = array(),$where = false,$and = false) {
18 18
 		global $globalFilter, $globalStatsFilters, $globalFilterName;
19 19
 		if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) {
Please login to merge, or discard this patch.
Braces   +20 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,7 +7,9 @@  discard block
 block discarded – undo
7 7
 	public function __construct($dbc = null) {
8 8
 		$Connection = new Connection($dbc);
9 9
 		$this->db = $Connection->db;
10
-		if ($this->db === null) die('Error: No DB connection. (ATC)');
10
+		if ($this->db === null) {
11
+			die('Error: No DB connection. (ATC)');
12
+		}
11 13
 	}
12 14
 
13 15
 	/**
@@ -20,20 +22,27 @@  discard block
 block discarded – undo
20 22
 		if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) {
21 23
 			if (isset($globalStatsFilters[$globalFilterName][0]['source'])) {
22 24
 				foreach($globalStatsFilters[$globalFilterName] as $source) {
23
-					if (isset($source['source'])) $filter['source'][] = $source['source'];
25
+					if (isset($source['source'])) {
26
+						$filter['source'][] = $source['source'];
27
+					}
24 28
 				}
25 29
 			} else {
26 30
 				$filter = $globalStatsFilters[$globalFilterName];
27 31
 			}
28 32
 		}
29
-		if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter);
33
+		if (is_array($globalFilter)) {
34
+			$filter = array_merge($filter,$globalFilter);
35
+		}
30 36
 		$filter_query_join = '';
31 37
 		$filter_query_where = '';
32 38
 		if (isset($filter['source']) && !empty($filter['source'])) {
33 39
 			$filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')";
34 40
 		}
35
-		if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE';
36
-		elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND';
41
+		if ($filter_query_where == '' && $where) {
42
+			$filter_query_where = ' WHERE';
43
+		} elseif ($filter_query_where != '' && $and) {
44
+			$filter_query_where .= ' AND';
45
+		}
37 46
 		$filter_query = $filter_query_join.$filter_query_where;
38 47
 		return $filter_query;
39 48
 	}
@@ -90,7 +99,9 @@  discard block
 block discarded – undo
90 99
 		$info = str_replace('^','<br />',$info);
91 100
 		$info = str_replace('&amp;sect;','',$info);
92 101
 		$info = str_replace('"','',$info);
93
-		if ($type == '') $type = NULL;
102
+		if ($type == '') {
103
+			$type = NULL;
104
+		}
94 105
 		$query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name,format_source,source_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name,:format_source,:source_name)";
95 106
 		$query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name);
96 107
 		try {
@@ -106,7 +117,9 @@  discard block
 block discarded – undo
106 117
 		$info = str_replace('^','<br />',$info);
107 118
 		$info = str_replace('&amp;sect;','',$info);
108 119
 		$info = str_replace('"','',$info);
109
-		if ($type == '') $type = NULL;
120
+		if ($type == '') {
121
+			$type = NULL;
122
+		}
110 123
 		$query = "UPDATE atc SET frequency = :frequency,latitude = :latitude,longitude = :longitude,atc_range = :range,info = :info,atc_lastseen = :date,type = :type,ivao_id = :ivao_id,ivao_name = :ivao_name WHERE ident = :ident AND format_source = :format_source AND source_name = :source_name";
111 124
 		$query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name);
112 125
 		try {
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -26,22 +26,22 @@  discard block
 block discarded – undo
26 26
 	* @param Array $filter the filter
27 27
 	* @return Array the SQL part
28 28
 	*/
29
-	public function getFilter($filter = array(),$where = false,$and = false) {
29
+	public function getFilter($filter = array(), $where = false, $and = false) {
30 30
 		global $globalFilter, $globalStatsFilters, $globalFilterName;
31 31
 		if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) {
32 32
 			if (isset($globalStatsFilters[$globalFilterName][0]['source'])) {
33
-				foreach($globalStatsFilters[$globalFilterName] as $source) {
33
+				foreach ($globalStatsFilters[$globalFilterName] as $source) {
34 34
 					if (isset($source['source'])) $filter['source'][] = $source['source'];
35 35
 				}
36 36
 			} else {
37 37
 				$filter = $globalStatsFilters[$globalFilterName];
38 38
 			}
39 39
 		}
40
-		if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter);
40
+		if (is_array($globalFilter)) $filter = array_merge($filter, $globalFilter);
41 41
 		$filter_query_join = '';
42 42
 		$filter_query_where = '';
43 43
 		if (isset($filter['source']) && !empty($filter['source'])) {
44
-			$filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')";
44
+			$filter_query_where = " WHERE format_source IN ('".implode("','", $filter['source'])."')";
45 45
 		}
46 46
 		if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE';
47 47
 		elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND';
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		try {
61 61
 			$sth = $this->db->prepare($query);
62 62
 			$sth->execute($query_values);
63
-		} catch(PDOException $e) {
63
+		} catch (PDOException $e) {
64 64
 			return "error : ".$e->getMessage();
65 65
 		}
66 66
 		$all = $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
 	 * @return Array Return ATC
74 74
 	*/
75 75
 	public function getById($id) {
76
-		$filter_query = $this->getFilter(array(),true,true);
76
+		$filter_query = $this->getFilter(array(), true, true);
77 77
 		$query = "SELECT * FROM atc".$filter_query." atc_id = :id";
78 78
 		$query_values = array(':id' => $id);
79 79
 		try {
80 80
 			$sth = $this->db->prepare($query);
81 81
 			$sth->execute($query_values);
82
-		} catch(PDOException $e) {
82
+		} catch (PDOException $e) {
83 83
 			return "error : ".$e->getMessage();
84 84
 		}
85 85
 		$all = $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -92,19 +92,19 @@  discard block
 block discarded – undo
92 92
 	 * @param String $format_source Format source
93 93
 	 * @return Array Return ATC
94 94
 	*/
95
-	public function getByIdent($ident,$format_source = '') {
96
-		$filter_query = $this->getFilter(array(),true,true);
95
+	public function getByIdent($ident, $format_source = '') {
96
+		$filter_query = $this->getFilter(array(), true, true);
97 97
 		if ($format_source == '') {
98 98
 			$query = "SELECT * FROM atc".$filter_query." ident = :ident";
99 99
 			$query_values = array(':ident' => $ident);
100 100
 		} else {
101 101
 			$query = "SELECT * FROM atc".$filter_query." ident = :ident AND format_source = :format_source";
102
-			$query_values = array(':ident' => $ident,':format_source' => $format_source);
102
+			$query_values = array(':ident' => $ident, ':format_source' => $format_source);
103 103
 		}
104 104
 		try {
105 105
 			$sth = $this->db->prepare($query);
106 106
 			$sth->execute($query_values);
107
-		} catch(PDOException $e) {
107
+		} catch (PDOException $e) {
108 108
 			return "error : ".$e->getMessage();
109 109
 		}
110 110
 		$all = $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -126,18 +126,18 @@  discard block
 block discarded – undo
126 126
 	 * @param String $format_source Format source
127 127
 	 * @param String $source_name Source name
128 128
 	*/
129
-	public function add($ident,$frequency,$latitude,$longitude,$range,$info,$date,$type = '',$ivao_id = '',$ivao_name = '',$format_source = '',$source_name = '') {
130
-		$info = preg_replace('/[^(\x20-\x7F)]*/','',$info);
131
-		$info = str_replace('^','<br />',$info);
132
-		$info = str_replace('&amp;sect;','',$info);
133
-		$info = str_replace('"','',$info);
129
+	public function add($ident, $frequency, $latitude, $longitude, $range, $info, $date, $type = '', $ivao_id = '', $ivao_name = '', $format_source = '', $source_name = '') {
130
+		$info = preg_replace('/[^(\x20-\x7F)]*/', '', $info);
131
+		$info = str_replace('^', '<br />', $info);
132
+		$info = str_replace('&amp;sect;', '', $info);
133
+		$info = str_replace('"', '', $info);
134 134
 		if ($type == '') $type = NULL;
135 135
 		$query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name,format_source,source_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name,:format_source,:source_name)";
136
-		$query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name);
136
+		$query_values = array(':ident' => $ident, ':frequency' => $frequency, ':latitude' => $latitude, ':longitude' => $longitude, ':range' => $range, ':info' => $info, ':date' => $date, ':ivao_id' => $ivao_id, ':ivao_name' => $ivao_name, ':type' => $type, ':format_source' => $format_source, ':source_name' => $source_name);
137 137
 		try {
138 138
 			$sth = $this->db->prepare($query);
139 139
 			$sth->execute($query_values);
140
-		} catch(PDOException $e) {
140
+		} catch (PDOException $e) {
141 141
 			return "error : ".$e->getMessage();
142 142
 		}
143 143
 	}
@@ -157,18 +157,18 @@  discard block
 block discarded – undo
157 157
 	 * @param String $format_source Format source
158 158
 	 * @param String $source_name Source name
159 159
 	*/
160
-	public function update($ident,$frequency,$latitude,$longitude,$range,$info,$date,$type = '',$ivao_id = '',$ivao_name = '',$format_source = '',$source_name = '') {
161
-		$info = preg_replace('/[^(\x20-\x7F)]*/','',$info);
162
-		$info = str_replace('^','<br />',$info);
163
-		$info = str_replace('&amp;sect;','',$info);
164
-		$info = str_replace('"','',$info);
160
+	public function update($ident, $frequency, $latitude, $longitude, $range, $info, $date, $type = '', $ivao_id = '', $ivao_name = '', $format_source = '', $source_name = '') {
161
+		$info = preg_replace('/[^(\x20-\x7F)]*/', '', $info);
162
+		$info = str_replace('^', '<br />', $info);
163
+		$info = str_replace('&amp;sect;', '', $info);
164
+		$info = str_replace('"', '', $info);
165 165
 		if ($type == '') $type = NULL;
166 166
 		$query = "UPDATE atc SET frequency = :frequency,latitude = :latitude,longitude = :longitude,atc_range = :range,info = :info,atc_lastseen = :date,type = :type,ivao_id = :ivao_id,ivao_name = :ivao_name WHERE ident = :ident AND format_source = :format_source AND source_name = :source_name";
167
-		$query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name);
167
+		$query_values = array(':ident' => $ident, ':frequency' => $frequency, ':latitude' => $latitude, ':longitude' => $longitude, ':range' => $range, ':info' => $info, ':date' => $date, ':ivao_id' => $ivao_id, ':ivao_name' => $ivao_name, ':type' => $type, ':format_source' => $format_source, ':source_name' => $source_name);
168 168
 		try {
169 169
 			$sth = $this->db->prepare($query);
170 170
 			$sth->execute($query_values);
171
-		} catch(PDOException $e) {
171
+		} catch (PDOException $e) {
172 172
 			return "error : ".$e->getMessage();
173 173
 		}
174 174
 	}
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		try {
184 184
 			$sth = $this->db->prepare($query);
185 185
 			$sth->execute($query_values);
186
-		} catch(PDOException $e) {
186
+		} catch (PDOException $e) {
187 187
 			return "error : ".$e->getMessage();
188 188
 		}
189 189
 	}
@@ -193,13 +193,13 @@  discard block
 block discarded – undo
193 193
 	 * @param String $ident Flight ident
194 194
 	 * @param String $format_source Format source
195 195
 	*/
196
-	public function deleteByIdent($ident,$format_source) {
196
+	public function deleteByIdent($ident, $format_source) {
197 197
 		$query = "DELETE FROM atc WHERE ident = :ident AND format_source = :format_source";
198
-		$query_values = array(':ident' => $ident,':format_source' => $format_source);
198
+		$query_values = array(':ident' => $ident, ':format_source' => $format_source);
199 199
 		try {
200 200
 			$sth = $this->db->prepare($query);
201 201
 			$sth->execute($query_values);
202
-		} catch(PDOException $e) {
202
+		} catch (PDOException $e) {
203 203
 			return "error : ".$e->getMessage();
204 204
 		}
205 205
 	}
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 		try {
214 214
 			$sth = $this->db->prepare($query);
215 215
 			$sth->execute($query_values);
216
-		} catch(PDOException $e) {
216
+		} catch (PDOException $e) {
217 217
 			return "error : ".$e->getMessage();
218 218
 		}
219 219
 	}
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 		try {
232 232
 			$sth = $this->db->prepare($query);
233 233
 			$sth->execute();
234
-		} catch(PDOException $e) {
234
+		} catch (PDOException $e) {
235 235
 			return "error";
236 236
 		}
237 237
 		return "success";
Please login to merge, or discard this patch.
tools-geoid.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 try {
6 6
 $GeoidHeight = new GeoidHeight();
7 7
 } catch (Exception $e) {
8
-    echo $e;
8
+	echo $e;
9 9
 }
10 10
 $title = _("Geoid Height Calculator");
11 11
 require_once('header.php');
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
 
13 13
 $page_url = $globalURL.'/tools-geoid';
14 14
 
15
-$latitude = filter_input(INPUT_POST,'latitude',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
16
-$longitude = filter_input(INPUT_POST,'longitude',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
17
-$altitude = filter_input(INPUT_POST,'altitude',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
15
+$latitude = filter_input(INPUT_POST, 'latitude', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
16
+$longitude = filter_input(INPUT_POST, 'longitude', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
17
+$altitude = filter_input(INPUT_POST, 'altitude', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
18 18
 
19 19
 print '<div class="info column">';
20 20
 print '<h1>'._("Geoid Height Calculator").'</h1>';
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
 
52 52
 if ($latitude != '' && $longitude != '') {
53 53
 	$globalDebug = FALSE;
54
-	$geoid = $GeoidHeight->get($latitude,$longitude);
54
+	$geoid = $GeoidHeight->get($latitude, $longitude);
55 55
 	print '<div class="row">';
56 56
 	print '<div class="col-md-3 col-md-offset-5">';
57 57
 	print '<div class="col-sm-6"><b>Geoid</b></div>';
58 58
 	print '<div class="col-sm-6">'.$geoid.'</div>';
59 59
 	if ($altitude != '') {
60 60
 		print '<div class="col-sm-6"><b>AMSL Elevation</b></div>';
61
-		print '<div class="col-sm-6">'.round($altitude-$geoid,3).'</div>';
61
+		print '<div class="col-sm-6">'.round($altitude - $geoid, 3).'</div>';
62 62
 	}
63 63
 	print '<div class="col-sm-6"><b>Earth Gravity Model</b></div>';
64 64
 	if (isset($globalGeoidSource) && $globalGeoidSource != '') $geoidsource = $globalGeoidSource;
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,8 +61,11 @@
 block discarded – undo
61 61
 		print '<div class="col-sm-6">'.round($altitude-$geoid,3).'</div>';
62 62
 	}
63 63
 	print '<div class="col-sm-6"><b>Earth Gravity Model</b></div>';
64
-	if (isset($globalGeoidSource) && $globalGeoidSource != '') $geoidsource = $globalGeoidSource;
65
-	else $geoidsource = 'EGM96-15';
64
+	if (isset($globalGeoidSource) && $globalGeoidSource != '') {
65
+		$geoidsource = $globalGeoidSource;
66
+	} else {
67
+		$geoidsource = 'EGM96-15';
68
+	}
66 69
 	print '<div class="col-sm-6">'.$geoidsource.'</div>';
67 70
 	print '</div>';
68 71
 }
Please login to merge, or discard this patch.
flightid-overview.php 2 patches
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,9 @@  discard block
 block discarded – undo
48 48
 		$all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']);
49 49
 		if (isset($globalTimezone)) {
50 50
 			date_default_timezone_set($globalTimezone);
51
-		} else date_default_timezone_set('UTC');
51
+		} else {
52
+			date_default_timezone_set('UTC');
53
+		}
52 54
 		
53 55
 		if (is_array($all_data) && count($all_data) > 1) {
54 56
 			print '<br/>';
@@ -327,9 +329,13 @@  discard block
 block discarded – undo
327 329
 			print '<div>';
328 330
 			if (isset($spotter_item['pilot_id']) && $spotter_item['pilot_id'] != "")
329 331
 			{
330
-				if ($spotter_item['format_source'] == 'whazzup') print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>';
331
-				elseif ($spotter_item['format_source'] == 'vatsimtxt') print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>';
332
-				else print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')';
332
+				if ($spotter_item['format_source'] == 'whazzup') {
333
+					print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>';
334
+				} elseif ($spotter_item['format_source'] == 'vatsimtxt') {
335
+					print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>';
336
+				} else {
337
+					print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')';
338
+				}
333 339
 			} else {
334 340
 				if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != "")
335 341
 				{
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-$id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_STRING);
2
+$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING);
3 3
 if ($id == "")
4 4
 {
5 5
 	header('Location: /');
@@ -16,30 +16,30 @@  discard block
 block discarded – undo
16 16
 
17 17
 if (!empty($spotter_array))
18 18
 {
19
-	if(isset($spotter_array[0]['flightaware_id'])) {
19
+	if (isset($spotter_array[0]['flightaware_id'])) {
20 20
 		$flightaware_id = $spotter_array[0]['flightaware_id'];
21 21
 	}
22
-	if(isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') {
22
+	if (isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') {
23 23
 		$latitude = $spotter_array[0]['last_latitude'];
24
-	} elseif(isset($spotter_array[0]['latitude'])) {
24
+	} elseif (isset($spotter_array[0]['latitude'])) {
25 25
 		$latitude = $spotter_array[0]['latitude'];
26 26
 	}
27
-	if(isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') {
27
+	if (isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') {
28 28
 		$longitude = $spotter_array[0]['last_longitude'];
29
-	} elseif(isset($spotter_array[0]['longitude'])) {
29
+	} elseif (isset($spotter_array[0]['longitude'])) {
30 30
 		$longitude = $spotter_array[0]['longitude'];
31 31
 	}
32 32
 	$title = '';
33
-	if(isset($spotter_array[0]['ident'])) {
33
+	if (isset($spotter_array[0]['ident'])) {
34 34
 		$title .= $spotter_array[0]['ident'];
35 35
 	}
36
-	if(isset($spotter_array[0]['airline_name'])) {
36
+	if (isset($spotter_array[0]['airline_name'])) {
37 37
 		$title .= ' - '.$spotter_array[0]['airline_name'];
38 38
 	}
39
-	if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') {
39
+	if (isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') {
40 40
 		$title .= ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')';
41 41
 	}
42
-	if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') {
42
+	if (isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') {
43 43
 		$title .= ' - '.$spotter_array[0]['registration'];
44 44
 	}
45 45
 	//$facebook_meta_image = $spotter_array[0]['image'];
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 			$altitude_data = '';
60 60
 			$hour_data = '';
61 61
 			$speed_data = '';
62
-			foreach($all_data as $data)
62
+			foreach ($all_data as $data)
63 63
 			{
64 64
 				$hour_data .= '"'.$data['date'].'",';
65 65
 				if (isset($data['real_altitude']) && $data['real_altitude'] != '') {
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
 				$speed_data .= $speed.',';
88 88
 			}
89 89
 			$hour_data = "['x',".substr($hour_data, 0, -1)."]";
90
-			$altitude_data = "['altitude',".substr($altitude_data,0,-1)."]";
91
-			$speed_data = "['speed',".substr($speed_data,0,-1)."]";
90
+			$altitude_data = "['altitude',".substr($altitude_data, 0, -1)."]";
91
+			$speed_data = "['speed',".substr($speed_data, 0, -1)."]";
92 92
 			print 'c3.generate({
93 93
 			    bindto: "#chart",
94 94
 			    data: {
@@ -134,16 +134,16 @@  discard block
 block discarded – undo
134 134
 			print '<a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a> ';
135 135
 		}
136 136
 	}
137
-	if(isset($spotter_array[0]['ident'])) {
137
+	if (isset($spotter_array[0]['ident'])) {
138 138
 		print $spotter_array[0]['ident'];
139 139
 	}
140
-	if(isset($spotter_array[0]['airline_name'])) {
140
+	if (isset($spotter_array[0]['airline_name'])) {
141 141
 		print ' - '.$spotter_array[0]['airline_name'];
142 142
 	}
143
-	if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') {
143
+	if (isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') {
144 144
 		print ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')';
145 145
 	}
146
-	if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') {
146
+	if (isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') {
147 147
 		print ' - '.$spotter_array[0]['registration'];
148 148
 	}
149 149
 	print '</h1>';
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	 print '</div>';
298 298
 */
299 299
 
300
-	foreach($spotter_array as $spotter_item)
300
+	foreach ($spotter_array as $spotter_item)
301 301
 	{
302 302
 		print '<div class="details">';
303 303
 		print '<h3>'._("Flight Information").'</h3>';
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 			if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') {
398 398
 				if ($spotter_item['departure_airport_time'] > 2460) {
399 399
 					print '<div class="time">';
400
-					print 'at '.date('H:m',$spotter_item['departure_airport_time']);
400
+					print 'at '.date('H:m', $spotter_item['departure_airport_time']);
401 401
 					print '</div>';
402 402
 				} else {
403 403
 					print '<div class="time">';
@@ -547,19 +547,19 @@  discard block
 block discarded – undo
547 547
 			if (count($departure_airport_info) > 0) {
548 548
 				if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') {
549 549
 					if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
550
-						print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm';
550
+						print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'nm').' nm';
551 551
 					} elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
552
-						print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi';
552
+						print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'mi').' mi';
553 553
 					} else {
554
-						print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km';
554
+						print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'km').' km';
555 555
 					}
556 556
 				} else {
557 557
 					if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
558
-						print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm';
558
+						print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'nm').' nm';
559 559
 					} elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
560
-						print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi';
560
+						print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'mi').' mi';
561 561
 					} else {
562
-						print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km';
562
+						print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'km').' km';
563 563
 					}
564 564
 				}
565 565
 			}
@@ -575,19 +575,19 @@  discard block
 block discarded – undo
575 575
 			if (count($arrival_airport_info) > 0) {
576 576
 				if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') {
577 577
 					if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
578
-						print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm';
578
+						print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'nm').' nm';
579 579
 					} elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
580
-						print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi';
580
+						print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'mi').' mi';
581 581
 					} else {
582
-						print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km';
582
+						print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'km').' km';
583 583
 					}
584 584
 				} else {
585 585
 					if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
586
-						print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm';
586
+						print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'nm').' nm';
587 587
 					} elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
588
-						print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi';
588
+						print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'mi').' mi';
589 589
 					} else {
590
-						print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km';
590
+						print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'km').' km';
591 591
 					}
592 592
 				}
593 593
 			}
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 		print '<div class="last-flights">';
607 607
 		print '<h3>'._("Last 5 Flights of this Aircraft").' ('.$registration.')</h3>';
608 608
 		$hide_th_links = true;
609
-		$spotter_array = $Spotter->getSpotterDataByRegistration($registration,"0,5", "");
609
+		$spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,5", "");
610 610
 		include('table-output.php'); 
611 611
 		print '<div class="more">';
612 612
 		print '<a href="'.$globalURL.'/registration/'.$registration.'" class="btn btn-default btn" role="button">See all Flights&raquo;</a>';
Please login to merge, or discard this patch.
ident-detailed.php 2 patches
Braces   +22 added lines, -8 removed lines patch added patch discarded remove patch
@@ -118,8 +118,12 @@  discard block
 block discarded – undo
118 118
 	{
119 119
 		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['ident']);
120 120
 		$ident = $spotter_array[0]['ident'];
121
-		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
122
-		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
121
+		if (isset($spotter_array[0]['latitude'])) {
122
+			$latitude = $spotter_array[0]['latitude'];
123
+		}
124
+		if (isset($spotter_array[0]['longitude'])) {
125
+			$longitude = $spotter_array[0]['longitude'];
126
+		}
123 127
 		require_once('header.php');
124 128
 		if (isset($globalArchive) && $globalArchive && $type == 'aircraft') {
125 129
 			// Requirement for altitude graph
@@ -127,7 +131,9 @@  discard block
 block discarded – undo
127 131
 			$all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']);
128 132
 			if (isset($globalTimezone)) {
129 133
 				date_default_timezone_set($globalTimezone);
130
-			} else date_default_timezone_set('UTC');
134
+			} else {
135
+				date_default_timezone_set('UTC');
136
+			}
131 137
 			if (is_array($all_data) && count($all_data) > 1) {
132 138
 				print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">';
133 139
 				print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
@@ -204,14 +210,22 @@  discard block
 block discarded – undo
204 210
 		if (isset($spotter_array[0]['airline_icao'])) {
205 211
 			print '<div><span class="label">'._("Airline").'</span><a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a></div>'; 
206 212
 		}
207
-		if ($type == 'aircraft') print '<div><span class="label">'._("Flight History").'</span><a href="http://flightaware.com/live/flight/'.$spotter_array[0]['ident'].'" target="_blank">'._("View the Flight History of this callsign").'</a></div>';
213
+		if ($type == 'aircraft') {
214
+			print '<div><span class="label">'._("Flight History").'</span><a href="http://flightaware.com/live/flight/'.$spotter_array[0]['ident'].'" target="_blank">'._("View the Flight History of this callsign").'</a></div>';
215
+		}
208 216
 		print '</div>';
209 217
 	
210
-		if ($type == 'aircraft') include('ident-sub-menu.php');
218
+		if ($type == 'aircraft') {
219
+			include('ident-sub-menu.php');
220
+		}
211 221
 		print '<div class="table column">';
212
-		if ($type == 'aircraft') print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
213
-		elseif ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
214
-		elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
222
+		if ($type == 'aircraft') {
223
+			print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
224
+		} elseif ($type == 'marine') {
225
+			print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
226
+		} elseif ($type == 'tracker') {
227
+			print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
228
+		}
215 229
 
216 230
 		include('table-output.php'); 
217 231
 		print '<div class="pagination">';
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Language.php');
4 4
 require_once('require/class.Translation.php');
5 5
 $type = '';
6
-$ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING));
6
+$ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING));
7 7
 if (isset($_GET['marine'])) {
8 8
 	require_once('require/class.Marine.php');
9 9
 	require_once('require/class.MarineLive.php');
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
 	$page_url = $globalURL.'/ident/'.$_GET['ident'];
31 31
 }
32 32
 
33
-if (!isset($_GET['ident'])){
33
+if (!isset($_GET['ident'])) {
34 34
 	header('Location: '.$globalURL.'');
35 35
 } else {
36 36
 	$Translation = new Translation();
37 37
 	//calculuation for the pagination
38
-	if(!isset($_GET['limit']))
38
+	if (!isset($_GET['limit']))
39 39
 	{
40 40
 		$limit_start = 0;
41 41
 		$limit_end = 25;
@@ -54,18 +54,18 @@  discard block
 block discarded – undo
54 54
 	$limit_previous_1 = $limit_start - $absolute_difference;
55 55
 	$limit_previous_2 = $limit_end - $absolute_difference;
56 56
 	
57
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
57
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
58 58
 	if ($type == 'aircraft') {
59 59
 		if ($sort != '') 
60 60
 		{
61
-			$spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort);
61
+			$spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort);
62 62
 			if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
63
-				$spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort);
63
+				$spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort);
64 64
 			}
65 65
 		} else {
66
-			$spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference);
66
+			$spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference);
67 67
 			if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
68
-				$spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference);
68
+				$spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference);
69 69
 			}
70 70
 		}
71 71
 		if (empty($spotter_array)) {
@@ -74,14 +74,14 @@  discard block
 block discarded – undo
74 74
 				$ident = $new_ident;
75 75
 				if ($sort != '') 
76 76
 				{
77
-					$spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort);
77
+					$spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort);
78 78
 					if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
79
-						$spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort);
79
+						$spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort);
80 80
 					}
81 81
 				} else {
82
-					$spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference);
82
+					$spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference);
83 83
 					if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
84
-						$spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference);
84
+						$spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference);
85 85
 					}
86 86
 				}
87 87
 			}
@@ -89,34 +89,34 @@  discard block
 block discarded – undo
89 89
 	} elseif ($type == 'marine') {
90 90
 		if ($sort != '') 
91 91
 		{
92
-			$spotter_array = $Marine->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference, $sort);
92
+			$spotter_array = $Marine->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference, $sort);
93 93
 			if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
94
-				$spotter_array = $MarineArchive->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference, $sort);
94
+				$spotter_array = $MarineArchive->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference, $sort);
95 95
 			}
96 96
 		} else {
97
-			$spotter_array = $Marine->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference);
97
+			$spotter_array = $Marine->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference);
98 98
 			if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
99
-				$spotter_array = $MarineArchive->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference);
99
+				$spotter_array = $MarineArchive->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference);
100 100
 			}
101 101
 		}
102 102
 	} elseif ($type == 'tracker') {
103 103
 		if ($sort != '') 
104 104
 		{
105
-			$spotter_array = $Tracker->getTrackerDataByIdent($ident,$limit_start.",".$absolute_difference, $sort);
105
+			$spotter_array = $Tracker->getTrackerDataByIdent($ident, $limit_start.",".$absolute_difference, $sort);
106 106
 			if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
107
-				$spotter_array = $TrackerArchive->getTrackerDataByIdent($ident,$limit_start.",".$absolute_difference, $sort);
107
+				$spotter_array = $TrackerArchive->getTrackerDataByIdent($ident, $limit_start.",".$absolute_difference, $sort);
108 108
 			}
109 109
 		} else {
110
-			$spotter_array = $Tracker->getTrackerDataByIdent($ident,$limit_start.",".$absolute_difference);
110
+			$spotter_array = $Tracker->getTrackerDataByIdent($ident, $limit_start.",".$absolute_difference);
111 111
 			if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
112
-				$spotter_array = $TrackerArchive->getTrackerDataByIdent($ident,$limit_start.",".$absolute_difference);
112
+				$spotter_array = $TrackerArchive->getTrackerDataByIdent($ident, $limit_start.",".$absolute_difference);
113 113
 			}
114 114
 		}
115 115
 	}
116 116
 
117 117
 	if (!empty($spotter_array))
118 118
 	{
119
-		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['ident']);
119
+		$title = sprintf(_("Detailed View for %s"), $spotter_array[0]['ident']);
120 120
 		$ident = $spotter_array[0]['ident'];
121 121
 		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
122 122
 		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 				$altitude_data = '';
136 136
 				$hour_data = '';
137 137
 				$speed_data = '';
138
-				foreach($all_data as $data)
138
+				foreach ($all_data as $data)
139 139
 				{
140 140
 					$hour_data .= '"'.$data['date'].'",';
141 141
 					if (isset($data['real_altitude']) && $data['real_altitude'] != '') {
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
 					$speed_data .= $speed.',';
164 164
 				}
165 165
 				$hour_data = "['x',".substr($hour_data, 0, -1)."]";
166
-				$altitude_data = "['altitude',".substr($altitude_data,0,-1)."]";
167
-				$speed_data = "['speed',".substr($speed_data,0,-1)."]";
166
+				$altitude_data = "['altitude',".substr($altitude_data, 0, -1)."]";
167
+				$speed_data = "['speed',".substr($speed_data, 0, -1)."]";
168 168
 				print 'c3.generate({
169 169
 				    bindto: "#chart",
170 170
 				    data: {
@@ -208,9 +208,9 @@  discard block
 block discarded – undo
208 208
 	
209 209
 		if ($type == 'aircraft') include('ident-sub-menu.php');
210 210
 		print '<div class="table column">';
211
-		if ($type == 'aircraft') print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
212
-		elseif ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
213
-		elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
211
+		if ($type == 'aircraft') print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
212
+		elseif ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
213
+		elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
214 214
 
215 215
 		include('table-output.php'); 
216 216
 		print '<div class="pagination">';
Please login to merge, or discard this patch.