Completed
Push — master ( 46434e...ad133e )
by Yannick
32:08 queued 16:03
created
js/map-aircraft.3d.js.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -289,8 +289,8 @@  discard block
 block discarded – undo
289 289
 			var entityid = entity.id;
290 290
 			var lastupdateentity = entity.properties.lastupdate;
291 291
 			<?php 
292
-			    if (isset($globalMapUseBbox) && $globalMapUseBbox) {
293
-			    // Remove flights not in latest CZML
292
+				if (isset($globalMapUseBbox) && $globalMapUseBbox) {
293
+				// Remove flights not in latest CZML
294 294
 			?>
295 295
 			if (lastupdateentity != lastupdate) {
296 296
 				console.log('Remove...');
@@ -298,14 +298,14 @@  discard block
 block discarded – undo
298 298
 				czmlds.entities.removeById(entityid);
299 299
 			}
300 300
 			<?php
301
-			    } else {
301
+				} else {
302 302
 			?>
303 303
 			if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) {
304 304
 				viewer.dataSources.get(dsn).entities.remove(entity);
305 305
 				czmlds.entities.removeById(entityid);
306 306
 			}
307 307
 			<?php
308
-			    }
308
+				}
309 309
 			?>
310 310
 		}
311 311
 	}
@@ -762,12 +762,12 @@  discard block
 block discarded – undo
762 762
 }
763 763
 
764 764
 <?php
765
-    if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) {
765
+	if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) {
766 766
 ?>
767 767
 update_atcLayer();
768 768
 setInterval(function(){update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>);
769 769
 <?php
770
-    }
770
+	}
771 771
 ?>
772 772
 
773 773
 function iconColor(color) {
Please login to merge, or discard this patch.
Braces   +24 added lines, -4 removed lines patch added patch discarded remove patch
@@ -304,7 +304,12 @@  discard block
 block discarded – undo
304 304
 			<?php
305 305
 			    } else {
306 306
 			?>
307
-			if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) {
307
+			if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) {
308
+	print $globalMapRefresh*2000;
309
+} else {
310
+	print '60000';
311
+}
312
+?>)) {
308 313
 				viewer.dataSources.get(dsn).entities.remove(entity);
309 314
 				czmlds.entities.removeById(entityid);
310 315
 			}
@@ -588,7 +593,12 @@  discard block
 block discarded – undo
588 593
 		if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
589 594
 ?>
590 595
 update_polarLayer();
591
-setInterval(function(){update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>);
596
+setInterval(function(){update_polarLayer()},<?php if (isset($globalMapRefresh)) {
597
+	print $globalMapRefresh*1000*2;
598
+} else {
599
+	print '60000';
600
+}
601
+?>);
592 602
 <?php
593 603
 		}
594 604
 ?>
@@ -700,7 +710,12 @@  discard block
 block discarded – undo
700 710
 			console.log('Reload...');
701 711
 			updateData();
702 712
 		}
703
-	,<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>);
713
+	,<?php if (isset($globalMapRefresh)) {
714
+	print $globalMapRefresh*1000;
715
+} else {
716
+	print '30000';
717
+}
718
+?>);
704 719
 } else {
705 720
 	var clockViewModel = new Cesium.ClockViewModel(viewer.clock);
706 721
 	var animationViewModel = new Cesium.AnimationViewModel(clockViewModel);
@@ -729,7 +744,12 @@  discard block
 block discarded – undo
729 744
     if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) {
730 745
 ?>
731 746
 update_atcLayer();
732
-setInterval(function(){update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>);
747
+setInterval(function(){update_atcLayer()},<?php if (isset($globalMapRefresh)) {
748
+	print $globalMapRefresh*1000*2;
749
+} else {
750
+	print '60000';
751
+}
752
+?>);
733 753
 <?php
734 754
     }
735 755
 ?>
Please login to merge, or discard this patch.
aircraft-data.php 2 patches
Braces   +52 added lines, -19 removed lines patch added patch discarded remove patch
@@ -58,7 +58,9 @@  discard block
 block discarded – undo
58 58
 	{
59 59
 		if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') {
60 60
 			$image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
61
-		} else $image = $spotter_item['image_thumbnail'];
61
+		} else {
62
+			$image = $spotter_item['image_thumbnail'];
63
+		}
62 64
 	}
