@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | //protected $cookies = array(); |
8 | 8 | |
9 | 9 | /** |
10 | - * Get data from form result |
|
11 | - * @param String $url form URL |
|
12 | - * @param String $type type of submit form method (get or post) |
|
13 | - * @param String|Array $data values form post method |
|
14 | - * @param Array $headers header to submit with the form |
|
15 | - * @return String the result |
|
16 | - */ |
|
10 | + * Get data from form result |
|
11 | + * @param String $url form URL |
|
12 | + * @param String $type type of submit form method (get or post) |
|
13 | + * @param String|Array $data values form post method |
|
14 | + * @param Array $headers header to submit with the form |
|
15 | + * @return String the result |
|
16 | + */ |
|
17 | 17 | public function getData($url, $type = 'get', $data = '', $headers = '',$cookie = '',$referer = '',$timeout = '',$useragent = '', $sizelimit = false, $async = false) { |
18 | 18 | global $globalProxy, $globalForceIPv4; |
19 | 19 | $ch = curl_init(); |
@@ -166,10 +166,10 @@ discard block |
||
166 | 166 | } |
167 | 167 | |
168 | 168 | /** |
169 | - * Convert a HTML table to an array |
|
170 | - * @param String $data HTML page |
|
171 | - * @return Array array of the tables in HTML page |
|
172 | - */ |
|
169 | + * Convert a HTML table to an array |
|
170 | + * @param String $data HTML page |
|
171 | + * @return Array array of the tables in HTML page |
|
172 | + */ |
|
173 | 173 | public function table2array($data) { |
174 | 174 | if (!is_string($data)) return array(); |
175 | 175 | if ($data == '') return array(); |
@@ -203,10 +203,10 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | /** |
206 | - * Convert <p> part of a HTML page to an array |
|
207 | - * @param String $data HTML page |
|
208 | - * @return Array array of the <p> in HTML page |
|
209 | - */ |
|
206 | + * Convert <p> part of a HTML page to an array |
|
207 | + * @param String $data HTML page |
|
208 | + * @return Array array of the <p> in HTML page |
|
209 | + */ |
|
210 | 210 | public function text2array($data) { |
211 | 211 | $html = str_get_html($data); |
212 | 212 | if ($html === false) return array(); |
@@ -221,14 +221,14 @@ discard block |
||
221 | 221 | } |
222 | 222 | |
223 | 223 | /** |
224 | - * Give distance between 2 coordonnates |
|
225 | - * @param Float $lat latitude of first point |
|
226 | - * @param Float $lon longitude of first point |
|
227 | - * @param Float $latc latitude of second point |
|
228 | - * @param Float $lonc longitude of second point |
|
229 | - * @param String $unit km else no unit used |
|
230 | - * @return Float Distance in $unit |
|
231 | - */ |
|
224 | + * Give distance between 2 coordonnates |
|
225 | + * @param Float $lat latitude of first point |
|
226 | + * @param Float $lon longitude of first point |
|
227 | + * @param Float $latc latitude of second point |
|
228 | + * @param Float $lonc longitude of second point |
|
229 | + * @param String $unit km else no unit used |
|
230 | + * @return Float Distance in $unit |
|
231 | + */ |
|
232 | 232 | public function distance($lat, $lon, $latc, $lonc, $unit = 'km') { |
233 | 233 | if ($lat == $latc && $lon == $lonc) return 0; |
234 | 234 | $dist = rad2deg(acos(sin(deg2rad(floatval($lat)))*sin(deg2rad(floatval($latc)))+ cos(deg2rad(floatval($lat)))*cos(deg2rad(floatval($latc)))*cos(deg2rad(floatval($lon)-floatval($lonc)))))*60*1.1515; |
@@ -246,25 +246,25 @@ discard block |
||
246 | 246 | } |
247 | 247 | |
248 | 248 | /** |
249 | - * Give plunge between 2 altitudes and distance |
|
250 | - * @param Float $initial_altitude altitude of first point in m |
|
251 | - * @param Float $final_altitude altitude of second point in m |
|
252 | - * @param String $distance distance between two points in m |
|
253 | - * @return Float plunge |
|
254 | - */ |
|
249 | + * Give plunge between 2 altitudes and distance |
|
250 | + * @param Float $initial_altitude altitude of first point in m |
|
251 | + * @param Float $final_altitude altitude of second point in m |
|
252 | + * @param String $distance distance between two points in m |
|
253 | + * @return Float plunge |
|
254 | + */ |
|
255 | 255 | public function plunge($initial_altitude,$final_altitude,$distance) { |
256 | 256 | $plunge = rad2deg(asin(($final_altitude-$initial_altitude)/$distance)); |
257 | 257 | return $plunge; |
258 | 258 | } |
259 | 259 | |
260 | 260 | /** |
261 | - * Give azimuth between 2 coordonnates |
|
262 | - * @param Float $lat latitude of first point |
|
263 | - * @param Float $lon longitude of first point |
|
264 | - * @param Float $latc latitude of second point |
|
265 | - * @param Float $lonc longitude of second point |
|
266 | - * @return Float Azimuth |
|
267 | - */ |
|
261 | + * Give azimuth between 2 coordonnates |
|
262 | + * @param Float $lat latitude of first point |
|
263 | + * @param Float $lon longitude of first point |
|
264 | + * @param Float $latc latitude of second point |
|
265 | + * @param Float $lonc longitude of second point |
|
266 | + * @return Float Azimuth |
|
267 | + */ |
|
268 | 268 | public function azimuth($lat, $lon, $latc, $lonc) { |
269 | 269 | $dX = $latc - $lat; |
270 | 270 | $dY = $lonc - $lon; |
@@ -275,11 +275,11 @@ discard block |
||
275 | 275 | |
276 | 276 | |
277 | 277 | /** |
278 | - * Check is distance realistic |
|
279 | - * @param int $timeDifference the time between the reception of both messages |
|
280 | - * @param float $distance distance covered |
|
281 | - * @return whether distance is realistic |
|
282 | - */ |
|
278 | + * Check is distance realistic |
|
279 | + * @param int $timeDifference the time between the reception of both messages |
|
280 | + * @param float $distance distance covered |
|
281 | + * @return whether distance is realistic |
|
282 | + */ |
|
283 | 283 | public function withinThreshold ($timeDifference, $distance) { |
284 | 284 | $x = abs($timeDifference); |
285 | 285 | $d = abs($distance); |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | } |
298 | 298 | |
299 | 299 | public function isInteger($input){ |
300 | - return(ctype_digit(strval($input))); |
|
300 | + return(ctype_digit(strval($input))); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | |
@@ -328,11 +328,11 @@ discard block |
||
328 | 328 | } |
329 | 329 | |
330 | 330 | /** |
331 | - * Copy folder contents |
|
332 | - * @param string $source Source path |
|
333 | - * @param string $dest Destination path |
|
334 | - * @return bool Returns true on success, false on failure |
|
335 | - */ |
|
331 | + * Copy folder contents |
|
332 | + * @param string $source Source path |
|
333 | + * @param string $dest Destination path |
|
334 | + * @return bool Returns true on success, false on failure |
|
335 | + */ |
|
336 | 336 | public function xcopy($source, $dest) |
337 | 337 | { |
338 | 338 | $files = glob($source.'*.*'); |
@@ -344,20 +344,20 @@ discard block |
||
344 | 344 | } |
345 | 345 | |
346 | 346 | /** |
347 | - * Check if an url exist |
|
348 | - * @param String $url url to check |
|
349 | - * @return bool Return true on succes false on failure |
|
350 | - */ |
|
347 | + * Check if an url exist |
|
348 | + * @param String $url url to check |
|
349 | + * @return bool Return true on succes false on failure |
|
350 | + */ |
|
351 | 351 | public function urlexist($url){ |
352 | 352 | $headers=get_headers($url); |
353 | 353 | return stripos($headers[0],"200 OK")?true:false; |
354 | 354 | } |
355 | 355 | |
356 | 356 | /** |
357 | - * Convert hexa to string |
|
358 | - * @param String $hex data in hexa |
|
359 | - * @return String Return result |
|
360 | - */ |
|
357 | + * Convert hexa to string |
|
358 | + * @param String $hex data in hexa |
|
359 | + * @return String Return result |
|
360 | + */ |
|
361 | 361 | public function hex2str($hex) { |
362 | 362 | $str = ''; |
363 | 363 | $hexln = strlen($hex); |
@@ -366,10 +366,10 @@ discard block |
||
366 | 366 | } |
367 | 367 | |
368 | 368 | /** |
369 | - * Convert hexa color to rgb |
|
370 | - * @param String $hex data in hexa |
|
371 | - * @return String Return result |
|
372 | - */ |
|
369 | + * Convert hexa color to rgb |
|
370 | + * @param String $hex data in hexa |
|
371 | + * @return String Return result |
|
372 | + */ |
|
373 | 373 | public function hex2rgb($hex) { |
374 | 374 | $hex = str_replace('#','',$hex); |
375 | 375 | return sscanf($hex, "%02x%02x%02x"); |
@@ -447,9 +447,9 @@ discard block |
||
447 | 447 | } |
448 | 448 | |
449 | 449 | /** |
450 | - * Returns list of available locales |
|
451 | - * |
|
452 | - * @return array |
|
450 | + * Returns list of available locales |
|
451 | + * |
|
452 | + * @return array |
|
453 | 453 | */ |
454 | 454 | public function listLocaleDir() |
455 | 455 | { |
@@ -548,100 +548,100 @@ discard block |
||
548 | 548 | public function remove_accents($string) { |
549 | 549 | if ( !preg_match('/[\x80-\xff]/', $string) ) return $string; |
550 | 550 | $chars = array( |
551 | - // Decompositions for Latin-1 Supplement |
|
552 | - chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', |
|
553 | - chr(195).chr(130) => 'A', chr(195).chr(131) => 'A', |
|
554 | - chr(195).chr(132) => 'A', chr(195).chr(133) => 'A', |
|
555 | - chr(195).chr(135) => 'C', chr(195).chr(136) => 'E', |
|
556 | - chr(195).chr(137) => 'E', chr(195).chr(138) => 'E', |
|
557 | - chr(195).chr(139) => 'E', chr(195).chr(140) => 'I', |
|
558 | - chr(195).chr(141) => 'I', chr(195).chr(142) => 'I', |
|
559 | - chr(195).chr(143) => 'I', chr(195).chr(145) => 'N', |
|
560 | - chr(195).chr(146) => 'O', chr(195).chr(147) => 'O', |
|
561 | - chr(195).chr(148) => 'O', chr(195).chr(149) => 'O', |
|
562 | - chr(195).chr(150) => 'O', chr(195).chr(153) => 'U', |
|
563 | - chr(195).chr(154) => 'U', chr(195).chr(155) => 'U', |
|
564 | - chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y', |
|
565 | - chr(195).chr(159) => 's', chr(195).chr(160) => 'a', |
|
566 | - chr(195).chr(161) => 'a', chr(195).chr(162) => 'a', |
|
567 | - chr(195).chr(163) => 'a', chr(195).chr(164) => 'a', |
|
568 | - chr(195).chr(165) => 'a', chr(195).chr(167) => 'c', |
|
569 | - chr(195).chr(168) => 'e', chr(195).chr(169) => 'e', |
|
570 | - chr(195).chr(170) => 'e', chr(195).chr(171) => 'e', |
|
571 | - chr(195).chr(172) => 'i', chr(195).chr(173) => 'i', |
|
572 | - chr(195).chr(174) => 'i', chr(195).chr(175) => 'i', |
|
573 | - chr(195).chr(177) => 'n', chr(195).chr(178) => 'o', |
|
574 | - chr(195).chr(179) => 'o', chr(195).chr(180) => 'o', |
|
575 | - chr(195).chr(181) => 'o', chr(195).chr(182) => 'o', |
|
576 | - chr(195).chr(182) => 'o', chr(195).chr(185) => 'u', |
|
577 | - chr(195).chr(186) => 'u', chr(195).chr(187) => 'u', |
|
578 | - chr(195).chr(188) => 'u', chr(195).chr(189) => 'y', |
|
579 | - chr(195).chr(191) => 'y', |
|
580 | - // Decompositions for Latin Extended-A |
|
581 | - chr(196).chr(128) => 'A', chr(196).chr(129) => 'a', |
|
582 | - chr(196).chr(130) => 'A', chr(196).chr(131) => 'a', |
|
583 | - chr(196).chr(132) => 'A', chr(196).chr(133) => 'a', |
|
584 | - chr(196).chr(134) => 'C', chr(196).chr(135) => 'c', |
|
585 | - chr(196).chr(136) => 'C', chr(196).chr(137) => 'c', |
|
586 | - chr(196).chr(138) => 'C', chr(196).chr(139) => 'c', |
|
587 | - chr(196).chr(140) => 'C', chr(196).chr(141) => 'c', |
|
588 | - chr(196).chr(142) => 'D', chr(196).chr(143) => 'd', |
|
589 | - chr(196).chr(144) => 'D', chr(196).chr(145) => 'd', |
|
590 | - chr(196).chr(146) => 'E', chr(196).chr(147) => 'e', |
|
591 | - chr(196).chr(148) => 'E', chr(196).chr(149) => 'e', |
|
592 | - chr(196).chr(150) => 'E', chr(196).chr(151) => 'e', |
|
593 | - chr(196).chr(152) => 'E', chr(196).chr(153) => 'e', |
|
594 | - chr(196).chr(154) => 'E', chr(196).chr(155) => 'e', |
|
595 | - chr(196).chr(156) => 'G', chr(196).chr(157) => 'g', |
|
596 | - chr(196).chr(158) => 'G', chr(196).chr(159) => 'g', |
|
597 | - chr(196).chr(160) => 'G', chr(196).chr(161) => 'g', |
|
598 | - chr(196).chr(162) => 'G', chr(196).chr(163) => 'g', |
|
599 | - chr(196).chr(164) => 'H', chr(196).chr(165) => 'h', |
|
600 | - chr(196).chr(166) => 'H', chr(196).chr(167) => 'h', |
|
601 | - chr(196).chr(168) => 'I', chr(196).chr(169) => 'i', |
|
602 | - chr(196).chr(170) => 'I', chr(196).chr(171) => 'i', |
|
603 | - chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', |
|
604 | - chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', |
|
605 | - chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', |
|
606 | - chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', |
|
607 | - chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', |
|
608 | - chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', |
|
609 | - chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', |
|
610 | - chr(196).chr(186) => 'l', chr(196).chr(187) => 'L', |
|
611 | - chr(196).chr(188) => 'l', chr(196).chr(189) => 'L', |
|
612 | - chr(196).chr(190) => 'l', chr(196).chr(191) => 'L', |
|
613 | - chr(197).chr(128) => 'l', chr(197).chr(129) => 'L', |
|
614 | - chr(197).chr(130) => 'l', chr(197).chr(131) => 'N', |
|
615 | - chr(197).chr(132) => 'n', chr(197).chr(133) => 'N', |
|
616 | - chr(197).chr(134) => 'n', chr(197).chr(135) => 'N', |
|
617 | - chr(197).chr(136) => 'n', chr(197).chr(137) => 'N', |
|
618 | - chr(197).chr(138) => 'n', chr(197).chr(139) => 'N', |
|
619 | - chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', |
|
620 | - chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', |
|
621 | - chr(197).chr(144) => 'O', chr(197).chr(145) => 'o', |
|
622 | - chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe', |
|
623 | - chr(197).chr(148) => 'R',chr(197).chr(149) => 'r', |
|
624 | - chr(197).chr(150) => 'R',chr(197).chr(151) => 'r', |
|
625 | - chr(197).chr(152) => 'R',chr(197).chr(153) => 'r', |
|
626 | - chr(197).chr(154) => 'S',chr(197).chr(155) => 's', |
|
627 | - chr(197).chr(156) => 'S',chr(197).chr(157) => 's', |
|
628 | - chr(197).chr(158) => 'S',chr(197).chr(159) => 's', |
|
629 | - chr(197).chr(160) => 'S', chr(197).chr(161) => 's', |
|
630 | - chr(197).chr(162) => 'T', chr(197).chr(163) => 't', |
|
631 | - chr(197).chr(164) => 'T', chr(197).chr(165) => 't', |
|
632 | - chr(197).chr(166) => 'T', chr(197).chr(167) => 't', |
|
633 | - chr(197).chr(168) => 'U', chr(197).chr(169) => 'u', |
|
634 | - chr(197).chr(170) => 'U', chr(197).chr(171) => 'u', |
|
635 | - chr(197).chr(172) => 'U', chr(197).chr(173) => 'u', |
|
636 | - chr(197).chr(174) => 'U', chr(197).chr(175) => 'u', |
|
637 | - chr(197).chr(176) => 'U', chr(197).chr(177) => 'u', |
|
638 | - chr(197).chr(178) => 'U', chr(197).chr(179) => 'u', |
|
639 | - chr(197).chr(180) => 'W', chr(197).chr(181) => 'w', |
|
640 | - chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y', |
|
641 | - chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z', |
|
642 | - chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z', |
|
643 | - chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z', |
|
644 | - chr(197).chr(190) => 'z', chr(197).chr(191) => 's' |
|
551 | + // Decompositions for Latin-1 Supplement |
|
552 | + chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', |
|
553 | + chr(195).chr(130) => 'A', chr(195).chr(131) => 'A', |
|
554 | + chr(195).chr(132) => 'A', chr(195).chr(133) => 'A', |
|
555 | + chr(195).chr(135) => 'C', chr(195).chr(136) => 'E', |
|
556 | + chr(195).chr(137) => 'E', chr(195).chr(138) => 'E', |
|
557 | + chr(195).chr(139) => 'E', chr(195).chr(140) => 'I', |
|
558 | + chr(195).chr(141) => 'I', chr(195).chr(142) => 'I', |
|
559 | + chr(195).chr(143) => 'I', chr(195).chr(145) => 'N', |
|
560 | + chr(195).chr(146) => 'O', chr(195).chr(147) => 'O', |
|
561 | + chr(195).chr(148) => 'O', chr(195).chr(149) => 'O', |
|
562 | + chr(195).chr(150) => 'O', chr(195).chr(153) => 'U', |
|
563 | + chr(195).chr(154) => 'U', chr(195).chr(155) => 'U', |
|
564 | + chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y', |
|
565 | + chr(195).chr(159) => 's', chr(195).chr(160) => 'a', |
|
566 | + chr(195).chr(161) => 'a', chr(195).chr(162) => 'a', |
|
567 | + chr(195).chr(163) => 'a', chr(195).chr(164) => 'a', |
|
568 | + chr(195).chr(165) => 'a', chr(195).chr(167) => 'c', |
|
569 | + chr(195).chr(168) => 'e', chr(195).chr(169) => 'e', |
|
570 | + chr(195).chr(170) => 'e', chr(195).chr(171) => 'e', |
|
571 | + chr(195).chr(172) => 'i', chr(195).chr(173) => 'i', |
|
572 | + chr(195).chr(174) => 'i', chr(195).chr(175) => 'i', |
|
573 | + chr(195).chr(177) => 'n', chr(195).chr(178) => 'o', |
|
574 | + chr(195).chr(179) => 'o', chr(195).chr(180) => 'o', |
|
575 | + chr(195).chr(181) => 'o', chr(195).chr(182) => 'o', |
|
576 | + chr(195).chr(182) => 'o', chr(195).chr(185) => 'u', |
|
577 | + chr(195).chr(186) => 'u', chr(195).chr(187) => 'u', |
|
578 | + chr(195).chr(188) => 'u', chr(195).chr(189) => 'y', |
|
579 | + chr(195).chr(191) => 'y', |
|
580 | + // Decompositions for Latin Extended-A |
|
581 | + chr(196).chr(128) => 'A', chr(196).chr(129) => 'a', |
|
582 | + chr(196).chr(130) => 'A', chr(196).chr(131) => 'a', |
|
583 | + chr(196).chr(132) => 'A', chr(196).chr(133) => 'a', |
|
584 | + chr(196).chr(134) => 'C', chr(196).chr(135) => 'c', |
|
585 | + chr(196).chr(136) => 'C', chr(196).chr(137) => 'c', |
|
586 | + chr(196).chr(138) => 'C', chr(196).chr(139) => 'c', |
|
587 | + chr(196).chr(140) => 'C', chr(196).chr(141) => 'c', |
|
588 | + chr(196).chr(142) => 'D', chr(196).chr(143) => 'd', |
|
589 | + chr(196).chr(144) => 'D', chr(196).chr(145) => 'd', |
|
590 | + chr(196).chr(146) => 'E', chr(196).chr(147) => 'e', |
|
591 | + chr(196).chr(148) => 'E', chr(196).chr(149) => 'e', |
|
592 | + chr(196).chr(150) => 'E', chr(196).chr(151) => 'e', |
|
593 | + chr(196).chr(152) => 'E', chr(196).chr(153) => 'e', |
|
594 | + chr(196).chr(154) => 'E', chr(196).chr(155) => 'e', |
|
595 | + chr(196).chr(156) => 'G', chr(196).chr(157) => 'g', |
|
596 | + chr(196).chr(158) => 'G', chr(196).chr(159) => 'g', |
|
597 | + chr(196).chr(160) => 'G', chr(196).chr(161) => 'g', |
|
598 | + chr(196).chr(162) => 'G', chr(196).chr(163) => 'g', |
|
599 | + chr(196).chr(164) => 'H', chr(196).chr(165) => 'h', |
|
600 | + chr(196).chr(166) => 'H', chr(196).chr(167) => 'h', |
|
601 | + chr(196).chr(168) => 'I', chr(196).chr(169) => 'i', |
|
602 | + chr(196).chr(170) => 'I', chr(196).chr(171) => 'i', |
|
603 | + chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', |
|
604 | + chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', |
|
605 | + chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', |
|
606 | + chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', |
|
607 | + chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', |
|
608 | + chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', |
|
609 | + chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', |
|
610 | + chr(196).chr(186) => 'l', chr(196).chr(187) => 'L', |
|
611 | + chr(196).chr(188) => 'l', chr(196).chr(189) => 'L', |
|
612 | + chr(196).chr(190) => 'l', chr(196).chr(191) => 'L', |
|
613 | + chr(197).chr(128) => 'l', chr(197).chr(129) => 'L', |
|
614 | + chr(197).chr(130) => 'l', chr(197).chr(131) => 'N', |
|
615 | + chr(197).chr(132) => 'n', chr(197).chr(133) => 'N', |
|
616 | + chr(197).chr(134) => 'n', chr(197).chr(135) => 'N', |
|
617 | + chr(197).chr(136) => 'n', chr(197).chr(137) => 'N', |
|
618 | + chr(197).chr(138) => 'n', chr(197).chr(139) => 'N', |
|
619 | + chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', |
|
620 | + chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', |
|
621 | + chr(197).chr(144) => 'O', chr(197).chr(145) => 'o', |
|
622 | + chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe', |
|
623 | + chr(197).chr(148) => 'R',chr(197).chr(149) => 'r', |
|
624 | + chr(197).chr(150) => 'R',chr(197).chr(151) => 'r', |
|
625 | + chr(197).chr(152) => 'R',chr(197).chr(153) => 'r', |
|
626 | + chr(197).chr(154) => 'S',chr(197).chr(155) => 's', |
|
627 | + chr(197).chr(156) => 'S',chr(197).chr(157) => 's', |
|
628 | + chr(197).chr(158) => 'S',chr(197).chr(159) => 's', |
|
629 | + chr(197).chr(160) => 'S', chr(197).chr(161) => 's', |
|
630 | + chr(197).chr(162) => 'T', chr(197).chr(163) => 't', |
|
631 | + chr(197).chr(164) => 'T', chr(197).chr(165) => 't', |
|
632 | + chr(197).chr(166) => 'T', chr(197).chr(167) => 't', |
|
633 | + chr(197).chr(168) => 'U', chr(197).chr(169) => 'u', |
|
634 | + chr(197).chr(170) => 'U', chr(197).chr(171) => 'u', |
|
635 | + chr(197).chr(172) => 'U', chr(197).chr(173) => 'u', |
|
636 | + chr(197).chr(174) => 'U', chr(197).chr(175) => 'u', |
|
637 | + chr(197).chr(176) => 'U', chr(197).chr(177) => 'u', |
|
638 | + chr(197).chr(178) => 'U', chr(197).chr(179) => 'u', |
|
639 | + chr(197).chr(180) => 'W', chr(197).chr(181) => 'w', |
|
640 | + chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y', |
|
641 | + chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z', |
|
642 | + chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z', |
|
643 | + chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z', |
|
644 | + chr(197).chr(190) => 'z', chr(197).chr(191) => 's' |
|
645 | 645 | ); |
646 | 646 | $string = strtr($string, $chars); |
647 | 647 | return $string; |
@@ -331,15 +331,15 @@ discard block |
||
331 | 331 | } |
332 | 332 | |
333 | 333 | <?php |
334 | - if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
334 | + if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
335 | 335 | ?> |
336 | 336 | var loc_geojson = Cesium.loadJson("<?php print $globalURL; ?>/location-geojson.php?coord="+bbox()); |
337 | 337 | <?php |
338 | - } else { |
|
338 | + } else { |
|
339 | 339 | ?> |
340 | 340 | var loc_geojson = Cesium.loadJson("<?php print $globalURL; ?>/location-geojson.php"); |
341 | 341 | <?php |
342 | - } |
|
342 | + } |
|
343 | 343 | ?> |
344 | 344 | loc_geojson.then(function(geojsondata) { |
345 | 345 | loc = new Cesium.CustomDataSource('location'); |
@@ -512,15 +512,15 @@ discard block |
||
512 | 512 | // if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') { |
513 | 513 | ?> |
514 | 514 | <?php |
515 | - if (isset($globalMapOffline) && $globalMapOffline === TRUE) { |
|
515 | + if (isset($globalMapOffline) && $globalMapOffline === TRUE) { |
|
516 | 516 | ?> |
517 | 517 | var MapTerrain = 'ellipsoid'; |
518 | 518 | <?php |
519 | - } else { |
|
519 | + } else { |
|
520 | 520 | ?> |
521 | 521 | var MapTerrain = getCookie('MapTerrain'); |
522 | 522 | <?php |
523 | - } |
|
523 | + } |
|
524 | 524 | ?> |
525 | 525 | |
526 | 526 | |
@@ -574,11 +574,11 @@ discard block |
||
574 | 574 | } |
575 | 575 | |
576 | 576 | <?php |
577 | - if (isset($globalTSK) && $globalTSK && isset($_GET['tsk'])) { |
|
577 | + if (isset($globalTSK) && $globalTSK && isset($_GET['tsk'])) { |
|
578 | 578 | ?> |
579 | 579 | update_tsk(); |
580 | 580 | <?php |
581 | - } |
|
581 | + } |
|
582 | 582 | ?> |
583 | 583 | |
584 | 584 | update_locationsLayer(); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | <?php }; if (isset($globalSatellite) && $globalSatellite) { ?><td><div id="ibxsatellite"><h4><?php echo _("Satellites Displayed"); ?></h4><br /><i class="fa fa-spinner fa-pulse fa-fw"></i></div></td><?php } ?> |
48 | 48 | </tr></table></div> |
49 | 49 | <?php |
50 | - if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) { |
|
50 | + if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) { |
|
51 | 51 | ?> |
52 | 52 | <script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) print '?tsk='.$tsk; ?>"></script> |
53 | 53 | <?php |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | <script src="<?php echo $globalURL; ?>/js/map-marine.3d.js.php"></script> |
72 | 72 | <?php |
73 | 73 | } |
74 | - } |
|
74 | + } |
|
75 | 75 | ?> |
76 | 76 | |
77 | 77 | <div id="sidebar" class="sidebar collapsed"> |
@@ -82,34 +82,34 @@ discard block |
||
82 | 82 | <li><a href="#" onclick="getUserLocation(); return false;" title="<?php echo _("Plot your Location"); ?>"><i class="fa fa-map-marker"></i></a></li> |
83 | 83 | <li><a href="#" onclick="getCompassDirection(); return false;" title="<?php echo _("Compass Mode"); ?>"><i class="fa fa-compass"></i></a></li> |
84 | 84 | <?php |
85 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
85 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
86 | 86 | if (isset($globalArchive) && $globalArchive == TRUE) { |
87 | 87 | ?> |
88 | 88 | <li><a href="#archive" role="tab" title="<?php echo _("Archive"); ?>"><i class="fa fa-archive"></i></a></li> |
89 | 89 | <?php |
90 | 90 | } |
91 | - } |
|
91 | + } |
|
92 | 92 | ?> |
93 | 93 | <li><a href="#home" role="tab" title="<?php echo _("Layers"); ?>"><i class="fa fa-map"></i></a></li> |
94 | 94 | <li><a href="#filters" role="tab" title="<?php echo _("Filters"); ?>"><i class="fa fa-filter"></i></a></li> |
95 | 95 | <li><a href="#settings" role="tab" title="<?php echo _("Settings"); ?>"><i class="fa fa-gears"></i></a></li> |
96 | 96 | <?php |
97 | - if (isset($globalMap3D) && $globalMap3D) { |
|
97 | + if (isset($globalMap3D) && $globalMap3D) { |
|
98 | 98 | if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
99 | 99 | ?> |
100 | 100 | <li><a href="#" onclick="show3D(); return false;" role="tab" title="3D"><b>3D</b></a></li> |
101 | 101 | <?php |
102 | 102 | } else { |
103 | - if (isset($globalSatellite) && $globalSatellite) { |
|
103 | + if (isset($globalSatellite) && $globalSatellite) { |
|
104 | 104 | ?> |
105 | 105 | <li><a href="#satellites" role="tab" title="<?php echo _("Satellites"); ?>"><i class="satellite"></i></a></li> |
106 | 106 | <?php |
107 | - } |
|
107 | + } |
|
108 | 108 | ?> |
109 | 109 | <li><a href="#" onclick="show2D(); return false;" role="tab" title="2D"><b>2D</b></a></li> |
110 | 110 | <?php |
111 | 111 | } |
112 | - } |
|
112 | + } |
|
113 | 113 | ?> |
114 | 114 | </ul> |
115 | 115 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | ?> |
185 | 185 | </div> |
186 | 186 | <?php |
187 | - if (isset($globalArchive) && $globalArchive == TRUE) { |
|
187 | + if (isset($globalArchive) && $globalArchive == TRUE) { |
|
188 | 188 | ?> |
189 | 189 | <div class="sidebar-pane" id="archive"> |
190 | 190 | <h1 class="sidebar-header"><?php echo _("Playback"); ?> <i>Bêta</i><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | </form> |
244 | 244 | </div> |
245 | 245 | <?php |
246 | - } |
|
246 | + } |
|
247 | 247 | ?> |
248 | 248 | <div class="sidebar-pane" id="settings"> |
249 | 249 | <h1 class="sidebar-header"><?php echo _("Settings"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
@@ -254,67 +254,67 @@ discard block |
||
254 | 254 | <?php |
255 | 255 | if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider; |
256 | 256 | else $MapType = $_COOKIE['MapType']; |
257 | - ?> |
|
257 | + ?> |
|
258 | 258 | <?php |
259 | 259 | if (isset($globalMapOffline) && $globalMapOffline === TRUE) { |
260 | - ?> |
|
260 | + ?> |
|
261 | 261 | <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option> |
262 | 262 | <?php |
263 | 263 | } else { |
264 | - if (file_exists(dirname(__FILE__).'/js/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml')) { |
|
265 | - ?> |
|
264 | + if (file_exists(dirname(__FILE__).'/js/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml')) { |
|
265 | + ?> |
|
266 | 266 | <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option> |
267 | 267 | <?php |
268 | - } |
|
269 | - if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
|
270 | - ?> |
|
268 | + } |
|
269 | + if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
|
270 | + ?> |
|
271 | 271 | <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option> |
272 | 272 | <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option> |
273 | 273 | <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option> |
274 | 274 | <?php |
275 | - } |
|
276 | - ?> |
|
275 | + } |
|
276 | + ?> |
|
277 | 277 | <?php |
278 | - if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
279 | - ?> |
|
278 | + if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
279 | + ?> |
|
280 | 280 | <?php |
281 | 281 | if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
282 | - ?> |
|
282 | + ?> |
|
283 | 283 | <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option> |
284 | 284 | <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option> |
285 | 285 | <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option> |
286 | 286 | <?php |
287 | 287 | } |
288 | - ?> |
|
288 | + ?> |
|
289 | 289 | <?php |
290 | 290 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') { |
291 | - ?> |
|
291 | + ?> |
|
292 | 292 | <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option> |
293 | 293 | <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option> |
294 | 294 | <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option> |
295 | 295 | <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option> |
296 | 296 | <?php |
297 | 297 | } |
298 | - ?> |
|
298 | + ?> |
|
299 | 299 | <?php |
300 | 300 | if (isset($globalMapQuestKey) && $globalMapQuestKey != '') { |
301 | - ?> |
|
301 | + ?> |
|
302 | 302 | <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option> |
303 | 303 | <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option> |
304 | 304 | <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option> |
305 | 305 | <?php |
306 | 306 | } |
307 | - ?> |
|
307 | + ?> |
|
308 | 308 | <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option> |
309 | 309 | <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth</option> |
310 | 310 | <?php |
311 | - } |
|
312 | - ?> |
|
311 | + } |
|
312 | + ?> |
|
313 | 313 | <?php |
314 | - if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
|
314 | + if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
|
315 | 315 | if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default'; |
316 | 316 | else $MapBoxId = $_COOKIE['MapTypeId']; |
317 | - ?> |
|
317 | + ?> |
|
318 | 318 | <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') print ' selected'; ?>>Mapbox GL</option> |
319 | 319 | <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option> |
320 | 320 | <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option> |
@@ -329,16 +329,16 @@ discard block |
||
329 | 329 | <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option> |
330 | 330 | <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option> |
331 | 331 | <?php |
332 | - } |
|
333 | - ?> |
|
332 | + } |
|
333 | + ?> |
|
334 | 334 | <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option> |
335 | 335 | <?php |
336 | 336 | } |
337 | - ?> |
|
337 | + ?> |
|
338 | 338 | </select> |
339 | 339 | </li> |
340 | 340 | <?php |
341 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d' && (!isset($globalMapOffline) || $globalMapOffline === FALSE)) { |
|
341 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d' && (!isset($globalMapOffline) || $globalMapOffline === FALSE)) { |
|
342 | 342 | ?> |
343 | 343 | <li><?php echo _("Type of Terrain:"); ?> |
344 | 344 | <select class="selectpicker" onchange="terrainType(this);"> |
@@ -349,10 +349,10 @@ discard block |
||
349 | 349 | </select> |
350 | 350 | </li> |
351 | 351 | <?php |
352 | - } |
|
352 | + } |
|
353 | 353 | ?> |
354 | 354 | <?php |
355 | - if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
355 | + if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
356 | 356 | ?> |
357 | 357 | <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if ((isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') || (!isset($_COOKIE['Map2DBuildings']))) print 'checked'; ?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li> |
358 | 358 | |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Satellites animate between updates"); ?></label></div></li> |
372 | 372 | <?php |
373 | 373 | } |
374 | - } |
|
374 | + } |
|
375 | 375 | ?> |
376 | 376 | <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li> |
377 | 377 | <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) print 'checked'; ?> ><?php echo _("Display ground station on map"); ?></label></div></li> |
@@ -383,81 +383,81 @@ discard block |
||
383 | 383 | <li><div class="checkbox"><label><input type="checkbox" name="displayfires" value="1" onclick="clickDisplayFires(this)" <?php if ((isset($_COOKIE['show_Fires']) && $_COOKIE['show_Fires'] == 'true') || (!isset($_COOKIE['show_Fires']) && (isset($globalMapFires) && $globalMapFires === TRUE))) print 'checked'; ?> ><?php echo _("Display fires on map"); ?></label></div></li> |
384 | 384 | <?php |
385 | 385 | } |
386 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
386 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
387 | 387 | ?> |
388 | 388 | <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li> |
389 | 389 | <?php |
390 | - } |
|
391 | - if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
|
390 | + } |
|
391 | + if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
|
392 | 392 | ?> |
393 | 393 | <li><div class="checkbox"><label><input type="checkbox" name="displaysanta" value="1" onclick="clickSanta(this)"><i class="fa fa-snowflake-o" aria-hidden="true"></i> <?php echo _("Show Santa Claus now"); ?> <i class="fa fa-snowflake-o" aria-hidden="true"></i></label></div></li> |
394 | 394 | <?php |
395 | - } |
|
395 | + } |
|
396 | 396 | ?> |
397 | 397 | <?php |
398 | 398 | if (function_exists('array_column')) { |
399 | - if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
|
400 | - ?> |
|
399 | + if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
|
400 | + ?> |
|
401 | 401 | <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
402 | 402 | <?php |
403 | - } |
|
403 | + } |
|
404 | 404 | } elseif (isset($globalSources)) { |
405 | - $dispolar = false; |
|
406 | - foreach ($globalSources as $testsource) { |
|
407 | - if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
408 | - } |
|
409 | - if ($dispolar) { |
|
410 | - ?> |
|
405 | + $dispolar = false; |
|
406 | + foreach ($globalSources as $testsource) { |
|
407 | + if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
408 | + } |
|
409 | + if ($dispolar) { |
|
410 | + ?> |
|
411 | 411 | <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
412 | 412 | <?php |
413 | - } |
|
414 | - } |
|
415 | - ?> |
|
413 | + } |
|
414 | + } |
|
415 | + ?> |
|
416 | 416 | <?php |
417 | - if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
417 | + if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
418 | 418 | ?> |
419 | 419 | |
420 | 420 | <?php |
421 | 421 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
422 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
423 | - ?> |
|
422 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
423 | + ?> |
|
424 | 424 | <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li> |
425 | 425 | <?php |
426 | 426 | if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') { |
427 | - ?> |
|
427 | + ?> |
|
428 | 428 | <li><?php echo _("Aircraft icon color:"); ?> |
429 | 429 | <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>"> |
430 | 430 | </li> |
431 | 431 | <?php |
432 | 432 | } |
433 | - } |
|
434 | - } |
|
435 | - ?> |
|
433 | + } |
|
434 | + } |
|
435 | + ?> |
|
436 | 436 | <?php |
437 | 437 | if (isset($globalMarine) && $globalMarine === TRUE) { |
438 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
439 | - ?> |
|
438 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
439 | + ?> |
|
440 | 440 | <li><?php echo _("Marine icon color:"); ?> |
441 | 441 | <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>"> |
442 | 442 | </li> |
443 | 443 | <?php |
444 | - } |
|
445 | - } |
|
446 | - ?> |
|
444 | + } |
|
445 | + } |
|
446 | + ?> |
|
447 | 447 | <?php |
448 | 448 | if (isset($globalTracker) && $globalTracker === TRUE) { |
449 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
450 | - ?> |
|
449 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
450 | + ?> |
|
451 | 451 | <li><?php echo _("Tracker icon color:"); ?> |
452 | 452 | <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print '1a3151'; ?>"> |
453 | 453 | </li> |
454 | 454 | <?php |
455 | - } |
|
456 | - } |
|
457 | - ?> |
|
455 | + } |
|
456 | + } |
|
457 | + ?> |
|
458 | 458 | <?php |
459 | 459 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
460 | - ?> |
|
460 | + ?> |
|
461 | 461 | <li><?php echo _("Show airport icon at zoom level:"); ?> |
462 | 462 | <div class="range"> |
463 | 463 | <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>"> |
@@ -466,9 +466,9 @@ discard block |
||
466 | 466 | </li> |
467 | 467 | <?php |
468 | 468 | } |
469 | - ?> |
|
469 | + ?> |
|
470 | 470 | <?php |
471 | - } elseif (isset($_COOKIE['MapFormat']) || $_COOKIE['MapFOrmat'] == '3d') { |
|
471 | + } elseif (isset($_COOKIE['MapFormat']) || $_COOKIE['MapFOrmat'] == '3d') { |
|
472 | 472 | ?> |
473 | 473 | <?php |
474 | 474 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | </li> |
501 | 501 | <?php |
502 | 502 | } |
503 | - } |
|
503 | + } |
|
504 | 504 | ?> |
505 | 505 | <li><?php echo _("Distance unit:"); ?> |
506 | 506 | <select class="selectpicker" onchange="unitdistance(this);"> |
@@ -533,19 +533,19 @@ discard block |
||
533 | 533 | <ul> |
534 | 534 | <?php |
535 | 535 | if (!isset($globalAircraft) || $globalAircraft) { |
536 | - ?> |
|
536 | + ?> |
|
537 | 537 | <?php |
538 | 538 | if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) { |
539 | - ?> |
|
539 | + ?> |
|
540 | 540 | <?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?> |
541 | 541 | <?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?> |
542 | 542 | <?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?> |
543 | 543 | <?php |
544 | 544 | } |
545 | - ?> |
|
545 | + ?> |
|
546 | 546 | <?php |
547 | 547 | if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) { |
548 | - ?> |
|
548 | + ?> |
|
549 | 549 | <?php if (isset($globalSBS1) && $globalSBS1) { ?> |
550 | 550 | <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li> |
551 | 551 | <?php } ?> |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | <?php } ?> |
555 | 555 | <?php |
556 | 556 | } |
557 | - ?> |
|
557 | + ?> |
|
558 | 558 | <li><?php echo _("Display airlines:"); ?> |
559 | 559 | <br/> |
560 | 560 | <select class="selectpicker" multiple onchange="airlines(this);" id="display_airlines"> |
@@ -574,14 +574,14 @@ discard block |
||
574 | 574 | echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>'; |
575 | 575 | } |
576 | 576 | } |
577 | - ?> |
|
577 | + ?> |
|
578 | 578 | </select> |
579 | 579 | </li> |
580 | 580 | <?php |
581 | 581 | $Spotter = new Spotter(); |
582 | 582 | $allalliancenames = $Spotter->getAllAllianceNames(); |
583 | 583 | if (!empty($allalliancenames)) { |
584 | - ?> |
|
584 | + ?> |
|
585 | 585 | <li><?php echo _("Display alliance:"); ?> |
586 | 586 | <br/> |
587 | 587 | <select class="selectpicker" onchange="alliance(this);" id="display_alliance"> |
@@ -595,18 +595,18 @@ discard block |
||
595 | 595 | echo '<option value="'.$alliance_name.'">'.$alliance_name.'</option>'; |
596 | 596 | } |
597 | 597 | } |
598 | - ?> |
|
598 | + ?> |
|
599 | 599 | </select> |
600 | 600 | </li> |
601 | 601 | <?php |
602 | 602 | } |
603 | - ?> |
|
603 | + ?> |
|
604 | 604 | <?php |
605 | 605 | } |
606 | - ?> |
|
606 | + ?> |
|
607 | 607 | <?php |
608 | 608 | if (isset($globalAPRS) && $globalAPRS) { |
609 | - ?> |
|
609 | + ?> |
|
610 | 610 | <li><?php echo _("Display APRS sources name:"); ?> |
611 | 611 | <select class="selectpicker" multiple onchange="sources(this);"> |
612 | 612 | <?php |
@@ -630,18 +630,18 @@ discard block |
||
630 | 630 | echo '<option value="'.$src['name'].'">'.$src['name'].'</option>'; |
631 | 631 | } |
632 | 632 | } |
633 | - ?> |
|
633 | + ?> |
|
634 | 634 | </select> |
635 | 635 | </li> |
636 | 636 | <?php |
637 | 637 | } |
638 | - ?> |
|
638 | + ?> |
|
639 | 639 | <?php |
640 | 640 | if (!isset($globalAircraft) || $globalAircraft) { |
641 | - ?> |
|
641 | + ?> |
|
642 | 642 | <?php |
643 | - if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) { |
|
644 | - ?> |
|
643 | + if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) { |
|
644 | + ?> |
|
645 | 645 | <li><?php echo _("Display airlines of type:"); ?><br/> |
646 | 646 | <select class="selectpicker" onchange="airlinestype(this);"> |
647 | 647 | <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
@@ -651,21 +651,21 @@ discard block |
||
651 | 651 | </select> |
652 | 652 | </li> |
653 | 653 | <?php |
654 | - } |
|
655 | - ?> |
|
654 | + } |
|
655 | + ?> |
|
656 | 656 | <?php |
657 | 657 | } |
658 | - ?> |
|
658 | + ?> |
|
659 | 659 | <?php |
660 | 660 | if (isset($globalMarine) && $globalMarine) { |
661 | - ?> |
|
661 | + ?> |
|
662 | 662 | <li> |
663 | 663 | <?php echo _("Display vessels with MMSI:"); ?> |
664 | 664 | <input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) print $_COOKIE['filter_mmsi']; ?>" /> |
665 | 665 | </li> |
666 | 666 | <?php |
667 | 667 | } |
668 | - ?> |
|
668 | + ?> |
|
669 | 669 | <li> |
670 | 670 | <?php echo _("Display with ident:"); ?> |
671 | 671 | <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" /> |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | </form> |
679 | 679 | </div> |
680 | 680 | <?php |
681 | - if (isset($globalSatellite) && $globalSatellite) { |
|
681 | + if (isset($globalSatellite) && $globalSatellite) { |
|
682 | 682 | ?> |
683 | 683 | <div class="sidebar-pane" id="satellites"> |
684 | 684 | <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
@@ -718,14 +718,14 @@ discard block |
||
718 | 718 | print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>'; |
719 | 719 | } |
720 | 720 | } |
721 | - ?> |
|
721 | + ?> |
|
722 | 722 | </select> |
723 | 723 | </li> |
724 | 724 | </ul> |
725 | 725 | </form> |
726 | 726 | </div> |
727 | 727 | <?php |
728 | - } |
|
728 | + } |
|
729 | 729 | ?> |
730 | 730 | </div> |
731 | 731 | </div> |
@@ -13,11 +13,11 @@ discard block |
||
13 | 13 | } |
14 | 14 | |
15 | 15 | /** |
16 | - * Gets the images based on the aircraft registration |
|
17 | - * |
|
18 | - * @return Array the images list |
|
19 | - * |
|
20 | - */ |
|
16 | + * Gets the images based on the aircraft registration |
|
17 | + * |
|
18 | + * @return Array the images list |
|
19 | + * |
|
20 | + */ |
|
21 | 21 | public function getSpotterImage($registration,$aircraft_icao = '', $airline_icao = '') |
22 | 22 | { |
23 | 23 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -38,11 +38,11 @@ discard block |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
41 | - * Gets the images based on the ship name |
|
42 | - * |
|
43 | - * @return Array the images list |
|
44 | - * |
|
45 | - */ |
|
41 | + * Gets the images based on the ship name |
|
42 | + * |
|
43 | + * @return Array the images list |
|
44 | + * |
|
45 | + */ |
|
46 | 46 | public function getMarineImage($mmsi,$imo = '',$name = '') |
47 | 47 | { |
48 | 48 | $mmsi = filter_var($mmsi,FILTER_SANITIZE_STRING); |
@@ -69,11 +69,11 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
72 | - * Gets the image copyright based on the Exif data |
|
73 | - * |
|
74 | - * @return String image copyright |
|
75 | - * |
|
76 | - */ |
|
72 | + * Gets the image copyright based on the Exif data |
|
73 | + * |
|
74 | + * @return String image copyright |
|
75 | + * |
|
76 | + */ |
|
77 | 77 | public function getExifCopyright($url) { |
78 | 78 | $exif = exif_read_data($url); |
79 | 79 | $copyright = ''; |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
91 | - * Adds the images based on the aircraft registration |
|
92 | - * |
|
93 | - * @return String either success or error |
|
94 | - * |
|
95 | - */ |
|
91 | + * Adds the images based on the aircraft registration |
|
92 | + * |
|
93 | + * @return String either success or error |
|
94 | + * |
|
95 | + */ |
|
96 | 96 | public function addSpotterImage($registration,$aircraft_icao = '', $airline_icao = '') |
97 | 97 | { |
98 | 98 | global $globalDebug,$globalAircraftImageFetch, $globalOffline; |
@@ -120,11 +120,11 @@ discard block |
||
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
123 | - * Adds the images based on the marine name |
|
124 | - * |
|
125 | - * @return String either success or error |
|
126 | - * |
|
127 | - */ |
|
123 | + * Adds the images based on the marine name |
|
124 | + * |
|
125 | + * @return String either success or error |
|
126 | + * |
|
127 | + */ |
|
128 | 128 | public function addMarineImage($mmsi,$imo = '',$name = '') |
129 | 129 | { |
130 | 130 | global $globalDebug,$globalMarineImageFetch, $globalOffline; |
@@ -161,12 +161,12 @@ discard block |
||
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
164 | - * Gets the aircraft image |
|
165 | - * |
|
166 | - * @param String $aircraft_registration the registration of the aircraft |
|
167 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
168 | - * |
|
169 | - */ |
|
164 | + * Gets the aircraft image |
|
165 | + * |
|
166 | + * @param String $aircraft_registration the registration of the aircraft |
|
167 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
168 | + * |
|
169 | + */ |
|
170 | 170 | public function findAircraftImage($aircraft_registration, $aircraft_icao = '', $airline_icao = '') |
171 | 171 | { |
172 | 172 | global $globalAircraftImageSources, $globalIVAO, $globalAircraftImageCheckICAO, $globalVA; |
@@ -210,14 +210,14 @@ discard block |
||
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
213 | - * Gets the vessel image |
|
214 | - * |
|
215 | - * @param String $mmsi the vessel mmsi |
|
216 | - * @param String $imo the vessel imo |
|
217 | - * @param String $name the vessel name |
|
218 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
219 | - * |
|
220 | - */ |
|
213 | + * Gets the vessel image |
|
214 | + * |
|
215 | + * @param String $mmsi the vessel mmsi |
|
216 | + * @param String $imo the vessel imo |
|
217 | + * @param String $name the vessel name |
|
218 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
219 | + * |
|
220 | + */ |
|
221 | 221 | public function findMarineImage($mmsi,$imo = '',$name = '') |
222 | 222 | { |
223 | 223 | global $globalMarineImageSources; |
@@ -251,13 +251,13 @@ discard block |
||
251 | 251 | } |
252 | 252 | |
253 | 253 | /** |
254 | - * Gets the aircraft image from Planespotters |
|
255 | - * |
|
256 | - * @param String $aircraft_registration the registration of the aircraft |
|
257 | - * @param String $aircraft_name type of the aircraft |
|
258 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
259 | - * |
|
260 | - */ |
|
254 | + * Gets the aircraft image from Planespotters |
|
255 | + * |
|
256 | + * @param String $aircraft_registration the registration of the aircraft |
|
257 | + * @param String $aircraft_name type of the aircraft |
|
258 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
259 | + * |
|
260 | + */ |
|
261 | 261 | public function fromPlanespotters($type,$aircraft_registration, $aircraft_name='') { |
262 | 262 | $Common = new Common(); |
263 | 263 | // If aircraft registration is only number, also check with aircraft model |
@@ -285,13 +285,13 @@ discard block |
||
285 | 285 | } |
286 | 286 | |
287 | 287 | /** |
288 | - * Gets the aircraft image from Deviantart |
|
289 | - * |
|
290 | - * @param String $registration the registration of the aircraft |
|
291 | - * @param String $name type of the aircraft |
|
292 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
293 | - * |
|
294 | - */ |
|
288 | + * Gets the aircraft image from Deviantart |
|
289 | + * |
|
290 | + * @param String $registration the registration of the aircraft |
|
291 | + * @param String $name type of the aircraft |
|
292 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
293 | + * |
|
294 | + */ |
|
295 | 295 | public function fromDeviantart($type,$registration, $name='') { |
296 | 296 | $Common = new Common(); |
297 | 297 | if ($type == 'aircraft') { |
@@ -325,13 +325,13 @@ discard block |
||
325 | 325 | } |
326 | 326 | |
327 | 327 | /** |
328 | - * Gets the aircraft image from JetPhotos |
|
329 | - * |
|
330 | - * @param String $aircraft_registration the registration of the aircraft |
|
331 | - * @param String $aircraft_name type of the aircraft |
|
332 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
333 | - * |
|
334 | - */ |
|
328 | + * Gets the aircraft image from JetPhotos |
|
329 | + * |
|
330 | + * @param String $aircraft_registration the registration of the aircraft |
|
331 | + * @param String $aircraft_name type of the aircraft |
|
332 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
333 | + * |
|
334 | + */ |
|
335 | 335 | public function fromJetPhotos($type,$aircraft_registration, $aircraft_name='') { |
336 | 336 | $Common = new Common(); |
337 | 337 | $url= 'http://jetphotos.net/showphotos.php?displaymode=2®search='.$aircraft_registration; |
@@ -367,13 +367,13 @@ discard block |
||
367 | 367 | } |
368 | 368 | |
369 | 369 | /** |
370 | - * Gets the aircraft image from PlanePictures |
|
371 | - * |
|
372 | - * @param String $aircraft_registration the registration of the aircraft |
|
373 | - * @param String $aircraft_name type of the aircraft |
|
374 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
375 | - * |
|
376 | - */ |
|
370 | + * Gets the aircraft image from PlanePictures |
|
371 | + * |
|
372 | + * @param String $aircraft_registration the registration of the aircraft |
|
373 | + * @param String $aircraft_name type of the aircraft |
|
374 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
375 | + * |
|
376 | + */ |
|
377 | 377 | public function fromPlanePictures($type,$aircraft_registration, $aircraft_name='') { |
378 | 378 | $Common = new Common(); |
379 | 379 | $url= 'http://www.planepictures.net/netsearch4.cgi?srch='.$aircraft_registration.'&stype=reg&srng=2'; |
@@ -401,13 +401,13 @@ discard block |
||
401 | 401 | } |
402 | 402 | |
403 | 403 | /** |
404 | - * Gets the aircraft image from Flickr |
|
405 | - * |
|
406 | - * @param String $registration the registration of the aircraft |
|
407 | - * @param String $name type of the aircraft |
|
408 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
409 | - * |
|
410 | - */ |
|
404 | + * Gets the aircraft image from Flickr |
|
405 | + * |
|
406 | + * @param String $registration the registration of the aircraft |
|
407 | + * @param String $name type of the aircraft |
|
408 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
409 | + * |
|
410 | + */ |
|
411 | 411 | public function fromFlickr($type,$registration,$name='') { |
412 | 412 | $Common = new Common(); |
413 | 413 | if ($type == 'aircraft') { |
@@ -451,13 +451,13 @@ discard block |
||
451 | 451 | } |
452 | 452 | |
453 | 453 | /** |
454 | - * Gets the aircraft image from Bing |
|
455 | - * |
|
456 | - * @param String $aircraft_registration the registration of the aircraft |
|
457 | - * @param String $aircraft_name type of the aircraft |
|
458 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
459 | - * |
|
460 | - */ |
|
454 | + * Gets the aircraft image from Bing |
|
455 | + * |
|
456 | + * @param String $aircraft_registration the registration of the aircraft |
|
457 | + * @param String $aircraft_name type of the aircraft |
|
458 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
459 | + * |
|
460 | + */ |
|
461 | 461 | public function fromBing($type,$aircraft_registration,$aircraft_name='') { |
462 | 462 | global $globalImageBingKey; |
463 | 463 | $Common = new Common(); |
@@ -488,13 +488,13 @@ discard block |
||
488 | 488 | } |
489 | 489 | |
490 | 490 | /** |
491 | - * Gets the aircraft image from airport-data |
|
492 | - * |
|
493 | - * @param String $aircraft_registration the registration of the aircraft |
|
494 | - * @param String $aircraft_name type of the aircraft |
|
495 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
496 | - * |
|
497 | - */ |
|
491 | + * Gets the aircraft image from airport-data |
|
492 | + * |
|
493 | + * @param String $aircraft_registration the registration of the aircraft |
|
494 | + * @param String $aircraft_name type of the aircraft |
|
495 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
496 | + * |
|
497 | + */ |
|
498 | 498 | public function fromAirportData($type,$aircraft_registration,$aircraft_name='') { |
499 | 499 | $Common = new Common(); |
500 | 500 | $url = 'http://www.airport-data.com/api/ac_thumb.json?&n=1&r='.$aircraft_registration; |
@@ -513,13 +513,13 @@ discard block |
||
513 | 513 | } |
514 | 514 | |
515 | 515 | /** |
516 | - * Gets image from WikiMedia |
|
517 | - * |
|
518 | - * @param String $registration the registration of the aircraft/mmsi |
|
519 | - * @param String $name name |
|
520 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
521 | - * |
|
522 | - */ |
|
516 | + * Gets image from WikiMedia |
|
517 | + * |
|
518 | + * @param String $registration the registration of the aircraft/mmsi |
|
519 | + * @param String $name name |
|
520 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
521 | + * |
|
522 | + */ |
|
523 | 523 | public function fromWikimedia($type,$registration,$name='') { |
524 | 524 | $Common = new Common(); |
525 | 525 | if ($type == 'aircraft') { |
@@ -574,13 +574,13 @@ discard block |
||
574 | 574 | } |
575 | 575 | |
576 | 576 | /** |
577 | - * Gets the aircraft image from custom url |
|
578 | - * |
|
579 | - * @param String $registration the registration of the aircraft |
|
580 | - * @param String $name type of the aircraft |
|
581 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
582 | - * |
|
583 | - */ |
|
577 | + * Gets the aircraft image from custom url |
|
578 | + * |
|
579 | + * @param String $registration the registration of the aircraft |
|
580 | + * @param String $name type of the aircraft |
|
581 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
582 | + * |
|
583 | + */ |
|
584 | 584 | public function fromCustomSource($type,$registration,$name='') { |
585 | 585 | global $globalAircraftImageCustomSources, $globalMarineImageCustomSources, $globalDebug; |
586 | 586 | //$globalAircraftImageCustomSource[] = array('thumbnail' => '','original' => '', 'copyright' => '', 'source_website' => '', 'source' => '','exif' => true); |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | }; |
376 | 376 | |
377 | 377 | <?php |
378 | - if (isset($globalTSK) && $globalTSK && isset($_GET['tsk'])) { |
|
378 | + if (isset($globalTSK) && $globalTSK && isset($_GET['tsk'])) { |
|
379 | 379 | ?> |
380 | 380 | function tskPopup (feature, layer) { |
381 | 381 | var output = ''; |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | }; |
411 | 411 | update_tsk(); |
412 | 412 | <?php |
413 | - } |
|
413 | + } |
|
414 | 414 | ?> |
415 | 415 | map.on('moveend', function() { |
416 | 416 | //if (map.getZoom() > 7) { |
@@ -426,10 +426,10 @@ discard block |
||
426 | 426 | setInterval(function(){if (noTimeout) update_locationsLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
427 | 427 | |
428 | 428 | <?php |
429 | - // Add support for custom json via $globalMapJson |
|
430 | - if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
429 | + // Add support for custom json via $globalMapJson |
|
430 | + if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
431 | 431 | foreach ($globalMapJson as $json) { |
432 | - if (isset($json['url'])) { |
|
432 | + if (isset($json['url'])) { |
|
433 | 433 | ?> |
434 | 434 | update_genLayer('<?php print $json['url']; ?>'); |
435 | 435 | <?php |
@@ -438,9 +438,9 @@ discard block |
||
438 | 438 | setInterval(function(){if (noTimeout) update_genLayer('<?php print $json['url']; ?>')}, <?php print $json['refresh']; ?>); |
439 | 439 | <?php |
440 | 440 | } |
441 | - } |
|
441 | + } |
|
442 | + } |
|
442 | 443 | } |
443 | - } |
|
444 | 444 | |
445 | 445 | ?> |
446 | 446 | //adds the bootstrap tooltip to the map icons |
@@ -14,35 +14,35 @@ discard block |
||
14 | 14 | public $db; |
15 | 15 | |
16 | 16 | protected $texts = Array( |
17 | - 'MI' => 'Shallow', |
|
18 | - 'PR' => 'Partial', |
|
19 | - 'BC' => 'Low drifting', |
|
20 | - 'BL' => 'Blowing', |
|
21 | - 'SH' => 'Showers', |
|
22 | - 'TS' => 'Thunderstorm', |
|
23 | - 'FZ' => 'Freezing', |
|
24 | - 'DZ' => 'Drizzle', |
|
25 | - 'RA' => 'Rain', |
|
26 | - 'SN' => 'Snow', |
|
27 | - 'SG' => 'Snow Grains', |
|
28 | - 'IC' => 'Ice crystals', |
|
29 | - 'PL' => 'Ice pellets', |
|
30 | - 'GR' => 'Hail', |
|
31 | - 'GS' => 'Small hail', |
|
32 | - 'UP' => 'Unknown', |
|
33 | - 'BR' => 'Mist', |
|
34 | - 'FG' => 'Fog', |
|
35 | - 'FU' => 'Smoke', |
|
36 | - 'VA' => 'Volcanic ash', |
|
37 | - 'DU' => 'Widespread dust', |
|
38 | - 'SA' => 'Sand', |
|
39 | - 'HZ' => 'Haze', |
|
40 | - 'PY' => 'Spray', |
|
41 | - 'PO' => 'Well developed dust / sand whirls', |
|
42 | - 'SQ' => 'Squalls', |
|
43 | - 'FC' => 'Funnel clouds inc tornadoes or waterspouts', |
|
44 | - 'SS' => 'Sandstorm', |
|
45 | - 'DS' => 'Duststorm' |
|
17 | + 'MI' => 'Shallow', |
|
18 | + 'PR' => 'Partial', |
|
19 | + 'BC' => 'Low drifting', |
|
20 | + 'BL' => 'Blowing', |
|
21 | + 'SH' => 'Showers', |
|
22 | + 'TS' => 'Thunderstorm', |
|
23 | + 'FZ' => 'Freezing', |
|
24 | + 'DZ' => 'Drizzle', |
|
25 | + 'RA' => 'Rain', |
|
26 | + 'SN' => 'Snow', |
|
27 | + 'SG' => 'Snow Grains', |
|
28 | + 'IC' => 'Ice crystals', |
|
29 | + 'PL' => 'Ice pellets', |
|
30 | + 'GR' => 'Hail', |
|
31 | + 'GS' => 'Small hail', |
|
32 | + 'UP' => 'Unknown', |
|
33 | + 'BR' => 'Mist', |
|
34 | + 'FG' => 'Fog', |
|
35 | + 'FU' => 'Smoke', |
|
36 | + 'VA' => 'Volcanic ash', |
|
37 | + 'DU' => 'Widespread dust', |
|
38 | + 'SA' => 'Sand', |
|
39 | + 'HZ' => 'Haze', |
|
40 | + 'PY' => 'Spray', |
|
41 | + 'PO' => 'Well developed dust / sand whirls', |
|
42 | + 'SQ' => 'Squalls', |
|
43 | + 'FC' => 'Funnel clouds inc tornadoes or waterspouts', |
|
44 | + 'SS' => 'Sandstorm', |
|
45 | + 'DS' => 'Duststorm' |
|
46 | 46 | ); |
47 | 47 | |
48 | 48 | /* |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $result['QNH_format'] = $matches[1] == 'Q' ? 'hPa' : 'inHg'; |
178 | 178 | */ |
179 | 179 | } |
180 | - /* |
|
180 | + /* |
|
181 | 181 | // Wind Direction |
182 | 182 | if (preg_match('#^([0-9]{3})V([0-9]{3})$#', $piece, $matches)) { |
183 | 183 | $result['wind_direction'] = $matches[1]; |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $result['speed_variable'] = $matches[1]; |
189 | 189 | } |
190 | 190 | */ |
191 | - // Visibility |
|
191 | + // Visibility |
|
192 | 192 | if (preg_match('#^([0-9]{4})|(([0-9]{1,4})SM)$#', $piece, $matches)) { |
193 | 193 | if (isset($matches[3]) && strlen($matches[3]) > 0) { |
194 | 194 | $result['visibility'] = (float)$matches[3] * 1609.34; |
@@ -246,9 +246,9 @@ discard block |
||
246 | 246 | else $range = array('exact' => (float)$matches[2], 'unit' => 'M'); |
247 | 247 | if (isset($matches[3])) { |
248 | 248 | $range = Array( |
249 | - 'from' => (float)$matches[2], |
|
250 | - 'to' => (float)$matches[4], |
|
251 | - 'unit' => $matches[5] ? 'FT' : 'M' |
|
249 | + 'from' => (float)$matches[2], |
|
250 | + 'to' => (float)$matches[4], |
|
251 | + 'unit' => $matches[5] ? 'FT' : 'M' |
|
252 | 252 | ); |
253 | 253 | } |
254 | 254 | $result['RVR'] = $matches[1]; |
@@ -7,16 +7,16 @@ discard block |
||
7 | 7 | require_once(dirname(__FILE__).'/class.Source.php'); |
8 | 8 | |
9 | 9 | class TrackerImport { |
10 | - private $all_tracked = array(); |
|
11 | - private $last_delete_hourly = 0; |
|
12 | - private $last_delete = 0; |
|
13 | - private $stats = array(); |
|
14 | - private $tmd = 0; |
|
15 | - private $source_location = array(); |
|
16 | - public $db = null; |
|
17 | - public $nb = 0; |
|
10 | + private $all_tracked = array(); |
|
11 | + private $last_delete_hourly = 0; |
|
12 | + private $last_delete = 0; |
|
13 | + private $stats = array(); |
|
14 | + private $tmd = 0; |
|
15 | + private $source_location = array(); |
|
16 | + public $db = null; |
|
17 | + public $nb = 0; |
|
18 | 18 | |
19 | - public function __construct($dbc = null) { |
|
19 | + public function __construct($dbc = null) { |
|
20 | 20 | global $globalBeta; |
21 | 21 | $Connection = new Connection($dbc); |
22 | 22 | $this->db = $Connection->db(); |
@@ -38,50 +38,50 @@ discard block |
||
38 | 38 | } |
39 | 39 | } |
40 | 40 | */ |
41 | - } |
|
41 | + } |
|
42 | 42 | |
43 | - public function checkAll() { |
|
43 | + public function checkAll() { |
|
44 | 44 | global $globalDebug; |
45 | 45 | if ($globalDebug) echo "Update last seen tracked data...\n"; |
46 | 46 | foreach ($this->all_tracked as $key => $flight) { |
47 | - if (isset($this->all_tracked[$key]['id'])) { |
|
47 | + if (isset($this->all_tracked[$key]['id'])) { |
|
48 | 48 | //echo $this->all_tracked[$key]['id'].' - '.$this->all_tracked[$key]['latitude'].' '.$this->all_tracked[$key]['longitude']."\n"; |
49 | - $Tracker = new Tracker($this->db); |
|
50 | - $Tracker->updateLatestTrackerData($this->all_tracked[$key]['id'],$this->all_tracked[$key]['ident'],$this->all_tracked[$key]['latitude'],$this->all_tracked[$key]['longitude'],$this->all_tracked[$key]['altitude'],$this->all_tracked[$key]['speed'],$this->all_tracked[$key]['datetime']); |
|
51 | - } |
|
49 | + $Tracker = new Tracker($this->db); |
|
50 | + $Tracker->updateLatestTrackerData($this->all_tracked[$key]['id'],$this->all_tracked[$key]['ident'],$this->all_tracked[$key]['latitude'],$this->all_tracked[$key]['longitude'],$this->all_tracked[$key]['altitude'],$this->all_tracked[$key]['speed'],$this->all_tracked[$key]['datetime']); |
|
51 | + } |
|
52 | + } |
|
52 | 53 | } |
53 | - } |
|
54 | 54 | |
55 | - public function del() { |
|
55 | + public function del() { |
|
56 | 56 | global $globalDebug; |
57 | 57 | // Delete old infos |
58 | 58 | if ($globalDebug) echo 'Delete old values and update latest data...'."\n"; |
59 | 59 | foreach ($this->all_tracked as $key => $flight) { |
60 | - if (isset($flight['lastupdate'])) { |
|
61 | - if ($flight['lastupdate'] < (time()-3000)) { |
|
62 | - if (isset($this->all_tracked[$key]['id'])) { |
|
63 | - if ($globalDebug) echo "--- Delete old values with id ".$this->all_tracked[$key]['id']."\n"; |
|
60 | + if (isset($flight['lastupdate'])) { |
|
61 | + if ($flight['lastupdate'] < (time()-3000)) { |
|
62 | + if (isset($this->all_tracked[$key]['id'])) { |
|
63 | + if ($globalDebug) echo "--- Delete old values with id ".$this->all_tracked[$key]['id']."\n"; |
|
64 | 64 | /* |
65 | 65 | $TrackerLive = new TrackerLive(); |
66 | 66 | $TrackerLive->deleteLiveTrackerDataById($this->all_tracked[$key]['id']); |
67 | 67 | $TrackerLive->db = null; |
68 | 68 | */ |
69 | - //$real_arrival = $this->arrival($key); |
|
70 | - $Tracker = new Tracker($this->db); |
|
71 | - if ($this->all_tracked[$key]['latitude'] != '' && $this->all_tracked[$key]['longitude'] != '') { |
|
69 | + //$real_arrival = $this->arrival($key); |
|
70 | + $Tracker = new Tracker($this->db); |
|
71 | + if ($this->all_tracked[$key]['latitude'] != '' && $this->all_tracked[$key]['longitude'] != '') { |
|
72 | 72 | $result = $Tracker->updateLatestTrackerData($this->all_tracked[$key]['id'],$this->all_tracked[$key]['ident'],$this->all_tracked[$key]['latitude'],$this->all_tracked[$key]['longitude'],$this->all_tracked[$key]['altitude'],$this->all_tracked[$key]['speed']); |
73 | 73 | if ($globalDebug && $result != 'success') echo '!!! ERROR : '.$result."\n"; |
74 | 74 | } |
75 | 75 | // Put in archive |
76 | 76 | // $Tracker->db = null; |
77 | - } |
|
78 | - unset($this->all_tracked[$key]); |
|
79 | - } |
|
80 | - } |
|
81 | - } |
|
82 | - } |
|
77 | + } |
|
78 | + unset($this->all_tracked[$key]); |
|
79 | + } |
|
80 | + } |
|
81 | + } |
|
82 | + } |
|
83 | 83 | |
84 | - public function add($line) { |
|
84 | + public function add($line) { |
|
85 | 85 | global $globalFork, $globalDistanceIgnore, $globalDaemon, $globalDebug, $globalCoordMinChangeTracker, $globalDebugTimeElapsed, $globalCenterLatitude, $globalCenterLongitude, $globalBeta, $globalSourcesupdate, $globalAllTracked; |
86 | 86 | if (!isset($globalCoordMinChangeTracker) || $globalCoordMinChangeTracker == '') $globalCoordMinChangeTracker = '0.015'; |
87 | 87 | date_default_timezone_set('UTC'); |
@@ -90,47 +90,47 @@ discard block |
||
90 | 90 | |
91 | 91 | // SBS format is CSV format |
92 | 92 | if(is_array($line) && isset($line['ident'])) { |
93 | - //print_r($line); |
|
94 | - if (isset($line['ident'])) { |
|
93 | + //print_r($line); |
|
94 | + if (isset($line['ident'])) { |
|
95 | 95 | |
96 | 96 | |
97 | 97 | // Increment message number |
98 | 98 | if (isset($line['sourcestats']) && $line['sourcestats'] == TRUE) { |
99 | - $current_date = date('Y-m-d'); |
|
100 | - if (isset($line['source_name'])) $source = $line['source_name']; |
|
101 | - else $source = ''; |
|
102 | - if ($source == '' || $line['format_source'] == 'aprs') $source = $line['format_source']; |
|
103 | - if (!isset($this->stats[$current_date][$source]['msg'])) { |
|
104 | - $this->stats[$current_date][$source]['msg']['date'] = time(); |
|
105 | - $this->stats[$current_date][$source]['msg']['nb'] = 1; |
|
106 | - } else $this->stats[$current_date][$source]['msg']['nb'] += 1; |
|
99 | + $current_date = date('Y-m-d'); |
|
100 | + if (isset($line['source_name'])) $source = $line['source_name']; |
|
101 | + else $source = ''; |
|
102 | + if ($source == '' || $line['format_source'] == 'aprs') $source = $line['format_source']; |
|
103 | + if (!isset($this->stats[$current_date][$source]['msg'])) { |
|
104 | + $this->stats[$current_date][$source]['msg']['date'] = time(); |
|
105 | + $this->stats[$current_date][$source]['msg']['nb'] = 1; |
|
106 | + } else $this->stats[$current_date][$source]['msg']['nb'] += 1; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | |
110 | 110 | $Common = new Common(); |
111 | - if (!isset($line['id'])) $id = trim($line['ident']); |
|
112 | - else $id = trim($line['id']); |
|
111 | + if (!isset($line['id'])) $id = trim($line['ident']); |
|
112 | + else $id = trim($line['id']); |
|
113 | 113 | |
114 | 114 | if (!isset($this->all_tracked[$id])) { |
115 | - $this->all_tracked[$id] = array(); |
|
116 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('addedTracker' => 0)); |
|
117 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('ident' => '','latitude' => '', 'longitude' => '', 'speed' => '', 'altitude' => '', 'heading' => '', 'format_source' => '','source_name' => '','comment'=> '','type' => '','noarchive' => false,'putinarchive' => true,'over_country' => '')); |
|
118 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('lastupdate' => time())); |
|
119 | - if (!isset($line['id'])) { |
|
115 | + $this->all_tracked[$id] = array(); |
|
116 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('addedTracker' => 0)); |
|
117 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('ident' => '','latitude' => '', 'longitude' => '', 'speed' => '', 'altitude' => '', 'heading' => '', 'format_source' => '','source_name' => '','comment'=> '','type' => '','noarchive' => false,'putinarchive' => true,'over_country' => '')); |
|
118 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('lastupdate' => time())); |
|
119 | + if (!isset($line['id'])) { |
|
120 | 120 | if (!isset($globalDaemon)) $globalDaemon = TRUE; |
121 | 121 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $id.'-'.date('YmdHi'))); |
122 | - } else $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $line['id'])); |
|
123 | - if ($globalAllTracked !== FALSE) $dataFound = true; |
|
122 | + } else $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $line['id'])); |
|
123 | + if ($globalAllTracked !== FALSE) $dataFound = true; |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | if (isset($line['datetime']) && strtotime($line['datetime']) > time()-20*60 && strtotime($line['datetime']) < time()+20*60) { |
127 | - if (!isset($this->all_tracked[$id]['datetime']) || strtotime($line['datetime']) >= strtotime($this->all_tracked[$id]['datetime'])) { |
|
127 | + if (!isset($this->all_tracked[$id]['datetime']) || strtotime($line['datetime']) >= strtotime($this->all_tracked[$id]['datetime'])) { |
|
128 | 128 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('datetime' => $line['datetime'])); |
129 | - } else { |
|
129 | + } else { |
|
130 | 130 | if (strtotime($line['datetime']) == strtotime($this->all_tracked[$id]['datetime']) && $globalDebug) echo "!!! Date is the same as previous data for ".$this->all_tracked[$id]['ident']." - format : ".$line['format_source']."\n"; |
131 | 131 | elseif (strtotime($line['datetime']) > strtotime($this->all_tracked[$id]['datetime']) && $globalDebug) echo "!!! Date previous latest data (".$line['datetime']." > ".$this->all_tracked[$id]['datetime'].") !!! for ".$this->all_tracked[$id]['ident']." - format : ".$line['format_source']."\n"; |
132 | 132 | return ''; |
133 | - } |
|
133 | + } |
|
134 | 134 | } elseif (isset($line['datetime']) && strtotime($line['datetime']) < time()-20*60) { |
135 | 135 | if ($globalDebug) echo "!!! Date is too old ".$this->all_tracked[$id]['ident']." - format : ".$line['format_source']."!!!\n"; |
136 | 136 | return ''; |
@@ -147,38 +147,38 @@ discard block |
||
147 | 147 | |
148 | 148 | //if (isset($line['ident']) && $line['ident'] != '' && $line['ident'] != '????????' && $line['ident'] != '00000000' && ($this->all_tracked[$id]['ident'] != trim($line['ident'])) && preg_match('/^[a-zA-Z0-9-]+$/', $line['ident'])) { |
149 | 149 | if (isset($line['ident']) && $line['ident'] != '' && $line['ident'] != '????????' && $line['ident'] != '00000000' && ($this->all_tracked[$id]['ident'] != trim($line['ident']))) { |
150 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('ident' => trim($line['ident']))); |
|
151 | - if ($this->all_tracked[$id]['addedTracker'] == 1) { |
|
150 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('ident' => trim($line['ident']))); |
|
151 | + if ($this->all_tracked[$id]['addedTracker'] == 1) { |
|
152 | 152 | $timeelapsed = microtime(true); |
153 | - $Tracker = new Tracker($this->db); |
|
154 | - $fromsource = NULL; |
|
155 | - $result = $Tracker->updateIdentTrackerData($this->all_tracked[$id]['id'],$this->all_tracked[$id]['ident'],$fromsource); |
|
153 | + $Tracker = new Tracker($this->db); |
|
154 | + $fromsource = NULL; |
|
155 | + $result = $Tracker->updateIdentTrackerData($this->all_tracked[$id]['id'],$this->all_tracked[$id]['ident'],$fromsource); |
|
156 | 156 | if ($globalDebug && $result != 'success') echo '!!! ERROR : '.$result."\n"; |
157 | 157 | $Tracker->db = null; |
158 | 158 | if ($globalDebugTimeElapsed) echo 'Time elapsed for update identspotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
159 | - } |
|
160 | - if (!isset($this->all_tracked[$id]['id'])) $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $this->all_tracked[$id]['ident'])); |
|
159 | + } |
|
160 | + if (!isset($this->all_tracked[$id]['id'])) $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $this->all_tracked[$id]['ident'])); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | if (isset($line['speed']) && $line['speed'] != '') { |
164 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('speed' => round($line['speed']))); |
|
165 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('speed_fromsrc' => true)); |
|
164 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('speed' => round($line['speed']))); |
|
165 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('speed_fromsrc' => true)); |
|
166 | 166 | } else if (!isset($this->all_tracked[$id]['speed_fromsrc']) && isset($this->all_tracked[$id]['time_last_coord']) && $this->all_tracked[$id]['time_last_coord'] != time() && isset($line['latitude']) && isset($line['longitude'])) { |
167 | - $distance = $Common->distance($line['latitude'],$line['longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],'m'); |
|
168 | - if ($distance > 100 && $distance < 10000) { |
|
167 | + $distance = $Common->distance($line['latitude'],$line['longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],'m'); |
|
168 | + if ($distance > 100 && $distance < 10000) { |
|
169 | 169 | $speed = $distance/(time() - $this->all_tracked[$id]['time_last_coord']); |
170 | 170 | $speed = $speed*3.6; |
171 | 171 | if ($speed < 1000) $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('speed' => round($speed))); |
172 | 172 | if ($globalDebug) echo "ø Calculated Speed for ".$this->all_tracked[$id]['ident']." : ".$speed." - distance : ".$distance."\n"; |
173 | - } |
|
173 | + } |
|
174 | 174 | } |
175 | 175 | |
176 | - if (isset($line['latitude']) && isset($line['longitude']) && $line['latitude'] != '' && $line['longitude'] != '' && is_numeric($line['latitude']) && is_numeric($line['longitude'])) { |
|
177 | - if (isset($this->all_tracked[$id]['time_last_coord'])) $timediff = round(time()-$this->all_tracked[$id]['time_last_coord']); |
|
178 | - else unset($timediff); |
|
179 | - if ($this->tmd > 5 || !isset($timediff) || $timediff > 90 || ($timediff > 30 && isset($this->all_tracked[$id]['latitude']) && isset($this->all_tracked[$id]['longitude']) && $Common->withinThreshold($timediff,$Common->distance($line['latitude'],$line['longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],'m')))) { |
|
176 | + if (isset($line['latitude']) && isset($line['longitude']) && $line['latitude'] != '' && $line['longitude'] != '' && is_numeric($line['latitude']) && is_numeric($line['longitude'])) { |
|
177 | + if (isset($this->all_tracked[$id]['time_last_coord'])) $timediff = round(time()-$this->all_tracked[$id]['time_last_coord']); |
|
178 | + else unset($timediff); |
|
179 | + if ($this->tmd > 5 || !isset($timediff) || $timediff > 90 || ($timediff > 30 && isset($this->all_tracked[$id]['latitude']) && isset($this->all_tracked[$id]['longitude']) && $Common->withinThreshold($timediff,$Common->distance($line['latitude'],$line['longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],'m')))) { |
|
180 | 180 | if (isset($this->all_tracked[$id]['archive_latitude']) && isset($this->all_tracked[$id]['archive_longitude']) && isset($this->all_tracked[$id]['livedb_latitude']) && isset($this->all_tracked[$id]['livedb_longitude'])) { |
181 | - if (!$Common->checkLine($this->all_tracked[$id]['archive_latitude'],$this->all_tracked[$id]['archive_longitude'],$this->all_tracked[$id]['livedb_latitude'],$this->all_tracked[$id]['livedb_longitude'],$line['latitude'],$line['longitude'],0.08)) { |
|
181 | + if (!$Common->checkLine($this->all_tracked[$id]['archive_latitude'],$this->all_tracked[$id]['archive_longitude'],$this->all_tracked[$id]['livedb_latitude'],$this->all_tracked[$id]['livedb_longitude'],$line['latitude'],$line['longitude'],0.08)) { |
|
182 | 182 | $this->all_tracked[$id]['archive_latitude'] = $line['latitude']; |
183 | 183 | $this->all_tracked[$id]['archive_longitude'] = $line['longitude']; |
184 | 184 | $this->all_tracked[$id]['putinarchive'] = true; |
@@ -192,30 +192,30 @@ discard block |
||
192 | 192 | if ($globalDebugTimeElapsed) echo 'Time elapsed for update getCountryFromlatitudeLongitude : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
193 | 193 | $this->tmd = 0; |
194 | 194 | if ($globalDebug) echo 'FOUND : '.$this->all_tracked[$id]['over_country'].' ---------------'."\n"; |
195 | - } |
|
195 | + } |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | if (isset($line['latitude']) && $line['latitude'] != '' && $line['latitude'] != 0 && $line['latitude'] < 91 && $line['latitude'] > -90) { |
199 | 199 | if (!isset($this->all_tracked[$id]['archive_latitude'])) $this->all_tracked[$id]['archive_latitude'] = $line['latitude']; |
200 | 200 | if (!isset($this->all_tracked[$id]['livedb_latitude']) || abs($this->all_tracked[$id]['livedb_latitude']-$line['latitude']) > $globalCoordMinChangeTracker || $this->all_tracked[$id]['format_source'] == 'aprs') { |
201 | - $this->all_tracked[$id]['livedb_latitude'] = $line['latitude']; |
|
202 | - $dataFound = true; |
|
203 | - $this->all_tracked[$id]['time_last_coord'] = time(); |
|
201 | + $this->all_tracked[$id]['livedb_latitude'] = $line['latitude']; |
|
202 | + $dataFound = true; |
|
203 | + $this->all_tracked[$id]['time_last_coord'] = time(); |
|
204 | 204 | } |
205 | 205 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('latitude' => $line['latitude'])); |
206 | 206 | } |
207 | 207 | if (isset($line['longitude']) && $line['longitude'] != '' && $line['longitude'] != 0 && $line['longitude'] < 360 && $line['longitude'] > -180) { |
208 | - if ($line['longitude'] > 180) $line['longitude'] = $line['longitude'] - 360; |
|
208 | + if ($line['longitude'] > 180) $line['longitude'] = $line['longitude'] - 360; |
|
209 | 209 | if (!isset($this->all_tracked[$id]['archive_longitude'])) $this->all_tracked[$id]['archive_longitude'] = $line['longitude']; |
210 | 210 | if (!isset($this->all_tracked[$id]['livedb_longitude']) || abs($this->all_tracked[$id]['livedb_longitude']-$line['longitude']) > $globalCoordMinChangeTracker || $this->all_tracked[$id]['format_source'] == 'aprs') { |
211 | - $this->all_tracked[$id]['livedb_longitude'] = $line['longitude']; |
|
212 | - $dataFound = true; |
|
213 | - $this->all_tracked[$id]['time_last_coord'] = time(); |
|
211 | + $this->all_tracked[$id]['livedb_longitude'] = $line['longitude']; |
|
212 | + $dataFound = true; |
|
213 | + $this->all_tracked[$id]['time_last_coord'] = time(); |
|
214 | 214 | } |
215 | 215 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('longitude' => $line['longitude'])); |
216 | 216 | } |
217 | 217 | |
218 | - } else if ($globalDebug && $timediff > 20) { |
|
218 | + } else if ($globalDebug && $timediff > 20) { |
|
219 | 219 | $this->tmd = $this->tmd + 1; |
220 | 220 | if ($line['latitude'] != $this->all_tracked[$id]['latitude'] && $line['longitude'] != $this->all_tracked[$id]['longitude']) { |
221 | 221 | echo '!!! Too much distance in short time... for '.$this->all_tracked[$id]['ident']."\n"; |
@@ -223,131 +223,131 @@ discard block |
||
223 | 223 | echo 'Speed : '.(($Common->distance($line['latitude'],$line['longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],'m')/$timediff)*3.6)." km/h - "; |
224 | 224 | echo 'Lat : '.$line['latitude'].' - long : '.$line['longitude'].' - prev lat : '.$this->all_tracked[$id]['latitude'].' - prev long : '.$this->all_tracked[$id]['longitude']." \n"; |
225 | 225 | } |
226 | - } |
|
226 | + } |
|
227 | 227 | } |
228 | 228 | if (isset($line['last_update']) && $line['last_update'] != '') { |
229 | - if (isset($this->all_tracked[$id]['last_update']) && $this->all_tracked[$id]['last_update'] != $line['last_update']) $dataFound = true; |
|
230 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('last_update' => $line['last_update'])); |
|
229 | + if (isset($this->all_tracked[$id]['last_update']) && $this->all_tracked[$id]['last_update'] != $line['last_update']) $dataFound = true; |
|
230 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('last_update' => $line['last_update'])); |
|
231 | 231 | } |
232 | 232 | if (isset($line['format_source']) && $line['format_source'] != '') { |
233 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('format_source' => $line['format_source'])); |
|
233 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('format_source' => $line['format_source'])); |
|
234 | 234 | } |
235 | 235 | if (isset($line['source_name']) && $line['source_name'] != '') { |
236 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('source_name' => $line['source_name'])); |
|
236 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('source_name' => $line['source_name'])); |
|
237 | 237 | } |
238 | 238 | if (isset($line['comment']) && $line['comment'] != '') { |
239 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('comment' => $line['comment'])); |
|
240 | - //$dataFound = true; |
|
239 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('comment' => $line['comment'])); |
|
240 | + //$dataFound = true; |
|
241 | 241 | } |
242 | 242 | if (isset($line['type']) && $line['type'] != '') { |
243 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('type' => $line['type'])); |
|
244 | - //$dataFound = true; |
|
243 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('type' => $line['type'])); |
|
244 | + //$dataFound = true; |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | if (isset($line['altitude']) && $line['altitude'] != '') { |
248 | - //if (!isset($this->all_tracked[$id]['altitude']) || $this->all_tracked[$id]['altitude'] == '' || ($this->all_tracked[$id]['altitude'] > 0 && $line['altitude'] != 0)) { |
|
248 | + //if (!isset($this->all_tracked[$id]['altitude']) || $this->all_tracked[$id]['altitude'] == '' || ($this->all_tracked[$id]['altitude'] > 0 && $line['altitude'] != 0)) { |
|
249 | 249 | if (is_int($this->all_tracked[$id]['altitude']) && abs(round($line['altitude']/100)-$this->all_tracked[$id]['altitude']) > 3) $this->all_tracked[$id]['putinarchive'] = true; |
250 | 250 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('altitude' => $line['altitude'])); |
251 | 251 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('altitude_real' => $line['altitude'])); |
252 | 252 | //$dataFound = true; |
253 | - //} elseif ($globalDebug) echo "!!! Strange altitude data... not added.\n"; |
|
253 | + //} elseif ($globalDebug) echo "!!! Strange altitude data... not added.\n"; |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | if (isset($line['noarchive']) && $line['noarchive'] === true) { |
257 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('noarchive' => true)); |
|
257 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('noarchive' => true)); |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | if (isset($line['heading']) && $line['heading'] != '') { |
261 | - if (is_int($this->all_tracked[$id]['heading']) && abs($this->all_tracked[$id]['heading']-round($line['heading'])) > 10) $this->all_tracked[$id]['putinarchive'] = true; |
|
262 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('heading' => round($line['heading']))); |
|
263 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('heading_fromsrc' => true)); |
|
264 | - //$dataFound = true; |
|
261 | + if (is_int($this->all_tracked[$id]['heading']) && abs($this->all_tracked[$id]['heading']-round($line['heading'])) > 10) $this->all_tracked[$id]['putinarchive'] = true; |
|
262 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('heading' => round($line['heading']))); |
|
263 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('heading_fromsrc' => true)); |
|
264 | + //$dataFound = true; |
|
265 | 265 | } elseif (!isset($this->all_tracked[$id]['heading_fromsrc']) && isset($this->all_tracked[$id]['archive_latitude']) && $this->all_tracked[$id]['archive_latitude'] != $this->all_tracked[$id]['latitude'] && isset($this->all_tracked[$id]['archive_longitude']) && $this->all_tracked[$id]['archive_longitude'] != $this->all_tracked[$id]['longitude']) { |
266 | - $heading = $Common->getHeading($this->all_tracked[$id]['archive_latitude'],$this->all_tracked[$id]['archive_longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude']); |
|
267 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('heading' => round($heading))); |
|
268 | - if (abs($this->all_tracked[$id]['heading']-round($heading)) > 10) $this->all_tracked[$id]['putinarchive'] = true; |
|
269 | - if ($globalDebug) echo "ø Calculated Heading for ".$this->all_tracked[$id]['ident']." : ".$heading."\n"; |
|
266 | + $heading = $Common->getHeading($this->all_tracked[$id]['archive_latitude'],$this->all_tracked[$id]['archive_longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude']); |
|
267 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('heading' => round($heading))); |
|
268 | + if (abs($this->all_tracked[$id]['heading']-round($heading)) > 10) $this->all_tracked[$id]['putinarchive'] = true; |
|
269 | + if ($globalDebug) echo "ø Calculated Heading for ".$this->all_tracked[$id]['ident']." : ".$heading."\n"; |
|
270 | 270 | } |
271 | 271 | //if (isset($globalSourcesupdate) && $globalSourcesupdate != '' && isset($this->all_tracked[$id]['lastupdate']) && time()-$this->all_tracked[$id]['lastupdate'] < $globalSourcesupdate) $dataFound = false; |
272 | 272 | |
273 | 273 | if ($dataFound === true && isset($this->all_tracked[$id]['ident'])) { |
274 | - $this->all_tracked[$id]['lastupdate'] = time(); |
|
275 | - if ($this->all_tracked[$id]['addedTracker'] == 0) { |
|
276 | - if (!isset($globalDistanceIgnore['latitude']) || $this->all_tracked[$id]['longitude'] == '' || $this->all_tracked[$id]['latitude'] == '' || (isset($globalDistanceIgnore['latitude']) && $Common->distance($this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],$globalDistanceIgnore['latitude'],$globalDistanceIgnore['longitude']) < $globalDistanceIgnore['distance'])) { |
|
277 | - if (!isset($this->all_tracked[$id]['forcenew']) || $this->all_tracked[$id]['forcenew'] == 0) { |
|
274 | + $this->all_tracked[$id]['lastupdate'] = time(); |
|
275 | + if ($this->all_tracked[$id]['addedTracker'] == 0) { |
|
276 | + if (!isset($globalDistanceIgnore['latitude']) || $this->all_tracked[$id]['longitude'] == '' || $this->all_tracked[$id]['latitude'] == '' || (isset($globalDistanceIgnore['latitude']) && $Common->distance($this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],$globalDistanceIgnore['latitude'],$globalDistanceIgnore['longitude']) < $globalDistanceIgnore['distance'])) { |
|
277 | + if (!isset($this->all_tracked[$id]['forcenew']) || $this->all_tracked[$id]['forcenew'] == 0) { |
|
278 | 278 | if ($globalDebug) echo "Check if aircraft is already in DB..."; |
279 | 279 | $timeelapsed = microtime(true); |
280 | 280 | $TrackerLive = new TrackerLive($this->db); |
281 | 281 | if (isset($line['id'])) { |
282 | - $recent_ident = $TrackerLive->checkIdRecent($line['id']); |
|
283 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
282 | + $recent_ident = $TrackerLive->checkIdRecent($line['id']); |
|
283 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
284 | 284 | } elseif (isset($this->all_tracked[$id]['ident']) && $this->all_tracked[$id]['ident'] != '') { |
285 | - $recent_ident = $TrackerLive->checkIdentRecent($this->all_tracked[$id]['ident']); |
|
286 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdentRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
285 | + $recent_ident = $TrackerLive->checkIdentRecent($this->all_tracked[$id]['ident']); |
|
286 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdentRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
287 | 287 | } else $recent_ident = ''; |
288 | 288 | $TrackerLive->db=null; |
289 | 289 | |
290 | 290 | if ($globalDebug && $recent_ident == '') echo " Not in DB.\n"; |
291 | 291 | elseif ($globalDebug && $recent_ident != '') echo " Already in DB.\n"; |
292 | - } else { |
|
292 | + } else { |
|
293 | 293 | $recent_ident = ''; |
294 | 294 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('forcenew' => 0)); |
295 | - } |
|
296 | - //if there was no aircraft with the same callsign within the last hour and go post it into the archive |
|
297 | - if($recent_ident == "") |
|
298 | - { |
|
295 | + } |
|
296 | + //if there was no aircraft with the same callsign within the last hour and go post it into the archive |
|
297 | + if($recent_ident == "") |
|
298 | + { |
|
299 | 299 | if ($globalDebug) echo "\o/ Add ".$this->all_tracked[$id]['ident']." in archive DB : "; |
300 | 300 | //adds the spotter data for the archive |
301 | - $highlight = ''; |
|
302 | - if (!isset($this->all_tracked[$id]['id'])) $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $this->all_tracked[$id]['ident'].'-'.date('YmdHi'))); |
|
303 | - $timeelapsed = microtime(true); |
|
304 | - $Tracker = new Tracker($this->db); |
|
305 | - $result = $Tracker->addTrackerData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $this->all_tracked[$id]['altitude'], $this->all_tracked[$id]['heading'], $this->all_tracked[$id]['speed'], $this->all_tracked[$id]['datetime'], $this->all_tracked[$id]['comment'],$this->all_tracked[$id]['type'],$this->all_tracked[$id]['format_source'],$this->all_tracked[$id]['source_name']); |
|
306 | - $Tracker->db = null; |
|
307 | - if ($globalDebug && isset($result)) echo $result."\n"; |
|
308 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update addspotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
301 | + $highlight = ''; |
|
302 | + if (!isset($this->all_tracked[$id]['id'])) $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $this->all_tracked[$id]['ident'].'-'.date('YmdHi'))); |
|
303 | + $timeelapsed = microtime(true); |
|
304 | + $Tracker = new Tracker($this->db); |
|
305 | + $result = $Tracker->addTrackerData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $this->all_tracked[$id]['altitude'], $this->all_tracked[$id]['heading'], $this->all_tracked[$id]['speed'], $this->all_tracked[$id]['datetime'], $this->all_tracked[$id]['comment'],$this->all_tracked[$id]['type'],$this->all_tracked[$id]['format_source'],$this->all_tracked[$id]['source_name']); |
|
306 | + $Tracker->db = null; |
|
307 | + if ($globalDebug && isset($result)) echo $result."\n"; |
|
308 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update addspotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
309 | 309 | |
310 | 310 | |
311 | - // Add source stat in DB |
|
312 | - $Stats = new Stats($this->db); |
|
313 | - if (!empty($this->stats)) { |
|
311 | + // Add source stat in DB |
|
312 | + $Stats = new Stats($this->db); |
|
313 | + if (!empty($this->stats)) { |
|
314 | 314 | if ($globalDebug) echo 'Add source stats : '; |
315 | - foreach($this->stats as $date => $data) { |
|
316 | - foreach($data as $source => $sourced) { |
|
317 | - //print_r($sourced); |
|
318 | - if (isset($sourced['polar'])) echo $Stats->addStatSource(json_encode($sourced['polar']),$source,'polar_tracker',$date); |
|
319 | - if (isset($sourced['hist'])) echo $Stats->addStatSource(json_encode($sourced['hist']),$source,'hist_tracker',$date); |
|
320 | - if (isset($sourced['msg'])) { |
|
321 | - if (time() - $sourced['msg']['date'] > 10) { |
|
322 | - $nbmsg = round($sourced['msg']['nb']/(time() - $sourced['msg']['date'])); |
|
323 | - echo $Stats->addStatSource($nbmsg,$source,'msg_tracker',$date); |
|
324 | - unset($this->stats[$date][$source]['msg']); |
|
325 | - } |
|
326 | - } |
|
327 | - } |
|
328 | - if ($date != date('Y-m-d')) { |
|
329 | - unset($this->stats[$date]); |
|
330 | - } |
|
331 | - } |
|
332 | - if ($globalDebug) echo 'Done'."\n"; |
|
315 | + foreach($this->stats as $date => $data) { |
|
316 | + foreach($data as $source => $sourced) { |
|
317 | + //print_r($sourced); |
|
318 | + if (isset($sourced['polar'])) echo $Stats->addStatSource(json_encode($sourced['polar']),$source,'polar_tracker',$date); |
|
319 | + if (isset($sourced['hist'])) echo $Stats->addStatSource(json_encode($sourced['hist']),$source,'hist_tracker',$date); |
|
320 | + if (isset($sourced['msg'])) { |
|
321 | + if (time() - $sourced['msg']['date'] > 10) { |
|
322 | + $nbmsg = round($sourced['msg']['nb']/(time() - $sourced['msg']['date'])); |
|
323 | + echo $Stats->addStatSource($nbmsg,$source,'msg_tracker',$date); |
|
324 | + unset($this->stats[$date][$source]['msg']); |
|
325 | + } |
|
326 | + } |
|
327 | + } |
|
328 | + if ($date != date('Y-m-d')) { |
|
329 | + unset($this->stats[$date]); |
|
330 | + } |
|
331 | + } |
|
332 | + if ($globalDebug) echo 'Done'."\n"; |
|
333 | 333 | |
334 | - } |
|
335 | - $Stats->db = null; |
|
334 | + } |
|
335 | + $Stats->db = null; |
|
336 | 336 | |
337 | - $this->del(); |
|
337 | + $this->del(); |
|
338 | 338 | //$ignoreImport = false; |
339 | 339 | $this->all_tracked[$id]['addedTracker'] = 1; |
340 | 340 | //print_r($this->all_tracked[$id]); |
341 | 341 | if ($this->last_delete == 0 || time() - $this->last_delete > 1800) { |
342 | - if ($globalDebug) echo "---- Deleting Live Tracker data older than 9 hours..."; |
|
343 | - //TrackerLive->deleteLiveTrackerDataNotUpdated(); |
|
344 | - $TrackerLive = new TrackerLive($this->db); |
|
345 | - $TrackerLive->deleteLiveTrackerData(); |
|
346 | - $TrackerLive->db=null; |
|
347 | - if ($globalDebug) echo " Done\n"; |
|
348 | - $this->last_delete = time(); |
|
342 | + if ($globalDebug) echo "---- Deleting Live Tracker data older than 9 hours..."; |
|
343 | + //TrackerLive->deleteLiveTrackerDataNotUpdated(); |
|
344 | + $TrackerLive = new TrackerLive($this->db); |
|
345 | + $TrackerLive->deleteLiveTrackerData(); |
|
346 | + $TrackerLive->db=null; |
|
347 | + if ($globalDebug) echo " Done\n"; |
|
348 | + $this->last_delete = time(); |
|
349 | 349 | } |
350 | - } else { |
|
350 | + } else { |
|
351 | 351 | $this->all_tracked[$id]['id'] = $recent_ident; |
352 | 352 | $this->all_tracked[$id]['addedTracker'] = 1; |
353 | 353 | if (isset($globalDaemon) && !$globalDaemon) { |
@@ -356,16 +356,16 @@ discard block |
||
356 | 356 | $Tracker->db = null; |
357 | 357 | } |
358 | 358 | |
359 | - } |
|
359 | + } |
|
360 | 360 | } |
361 | - } |
|
362 | - //adds the spotter LIVE data |
|
363 | - if ($globalDebug) { |
|
361 | + } |
|
362 | + //adds the spotter LIVE data |
|
363 | + if ($globalDebug) { |
|
364 | 364 | echo 'DATA : ident : '.$this->all_tracked[$id]['ident'].' - type : '.$this->all_tracked[$id]['type'].' - Latitude : '.$this->all_tracked[$id]['latitude'].' - Longitude : '.$this->all_tracked[$id]['longitude'].' - Altitude : '.$this->all_tracked[$id]['altitude'].' - Heading : '.$this->all_tracked[$id]['heading'].' - Speed : '.$this->all_tracked[$id]['speed']."\n"; |
365 | - } |
|
366 | - $ignoreImport = false; |
|
365 | + } |
|
366 | + $ignoreImport = false; |
|
367 | 367 | |
368 | - if (!$ignoreImport) { |
|
368 | + if (!$ignoreImport) { |
|
369 | 369 | if (!isset($globalDistanceIgnore['latitude']) || (isset($globalDistanceIgnore['latitude']) && $Common->distance($this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],$globalDistanceIgnore['latitude'],$globalDistanceIgnore['longitude']) < $globalDistanceIgnore['distance'])) { |
370 | 370 | if ($globalDebug) echo "\o/ Add ".$this->all_tracked[$id]['ident']." from ".$this->all_tracked[$id]['format_source']." in Live DB : "; |
371 | 371 | $timeelapsed = microtime(true); |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | if ($stats_heading == 16) $stats_heading = 0; |
404 | 404 | if (!isset($this->stats[$current_date][$source]['polar'][1])) { |
405 | 405 | for ($i=0;$i<=15;$i++) { |
406 | - $this->stats[$current_date][$source]['polar'][$i] = 0; |
|
406 | + $this->stats[$current_date][$source]['polar'][$i] = 0; |
|
407 | 407 | } |
408 | 408 | $this->stats[$current_date][$source]['polar'][$stats_heading] = $stats_distance; |
409 | 409 | } else { |
@@ -416,11 +416,11 @@ discard block |
||
416 | 416 | //var_dump($this->stats); |
417 | 417 | if (!isset($this->stats[$current_date][$source]['hist'][$distance])) { |
418 | 418 | if (isset($this->stats[$current_date][$source]['hist'][0])) { |
419 | - end($this->stats[$current_date][$source]['hist']); |
|
420 | - $mini = key($this->stats[$current_date][$source]['hist'])+10; |
|
419 | + end($this->stats[$current_date][$source]['hist']); |
|
420 | + $mini = key($this->stats[$current_date][$source]['hist'])+10; |
|
421 | 421 | } else $mini = 0; |
422 | 422 | for ($i=$mini;$i<=$distance;$i+=10) { |
423 | - $this->stats[$current_date][$source]['hist'][$i] = 0; |
|
423 | + $this->stats[$current_date][$source]['hist'][$i] = 0; |
|
424 | 424 | } |
425 | 425 | $this->stats[$current_date][$source]['hist'][$distance] = 1; |
426 | 426 | } else { |
@@ -436,22 +436,22 @@ discard block |
||
436 | 436 | |
437 | 437 | |
438 | 438 | if ($this->last_delete_hourly == 0 || time() - $this->last_delete_hourly > 900) { |
439 | - if ($globalDebug) echo "---- Deleting Live Tracker data Not updated since 2 hour..."; |
|
440 | - $TrackerLive = new TrackerLive($this->db); |
|
441 | - $TrackerLive->deleteLiveTrackerDataNotUpdated(); |
|
442 | - $TrackerLive->db = null; |
|
443 | - //TrackerLive->deleteLiveTrackerData(); |
|
444 | - if ($globalDebug) echo " Done\n"; |
|
445 | - $this->last_delete_hourly = time(); |
|
439 | + if ($globalDebug) echo "---- Deleting Live Tracker data Not updated since 2 hour..."; |
|
440 | + $TrackerLive = new TrackerLive($this->db); |
|
441 | + $TrackerLive->deleteLiveTrackerDataNotUpdated(); |
|
442 | + $TrackerLive->db = null; |
|
443 | + //TrackerLive->deleteLiveTrackerData(); |
|
444 | + if ($globalDebug) echo " Done\n"; |
|
445 | + $this->last_delete_hourly = time(); |
|
446 | 446 | } |
447 | 447 | |
448 | - } |
|
449 | - //$ignoreImport = false; |
|
448 | + } |
|
449 | + //$ignoreImport = false; |
|
450 | 450 | } |
451 | 451 | //if (function_exists('pcntl_fork') && $globalFork) pcntl_signal(SIGCHLD, SIG_IGN); |
452 | 452 | if ($send) return $this->all_tracked[$id]; |
453 | - } |
|
453 | + } |
|
454 | + } |
|
454 | 455 | } |
455 | - } |
|
456 | 456 | } |
457 | 457 | ?> |
@@ -176,8 +176,8 @@ |
||
176 | 176 | |
177 | 177 | private function urshift($n, $s) { |
178 | 178 | return ($n >= 0) ? ($n >> $s) : |
179 | - (($n & 0x7fffffff) >> $s) | |
|
180 | - (0x40000000 >> ($s - 1)); |
|
179 | + (($n & 0x7fffffff) >> $s) | |
|
180 | + (0x40000000 >> ($s - 1)); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | /* |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
35 | - * Change IATA to ICAO value for ident |
|
36 | - * |
|
37 | - * @param String $ident ident |
|
38 | - * @return String the icao |
|
39 | - */ |
|
35 | + * Change IATA to ICAO value for ident |
|
36 | + * |
|
37 | + * @param String $ident ident |
|
38 | + * @return String the icao |
|
39 | + */ |
|
40 | 40 | public function ident2icao($ident) { |
41 | 41 | if (substr($ident,0,2) == 'AF') { |
42 | 42 | if (filter_var(substr($ident,2),FILTER_VALIDATE_INT,array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $ident; |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
55 | - * Deletes all info in the live table |
|
56 | - * |
|
57 | - * @return String success or false |
|
58 | - * |
|
59 | - */ |
|
55 | + * Deletes all info in the live table |
|
56 | + * |
|
57 | + * @return String success or false |
|
58 | + * |
|
59 | + */ |
|
60 | 60 | public function deleteLiveAcarsData() |
61 | 61 | { |
62 | 62 | global $globalDBdriver; |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
79 | - * Deletes all info in the archive table |
|
80 | - * |
|
81 | - * @return String success or false |
|
82 | - * |
|
83 | - */ |
|
79 | + * Deletes all info in the archive table |
|
80 | + * |
|
81 | + * @return String success or false |
|
82 | + * |
|
83 | + */ |
|
84 | 84 | public function deleteArchiveAcarsData() |
85 | 85 | { |
86 | 86 | global $globalACARSArchiveKeepMonths, $globalDBdriver; |
@@ -101,11 +101,11 @@ discard block |
||
101 | 101 | |
102 | 102 | |
103 | 103 | /** |
104 | - * Parse ACARS data |
|
105 | - * |
|
106 | - * @param String ACARS data in acarsdec data |
|
107 | - * |
|
108 | - */ |
|
104 | + * Parse ACARS data |
|
105 | + * |
|
106 | + * @param String ACARS data in acarsdec data |
|
107 | + * |
|
108 | + */ |
|
109 | 109 | public function parse($data) { |
110 | 110 | global $globalDebug, $globalACARSArchive; |
111 | 111 | //$Image = new Image($this->db); |
@@ -735,11 +735,11 @@ discard block |
||
735 | 735 | } |
736 | 736 | |
737 | 737 | /** |
738 | - * Add ACARS data |
|
739 | - * |
|
740 | - * @param String ACARS data in acarsdec data |
|
741 | - * |
|
742 | - */ |
|
738 | + * Add ACARS data |
|
739 | + * |
|
740 | + * @param String ACARS data in acarsdec data |
|
741 | + * |
|
742 | + */ |
|
743 | 743 | function add($data) { |
744 | 744 | global $globalDebug, $globalACARSArchive; |
745 | 745 | $Image = new Image($this->db); |
@@ -786,15 +786,15 @@ discard block |
||
786 | 786 | } |
787 | 787 | |
788 | 788 | /** |
789 | - * Add Live ACARS data in DB |
|
790 | - * |
|
791 | - * @param String $ident ident |
|
792 | - * @param String $registration Registration of the aircraft |
|
793 | - * @param String $label Label of the ACARS message |
|
794 | - * @param String $block_id Block id of the ACARS message |
|
795 | - * @param String $msg_no Number of the ACARS message |
|
796 | - * @param String $message ACARS message |
|
797 | - */ |
|
789 | + * Add Live ACARS data in DB |
|
790 | + * |
|
791 | + * @param String $ident ident |
|
792 | + * @param String $registration Registration of the aircraft |
|
793 | + * @param String $label Label of the ACARS message |
|
794 | + * @param String $block_id Block id of the ACARS message |
|
795 | + * @param String $msg_no Number of the ACARS message |
|
796 | + * @param String $message ACARS message |
|
797 | + */ |
|
798 | 798 | public function addLiveAcarsData($ident,$registration,$label,$block_id,$msg_no,$message,$decode = '') { |
799 | 799 | global $globalDebug; |
800 | 800 | date_default_timezone_set('UTC'); |
@@ -830,15 +830,15 @@ discard block |
||
830 | 830 | } |
831 | 831 | |
832 | 832 | /** |
833 | - * Add Archive ACARS data in DB |
|
834 | - * |
|
835 | - * @param String $ident ident |
|
836 | - * @param String $registration Registration of the aircraft |
|
837 | - * @param String $label Label of the ACARS message |
|
838 | - * @param String $block_id Block id of the ACARS message |
|
839 | - * @param String $msg_no Number of the ACARS message |
|
840 | - * @param String $message ACARS message |
|
841 | - */ |
|
833 | + * Add Archive ACARS data in DB |
|
834 | + * |
|
835 | + * @param String $ident ident |
|
836 | + * @param String $registration Registration of the aircraft |
|
837 | + * @param String $label Label of the ACARS message |
|
838 | + * @param String $block_id Block id of the ACARS message |
|
839 | + * @param String $msg_no Number of the ACARS message |
|
840 | + * @param String $message ACARS message |
|
841 | + */ |
|
842 | 842 | public function addArchiveAcarsData($ident,$registration,$label,$block_id,$msg_no,$message,$decode = '') { |
843 | 843 | global $globalDebug; |
844 | 844 | date_default_timezone_set('UTC'); |
@@ -869,11 +869,11 @@ discard block |
||
869 | 869 | } |
870 | 870 | |
871 | 871 | /** |
872 | - * Get Message title from label from DB |
|
873 | - * |
|
874 | - * @param String $label |
|
875 | - * @return String Return ACARS title |
|
876 | - */ |
|
872 | + * Get Message title from label from DB |
|
873 | + * |
|
874 | + * @param String $label |
|
875 | + * @return String Return ACARS title |
|
876 | + */ |
|
877 | 877 | public function getTitlefromLabel($label) { |
878 | 878 | $Connection = new Connection($this->db); |
879 | 879 | $this->db = $Connection->db; |
@@ -892,10 +892,10 @@ discard block |
||
892 | 892 | } |
893 | 893 | |
894 | 894 | /** |
895 | - * List all Message title & label from DB |
|
896 | - * |
|
897 | - * @return Array Return ACARS data in array |
|
898 | - */ |
|
895 | + * List all Message title & label from DB |
|
896 | + * |
|
897 | + * @return Array Return ACARS data in array |
|
898 | + */ |
|
899 | 899 | public function getAllTitleLabel() { |
900 | 900 | $query = "SELECT * FROM acars_label ORDER BY title"; |
901 | 901 | $query_values = array(); |
@@ -912,11 +912,11 @@ discard block |
||
912 | 912 | } |
913 | 913 | |
914 | 914 | /** |
915 | - * Get Live ACARS data from DB |
|
916 | - * |
|
917 | - * @param String $ident |
|
918 | - * @return Array Return ACARS data in array |
|
919 | - */ |
|
915 | + * Get Live ACARS data from DB |
|
916 | + * |
|
917 | + * @param String $ident |
|
918 | + * @return Array Return ACARS data in array |
|
919 | + */ |
|
920 | 920 | public function getLiveAcarsData($ident) { |
921 | 921 | $query = "SELECT * FROM acars_live WHERE ident = :ident ORDER BY acars_live_id DESC"; |
922 | 922 | $query_values = array(':ident' => $ident); |
@@ -933,10 +933,10 @@ discard block |
||
933 | 933 | } |
934 | 934 | |
935 | 935 | /** |
936 | - * Get Latest ACARS data from DB |
|
937 | - * |
|
938 | - * @return Array Return ACARS data in array |
|
939 | - */ |
|
936 | + * Get Latest ACARS data from DB |
|
937 | + * |
|
938 | + * @return Array Return ACARS data in array |
|
939 | + */ |
|
940 | 940 | public function getLatestAcarsData($limit = '',$label = '') { |
941 | 941 | global $globalURL, $globalDBdriver; |
942 | 942 | $Image = new Image($this->db); |
@@ -1024,10 +1024,10 @@ discard block |
||
1024 | 1024 | } |
1025 | 1025 | |
1026 | 1026 | /** |
1027 | - * Get Archive ACARS data from DB |
|
1028 | - * |
|
1029 | - * @return Array Return ACARS data in array |
|
1030 | - */ |
|
1027 | + * Get Archive ACARS data from DB |
|
1028 | + * |
|
1029 | + * @return Array Return ACARS data in array |
|
1030 | + */ |
|
1031 | 1031 | public function getArchiveAcarsData($limit = '',$label = '') { |
1032 | 1032 | global $globalURL, $globalDBdriver; |
1033 | 1033 | $Image = new Image($this->db); |
@@ -1115,13 +1115,13 @@ discard block |
||
1115 | 1115 | } |
1116 | 1116 | |
1117 | 1117 | /** |
1118 | - * Add ModeS data to DB |
|
1119 | - * |
|
1120 | - * @param String $ident ident |
|
1121 | - * @param String $registration Registration of the aircraft |
|
1122 | - * @param String $icao |
|
1123 | - * @param String $ICAOTypeCode |
|
1124 | - */ |
|
1118 | + * Add ModeS data to DB |
|
1119 | + * |
|
1120 | + * @param String $ident ident |
|
1121 | + * @param String $registration Registration of the aircraft |
|
1122 | + * @param String $icao |
|
1123 | + * @param String $ICAOTypeCode |
|
1124 | + */ |
|
1125 | 1125 | public function addModeSData($ident,$registration,$icao = '',$ICAOTypeCode = '',$latitude = '', $longitude = '') { |
1126 | 1126 | global $globalDebug, $globalDBdriver; |
1127 | 1127 | $ident = trim($ident); |