Completed
Push — master ( e565ed...055e12 )
by Yannick
58:46 queued 27:49
created
live-czml.php 1 patch
Braces   +150 added lines, -54 removed lines patch added patch discarded remove patch
@@ -26,8 +26,12 @@  discard block
 block discarded – undo
26 26
 }
27 27
 $tracker = false;
28 28
 $marine = false;
29
-if (isset($_GET['tracker'])) $tracker = true;
30
-if (isset($_GET['marine'])) $marine = true;
29
+if (isset($_GET['tracker'])) {
30
+	$tracker = true;
31
+}
32
+if (isset($_GET['marine'])) {
33
+	$marine = true;
34
+}
31 35
 if ($tracker) {
32 36
 	require_once('require/class.Tracker.php');
33 37
 	require_once('require/class.TrackerLive.php');
@@ -84,27 +88,56 @@  discard block
 block discarded – undo
84 88
 }
85 89
 header('Content-Type: text/javascript');
86 90
 
87
-if (!isset($globalJsonCompress)) $compress = true;
88
-else $compress = $globalJsonCompress;
91
+if (!isset($globalJsonCompress)) {
92
+	$compress = true;
93
+} else {
94
+	$compress = $globalJsonCompress;
95
+}
89 96
 
90 97
 $from_archive = false;
91 98
 $min = false;
92 99
 $allhistory = false;
93 100
 $filter['source'] = array();
94 101
 $limit = 0;
95
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
96
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
97
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
98
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
99
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
100
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
101
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
102
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
103
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
104
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
105
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
106
-if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_NUMBER_INT);
107
-if (isset($_COOKIE['filter_blocked']) && $_COOKIE['filter_blocked'] == 'true') $filter['blocked'] = true;
102
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') {
103
+	$filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
104
+}
105
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') {
106
+	$filter['source'] = array_merge($filter['source'],array('whazzup'));
107
+}
108
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') {
109
+	$filter['source'] = array_merge($filter['source'],array('phpvmacars'));
110
+}
111
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') {
112
+	$filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
113
+}
114
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') {
115
+	$filter['source'] = array_merge($filter['source'],array('aprs'));
116
+}
117
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') {
118
+	$filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
119
+}
120
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') {
121
+	$filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
122
+}
123
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') {
124
+	$filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
125
+}
126
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') {
127
+	$filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
128
+}
129
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') {
130
+	$filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
131
+}
132
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') {
133
+	$filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
134
+}
135
+if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') {
136
+	$filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_NUMBER_INT);
137
+}
138
+if (isset($_COOKIE['filter_blocked']) && $_COOKIE['filter_blocked'] == 'true') {
139
+	$filter['blocked'] = true;
140
+}
108 141
 
109 142
 if (isset($_COOKIE['map_3d_limit'])) {
110 143
 	$limit = filter_var($_COOKIE['map_3d_limit'],FILTER_SANITIZE_NUMBER_INT);
@@ -286,8 +319,12 @@  discard block
 block discarded – undo
286 319
 			$flightcnt = $SpotterLive->getLiveSpotterCount($filter);
287 320
 		}
288 321
 	}
289
-	if ($flightcnt == '') $flightcnt = 0;
290
-} else $flightcnt = 0;
322
+	if ($flightcnt == '') {
323
+		$flightcnt = 0;
324
+	}
325
+	} else {
326
+	$flightcnt = 0;
327
+}
291 328
 
292 329
 $sqltime = round(microtime(true)-$begintime,2);
293 330
 $minitime = time();
@@ -333,7 +370,9 @@  discard block
 block discarded – undo
333 370
 $gltf2 = false;
334 371
 $scale = 1.0;
335 372
 $minimumpixelsize = 20;
336
-if (isset($archivespeed)) $speed = $archivespeed;
373
+if (isset($archivespeed)) {
374
+	$speed = $archivespeed;
375
+}
337 376
 $output = '[';
338 377
 if ($tracker) {
339 378
 	$output .= '{"id" : "document", "name" : "tracker","version" : "1.0"';
@@ -369,9 +408,13 @@  discard block
 block discarded – undo
369 408
 			$image = "images/placeholder_thumb.png";
370 409
 		}