63 65
 	/* else {
64 66
 		$image = "images/placeholder_thumb.png";
@@ -75,10 +77,14 @@  discard block
 block discarded – undo
75 77
 	print '<div class="callsign-details">';
76 78
 	if ($spotter_item['ident'] != 'Not Available') {
77 79
 		print '<div class="callsign"><a href="'.$globalURL.'/redirect/'.$spotter_item['flightaware_id'].'" target="_blank">'.$spotter_item['ident'].'</a>';
78
-		if (isset($spotter_item['blocked']) && $spotter_item['blocked'] === true) print '<img src="'.$globalURL.'/images/forbidden.png" title="'._("Callsign is in blocked FAA list").'" class="blocked" />';
80
+		if (isset($spotter_item['blocked']) && $spotter_item['blocked'] === true) {
81
+			print '<img src="'.$globalURL.'/images/forbidden.png" title="'._("Callsign is in blocked FAA list").'" class="blocked" />';
82
+		}
79 83
 		print '</div>';
80 84
 	}
81
-	if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != 'Not Available') print '<div class="airline">'.$spotter_item['airline_name'].'</div>';
85
+	if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != 'Not Available') {
86
+		print '<div class="airline">'.$spotter_item['airline_name'].'</div>';
87
+	}
82 88
 	print '</div>';
83 89
 	if ($spotter_item['departure_airport'] != 'NA' && $spotter_item['arrival_airport'] != 'NA') {
84 90
 		print '<div class="nomobile airports"><div class="airport"><span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport'].'</a></span>'.$spotter_item['departure_airport_city'].' '.$spotter_item['departure_airport_country'];
@@ -110,15 +116,25 @@  discard block
 block discarded – undo
110 116
 	print '</div>';
111 117
 	print '<div id="aircraft">';
112 118
 	print '<span>'._("Aircraft").'</span>';
113
-	if (isset($spotter_item['aircraft_wiki'])) print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>';
119
+	if (isset($spotter_item['aircraft_wiki'])) {
120
+		print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>';
121
+	}
114 122
 	if (isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_manufacturer']) && $spotter_item['aircraft_manufacturer'] != 'N/A' && isset($spotter_item['aircraft_name']) && $spotter_item['aircraft_name'] != 'N/A') {
115 123
 		$aircraft_names = explode('/',$spotter_item['aircraft_name']);
116
-		if (count($aircraft_names) == 1) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>';
117
-		else print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].' ('.$spotter_item['aircraft_type'].')</a>';
118
-	} elseif (isset($spotter_item['aircraft_type'])) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a>';
119
-	else print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'];
124
+		if (count($aircraft_names) == 1) {
125
+			print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>';
126
+		} else {
127
+			print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].' ('.$spotter_item['aircraft_type'].')</a>';
128
+		}
129
+	} elseif (isset($spotter_item['aircraft_type'])) {
130
+		print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a>';
131
+	} else {
132
+		print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'];
133
+	}
120 134
 	print '</div>';
121
-	if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>';
135
+	if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') {
136
+		print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>';
137
+	}
122 138
 
123 139
 	print '<div id="altitude"><span>'._("Altitude").'</span>';
124 140
 	if (isset($globalGroundAltitude) && $globalGroundAltitude) {
@@ -131,11 +147,17 @@  discard block
 block discarded – undo
131 147
 
132 148
 	print '<span class="altitude">';
133 149
 	if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
134
-		if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') print $spotter_item['real_altitude'].' feet (FL'.$spotter_item['altitude'].')';
135
-		else print $spotter_item['altitude'].'00 feet (FL'.$spotter_item['altitude'].')';
150
+		if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') {
151
+			print $spotter_item['real_altitude'].' feet (FL'.$spotter_item['altitude'].')';
152
+		} else {
153
+			print $spotter_item['altitude'].'00 feet (FL'.$spotter_item['altitude'].')';
154
+		}
136 155
 	} else {
137
-		if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') print round($spotter_item['real_altitude']*0.3048).' m (FL'.$spotter_item['altitude'].')';
138
-		else print round($spotter_item['altitude']*30.48).' m (FL'.$spotter_item['altitude'].')';
156
+		if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') {
157
+			print round($spotter_item['real_altitude']*0.3048).' m (FL'.$spotter_item['altitude'].')';
158
+		} else {
159
+			print round($spotter_item['altitude']*30.48).' m (FL'.$spotter_item['altitude'].')';
160
+		}
139 161
 	}
140 162
 	print '</span>';
141 163
 
@@ -200,8 +222,11 @@  discard block
 block discarded – undo
200 222
 	}
201 223
 	if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != '') {
202 224
 		print '<div id="pilot"><span>'._("Pilot").'</span>';
203
-		if (isset($spotter_item['pilot_id'])) print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')';
204
-		else print $spotter_item['pilot_name'];
225
+		if (isset($spotter_item['pilot_id'])) {
226
+			print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')';
227
+		} else {
228
+			print $spotter_item['pilot_name'];
229
+		}
205 230
 		print '</div>';
206 231
 	}
207 232
 	if (isset($spotter_item['aircraft_owner']) && $spotter_item['aircraft_owner'] != '') {
@@ -227,10 +252,18 @@  discard block
 block discarded – undo
227 252
 	}
228 253
 	print '</div>';
229 254
 	print '</div>';
230
-	if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>';
231
-	if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>';
232
-	if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>';
233
-	if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>';
255
+	if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') {
256
+		print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>';
257
+	}
258
+	if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') {
259
+		print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>';
260
+	}
261
+	if (isset($spotter_item['acars']['message'])) {
262
+		print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>';
263
+	}
264
+	if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) {
265
+		print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>';
266
+	}
234 267
 	print '</div>';
235 268
 }
236 269
 ?>
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@  discard block
 block discarded – undo
13 13
 
14 14
 $from_archive = false;
15 15
 if (isset($_GET['ident'])) {
16
-	$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
16
+	$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
17 17
 	if (isset($_GET['currenttime'])) {
18
-		$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
18
+		$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
19 19
 		$currenttime = round($currenttime/1000);
20
-		$spotter_array = $SpotterLive->getDateLiveSpotterDataByIdent($ident,$currenttime);
20
+		$spotter_array = $SpotterLive->getDateLiveSpotterDataByIdent($ident, $currenttime);
21 21
 		if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
22 22
 			$from_archive = true;
23
-			$spotter_array = $SpotterArchive->getDateArchiveSpotterDataByIdent($ident,$currenttime);
23
+			$spotter_array = $SpotterArchive->getDateArchiveSpotterDataByIdent($ident, $currenttime);
24 24
 		}
25 25
 	} else {
26 26
 		$spotter_array = $SpotterLive->getLastLiveSpotterDataByIdent($ident);
@@ -31,15 +31,15 @@  discard block
 block discarded – undo
31 31
 	}
32 32
 }
33 33
 if (isset($_GET['flightaware_id'])) {
34
-	$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
34
+	$flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING);
35 35
 	if (isset($_GET['currenttime'])) {
36
-		$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
36
+		$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
37 37
 		$currenttime = round($currenttime/1000);
38
-		$spotter_array = $SpotterLive->getDateLiveSpotterDataById($flightaware_id,$currenttime);
38
+		$spotter_array = $SpotterLive->getDateLiveSpotterDataById($flightaware_id, $currenttime);
39 39
 		if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
40 40
 			$from_archive = true;
41 41
 //			$spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id);
42
-			$spotter_array = $SpotterArchive->getDateArchiveSpotterDataById($flightaware_id,$currenttime);
42
+			$spotter_array = $SpotterArchive->getDateArchiveSpotterDataById($flightaware_id, $currenttime);
43 43
 		}
44 44
 	} else {
45 45
 		$spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "")
60 60
 	{
61 61
 		if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') {
62
-			$image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
62
+			$image = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']);
63 63
 		} else $image = $spotter_item['image_thumbnail'];
64 64
 	}
65 65
 	/* else {
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 		print '<div class="nomobile airports"><div class="airport"><span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport'].'</a></span>'.$spotter_item['departure_airport_city'].' '.$spotter_item['departure_airport_country'];
87 87
 		if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') {
88 88
 			if ($spotter_item['departure_airport_time'] > 2460) {
89
-				print '<br /><span class="time">'.date('H:m',$spotter_item['departure_airport_time']).'</span>';
89
+				print '<br /><span class="time">'.date('H:m', $spotter_item['departure_airport_time']).'</span>';
90 90
 			} else {
91 91
 				print '<br /><span class="time">'.$spotter_item['departure_airport_time'].'</span>';
92 92
 			}
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		print '<span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'" target="_blank">'.$spotter_item['arrival_airport'].'</a></span>'.$spotter_item['arrival_airport_city'].' '.$spotter_item['arrival_airport_country'];
96 96
 		if (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') {
97 97
 			if ($spotter_item['arrival_airport_time'] > 2460) {
98
-				print '<br /><span class="time">'.date('H:m',$spotter_item['arrival_airport_time']).'</span>';
98
+				print '<br /><span class="time">'.date('H:m', $spotter_item['arrival_airport_time']).'</span>';
99 99
 			} else {
100 100
 				print '<br /><span class="time">'.$spotter_item['arrival_airport_time'].'</span>';
101 101
 			}
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	print '<span>'._("Aircraft").'</span>';
115 115
 	if (isset($spotter_item['aircraft_wiki'])) print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>';
116 116
 	if (isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_manufacturer']) && $spotter_item['aircraft_manufacturer'] != 'N/A' && isset($spotter_item['aircraft_name']) && $spotter_item['aircraft_name'] != 'N/A') {
117
-		$aircraft_names = explode('/',$spotter_item['aircraft_name']);
117
+		$aircraft_names = explode('/', $spotter_item['aircraft_name']);
118 118
 		if (count($aircraft_names) == 1) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>';
119 119
 		else print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].' ('.$spotter_item['aircraft_type'].')</a>';
120 120
 	} elseif (isset($spotter_item['aircraft_type'])) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a>';
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 	print '<div id="altitude"><span>'._("Altitude").'</span>';
126 126
 	if (isset($globalGroundAltitude) && $globalGroundAltitude) {
127 127
 		try {
128
-			$groundAltitude = $Elevation->getElevation($spotter_item['latitude'],$spotter_item['longitude']);
129
-		} catch(Exception $e) {
128
+			$groundAltitude = $Elevation->getElevation($spotter_item['latitude'], $spotter_item['longitude']);
129
+		} catch (Exception $e) {
130 130
 			// If catched not exist
131 131
 		}
132 132
 	}
@@ -157,15 +157,15 @@  discard block
 block discarded – undo
157 157
 	print '</div>';
158 158
 	print '<div id="coordinates"><span>'._("Coordinates").'</span>';
159 159
 	if ((!isset($_COOKIE['unitcoordinate']) && isset($globalUnitCoordinate) && $globalUnitCoordinate == 'dms') || (isset($_COOKIE['unitcoordinate']) && $_COOKIE['unitcoordinate'] == 'dms')) {
160
-		$latitude = $Common->convertDMS($spotter_item['latitude'],'latitude');
160
+		$latitude = $Common->convertDMS($spotter_item['latitude'], 'latitude');
161 161
 		print '<span class="latitude">'.$latitude['deg'].'° '.$latitude['min']."′ ".$latitude['sec'].'" '.$latitude['NSEW'].'</span>, ';
162
-		$longitude = $Common->convertDMS($spotter_item['longitude'],'longitude');
162
+		$longitude = $Common->convertDMS($spotter_item['longitude'], 'longitude');
163 163
 		print '<span class="longitude">'.$longitude['deg'].'° '.$longitude['min']."′ ".$longitude['sec'].'" '.$longitude['NSEW'].'</span>';
164 164
 	} elseif ((!isset($_COOKIE['unitcoordinate']) && isset($globalUnitCoordinate) && $globalUnitCoordinate == 'dm') || (isset($_COOKIE['unitcoordinate']) && $_COOKIE['unitcoordinate'] == 'dm')) {
165
-		$latitude = $Common->convertDM($spotter_item['latitude'],'latitude');
166
-		print '<span class="latitude">'.$latitude['deg'].'° '.round($latitude['min'],3)."′".$latitude['NSEW'].'</span>, ';
167
-		$longitude = $Common->convertDM($spotter_item['longitude'],'longitude');
168
-		print '<span class="longitude">'.$longitude['deg'].'° '.round($longitude['min'],3)."′".$longitude['NSEW'].'</span>';
165
+		$latitude = $Common->convertDM($spotter_item['latitude'], 'latitude');
166
+		print '<span class="latitude">'.$latitude['deg'].'° '.round($latitude['min'], 3)."′".$latitude['NSEW'].'</span>, ';
167
+		$longitude = $Common->convertDM($spotter_item['longitude'], 'longitude');
168
+		print '<span class="longitude">'.$longitude['deg'].'° '.round($longitude['min'], 3)."′".$longitude['NSEW'].'</span>';
169 169
 	} else {
170 170
 		print '<span class="latitude">'.$spotter_item['latitude'].'</span>, ';
171 171
 		print '<span class="longitude">'.$spotter_item['longitude'].'</span>';
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
 	if (isset($globalCam) && $globalCam) {
191 191
 		require_once(dirname(__FILE__).'/require/class.Common.php');
192 192
 		$Common = new Common();
193
-		$azimuth = round($Common->azimuth($globalCenterLatitude,$globalCenterLongitude,$spotter_item['latitude'],$spotter_item['longitude']));
194
-		$distance = $Common->distance($globalCenterLatitude,$globalCenterLongitude,$spotter_item['latitude'],$spotter_item['longitude'],'m');
195
-		$plunge = round($Common->plunge($globalCenterAltitude,$spotter_item['real_altitude'],$distance));
193
+		$azimuth = round($Common->azimuth($globalCenterLatitude, $globalCenterLongitude, $spotter_item['latitude'], $spotter_item['longitude']));
194
+		$distance = $Common->distance($globalCenterLatitude, $globalCenterLongitude, $spotter_item['latitude'], $spotter_item['longitude'], 'm');
195
+		$plunge = round($Common->plunge($globalCenterAltitude, $spotter_item['real_altitude'], $distance));
196 196
 		print '<div id="camcoordinates"><span>'._("Cam Coordinates").'</span>';
197 197
 		print 'azimuth: '.$azimuth;
198 198
 		print ' / ';
@@ -202,16 +202,16 @@  discard block
 block discarded – undo
202 202
 		print '</div>';
203 203
 		//echo $Common->getData('http://127.0.0.1/camera.php?azimuth='.$azimuth.'&plunge='.$plunge,'get','','','','','','',false,true);
204 204
 		//echo $Common->getData('file://'.dirname(__FILE__).'/camera.php?azimuth='.$azimuth.'&plunge='.$plunge,'get','','','','','','',false,true);
205
-		echo $Common->getData('http://'.$_SERVER['SERVER_NAME'].'/camera.php?azimuth='.$azimuth.'&plunge='.$plunge,'get','','','','','','',false,true);
205
+		echo $Common->getData('http://'.$_SERVER['SERVER_NAME'].'/camera.php?azimuth='.$azimuth.'&plunge='.$plunge, 'get', '', '', '', '', '', '', false, true);
206 206
 	}
207 207
   
208 208
 	print '<div id="heading"><span>'._("Heading").'</span><span class="heading">'.$spotter_item['heading'].'</span>°</div>';
209 209
 	if (isset($spotter_item['verticalrate']) && $spotter_item['verticalrate'] != '') {
210 210
 		print '<div id="verticalrate"><span>'._("Vertical rate").'</span>';
211 211
 		if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
212
-			print $spotter_item['verticalrate']. ' ft/min';
212
+			print $spotter_item['verticalrate'].' ft/min';
213 213
 		} else {
214
-			print round($spotter_item['verticalrate']*0.3048). ' m/min';
214
+			print round($spotter_item['verticalrate']*0.3048).' m/min';
215 215
 		}
216 216
 		print '</div>';
217 217
 	}
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	print '</div>';
247 247
 	if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>';
248 248
 	if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>';
249
-	if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>';
249
+	if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br/>', $spotter_item['acars']['message'])).'</div>';
250 250
 	if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>';
251 251
 	print '</div>';
252 252
 }
Please login to merge, or discard this patch.
airport-geojson.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		date_default_timezone_set('UTC');
28 28
 		//waypoint plotting
29 29
 		$output .= '{"type": "Feature",';
30
-		    $output .= '"properties": {';
30
+			$output .= '"properties": {';
31 31
 			$output .= '"name": '.json_encode(str_replace('"',"'",$spotter_item['name'])).',';
32 32
 			$output .= '"city": '.json_encode(str_replace('"',"'",$spotter_item['city'])).',';
33 33
 			$output .= '"country": "'.$spotter_item['country'].'",';
@@ -50,13 +50,13 @@  discard block
 block discarded – undo
50 50
 			$output .= '"homepage": "'.$spotter_item['home_link'].'",';
51 51
 			$output .= '"image_thumb": "'.$spotter_item['image_thumb'].'"';
52 52
 //			$output .= '"photo": "'.$spotter_item['image_thumbnail'].'",';
53
-		    $output .= '},';
54
-		    $output .= '"geometry": {';
53
+			$output .= '},';
54
+			$output .= '"geometry": {';
55 55
 			$output .= '"type": "Point",';
56 56
 			$output .= '"coordinates": [';
57
-			    $output .= $spotter_item['longitude'].', '.$spotter_item['latitude'];
57
+				$output .= $spotter_item['longitude'].', '.$spotter_item['latitude'];
58 58
 			$output .= ']';
59
-		    $output .= '}';
59
+			$output .= '}';
60 60
 		$output .= '},';
61 61
 	}
62 62
 	$output  = substr($output, 0, -1);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 if (isset($_GET['coord'])) 
13 13
 {
14
-	$coords = explode(',',$_GET['coord']);
14
+	$coords = explode(',', $_GET['coord']);
15 15
 	$spotter_array = $Spotter->getAllAirportInfobyCoord($coords);
16 16
 } else {
17 17
 	$spotter_array = $Spotter->getAllAirportInfo();
@@ -22,17 +22,17 @@  discard block
 block discarded – undo
22 22
             
23 23
 if (!empty($spotter_array))
24 24
 {	  
25
-	foreach($spotter_array as $spotter_item)
25
+	foreach ($spotter_array as $spotter_item)
26 26
 	{
27 27
 		date_default_timezone_set('UTC');
28 28
 		//waypoint plotting
29 29
 		$output .= '{"type": "Feature",';
30 30
 		    $output .= '"properties": {';
31
-			$output .= '"name": '.json_encode(str_replace('"',"'",$spotter_item['name'])).',';
32
-			$output .= '"city": '.json_encode(str_replace('"',"'",$spotter_item['city'])).',';
31
+			$output .= '"name": '.json_encode(str_replace('"', "'", $spotter_item['name'])).',';
32
+			$output .= '"city": '.json_encode(str_replace('"', "'", $spotter_item['city'])).',';
33 33
 			$output .= '"country": "'.$spotter_item['country'].'",';
34 34
 			$output .= '"altitude": "'.$spotter_item['altitude'].'",';
35
-			$output .= '"popupContent": '.json_encode(str_replace('"',"'",$spotter_item['name']).' : '.str_replace('"',"'",$spotter_item['city']).', '.$spotter_item['country']).',';
35
+			$output .= '"popupContent": '.json_encode(str_replace('"', "'", $spotter_item['name']).' : '.str_replace('"', "'", $spotter_item['city']).', '.$spotter_item['country']).',';
36 36
 			if ($spotter_item['type'] == 'large_airport') {
37 37
 				$output .= '"icon": "'.$globalURL.'/images/airport.png",';
38 38
 			} elseif ($spotter_item['type'] == 'heliport') {
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		    $output .= '}';
60 60
 		$output .= '},';
61 61
 	}
62
-	$output  = substr($output, 0, -1);
62
+	$output = substr($output, 0, -1);
63 63
 }
64 64
 $output .= ']}';
65 65
 print $output;
Please login to merge, or discard this patch.
live-czml.php 3 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -50,30 +50,30 @@  discard block
 block discarded – undo
50 50
 
51 51
 
52 52
 function quaternionrotate($heading, $attitude = 0, $bank = 0) {
53
-    // Assuming the angles are in radians.
54
-    $c1 = cos($heading/2);
55
-    $s1 = sin($heading/2);
56
-    $c2 = cos($attitude/2);
57
-    $s2 = sin($attitude/2);
58
-    $c3 = cos($bank/2);
59
-    $s3 = sin($bank/2);
60
-    $c1c2 = $c1*$c2;
61
-    $s1s2 = $s1*$s2;
62
-    $w =$c1c2*$c3 - $s1s2*$s3;
63
-    $x =$c1c2*$s3 + $s1s2*$c3;
64
-    $y =$s1*$c2*$c3 + $c1*$s2*$s3;
65
-    $z =$c1*$s2*$c3 - $s1*$c2*$s3;
66
-    return array('x' => $x,'y' => $y,'z' => $z,'w' => $w);
53
+	// Assuming the angles are in radians.
54
+	$c1 = cos($heading/2);
55
+	$s1 = sin($heading/2);
56
+	$c2 = cos($attitude/2);
57
+	$s2 = sin($attitude/2);
58
+	$c3 = cos($bank/2);
59
+	$s3 = sin($bank/2);
60
+	$c1c2 = $c1*$c2;
61
+	$s1s2 = $s1*$s2;
62
+	$w =$c1c2*$c3 - $s1s2*$s3;
63
+	$x =$c1c2*$s3 + $s1s2*$c3;
64
+	$y =$s1*$c2*$c3 + $c1*$s2*$s3;
65
+	$z =$c1*$s2*$c3 - $s1*$c2*$s3;
66
+	return array('x' => $x,'y' => $y,'z' => $z,'w' => $w);
67 67
 //    return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365');
68 68
 
69 69
 }
70 70
 
71 71
 
72 72
 if (isset($_GET['download'])) {
73
-    if ($_GET['download'] == "true")
74
-    {
73
+	if ($_GET['download'] == "true")
74
+	{
75 75
 	header('Content-disposition: attachment; filename="flightairmap.json"');
76
-    }
76
+	}
77 77
 }
78 78
 header('Content-Type: text/javascript');
79 79
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	if (isset($_GET['coord']) && $_GET['coord'] != '') {
185 185
 		$coord = explode(',',$_GET['coord']);
186 186
 		if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
187
-		    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
187
+			&& $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
188 188
 			$coord = array();
189 189
 		}
190 190
 	}
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 	if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') {
209 209
 		$coord = explode(',',$_GET['coord']);
210 210
 		if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
211
-		    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
211
+			&& $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
212 212
 			$coord = array();
213 213
 		}
214 214
 	}
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') {
230 230
 		$coord = explode(',',$_GET['coord']);
231 231
 		if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
232
-		    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
232
+			&& $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
233 233
 			$coord = array();
234 234
 		}
235 235
 	}
@@ -350,10 +350,10 @@  discard block
 block discarded – undo
350 350
 			$image = "images/placeholder_thumb.png";
351 351
 		}
352 352
 
353
-                if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id'];
354
-                elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid'];
355
-                elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id'];
356
-                if ($prev_flightaware_id != $id) {
353
+				if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id'];
354
+				elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid'];
355
+				elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id'];
356
+				if ($prev_flightaware_id != $id) {
357 357
 			if ($prev_flightaware_id != '') {
358 358
 				/*
359 359
 				if ($nblatlong == 1) {
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 							$spotter_item['wake_category'] = $aircraft_info[0]['wake_category'];
450 450
 							$spotter_item['engine_count'] = $aircraft_info[0]['engine_count'];
451 451
 						} else $aircraft_shadow = '';
452
-	    					$output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5';
452
+							$output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5';
453 453
 						if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
454 454
 							$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
455 455
 							$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 							$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
481 481
 							$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
482 482
 						}
483
-    						$output .= '},';
483
+							$output .= '},';
484 484
 					} elseif (isset($modelsdb[$aircraft_icao]) && $aircraft_icao != '') {
485 485
 						$output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_icao].'","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
486 486
 						$output .= ',"heightReference": "'.$heightrelative.'"';
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 							$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
489 489
 							$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
490 490
 						}
491
-    						$output .= '},';
491
+							$output .= '},';
492 492
 					} elseif ($aircraft_icao != '') {
493 493
 						$aircraft_info = $Spotter->getAllAircraftInfo($aircraft_icao);
494 494
 						if (isset($aircraft_info[0]['engine_type'])) {
Please login to merge, or discard this patch.
Spacing   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
     $s3 = sin($bank/2);
67 67
     $c1c2 = $c1*$c2;
68 68
     $s1s2 = $s1*$s2;
69
-    $w =$c1c2*$c3 - $s1s2*$s3;
70
-    $x =$c1c2*$s3 + $s1s2*$c3;
71
-    $y =$s1*$c2*$c3 + $c1*$s2*$s3;
72
-    $z =$c1*$s2*$c3 - $s1*$c2*$s3;
73
-    return array('x' => $x,'y' => $y,'z' => $z,'w' => $w);
69
+    $w = $c1c2*$c3 - $s1s2*$s3;
70
+    $x = $c1c2*$s3 + $s1s2*$c3;
71
+    $y = $s1*$c2*$c3 + $c1*$s2*$s3;
72
+    $z = $c1*$s2*$c3 - $s1*$c2*$s3;
73
+    return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w);
74 74
 //    return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365');
75 75
 
76 76
 }
@@ -92,22 +92,22 @@  discard block
 block discarded – undo
92 92
 $allhistory = false;
93 93
 $filter['source'] = array();
94 94
 $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);
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 107
 if (isset($_COOKIE['filter_blocked']) && $_COOKIE['filter_blocked'] == 'true') $filter['blocked'] = true;
108 108
 
109 109
 if (isset($_COOKIE['map_3d_limit'])) {
110
-	$limit = filter_var($_COOKIE['map_3d_limit'],FILTER_SANITIZE_NUMBER_INT);
110
+	$limit = filter_var($_COOKIE['map_3d_limit'], FILTER_SANITIZE_NUMBER_INT);
111 111
 }
112 112
 
113 113
 /*
@@ -156,17 +156,17 @@  discard block
 block discarded – undo
156 156
 	$from_archive = true;
157 157
 //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
158 158
 //	$enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
159
-	$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
160
-	$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
161
-	$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
162
-	$begindate = date('Y-m-d H:i:s',$begindate);
163
-	$enddate = date('Y-m-d H:i:s',$enddate);
159
+	$begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT);
160
+	$enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT);
161
+	$archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT);
162
+	$begindate = date('Y-m-d H:i:s', $begindate);
163
+	$enddate = date('Y-m-d H:i:s', $enddate);
164 164
 	if ($tracker) {
165
-		$spotter_array = $TrackerArchive->getMinLiveTrackerDataPlayback($begindate,$enddate,$filter);
165
+		$spotter_array = $TrackerArchive->getMinLiveTrackerDataPlayback($begindate, $enddate, $filter);
166 166
 	} elseif ($marine) {
167
-		$spotter_array = $MarineArchive->getMinLiveMarineDataPlayback($begindate,$enddate,$filter);
167
+		$spotter_array = $MarineArchive->getMinLiveMarineDataPlayback($begindate, $enddate, $filter);
168 168
 	} else {
169
-		$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter);
169
+		$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter);
170 170
 	}
171 171
 } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) {
172 172
 	$from_archive = true;
@@ -183,36 +183,36 @@  discard block
 block discarded – undo
183 183
 	}
184 184
 	$enddate = $_COOKIE['archive_end'];
185 185
 	$enddateinitial = $_COOKIE['archive_end'];
186
-	$archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT);
187
-	$begindate = date('Y-m-d H:i:s',$begindate);
188
-	$enddate = date('Y-m-d H:i:s',$enddate);
186
+	$archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT);
187
+	$begindate = date('Y-m-d H:i:s', $begindate);
188
+	$enddate = date('Y-m-d H:i:s', $enddate);
189 189
 	//echo 'Begin : '.$begindate.' - End : '.$enddate."\n";
190 190
 	if ($tracker) {
191
-		$spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate,$enddate,$filter);
191
+		$spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate, $enddate, $filter);
192 192
 	} elseif ($marine) {
193
-		$spotter_array = $MarineArchive->getMinLiveMarineData($begindate,$enddate,$filter);
193
+		$spotter_array = $MarineArchive->getMinLiveMarineData($begindate, $enddate, $filter);
194 194
 	} else {
195
-		$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
195
+		$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter);
196 196
 	}
197 197
 } elseif ($tracker) {
198 198
 	$coord = array();
199 199
 	if (isset($_GET['coord']) && $_GET['coord'] != '') {
200
-		$coord = explode(',',$_GET['coord']);
201
-		if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
200
+		$coord = explode(',', $_GET['coord']);
201
+		if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) 
202 202
 		    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
203 203
 			$coord = array();
204 204
 		}
205 205
 	}
206 206
 	$previous_filter = $filter;
207 207
 	if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackTracker']) && $_COOKIE['MapTrackTracker'] != '')) {
208
-		$filter = array_merge($filter,array('id' => $_COOKIE['MapTrackTracker']));
209
-		$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,false);
208
+		$filter = array_merge($filter, array('id' => $_COOKIE['MapTrackTracker']));
209
+		$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, false);
210 210
 	/*
211 211
 	} elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && !empty($coord)) {
212 212
 		$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true,$_COOKIE['MapTrack']);
213 213
 	*/
