@@ -12,11 +12,11 @@ discard block |
||
12 | 12 | } |
13 | 13 | |
14 | 14 | /** |
15 | - * Gets the images based on the aircraft registration |
|
16 | - * |
|
17 | - * @return Array the images list |
|
18 | - * |
|
19 | - */ |
|
15 | + * Gets the images based on the aircraft registration |
|
16 | + * |
|
17 | + * @return Array the images list |
|
18 | + * |
|
19 | + */ |
|
20 | 20 | public function getSpotterImage($registration,$aircraft_icao = '', $airline_icao = '') |
21 | 21 | { |
22 | 22 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
40 | - * Gets the images based on the ship name |
|
41 | - * |
|
42 | - * @return Array the images list |
|
43 | - * |
|
44 | - */ |
|
40 | + * Gets the images based on the ship name |
|
41 | + * |
|
42 | + * @return Array the images list |
|
43 | + * |
|
44 | + */ |
|
45 | 45 | public function getMarineImage($mmsi,$imo = '',$name = '') |
46 | 46 | { |
47 | 47 | $mmsi = filter_var($mmsi,FILTER_SANITIZE_STRING); |
@@ -68,11 +68,11 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
71 | - * Gets the image copyright based on the Exif data |
|
72 | - * |
|
73 | - * @return String image copyright |
|
74 | - * |
|
75 | - */ |
|
71 | + * Gets the image copyright based on the Exif data |
|
72 | + * |
|
73 | + * @return String image copyright |
|
74 | + * |
|
75 | + */ |
|
76 | 76 | public function getExifCopyright($url) { |
77 | 77 | $exif = exif_read_data($url); |
78 | 78 | $copyright = ''; |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
90 | - * Adds the images based on the aircraft registration |
|
91 | - * |
|
92 | - * @return String either success or error |
|
93 | - * |
|
94 | - */ |
|
90 | + * Adds the images based on the aircraft registration |
|
91 | + * |
|
92 | + * @return String either success or error |
|
93 | + * |
|
94 | + */ |
|
95 | 95 | public function addSpotterImage($registration,$aircraft_icao = '', $airline_icao = '') |
96 | 96 | { |
97 | 97 | global $globalDebug,$globalAircraftImageFetch; |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
122 | - * Adds the images based on the marine name |
|
123 | - * |
|
124 | - * @return String either success or error |
|
125 | - * |
|
126 | - */ |
|
122 | + * Adds the images based on the marine name |
|
123 | + * |
|
124 | + * @return String either success or error |
|
125 | + * |
|
126 | + */ |
|
127 | 127 | public function addMarineImage($mmsi,$imo = '',$name = '') |
128 | 128 | { |
129 | 129 | global $globalDebug,$globalMarineImageFetch; |
@@ -160,12 +160,12 @@ discard block |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
163 | - * Gets the aircraft image |
|
164 | - * |
|
165 | - * @param String $aircraft_registration the registration of the aircraft |
|
166 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
167 | - * |
|
168 | - */ |
|
163 | + * Gets the aircraft image |
|
164 | + * |
|
165 | + * @param String $aircraft_registration the registration of the aircraft |
|
166 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
167 | + * |
|
168 | + */ |
|
169 | 169 | public function findAircraftImage($aircraft_registration, $aircraft_icao = '', $airline_icao = '') |
170 | 170 | { |
171 | 171 | global $globalAircraftImageSources, $globalIVAO, $globalAircraftImageCheckICAO, $globalVA; |
@@ -209,14 +209,14 @@ discard block |
||
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
212 | - * Gets the vessel image |
|
213 | - * |
|
214 | - * @param String $mmsi the vessel mmsi |
|
215 | - * @param String $imo the vessel imo |
|
216 | - * @param String $name the vessel name |
|
217 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
218 | - * |
|
219 | - */ |
|
212 | + * Gets the vessel image |
|
213 | + * |
|
214 | + * @param String $mmsi the vessel mmsi |
|
215 | + * @param String $imo the vessel imo |
|
216 | + * @param String $name the vessel name |
|
217 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
218 | + * |
|
219 | + */ |
|
220 | 220 | public function findMarineImage($mmsi,$imo = '',$name = '') |
221 | 221 | { |
222 | 222 | global $globalMarineImageSources; |
@@ -250,13 +250,13 @@ discard block |
||
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
253 | - * Gets the aircraft image from Planespotters |
|
254 | - * |
|
255 | - * @param String $aircraft_registration the registration of the aircraft |
|
256 | - * @param String $aircraft_name type of the aircraft |
|
257 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
258 | - * |
|
259 | - */ |
|
253 | + * Gets the aircraft image from Planespotters |
|
254 | + * |
|
255 | + * @param String $aircraft_registration the registration of the aircraft |
|
256 | + * @param String $aircraft_name type of the aircraft |
|
257 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
258 | + * |
|
259 | + */ |
|
260 | 260 | public function fromPlanespotters($type,$aircraft_registration, $aircraft_name='') { |
261 | 261 | $Common = new Common(); |
262 | 262 | // If aircraft registration is only number, also check with aircraft model |
@@ -283,13 +283,13 @@ discard block |
||
283 | 283 | } |
284 | 284 | |
285 | 285 | /** |
286 | - * Gets the aircraft image from Deviantart |
|
287 | - * |
|
288 | - * @param String $registration the registration of the aircraft |
|
289 | - * @param String $name type of the aircraft |
|
290 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
291 | - * |
|
292 | - */ |
|
286 | + * Gets the aircraft image from Deviantart |
|
287 | + * |
|
288 | + * @param String $registration the registration of the aircraft |
|
289 | + * @param String $name type of the aircraft |
|
290 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
291 | + * |
|
292 | + */ |
|
293 | 293 | public function fromDeviantart($type,$registration, $name='') { |
294 | 294 | $Common = new Common(); |
295 | 295 | if ($type == 'aircraft') { |
@@ -321,13 +321,13 @@ discard block |
||
321 | 321 | } |
322 | 322 | |
323 | 323 | /** |
324 | - * Gets the aircraft image from JetPhotos |
|
325 | - * |
|
326 | - * @param String $aircraft_registration the registration of the aircraft |
|
327 | - * @param String $aircraft_name type of the aircraft |
|
328 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
329 | - * |
|
330 | - */ |
|
324 | + * Gets the aircraft image from JetPhotos |
|
325 | + * |
|
326 | + * @param String $aircraft_registration the registration of the aircraft |
|
327 | + * @param String $aircraft_name type of the aircraft |
|
328 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
329 | + * |
|
330 | + */ |
|
331 | 331 | public function fromJetPhotos($type,$aircraft_registration, $aircraft_name='') { |
332 | 332 | $Common = new Common(); |
333 | 333 | $url= 'http://jetphotos.net/showphotos.php?displaymode=2®search='.$aircraft_registration; |
@@ -363,13 +363,13 @@ discard block |
||
363 | 363 | } |
364 | 364 | |
365 | 365 | /** |
366 | - * Gets the aircraft image from PlanePictures |
|
367 | - * |
|
368 | - * @param String $aircraft_registration the registration of the aircraft |
|
369 | - * @param String $aircraft_name type of the aircraft |
|
370 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
371 | - * |
|
372 | - */ |
|
366 | + * Gets the aircraft image from PlanePictures |
|
367 | + * |
|
368 | + * @param String $aircraft_registration the registration of the aircraft |
|
369 | + * @param String $aircraft_name type of the aircraft |
|
370 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
371 | + * |
|
372 | + */ |
|
373 | 373 | public function fromPlanePictures($type,$aircraft_registration, $aircraft_name='') { |
374 | 374 | $Common = new Common(); |
375 | 375 | $url= 'http://www.planepictures.net/netsearch4.cgi?srch='.$aircraft_registration.'&stype=reg&srng=2'; |
@@ -397,13 +397,13 @@ discard block |
||
397 | 397 | } |
398 | 398 | |
399 | 399 | /** |
400 | - * Gets the aircraft image from Flickr |
|
401 | - * |
|
402 | - * @param String $registration the registration of the aircraft |
|
403 | - * @param String $name type of the aircraft |
|
404 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
405 | - * |
|
406 | - */ |
|
400 | + * Gets the aircraft image from Flickr |
|
401 | + * |
|
402 | + * @param String $registration the registration of the aircraft |
|
403 | + * @param String $name type of the aircraft |
|
404 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
405 | + * |
|
406 | + */ |
|
407 | 407 | public function fromFlickr($type,$registration,$name='') { |
408 | 408 | $Common = new Common(); |
409 | 409 | if ($type == 'aircraft') { |
@@ -446,13 +446,13 @@ discard block |
||
446 | 446 | } |
447 | 447 | |
448 | 448 | /** |
449 | - * Gets the aircraft image from Bing |
|
450 | - * |
|
451 | - * @param String $aircraft_registration the registration of the aircraft |
|
452 | - * @param String $aircraft_name type of the aircraft |
|
453 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
454 | - * |
|
455 | - */ |
|
449 | + * Gets the aircraft image from Bing |
|
450 | + * |
|
451 | + * @param String $aircraft_registration the registration of the aircraft |
|
452 | + * @param String $aircraft_name type of the aircraft |
|
453 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
454 | + * |
|
455 | + */ |
|
456 | 456 | public function fromBing($type,$aircraft_registration,$aircraft_name='') { |
457 | 457 | global $globalImageBingKey; |
458 | 458 | $Common = new Common(); |
@@ -478,13 +478,13 @@ discard block |
||
478 | 478 | } |
479 | 479 | |
480 | 480 | /** |
481 | - * Gets the aircraft image from airport-data |
|
482 | - * |
|
483 | - * @param String $aircraft_registration the registration of the aircraft |
|
484 | - * @param String $aircraft_name type of the aircraft |
|
485 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
486 | - * |
|
487 | - */ |
|
481 | + * Gets the aircraft image from airport-data |
|
482 | + * |
|
483 | + * @param String $aircraft_registration the registration of the aircraft |
|
484 | + * @param String $aircraft_name type of the aircraft |
|
485 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
486 | + * |
|
487 | + */ |
|
488 | 488 | public function fromAirportData($type,$aircraft_registration,$aircraft_name='') { |
489 | 489 | $Common = new Common(); |
490 | 490 | $url = 'http://www.airport-data.com/api/ac_thumb.json?&n=1&r='.$aircraft_registration; |
@@ -503,13 +503,13 @@ discard block |
||
503 | 503 | } |
504 | 504 | |
505 | 505 | /** |
506 | - * Gets image from WikiMedia |
|
507 | - * |
|
508 | - * @param String $registration the registration of the aircraft/mmsi |
|
509 | - * @param String $name name |
|
510 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
511 | - * |
|
512 | - */ |
|
506 | + * Gets image from WikiMedia |
|
507 | + * |
|
508 | + * @param String $registration the registration of the aircraft/mmsi |
|
509 | + * @param String $name name |
|
510 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
511 | + * |
|
512 | + */ |
|
513 | 513 | public function fromWikimedia($type,$registration,$name='') { |
514 | 514 | $Common = new Common(); |
515 | 515 | if ($type == 'aircraft') { |
@@ -564,13 +564,13 @@ discard block |
||
564 | 564 | } |
565 | 565 | |
566 | 566 | /** |
567 | - * Gets the aircraft image from custom url |
|
568 | - * |
|
569 | - * @param String $registration the registration of the aircraft |
|
570 | - * @param String $name type of the aircraft |
|
571 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
572 | - * |
|
573 | - */ |
|
567 | + * Gets the aircraft image from custom url |
|
568 | + * |
|
569 | + * @param String $registration the registration of the aircraft |
|
570 | + * @param String $name type of the aircraft |
|
571 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
572 | + * |
|
573 | + */ |
|
574 | 574 | public function fromCustomSource($type,$registration,$name='') { |
575 | 575 | global $globalAircraftImageCustomSources, $globalMarineImageCustomSources, $globalDebug; |
576 | 576 | //$globalAircraftImageCustomSource[] = array('thumbnail' => '','original' => '', 'copyright' => '', 'source_website' => '', 'source' => '','exif' => true); |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | class SBS { |
3 | - static $latlon = array(); |
|
3 | + static $latlon = array(); |
|
4 | 4 | |
5 | - public function parse($buffer) { |
|
5 | + public function parse($buffer) { |
|
6 | 6 | // Not yet finished, no CRC checks |
7 | 7 | //echo $buffer."\n"; |
8 | 8 | $data = array(); |
@@ -13,47 +13,47 @@ discard block |
||
13 | 13 | $bin = gmp_strval( gmp_init($hex,16), 2); |
14 | 14 | //if (strlen($hex) == 28 && $this->parityCheck($hex,$bin)) { |
15 | 15 | if (strlen($hex) == 28) { |
16 | - $df = intval(substr($bin,0,5),2); |
|
17 | - //$ca = intval(substr($bin,5,3),2); |
|
18 | - // Only support DF17 for now |
|
19 | - //if ($df == 17 || ($df == 18 && ($ca == 0 || $ca == 1 || $ca == 6))) { |
|
20 | - if (($df == 17 || $df == 18) && ($this->parityCheck($hex,$bin) || $typehex == '@')) { |
|
16 | + $df = intval(substr($bin,0,5),2); |
|
17 | + //$ca = intval(substr($bin,5,3),2); |
|
18 | + // Only support DF17 for now |
|
19 | + //if ($df == 17 || ($df == 18 && ($ca == 0 || $ca == 1 || $ca == 6))) { |
|
20 | + if (($df == 17 || $df == 18) && ($this->parityCheck($hex,$bin) || $typehex == '@')) { |
|
21 | 21 | $icao = substr($hex,2,6); |
22 | 22 | $data['hex'] = $icao; |
23 | 23 | $tc = intval(substr($bin,32,5),2); |
24 | 24 | if ($tc >= 1 && $tc <= 4) { |
25 | - //callsign |
|
26 | - $csbin = substr($bin,40,56); |
|
27 | - $charset = str_split('#ABCDEFGHIJKLMNOPQRSTUVWXYZ#####_###############0123456789######'); |
|
28 | - $cs = ''; |
|
29 | - $cs .= $charset[intval(substr($csbin,0,6),2)]; |
|
30 | - $cs .= $charset[intval(substr($csbin,6,6),2)]; |
|
31 | - $cs .= $charset[intval(substr($csbin,12,6),2)]; |
|
32 | - $cs .= $charset[intval(substr($csbin,18,6),2)]; |
|
33 | - $cs .= $charset[intval(substr($csbin,24,6),2)]; |
|
34 | - $cs .= $charset[intval(substr($csbin,30,6),2)]; |
|
35 | - $cs .= $charset[intval(substr($csbin,36,6),2)]; |
|
36 | - $cs .= $charset[intval(substr($csbin,42,6),2)]; |
|
37 | - $cs = str_replace('_','',$cs); |
|
38 | - $cs = str_replace('#','',$cs); |
|
39 | - $callsign = $cs; |
|
40 | - $data['ident'] = $callsign; |
|
25 | + //callsign |
|
26 | + $csbin = substr($bin,40,56); |
|
27 | + $charset = str_split('#ABCDEFGHIJKLMNOPQRSTUVWXYZ#####_###############0123456789######'); |
|
28 | + $cs = ''; |
|
29 | + $cs .= $charset[intval(substr($csbin,0,6),2)]; |
|
30 | + $cs .= $charset[intval(substr($csbin,6,6),2)]; |
|
31 | + $cs .= $charset[intval(substr($csbin,12,6),2)]; |
|
32 | + $cs .= $charset[intval(substr($csbin,18,6),2)]; |
|
33 | + $cs .= $charset[intval(substr($csbin,24,6),2)]; |
|
34 | + $cs .= $charset[intval(substr($csbin,30,6),2)]; |
|
35 | + $cs .= $charset[intval(substr($csbin,36,6),2)]; |
|
36 | + $cs .= $charset[intval(substr($csbin,42,6),2)]; |
|
37 | + $cs = str_replace('_','',$cs); |
|
38 | + $cs = str_replace('#','',$cs); |
|
39 | + $callsign = $cs; |
|
40 | + $data['ident'] = $callsign; |
|
41 | 41 | } elseif ($tc >= 9 && $tc <= 18) { |
42 | - // Check Q-bit |
|
43 | - $q = substr($bin,47,1); |
|
44 | - if ($q) { |
|
42 | + // Check Q-bit |
|
43 | + $q = substr($bin,47,1); |
|
44 | + if ($q) { |
|
45 | 45 | $n = intval(substr($bin,40,7).substr($bin,48,4),2); |
46 | 46 | $alt = $n*25-1000; |
47 | 47 | $data['altitude'] = $alt; |
48 | - } |
|
49 | - // Check odd/even flag |
|
50 | - $oe = substr($bin,53,1); |
|
51 | - //if ($oe) => odd else even |
|
52 | - // 131072 is 2^17 since CPR latitude and longitude are encoded in 17 bits. |
|
53 | - $cprlat = intval(substr($bin,54,17),2)/131072.0; |
|
54 | - $cprlon = intval(substr($bin,71,17),2)/131072.0; |
|
55 | - if ($oe == 0) $this::$latlon[$icao] = array('latitude' => $cprlat,'longitude' => $cprlon,'created' => time()); |
|
56 | - elseif (isset($this::$latlon[$icao]) && (time() - $this::$latlon[$icao]['created']) < 10) { |
|
48 | + } |
|
49 | + // Check odd/even flag |
|
50 | + $oe = substr($bin,53,1); |
|
51 | + //if ($oe) => odd else even |
|
52 | + // 131072 is 2^17 since CPR latitude and longitude are encoded in 17 bits. |
|
53 | + $cprlat = intval(substr($bin,54,17),2)/131072.0; |
|
54 | + $cprlon = intval(substr($bin,71,17),2)/131072.0; |
|
55 | + if ($oe == 0) $this::$latlon[$icao] = array('latitude' => $cprlat,'longitude' => $cprlon,'created' => time()); |
|
56 | + elseif (isset($this::$latlon[$icao]) && (time() - $this::$latlon[$icao]['created']) < 10) { |
|
57 | 57 | $cprlat_odd = $cprlat; |
58 | 58 | $cprlon_odd = $cprlon; |
59 | 59 | $cprlat_even = $this::$latlon[$icao]['latitude']; |
@@ -66,53 +66,53 @@ discard block |
||
66 | 66 | if ($lat_odd >= 270) $lat_odd = $lat_odd - 360; |
67 | 67 | // check latitude zone |
68 | 68 | if ($this->cprNL($lat_even) == $this->cprNL($lat_odd)) { |
69 | - if ($this::$latlon[$icao]['created'] > time()) { |
|
69 | + if ($this::$latlon[$icao]['created'] > time()) { |
|
70 | 70 | $ni = $this->cprN($lat_even,0); |
71 | 71 | $m = floor($cprlon_even*($this->cprNL($lat_even)-1) - $cprlon_odd * $this->cprNL($lat_even)+0.5); |
72 | 72 | $lon = (360.0/$ni)*($m%$ni+$cprlon_even); |
73 | 73 | $lat = $lat_even; |
74 | 74 | if ($lon > 180) $lon = $lon -360; |
75 | 75 | if ($lat > -91 && $lat < 91 && $lon > -181 && $lon < 181) { |
76 | - //if ($globalDebug) echo 'cs : '.$cs.' - hex : '.$hex.' - lat : '.$lat.' - lon : '.$lon; |
|
77 | - $data['latitude'] = $lat; |
|
78 | - $data['longitude'] = $lon; |
|
76 | + //if ($globalDebug) echo 'cs : '.$cs.' - hex : '.$hex.' - lat : '.$lat.' - lon : '.$lon; |
|
77 | + $data['latitude'] = $lat; |
|
78 | + $data['longitude'] = $lon; |
|
79 | 79 | } |
80 | - } else { |
|
80 | + } else { |
|
81 | 81 | $ni = $this->cprN($lat_odd,1); |
82 | 82 | $m = floor($cprlon_even*($this->cprNL($lat_odd)-1) - $cprlon_odd * $this->cprNL($lat_odd)+0.5); |
83 | 83 | $lon = (360.0/$ni)*($m%$ni+$cprlon_odd); |
84 | 84 | $lat = $lat_odd; |
85 | 85 | if ($lon > 180) $lon = $lon -360; |
86 | 86 | if ($lat > -91 && $lat < 91 && $lon > -181 && $lon < 181) { |
87 | - //if ($globalDebug) echo 'icao : '.$icao.' - hex : '.$hex.' - lat : '.$lat.' - lon : '.$lon.' second'."\n"; |
|
88 | - $data['latitude'] = $lat; |
|
89 | - $data['longitude'] = $lon; |
|
87 | + //if ($globalDebug) echo 'icao : '.$icao.' - hex : '.$hex.' - lat : '.$lat.' - lon : '.$lon.' second'."\n"; |
|
88 | + $data['latitude'] = $lat; |
|
89 | + $data['longitude'] = $lon; |
|
90 | + } |
|
90 | 91 | } |
91 | - } |
|
92 | 92 | } else echo "Not cprNL"; |
93 | 93 | unset($this::$latlon[$icao]); |
94 | - } |
|
94 | + } |
|
95 | 95 | } elseif ($tc == 19) { |
96 | - // speed & heading |
|
97 | - $v_ew_dir = intval(substr($bin,45,1)); |
|
98 | - $v_ew = intval(substr($bin,46,10),2); |
|
99 | - $v_ns_dir = intval(substr($bin,56,1)); |
|
100 | - $v_ns = intval(substr($bin,57,10),2); |
|
101 | - if ($v_ew_dir) $v_ew = -1*$v_ew; |
|
102 | - if ($v_ns_dir) $v_ns = -1*$v_ns; |
|
103 | - $speed = sqrt($v_ns*$v_ns+$v_ew*$v_ew); |
|
104 | - $heading = atan2($v_ew,$v_ns)*360.0/(2*pi()); |
|
105 | - if ($heading <0) $heading = $heading+360; |
|
106 | - $data['speed'] = $speed; |
|
107 | - $data['heading'] = $heading; |
|
96 | + // speed & heading |
|
97 | + $v_ew_dir = intval(substr($bin,45,1)); |
|
98 | + $v_ew = intval(substr($bin,46,10),2); |
|
99 | + $v_ns_dir = intval(substr($bin,56,1)); |
|
100 | + $v_ns = intval(substr($bin,57,10),2); |
|
101 | + if ($v_ew_dir) $v_ew = -1*$v_ew; |
|
102 | + if ($v_ns_dir) $v_ns = -1*$v_ns; |
|
103 | + $speed = sqrt($v_ns*$v_ns+$v_ew*$v_ew); |
|
104 | + $heading = atan2($v_ew,$v_ns)*360.0/(2*pi()); |
|
105 | + if ($heading <0) $heading = $heading+360; |
|
106 | + $data['speed'] = $speed; |
|
107 | + $data['heading'] = $heading; |
|
108 | + } |
|
108 | 109 | } |
109 | - } |
|
110 | - if (isset($data)) { |
|
110 | + if (isset($data)) { |
|
111 | 111 | //print_r($data); |
112 | 112 | return $data; |
113 | - } |
|
114 | - } |
|
115 | - } |
|
113 | + } |
|
114 | + } |
|
115 | + } |
|
116 | 116 | |
117 | 117 | |
118 | 118 | public function cprNL($lat) { |
@@ -177,16 +177,16 @@ discard block |
||
177 | 177 | if ($lat < 86.53536998) return 3; |
178 | 178 | if ($lat < 87.00000000) return 2; |
179 | 179 | return 1; |
180 | - } |
|
180 | + } |
|
181 | 181 | |
182 | - public function cprN($lat,$isodd) { |
|
182 | + public function cprN($lat,$isodd) { |
|
183 | 183 | $nl = $this->cprNL($lat) - $isodd; |
184 | 184 | if ($nl > 1) return $nl; |
185 | 185 | else return 1; |
186 | - } |
|
186 | + } |
|
187 | 187 | |
188 | 188 | |
189 | - function parityCheck($msg, $bin) { |
|
189 | + function parityCheck($msg, $bin) { |
|
190 | 190 | $modes_checksum_table = array( |
191 | 191 | 0x3935ea, 0x1c9af5, 0xf1b77e, 0x78dbbf, 0xc397db, 0x9e31e9, 0xb0e2f0, 0x587178, |
192 | 192 | 0x2c38bc, 0x161c5e, 0x0b0e2f, 0xfa7d13, 0x82c48d, 0xbe9842, 0x5f4c21, 0xd05c14, |
@@ -208,75 +208,75 @@ discard block |
||
208 | 208 | $checksum = intval(substr($msg,22,6),16); |
209 | 209 | |
210 | 210 | for ($j = 0; $j < strlen($bin); $j++) { |
211 | - if ($bin[$j]) $crc = $crc^intval($modes_checksum_table[$j],0); |
|
211 | + if ($bin[$j]) $crc = $crc^intval($modes_checksum_table[$j],0); |
|
212 | 212 | } |
213 | 213 | if ($crc == $checksum) return true; |
214 | 214 | else { |
215 | - //echo "**** CRC ERROR ****\n"; |
|
216 | - return false; |
|
215 | + //echo "**** CRC ERROR ****\n"; |
|
216 | + return false; |
|
217 | + } |
|
217 | 218 | } |
218 | - } |
|
219 | 219 | |
220 | - public function famaprs_to_basestation($data) { |
|
220 | + public function famaprs_to_basestation($data) { |
|
221 | 221 | $result = array(); |
222 | - if (isset($data['ident']) && $data['ident'] != '') { |
|
223 | - $msg = array(); |
|
224 | - $msg['msg_type'] = 'MSG'; |
|
225 | - $msg['transmission_type'] = 1; |
|
226 | - $msg['session_id'] = 5; |
|
227 | - $msg['aircraftid'] = hexdec($data['address']); |
|
228 | - $msg['hex'] = $data['address']; |
|
229 | - $msg['flightid'] = hexdec($data['address']); |
|
230 | - $msg['date_gen'] = date('Y/m/d',$data['timestamp']); |
|
231 | - $msg['time_gen'] = date('H:i:s',$data['timestamp']).'.180'; |
|
232 | - $msg['date_log'] = date('Y/m/d',$data['timestamp']); |
|
233 | - $msg['time_log'] = date('H:i:s',$data['timestamp']).'.180'; |
|
234 | - $msg['callsign'] = $data['ident']; |
|
235 | - $msg['altitude'] = ''; |
|
236 | - $msg['speed'] = ''; |
|
237 | - $msg['track'] = ''; |
|
238 | - $msg['latitude'] = ''; |
|
239 | - $msg['longitude'] = ''; |
|
240 | - $msg['verticalrate'] = ''; |
|
241 | - $msg['squawk'] = ''; |
|
242 | - $msg['alert'] = ''; |
|
243 | - $msg['emergency'] = ''; |
|
244 | - $msg['SPI'] = ''; |
|
245 | - $msg['ground'] = ''; |
|
246 | - $result[] = implode(',',$msg); |
|
247 | - } |
|
248 | - if (isset($data['latitude']) && $data['latitude'] != 0) { |
|
249 | - $msg = array(); |
|
250 | - $msg['msg_type'] = 'MSG'; |
|
251 | - $msg['transmission_type'] = 2; |
|
252 | - $msg['session_id'] = 5; |
|
253 | - $msg['aircraftid'] = hexdec($data['address']); |
|
254 | - $msg['hex'] = $data['address']; |
|
255 | - $msg['flightid'] = hexdec($data['address']); |
|
256 | - $msg['date_gen'] = date('Y/m/d',$data['timestamp']); |
|
257 | - $msg['time_gen'] = date('H:i:s',$data['timestamp']).'.180'; |
|
258 | - $msg['date_log'] = date('Y/m/d',$data['timestamp']); |
|
259 | - $msg['time_log'] = date('H:i:s',$data['timestamp']).'.180'; |
|
260 | - $msg['callsign'] = ''; |
|
261 | - if (isset($data['altitude'])) $msg['altitude'] = $data['altitude']; |
|
262 | - else $msg['altitude'] = ''; |
|
263 | - $msg['speed'] = $data['speed']; |
|
264 | - if (isset($data['heading'])) $msg['track'] = $data['heading']; |
|
265 | - else $msg['track'] = ''; |
|
266 | - $msg['latitude'] = $data['latitude']; |
|
267 | - $msg['longitude'] = $data['longitude']; |
|
268 | - if (isset($data['verticalrate'])) $msg['verticalrate'] = $data['verticalrate']; |
|
269 | - else $msg['verticalrate'] = ''; |
|
270 | - if (isset($data['squawk'])) $msg['squawk'] = $data['squawk']; |
|
271 | - else $msg['squawk'] = 0; |
|
272 | - $msg['alert'] = 0; |
|
273 | - $msg['emergency'] = 0; |
|
274 | - $msg['SPI'] = 0; |
|
275 | - if (isset($data['ground'])) $msg['ground'] = 1; |
|
276 | - else $msg['ground'] = 0; |
|
277 | - $result[] = implode(',',$msg); |
|
278 | - } |
|
279 | - return $result; |
|
280 | - } |
|
222 | + if (isset($data['ident']) && $data['ident'] != '') { |
|
223 | + $msg = array(); |
|
224 | + $msg['msg_type'] = 'MSG'; |
|
225 | + $msg['transmission_type'] = 1; |
|
226 | + $msg['session_id'] = 5; |
|
227 | + $msg['aircraftid'] = hexdec($data['address']); |
|
228 | + $msg['hex'] = $data['address']; |
|
229 | + $msg['flightid'] = hexdec($data['address']); |
|
230 | + $msg['date_gen'] = date('Y/m/d',$data['timestamp']); |
|
231 | + $msg['time_gen'] = date('H:i:s',$data['timestamp']).'.180'; |
|
232 | + $msg['date_log'] = date('Y/m/d',$data['timestamp']); |
|
233 | + $msg['time_log'] = date('H:i:s',$data['timestamp']).'.180'; |
|
234 | + $msg['callsign'] = $data['ident']; |
|
235 | + $msg['altitude'] = ''; |
|
236 | + $msg['speed'] = ''; |
|
237 | + $msg['track'] = ''; |
|
238 | + $msg['latitude'] = ''; |
|
239 | + $msg['longitude'] = ''; |
|
240 | + $msg['verticalrate'] = ''; |
|
241 | + $msg['squawk'] = ''; |
|
242 | + $msg['alert'] = ''; |
|
243 | + $msg['emergency'] = ''; |
|
244 | + $msg['SPI'] = ''; |
|
245 | + $msg['ground'] = ''; |
|
246 | + $result[] = implode(',',$msg); |
|
247 | + } |
|
248 | + if (isset($data['latitude']) && $data['latitude'] != 0) { |
|
249 | + $msg = array(); |
|
250 | + $msg['msg_type'] = 'MSG'; |
|
251 | + $msg['transmission_type'] = 2; |
|
252 | + $msg['session_id'] = 5; |
|
253 | + $msg['aircraftid'] = hexdec($data['address']); |
|
254 | + $msg['hex'] = $data['address']; |
|
255 | + $msg['flightid'] = hexdec($data['address']); |
|
256 | + $msg['date_gen'] = date('Y/m/d',$data['timestamp']); |
|
257 | + $msg['time_gen'] = date('H:i:s',$data['timestamp']).'.180'; |
|
258 | + $msg['date_log'] = date('Y/m/d',$data['timestamp']); |
|
259 | + $msg['time_log'] = date('H:i:s',$data['timestamp']).'.180'; |
|
260 | + $msg['callsign'] = ''; |
|
261 | + if (isset($data['altitude'])) $msg['altitude'] = $data['altitude']; |
|
262 | + else $msg['altitude'] = ''; |
|
263 | + $msg['speed'] = $data['speed']; |
|
264 | + if (isset($data['heading'])) $msg['track'] = $data['heading']; |
|
265 | + else $msg['track'] = ''; |
|
266 | + $msg['latitude'] = $data['latitude']; |
|
267 | + $msg['longitude'] = $data['longitude']; |
|
268 | + if (isset($data['verticalrate'])) $msg['verticalrate'] = $data['verticalrate']; |
|
269 | + else $msg['verticalrate'] = ''; |
|
270 | + if (isset($data['squawk'])) $msg['squawk'] = $data['squawk']; |
|
271 | + else $msg['squawk'] = 0; |
|
272 | + $msg['alert'] = 0; |
|
273 | + $msg['emergency'] = 0; |
|
274 | + $msg['SPI'] = 0; |
|
275 | + if (isset($data['ground'])) $msg['ground'] = 1; |
|
276 | + else $msg['ground'] = 0; |
|
277 | + $result[] = implode(',',$msg); |
|
278 | + } |
|
279 | + return $result; |
|
280 | + } |
|
281 | 281 | } |
282 | 282 | ?> |
@@ -21,7 +21,7 @@ |
||
21 | 21 | } |
22 | 22 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
23 | 23 | if ($airline_icao == '' && isset($globalFilter)) { |
24 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
24 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | require_once('header.php'); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | ?> |
38 | 38 | </div> |
39 | 39 | <?php |
40 | - if (!isset($year) || (isset($year) && $year == '') && !isset($month) || (isset($month) && $month == '')) { |
|
40 | + if (!isset($year) || (isset($year) && $year == '') && !isset($month) || (isset($month) && $month == '')) { |
|
41 | 41 | ?> |
42 | 42 | <div class="sub-menu sub-menu-container"> |
43 | 43 | <ul class="nav"> |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | </ul> |
96 | 96 | </li> |
97 | 97 | <?php |
98 | - if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
|
98 | + if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
|
99 | 99 | ?> |
100 | 100 | <li class="dropdown"> |
101 | 101 | <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | </ul> |
108 | 108 | </li> |
109 | 109 | <?php |
110 | - } |
|
110 | + } |
|
111 | 111 | ?> |
112 | 112 | <?php |
113 | 113 | } elseif ($type == 'marine' || $type == 'tracker') { |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | </ul> |
128 | 128 | </div> |
129 | 129 | <?php |
130 | - } else { |
|
130 | + } else { |
|
131 | 131 | ?> |
132 | 132 | <div class="sub-menu sub-menu-container"> |
133 | 133 | <ul class="nav"> |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | </li> |
190 | 190 | --> |
191 | 191 | <?php |
192 | - if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
|
192 | + if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
|
193 | 193 | ?> |
194 | 194 | <!-- |
195 | 195 | <li class="dropdown"> |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | </li> |
204 | 204 | --> |
205 | 205 | <?php |
206 | - } |
|
206 | + } |
|
207 | 207 | ?> |
208 | 208 | <?php |
209 | 209 | } elseif ($type == 'marine' || $type == 'tracker') { |
@@ -224,5 +224,5 @@ discard block |
||
224 | 224 | </ul> |
225 | 225 | </div> |
226 | 226 | <?php |
227 | - } |
|
227 | + } |
|
228 | 228 | ?> |
229 | 229 | \ No newline at end of file |
@@ -40,15 +40,15 @@ |
||
40 | 40 | //print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
41 | 41 | print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>'; |
42 | 42 | if ($spotter_item['atc_range'] > 0) { |
43 | - print '<div><span>'._("Range").'</span>'; |
|
44 | - print $spotter_item['atc_range']; |
|
45 | - print '</div>'; |
|
43 | + print '<div><span>'._("Range").'</span>'; |
|
44 | + print $spotter_item['atc_range']; |
|
45 | + print '</div>'; |
|
46 | 46 | } |
47 | 47 | print '</div>'; |
48 | 48 | if ($spotter_item['info'] != '') { |
49 | - print '<div class="notamtext"><span>'._("Info").'</span>'; |
|
50 | - print $spotter_item['info']; |
|
51 | - print '</div>'; |
|
49 | + print '<div class="notamtext"><span>'._("Info").'</span>'; |
|
50 | + print $spotter_item['info']; |
|
51 | + print '</div>'; |
|
52 | 52 | } |
53 | 53 | print '</div>'; |
54 | 54 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | date_default_timezone_set('UTC'); |
25 | 25 | //waypoint plotting |
26 | 26 | $output .= '{"type": "Feature",'; |
27 | - $output .= '"properties": {'; |
|
27 | + $output .= '"properties": {'; |
|
28 | 28 | $output .= '"ref": "'.$spotter_item['atc_id'].'",'; |
29 | 29 | $output .= '"ident": "'.$spotter_item['ident'].'",'; |
30 | 30 | $output .= '"frequency": "'.$spotter_item['frequency'].'",'; |
@@ -50,18 +50,18 @@ discard block |
||
50 | 50 | } else { |
51 | 51 | $output .= '"icon": "images/atc.png"'; |
52 | 52 | } |
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 | $radius = $spotter_item['atc_range']*100; |
62 | 62 | if ($radius > 0) { |
63 | 63 | $output .= '{"type": "Feature",'; |
64 | - $output .= '"properties": {'; |
|
64 | + $output .= '"properties": {'; |
|
65 | 65 | $output .= '"ref": "'.$spotter_item['atc_id'].'",'; |
66 | 66 | $output .= '"ident": "'.$spotter_item['ident'].'",'; |
67 | 67 | $output .= '"frequency": "'.$spotter_item['frequency'].'",'; |
@@ -87,13 +87,13 @@ discard block |
||
87 | 87 | } else { |
88 | 88 | $output .= '"atccolor": "#888219"'; |
89 | 89 | } |
90 | - $output .= '},'; |
|
91 | - $output .= '"geometry": {'; |
|
90 | + $output .= '},'; |
|
91 | + $output .= '"geometry": {'; |
|
92 | 92 | $output .= '"type": "Point",'; |
93 | 93 | $output .= '"coordinates": ['; |
94 | - $output .= $spotter_item['longitude'].', '.$spotter_item['latitude']; |
|
94 | + $output .= $spotter_item['longitude'].', '.$spotter_item['latitude']; |
|
95 | 95 | $output .= ']'; |
96 | - $output .= '}'; |
|
96 | + $output .= '}'; |
|
97 | 97 | $output .= '},'; |
98 | 98 | } |
99 | 99 | } |
@@ -5,23 +5,23 @@ discard block |
||
5 | 5 | $marine = false; |
6 | 6 | $usecoord = false; |
7 | 7 | if (isset($_GET['tracker'])) { |
8 | - $tracker = true; |
|
8 | + $tracker = true; |
|
9 | 9 | } |
10 | 10 | if (isset($_GET['marine'])) { |
11 | - $marine = true; |
|
11 | + $marine = true; |
|
12 | 12 | } |
13 | 13 | if ($tracker) { |
14 | - require_once('require/class.Tracker.php'); |
|
15 | - require_once('require/class.TrackerLive.php'); |
|
16 | - require_once('require/class.TrackerArchive.php'); |
|
14 | + require_once('require/class.Tracker.php'); |
|
15 | + require_once('require/class.TrackerLive.php'); |
|
16 | + require_once('require/class.TrackerArchive.php'); |
|
17 | 17 | } elseif ($marine) { |
18 | - require_once('require/class.Marine.php'); |
|
19 | - require_once('require/class.MarineLive.php'); |
|
20 | - require_once('require/class.MarineArchive.php'); |
|
18 | + require_once('require/class.Marine.php'); |
|
19 | + require_once('require/class.MarineLive.php'); |
|
20 | + require_once('require/class.MarineArchive.php'); |
|
21 | 21 | } else { |
22 | - require_once('require/class.Spotter.php'); |
|
23 | - require_once('require/class.SpotterLive.php'); |
|
24 | - require_once('require/class.SpotterArchive.php'); |
|
22 | + require_once('require/class.Spotter.php'); |
|
23 | + require_once('require/class.SpotterLive.php'); |
|
24 | + require_once('require/class.SpotterArchive.php'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | $begintime = microtime(true); |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | $Common = new Common(); |
42 | 42 | |
43 | 43 | if (isset($_GET['download'])) { |
44 | - if ($_GET['download'] == "true") |
|
45 | - { |
|
44 | + if ($_GET['download'] == "true") |
|
45 | + { |
|
46 | 46 | header('Content-disposition: attachment; filename="flightairmap.json"'); |
47 | - } |
|
47 | + } |
|
48 | 48 | } |
49 | 49 | header('Content-Type: text/javascript'); |
50 | 50 | |
@@ -498,17 +498,17 @@ discard block |
||
498 | 498 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
499 | 499 | |
500 | 500 | if ( |
501 | - (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
502 | - || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
501 | + (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
502 | + || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
503 | 503 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
504 | 504 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
505 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
506 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
507 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
508 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
509 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
510 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
511 | - ) { |
|
505 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
506 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
507 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
508 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
509 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
510 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
511 | + ) { |
|
512 | 512 | if ($tracker) { |
513 | 513 | if ($from_archive || $globalArchive) { |
514 | 514 | $spotter_history_array = $TrackerArchive->getAllArchiveTrackerDataById($spotter_item['famtrackid']); |
@@ -597,65 +597,65 @@ discard block |
||
597 | 597 | } |
598 | 598 | |
599 | 599 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
600 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
601 | - && (isset($spotter_item['departure_airport']) |
|
602 | - && $spotter_item['departure_airport'] != 'NA' |
|
603 | - && isset($spotter_item['arrival_airport']) |
|
604 | - && $spotter_item['arrival_airport'] != 'NA' |
|
605 | - && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
606 | - || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
|
607 | - if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
608 | - else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
609 | - if (isset($spotter_item['departure_airport_latitude'])) { |
|
600 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
601 | + && (isset($spotter_item['departure_airport']) |
|
602 | + && $spotter_item['departure_airport'] != 'NA' |
|
603 | + && isset($spotter_item['arrival_airport']) |
|
604 | + && $spotter_item['arrival_airport'] != 'NA' |
|
605 | + && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
606 | + || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
|
607 | + if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
608 | + else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
609 | + if (isset($spotter_item['departure_airport_latitude'])) { |
|
610 | 610 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
611 | - } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
611 | + } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
612 | 612 | $dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']); |
613 | 613 | if (isset($dairport[0]['latitude'])) { |
614 | - $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
614 | + $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
615 | 615 | } |
616 | - } |
|
617 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
616 | + } |
|
617 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
618 | 618 | $output_air .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].'],'; |
619 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
619 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
620 | 620 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
621 | 621 | if (isset($aairport[0]['latitude'])) { |
622 | - $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],'; |
|
622 | + $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],'; |
|
623 | 623 | } |
624 | - } |
|
625 | - $output_air = substr($output_air, 0, -1); |
|
626 | - $output_air .= ']}},'; |
|
627 | - $output .= $output_air; |
|
628 | - unset($output_air); |
|
624 | + } |
|
625 | + $output_air = substr($output_air, 0, -1); |
|
626 | + $output_air .= ']}},'; |
|
627 | + $output .= $output_air; |
|
628 | + unset($output_air); |
|
629 | 629 | } |
630 | 630 | |
631 | 631 | //if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
632 | 632 | //if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
633 | 633 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
634 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
635 | - && (isset($spotter_item['arrival_airport']) |
|
636 | - && $spotter_item['arrival_airport'] != 'NA' |
|
637 | - && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") |
|
638 | - || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) |
|
639 | - || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
|
640 | - $havedata = false; |
|
641 | - if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
642 | - else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
643 | - $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
634 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
635 | + && (isset($spotter_item['arrival_airport']) |
|
636 | + && $spotter_item['arrival_airport'] != 'NA' |
|
637 | + && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") |
|
638 | + || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) |
|
639 | + || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
|
640 | + $havedata = false; |
|
641 | + if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
642 | + else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
643 | + $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
644 | 644 | |
645 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
645 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
646 | 646 | $output_dest .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].']'; |
647 | 647 | $havedata = true; |
648 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
648 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
649 | 649 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
650 | 650 | if (isset($aairport[0]['latitude'])) { |
651 | - $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
652 | - $havedata = true; |
|
651 | + $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
652 | + $havedata = true; |
|
653 | 653 | } |
654 | - } |
|
655 | - //$output_dest = substr($output_dest, 0, -1); |
|
656 | - $output_dest .= ']}},'; |
|
657 | - if ($havedata) $output .= $output_dest; |
|
658 | - unset($output_dest); |
|
654 | + } |
|
655 | + //$output_dest = substr($output_dest, 0, -1); |
|
656 | + $output_dest .= ']}},'; |
|
657 | + if ($havedata) $output .= $output_dest; |
|
658 | + unset($output_dest); |
|
659 | 659 | } |
660 | 660 | } |
661 | 661 | $output = substr($output, 0, -1); |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | print '<th class="arrival"><span class="nomobile">'._("Going to").'</span><span class="mobile">'._("To").'</span></th>'; |
278 | 278 | } |
279 | 279 | } |
280 | - if ($type == 'aircraft') { |
|
280 | + if ($type == 'aircraft') { |
|
281 | 281 | if ((isset($globalUsePilot) && $globalUsePilot) || (!isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalVAM) && $globalVAM) || (isset($globalphpVMS) && $globalphpVMS)))) { |
282 | 282 | print '<th class="pilot"><span class="nomobile">'._("Pilot name").'</span><span class="mobile">'._("Pilot").'</span></a></th>'; |
283 | 283 | } |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | } elseif(strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive" && strtolower($current_page) != "accident-latest" && strtolower($current_page) != "incident-latest" && strtolower($current_page) != "accident-detailed" && strtolower($current_page) != "incident-detailed"){ |
580 | 580 | if ($type == 'aircraft') { |
581 | 581 | if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) { |
582 | - $spotter_item['squawk'] = '-'; |
|
582 | + $spotter_item['squawk'] = '-'; |
|
583 | 583 | } |
584 | 584 | if ($spotter_item['image_thumbnail'] != "") |
585 | 585 | { |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | print '</td>'."\n"; |
619 | 619 | } else { |
620 | 620 | print '<td class="aircraft_thumbnail">'."\n"; |
621 | - // print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
|
621 | + // print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
|
622 | 622 | //} |
623 | 623 | if (!isset($spotter_item['airline_name']) && !isset($spotter_item['aircraft_name'])) { |
624 | 624 | print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '._("Not available").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n"; |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | print '<div class="details">'; |
79 | 79 | print '<div><span>'._("Altitude").'</span>'; |
80 | 80 | if (isset($globalGroundAltitude) && $globalGroundAltitude) { |
81 | - try { |
|
81 | + try { |
|
82 | 82 | $groundAltitude = $Elevation->getElevation($spotter_item['latitude'],$spotter_item['longitude']); |
83 | - } catch(Exception $e) { |
|
84 | - } |
|
83 | + } catch(Exception $e) { |
|
84 | + } |
|
85 | 85 | } |
86 | 86 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
87 | 87 | print $spotter_item['altitude'].' feet (FL'.$spotter_item['altitude'].')'; |
@@ -89,14 +89,14 @@ discard block |
||
89 | 89 | print round($spotter_item['altitude']*0.3048).' m (FL'.round($spotter_item['altitude']/100).')'; |
90 | 90 | } |
91 | 91 | if (isset($groundAltitude) && $groundAltitude < $spotter_item['altitude']*0.3048) { |
92 | - print '<br>'; |
|
93 | - print '<span>'._("Ground Altitude").'</span>'; |
|
94 | - if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
|
92 | + print '<br>'; |
|
93 | + print '<span>'._("Ground Altitude").'</span>'; |
|
94 | + if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
|
95 | 95 | print round($groundAltitude*3.28084).' feet'; |
96 | - } else { |
|
96 | + } else { |
|
97 | 97 | print round($groundAltitude).' m'; |
98 | - } |
|
99 | - print '</i>'; |
|
98 | + } |
|
99 | + print '</i>'; |
|
100 | 100 | } |
101 | 101 | print '</div>'; |
102 | 102 | print '<div><span>'._("Speed").'</span>'; |