371 410
 
372
-                if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id'];
373
-                elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid'];
374
-                elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id'];
411
+                if (isset($spotter_item['flightaware_id'])) {
412
+                	$id = $spotter_item['flightaware_id'];
413
+                } elseif (isset($spotter_item['famtrackid'])) {
414
+                	$id = $spotter_item['famtrackid'];
415
+                } elseif (isset($spotter_item['fammarine_id'])) {
416
+                	$id = $spotter_item['fammarine_id'];
417
+                }
375 418
                 if ($prev_flightaware_id != $id) {
376 419
 			if ($prev_flightaware_id != '') {
377 420
 				/*
@@ -409,18 +452,36 @@  discard block
 block discarded – undo
409 452
 			if (isset($spotter_item['squawk'])) {
410 453
 				$output .= '"squawk": "'.$spotter_item['squawk'].'",';
411 454
 			}
412
-			if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",';
413
-			if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",';
414
-			if (isset($spotter_item['ident'])) $output.= '"ident": '.json_encode($spotter_item['ident']).',';
455
+			if (isset($spotter_item['registration'])) {
456
+				$output .= '"registration": "'.$spotter_item['registration'].'",';
457
+			}
458
+			if (isset($spotter_item['format_source'])) {
459
+				$output .= '"format": "'.$spotter_item['format_source'].'",';
460
+			}
461
+			if (isset($spotter_item['ident'])) {
462
+				$output.= '"ident": '.json_encode($spotter_item['ident']).',';
463
+			}
415 464
 			if ($tracker) {
416
-				if (isset($spotter_item['type'])) $output .= '"tracker_type": '.json_encode($spotter_item['type']).',';
465
+				if (isset($spotter_item['type'])) {
466
+					$output .= '"tracker_type": '.json_encode($spotter_item['type']).',';
467
+				}
417 468
 				$output.= '"type": "tracker"';
418 469
 			} elseif ($marine) {
419
-				if (isset($spotter_item['type'])) $output .= '"marine_type": '.json_encode($spotter_item['type']).',';
420
-				if (isset($spotter_item['captain_name'])) $output .= '"captain": '.json_encode($spotter_item['captain_name']).',';
421
-				if (isset($spotter_item['race_id'])) $output .= '"raceid": '.$spotter_item['race_id'].',';
422
-				if (isset($spotter_item['race_name'])) $output .= '"race": '.json_encode($spotter_item['race_name']).',';
423
-				if (isset($spotter_item['race_rank'])) $output .= '"rank": "'.$spotter_item['race_rank'].'",';
470
+				if (isset($spotter_item['type'])) {
471
+					$output .= '"marine_type": '.json_encode($spotter_item['type']).',';
472
+				}
473
+				if (isset($spotter_item['captain_name'])) {
474
+					$output .= '"captain": '.json_encode($spotter_item['captain_name']).',';
475
+				}
476
+				if (isset($spotter_item['race_id'])) {
477
+					$output .= '"raceid": '.$spotter_item['race_id'].',';
478
+				}
479
+				if (isset($spotter_item['race_name'])) {
480
+					$output .= '"race": '.json_encode($spotter_item['race_name']).',';
481
+				}
482
+				if (isset($spotter_item['race_rank'])) {
483
+					$output .= '"rank": "'.$spotter_item['race_rank'].'",';
484
+				}
424 485
 				$output.= '"type": "marine"';
425 486
 			} else {
426 487
 				if ($one3dmodel === false && isset($globalMap3DLiveries) && $globalMap3DLiveries) {
@@ -471,7 +532,9 @@  discard block
 block discarded – undo
471 532
 							$spotter_item['engine_type'] = $aircraft_info[0]['engine_type'];
472 533
 							$spotter_item['wake_category'] = $aircraft_info[0]['wake_category'];
473 534
 							$spotter_item['engine_count'] = $aircraft_info[0]['engine_count'];
474
-						} else $aircraft_shadow = '';
535
+						} else {
536
+							$aircraft_shadow = '';
537
+						}
475 538
 	    					$output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5';
476 539
 						if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
477 540
 							$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
@@ -479,7 +542,9 @@  discard block
 block discarded – undo
479 542
 						}
480 543
 						$output .= '},';
481 544
 					}
482
-				} else $output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2l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Azg2+/fQSsBhoJxBAaALaIzenZGnD911wA7gEDAD2FFSpwOzgDHZ5T7+ZSlGd2d6AXgi5+qAn+O5U0PbBVwKtAD3AHuB8f3YGBUdncCGoQ4LE9XtGRqK9LnduVPRIu2BPqwD65IYbS7Qpql7Ql9YoJcy9bwzkgPrfOCj5G33+h54E/g0PAr5thq4ApgyEgNrc27aWwVaPTA1QJ4BjgTGFvhteV40EgPrgvTP7qlmZqFnl9WD+b2posN83E/NrEkOjlI/U1fkfUYa/pe5IE3qZPW8jFOqiyN7p3pAPX04c7AxYSoDDcAjKT2LgLXA6IR2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 0.5},';
545
+				} else {
546
+					$output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3A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P2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 0.5},';
547
+				}
483 548
 			} elseif ($one3dmodel) {
484 549
 				if (isset($globalMap3DForceModel) && $globalMap3DForceModel != '') {
485 550
 					$output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$globalMap3DForceModel.'","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
@@ -519,7 +584,9 @@  discard block
 block discarded – undo
519 584
 							$spotter_item['engine_type'] = $aircraft_info[0]['engine_type'];
520 585
 							$spotter_item['wake_category'] = $aircraft_info[0]['wake_category'];
521 586
 							$spotter_item['engine_count'] = $aircraft_info[0]['engine_count'];
522
-						} else $aircraft_shadow = '';
587
+						} else {
588
+							$aircraft_shadow = '';
589
+						}
523 590
 						if ($aircraft_shadow != '') {
524 591
 							if (isset($modelsdb2[$aircraft_shadow])) {
525 592
 								$output .= '"model": {"gltf" : "'.$globalURL.'/models/gltf2/'.$modelsdb2[$aircraft_shadow]['glb'].'","scale" : '.$scale.',"minimumPixelSize": '.$modelsdb2[$aircraft_shadow]['size'];
@@ -674,7 +741,9 @@  discard block
 block discarded – undo
674 741
 								}
675 742
 								$output .= '},';
676 743
 								//if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
677
-								if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
744
+								if ($spotter_item['aircraft_icao'] != '') {
745
+									$output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
746
+								}
678 747
 								$modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
679 748
 							}
680 749
 						} elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') {
@@ -696,7 +765,9 @@  discard block
 block discarded – undo
696 765
 							}
697 766
 							$output .= '},';
698 767
 							//if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
699
-							if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
768
+							if ($spotter_item['aircraft_icao'] != '') {
769
+								$output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
770
+							}
700 771
 							$modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
701 772
 						}
702 773
 					} else {
@@ -709,7 +780,9 @@  discard block
 block discarded – undo
709 780
 						}
710 781
 						$output .= '},';
711 782
 						//if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
712
-						if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
783
+						if ($spotter_item['aircraft_icao'] != '') {
784
+							$output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
785
+						}
713 786
 						$modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
714 787
 					}
715 788
 				} elseif ($tracker && isset($spotter_item['type'])) {
@@ -817,8 +890,11 @@  discard block
 block discarded – undo
817 890
 					$output .= '},';
818 891
 				}
819 892
 			}
820
-			if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output);
821
-			else $output = str_replace('%onground%','false',$output);
893
+			if (isset($onground) && $onground) {
894
+				$output = str_replace('%onground%','true',$output);
895
+			} else {
896
+				$output = str_replace('%onground%','false',$output);
897
+			}
822 898
 
823 899
 	//		$output .= '"heightReference": "CLAMP_TO_GROUND",';
824 900
 			//$output .= '"heightReference": "'.$heightrelative.'",';
@@ -831,9 +907,15 @@  discard block
 block discarded – undo
831 907
 	//		$output .= '"interpolationDegree" : 5,';
832 908
 	//		$output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", ';
833 909
 			$output .= '"cartographicDegrees": [';
834
-			if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']);
835
-			if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) $minitracktime = strtotime($spotter_item['date']);
836
-			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
910
+			if ($minitime > strtotime($spotter_item['date'])) {
911
+				$minitime = strtotime($spotter_item['date']);
912
+			}
913
+			if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) {
914
+				$minitracktime = strtotime($spotter_item['date']);
915
+			}
916
+			if ($maxitime < strtotime($spotter_item['date'])) {
917
+				$maxitime = strtotime($spotter_item['date']);
918
+			}
837 919
 			$output .= '"'.date("c",strtotime($spotter_item['date'])).'", ';
838 920
 			$output .= $spotter_item['longitude'].', ';
839 921
 			$output .= $spotter_item['latitude'];
@@ -856,7 +938,9 @@  discard block
 block discarded – undo
856 938
 					$output .= ', '.round($spotter_item['altitude']*30.48);
857 939
 					$prevalt = round($spotter_item['altitude']*30.48);
858 940
 				}
859
-			} else $output .= ', 0';
941
+			} else {
942
+				$output .= ', 0';
943
+			}
860 944
 			//$orientation = '"orientation" : { ';
861 945
 			//$orientation .= '"unitQuaternion": [';
862 946
 			//$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0));
@@ -864,13 +948,18 @@  discard block
 block discarded – undo
864 948
 		} else {
865 949
 			$nblatlong = $nblatlong+1;
866 950
 			$output .= ',"'.date("c",strtotime($spotter_item['date'])).'", ';
867
-			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
951
+			if ($maxitime < strtotime($spotter_item['date'])) {
952
+				$maxitime = strtotime($spotter_item['date']);
953
+			}
868 954
 			if ($spotter_item['ground_speed'] == 0) {
869 955
 				$output .= $prevlong.', ';
870 956
 				$output .= $prevlat;
871 957
 				//if (!$marine && (!isset($onground) || !$onground)) $output .= ', '.$prevalt;
872
-				if (!$marine) $output .= ', '.$prevalt;
873
-				else $output .= ', 0';
958
+				if (!$marine) {
959
+					$output .= ', '.$prevalt;
960
+				} else {
961
+					$output .= ', 0';
962
+				}
874 963
 			} else {
875 964
 				$output .= $spotter_item['longitude'].', ';
876 965
 				$output .= $spotter_item['latitude'];
@@ -883,14 +972,17 @@  discard block
 block discarded – undo
883 972
 							$output .= ', 0';
884 973
 						}
885 974
 					} else {
886
-						if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') $output .= ', '.round($spotter_item['real_altitude']*0.3048);
887
-						elseif ($tracker) {
975
+						if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') {
976
+							$output .= ', '.round($spotter_item['real_altitude']*0.3048);
977
+						} elseif ($tracker) {
888 978
 							$output .= ', '.round($spotter_item['altitude']*0.3048);
889 979
 						} else {
890 980
 							$output .= ', '.round($spotter_item['altitude']*30.48);
891 981
 						}
892 982
 					}
893
-				} else $output .= ', 0';
983
+				} else {
984
+					$output .= ', 0';
985
+				}
894 986
 			}
895 987
 			//$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0));
896 988
 			//$orientation .= ',"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w'];
@@ -911,9 +1003,10 @@  discard block
 block discarded – undo
911 1003
 		} else {
912 1004
 			$output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output);
913 1005
 		}
1006
+	} else {
1007
+		$output = str_replace('%minitime%',date("c",$minitime),$output);
914 1008
 	}
915
-	else $output = str_replace('%minitime%',date("c",$minitime),$output);
916
-} elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) {
1009
+	} elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) {
917 1010
 	$output = str_replace('%minitime%',date("c",$minitracktime),$output);
918 1011
 } else {
919 1012
 	$output = str_replace('%minitime%',date("c",$minitime),$output);
@@ -923,7 +1016,10 @@  discard block
 block discarded – undo
923 1016
 } else {
924 1017
 	$output = str_replace('%maxitime%',date("c",$maxitime),$output);
925 1018
 }
926
-if ($gltf2) $output = str_replace('%gltf2%','true',$output);
927
-else $output = str_replace('%gltf2%','false',$output);
1019
+if ($gltf2) {
1020
+	$output = str_replace('%gltf2%','true',$output);
1021
+} else {
1022
+	$output = str_replace('%gltf2%','false',$output);
1023
+}
928 1024
 print $output;
929 1025
 ?>
Please login to merge, or discard this patch.
aircraft-detailed.php 1 patch
Braces   +16 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 		$limit_start = 0;
15 15
 		$limit_end = 25;
16 16
 		$absolute_difference = 25;
17
-	}  else {
17
+	} else {
18 18
 		$limit_explode = explode(",", $_GET['limit']);
19 19
 		$limit_start = $limit_explode[0];
20 20
 		$limit_end = $limit_explode[1];
@@ -50,7 +50,9 @@  discard block
 block discarded – undo
50 50
 		print '<option></option>';
51 51
 		$Stats = new Stats();
52 52
 		$aircraft_types = $Stats->getAllAircraftTypes();
53
-		if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes();
53
+		if (empty($aircraft_types)) {
54
+			$aircraft_types = $Spotter->getAllAircraftTypes();
55
+		}
54 56
 		foreach($aircraft_types as $aircrafttype)
55 57
 		{
56 58
 			if($aircraft_type == $aircrafttype['aircraft_icao'])
@@ -73,14 +75,22 @@  discard block
 block discarded – undo
73 75
 				print '<div><span class="label">'._("Name").'</span>'.$aircraft_info[0]['type'].'</div>';
74 76
 				print '<div><span class="label">'._("ICAO").'</span>'.$aircraft_info[0]['icao'].'</div>'; 
75 77
 				print '<div><span class="label">'._("Manufacturer").'</span><a href="'.$globalURL.'/manufacturer/'.strtolower(str_replace(" ", "-", $aircraft_info[0]['manufacturer'])).'">'.$aircraft_info[0]['manufacturer'].'</a></div>';
76
-				if ($aircraft_info[0]['aircraft_description'] != '' && $aircraft_info[0]['aircraft_description'] != 'None') print '<div><span class="label">'._("Description").'</span>'.$aircraft_info[0]['aircraft_description'].'</div>'; 
77
-				if ($aircraft_info[0]['engine_type'] != '' && $aircraft_info[0]['engine_type'] != 'None') print '<div><span class="label">'._("Engine").'</span>'.$aircraft_info[0]['engine_type'].'</div>'; 
78
-				if ($aircraft_info[0]['engine_count'] != '' && $aircraft_info[0]['engine_count'] != 0) print '<div><span class="label">'._("Engine count").'</span>'.$aircraft_info[0]['engine_count'].'</div>'; 
78
+				if ($aircraft_info[0]['aircraft_description'] != '' && $aircraft_info[0]['aircraft_description'] != 'None') {
79
+					print '<div><span class="label">'._("Description").'</span>'.$aircraft_info[0]['aircraft_description'].'</div>';
80
+				}
81
+				if ($aircraft_info[0]['engine_type'] != '' && $aircraft_info[0]['engine_type'] != 'None') {
82
+					print '<div><span class="label">'._("Engine").'</span>'.$aircraft_info[0]['engine_type'].'</div>';
83
+				}
84
+				if ($aircraft_info[0]['engine_count'] != '' && $aircraft_info[0]['engine_count'] != 0) {
85
+					print '<div><span class="label">'._("Engine count").'</span>'.$aircraft_info[0]['engine_count'].'</div>';
86
+				}
79 87
 			} else {
80 88
 				print '<h1>'.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')</h1>';
81 89
 				print '<div><span class="label">'._("Name").'</span>'.$spotter_array[0]['aircraft_name'].'</div>';
82 90
 				print '<div><span class="label">'._("ICAO").'</span>'.$spotter_array[0]['aircraft_type'].'</div>'; 
83
-				if (isset($spotter_array[0]['aircraft_manufacturer'])) print '<div><span class="label">'._("Manufacturer").'</span><a href="'.$globalURL.'/manufacturer/'.strtolower(str_replace(" ", "-", $spotter_array[0]['aircraft_manufacturer'])).'">'.$spotter_array[0]['aircraft_manufacturer'].'</a></div>';
91
+				if (isset($spotter_array[0]['aircraft_manufacturer'])) {
92
+					print '<div><span class="label">'._("Manufacturer").'</span><a href="'.$globalURL.'/manufacturer/'.strtolower(str_replace(" ", "-", $spotter_array[0]['aircraft_manufacturer'])).'">'.$spotter_array[0]['aircraft_manufacturer'].'</a></div>';
93
+				}
84 94
 			}
85 95
 			print '</div>';
86 96
 		} else {
Please login to merge, or discard this patch.
airport-detailed.php 1 patch
Braces   +22 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 		$limit_start = 0;
16 16
 		$limit_end = 25;
17 17
 		$absolute_difference = 25;
18
-	}  else {
18
+	} else {
19 19
 		$limit_explode = explode(",", $_GET['limit']);
20 20
 		$limit_start = $limit_explode[0];
21 21
 		$limit_end = $limit_explode[1];
@@ -46,7 +46,9 @@  discard block
 block discarded – undo
46 46
 			$METAR = new METAR();
47 47
 			$metar_info = $METAR->getMETAR($airport_icao);
48 48
 			//print_r($metar_info);
49
-			if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']);
49
+			if (isset($metar_info[0]['metar'])) {
50
+				$metar_parse = $METAR->parse($metar_info[0]['metar']);
51
+			}
50 52
             		//print_r($metar_parse);
51 53
 		}
52 54
 		
@@ -60,7 +62,9 @@  discard block
 block discarded – undo
60 62
 		print '<option></option>';
61 63
 		$Stats = new Stats();
62 64
 		$airport_names = $Stats->getAllAirportNames();
63
-		if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
65
+		if (empty($airport_names)) {
66
+			$airport_names = $Spotter->getAllAirportNames();
67
+		}
64 68
 		ksort($airport_names);
65 69
 		foreach($airport_names as $airport_name)
66 70
 		{
@@ -95,9 +99,15 @@  discard block
 block discarded – undo
95 99
 			print '</div>';
96 100
 			print '<div><span class="label">'._("Coordinates").'</span><a href="http://maps.google.com/maps?z=10&t=k&q='.$airport_array[0]['latitude'].','.$airport_array[0]['longitude'].'" target="_blank">Google Map<i class="fa fa-angle-double-right"></i></a></div>';
97 101
 			print '<div><span class="label">'._("Live Air Traffic").'</span><a href="http://www.liveatc.net/search/?icao='.$airport_array[0]['icao'].'" target="_blank">LiveATC.net<i class="fa fa-angle-double-right"></i></a></div>';
98
-			if (isset($airport_array[0]['home_link']) && $airport_array[0]['home_link'] != '') print '<div><a href="'.$airport_array[0]['home_link'].'"><i class="fa fa-home"></i></a></div>';
99
-			if (isset($airport_array[0]['wikipedia_link']) && $airport_array[0]['wikipedia_link'] != '') print '<div><a href="'.$airport_array[0]['wikipedia_link'].'"><i class="fa fa-wikipedia-w"></i></a></div>';
100
-			if (isset($airport_array[0]['diagram_pdf']) && $airport_array[0]['diagram_pdf'] != '') print '<div><span class="label">'._("Diagram").'</span><a href="'.$airport_array[0]['diagram_pdf'].'" target="_blank">'.$airport_array[0]['icao'].'<i class="fa fa-angle-double-right"></i></a></div>';
102
+			if (isset($airport_array[0]['home_link']) && $airport_array[0]['home_link'] != '') {
103
+				print '<div><a href="'.$airport_array[0]['home_link'].'"><i class="fa fa-home"></i></a></div>';
104
+			}
105
+			if (isset($airport_array[0]['wikipedia_link']) && $airport_array[0]['wikipedia_link'] != '') {
106
+				print '<div><a href="'.$airport_array[0]['wikipedia_link'].'"><i class="fa fa-wikipedia-w"></i></a></div>';
107
+			}
108
+			if (isset($airport_array[0]['diagram_pdf']) && $airport_array[0]['diagram_pdf'] != '') {
109
+				print '<div><span class="label">'._("Diagram").'</span><a href="'.$airport_array[0]['diagram_pdf'].'" target="_blank">'.$airport_array[0]['icao'].'<i class="fa fa-angle-double-right"></i></a></div>';
110
+			}
101 111
 			print '</div>';
102 112
 			
103 113
 			$Stats = new Stats();
@@ -105,7 +115,9 @@  discard block
 block discarded – undo
105 115
 			// Use spotter also
106 116
 			if (isset($globalTimezone)) {
107 117
 				date_default_timezone_set($globalTimezone);
108
-			} else date_default_timezone_set('UTC');
118
+			} else {
119
+				date_default_timezone_set('UTC');
120
+			}
109 121
 			if (count($all_data) > 0) {
110 122
 				print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">';
111 123
 				print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
@@ -211,7 +223,9 @@  discard block
 block discarded – undo
211 223
 			print '</div>';
212 224
 			print '</div>';
213 225
 		} else {
214
-			if (isset($airport_array[0]['image']) && $airport_array[0]['image'] != '') print '<center><img src="'.$airport_array[0]['image'].'" /></center>';
226
+			if (isset($airport_array[0]['image']) && $airport_array[0]['image'] != '') {
227
+				print '<center><img src="'.$airport_array[0]['image'].'" /></center>';
228
+			}
215 229
 			print '<p>'._("Sorry, no flights used the airport in this database.").'</p>'; 
216 230
 		}
217 231
 	} else {
Please login to merge, or discard this patch.
incident-detailed.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,12 @@
 block discarded – undo
58 58
 if (!empty($spotter_array) && isset($spotter_array[0]['query_number_rows']) && $spotter_array[0]['query_number_rows'] != 0) {
59 59
 	include('table-output.php');
60 60
 	print '<div class="pagination">';
61
-	if ($limit_previous_1 >= 0) print '<a href="'.$page_url.'/'.$date.'/'.$limit_previous_1.','.$limit_previous_2.'">&laquo;'._("Previous Page").'</a>';
62
-	if ($spotter_array[0]['query_number_rows'] == $absolute_difference) print '<a href="'.$page_url.'/'.$date.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'&raquo;</a>';
61
+	if ($limit_previous_1 >= 0) {
62
+		print '<a href="'.$page_url.'/'.$date.'/'.$limit_previous_1.','.$limit_previous_2.'">&laquo;'._("Previous Page").'</a>';
63
+	}
64
+	if ($spotter_array[0]['query_number_rows'] == $absolute_difference) {
65
+		print '<a href="'.$page_url.'/'.$date.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'&raquo;</a>';
66
+	}
63 67
 	print '</div>';
64 68
 }
65 69
 print '</div>';
Please login to merge, or discard this patch.
accident-detailed.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,12 @@
 block discarded – undo
58 58
 if (!empty($spotter_array) && isset($spotter_array[0]['query_number_rows']) && $spotter_array[0]['query_number_rows'] != 0) {
59 59
 	include('table-output.php');
60 60
 	print '<div class="pagination">';
61
-	if ($limit_previous_1 >= 0) print '<a href="'.$page_url.'/'.$date.'/'.$limit_previous_1.','.$limit_previous_2.'">&laquo;'._("Previous Page").'</a>';
62
-	if ($spotter_array[0]['query_number_rows'] == $absolute_difference) print '<a href="'.$page_url.'/'.$date.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'&raquo;</a>';
61
+	if ($limit_previous_1 >= 0) {
62
+		print '<a href="'.$page_url.'/'.$date.'/'.$limit_previous_1.','.$limit_previous_2.'">&laquo;'._("Previous Page").'</a>';
63
+	}
64
+	if ($spotter_array[0]['query_number_rows'] == $absolute_difference) {
65
+		print '<a href="'.$page_url.'/'.$date.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'&raquo;</a>';
66
+	}
63 67
 	print '</div>';
64 68
 }
65 69
 print '</div>';
Please login to merge, or discard this patch.
owner-statistics-time.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,12 @@
 block discarded – undo
14 14
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
15 15
 $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
16 16
 $filter = array();
17
-if ($year != '') $filter = array_merge($filter,array('year' => $year));
18
-if ($month != '') $filter = array_merge($filter,array('month' => $month));
17
+if ($year != '') {
18
+	$filter = array_merge($filter,array('year' => $year));
19
+}
20
+if ($month != '') {
21
+	$filter = array_merge($filter,array('month' => $month));
22
+}
19 23
 $archive = false;
20 24
 $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter);
21 25
 if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
Please login to merge, or discard this patch.
owner-statistics-arrival-airport-country.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,12 @@
 block discarded – undo
14 14
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
15 15
 $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
16 16
 $filter = array();
17
-if ($year != '') $filter = array_merge($filter,array('year' => $year));
18
-if ($month != '') $filter = array_merge($filter,array('month' => $month));
17
+if ($year != '') {
18
+	$filter = array_merge($filter,array('year' => $year));
19
+}
20
+if ($month != '') {
21
+	$filter = array_merge($filter,array('month' => $month));
22
+}
19 23
 $archive = false;
20 24
 $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort, $filter);
21 25
 if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
Please login to merge, or discard this patch.
owner-detailed.php 1 patch
Braces   +23 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,8 +45,12 @@  discard block
 block discarded – undo
45 45
 	$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
46 46
 	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
47 47
 	$filter = array();
48
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
49
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
48
+	if ($year != '') {
49
+		$filter = array_merge($filter,array('year' => $year));
50
+	}
51
+	if ($month != '') {
52
+		$filter = array_merge($filter,array('month' => $month));
53
+	}
50 54
 	$spotter_array = $Spotter->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference, $sort,$filter);
51 55
 	if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
52 56
 		$spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference, $sort,$filter);
@@ -56,16 +60,25 @@  discard block
 block discarded – undo
56 60
 	{
57 61
 		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['aircraft_owner']);
58 62
 		//$ident = $spotter_array[0]['ident'];
59
-		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
60
-		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
63
+		if (isset($spotter_array[0]['latitude'])) {
64
+			$latitude = $spotter_array[0]['latitude'];
65
+		}
66
+		if (isset($spotter_array[0]['longitude'])) {
67
+			$longitude = $spotter_array[0]['longitude'];
68
+		}
61 69
 		require_once('header.php');
62 70
 		print '<div class="info column">';
63 71
 		print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>';
64 72
 		//print '<div><span class="label">'._("Owner").'</span>'.$spotter_array[0]['aircraft_owner'].'</div>';
65 73
 		$Stats = new Stats();
66
-		if ($year == '' && $month == '') $flights = $Stats->getStatsOwner($owner);
67
-		else $flights = 0;
68
-		if ($flights == 0) $flights = $Spotter->countFlightsByOwner($owner,$filter);
74
+		if ($year == '' && $month == '') {
75
+			$flights = $Stats->getStatsOwner($owner);
76
+		} else {
77
+			$flights = 0;
78
+		}
79
+		if ($flights == 0) {
80
+			$flights = $Spotter->countFlightsByOwner($owner,$filter);
81
+		}
69 82
 		print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>';
70 83
 		$aircraft_type = count($Spotter->countAllAircraftTypesByOwner($owner,$filter));
71 84
 		print '<div><span class="label">'._("Aircraft type").'</span>'.$aircraft_type.'</div>';
@@ -76,7 +89,9 @@  discard block
 block discarded – undo
76 89
 		$airlines = count($Spotter->countAllAirlinesByOwner($owner,$filter));
77 90
 		print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>';
78 91
 		$duration = $Spotter->getFlightDurationByOwner($owner,$filter);
79
-		if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
92
+		if ($duration != '0') {
93
+			print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
94
+		}
80 95
 		print '</div>';
81 96
 	
82 97
 		include('owner-sub-menu.php');
Please login to merge, or discard this patch.
owner-statistics-airline.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,12 @@
 block discarded – undo
14 14
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
15 15
 $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
16 16
 $filter = array();
17
-if ($year != '') $filter = array_merge($filter,array('year' => $year));
18
-if ($month != '') $filter = array_merge($filter,array('month' => $month));
17
+if ($year != '') {
18
+	$filter = array_merge($filter,array('year' => $year));
19
+}
20
+if ($month != '') {
21
+	$filter = array_merge($filter,array('month' => $month));
22
+}
19 23
 $archive = false;
20 24
 $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter);
21 25
 if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
Please login to merge, or discard this patch.