214 214
 	} elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') {
215
-		$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,false);
215
+		$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, false);
216 216
 	} else {
217 217
 		$spotter_array = array();
218 218
 	}
@@ -221,8 +221,8 @@  discard block
 block discarded – undo
221 221
 	$coord = array();
222 222
 	//if (isset($_GET['coord']) && $_GET['coord'] != '') {
223 223
 	if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') {
224
-		$coord = explode(',',$_GET['coord']);
225
-		if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
224
+		$coord = explode(',', $_GET['coord']);
225
+		if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) 
226 226
 		    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
227 227
 			$coord = array();
228 228
 		}
@@ -231,11 +231,11 @@  discard block
 block discarded – undo
231 231
 	if (((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') || (!isset($_COOKIE['singlemodel']) && isset($globalMap3DSelected) && $globalMap3DSelected)) && (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '')) {
232 232
 		//$filter = array_merge($filter,array('id' => $_COOKIE['MapTrackMarine']));
233 233
 		//$spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false);
234
-		$spotter_array = $MarineLive->getMinLastLiveMarineDataByID($_COOKIE['MapTrackMarine'],$filter,false);
234
+		$spotter_array = $MarineLive->getMinLastLiveMarineDataByID($_COOKIE['MapTrackMarine'], $filter, false);
235 235
 	} elseif (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '' && !empty($coord)) {
236
-		$spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false,$_COOKIE['MapTrack']);
236
+		$spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, false, $_COOKIE['MapTrack']);
237 237
 	} elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') {
