@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | die(); |
24 | 24 | } |
25 | 25 | |
26 | -$ACARS=new ACARS(null,true); |
|
26 | +$ACARS = new ACARS(null, true); |
|
27 | 27 | date_default_timezone_set('UTC'); |
28 | 28 | // signal handler - playing nice with sockets and dump1090 |
29 | -pcntl_signal(SIGINT, function($signo) { |
|
29 | +pcntl_signal(SIGINT, function($signo) { |
|
30 | 30 | global $sock; |
31 | 31 | echo "\n\nctrl-c or kill signal received. Tidying up ... "; |
32 | 32 | socket_shutdown($sock, 0); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $sock = socket_create(AF_INET, SOCK_DGRAM, 0) or die("Unable to create socket\n"); |
43 | 43 | |
44 | 44 | // Bind the source address |
45 | -if( !socket_bind($sock, $globalACARSHost , $globalACARSPort) ) |
|
45 | +if (!socket_bind($sock, $globalACARSHost, $globalACARSPort)) |
|
46 | 46 | { |
47 | 47 | $errorcode = socket_last_error(); |
48 | 48 | $errormsg = socket_strerror($errorcode); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | if ($globalDebug) echo "LISTEN UDP MODE \n\n"; |
54 | -while(1) { |
|
54 | +while (1) { |
|
55 | 55 | $r = socket_recvfrom($sock, $buffer, 512, 0, $remote_ip, $remote_port); |
56 | 56 | |
57 | 57 | // lets play nice and handle signals such as ctrl-c/kill properly |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | // (null) 2 23/02/2015 14:46:06 0 -16 X .D-AIPW ! 1L 7 M82A LH077P 010952342854:VP-MIBI+W+0)-V+(),GB1 |
61 | 61 | if ($globalDebug) echo $buffer."\n"; |
62 | 62 | $ACARS->add(trim($buffer)); |
63 | - socket_sendto($sock, "OK " . $buffer , 100 , 0 , $remote_ip , $remote_port); |
|
63 | + socket_sendto($sock, "OK ".$buffer, 100, 0, $remote_ip, $remote_port); |
|
64 | 64 | $ACARS->deleteLiveAcarsData(); |
65 | 65 | } |
66 | -pcntl_exec($_,$argv); |
|
66 | +pcntl_exec($_, $argv); |
|
67 | 67 | ?> |
@@ -12,10 +12,10 @@ |
||
12 | 12 | } |
13 | 13 | // Check if script is not already running... (dirty) |
14 | 14 | if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN' && (!isset($globalDisableUpdateCheck) || $globalDisableUpdateCheck === FALSE)) { |
15 | - if(function_exists('exec')) { |
|
15 | + if (function_exists('exec')) { |
|
16 | 16 | exec("ps ux", $output, $result); |
17 | 17 | $j = 0; |
18 | - foreach ($output as $line) if(strpos($line, dirname(__FILE__)."/update_db.php") && !strpos($line, "sh ") && !strpos($line, "sudo ")) $j++; |
|
18 | + foreach ($output as $line) if (strpos($line, dirname(__FILE__)."/update_db.php") && !strpos($line, "sh ") && !strpos($line, "sudo ")) $j++; |
|
19 | 19 | if ($j > 1) { |
20 | 20 | echo "Script is already runnning..."; |
21 | 21 | die(); |
@@ -1,7 +1,7 @@ discard block |
||
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. |
@@ -108,16 +108,16 @@ discard block |
||
108 | 108 | <?php |
109 | 109 | } |
110 | 110 | if (isset($_GET['ident'])) { |
111 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
111 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
112 | 112 | } |
113 | 113 | if (isset($_GET['flightaware_id'])) { |
114 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
114 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
115 | 115 | } |
116 | 116 | if (isset($_GET['latitude'])) { |
117 | - $latitude = filter_input(INPUT_GET,'latitude',FILTER_SANITIZE_STRING); |
|
117 | + $latitude = filter_input(INPUT_GET, 'latitude', FILTER_SANITIZE_STRING); |
|
118 | 118 | } |
119 | 119 | if (isset($_GET['longitude'])) { |
120 | - $longitude = filter_input(INPUT_GET,'longitude',FILTER_SANITIZE_STRING); |
|
120 | + $longitude = filter_input(INPUT_GET, 'longitude', FILTER_SANITIZE_STRING); |
|
121 | 121 | } |
122 | 122 | ?> |
123 | 123 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | } else { |
146 | 146 | if ((isset($globalCenterLatitude) && $globalCenterLatitude != '' && isset($globalCenterLongitude) && $globalCenterLongitude != '') || isset($_COOKIE['lastcentercoord'])) { |
147 | 147 | if (isset($_COOKIE['lastcentercoord'])) { |
148 | - $lastcentercoord = explode(',',$_COOKIE['lastcentercoord']); |
|
148 | + $lastcentercoord = explode(',', $_COOKIE['lastcentercoord']); |
|
149 | 149 | $viewcenterlatitude = $lastcentercoord[0]; |
150 | 150 | $viewcenterlongitude = $lastcentercoord[1]; |
151 | 151 | $viewzoom = $lastcentercoord[2]; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | || navigator.userAgent.match(/BlackBerry/i) |
167 | 167 | || navigator.userAgent.match(/Windows Phone/i)) |
168 | 168 | { |
169 | - var zoom = <?php if (isset($viewzoom) && $viewzoom == $globalLiveZoom) print $viewzoom-1; elseif (isset($viewzoom)) print $viewzoom; else print '8'; ?>; |
|
169 | + var zoom = <?php if (isset($viewzoom) && $viewzoom == $globalLiveZoom) print $viewzoom - 1; elseif (isset($viewzoom)) print $viewzoom; else print '8'; ?>; |
|
170 | 170 | } else { |
171 | 171 | var zoom = <?php if (isset($viewzoom)) print $viewzoom; else print '9'; ?>; |
172 | 172 | } |
@@ -310,19 +310,19 @@ discard block |
||
310 | 310 | map.addLayer(yandexLayer); |
311 | 311 | <?php |
312 | 312 | } elseif ($MapType == 'Bing-Aerial') { |
313 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
313 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
314 | 314 | ?> |
315 | 315 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
316 | 316 | map.addLayer(bingLayer); |
317 | 317 | <?php |
318 | 318 | } elseif ($MapType == 'Bing-Hybrid') { |
319 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
319 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
320 | 320 | ?> |
321 | 321 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
322 | 322 | map.addLayer(bingLayer); |
323 | 323 | <?php |
324 | 324 | } elseif ($MapType == 'Bing-Road') { |
325 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
325 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
326 | 326 | ?> |
327 | 327 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
328 | 328 | map.addLayer(bingLayer); |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | |
461 | 461 | function update_tsk() { |
462 | 462 | var bbox = map.getBounds().toBBoxString(); |
463 | - var tskLayerQuery = $.getJSON("<?php print $globalURL; ?>/tsk-geojson.php?tsk=<?php echo filter_input(INPUT_GET,'tsk',FILTER_SANITIZE_URL); ?>",function (data) { |
|
463 | + var tskLayerQuery = $.getJSON("<?php print $globalURL; ?>/tsk-geojson.php?tsk=<?php echo filter_input(INPUT_GET, 'tsk', FILTER_SANITIZE_URL); ?>",function (data) { |
|
464 | 464 | tskLayer = L.geoJson(data,{ |
465 | 465 | onEachFeature: function (feature, layer) { |
466 | 466 | tskPopup(feature, layer); |
@@ -1,7 +1,7 @@ discard block |
||
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. |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | |
28 | 28 | <?php |
29 | 29 | if (isset($_GET['famtrackid'])) { |
30 | - $famtrackid = filter_input(INPUT_GET,'famtrackid',FILTER_SANITIZE_STRING); |
|
30 | + $famtrackid = filter_input(INPUT_GET, 'famtrackid', FILTER_SANITIZE_STRING); |
|
31 | 31 | } |
32 | 32 | if (isset($_GET['ident'])) { |
33 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
33 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
34 | 34 | } |
35 | 35 | if (!isset($ident) && !isset($famtrackid)) { |
36 | 36 | ?> |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | <?php |
211 | 211 | } else { |
212 | 212 | ?> |
213 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
213 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
214 | 214 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
215 | 215 | <?php |
216 | 216 | } |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | /* |
227 | 227 | shadowUrl: iconURLShadowpath, |
228 | 228 | shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>], |
229 | - shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>] |
|
229 | + shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>] |
|
230 | 230 | */ |
231 | 231 | }) |
232 | 232 | }) |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | <?php |
268 | 268 | } else { |
269 | 269 | ?> |
270 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
270 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
271 | 271 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
272 | 272 | <?php |
273 | 273 | } |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | <?php |
324 | 324 | } else { |
325 | 325 | ?> |
326 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
326 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
327 | 327 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
328 | 328 | <?php |
329 | 329 | } |
@@ -1,7 +1,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -1,7 +1,7 @@ discard block |
||
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. |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | |
27 | 27 | <?php |
28 | 28 | if (isset($_GET['famsatid'])) { |
29 | - $famsatid = filter_input(INPUT_GET,'famsatid',FILTER_SANITIZE_STRING); |
|
29 | + $famsatid = filter_input(INPUT_GET, 'famsatid', FILTER_SANITIZE_STRING); |
|
30 | 30 | } |
31 | 31 | if (isset($_GET['ident'])) { |
32 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
32 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
33 | 33 | } |
34 | 34 | if (!isset($ident) && !isset($famsatid)) { |
35 | 35 | ?> |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | <?php |
175 | 175 | } else { |
176 | 176 | ?> |
177 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
177 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
178 | 178 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
179 | 179 | <?php |
180 | 180 | } |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | /* |
191 | 191 | shadowUrl: iconURLShadowpath, |
192 | 192 | shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>], |
193 | - shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>] |
|
193 | + shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>] |
|
194 | 194 | */ |
195 | 195 | }) |
196 | 196 | }) |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | <?php |
232 | 232 | } else { |
233 | 233 | ?> |
234 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
234 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
235 | 235 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
236 | 236 | <?php |
237 | 237 | } |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | <?php |
288 | 288 | } else { |
289 | 289 | ?> |
290 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
290 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
291 | 291 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
292 | 292 | <?php |
293 | 293 | } |
@@ -6,14 +6,14 @@ discard block |
||
6 | 6 | $Spotter = new Spotter(); |
7 | 7 | if (isset($_GET['start_date'])) { |
8 | 8 | //for the date manipulation into the query |
9 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
9 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
10 | 10 | $start_date = $_GET['start_date'].":00"; |
11 | 11 | $end_date = $_GET['end_date'].":00"; |
12 | 12 | $sql_date = $start_date.",".$end_date; |
13 | - } else if($_GET['start_date'] != ""){ |
|
13 | + } else if ($_GET['start_date'] != "") { |
|
14 | 14 | $start_date = $_GET['start_date'].":00"; |
15 | 15 | $sql_date = $start_date; |
16 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
16 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
17 | 17 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
18 | 18 | $sql_date = $end_date; |
19 | 19 | } else $sql_date = ''; |
@@ -21,38 +21,38 @@ discard block |
||
21 | 21 | |
22 | 22 | if (isset($_GET['highest_altitude'])) { |
23 | 23 | //for altitude manipulation |
24 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
25 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
26 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
24 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
25 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
26 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
27 | 27 | $sql_altitude = $start_altitude.",".$end_altitude; |
28 | - } else if($_GET['highest_altitude'] != ""){ |
|
29 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
28 | + } else if ($_GET['highest_altitude'] != "") { |
|
29 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
30 | 30 | $sql_altitude = $end_altitude; |
31 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
32 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
31 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
32 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
33 | 33 | $sql_altitude = $start_altitude; |
34 | 34 | } else $sql_altitude = ''; |
35 | 35 | } else $sql_altitude = ''; |
36 | 36 | |
37 | 37 | //calculuation for the pagination |
38 | -if(!isset($_GET['limit'])) |
|
38 | +if (!isset($_GET['limit'])) |
|
39 | 39 | { |
40 | 40 | if (!isset($_GET['number_results'])) { |
41 | 41 | $limit_start = 0; |
42 | 42 | $limit_end = 25; |
43 | 43 | $absolute_difference = 25; |
44 | 44 | } else { |
45 | - if ($_GET['number_results'] > 1000){ |
|
45 | + if ($_GET['number_results'] > 1000) { |
|
46 | 46 | $_GET['number_results'] = 1000; |
47 | 47 | } |
48 | 48 | $limit_start = 0; |
49 | - $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
50 | - $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
49 | + $limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
50 | + $absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
51 | 51 | } |
52 | -} else { |
|
52 | +} else { |
|
53 | 53 | $limit_explode = explode(",", $_GET['limit']); |
54 | - $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
|
55 | - $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
|
54 | + $limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT); |
|
55 | + $limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -69,27 +69,27 @@ discard block |
||
69 | 69 | |
70 | 70 | if (isset($_GET['sort'])) $sort = $_GET['sort']; |
71 | 71 | else $sort = ''; |
72 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
73 | -$id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_STRING); |
|
74 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
75 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
76 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
77 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
78 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
79 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
80 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
81 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
82 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
83 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
84 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
85 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
86 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
87 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
88 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
72 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
73 | +$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING); |
|
74 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
75 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
76 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
77 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
78 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
79 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
80 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
81 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
82 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
83 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
84 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
85 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
86 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
87 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
88 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
89 | 89 | if ($id != '') { |
90 | 90 | $spotter_array = $Spotter->getSpotterDataByID($id); |
91 | 91 | } else { |
92 | - $spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,''); |
|
92 | + $spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, ''); |
|
93 | 93 | } |
94 | 94 | $output = '<?xml version="1.0" encoding="UTF-8"?>'; |
95 | 95 | $output .= '<kml xmlns="http://www.opengis.net/kml/2.2">'; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $output .= '</Style>'; |
118 | 118 | |
119 | 119 | if (!empty($spotter_array)) { |
120 | - foreach($spotter_array as $spotter_item) { |
|
120 | + foreach ($spotter_array as $spotter_item) { |
|
121 | 121 | $altitude = $spotter_item['altitude'].'00'; |
122 | 122 | $SpotterArchive = new SpotterArchive(); |
123 | 123 | $archive_data = $SpotterArchive->getAllArchiveSpotterDataById($spotter_item['flightaware_id']); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $output .= '<LineString>'; |
129 | 129 | $output .= '<coordinates>'; |
130 | 130 | foreach ($archive_data as $coord_data) { |
131 | - $output .= $coord_data['longitude'].','.$coord_data['latitude'].','.$coord_data['real_altitude'].' '; |
|
131 | + $output .= $coord_data['longitude'].','.$coord_data['latitude'].','.$coord_data['real_altitude'].' '; |
|
132 | 132 | } |
133 | 133 | $output .= '</coordinates>'; |
134 | 134 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $output .= ' ]]></description>'; |
192 | 192 | $output .= '<styleUrl>#departureAirport</styleUrl>'; |
193 | 193 | $output .= '<Point>'; |
194 | - $output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>'; |
|
194 | + $output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>'; |
|
195 | 195 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
196 | 196 | $output .= '</Point>'; |
197 | 197 | $output .= '</Placemark>'; |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $output .= ' ]]></description>'; |
233 | 233 | $output .= '<styleUrl>#arrivalAirport</styleUrl>'; |
234 | 234 | $output .= '<Point>'; |
235 | - $output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>'; |
|
235 | + $output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>'; |
|
236 | 236 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
237 | 237 | $output .= '</Point>'; |
238 | 238 | $output .= '</Placemark>'; |
@@ -3,17 +3,17 @@ discard block |
||
3 | 3 | require_once('require/class.Language.php'); |
4 | 4 | require_once('require/class.Spotter.php'); |
5 | 5 | require_once('require/class.SpotterArchive.php'); |
6 | -$Spotter=new Spotter(); |
|
6 | +$Spotter = new Spotter(); |
|
7 | 7 | if (isset($_GET['start_date'])) { |
8 | 8 | //for the date manipulation into the query |
9 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
9 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
10 | 10 | $start_date = $_GET['start_date'].":00"; |
11 | 11 | $end_date = $_GET['end_date'].":00"; |
12 | 12 | $sql_date = $start_date.",".$end_date; |
13 | - } else if($_GET['start_date'] != ""){ |
|
13 | + } else if ($_GET['start_date'] != "") { |
|
14 | 14 | $start_date = $_GET['start_date'].":00"; |
15 | 15 | $sql_date = $start_date; |
16 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
16 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
17 | 17 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
18 | 18 | $sql_date = $end_date; |
19 | 19 | } else $sql_date = ''; |
@@ -21,21 +21,21 @@ discard block |
||
21 | 21 | |
22 | 22 | if (isset($_GET['highest_altitude'])) { |
23 | 23 | //for altitude manipulation |
24 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
25 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
26 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
24 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
25 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
26 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
27 | 27 | $sql_altitude = $start_altitude.",".$end_altitude; |
28 | - } else if($_GET['highest_altitude'] != ""){ |
|
29 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
28 | + } else if ($_GET['highest_altitude'] != "") { |
|
29 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
30 | 30 | $sql_altitude = $end_altitude; |
31 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
32 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
31 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
32 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
33 | 33 | $sql_altitude = $start_altitude; |
34 | 34 | } else $sql_altitude = ''; |
35 | 35 | } else $sql_altitude = ''; |
36 | 36 | |
37 | 37 | //calculuation for the pagination |
38 | -if(!isset($_GET['limit'])) |
|
38 | +if (!isset($_GET['limit'])) |
|
39 | 39 | { |
40 | 40 | if (!isset($_GET['number_results'])) |
41 | 41 | { |
@@ -43,17 +43,17 @@ discard block |
||
43 | 43 | $limit_end = 25; |
44 | 44 | $absolute_difference = 25; |
45 | 45 | } else { |
46 | - if ($_GET['number_results'] > 1000){ |
|
46 | + if ($_GET['number_results'] > 1000) { |
|
47 | 47 | $_GET['number_results'] = 1000; |
48 | 48 | } |
49 | 49 | $limit_start = 0; |
50 | - $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
51 | - $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
50 | + $limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
51 | + $absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
52 | 52 | } |
53 | -} else { |
|
53 | +} else { |
|
54 | 54 | $limit_explode = explode(",", $_GET['limit']); |
55 | - $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
|
56 | - $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
|
55 | + $limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT); |
|
56 | + $limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -70,34 +70,34 @@ discard block |
||
70 | 70 | |
71 | 71 | if (isset($_GET['sort'])) $sort = $_GET['sort']; |
72 | 72 | else $sort = ''; |
73 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
74 | -$id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_NUMBER_INT); |
|
75 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
76 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
77 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
78 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
79 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
80 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
81 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
82 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
83 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
84 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
85 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
86 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
87 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
88 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
89 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
73 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
74 | +$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT); |
|
75 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
76 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
77 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
78 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
79 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
80 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
81 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
82 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
83 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
84 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
85 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
86 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
87 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
88 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
89 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
90 | 90 | if ($id != '') { |
91 | 91 | $spotter_array = $Spotter->getSpotterDataByID($id); |
92 | 92 | } else { |
93 | - $spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,''); |
|
93 | + $spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, ''); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | $output = '{'; |
97 | 97 | $output .= '"type": "FeatureCollection",'; |
98 | 98 | $output .= '"features": ['; |
99 | 99 | if (!empty($spotter_array)) { |
100 | - foreach($spotter_array as $spotter_item) { |
|
100 | + foreach ($spotter_array as $spotter_item) { |
|
101 | 101 | //waypoint plotting |
102 | 102 | $output .= '{'; |
103 | 103 | $output .= '"type": "Feature",'; |
@@ -164,8 +164,8 @@ discard block |
||
164 | 164 | $output .= '"coordinates": ['; |
165 | 165 | foreach ($archive_data as $coord_data) { |
166 | 166 | $output .= '['; |
167 | - $output .= $coord_data['longitude'].', '; |
|
168 | - $output .= $coord_data['latitude']; |
|
167 | + $output .= $coord_data['longitude'].', '; |
|
168 | + $output .= $coord_data['latitude']; |
|
169 | 169 | $output .= '],'; |
170 | 170 | } |
171 | 171 | $output = substr($output, 0, -1); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -$id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_STRING); |
|
2 | +$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING); |
|
3 | 3 | if ($id == "") |
4 | 4 | { |
5 | 5 | header('Location: /'); |
@@ -16,17 +16,17 @@ discard block |
||
16 | 16 | |
17 | 17 | if (!empty($spotter_array)) |
18 | 18 | { |
19 | - if(isset($spotter_array[0]['flightaware_id'])) { |
|
19 | + if (isset($spotter_array[0]['flightaware_id'])) { |
|
20 | 20 | $flightaware_id = $spotter_array[0]['flightaware_id']; |
21 | 21 | } |
22 | - if(isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') { |
|
22 | + if (isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') { |
|
23 | 23 | $latitude = $spotter_array[0]['last_latitude']; |
24 | - } elseif(isset($spotter_array[0]['latitude'])) { |
|
24 | + } elseif (isset($spotter_array[0]['latitude'])) { |
|
25 | 25 | $latitude = $spotter_array[0]['latitude']; |
26 | 26 | } |
27 | - if(isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') { |
|
27 | + if (isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') { |
|
28 | 28 | $longitude = $spotter_array[0]['last_longitude']; |
29 | - } elseif(isset($spotter_array[0]['longitude'])) { |
|
29 | + } elseif (isset($spotter_array[0]['longitude'])) { |
|
30 | 30 | $longitude = $spotter_array[0]['longitude']; |
31 | 31 | } |
32 | 32 | |
@@ -39,16 +39,16 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | $title = ''; |
42 | - if(isset($spotter_array[0]['ident'])) { |
|
42 | + if (isset($spotter_array[0]['ident'])) { |
|
43 | 43 | $title .= $spotter_array[0]['ident']; |
44 | 44 | } |
45 | - if(isset($spotter_array[0]['airline_name'])) { |
|
45 | + if (isset($spotter_array[0]['airline_name'])) { |
|
46 | 46 | $title .= ' - '.$spotter_array[0]['airline_name']; |
47 | 47 | } |
48 | - if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
48 | + if (isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
49 | 49 | $title .= ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')'; |
50 | 50 | } |
51 | - if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') { |
|
51 | + if (isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') { |
|
52 | 52 | $title .= ' - '.$spotter_array[0]['registration']; |
53 | 53 | } |
54 | 54 | //$facebook_meta_image = $spotter_array[0]['image']; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $altitude_data = ''; |
69 | 69 | $hour_data = ''; |
70 | 70 | $speed_data = ''; |
71 | - foreach($all_data as $data) |
|
71 | + foreach ($all_data as $data) |
|
72 | 72 | { |
73 | 73 | $hour_data .= '"'.$data['date'].'",'; |
74 | 74 | if (isset($data['real_altitude']) && $data['real_altitude'] != '') { |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | $speed_data .= $speed.','; |
97 | 97 | } |
98 | 98 | $hour_data = "['x',".substr($hour_data, 0, -1)."]"; |
99 | - $altitude_data = "['altitude',".substr($altitude_data,0,-1)."]"; |
|
100 | - $speed_data = "['speed',".substr($speed_data,0,-1)."]"; |
|
99 | + $altitude_data = "['altitude',".substr($altitude_data, 0, -1)."]"; |
|
100 | + $speed_data = "['speed',".substr($speed_data, 0, -1)."]"; |
|
101 | 101 | print 'c3.generate({ |
102 | 102 | bindto: "#chart", |
103 | 103 | data: { |
@@ -143,16 +143,16 @@ discard block |
||
143 | 143 | print '<a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a> '; |
144 | 144 | } |
145 | 145 | } |
146 | - if(isset($spotter_array[0]['ident'])) { |
|
146 | + if (isset($spotter_array[0]['ident'])) { |
|
147 | 147 | print $spotter_array[0]['ident']; |
148 | 148 | } |
149 | - if(isset($spotter_array[0]['airline_name'])) { |
|
149 | + if (isset($spotter_array[0]['airline_name'])) { |
|
150 | 150 | print ' - '.$spotter_array[0]['airline_name']; |
151 | 151 | } |
152 | - if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
152 | + if (isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
153 | 153 | print ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')'; |
154 | 154 | } |
155 | - if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') { |
|
155 | + if (isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') { |
|
156 | 156 | print ' - '.$spotter_array[0]['registration']; |
157 | 157 | } |
158 | 158 | print '</h1>'; |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | print '</div>'; |
307 | 307 | */ |
308 | 308 | |
309 | - foreach($spotter_array as $spotter_item) |
|
309 | + foreach ($spotter_array as $spotter_item) |
|
310 | 310 | { |
311 | 311 | print '<div class="details">'; |
312 | 312 | print '<h3>'._("Flight Information").'</h3>'; |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') { |
407 | 407 | if ($spotter_item['departure_airport_time'] > 2460) { |
408 | 408 | print '<div class="time">'; |
409 | - print 'at '.date('H:m',$spotter_item['departure_airport_time']); |
|
409 | + print 'at '.date('H:m', $spotter_item['departure_airport_time']); |
|
410 | 410 | print '</div>'; |
411 | 411 | } else { |
412 | 412 | print '<div class="time">'; |
@@ -556,19 +556,19 @@ discard block |
||
556 | 556 | if (count($departure_airport_info) > 0) { |
557 | 557 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
558 | 558 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
559 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm'; |
|
559 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'nm').' nm'; |
|
560 | 560 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
561 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi'; |
|
561 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'mi').' mi'; |
|
562 | 562 | } else { |
563 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km'; |
|
563 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'km').' km'; |
|
564 | 564 | } |
565 | 565 | } else { |
566 | 566 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
567 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm'; |
|
567 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'nm').' nm'; |
|
568 | 568 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
569 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi'; |
|
569 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'mi').' mi'; |
|
570 | 570 | } else { |
571 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km'; |
|
571 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'km').' km'; |
|
572 | 572 | } |
573 | 573 | } |
574 | 574 | } |
@@ -584,19 +584,19 @@ discard block |
||
584 | 584 | if (count($arrival_airport_info) > 0) { |
585 | 585 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
586 | 586 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
587 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm'; |
|
587 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'nm').' nm'; |
|
588 | 588 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
589 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi'; |
|
589 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'mi').' mi'; |
|
590 | 590 | } else { |
591 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km'; |
|
591 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'km').' km'; |
|
592 | 592 | } |
593 | 593 | } else { |
594 | 594 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
595 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm'; |
|
595 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'nm').' nm'; |
|
596 | 596 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
597 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi'; |
|
597 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'mi').' mi'; |
|
598 | 598 | } else { |
599 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km'; |
|
599 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'km').' km'; |
|
600 | 600 | } |
601 | 601 | } |
602 | 602 | } |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | print '<div class="last-flights">'; |
617 | 617 | print '<h3>'._("Last 5 Flights of this Aircraft").' ('.$registration.')</h3>'; |
618 | 618 | $hide_th_links = true; |
619 | - $spotter_array = $Spotter->getSpotterDataByRegistration($registration,"0,5", ""); |
|
619 | + $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,5", ""); |
|
620 | 620 | include('table-output.php'); |
621 | 621 | print '<div class="more">'; |
622 | 622 | print '<a href="'.$globalURL.'/registration/'.$registration.'" class="btn btn-default btn" role="button">See all Flights»</a>'; |