@@ -5,23 +5,23 @@ discard block |
||
5 | 5 | $marine = false; |
6 | 6 | $usecoord = false; |
7 | 7 | if (isset($_GET['tracker'])) { |
8 | - $tracker = true; |
|
8 | + $tracker = true; |
|
9 | 9 | } |
10 | 10 | if (isset($_GET['marine'])) { |
11 | - $marine = true; |
|
11 | + $marine = true; |
|
12 | 12 | } |
13 | 13 | if ($tracker) { |
14 | - require_once('require/class.Tracker.php'); |
|
15 | - require_once('require/class.TrackerLive.php'); |
|
16 | - require_once('require/class.TrackerArchive.php'); |
|
14 | + require_once('require/class.Tracker.php'); |
|
15 | + require_once('require/class.TrackerLive.php'); |
|
16 | + require_once('require/class.TrackerArchive.php'); |
|
17 | 17 | } elseif ($marine) { |
18 | - require_once('require/class.Marine.php'); |
|
19 | - require_once('require/class.MarineLive.php'); |
|
20 | - require_once('require/class.MarineArchive.php'); |
|
18 | + require_once('require/class.Marine.php'); |
|
19 | + require_once('require/class.MarineLive.php'); |
|
20 | + require_once('require/class.MarineArchive.php'); |
|
21 | 21 | } else { |
22 | - require_once('require/class.Spotter.php'); |
|
23 | - require_once('require/class.SpotterLive.php'); |
|
24 | - require_once('require/class.SpotterArchive.php'); |
|
22 | + require_once('require/class.Spotter.php'); |
|
23 | + require_once('require/class.SpotterLive.php'); |
|
24 | + require_once('require/class.SpotterArchive.php'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | $begintime = microtime(true); |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | $Common = new Common(); |
42 | 42 | |
43 | 43 | if (isset($_GET['download'])) { |
44 | - if ($_GET['download'] == "true") |
|
45 | - { |
|
44 | + if ($_GET['download'] == "true") |
|
45 | + { |
|
46 | 46 | header('Content-disposition: attachment; filename="flightairmap.json"'); |
47 | - } |
|
47 | + } |
|
48 | 48 | } |
49 | 49 | header('Content-Type: text/javascript'); |
50 | 50 | |
@@ -498,17 +498,17 @@ discard block |
||
498 | 498 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
499 | 499 | |
500 | 500 | if ( |
501 | - (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
502 | - || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
501 | + (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
502 | + || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
503 | 503 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
504 | 504 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
505 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
506 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
507 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
508 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
509 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
510 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
511 | - ) { |
|
505 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
506 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
507 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
508 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
509 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
510 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
511 | + ) { |
|
512 | 512 | if ($tracker) { |
513 | 513 | if ($from_archive || $globalArchive) { |
514 | 514 | $spotter_history_array = $TrackerArchive->getAllArchiveTrackerDataById($spotter_item['famtrackid']); |
@@ -597,65 +597,65 @@ discard block |
||
597 | 597 | } |
598 | 598 | |
599 | 599 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
600 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
601 | - && (isset($spotter_item['departure_airport']) |
|
602 | - && $spotter_item['departure_airport'] != 'NA' |
|
603 | - && isset($spotter_item['arrival_airport']) |
|
604 | - && $spotter_item['arrival_airport'] != 'NA' |
|
605 | - && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
606 | - || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
|
607 | - if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
608 | - else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
609 | - if (isset($spotter_item['departure_airport_latitude'])) { |
|
600 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
601 | + && (isset($spotter_item['departure_airport']) |
|
602 | + && $spotter_item['departure_airport'] != 'NA' |
|
603 | + && isset($spotter_item['arrival_airport']) |
|
604 | + && $spotter_item['arrival_airport'] != 'NA' |
|
605 | + && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
606 | + || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
|
607 | + if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
608 | + else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
609 | + if (isset($spotter_item['departure_airport_latitude'])) { |
|
610 | 610 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
611 | - } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
611 | + } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
612 | 612 | $dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']); |
613 | 613 | if (isset($dairport[0]['latitude'])) { |
614 | - $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
614 | + $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
615 | 615 | } |
616 | - } |
|
617 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
616 | + } |
|
617 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
618 | 618 | $output_air .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].'],'; |
619 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
619 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
620 | 620 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
621 | 621 | if (isset($aairport[0]['latitude'])) { |
622 | - $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],'; |
|
622 | + $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],'; |
|
623 | 623 | } |
624 | - } |
|
625 | - $output_air = substr($output_air, 0, -1); |
|
626 | - $output_air .= ']}},'; |
|
627 | - $output .= $output_air; |
|
628 | - unset($output_air); |
|
624 | + } |
|
625 | + $output_air = substr($output_air, 0, -1); |
|
626 | + $output_air .= ']}},'; |
|
627 | + $output .= $output_air; |
|
628 | + unset($output_air); |
|
629 | 629 | } |
630 | 630 | |
631 | 631 | //if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
632 | 632 | //if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
633 | 633 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
634 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
635 | - && (isset($spotter_item['arrival_airport']) |
|
636 | - && $spotter_item['arrival_airport'] != 'NA' |
|
637 | - && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") |
|
638 | - || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) |
|
639 | - || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
|
640 | - $havedata = false; |
|
641 | - if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
642 | - else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
643 | - $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
634 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
635 | + && (isset($spotter_item['arrival_airport']) |
|
636 | + && $spotter_item['arrival_airport'] != 'NA' |
|
637 | + && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") |
|
638 | + || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) |
|
639 | + || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
|
640 | + $havedata = false; |
|
641 | + if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
642 | + else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
643 | + $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
644 | 644 | |
645 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
645 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
646 | 646 | $output_dest .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].']'; |
647 | 647 | $havedata = true; |
648 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
648 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
649 | 649 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
650 | 650 | if (isset($aairport[0]['latitude'])) { |
651 | - $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
652 | - $havedata = true; |
|
651 | + $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
652 | + $havedata = true; |
|
653 | 653 | } |
654 | - } |
|
655 | - //$output_dest = substr($output_dest, 0, -1); |
|
656 | - $output_dest .= ']}},'; |
|
657 | - if ($havedata) $output .= $output_dest; |
|
658 | - unset($output_dest); |
|
654 | + } |
|
655 | + //$output_dest = substr($output_dest, 0, -1); |
|
656 | + $output_dest .= ']}},'; |
|
657 | + if ($havedata) $output .= $output_dest; |
|
658 | + unset($output_dest); |
|
659 | 659 | } |
660 | 660 | } |
661 | 661 | $output = substr($output, 0, -1); |