238
-		$spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false);
238
+		$spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, false);
239 239
 	} else {
240 240
 		$spotter_array = array();
241 241
 	}
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
 } else {
244 244
 	$coord = array();
245 245
 	if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') {
246
-		$coord = explode(',',$_GET['coord']);
247
-		if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
246
+		$coord = explode(',', $_GET['coord']);
247
+		if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) 
248 248
 		    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
249 249
 			$coord = array();
250 250
 		}
@@ -252,14 +252,14 @@  discard block
 block discarded – undo
252 252
 	$previous_filter = $filter;
253 253
 	if (((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') || (!isset($_COOKIE['singlemodel']) && isset($globalMap3DSelected) && $globalMap3DSelected)) && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) {
254 254
 		//$filter = array_merge($filter,array('id' => $_COOKIE['MapTrack']));
255
-		$spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'],$filter,$limit);
255
+		$spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'], $filter, $limit);
256 256
 		//$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false);
257 257
 	} elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '') {
258 258
 		//$spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'],$filter,false);
259 259
 		//if (empty($spotter_array)) $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false,$_COOKIE['MapTrack']);
260
-		$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,$limit,$_COOKIE['MapTrack']);
260
+		$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, $limit, $_COOKIE['MapTrack']);
261 261
 	} elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') {
262
-		$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,$limit);
262
+		$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, $limit);
263 263
 	} else {
264 264
 		$spotter_array = array();
265 265
 	}
@@ -269,19 +269,19 @@  discard block
 block discarded – undo
269 269
 if (!empty($spotter_array) && isset($coord)) {
270 270
 	if ($tracker) {
271 271
 		if (isset($_GET['archive'])) {
272
-			$flightcnt = $TrackerArchive->getLiveTrackerCount($begindate,$enddate,$filter);
272
+			$flightcnt = $TrackerArchive->getLiveTrackerCount($begindate, $enddate, $filter);
273 273
 		} else {
274 274
 			$flightcnt = $TrackerLive->getLiveTrackerCount($filter);
275 275
 		}
276 276
 	} elseif ($marine) {
277 277
 		if (isset($_GET['archive'])) {
278
-			$flightcnt = $MarineArchive->getLiveMarineCount($begindate,$enddate,$filter);
278
+			$flightcnt = $MarineArchive->getLiveMarineCount($begindate, $enddate, $filter);
279 279
 		} else {
280 280
 			$flightcnt = $MarineLive->getLiveMarineCount($filter);
281 281
 		}
282 282
 	} else {
283 283
 		if (isset($_GET['archive'])) {
284
-			$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);
284
+			$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter);
285 285
 		} else {
286 286
 			$flightcnt = $SpotterLive->getLiveSpotterCount($filter);
287 287
 		}
@@ -289,17 +289,17 @@  discard block
 block discarded – undo
289 289
 	if ($flightcnt == '') $flightcnt = 0;
290 290
 } else $flightcnt = 0;
291 291
 
