@@ -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; |
@@ -781,7 +781,7 @@ discard block |
||
| 781 | 781 | $dfX = $first_pass[$j][0]; |
| 782 | 782 | $dfDiffLong = abs($dfX - $dfPrevX); |
| 783 | 783 | if ($dfDiffLong > $dfDiffSpace && |
| 784 | - (($dfX > $dfLeftBorderX && $dfPrevX < $dfRightBorderX) || ($dfPrevX > $dfLeftBorderX && $dfX < $dfRightBorderX))) |
|
| 784 | + (($dfX > $dfLeftBorderX && $dfPrevX < $dfRightBorderX) || ($dfPrevX > $dfLeftBorderX && $dfX < $dfRightBorderX))) |
|
| 785 | 785 | { |
| 786 | 786 | $bHasBigDiff = true; |
| 787 | 787 | } else if ($dfDiffLong > $dfMaxSmallDiffLong) { |
@@ -800,8 +800,8 @@ discard block |
||
| 800 | 800 | $dfX2 = floatval($first_pass[$k][0]); |
| 801 | 801 | $dfY2 = floatval($first_pass[$k][1]); |
| 802 | 802 | if ($dfX1 > -180 && $dfX1 < $dfRightBorderX && $dfX2 == 180 && |
| 803 | - $k+1 < count($first_pass) && |
|
| 804 | - $first_pass[$k-1][0] > -180 && $first_pass[$k-1][0] < $dfRightBorderX) |
|
| 803 | + $k+1 < count($first_pass) && |
|
| 804 | + $first_pass[$k-1][0] > -180 && $first_pass[$k-1][0] < $dfRightBorderX) |
|
| 805 | 805 | { |
| 806 | 806 | $poNewLS[] = array(-180, $first_pass[$k][1]); |
| 807 | 807 | $k++; |
@@ -809,8 +809,8 @@ discard block |
||
| 809 | 809 | $poNewLS[] = array($first_pass[$k][0], $first_pass[$k][1]); |
| 810 | 810 | continue; |
| 811 | 811 | } else if ($dfX1 > $dfLeftBorderX && $dfX1 < 180 && $dfX2 == -180 && |
| 812 | - $k+1 < count($first_pass) && |
|
| 813 | - $first_pass[$k-1][0] > $dfLeftBorderX && $first_pass[$k-1][0] < 180) |
|
| 812 | + $k+1 < count($first_pass) && |
|
| 813 | + $first_pass[$k-1][0] > $dfLeftBorderX && $first_pass[$k-1][0] < 180) |
|
| 814 | 814 | { |
| 815 | 815 | $poNewLS[] = array(180, $first_pass[$k][1]); |
| 816 | 816 | $k++; |
@@ -14,23 +14,23 @@ discard block |
||
| 14 | 14 | $usecoord = false; |
| 15 | 15 | if (isset($_GET['test'])) exit(); |
| 16 | 16 | if (isset($_GET['tracker'])) { |
| 17 | - $tracker = true; |
|
| 17 | + $tracker = true; |
|
| 18 | 18 | } |
| 19 | 19 | if (isset($_GET['marine'])) { |
| 20 | - $marine = true; |
|
| 20 | + $marine = true; |
|
| 21 | 21 | } |
| 22 | 22 | if ($tracker) { |
| 23 | - require_once('require/class.Tracker.php'); |
|
| 24 | - require_once('require/class.TrackerLive.php'); |
|
| 25 | - require_once('require/class.TrackerArchive.php'); |
|
| 23 | + require_once('require/class.Tracker.php'); |
|
| 24 | + require_once('require/class.TrackerLive.php'); |
|
| 25 | + require_once('require/class.TrackerArchive.php'); |
|
| 26 | 26 | } elseif ($marine) { |
| 27 | - require_once('require/class.Marine.php'); |
|
| 28 | - require_once('require/class.MarineLive.php'); |
|
| 29 | - require_once('require/class.MarineArchive.php'); |
|
| 27 | + require_once('require/class.Marine.php'); |
|
| 28 | + require_once('require/class.MarineLive.php'); |
|
| 29 | + require_once('require/class.MarineArchive.php'); |
|
| 30 | 30 | } else { |
| 31 | - require_once('require/class.Spotter.php'); |
|
| 32 | - require_once('require/class.SpotterLive.php'); |
|
| 33 | - require_once('require/class.SpotterArchive.php'); |
|
| 31 | + require_once('require/class.Spotter.php'); |
|
| 32 | + require_once('require/class.SpotterLive.php'); |
|
| 33 | + require_once('require/class.SpotterArchive.php'); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | $begintime = microtime(true); |
@@ -50,10 +50,10 @@ discard block |
||
| 50 | 50 | $Common = new Common(); |
| 51 | 51 | |
| 52 | 52 | if (isset($_GET['download'])) { |
| 53 | - if ($_GET['download'] == "true") |
|
| 54 | - { |
|
| 53 | + if ($_GET['download'] == "true") |
|
| 54 | + { |
|
| 55 | 55 | header('Content-disposition: attachment; filename="flightairmap.json"'); |
| 56 | - } |
|
| 56 | + } |
|
| 57 | 57 | } |
| 58 | 58 | header('Content-Type: text/javascript'); |
| 59 | 59 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $usecoord = true; |
| 132 | 132 | $coord = explode(',',$_GET['coord']); |
| 133 | 133 | if (filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
| 134 | - && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) { |
|
| 134 | + && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) { |
|
| 135 | 135 | if ($tracker) { |
| 136 | 136 | $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter); |
| 137 | 137 | } elseif ($marine) { |
@@ -635,17 +635,17 @@ discard block |
||
| 635 | 635 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
| 636 | 636 | |
| 637 | 637 | if ( |
| 638 | - (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
| 639 | - || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
| 638 | + (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
| 639 | + || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
| 640 | 640 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
| 641 | 641 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
| 642 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
| 643 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
| 644 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
| 645 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
| 646 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
| 647 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
| 648 | - ) { |
|
| 642 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
| 643 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
| 644 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
| 645 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
| 646 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
| 647 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
| 648 | + ) { |
|
| 649 | 649 | if ($tracker) { |
| 650 | 650 | if ($from_archive || $globalArchive) { |
| 651 | 651 | $spotter_history_array = $TrackerArchive->getAllArchiveTrackerDataById($spotter_item['famtrackid']); |
@@ -653,9 +653,9 @@ discard block |
||
| 653 | 653 | $spotter_history_array = $TrackerLive->getAllLiveTrackerDataById($spotter_item['famtrackid']); |
| 654 | 654 | } |
| 655 | 655 | if (((isset($_COOKIE['mapmatching']) && $_COOKIE['mapmatching'] == 'true') || |
| 656 | - (!isset($_COOKIE['mapmatching']) && $globalMapMatching === TRUE)) && |
|
| 657 | - isset($_GET['zoom']) && $_GET['zoom'] > 12 && |
|
| 658 | - isset($spotter_item['type']) && ( |
|
| 656 | + (!isset($_COOKIE['mapmatching']) && $globalMapMatching === TRUE)) && |
|
| 657 | + isset($_GET['zoom']) && $_GET['zoom'] > 12 && |
|
| 658 | + isset($spotter_item['type']) && ( |
|
| 659 | 659 | $spotter_item['type'] == 'Firetruck' || |
| 660 | 660 | $spotter_item['type'] == 'Ambulance' || |
| 661 | 661 | $spotter_item['type'] == 'Truck (18 Wheeler)' || |
@@ -667,7 +667,7 @@ discard block |
||
| 667 | 667 | $spotter_item['type'] == 'Jeep' || |
| 668 | 668 | $spotter_item['type'] == 'Motorcycle' || |
| 669 | 669 | $spotter_item['type'] == 'Car' |
| 670 | - ) |
|
| 670 | + ) |
|
| 671 | 671 | ) { |
| 672 | 672 | require(dirname(__FILE__).'/require/class.MapMatching.php'); |
| 673 | 673 | $MapMatching = new MapMatching(); |
@@ -770,75 +770,75 @@ discard block |
||
| 770 | 770 | } |
| 771 | 771 | |
| 772 | 772 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
| 773 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
| 774 | - && (isset($spotter_item['departure_airport']) |
|
| 775 | - && $spotter_item['departure_airport'] != 'NA' |
|
| 776 | - && isset($spotter_item['arrival_airport']) |
|
| 777 | - && $spotter_item['arrival_airport'] != 'NA' |
|
| 778 | - && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
| 779 | - || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
|
| 780 | - if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 781 | - else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 782 | - if (isset($spotter_item['departure_airport_latitude'])) { |
|
| 773 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
| 774 | + && (isset($spotter_item['departure_airport']) |
|
| 775 | + && $spotter_item['departure_airport'] != 'NA' |
|
| 776 | + && isset($spotter_item['arrival_airport']) |
|
| 777 | + && $spotter_item['arrival_airport'] != 'NA' |
|
| 778 | + && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
| 779 | + || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
|
| 780 | + if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 781 | + else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 782 | + if (isset($spotter_item['departure_airport_latitude'])) { |
|
| 783 | 783 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
| 784 | - } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
| 784 | + } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
| 785 | 785 | $dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']); |
| 786 | 786 | if (isset($dairport[0]['latitude'])) { |
| 787 | - $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
| 787 | + $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
| 788 | 788 | } |
| 789 | - } |
|
| 790 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
| 789 | + } |
|
| 790 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
| 791 | 791 | $output_air .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].'],'; |
| 792 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
| 792 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
| 793 | 793 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
| 794 | 794 | if (isset($aairport[0]['latitude'])) { |
| 795 | - $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],'; |
|
| 795 | + $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],'; |
|
| 796 | 796 | } |
| 797 | - } |
|
| 798 | - $output_air = substr($output_air, 0, -1); |
|
| 799 | - $output_air .= ']}},'; |
|
| 800 | - $output .= $output_air; |
|
| 801 | - unset($output_air); |
|
| 797 | + } |
|
| 798 | + $output_air = substr($output_air, 0, -1); |
|
| 799 | + $output_air .= ']}},'; |
|
| 800 | + $output .= $output_air; |
|
| 801 | + unset($output_air); |
|
| 802 | 802 | } |
| 803 | 803 | |
| 804 | 804 | //if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
| 805 | 805 | //if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
| 806 | 806 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
| 807 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
| 808 | - && (isset($spotter_item['arrival_airport']) |
|
| 809 | - && $spotter_item['arrival_airport'] != 'NA' |
|
| 810 | - && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") |
|
| 811 | - || (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute) |
|
| 812 | - || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
|
| 813 | - $havedata = false; |
|
| 814 | - if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 815 | - else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 807 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
| 808 | + && (isset($spotter_item['arrival_airport']) |
|
| 809 | + && $spotter_item['arrival_airport'] != 'NA' |
|
| 810 | + && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") |
|
| 811 | + || (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute) |
|
| 812 | + || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
|
| 813 | + $havedata = false; |
|
| 814 | + if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 815 | + else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
| 816 | 816 | |
| 817 | - //$output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
| 818 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
| 817 | + //$output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
| 818 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
| 819 | 819 | //$output_dest .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].']'; |
| 820 | 820 | $end_lon = $spotter_item['arrival_airport_longitude']; |
| 821 | 821 | $end_lat = $spotter_item['arrival_airport_latitude']; |
| 822 | 822 | $havedata = true; |
| 823 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
| 823 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
| 824 | 824 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
| 825 | 825 | if (isset($aairport[0]['latitude'])) { |
| 826 | - //$output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
| 827 | - $end_lon = $aairport[0]['longitude']; |
|
| 828 | - $end_lat = $aairport[0]['latitude']; |
|
| 829 | - $havedata = true; |
|
| 826 | + //$output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
| 827 | + $end_lon = $aairport[0]['longitude']; |
|
| 828 | + $end_lat = $aairport[0]['latitude']; |
|
| 829 | + $havedata = true; |
|
| 830 | 830 | } |
| 831 | - } |
|
| 832 | - if ($havedata) { |
|
| 831 | + } |
|
| 832 | + if ($havedata) { |
|
| 833 | 833 | $line = $Common->greatCircle($spotter_item['latitude'],$spotter_item['longitude'],$end_lat,$end_lon); |
| 834 | 834 | foreach ($line[0] as $coord) { |
| 835 | 835 | $output_dest .= '['.$coord[0].','.$coord[1].'],'; |
| 836 | 836 | } |
| 837 | 837 | $output_dest = substr($output_dest, 0, -1); |
| 838 | - } |
|
| 839 | - $output_dest .= ']}},'; |
|
| 840 | - if ($havedata) $output .= $output_dest; |
|
| 841 | - unset($output_dest); |
|
| 838 | + } |
|
| 839 | + $output_dest .= ']}},'; |
|
| 840 | + if ($havedata) $output .= $output_dest; |
|
| 841 | + unset($output_dest); |
|
| 842 | 842 | } |
| 843 | 843 | } |
| 844 | 844 | $output = substr($output, 0, -1); |