@@ -7,7 +7,9 @@ discard block |
||
| 7 | 7 | $showRouteStop = $Common->multiKeyExists($spotter_array,'route_stop'); |
| 8 | 8 | $showDuration = $Common->multiKeyExists($spotter_array,'duration'); |
| 9 | 9 | |
| 10 | -if (!isset($type)) $type = 'aircraft'; |
|
| 10 | +if (!isset($type)) { |
|
| 11 | + $type = 'aircraft'; |
|
| 12 | +} |
|
| 11 | 13 | |
| 12 | 14 | if (!isset($_GET['sort'])) |
| 13 | 15 | { |
@@ -440,7 +442,9 @@ discard block |
||
| 440 | 442 | if (isset($globalTimezone)) |
| 441 | 443 | { |
| 442 | 444 | date_default_timezone_set($globalTimezone); |
| 443 | - } else date_default_timezone_set('UTC'); |
|
| 445 | + } else { |
|
| 446 | + date_default_timezone_set('UTC'); |
|
| 447 | + } |
|
| 444 | 448 | if ($showSpecial === true) |
| 445 | 449 | { |
| 446 | 450 | print '<tr class="special">'."\n"; |
@@ -455,7 +459,9 @@ discard block |
||
| 455 | 459 | print '<tr class="active">'; |
| 456 | 460 | } elseif (isset($spotter_item['spotted_registration'])) { |
| 457 | 461 | print '<tr class="info">'; |
| 458 | - } else print '<tr>'; |
|
| 462 | + } else { |
|
| 463 | + print '<tr>'; |
|
| 464 | + } |
|
| 459 | 465 | } |
| 460 | 466 | if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive" || strtolower($current_page) == "currently" || strtolower($current_page) == "accident-latest" || strtolower($current_page) == "incident-latest" || strtolower($current_page) == "accident-detailed" || strtolower($current_page) == "incident-detailed") { |
| 461 | 467 | if ($type == 'aircraft') { |
@@ -463,8 +469,9 @@ discard block |
||
| 463 | 469 | { |
| 464 | 470 | print '<td class="aircraft_thumbnail">'."\n"; |
| 465 | 471 | if ($spotter_item['image_source'] == 'planespotters') { |
| 466 | - if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website']; |
|
| 467 | - else { |
|
| 472 | + if ($spotter_item['image_source_website'] != '') { |
|
| 473 | + $image_src = $spotter_item['image_source_website']; |
|
| 474 | + } else { |
|
| 468 | 475 | $planespotter_url_array = explode("_", $spotter_item['image']); |
| 469 | 476 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
| 470 | 477 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
@@ -477,7 +484,9 @@ discard block |
||
| 477 | 484 | } else { |
| 478 | 485 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 479 | 486 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 480 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 487 | + } else { |
|
| 488 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 489 | + } |
|
| 481 | 490 | if (isset($spotter_item['airline_name'])) { |
| 482 | 491 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
| 483 | 492 | } else { |
@@ -496,7 +505,9 @@ discard block |
||
| 496 | 505 | print '<td class="aircraft_thumbnail">'."\n"; |
| 497 | 506 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 498 | 507 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 499 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 508 | + } else { |
|
| 509 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 510 | + } |
|
| 500 | 511 | if (isset($spotter_item['airline_name'])) { |
| 501 | 512 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['mmsi'].'" alt="'.$spotter_item['mmsi'].'" data-content="'._("MMSI:").' '.$spotter_item['mmsi'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
| 502 | 513 | } else { |
@@ -514,7 +525,9 @@ discard block |
||
| 514 | 525 | print '<td class="aircraft_thumbnail">'."\n"; |
| 515 | 526 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 516 | 527 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 517 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 528 | + } else { |
|
| 529 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 530 | + } |
|
| 518 | 531 | if (isset($spotter_item['airline_name'])) { |
| 519 | 532 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['type'].'" data-content="'._("Type:").' '.$spotter_item['type'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
| 520 | 533 | } else { |
@@ -537,8 +550,9 @@ discard block |
||
| 537 | 550 | print '<td class="aircraft_thumbnail">'."\n"; |
| 538 | 551 | //print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$spotter_item['image_thumbnail'].'" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
| 539 | 552 | if ($spotter_item['image_source'] == 'planespotters') { |
| 540 | - if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website']; |
|
| 541 | - else { |
|
| 553 | + if ($spotter_item['image_source_website'] != '') { |
|
| 554 | + $image_src = $spotter_item['image_source_website']; |
|
| 555 | + } else { |
|
| 542 | 556 | $planespotter_url_array = explode("_", $spotter_array[0]['image']); |
| 543 | 557 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
| 544 | 558 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
@@ -555,7 +569,9 @@ discard block |
||
| 555 | 569 | } else { |
| 556 | 570 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 557 | 571 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 558 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 572 | + } else { |
|
| 573 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 574 | + } |
|
| 559 | 575 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
| 560 | 576 | print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
| 561 | 577 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
@@ -588,7 +604,9 @@ discard block |
||
| 588 | 604 | print '<td class="aircraft_thumbnail">'."\n"; |
| 589 | 605 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 590 | 606 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 591 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 607 | + } else { |
|
| 608 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 609 | + } |
|
| 592 | 610 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['mmsi'].'" alt="'.$spotter_item['mmsi'].'" data-content="'._("MMSI:").' '.$spotter_item['mmsi'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
| 593 | 611 | print '</td>'."\n"; |
| 594 | 612 | } else { |
@@ -602,7 +620,9 @@ discard block |
||
| 602 | 620 | print '<td class="aircraft_thumbnail">'."\n"; |
| 603 | 621 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 604 | 622 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 605 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 623 | + } else { |
|
| 624 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 625 | + } |
|
| 606 | 626 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['type'].'" data-content="'._("Type:").' '.$spotter_item['type'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
| 607 | 627 | print '</td>'."\n"; |
| 608 | 628 | } else { |
@@ -723,15 +743,21 @@ discard block |
||
| 723 | 743 | if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) { |
| 724 | 744 | if ($spotter_item['departure_airport_time'] > 2460) { |
| 725 | 745 | $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
| 726 | - } else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
| 746 | + } else { |
|
| 747 | + $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
| 748 | + } |
|
| 727 | 749 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
| 728 | 750 | $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
| 729 | - } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
| 751 | + } else { |
|
| 752 | + $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
| 753 | + } |
|
| 730 | 754 | print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n"; |
| 731 | 755 | } elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') { |
| 732 | 756 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
| 733 | 757 | $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
| 734 | - } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
| 758 | + } else { |
|
| 759 | + $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
| 760 | + } |
|
| 735 | 761 | print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n"; |
| 736 | 762 | } elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
| 737 | 763 | if ($spotter_item['departure_airport_time'] > 2460) { |
@@ -753,7 +779,9 @@ discard block |
||
| 753 | 779 | $longitude = $spotter_item['longitude']; |
| 754 | 780 | } |
| 755 | 781 | $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
| 756 | - } else $distance = ''; |
|
| 782 | + } else { |
|
| 783 | + $distance = ''; |
|
| 784 | + } |
|
| 757 | 785 | if ($distance != '') { |
| 758 | 786 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
| 759 | 787 | echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
@@ -780,7 +808,9 @@ discard block |
||
| 780 | 808 | } else { |
| 781 | 809 | if (isset($spotter_item['real_arrival_airport']) && $spotter_item['real_arrival_airport'] != $spotter_item['arrival_airport']) { |
| 782 | 810 | print '<span class="nomobile">Scheduled : <a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'">'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</a></span>'."\n"; |
| 783 | - if (!isset($Spotter)) $Spotter = new Spotter(); |
|
| 811 | + if (!isset($Spotter)) { |
|
| 812 | + $Spotter = new Spotter(); |
|
| 813 | + } |
|
| 784 | 814 | $arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['real_arrival_airport']); |
| 785 | 815 | print '<br /><span class="nomobile">'._("Real:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$arrival_airport_info[0]['city'].','.$arrival_airport_info[0]['country'].' ('.$spotter_item['real_arrival_airport'].')</a></span>'."\n"; |
| 786 | 816 | print '<span class="mobile">'._("Scheduled:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$spotter_item['real_arrival_airport'].'</a></span>'."\n"; |
@@ -796,20 +826,28 @@ discard block |
||
| 796 | 826 | if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) { |
| 797 | 827 | if ($spotter_item['arrival_airport_time'] > 2460) { |
| 798 | 828 | $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
| 799 | - } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
| 829 | + } else { |
|
| 830 | + $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
| 831 | + } |
|
| 800 | 832 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
| 801 | 833 | $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
| 802 | - } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
| 834 | + } else { |
|
| 835 | + $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
| 836 | + } |
|
| 803 | 837 | print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n"; |
| 804 | 838 | } elseif (isset($spotter_item['real_arrival_airport_time'])) { |
| 805 | 839 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
| 806 | 840 | $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
| 807 | - } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
| 841 | + } else { |
|
| 842 | + $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
| 843 | + } |
|
| 808 | 844 | print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n"; |
| 809 | 845 | } elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') { |
| 810 | 846 | if ($spotter_item['arrival_airport_time'] > 2460) { |
| 811 | 847 | $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
| 812 | - } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
| 848 | + } else { |
|
| 849 | + $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
| 850 | + } |
|
| 813 | 851 | print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n"; |
| 814 | 852 | } |
| 815 | 853 | if (!isset($spotter_item['real_arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
@@ -822,7 +860,9 @@ discard block |
||
| 822 | 860 | $longitude = $spotter_item['longitude']; |
| 823 | 861 | } |
| 824 | 862 | $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
| 825 | - } else $distance = ''; |
|
| 863 | + } else { |
|
| 864 | + $distance = ''; |
|
| 865 | + } |
|
| 826 | 866 | if ($distance != '') { |
| 827 | 867 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
| 828 | 868 | echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $limit_start = 0; |
| 29 | 29 | $limit_end = 25; |
| 30 | 30 | $absolute_difference = 25; |
| 31 | -} else { |
|
| 31 | +} else { |
|
| 32 | 32 | $limit_explode = explode(",", $_GET['limit']); |
| 33 | 33 | $limit_start = $limit_explode[0]; |
| 34 | 34 | $limit_end = $limit_explode[1]; |
@@ -47,9 +47,14 @@ discard block |
||
| 47 | 47 | print '<h1>'._("Latest Activity").'</h1>'; |
| 48 | 48 | print '</div>'; |
| 49 | 49 | print '<div class="table column">'; |
| 50 | -if ($type == 'marine') print '<p>'._("The table below shows the detailed information of all recent vessels.").'</p>'; |
|
| 51 | -if ($type == 'tracker') print '<p>'._("The table below shows the detailed information of all recent trackers.").'</p>'; |
|
| 52 | -else print '<p>'._("The table below shows the detailed information of all recent flights.").'</p>'; |
|
| 50 | +if ($type == 'marine') { |
|
| 51 | + print '<p>'._("The table below shows the detailed information of all recent vessels.").'</p>'; |
|
| 52 | +} |
|
| 53 | +if ($type == 'tracker') { |
|
| 54 | + print '<p>'._("The table below shows the detailed information of all recent trackers.").'</p>'; |
|
| 55 | +} else { |
|
| 56 | + print '<p>'._("The table below shows the detailed information of all recent flights.").'</p>'; |
|
| 57 | +} |
|
| 53 | 58 | |
| 54 | 59 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
| 55 | 60 | $sql_begin = microtime(true); |
@@ -118,8 +118,12 @@ discard block |
||
| 118 | 118 | { |
| 119 | 119 | $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['ident']); |
| 120 | 120 | $ident = $spotter_array[0]['ident']; |
| 121 | - if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
|
| 122 | - if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
|
| 121 | + if (isset($spotter_array[0]['latitude'])) { |
|
| 122 | + $latitude = $spotter_array[0]['latitude']; |
|
| 123 | + } |
|
| 124 | + if (isset($spotter_array[0]['longitude'])) { |
|
| 125 | + $longitude = $spotter_array[0]['longitude']; |
|
| 126 | + } |
|
| 123 | 127 | require_once('header.php'); |
| 124 | 128 | if (isset($globalArchive) && $globalArchive && $type == 'aircraft') { |
| 125 | 129 | // Requirement for altitude graph |
@@ -127,7 +131,9 @@ discard block |
||
| 127 | 131 | $all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']); |
| 128 | 132 | if (isset($globalTimezone)) { |
| 129 | 133 | date_default_timezone_set($globalTimezone); |
| 130 | - } else date_default_timezone_set('UTC'); |
|
| 134 | + } else { |
|
| 135 | + date_default_timezone_set('UTC'); |
|
| 136 | + } |
|
| 131 | 137 | if (count($all_data) > 0) { |
| 132 | 138 | print '<div id="chart6" class="chart" width="100%"></div> |
| 133 | 139 | <script> |
@@ -174,14 +180,22 @@ discard block |
||
| 174 | 180 | if (isset($spotter_array[0]['airline_icao'])) { |
| 175 | 181 | print '<div><span class="label">'._("Airline").'</span><a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a></div>'; |
| 176 | 182 | } |
| 177 | - if ($type == 'aircraft') print '<div><span class="label">'._("Flight History").'</span><a href="http://flightaware.com/live/flight/'.$spotter_array[0]['ident'].'" target="_blank">'._("View the Flight History of this callsign").'</a></div>'; |
|
| 183 | + if ($type == 'aircraft') { |
|
| 184 | + print '<div><span class="label">'._("Flight History").'</span><a href="http://flightaware.com/live/flight/'.$spotter_array[0]['ident'].'" target="_blank">'._("View the Flight History of this callsign").'</a></div>'; |
|
| 185 | + } |
|
| 178 | 186 | print '</div>'; |
| 179 | 187 | |
| 180 | - if ($type == 'aircraft') include('ident-sub-menu.php'); |
|
| 188 | + if ($type == 'aircraft') { |
|
| 189 | + include('ident-sub-menu.php'); |
|
| 190 | + } |
|
| 181 | 191 | print '<div class="table column">'; |
| 182 | - if ($type == 'aircraft') print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 183 | - elseif ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 184 | - elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 192 | + if ($type == 'aircraft') { |
|
| 193 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 194 | + } elseif ($type == 'marine') { |
|
| 195 | + print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 196 | + } elseif ($type == 'tracker') { |
|
| 197 | + print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 198 | + } |
|
| 185 | 199 | |
| 186 | 200 | include('table-output.php'); |
| 187 | 201 | print '<div class="pagination">'; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $limit_start = 0; |
| 32 | 32 | $limit_end = 25; |
| 33 | 33 | $absolute_difference = 25; |
| 34 | -} else { |
|
| 34 | +} else { |
|
| 35 | 35 | $limit_explode = explode(",", $_GET['limit']); |
| 36 | 36 | $limit_start = $limit_explode[0]; |
| 37 | 37 | $limit_end = $limit_explode[1]; |
@@ -50,20 +50,32 @@ discard block |
||
| 50 | 50 | print '</div>'; |
| 51 | 51 | |
| 52 | 52 | print '<div class="table column">'; |
| 53 | -if ($type == 'aircraft') print '<p>'._("The table below shows the detailed information of all current flights.").'</p>'; |
|
| 54 | -elseif ($type == 'marine') print '<p>'._("The table below shows the detailed information of all current vessels.").'</p>'; |
|
| 55 | -elseif ($type == 'tracker') print '<p>'._("The table below shows the detailed information of all current trackers.").'</p>'; |
|
| 53 | +if ($type == 'aircraft') { |
|
| 54 | + print '<p>'._("The table below shows the detailed information of all current flights.").'</p>'; |
|
| 55 | +} elseif ($type == 'marine') { |
|
| 56 | + print '<p>'._("The table below shows the detailed information of all current vessels.").'</p>'; |
|
| 57 | +} elseif ($type == 'tracker') { |
|
| 58 | + print '<p>'._("The table below shows the detailed information of all current trackers.").'</p>'; |
|
| 59 | +} |
|
| 56 | 60 | |
| 57 | 61 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
| 58 | 62 | if ($sort != '') { |
| 59 | - if ($type == 'aircraft') $spotter_array = $SpotterLive->getLiveSpotterData($limit_start.",".$absolute_difference, $sort); |
|
| 60 | - elseif ($type == 'marine') $spotter_array = $MarineLive->getLiveMarineData($limit_start.",".$absolute_difference, $sort); |
|
| 61 | - elseif ($type == 'tracker') $spotter_array = $TrackerLive->getLiveTrackerData($limit_start.",".$absolute_difference, $sort); |
|
| 62 | -} else { |
|
| 63 | - if ($type == 'aircraft') $spotter_array = $SpotterLive->getLiveSpotterData($limit_start.",".$absolute_difference); |
|
| 64 | - elseif ($type == 'marine') $spotter_array = $MarineLive->getLiveMarineData($limit_start.",".$absolute_difference); |
|
| 65 | - elseif ($type == 'tracker') $spotter_array = $TrackerLive->getLiveTrackerData($limit_start.",".$absolute_difference); |
|
| 66 | -} |
|
| 63 | + if ($type == 'aircraft') { |
|
| 64 | + $spotter_array = $SpotterLive->getLiveSpotterData($limit_start.",".$absolute_difference, $sort); |
|
| 65 | + } elseif ($type == 'marine') { |
|
| 66 | + $spotter_array = $MarineLive->getLiveMarineData($limit_start.",".$absolute_difference, $sort); |
|
| 67 | + } elseif ($type == 'tracker') { |
|
| 68 | + $spotter_array = $TrackerLive->getLiveTrackerData($limit_start.",".$absolute_difference, $sort); |
|
| 69 | + } |
|
| 70 | + } else { |
|
| 71 | + if ($type == 'aircraft') { |
|
| 72 | + $spotter_array = $SpotterLive->getLiveSpotterData($limit_start.",".$absolute_difference); |
|
| 73 | + } elseif ($type == 'marine') { |
|
| 74 | + $spotter_array = $MarineLive->getLiveMarineData($limit_start.",".$absolute_difference); |
|
| 75 | + } elseif ($type == 'tracker') { |
|
| 76 | + $spotter_array = $TrackerLive->getLiveTrackerData($limit_start.",".$absolute_difference); |
|
| 77 | + } |
|
| 78 | + } |
|
| 67 | 79 | |
| 68 | 80 | if (!empty($spotter_array)) |
| 69 | 81 | { |
@@ -1,11 +1,20 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | require_once(dirname(__FILE__).'/require/settings.php'); |
| 3 | 3 | $type = 'aircraft'; |
| 4 | -if (isset($_GET['marine'])) $type = 'marine'; |
|
| 5 | -elseif (isset($_GET['tracker'])) $type = 'tracker'; |
|
| 4 | +if (isset($_GET['marine'])) { |
|
| 5 | + $type = 'marine'; |
|
| 6 | +} elseif (isset($_GET['tracker'])) { |
|
| 7 | + $type = 'tracker'; |
|
| 8 | +} |
|
| 6 | 9 | $date = filter_input(INPUT_POST,'date',FILTER_SANITIZE_STRING); |
| 7 | -if ($date == '') $date = date('Y-m-d'); |
|
| 8 | -if ($type == 'marine') header('Location: '.$globalURL.'/marine/date/'.$date); |
|
| 9 | -elseif ($type == 'tracker') header('Location: '.$globalURL.'/tracker/date/'.$date); |
|
| 10 | -else header('Location: '.$globalURL.'/date/'.$date); |
|
| 10 | +if ($date == '') { |
|
| 11 | + $date = date('Y-m-d'); |
|
| 12 | +} |
|
| 13 | +if ($type == 'marine') { |
|
| 14 | + header('Location: '.$globalURL.'/marine/date/'.$date); |
|
| 15 | +} elseif ($type == 'tracker') { |
|
| 16 | + header('Location: '.$globalURL.'/tracker/date/'.$date); |
|
| 17 | +} else { |
|
| 18 | + header('Location: '.$globalURL.'/date/'.$date); |
|
| 19 | +} |
|
| 11 | 20 | ?> |
| 12 | 21 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $limit_start = 0; |
| 30 | 30 | $limit_end = 25; |
| 31 | 31 | $absolute_difference = 25; |
| 32 | - } else { |
|
| 32 | + } else { |
|
| 33 | 33 | $limit_explode = explode(",", $_GET['limit']); |
| 34 | 34 | $limit_start = $limit_explode[0]; |
| 35 | 35 | $limit_end = $limit_explode[1]; |
@@ -46,21 +46,33 @@ discard block |
||
| 46 | 46 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
| 47 | 47 | if ($sort != '') |
| 48 | 48 | { |
| 49 | - if ($type == 'marine') $spotter_array = $Marine->getMarineDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
| 50 | - elseif ($type == 'tracker') $spotter_array = $Tracker->getTrackerDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
| 51 | - else $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
| 49 | + if ($type == 'marine') { |
|
| 50 | + $spotter_array = $Marine->getMarineDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
| 51 | + } elseif ($type == 'tracker') { |
|
| 52 | + $spotter_array = $Tracker->getTrackerDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
| 53 | + } else { |
|
| 54 | + $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
| 55 | + } |
|
| 52 | 56 | } else { |
| 53 | - if ($type == 'marine') $spotter_array = $Marine->getMarineDataByDate($date,$limit_start.",".$absolute_difference); |
|
| 54 | - elseif ($type == 'tracker') $spotter_array = $Tracker->getTrackerDataByDate($date,$limit_start.",".$absolute_difference); |
|
| 55 | - else $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference); |
|
| 57 | + if ($type == 'marine') { |
|
| 58 | + $spotter_array = $Marine->getMarineDataByDate($date,$limit_start.",".$absolute_difference); |
|
| 59 | + } elseif ($type == 'tracker') { |
|
| 60 | + $spotter_array = $Tracker->getTrackerDataByDate($date,$limit_start.",".$absolute_difference); |
|
| 61 | + } else { |
|
| 62 | + $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference); |
|
| 63 | + } |
|
| 56 | 64 | } |
| 57 | 65 | |
| 58 | 66 | if (!empty($spotter_array)) |
| 59 | 67 | { |
| 60 | 68 | date_default_timezone_set($globalTimezone); |
| 61 | - if ($type == 'marine') $title = sprintf(_("Detailed View for vessels from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 62 | - elseif ($type == 'tracker') $title = sprintf(_("Detailed View for trackers from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 63 | - else $title = sprintf(_("Detailed View for flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 69 | + if ($type == 'marine') { |
|
| 70 | + $title = sprintf(_("Detailed View for vessels from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 71 | + } elseif ($type == 'tracker') { |
|
| 72 | + $title = sprintf(_("Detailed View for trackers from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 73 | + } else { |
|
| 74 | + $title = sprintf(_("Detailed View for flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 75 | + } |
|
| 64 | 76 | |
| 65 | 77 | require_once('header.php'); |
| 66 | 78 | print '<div class="select-item">'; |
@@ -78,15 +90,24 @@ discard block |
||
| 78 | 90 | print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>'; |
| 79 | 91 | print '<br />'; |
| 80 | 92 | print '<div class="info column">'; |
| 81 | - if ($type == 'marine') print '<h1>'.sprintf(_("Vessels from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 82 | - else print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 93 | + if ($type == 'marine') { |
|
| 94 | + print '<h1>'.sprintf(_("Vessels from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 95 | + } else { |
|
| 96 | + print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 97 | + } |
|
| 83 | 98 | print '</div>'; |
| 84 | 99 | |
| 85 | - if ($type == 'aircraft') include('date-sub-menu.php'); |
|
| 100 | + if ($type == 'aircraft') { |
|
| 101 | + include('date-sub-menu.php'); |
|
| 102 | + } |
|
| 86 | 103 | print '<div class="table column">'; |
| 87 | - if ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 88 | - elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 89 | - else print '<p>'.sprintf(_("The table below shows the detailed information of all flights on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 104 | + if ($type == 'marine') { |
|
| 105 | + print '<p>'.sprintf(_("The table below shows the detailed information of all vessels on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 106 | + } elseif ($type == 'tracker') { |
|
| 107 | + print '<p>'.sprintf(_("The table below shows the detailed information of all trackers on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 108 | + } else { |
|
| 109 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 110 | + } |
|
| 90 | 111 | |
| 91 | 112 | include('table-output.php'); |
| 92 | 113 | print '<div class="pagination">'; |
@@ -44,7 +44,9 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | public function checkAll() { |
| 46 | 46 | global $globalDebug; |
| 47 | - if ($globalDebug) echo "Update last seen tracked data...\n"; |
|
| 47 | + if ($globalDebug) { |
|
| 48 | + echo "Update last seen tracked data...\n"; |
|
| 49 | + } |
|
| 48 | 50 | foreach ($this->all_tracked as $key => $flight) { |
| 49 | 51 | if (isset($this->all_tracked[$key]['id'])) { |
| 50 | 52 | //echo $this->all_tracked[$key]['id'].' - '.$this->all_tracked[$key]['latitude'].' '.$this->all_tracked[$key]['longitude']."\n"; |
@@ -57,12 +59,16 @@ discard block |
||
| 57 | 59 | public function del() { |
| 58 | 60 | global $globalDebug; |
| 59 | 61 | // Delete old infos |
| 60 | - if ($globalDebug) echo 'Delete old values and update latest data...'."\n"; |
|
| 62 | + if ($globalDebug) { |
|
| 63 | + echo 'Delete old values and update latest data...'."\n"; |
|
| 64 | + } |
|
| 61 | 65 | foreach ($this->all_tracked as $key => $flight) { |
| 62 | 66 | if (isset($flight['lastupdate'])) { |
| 63 | 67 | if ($flight['lastupdate'] < (time()-3000)) { |
| 64 | 68 | if (isset($this->all_tracked[$key]['id'])) { |
| 65 | - if ($globalDebug) echo "--- Delete old values with id ".$this->all_tracked[$key]['id']."\n"; |
|
| 69 | + if ($globalDebug) { |
|
| 70 | + echo "--- Delete old values with id ".$this->all_tracked[$key]['id']."\n"; |
|
| 71 | + } |
|
| 66 | 72 | /* |
| 67 | 73 | $TrackerLive = new TrackerLive(); |
| 68 | 74 | $TrackerLive->deleteLiveTrackerDataById($this->all_tracked[$key]['id']); |
@@ -72,7 +78,9 @@ discard block |
||
| 72 | 78 | $Tracker = new Tracker($this->db); |
| 73 | 79 | if ($this->all_tracked[$key]['latitude'] != '' && $this->all_tracked[$key]['longitude'] != '') { |
| 74 | 80 | $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']); |
| 75 | - if ($globalDebug && $result != 'success') echo '!!! ERROR : '.$result."\n"; |
|
| 81 | + if ($globalDebug && $result != 'success') { |
|
| 82 | + echo '!!! ERROR : '.$result."\n"; |
|
| 83 | + } |
|
| 76 | 84 | } |
| 77 | 85 | // Put in archive |
| 78 | 86 | // $Tracker->db = null; |
@@ -85,7 +93,9 @@ discard block |
||
| 85 | 93 | |
| 86 | 94 | public function add($line) { |
| 87 | 95 | global $globalFork, $globalDistanceIgnore, $globalDaemon, $globalDebug, $globalCoordMinChange, $globalDebugTimeElapsed, $globalCenterLatitude, $globalCenterLongitude, $globalBeta, $globalSourcesupdate, $globalAllTracked; |
| 88 | - if (!isset($globalCoordMinChange) || $globalCoordMinChange == '') $globalCoordMinChange = '0.02'; |
|
| 96 | + if (!isset($globalCoordMinChange) || $globalCoordMinChange == '') { |
|
| 97 | + $globalCoordMinChange = '0.02'; |
|
| 98 | + } |
|
| 89 | 99 | date_default_timezone_set('UTC'); |
| 90 | 100 | $dataFound = false; |
| 91 | 101 | $send = false; |
@@ -109,8 +119,11 @@ discard block |
||
| 109 | 119 | */ |
| 110 | 120 | |
| 111 | 121 | $Common = new Common(); |
| 112 | - if (!isset($line['id'])) $id = trim($line['ident']); |
|
| 113 | - else $id = trim($line['id']); |
|
| 122 | + if (!isset($line['id'])) { |
|
| 123 | + $id = trim($line['ident']); |
|
| 124 | + } else { |
|
| 125 | + $id = trim($line['id']); |
|
| 126 | + } |
|
| 114 | 127 | |
| 115 | 128 | if (!isset($this->all_tracked[$id])) { |
| 116 | 129 | $this->all_tracked[$id] = array(); |
@@ -118,31 +131,46 @@ discard block |
||
| 118 | 131 | $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' => '')); |
| 119 | 132 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('lastupdate' => time())); |
| 120 | 133 | if (!isset($line['id'])) { |
| 121 | - if (!isset($globalDaemon)) $globalDaemon = TRUE; |
|
| 134 | + if (!isset($globalDaemon)) { |
|
| 135 | + $globalDaemon = TRUE; |
|
| 136 | + } |
|
| 122 | 137 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $id.'-'.date('YmdHi'))); |
| 123 | - } else $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $line['id'])); |
|
| 124 | - if ($globalAllTracked !== FALSE) $dataFound = true; |
|
| 138 | + } else { |
|
| 139 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $line['id'])); |
|
| 140 | + } |
|
| 141 | + if ($globalAllTracked !== FALSE) { |
|
| 142 | + $dataFound = true; |
|
| 143 | + } |
|
| 125 | 144 | } |
| 126 | 145 | |
| 127 | 146 | if (isset($line['datetime']) && strtotime($line['datetime']) > time()-20*60 && strtotime($line['datetime']) < time()+20*60) { |
| 128 | 147 | if (!isset($this->all_tracked[$id]['datetime']) || strtotime($line['datetime']) >= strtotime($this->all_tracked[$id]['datetime'])) { |
| 129 | 148 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('datetime' => $line['datetime'])); |
| 130 | 149 | } else { |
| 131 | - if (strtotime($line['datetime']) == strtotime($this->all_tracked[$id]['datetime']) && $globalDebug) echo "!!! Date is the same as previous data for ".$this->all_tracked[$id]['hex']." - format : ".$line['format_source']."\n"; |
|
| 132 | - 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]['hex']." - format : ".$line['format_source']."\n"; |
|
| 150 | + if (strtotime($line['datetime']) == strtotime($this->all_tracked[$id]['datetime']) && $globalDebug) { |
|
| 151 | + echo "!!! Date is the same as previous data for ".$this->all_tracked[$id]['hex']." - format : ".$line['format_source']."\n"; |
|
| 152 | + } elseif (strtotime($line['datetime']) > strtotime($this->all_tracked[$id]['datetime']) && $globalDebug) { |
|
| 153 | + echo "!!! Date previous latest data (".$line['datetime']." > ".$this->all_tracked[$id]['datetime'].") !!! for ".$this->all_tracked[$id]['hex']." - format : ".$line['format_source']."\n"; |
|
| 154 | + } |
|
| 133 | 155 | return ''; |
| 134 | 156 | } |
| 135 | 157 | } elseif (isset($line['datetime']) && strtotime($line['datetime']) < time()-20*60) { |
| 136 | - if ($globalDebug) echo "!!! Date is too old ".$this->all_tracked[$id]['hex']." - format : ".$line['format_source']."!!!"; |
|
| 158 | + if ($globalDebug) { |
|
| 159 | + echo "!!! Date is too old ".$this->all_tracked[$id]['hex']." - format : ".$line['format_source']."!!!"; |
|
| 160 | + } |
|
| 137 | 161 | return ''; |
| 138 | 162 | } elseif (isset($line['datetime']) && strtotime($line['datetime']) > time()+20*60) { |
| 139 | - if ($globalDebug) echo "!!! Date is in the future ".$this->all_tracked[$id]['hex']." - format : ".$line['format_source']."!!!"; |
|
| 163 | + if ($globalDebug) { |
|
| 164 | + echo "!!! Date is in the future ".$this->all_tracked[$id]['hex']." - format : ".$line['format_source']."!!!"; |
|
| 165 | + } |
|
| 140 | 166 | return ''; |
| 141 | 167 | } elseif (!isset($line['datetime'])) { |
| 142 | 168 | date_default_timezone_set('UTC'); |
| 143 | 169 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('datetime' => date('Y-m-d H:i:s'))); |
| 144 | 170 | } else { |
| 145 | - if ($globalDebug) echo "!!! Unknow date error ".$this->all_tracked[$id]['hex']." - format : ".$line['format_source']."!!!"; |
|
| 171 | + if ($globalDebug) { |
|
| 172 | + echo "!!! Unknow date error ".$this->all_tracked[$id]['hex']." - format : ".$line['format_source']."!!!"; |
|
| 173 | + } |
|
| 146 | 174 | return ''; |
| 147 | 175 | } |
| 148 | 176 | |
@@ -154,11 +182,17 @@ discard block |
||
| 154 | 182 | $Tracker = new Tracker($this->db); |
| 155 | 183 | $fromsource = NULL; |
| 156 | 184 | $result = $Tracker->updateIdentTrackerData($this->all_tracked[$id]['id'],$this->all_tracked[$id]['ident'],$fromsource); |
| 157 | - if ($globalDebug && $result != 'success') echo '!!! ERROR : '.$result."\n"; |
|
| 185 | + if ($globalDebug && $result != 'success') { |
|
| 186 | + echo '!!! ERROR : '.$result."\n"; |
|
| 187 | + } |
|
| 158 | 188 | $Tracker->db = null; |
| 159 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update identspotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 189 | + if ($globalDebugTimeElapsed) { |
|
| 190 | + echo 'Time elapsed for update identspotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 191 | + } |
|
| 192 | + } |
|
| 193 | + if (!isset($this->all_tracked[$id]['id'])) { |
|
| 194 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $this->all_tracked[$id]['ident'])); |
|
| 160 | 195 | } |
| 161 | - if (!isset($this->all_tracked[$id]['id'])) $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $this->all_tracked[$id]['ident'])); |
|
| 162 | 196 | } |
| 163 | 197 | |
| 164 | 198 | if (isset($line['speed']) && $line['speed'] != '') { |
@@ -169,14 +203,21 @@ discard block |
||
| 169 | 203 | if ($distance > 1000 && $distance < 10000) { |
| 170 | 204 | $speed = $distance/(time() - $this->all_tracked[$id]['time_last_coord']); |
| 171 | 205 | $speed = $speed*3.6; |
| 172 | - if ($speed < 1000) $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('speed' => round($speed))); |
|
| 173 | - if ($globalDebug) echo "ø Calculated Speed for ".$this->all_tracked[$id]['ident']." : ".$speed." - distance : ".$distance."\n"; |
|
| 206 | + if ($speed < 1000) { |
|
| 207 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('speed' => round($speed))); |
|
| 208 | + } |
|
| 209 | + if ($globalDebug) { |
|
| 210 | + echo "ø Calculated Speed for ".$this->all_tracked[$id]['ident']." : ".$speed." - distance : ".$distance."\n"; |
|
| 211 | + } |
|
| 174 | 212 | } |
| 175 | 213 | } |
| 176 | 214 | |
| 177 | 215 | if (isset($line['latitude']) && isset($line['longitude']) && $line['latitude'] != '' && $line['longitude'] != '' && is_numeric($line['latitude']) && is_numeric($line['longitude'])) { |
| 178 | - if (isset($this->all_tracked[$id]['time_last_coord'])) $timediff = round(time()-$this->all_tracked[$id]['time_last_coord']); |
|
| 179 | - else unset($timediff); |
|
| 216 | + if (isset($this->all_tracked[$id]['time_last_coord'])) { |
|
| 217 | + $timediff = round(time()-$this->all_tracked[$id]['time_last_coord']); |
|
| 218 | + } else { |
|
| 219 | + unset($timediff); |
|
| 220 | + } |
|
| 180 | 221 | if ($this->tmd > 5 || !isset($timediff) || $timediff > 2000 || ($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')))) { |
| 181 | 222 | 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'])) { |
| 182 | 223 | 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'])) { |
@@ -184,20 +225,30 @@ discard block |
||
| 184 | 225 | $this->all_tracked[$id]['archive_longitude'] = $line['longitude']; |
| 185 | 226 | $this->all_tracked[$id]['putinarchive'] = true; |
| 186 | 227 | |
| 187 | - if ($globalDebug) echo "\n".' ------- Check Country for '.$this->all_tracked[$id]['ident'].' with latitude : '.$line['latitude'].' and longitude : '.$line['longitude'].'.... '; |
|
| 228 | + if ($globalDebug) { |
|
| 229 | + echo "\n".' ------- Check Country for '.$this->all_tracked[$id]['ident'].' with latitude : '.$line['latitude'].' and longitude : '.$line['longitude'].'.... '; |
|
| 230 | + } |
|
| 188 | 231 | $timeelapsed = microtime(true); |
| 189 | 232 | $Tracker = new Tracker($this->db); |
| 190 | 233 | $all_country = $Tracker->getCountryFromLatitudeLongitude($line['latitude'],$line['longitude']); |
| 191 | - if (!empty($all_country)) $this->all_tracked[$id]['over_country'] = $all_country['iso2']; |
|
| 234 | + if (!empty($all_country)) { |
|
| 235 | + $this->all_tracked[$id]['over_country'] = $all_country['iso2']; |
|
| 236 | + } |
|
| 192 | 237 | $Tracker->db = null; |
| 193 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update getCountryFromlatitudeLongitude : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 238 | + if ($globalDebugTimeElapsed) { |
|
| 239 | + echo 'Time elapsed for update getCountryFromlatitudeLongitude : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 240 | + } |
|
| 194 | 241 | $this->tmd = 0; |
| 195 | - if ($globalDebug) echo 'FOUND : '.$this->all_tracked[$id]['over_country'].' ---------------'."\n"; |
|
| 242 | + if ($globalDebug) { |
|
| 243 | + echo 'FOUND : '.$this->all_tracked[$id]['over_country'].' ---------------'."\n"; |
|
| 244 | + } |
|
| 196 | 245 | } |
| 197 | 246 | } |
| 198 | 247 | |
| 199 | 248 | if (isset($line['latitude']) && $line['latitude'] != '' && $line['latitude'] != 0 && $line['latitude'] < 91 && $line['latitude'] > -90) { |
| 200 | - if (!isset($this->all_tracked[$id]['archive_latitude'])) $this->all_tracked[$id]['archive_latitude'] = $line['latitude']; |
|
| 249 | + if (!isset($this->all_tracked[$id]['archive_latitude'])) { |
|
| 250 | + $this->all_tracked[$id]['archive_latitude'] = $line['latitude']; |
|
| 251 | + } |
|
| 201 | 252 | if (!isset($this->all_tracked[$id]['livedb_latitude']) || abs($this->all_tracked[$id]['livedb_latitude']-$line['latitude']) > $globalCoordMinChange || $this->all_tracked[$id]['format_source'] == 'aprs') { |
| 202 | 253 | $this->all_tracked[$id]['livedb_latitude'] = $line['latitude']; |
| 203 | 254 | $dataFound = true; |
@@ -206,8 +257,12 @@ discard block |
||
| 206 | 257 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('latitude' => $line['latitude'])); |
| 207 | 258 | } |
| 208 | 259 | if (isset($line['longitude']) && $line['longitude'] != '' && $line['longitude'] != 0 && $line['longitude'] < 360 && $line['longitude'] > -180) { |
| 209 | - if ($line['longitude'] > 180) $line['longitude'] = $line['longitude'] - 360; |
|
| 210 | - if (!isset($this->all_tracked[$id]['archive_longitude'])) $this->all_tracked[$id]['archive_longitude'] = $line['longitude']; |
|
| 260 | + if ($line['longitude'] > 180) { |
|
| 261 | + $line['longitude'] = $line['longitude'] - 360; |
|
| 262 | + } |
|
| 263 | + if (!isset($this->all_tracked[$id]['archive_longitude'])) { |
|
| 264 | + $this->all_tracked[$id]['archive_longitude'] = $line['longitude']; |
|
| 265 | + } |
|
| 211 | 266 | if (!isset($this->all_tracked[$id]['livedb_longitude']) || abs($this->all_tracked[$id]['livedb_longitude']-$line['longitude']) > $globalCoordMinChange || $this->all_tracked[$id]['format_source'] == 'aprs') { |
| 212 | 267 | $this->all_tracked[$id]['livedb_longitude'] = $line['longitude']; |
| 213 | 268 | $dataFound = true; |
@@ -225,7 +280,9 @@ discard block |
||
| 225 | 280 | } |
| 226 | 281 | } |
| 227 | 282 | if (isset($line['last_update']) && $line['last_update'] != '') { |
| 228 | - if (isset($this->all_tracked[$id]['last_update']) && $this->all_tracked[$id]['last_update'] != $line['last_update']) $dataFound = true; |
|
| 283 | + if (isset($this->all_tracked[$id]['last_update']) && $this->all_tracked[$id]['last_update'] != $line['last_update']) { |
|
| 284 | + $dataFound = true; |
|
| 285 | + } |
|
| 229 | 286 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('last_update' => $line['last_update'])); |
| 230 | 287 | } |
| 231 | 288 | if (isset($line['format_source']) && $line['format_source'] != '') { |
@@ -245,7 +302,9 @@ discard block |
||
| 245 | 302 | |
| 246 | 303 | if (isset($line['altitude']) && $line['altitude'] != '') { |
| 247 | 304 | //if (!isset($this->all_tracked[$id]['altitude']) || $this->all_tracked[$id]['altitude'] == '' || ($this->all_tracked[$id]['altitude'] > 0 && $line['altitude'] != 0)) { |
| 248 | - 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; |
|
| 305 | + if (is_int($this->all_tracked[$id]['altitude']) && abs(round($line['altitude']/100)-$this->all_tracked[$id]['altitude']) > 3) { |
|
| 306 | + $this->all_tracked[$id]['putinarchive'] = true; |
|
| 307 | + } |
|
| 249 | 308 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('altitude' => round($line['altitude']/100))); |
| 250 | 309 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('altitude_real' => $line['altitude'])); |
| 251 | 310 | //$dataFound = true; |
@@ -257,15 +316,21 @@ discard block |
||
| 257 | 316 | } |
| 258 | 317 | |
| 259 | 318 | if (isset($line['heading']) && $line['heading'] != '') { |
| 260 | - if (is_int($this->all_tracked[$id]['heading']) && abs($this->all_tracked[$id]['heading']-round($line['heading'])) > 10) $this->all_tracked[$id]['putinarchive'] = true; |
|
| 319 | + if (is_int($this->all_tracked[$id]['heading']) && abs($this->all_tracked[$id]['heading']-round($line['heading'])) > 10) { |
|
| 320 | + $this->all_tracked[$id]['putinarchive'] = true; |
|
| 321 | + } |
|
| 261 | 322 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('heading' => round($line['heading']))); |
| 262 | 323 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('heading_fromsrc' => true)); |
| 263 | 324 | //$dataFound = true; |
| 264 | 325 | } 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']) { |
| 265 | 326 | $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']); |
| 266 | 327 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('heading' => round($heading))); |
| 267 | - if (abs($this->all_tracked[$id]['heading']-round($heading)) > 10) $this->all_tracked[$id]['putinarchive'] = true; |
|
| 268 | - if ($globalDebug) echo "ø Calculated Heading for ".$this->all_tracked[$id]['ident']." : ".$heading."\n"; |
|
| 328 | + if (abs($this->all_tracked[$id]['heading']-round($heading)) > 10) { |
|
| 329 | + $this->all_tracked[$id]['putinarchive'] = true; |
|
| 330 | + } |
|
| 331 | + if ($globalDebug) { |
|
| 332 | + echo "ø Calculated Heading for ".$this->all_tracked[$id]['ident']." : ".$heading."\n"; |
|
| 333 | + } |
|
| 269 | 334 | } |
| 270 | 335 | //if (isset($globalSourcesupdate) && $globalSourcesupdate != '' && isset($this->all_tracked[$id]['lastupdate']) && time()-$this->all_tracked[$id]['lastupdate'] < $globalSourcesupdate) $dataFound = false; |
| 271 | 336 | |
@@ -274,20 +339,31 @@ discard block |
||
| 274 | 339 | if ($this->all_tracked[$id]['addedTracker'] == 0) { |
| 275 | 340 | 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'])) { |
| 276 | 341 | if (!isset($this->all_tracked[$id]['forcenew']) || $this->all_tracked[$id]['forcenew'] == 0) { |
| 277 | - if ($globalDebug) echo "Check if aircraft is already in DB..."; |
|
| 342 | + if ($globalDebug) { |
|
| 343 | + echo "Check if aircraft is already in DB..."; |
|
| 344 | + } |
|
| 278 | 345 | $timeelapsed = microtime(true); |
| 279 | 346 | $TrackerLive = new TrackerLive($this->db); |
| 280 | 347 | if (isset($line['id'])) { |
| 281 | 348 | $recent_ident = $TrackerLive->checkIdRecent($line['id']); |
| 282 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 349 | + if ($globalDebugTimeElapsed) { |
|
| 350 | + echo 'Time elapsed for update checkIdRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 351 | + } |
|
| 283 | 352 | } elseif (isset($this->all_tracked[$id]['ident']) && $this->all_tracked[$id]['ident'] != '') { |
| 284 | 353 | $recent_ident = $TrackerLive->checkIdentRecent($this->all_tracked[$id]['ident']); |
| 285 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdentRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 286 | - } else $recent_ident = ''; |
|
| 354 | + if ($globalDebugTimeElapsed) { |
|
| 355 | + echo 'Time elapsed for update checkIdentRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 356 | + } |
|
| 357 | + } else { |
|
| 358 | + $recent_ident = ''; |
|
| 359 | + } |
|
| 287 | 360 | $TrackerLive->db=null; |
| 288 | 361 | |
| 289 | - if ($globalDebug && $recent_ident == '') echo " Not in DB.\n"; |
|
| 290 | - elseif ($globalDebug && $recent_ident != '') echo " Already in DB.\n"; |
|
| 362 | + if ($globalDebug && $recent_ident == '') { |
|
| 363 | + echo " Not in DB.\n"; |
|
| 364 | + } elseif ($globalDebug && $recent_ident != '') { |
|
| 365 | + echo " Already in DB.\n"; |
|
| 366 | + } |
|
| 291 | 367 | } else { |
| 292 | 368 | $recent_ident = ''; |
| 293 | 369 | $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('forcenew' => 0)); |
@@ -295,16 +371,24 @@ discard block |
||
| 295 | 371 | //if there was no aircraft with the same callsign within the last hour and go post it into the archive |
| 296 | 372 | if($recent_ident == "") |
| 297 | 373 | { |
| 298 | - if ($globalDebug) echo "\o/ Add ".$this->all_tracked[$id]['ident']." in archive DB : "; |
|
| 374 | + if ($globalDebug) { |
|
| 375 | + echo "\o/ Add ".$this->all_tracked[$id]['ident']." in archive DB : "; |
|
| 376 | + } |
|
| 299 | 377 | //adds the spotter data for the archive |
| 300 | 378 | $highlight = ''; |
| 301 | - 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'))); |
|
| 379 | + if (!isset($this->all_tracked[$id]['id'])) { |
|
| 380 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $this->all_tracked[$id]['ident'].'-'.date('YmdHi'))); |
|
| 381 | + } |
|
| 302 | 382 | $timeelapsed = microtime(true); |
| 303 | 383 | $Tracker = new Tracker($this->db); |
| 304 | 384 | $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']); |
| 305 | 385 | $Tracker->db = null; |
| 306 | - if ($globalDebug && isset($result)) echo $result."\n"; |
|
| 307 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update addspotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 386 | + if ($globalDebug && isset($result)) { |
|
| 387 | + echo $result."\n"; |
|
| 388 | + } |
|
| 389 | + if ($globalDebugTimeElapsed) { |
|
| 390 | + echo 'Time elapsed for update addspotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 391 | + } |
|
| 308 | 392 | |
| 309 | 393 | /* |
| 310 | 394 | // Add source stat in DB |
@@ -338,12 +422,16 @@ discard block |
||
| 338 | 422 | $this->all_tracked[$id]['addedTracker'] = 1; |
| 339 | 423 | //print_r($this->all_tracked[$id]); |
| 340 | 424 | if ($this->last_delete == 0 || time() - $this->last_delete > 1800) { |
| 341 | - if ($globalDebug) echo "---- Deleting Live Tracker data older than 9 hours..."; |
|
| 425 | + if ($globalDebug) { |
|
| 426 | + echo "---- Deleting Live Tracker data older than 9 hours..."; |
|
| 427 | + } |
|
| 342 | 428 | //TrackerLive->deleteLiveTrackerDataNotUpdated(); |
| 343 | 429 | $TrackerLive = new TrackerLive($this->db); |
| 344 | 430 | $TrackerLive->deleteLiveTrackerData(); |
| 345 | 431 | $TrackerLive->db=null; |
| 346 | - if ($globalDebug) echo " Done\n"; |
|
| 432 | + if ($globalDebug) { |
|
| 433 | + echo " Done\n"; |
|
| 434 | + } |
|
| 347 | 435 | $this->last_delete = time(); |
| 348 | 436 | } |
| 349 | 437 | } else { |
@@ -366,13 +454,17 @@ discard block |
||
| 366 | 454 | |
| 367 | 455 | if (!$ignoreImport) { |
| 368 | 456 | 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'])) { |
| 369 | - if ($globalDebug) echo "\o/ Add ".$this->all_tracked[$id]['ident']." from ".$this->all_tracked[$id]['format_source']." in Live DB : "; |
|
| 457 | + if ($globalDebug) { |
|
| 458 | + echo "\o/ Add ".$this->all_tracked[$id]['ident']." from ".$this->all_tracked[$id]['format_source']." in Live DB : "; |
|
| 459 | + } |
|
| 370 | 460 | $timeelapsed = microtime(true); |
| 371 | 461 | $TrackerLive = new TrackerLive($this->db); |
| 372 | 462 | $result = $TrackerLive->addLiveTrackerData($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]['putinarchive'],$this->all_tracked[$id]['comment'],$this->all_tracked[$id]['type'],$this->all_tracked[$id]['noarchive'],$this->all_tracked[$id]['format_source'],$this->all_tracked[$id]['source_name'],$this->all_tracked[$id]['over_country']); |
| 373 | 463 | $TrackerLive->db = null; |
| 374 | 464 | $this->all_tracked[$id]['putinarchive'] = false; |
| 375 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update addlivespotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 465 | + if ($globalDebugTimeElapsed) { |
|
| 466 | + echo 'Time elapsed for update addlivespotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 467 | + } |
|
| 376 | 468 | |
| 377 | 469 | // Put statistics in $this->stats variable |
| 378 | 470 | /* |
@@ -429,19 +521,29 @@ discard block |
||
| 429 | 521 | */ |
| 430 | 522 | |
| 431 | 523 | $this->all_tracked[$id]['lastupdate'] = time(); |
| 432 | - if ($this->all_tracked[$id]['putinarchive']) $send = true; |
|
| 433 | - if ($globalDebug) echo $result."\n"; |
|
| 434 | - } elseif (isset($this->all_tracked[$id]['latitude']) && isset($globalDistanceIgnore['latitude']) && $globalDebug) echo "!! Too far -> Distance : ".$Common->distance($this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],$globalDistanceIgnore['latitude'],$globalDistanceIgnore['longitude'])."\n"; |
|
| 524 | + if ($this->all_tracked[$id]['putinarchive']) { |
|
| 525 | + $send = true; |
|
| 526 | + } |
|
| 527 | + if ($globalDebug) { |
|
| 528 | + echo $result."\n"; |
|
| 529 | + } |
|
| 530 | + } elseif (isset($this->all_tracked[$id]['latitude']) && isset($globalDistanceIgnore['latitude']) && $globalDebug) { |
|
| 531 | + echo "!! Too far -> Distance : ".$Common->distance($this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],$globalDistanceIgnore['latitude'],$globalDistanceIgnore['longitude'])."\n"; |
|
| 532 | + } |
|
| 435 | 533 | //$this->del(); |
| 436 | 534 | |
| 437 | 535 | |
| 438 | 536 | 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..."; |
|
| 537 | + if ($globalDebug) { |
|
| 538 | + echo "---- Deleting Live Tracker data Not updated since 2 hour..."; |
|
| 539 | + } |
|
| 440 | 540 | $TrackerLive = new TrackerLive($this->db); |
| 441 | 541 | $TrackerLive->deleteLiveTrackerDataNotUpdated(); |
| 442 | 542 | $TrackerLive->db = null; |
| 443 | 543 | //TrackerLive->deleteLiveTrackerData(); |
| 444 | - if ($globalDebug) echo " Done\n"; |
|
| 544 | + if ($globalDebug) { |
|
| 545 | + echo " Done\n"; |
|
| 546 | + } |
|
| 445 | 547 | $this->last_delete_hourly = time(); |
| 446 | 548 | } |
| 447 | 549 | |
@@ -449,7 +551,9 @@ discard block |
||
| 449 | 551 | //$ignoreImport = false; |
| 450 | 552 | } |
| 451 | 553 | //if (function_exists('pcntl_fork') && $globalFork) pcntl_signal(SIGCHLD, SIG_IGN); |
| 452 | - if ($send) return $this->all_tracked[$id]; |
|
| 554 | + if ($send) { |
|
| 555 | + return $this->all_tracked[$id]; |
|
| 556 | + } |
|
| 453 | 557 | } |
| 454 | 558 | } |
| 455 | 559 | } |
@@ -5,8 +5,11 @@ discard block |
||
| 5 | 5 | $file_path = pathinfo($_SERVER['SCRIPT_NAME']); |
| 6 | 6 | $current_page = $file_path['filename']; |
| 7 | 7 | date_default_timezone_set($globalTimezone); |
| 8 | -if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') $MapType = $_COOKIE['MapType']; |
|
| 9 | -else $MapType = $globalMapProvider; |
|
| 8 | +if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') { |
|
| 9 | + $MapType = $_COOKIE['MapType']; |
|
| 10 | +} else { |
|
| 11 | + $MapType = $globalMapProvider; |
|
| 12 | +} |
|
| 10 | 13 | if (isset($_GET['3d'])) { |
| 11 | 14 | setcookie('MapFormat','3d'); |
| 12 | 15 | } else if (isset($_GET['2d'])) { |
@@ -241,7 +244,13 @@ discard block |
||
| 241 | 244 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
| 242 | 245 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
| 243 | 246 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
| 244 | -<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
| 247 | +<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) { |
|
| 248 | + print '&latitude='.$latitude; |
|
| 249 | +} |
|
| 250 | +?><?php if(isset($longitude)) { |
|
| 251 | + print '&longitude='.$longitude; |
|
| 252 | +} |
|
| 253 | +?>&<?php print time(); ?>"></script> |
|
| 245 | 254 | <?php |
| 246 | 255 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
| 247 | 256 | ?> |
@@ -296,7 +305,13 @@ discard block |
||
| 296 | 305 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
| 297 | 306 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
| 298 | 307 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
| 299 | -<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
| 308 | +<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) { |
|
| 309 | + print '&latitude='.$latitude; |
|
| 310 | +} |
|
| 311 | +?><?php if(isset($longitude)) { |
|
| 312 | + print '&longitude='.$longitude; |
|
| 313 | +} |
|
| 314 | +?>&<?php print time(); ?>"></script> |
|
| 300 | 315 | <?php |
| 301 | 316 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
| 302 | 317 | ?> |
@@ -369,7 +384,12 @@ discard block |
||
| 369 | 384 | <span class="icon-bar"></span> |
| 370 | 385 | </button> |
| 371 | 386 | <a href="<?php print $globalURL; ?>/search" class="navbar-toggle navbar-toggle-search"><i class="fa fa-search"></i></a> |
| 372 | - <a class="navbar-brand" href="<?php if ($globalURL == '') print '/'; else print $globalURL; ?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
| 387 | + <a class="navbar-brand" href="<?php if ($globalURL == '') { |
|
| 388 | + print '/'; |
|
| 389 | +} else { |
|
| 390 | + print $globalURL; |
|
| 391 | +} |
|
| 392 | +?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
| 373 | 393 | </div> |
| 374 | 394 | <div class="collapse navbar-collapse"> |
| 375 | 395 | |
@@ -395,7 +415,10 @@ discard block |
||
| 395 | 415 | <?php |
| 396 | 416 | } |
| 397 | 417 | ?> |
| 398 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
| 418 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
| 419 | + echo 'right-'; |
|
| 420 | +} |
|
| 421 | +?>caret"></b></a> |
|
| 399 | 422 | <ul class="dropdown-menu"> |
| 400 | 423 | <li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircrafts Types"); ?></a></li> |
| 401 | 424 | <li><a href="<?php print $globalURL; ?>/airline"><?php echo _("Airlines"); ?></a></li> |
@@ -452,8 +475,14 @@ discard block |
||
| 452 | 475 | </li> |
| 453 | 476 | <li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li> |
| 454 | 477 | <li><a href="<?php print $globalURL; ?>/statistics"><?php echo _("Statistics"); ?></a></li> |
| 455 | - <li class="dropdown<?php if ($sub) echo '-submenu'; ?>"> |
|
| 456 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
| 478 | + <li class="dropdown<?php if ($sub) { |
|
| 479 | + echo '-submenu'; |
|
| 480 | +} |
|
| 481 | +?>"> |
|
| 482 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) { |
|
| 483 | + echo 'right-'; |
|
| 484 | +} |
|
| 485 | +?>caret"></b></a> |
|
| 457 | 486 | <ul class="dropdown-menu"> |
| 458 | 487 | <li><a href="<?php print $globalURL; ?>/tools/acars"><?php echo _("ACARS translator"); ?></a></li> |
| 459 | 488 | <li><a href="<?php print $globalURL; ?>/tools/metar"><?php echo _("METAR translator"); ?></a></li> |
@@ -482,7 +511,10 @@ discard block |
||
| 482 | 511 | <?php |
| 483 | 512 | } |
| 484 | 513 | ?> |
| 485 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
| 514 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
| 515 | + echo 'right-'; |
|
| 516 | +} |
|
| 517 | +?>caret"></b></a> |
|
| 486 | 518 | <ul class="dropdown-menu"> |
| 487 | 519 | <li><a href="<?php print $globalURL; ?>/marine/currently"><?php echo _("Current Activity"); ?></a></li> |
| 488 | 520 | <li><a href="<?php print $globalURL; ?>/marine/latest"><?php echo _("Latest Activity"); ?></a></li> |
@@ -513,7 +545,10 @@ discard block |
||
| 513 | 545 | <?php |
| 514 | 546 | } |
| 515 | 547 | ?> |
| 516 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
| 548 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
| 549 | + echo 'right-'; |
|
| 550 | +} |
|
| 551 | +?>caret"></b></a> |
|
| 517 | 552 | <ul class="dropdown-menu"> |
| 518 | 553 | <li><a href="<?php print $globalURL; ?>/tracker/currently"><?php echo _("Current Activity"); ?></a></li> |
| 519 | 554 | <li><a href="<?php print $globalURL; ?>/tracker/latest"><?php echo _("Latest Activity"); ?></a></li> |
@@ -562,7 +597,9 @@ discard block |
||
| 562 | 597 | $alllang = $Language->getLanguages(); |
| 563 | 598 | foreach ($alllang as $key => $lang) { |
| 564 | 599 | print '<option value="'.$key.'"'; |
| 565 | - if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
| 600 | + if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) { |
|
| 601 | + print ' selected '; |
|
| 602 | + } |
|
| 566 | 603 | print '>'.$lang[0].'</option>'; |
| 567 | 604 | } |
| 568 | 605 | ?> |
@@ -715,4 +752,7 @@ discard block |
||
| 715 | 752 | |
| 716 | 753 | ?> |
| 717 | 754 | |
| 718 | -<section class="container main-content <?php if (strtolower($current_page) == 'index') print 'index '; ?>clear"> |
|
| 755 | +<section class="container main-content <?php if (strtolower($current_page) == 'index') { |
|
| 756 | + print 'index '; |
|
| 757 | +} |
|
| 758 | +?>clear"> |
|