292
-$sqltime = round(microtime(true)-$begintime,2);
292
+$sqltime = round(microtime(true) - $begintime, 2);
293 293
 $minitime = time();
294 294
 $minitracktime_begin = time();
295 295
 $minitracktime = $minitracktime_begin;
296 296
 $maxitime = 0;
297
-$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT);
297
+$lastupdate = filter_input(INPUT_GET, 'update', FILTER_SANITIZE_NUMBER_INT);
298 298
 $modelsdb = array();
299 299
 if (file_exists(dirname(__FILE__).'/models/modelsdb')) {
300
-	if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) {
301
-		while (($row = fgetcsv($handle,1000)) !== FALSE) {
302
-			if (isset($row[1]) ){
300
+	if (($handle = fopen(dirname(__FILE__).'/models/modelsdb', 'r')) !== FALSE) {
301
+		while (($row = fgetcsv($handle, 1000)) !== FALSE) {
302
+			if (isset($row[1])) {
303 303
 				$model = $row[0];
304 304
 				$modelsdb[$model] = $row[1];
305 305
 			}
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
 }
310 310
 $modelsdb2 = array();
311 311
 if (file_exists(dirname(__FILE__).'/models/gltf2/modelsdb')) {
312
-	if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb','r')) !== FALSE) {
313
-		while (($row = fgetcsv($handle,1000)) !== FALSE) {
314
-			if (isset($row[1]) ){
312
+	if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb', 'r')) !== FALSE) {
313
+		while (($row = fgetcsv($handle, 1000)) !== FALSE) {
314
+			if (isset($row[1])) {
315 315
 				$model = $row[0];
316 316
 				$glb = $row[1];
317 317
 				if (isset($row[2])) {
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 if (!empty($spotter_array) && is_array($spotter_array))
358 358
 {
359 359
 	$nblatlong = 0;
360
-	foreach($spotter_array as $spotter_item)
360
+	foreach ($spotter_array as $spotter_item)
361 361
 	{
362 362
 		$j++;
363 363
 		//if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND';
@@ -411,17 +411,17 @@  discard block
 block discarded – undo
411 411
 			}
412 412
 			if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",';
413 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']).',';
414
+			if (isset($spotter_item['ident'])) $output .= '"ident": '.json_encode($spotter_item['ident']).',';
415 415
 			if ($tracker) {
416 416
 				if (isset($spotter_item['type'])) $output .= '"tracker_type": '.json_encode($spotter_item['type']).',';
417
-				$output.= '"type": "tracker"';
417
+				$output .= '"type": "tracker"';
418 418
 			} elseif ($marine) {
419 419
 				if (isset($spotter_item['type'])) $output .= '"marine_type": '.json_encode($spotter_item['type']).',';
420 420
 				if (isset($spotter_item['captain_name'])) $output .= '"captain": '.json_encode($spotter_item['captain_name']).',';
421 421
 				if (isset($spotter_item['race_id'])) $output .= '"raceid": '.$spotter_item['race_id'].',';
422 422
 				if (isset($spotter_item['race_name'])) $output .= '"race": '.json_encode($spotter_item['race_name']).',';
423 423
 				if (isset($spotter_item['race_rank'])) $output .= '"rank": "'.$spotter_item['race_rank'].'",';
424
-				$output.= '"type": "marine"';
424
+				$output .= '"type": "marine"';
425 425
 			} else {
426 426
 				if ($one3dmodel === false && isset($globalMap3DLiveries) && $globalMap3DLiveries) {
427 427
 					$aircraft_icao = $spotter_item['aircraft_icao'];
@@ -435,14 +435,14 @@  discard block
 block discarded – undo
435 435
 						if (isset($airline_icao)) {
436 436
 							$imagefile = $aircraft_icao.'-'.$airline_icao.'.png';
437 437
 							if (file_exists(dirname(__FILE__).'/models/gltf2/liveries/'.$imagefile)) {
438
-								$output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",';
438
+								$output .= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",';
439 439
 							}
440 440
 						}
441 441
 					}
442 442
 					//if ($ident != '') $output.= '"ident": "'.$ident.'",';
443 443
 				}
444
-				$output.= '"gltf2": %gltf2%,';
445
-				$output.= '"type": "flight"';
444
+				$output .= '"gltf2": %gltf2%,';
445
+				$output .= '"type": "flight"';
446 446
 			}
447 447
 			$output .= '},';
448 448
 
@@ -817,8 +817,8 @@  discard block
 block discarded – undo
817 817
 					$output .= '},';
818 818
 				}
819 819
 			}
820
-			if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output);
821
-			else $output = str_replace('%onground%','false',$output);
820
+			if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output);
821
+			else $output = str_replace('%onground%', 'false', $output);
822 822
 
823 823
 	//		$output .= '"heightReference": "CLAMP_TO_GROUND",';
824 824
 			//$output .= '"heightReference": "'.$heightrelative.'",';
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
 			if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']);
835 835
 			if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) $minitracktime = strtotime($spotter_item['date']);
836 836
 			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
837
-			$output .= '"'.date("c",strtotime($spotter_item['date'])).'", ';
837
+			$output .= '"'.date("c", strtotime($spotter_item['date'])).'", ';
838 838
 			$output .= $spotter_item['longitude'].', ';
839 839
 			$output .= $spotter_item['latitude'];
840 840
 			$prevlong = $spotter_item['longitude'];
@@ -862,8 +862,8 @@  discard block
 block discarded – undo
862 862
 			//$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0));
863 863
 			//$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w'];
864 864
 		} else {
865
-			$nblatlong = $nblatlong+1;
866
-			$output .= ',"'.date("c",strtotime($spotter_item['date'])).'", ';
865
+			$nblatlong = $nblatlong + 1;
866
+			$output .= ',"'.date("c", strtotime($spotter_item['date'])).'", ';
867 867
 			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
868 868
 			if ($spotter_item['ground_speed'] == 0) {
869 869
 				$output .= $prevlong.', ';
@@ -904,26 +904,26 @@  discard block
 block discarded – undo
904 904
 $output .= ']';
905 905
 if (isset($globalArchive) && $globalArchive === TRUE) {
906 906
 	if (isset($begindateinitial)) {
907
-		$output = str_replace('%minitime%',date("c",$begindateinitial),$output);
908
-	} elseif ((time()-$globalLiveInterval) > $minitime) {
909
-		if (time()-$globalLiveInterval > $maxitime) {
910
-			$output = str_replace('%minitime%',date("c",$maxitime),$output);
907
+		$output = str_replace('%minitime%', date("c", $begindateinitial), $output);
908
+	} elseif ((time() - $globalLiveInterval) > $minitime) {
909
+		if (time() - $globalLiveInterval > $maxitime) {
910
+			$output = str_replace('%minitime%', date("c", $maxitime), $output);
911 911
 		} else {
912
-			$output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output);
912
+			$output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output);
913 913
 		}
914 914
 	}
915
-	else $output = str_replace('%minitime%',date("c",$minitime),$output);
915
+	else $output = str_replace('%minitime%', date("c", $minitime), $output);
916 916
 } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) {
917
-	$output = str_replace('%minitime%',date("c",$minitracktime),$output);
917
+	$output = str_replace('%minitime%', date("c", $minitracktime), $output);
918 918
 } else {
919
-	$output = str_replace('%minitime%',date("c",$minitime),$output);
919
+	$output = str_replace('%minitime%', date("c", $minitime), $output);
920 920
 }
921 921
 if (isset($enddateinitial)) {
922
-	$output = str_replace('%maxitime%',date("c",$enddateinitial),$output);
922
+	$output = str_replace('%maxitime%', date("c", $enddateinitial), $output);
923 923
 } else {
924
-	$output = str_replace('%maxitime%',date("c",$maxitime),$output);
924
+	$output = str_replace('%maxitime%', date("c", $maxitime), $output);
925 925
 }
926
-if ($gltf2) $output = str_replace('%gltf2%','true',$output);
927
-else $output = str_replace('%gltf2%','false',$output);
926
+if ($gltf2) $output = str_replace('%gltf2%', 'true', $output);
927
+else $output = str_replace('%gltf2%', 'false', $output);
928 928
 print $output;
929 929
 ?>
Please login to merge, or discard this 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,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJM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97kxujblWf64HXov7Vl/E4YXWccP9AAd6dAx+ox/WTArNzY1t64B0f8K0DyLXuUvRGZfcpCo1VX4tg6wB76WMB0dALf526foAX8cqUot2pGP8B2Kz+krBeNYjS8636dh/8Beo2deoA9TWp76pd6g0q9cDNwKvAD8A84EfglLRBe2g+JWAfcEF68bPABOCoAl/gIPA5MA64FVgGnNhP292W3r0SeB1YVlJXAjcBP8XwyQUj9AKwAzg2+/fQSsBhoJxBAaALaIzenZGnD911wA7gEDAD2FFSpwOzgDHZ5T7+ZSlGd2d6AXgi5+qAn+O5U0PbBVwKtAD3AHuB8f3YGBUdncCGoQ4LE9XtGRqK9LnduVPRIu2BPqwD65IYbS7Qpql7Ql9YoJcy9bwzkgPrfOCj5G33+h54E/g0PAr5thq4ApgyEgNrc27aWwVaPTA1QJ4BjgTGFvhteV40EgPrgvTP7qlmZqFnl9WD+b2posN83E/NrEkOjlI/U1fkfUYa/pe5IE3qZPW8jFOqiyN7p3pAPX04c7AxYSoDDcAjKT2LgLXA6IR2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 0.5},';
545
+				} else {
546
+					$output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+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S7Qpql7Ql9YoJcy9bwzkgPrfOCj5G33+h54E/g0PAr5thq4ApgyEgNrc27aWwVaPTA1QJ4BjgTGFvhteV40EgPrgvTP7qlmZqFnl9WD+b2posN83E/NrEkOjlI/U1fkfUYa/pe5IE3qZPW8jFOqiyN7p3pAPX04c7AxYSoDDcAjKT2LgLXA6IR2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/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.
js/map-marine.2d.js.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -549,8 +549,8 @@  discard block
 block discarded – undo
549 549
 			}
550 550
                     }
551 551
 		    <?php
552
-            		} else {
553
-            	    ?>
552
+					} else {
553
+					?>
554 554
 		    if (map.getZoom() > 7) {
555 555
                 	var style = {
556 556
                     	    "color": "#529dff",
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
                 	layer_marine_data.addLayer(layer);
570 570
 		    }
571 571
 <?php
572
-            		}
572
+					}
573 573
 ?>
