@@ -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,65 +770,65 @@ 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": ['; |
|
816 | - $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
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 | + $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
817 | 817 | |
818 | - if (isset($spotter_item['arrival_airport_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 | $havedata = true; |
821 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
821 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
822 | 822 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
823 | 823 | if (isset($aairport[0]['latitude'])) { |
824 | - $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
825 | - $havedata = true; |
|
824 | + $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
825 | + $havedata = true; |
|
826 | 826 | } |
827 | - } |
|
828 | - //$output_dest = substr($output_dest, 0, -1); |
|
829 | - $output_dest .= ']}},'; |
|
830 | - if ($havedata) $output .= $output_dest; |
|
831 | - unset($output_dest); |
|
827 | + } |
|
828 | + //$output_dest = substr($output_dest, 0, -1); |
|
829 | + $output_dest .= ']}},'; |
|
830 | + if ($havedata) $output .= $output_dest; |
|
831 | + unset($output_dest); |
|
832 | 832 | } |
833 | 833 | } |
834 | 834 | $output = substr($output, 0, -1); |