574 574
 				}
575 575
 			    }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 require_once('../require/settings.php');
3 3
 require_once('../require/class.Language.php'); 
4
-setcookie("MapFormat",'2d');
4
+setcookie("MapFormat", '2d');
5 5
 ?>
6 6
 /**
7 7
  * This javascript is part of FlightAirmap.
@@ -38,10 +38,10 @@  discard block
 block discarded – undo
38 38
 
39 39
 <?php
40 40
 	if (isset($_GET['fammarine_id'])) {
41
-		$fammarine_id = filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING);
41
+		$fammarine_id = filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING);
42 42
 	}
43 43
 	if (isset($_GET['ident'])) {
44
-		$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
44
+		$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
45 45
 	}
46 46
 	if (!isset($ident) && !isset($fammarine_id)) {
47 47
 ?>
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 <?php
202 202
 		} else {
203 203
 ?>
204
-		    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
204
+		    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000);
205 205
 		    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
206 206
 <?php
207 207
 		}
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 			    /*
218 218
 			    shadowUrl: iconURLShadowpath,
219 219
 			    shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>],
220
-			    shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>]
220
+			    shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>]
221 221
 			    */
222 222
 			})
223 223
 		    })
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 <?php
259 259
 		} else {
260 260
 ?>
261
-			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
261
+			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000);
262 262
 			    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
263 263
 <?php
264 264
 		}
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 <?php
315 315
 		} else {
316 316
 ?>
317
-			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
317
+			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000);
318 318
 			    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
319 319
 <?php
320 320
 		}
Please login to merge, or discard this patch.
Braces   +36 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,11 +14,18 @@  discard block
 block discarded – undo
14 14
 <?php
15 15
 
16 16
 // Compressed GeoJson is used if true
17
-if (!isset($globalJsonCompress)) $compress = true;
18
-else $compress = $globalJsonCompress;
19
-if (isset($_COOKIE['MarineIconColor'])) $MarineIconColor = $_COOKIE['MarineIconColor'];
20
-elseif (isset($globalMarineIconColor)) $MarineIconColor = $globalMarineIconColor;
21
-else $MarineIconColor = '43d1d8';
17
+if (!isset($globalJsonCompress)) {
18
+	$compress = true;
19
+} else {
20
+	$compress = $globalJsonCompress;
21
+}
22
+if (isset($_COOKIE['MarineIconColor'])) {
23
+	$MarineIconColor = $_COOKIE['MarineIconColor'];
24
+} elseif (isset($globalMarineIconColor)) {
25
+	$MarineIconColor = $globalMarineIconColor;
26
+} else {
27
+	$MarineIconColor = '43d1d8';
28
+}
22 29
 
23 30
 if (isset($globalVM) && $globalVM) {
24 31
 ?>
@@ -201,7 +208,12 @@  discard block
 block discarded – undo
201 208
 <?php
202 209
 		} else {
203 210
 ?>
204
-		    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
211
+		    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
212
+	print $archiveupdatetime*1000;
213
+} else {
214
+	print $globalMapRefresh*1000+20000;
215
+}
216
+?>+feature.properties.sqt*1000);
205 217
 		    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
206 218
 <?php
207 219
 		}
@@ -258,7 +270,12 @@  discard block
 block discarded – undo
258 270
 <?php
259 271
 		} else {
260 272
 ?>
261
-			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
273
+			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
274
+	print $archiveupdatetime*1000;
275
+} else {
276
+	print $globalMapRefresh*1000+20000;
277
+}
278
+?>+feature.properties.sqt*1000);
262 279
 			    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
263 280
 <?php
264 281
 		}
@@ -314,7 +331,12 @@  discard block
 block discarded – undo
314 331
 <?php
315 332
 		} else {
316 333
 ?>
317
-			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
334
+			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
335
+	print $archiveupdatetime*1000;
336
+} else {
337
+	print $globalMapRefresh*1000+20000;
338
+}
339
+?>+feature.properties.sqt*1000);
318 340
 			    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
319 341
 <?php
320 342
 		}
@@ -746,7 +768,12 @@  discard block
 block discarded – undo
746 768
 } else {
747 769
 	//then load it again every 30 seconds
748 770
 	var reloadMarinePage = setInterval(
749
-	function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>);
771
+	function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) {
772
+	print $globalMapRefresh*1000;
773
+} else {
774
+	print '30000';
775
+}
776
+?>);
750 777
 }
751 778
 
752 779
 if (getCookie('openseamap') == 'true') loadOpenSeaMap(getCookie('openseamap'));
Please login to merge, or discard this patch.
race.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 
8 8
 if (isset($_POST['race']))
9 9
 {
10
-	header('Location: '.$globalURL.'/race/'.filter_input(INPUT_POST,'race',FILTER_SANITIZE_STRING));
10
+	header('Location: '.$globalURL.'/race/'.filter_input(INPUT_POST, 'race', FILTER_SANITIZE_STRING));
11 11
 //} else if (isset($_GET['airport'])){
12 12
 } else {
13 13
 	$Marine = new Marine();
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
 	//ksort($race_names);
25 25
 	$previous = null;
26 26
 	print '<div class="alphabet-legend">';
27
-	foreach($race_names as $value) {
27
+	foreach ($race_names as $value) {
28 28
 		$firstLetter = strtoupper($Common->replace_mb_substr($value['race_name'], 0, 1));
29
-		if($previous !== $firstLetter && $firstLetter != "'")
29
+		if ($previous !== $firstLetter && $firstLetter != "'")
30 30
 		{
31
-			if ($previous !== null){
31
+			if ($previous !== null) {
32 32
 				print ' | ';
33 33
 			}
34 34
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
 	}
38 38
 	print '</div>';
39 39
 	$previous = null;
40
-	foreach($race_names as $value) {
40
+	foreach ($race_names as $value) {
41 41
 		$firstLetter = strtoupper($Common->replace_mb_substr($value['race_name'], 0, 1));
42 42
 		if ($firstLetter != "")
43 43
 		{
44
-			if($previous !== $firstLetter && $firstLetter != "'")
44
+			if ($previous !== $firstLetter && $firstLetter != "'")
45 45
 			{
46
-				if ($previous !== null){
46
+				if ($previous !== null) {
47 47
 					print '</div>';
48 48
 				}
49 49
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
Please login to merge, or discard this patch.
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@  discard block
 block discarded – undo
33 33
 			}
34 34
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
35 35
 		}
36
-		if ($firstLetter != "'") $previous = $firstLetter;
36
+		if ($firstLetter != "'") {
37
+			$previous = $firstLetter;
38
+		}
37 39
 	}
38 40
 	print '</div>';
39 41
 	$previous = null;
@@ -48,10 +50,15 @@  discard block
 block discarded – undo
48 50
 				}
49 51
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
50 52
 			}
51
-			if ($firstLetter != "'") $previous = $firstLetter;
53
+			if ($firstLetter != "'") {
54
+				$previous = $firstLetter;
55
+			}
52 56
 			print '<div class="alphabet-item">';
53
-			if (isset($value['race_id']) && $value['race_id'] != '') print '<a href="'.$globalURL.'/marine/race/'.$value['race_id'].'">'.$value['race_name'].' ('.$value['race_id'].')';
54
-			else print '<a href="'.$globalURL.'/race/'.$value['race_name'].'">'.$value['race_name'];
57
+			if (isset($value['race_id']) && $value['race_id'] != '') {
58
+				print '<a href="'.$globalURL.'/marine/race/'.$value['race_id'].'">'.$value['race_name'].' ('.$value['race_id'].')';
59
+			} else {
60
+				print '<a href="'.$globalURL.'/race/'.$value['race_name'].'">'.$value['race_name'];
61
+			}
55 62
 			print '</a>';
56 63
 			print '</div>';
57 64
 		}
Please login to merge, or discard this patch.
captain-detailed.php 2 patches
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,8 +38,12 @@  discard block
 block discarded – undo
38 38
 	$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
39 39
 	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
40 40
 	$filter = array();
41
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
42
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
41
+	if ($year != '') {
42
+		$filter = array_merge($filter,array('year' => $year));
43
+	}
44
+	if ($month != '') {
45
+		$filter = array_merge($filter,array('month' => $month));
46
+	}
43 47
 	if ($sort != '') 
44 48
 	{
45 49
 		$spotter_array = $Marine->getMarineDataByCaptain($captain,$limit_start.",".$absolute_difference, $sort,$filter);
@@ -57,8 +61,12 @@  discard block
 block discarded – undo
57 61
 	{
58 62
 		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['captain_name']);
59 63
 		$ident = $spotter_array[0]['ident'];
60
-		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
61
-		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
64
+		if (isset($spotter_array[0]['latitude'])) {
65
+			$latitude = $spotter_array[0]['latitude'];
66
+		}
67
+		if (isset($spotter_array[0]['longitude'])) {
68
+			$longitude = $spotter_array[0]['longitude'];
69
+		}
62 70
 		require_once('header.php');
63 71
 		/*
64 72
 		if (isset($globalArchive) && $globalArchive) {
@@ -111,7 +119,9 @@  discard block
 block discarded – undo
111 119
 		*/
112 120
 		print '<div class="info column">';
113 121
 		print '<h1>'.$spotter_array[0]['captain_name'].'</h1>';
114
-		if (isset($spotter_array[0]['captain_id']) && $spotter_array[0]['captain_id'] != '') print '<div><span class="label">'._("Captain ID").'</span>'.$spotter_array[0]['captain_id'].'</div>';
122
+		if (isset($spotter_array[0]['captain_id']) && $spotter_array[0]['captain_id'] != '') {
123
+			print '<div><span class="label">'._("Captain ID").'</span>'.$spotter_array[0]['captain_id'].'</div>';
124
+		}
115 125
 		/*
116 126
 		if ($year == '' && $month == '') {
117 127
 			$Stats = new Stats();
@@ -130,7 +140,9 @@  discard block
 block discarded – undo
130 140
 		//$airlines = count($Marine->countAllAirlinesByCaptain($captain,$filter));
131 141
 		//print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>';
132 142
 		$duration = $Marine->getRaceDurationByCaptain($captain,$filter);
133
-		if ($duration != '0') print '<div><span class="label">'._("Total races spotted duration").'</span>'.$duration.'</div>';
143
+		if ($duration != '0') {
144
+			print '<div><span class="label">'._("Total races spotted duration").'</span>'.$duration.'</div>';
145
+		}
134 146
 		print '</div>';
135 147
 	
136 148
 		//include('captain-sub-menu.php');
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  discard block
 block discarded – undo
5 5
 require_once('require/class.Language.php');
6 6
 require_once('require/class.MarineArchive.php');
7 7
 
8
-if (!isset($_GET['captain'])){
8
+if (!isset($_GET['captain'])) {
9 9
 	header('Location: '.$globalURL.'/');
10 10
 } else {
11 11
 	$type = 'marine';
12 12
 	$Marine = new Marine();
13 13
 	$MarineArchive = new MarineArchive();
14 14
 	//calculuation for the pagination
15
-	if(!isset($_GET['limit']))
15
+	if (!isset($_GET['limit']))
16 16
 	{
17 17
 		$limit_start = 0;
18 18
 		$limit_end = 25;
@@ -33,23 +33,23 @@  discard block
 block discarded – undo
33 33
 	
34 34
 	$page_url = $globalURL.'/marine/captain/'.$_GET['captain'];
35 35
 	
36
-	$captain = filter_input(INPUT_GET,'captain',FILTER_SANITIZE_STRING);
37
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
38
-	$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
39
-	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
36
+	$captain = filter_input(INPUT_GET, 'captain', FILTER_SANITIZE_STRING);
37
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
38
+	$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
39
+	$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
40 40
 	$filter = array();
41
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
42
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
41
+	if ($year != '') $filter = array_merge($filter, array('year' => $year));
42
+	if ($month != '') $filter = array_merge($filter, array('month' => $month));
43 43
 	if ($sort != '') 
44 44
 	{
45
-		$spotter_array = $Marine->getMarineDataByCaptain($captain,$limit_start.",".$absolute_difference, $sort,$filter);
45
+		$spotter_array = $Marine->getMarineDataByCaptain($captain, $limit_start.",".$absolute_difference, $sort, $filter);
46 46
 		/*
47 47
 		if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
48 48
 			$spotter_array = $MarineArchive->getMarineDataByCaptain($captain,$limit_start.",".$absolute_difference, $sort,$filter);
49 49
 		}
50 50
 		*/
51 51
 	} else {
52
-		$spotter_array = $Marine->getMarineDataByCaptain($captain,$limit_start.",".$absolute_difference,'',$filter);
52
+		$spotter_array = $Marine->getMarineDataByCaptain($captain, $limit_start.",".$absolute_difference, '', $filter);
53 53
 		/*
54 54
 		if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
55 55
 			$spotter_array = $MarineArchive->getMarineDataByCaptain($captain,$limit_start.",".$absolute_difference,'',$filter);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
 	if (!empty($spotter_array))
61 61
 	{
62
-		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['captain_name']);
62
+		$title = sprintf(_("Detailed View for %s"), $spotter_array[0]['captain_name']);
63 63
 		$ident = $spotter_array[0]['ident'];
64 64
 		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
65 65
 		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
 		} else $flights = 0;
124 124
 		if ($flights == 0)
125 125
 		*/
126
-		$flights = $Marine->countRacesByCaptain($captain,$filter);
126
+		$flights = $Marine->countRacesByCaptain($captain, $filter);
127 127
 		print '<div><span class="label">'._("Races").'</span>'.$flights.'</div>';
128
-		$aircraft_type = count($Marine->countAllBoatTypesByCaptain($captain,$filter));
128
+		$aircraft_type = count($Marine->countAllBoatTypesByCaptain($captain, $filter));
129 129
 		print '<div><span class="label">'._("Boat type").'</span>'.$aircraft_type.'</div>';
130 130
 		//$aircraft_registration = count($Marine->countAllAircraftRegistrationByCaptain($captain,$filter));
131 131
 		//print '<div><span class="label">'._("Aircraft").'</span>'.$aircraft_registration.'</div>';
@@ -133,13 +133,13 @@  discard block
 block discarded – undo
133 133
 		//print '<div><span class="label">'._("Manufacturers").'</span>'.$aircraft_manufacturer.'</div>';
134 134
 		//$airlines = count($Marine->countAllAirlinesByCaptain($captain,$filter));
135 135
 		//print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>';
136
-		$duration = $Marine->getRaceDurationByCaptain($captain,$filter);
136
+		$duration = $Marine->getRaceDurationByCaptain($captain, $filter);
137 137
 		if ($duration != '0') print '<div><span class="label">'._("Total races spotted duration").'</span>'.$duration.'</div>';
138 138
 		print '</div>';
139 139
 	
140 140
 		//include('captain-sub-menu.php');
141 141
 		print '<div class="table column">';
142
-		print '<p>'.sprintf(_("The table below shows the detailed information of all races with the captain <strong>%s</strong>."),$spotter_array[0]['captain_name']).'</p>';
142
+		print '<p>'.sprintf(_("The table below shows the detailed information of all races with the captain <strong>%s</strong>."), $spotter_array[0]['captain_name']).'</p>';
143 143
 
144 144
 		include('table-output.php'); 
145 145
 		print '<div class="pagination">';
Please login to merge, or discard this patch.
captain.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 
8 8
 if (isset($_POST['captain']))
9 9
 {
10
-	header('Location: '.$globalURL.'/captain/'.filter_input(INPUT_POST,'captain',FILTER_SANITIZE_STRING));
10
+	header('Location: '.$globalURL.'/captain/'.filter_input(INPUT_POST, 'captain', FILTER_SANITIZE_STRING));
11 11
 //} else if (isset($_GET['airport'])){
12 12
 } else {
13 13
 	$Marine = new Marine();
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
 	//ksort($captain_names);
25 25
 	$previous = null;
26 26
 	print '<div class="alphabet-legend">';
27
-	foreach($captain_names as $value) {
27
+	foreach ($captain_names as $value) {
28 28
 		$firstLetter = strtoupper($Common->replace_mb_substr($value['captain_name'], 0, 1));
29
-		if($previous !== $firstLetter && $firstLetter != "'")
29
+		if ($previous !== $firstLetter && $firstLetter != "'")
30 30
 		{
31
-			if ($previous !== null){
31
+			if ($previous !== null) {
32 32
 				print ' | ';
33 33
 			}
34 34
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
 	}
38 38
 	print '</div>';
39 39
 	$previous = null;
40
-	foreach($captain_names as $value) {
40
+	foreach ($captain_names as $value) {
41 41
 		$firstLetter = strtoupper($Common->replace_mb_substr($value['captain_name'], 0, 1));
42 42
 		if ($firstLetter != "")
43 43
 		{
44
-			if($previous !== $firstLetter && $firstLetter != "'")
44
+			if ($previous !== $firstLetter && $firstLetter != "'")
45 45
 			{
46
-				if ($previous !== null){
46
+				if ($previous !== null) {
47 47
 					print '</div>';
48 48
 				}
49 49
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
Please login to merge, or discard this patch.
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@  discard block
 block discarded – undo
33 33
 			}
34 34
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
35 35
 		}
36
-		if ($firstLetter != "'") $previous = $firstLetter;
36
+		if ($firstLetter != "'") {
37
+			$previous = $firstLetter;
38
+		}
37 39
 	}
38 40
 	print '</div>';
39 41
 	$previous = null;
@@ -48,10 +50,15 @@  discard block
 block discarded – undo
48 50
 				}
49 51
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
50 52
 			}
51
-			if ($firstLetter != "'") $previous = $firstLetter;
53
+			if ($firstLetter != "'") {
54
+				$previous = $firstLetter;
55
+			}
52 56
 			print '<div class="alphabet-item">';
53
-			if (isset($value['captain_id']) && $value['captain_id'] != '') print '<a href="'.$globalURL.'/marine/captain/'.$value['captain_id'].'">'.$value['captain_name'].' ('.$value['captain_id'].')';
54
-			else print '<a href="'.$globalURL.'/captain/'.$value['captain_name'].'">'.$value['captain_name'];
57
+			if (isset($value['captain_id']) && $value['captain_id'] != '') {
58
+				print '<a href="'.$globalURL.'/marine/captain/'.$value['captain_id'].'">'.$value['captain_name'].' ('.$value['captain_id'].')';
59
+			} else {
60
+				print '<a href="'.$globalURL.'/captain/'.$value['captain_name'].'">'.$value['captain_name'];
61
+			}
55 62
 			print '</a>';
56 63
 			print '</div>';
57 64
 		}
Please login to merge, or discard this patch.
require/class.Elevation.php 3 patches
Doc Comments   +11 added lines patch added patch discarded remove patch
@@ -53,6 +53,11 @@  discard block
 block discarded – undo
53 53
 		$this->openedFiles = [];
54 54
 	}
55 55
 
56
+	/**
57
+	 * @param string $fileName
58
+	 * @param double $row
59
+	 * @param double $column
60
+	 */
56 61
 	private function getElevationAtPosition($fileName, $row, $column) {
57 62
 		if (!array_key_exists($fileName, $this->openedFiles)) {
58 63
 			if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) {
@@ -153,6 +158,9 @@  discard block
 block discarded – undo
153 158
 		else return $zN;
154 159
 	}
155 160
 
161
+	/**
162
+	 * @param integer $numPrefix
163
+	 */
156 164
 	private function getDeg($deg, $numPrefix) {
157 165
 		$deg = abs($deg);
158 166
 		$d   = floor($deg);     // round degrees
@@ -167,6 +175,9 @@  discard block
 block discarded – undo
167 175
 		return $d;
168 176
 	}
169 177
 
178
+	/**
179
+	 * @param double $deg
180
+	 */
170 181
 	private function getSec($deg) {
171 182
 		$deg = abs($deg);
172 183
 		$sec = round($deg * 3600, 4);
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);
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
 		$latSec = $this->getSec($lat);
111 111
 		$lonSec = $this->getSec($lon);
112 112
 
113
-		$Xn = round($latSec / $this->resolution, 3);
114
-		$Yn = round($lonSec / $this->resolution, 3);
113
+		$Xn = round($latSec/$this->resolution, 3);
114
+		$Yn = round($lonSec/$this->resolution, 3);
115 115
 
116 116
 		$a1 = round($Xn);
117 117
 		$a2 = round($Yn);
@@ -143,39 +143,39 @@  discard block
 block discarded – undo
143 143
 		$b3 = $this->getElevationAtPosition($fName, $b1, $b2);
144 144
 		$c3 = $this->getElevationAtPosition($fName, $c1, $c2);
145 145
 
146
-		$n1 = ($c2 - $a2) * ($b3 - $a3) - ($c3 - $a3) * ($b2 - $a2);
147
-		$n2 = ($c3 - $a3) * ($b1 - $a1) - ($c1 - $a1) * ($b3 - $a3);
148
-		$n3 = ($c1 - $a1) * ($b2 - $a2) - ($c2 - $a2) * ($b1 - $a1);
146
+		$n1 = ($c2 - $a2)*($b3 - $a3) - ($c3 - $a3)*($b2 - $a2);
147
+		$n2 = ($c3 - $a3)*($b1 - $a1) - ($c1 - $a1)*($b3 - $a3);
148
+		$n3 = ($c1 - $a1)*($b2 - $a2) - ($c2 - $a2)*($b1 - $a1);
149 149
 
150
-		$d  = -$n1 * $a1 - $n2 * $a2 - $n3 * $a3;
151
-		$zN = (-$n1 * $Xn - $n2 * $Yn - $d) / $n3;
150
+		$d  = -$n1*$a1 - $n2*$a2 - $n3*$a3;
151
+		$zN = (-$n1*$Xn - $n2*$Yn - $d)/$n3;
152 152
 		if ($zN > 10000) return 0;
153 153
 		else return $zN;
154 154
 	}
155 155
 
156 156
 	private function getDeg($deg, $numPrefix) {
157 157
 		$deg = abs($deg);
158
-		$d   = floor($deg);     // round degrees
158
+		$d   = floor($deg); // round degrees
159 159
 		if ($numPrefix >= 3) {
160 160
 			if ($d < 100) {
161
-				$d = '0' . $d;
161
+				$d = '0'.$d;
162 162
 			}
163 163
 		} // pad with leading zeros
164 164
 		if ($d < 10) {
165
-			$d = '0' . $d;
165
+			$d = '0'.$d;
166 166
 		}
167 167
 		return $d;
168 168
 	}
169 169
 
170 170
 	private function getSec($deg) {
171 171
 		$deg = abs($deg);
172
-		$sec = round($deg * 3600, 4);
173
-		$m   = fmod(floor($sec / 60), 60);
172
+		$sec = round($deg*3600, 4);
173
+		$m   = fmod(floor($sec/60), 60);
174 174
 		$s   = round(fmod($sec, 60), 4);
175
-		return ($m * 60) + $s;
175
+		return ($m*60) + $s;
176 176
 	}
177 177
 
178
-	public function download($lat,$lon, $debug = false) {
178
+	public function download($lat, $lon, $debug = false) {
179 179
 		if ($lat < 0) {
180 180
 			$latd = 'S'.$this->getDeg($lat, 2);
181 181
 		} else {
@@ -186,20 +186,20 @@  discard block
 block discarded – undo
186 186
 		} else {
187 187
 			$lond = 'W'.$this->getDeg($lon, 3);
188 188
 		}
189
-		$fileName  = $latd.$lond.".hgt";
190
-		if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) {
189
+		$fileName = $latd.$lond.".hgt";
190
+		if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName)) {
191 191
 			$Common = new Common();
192 192
 			if ($debug) echo 'Downloading '.$fileName.'.gz ...';
193
-			$Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/'.$latd.'/'.$fileName.'.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz');
194
-			if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz')) {
193
+			$Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/'.$latd.'/'.$fileName.'.gz', $this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz');
194
+			if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz')) {
195 195
 				if ($debug) echo "File '{$fileName}.gz' not exists.";
196 196
 				return false;
197 197
 			}
198 198
 			if ($debug) echo 'Done'."\n";
199 199
 			if ($debug) echo 'Decompress '.$fileName.' ....';
200
-			$Common->gunzip($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName);
200
+			$Common->gunzip($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz', $this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName);
201 201
 			if ($debug) echo 'Done'."\n";
202
-			unlink($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz');
202
+			unlink($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz');
203 203
 		}
204 204
 		return true;
205 205
 	}
@@ -212,22 +212,22 @@  discard block
 block discarded – undo
212 212
 		try {
213 213
 			$sth = $db->prepare($query);
214 214
 			$sth->execute($query_values);
215
-		} catch(PDOException $e) {
215
+		} catch (PDOException $e) {
216 216
 			return "error : ".$e->getMessage();
217 217
 		}
218 218
 		while ($data = $sth->fetch(PDO::FETCH_ASSOC)) {
219
-			$this->download($data['latitude'],$data['longitude'],true);
219
+			$this->download($data['latitude'], $data['longitude'], true);
220 220
 		}
221 221
 		$query = 'SELECT latitude, longitude FROM tracker_output WHERE latitude <> 0 AND longitude <> 0 ORDER BY date DESC LIMIT 10';
222 222
 		$query_values = array();
223 223
 		try {
224 224
 			$sth = $db->prepare($query);
225 225
 			$sth->execute($query_values);
226
-		} catch(PDOException $e) {
226
+		} catch (PDOException $e) {
227 227
 			return "error : ".$e->getMessage();
228 228
 		}
229 229
 		while ($data = $sth->fetch(PDO::FETCH_ASSOC)) {
230
-			$this->download($data['latitude'],$data['longitude'],true);
230
+			$this->download($data['latitude'], $data['longitude'], true);
231 231
 		}
232 232
 	}
233 233
 }
Please login to merge, or discard this patch.
Braces   +23 added lines, -8 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) {
@@ -149,8 +151,11 @@  discard block
 block discarded – undo
149 151
 
150 152
 		$d  = -$n1 * $a1 - $n2 * $a2 - $n3 * $a3;
151 153
 		$zN = (-$n1 * $Xn - $n2 * $Yn - $d) / $n3;
152
-		if ($zN > 10000) return 0;
153
-		else return $zN;
154
+		if ($zN > 10000) {
155
+			return 0;
156
+		} else {
157
+			return $zN;
158
+		}
154 159
 	}
155 160
 
156 161
 	private function getDeg($deg, $numPrefix) {
@@ -189,16 +194,26 @@  discard block
 block discarded – undo
189 194
 		$fileName  = $latd.$lond.".hgt";
190 195
 		if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) {
191 196
 			$Common = new Common();
192
-			if ($debug) echo 'Downloading '.$fileName.'.gz ...';
197
+			if ($debug) {
198
+				echo 'Downloading '.$fileName.'.gz ...';
199
+			}
193 200
 			$Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/'.$latd.'/'.$fileName.'.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz');
194 201
 			if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz')) {
195
-				if ($debug) echo "File '{$fileName}.gz' not exists.";
202
+				if ($debug) {
203
+					echo "File '{$fileName}.gz' not exists.";
204
+				}
196 205
 				return false;
197 206
 			}
198
-			if ($debug) echo 'Done'."\n";
199
-			if ($debug) echo 'Decompress '.$fileName.' ....';
207
+			if ($debug) {
208
+				echo 'Done'."\n";
209
+			}
210
+			if ($debug) {
211
+				echo 'Decompress '.$fileName.' ....';
212
+			}
200 213
 			$Common->gunzip($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName);
201
-			if ($debug) echo 'Done'."\n";
214
+			if ($debug) {
215
+				echo 'Done'."\n";
216
+			}
202 217
 			unlink($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz');
203 218
 		}
204 219
 		return true;
Please login to merge, or discard this patch.