@@ -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 | |
@@ -497,17 +497,17 @@ discard block |
||
| 497 | 497 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
| 498 | 498 | |
| 499 | 499 | if ( |
| 500 | - (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
| 501 | - || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
| 500 | + (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
| 501 | + || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
| 502 | 502 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
| 503 | 503 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
| 504 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
| 505 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
| 506 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
| 507 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
| 508 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
| 509 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
| 510 | - ) { |
|
| 504 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
| 505 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
| 506 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
| 507 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
| 508 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
| 509 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
| 510 | + ) { |
|
| 511 | 511 | if ($tracker) { |
| 512 | 512 | if ($from_archive || $globalArchive) { |
| 513 | 513 | $spotter_history_array = $TrackerArchive->getAllArchiveTrackerDataById($spotter_item['famtrackid']); |
@@ -596,66 +596,66 @@ discard block |
||
| 596 | 596 | } |
| 597 | 597 | |
| 598 | 598 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
| 599 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
| 600 | - && (isset($spotter_item['departure_airport']) |
|
| 601 | - && $spotter_item['departure_airport'] != 'NA' |
|
| 602 | - && isset($spotter_item['arrival_airport']) |
|
| 603 | - && $spotter_item['arrival_airport'] != 'NA' |
|
| 604 | - && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
| 605 | - || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) |
|
| 606 | - || (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'])) { |
|
| 599 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
| 600 | + && (isset($spotter_item['departure_airport']) |
|
| 601 | + && $spotter_item['departure_airport'] != 'NA' |
|
| 602 | + && isset($spotter_item['arrival_airport']) |
|
| 603 | + && $spotter_item['arrival_airport'] != 'NA' |
|
| 604 | + && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
| 605 | + || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) |
|
| 606 | + || (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['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
| 638 | - || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) |
|
| 639 | - || (isset($globalMapRoute) && $globalMapRoute)))))) { |
|
| 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['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
| 638 | + || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) |
|
| 639 | + || (isset($globalMapRoute) && $globalMapRoute)))))) { |
|
| 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); |
@@ -55,23 +55,23 @@ discard block |
||
| 55 | 55 | $min = true; |
| 56 | 56 | $allhistory = false; |
| 57 | 57 | $filter['source'] = array(); |
| 58 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 59 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 60 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 61 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
| 62 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 63 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
| 64 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
| 65 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
| 66 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
| 67 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
| 58 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
| 59 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
| 60 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
| 61 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
| 62 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
| 63 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
| 64 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
| 65 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
| 66 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
| 67 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
| 68 | 68 | |
| 69 | 69 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
| 70 | 70 | $min = true; |
| 71 | 71 | } else $min = false; |
| 72 | 72 | |
| 73 | 73 | if (isset($_GET['ident'])) { |
| 74 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
| 74 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
| 75 | 75 | if ($tracker) { |
| 76 | 76 | $spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident); |
| 77 | 77 | } elseif ($marine) { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | $allhistory = true; |
| 87 | 87 | } elseif (isset($_GET['flightaware_id'])) { |
| 88 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
| 88 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
| 89 | 89 | $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id); |
| 90 | 90 | if (empty($spotter_array)) { |
| 91 | 91 | $from_archive = true; |
@@ -93,44 +93,44 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | $allhistory = true; |
| 95 | 95 | } elseif (isset($_GET['famtrack_id'])) { |
| 96 | - $famtrack_id = filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING); |
|
| 96 | + $famtrack_id = filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING); |
|
| 97 | 97 | $spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id); |
| 98 | 98 | $allhistory = true; |
| 99 | 99 | } elseif (isset($_GET['fammarine_id'])) { |
| 100 | - $fammarine_id = filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING); |
|
| 100 | + $fammarine_id = filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING); |
|
| 101 | 101 | $spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id); |
| 102 | 102 | $allhistory = true; |
| 103 | 103 | } elseif (isset($_GET['coord']) && (!isset($globalMapPopup) || $globalMapPopup || (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true'))) { |
| 104 | 104 | //} elseif (isset($_GET['coord'])) { |
| 105 | 105 | $usecoord = true; |
| 106 | - $coord = explode(',',$_GET['coord']); |
|
| 106 | + $coord = explode(',', $_GET['coord']); |
|
| 107 | 107 | if ($tracker) { |
| 108 | - $spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord,$filter); |
|
| 108 | + $spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord, $filter); |
|
| 109 | 109 | } elseif ($marine) { |
| 110 | - $spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord,$filter); |
|
| 110 | + $spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord, $filter); |
|
| 111 | 111 | } else { |
| 112 | - $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord,$filter); |
|
| 112 | + $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord, $filter); |
|
| 113 | 113 | } |
| 114 | 114 | } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min) { |
| 115 | 115 | $usecoord = true; |
| 116 | - $coord = explode(',',$_GET['coord']); |
|
| 116 | + $coord = explode(',', $_GET['coord']); |
|
| 117 | 117 | if ($tracker) { |
| 118 | - $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter); |
|
| 118 | + $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter); |
|
| 119 | 119 | } elseif ($marine) { |
| 120 | - $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter); |
|
| 120 | + $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter); |
|
| 121 | 121 | } else { |
| 122 | - $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$filter); |
|
| 122 | + $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $filter); |
|
| 123 | 123 | } |
| 124 | 124 | } elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed']) && !isset($_GET['tracker']) && !isset($_GET['marine'])) { |
| 125 | 125 | $from_archive = true; |
| 126 | 126 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
| 127 | 127 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
| 128 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
| 129 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
| 130 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
| 131 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
| 132 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
| 133 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
| 128 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
| 129 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
| 130 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
| 131 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
| 132 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
| 133 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
| 134 | 134 | } elseif ($min) { |
| 135 | 135 | if ($tracker) { |
| 136 | 136 | $spotter_array = $TrackerLive->getMinLiveTrackerData($filter); |
@@ -142,18 +142,18 @@ discard block |
||
| 142 | 142 | # $min = true; |
| 143 | 143 | } else { |
| 144 | 144 | if ($tracker) { |
| 145 | - $spotter_array = $TrackerLive->getLiveTrackerData('','',$filter); |
|
| 145 | + $spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter); |
|
| 146 | 146 | } elseif ($marine) { |
| 147 | - $spotter_array = $marineLive->getLiveMarineData('','',$filter); |
|
| 147 | + $spotter_array = $marineLive->getLiveMarineData('', '', $filter); |
|
| 148 | 148 | } else { |
| 149 | - $spotter_array = $SpotterLive->getLiveSpotterData('','',$filter); |
|
| 149 | + $spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter); |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | if (!empty($spotter_array) || $usecoord) { |
| 154 | 154 | if ($usecoord) { |
| 155 | 155 | if (isset($_GET['archive'])) { |
| 156 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
| 156 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
| 157 | 157 | } else { |
| 158 | 158 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
| 159 | 159 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | if ($flightcnt == '') $flightcnt = 0; |
| 162 | 162 | } else $flightcnt = 0; |
| 163 | 163 | |
| 164 | -$sqltime = round(microtime(true)-$begintime,2); |
|
| 164 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
| 165 | 165 | |
| 166 | 166 | if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
| 167 | 167 | else $usenextlatlon = true; |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | if (!empty($spotter_array) && is_array($spotter_array)) |
| 179 | 179 | { |
| 180 | 180 | $output .= '"features": ['; |
| 181 | - foreach($spotter_array as $spotter_item) |
|
| 181 | + foreach ($spotter_array as $spotter_item) |
|
| 182 | 182 | { |
| 183 | 183 | $j++; |
| 184 | 184 | date_default_timezone_set('UTC'); |
@@ -234,8 +234,8 @@ discard block |
||
| 234 | 234 | */ |
| 235 | 235 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
| 236 | 236 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
| 237 | - if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
| 238 | - else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
| 237 | + if ($compress) $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
| 238 | + else $output .= '"callsign": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
| 239 | 239 | //" |
| 240 | 240 | } else { |
| 241 | 241 | if ($compress) $output .= '"c": "NA",'; |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
| 245 | 245 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
| 246 | 246 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
| 247 | - $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
|
| 247 | + $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",'; |
|
| 248 | 248 | } elseif (isset($spotter_item['aircraft_type'])) { |
| 249 | 249 | $output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",'; |
| 250 | 250 | } elseif (!$min) { |
@@ -384,16 +384,16 @@ discard block |
||
| 384 | 384 | else $output .= '"heading": "'.$spotter_item['heading'].'",'; |
| 385 | 385 | |
| 386 | 386 | if (isset($archivespeed)) { |
| 387 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
| 387 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed); |
|
| 388 | 388 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 389 | 389 | } elseif ($usenextlatlon) { |
| 390 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
| 390 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']); |
|
| 391 | 391 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | if (!$min) $output .= '"image": "'.$image.'",'; |
| 395 | 395 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
| 396 | - $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
|
| 396 | + $output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",'; |
|
| 397 | 397 | } |
| 398 | 398 | if (isset($spotter_item['image_source_website'])) { |
| 399 | 399 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | $output .= '"waypoints": "'.$spotter_item['waypoints'].'",'; |
| 416 | 416 | } |
| 417 | 417 | if (isset($spotter_item['acars'])) { |
| 418 | - $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
|
| 418 | + $output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",'; |
|
| 419 | 419 | } |
| 420 | 420 | // type when not aircraft ? |
| 421 | 421 | if (isset($spotter_item['type'])) { |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | |
| 494 | 494 | } |
| 495 | 495 | */ |
| 496 | - $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
|
| 496 | + $history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING); |
|
| 497 | 497 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
| 498 | 498 | |
| 499 | 499 | if ( |
@@ -501,11 +501,11 @@ discard block |
||
| 501 | 501 | || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
| 502 | 502 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
| 503 | 503 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
| 504 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
| 504 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
| 505 | 505 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
| 506 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
| 506 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id'])) |
|
| 507 | 507 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
| 508 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
| 508 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid'])) |
|
| 509 | 509 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
| 510 | 510 | ) { |
| 511 | 511 | if ($tracker) { |
@@ -542,9 +542,9 @@ discard block |
||
| 542 | 542 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
| 543 | 543 | } |
| 544 | 544 | $output_history .= '['; |
| 545 | - $output_history .= $spotter_history['longitude'].', '; |
|
| 546 | - $output_history .= $spotter_history['latitude'].', '; |
|
| 547 | - $output_history .= $spotter_history['altitude']*30.48; |
|
| 545 | + $output_history .= $spotter_history['longitude'].', '; |
|
| 546 | + $output_history .= $spotter_history['latitude'].', '; |
|
| 547 | + $output_history .= $spotter_history['altitude']*30.48; |
|
| 548 | 548 | $output_history .= '],'; |
| 549 | 549 | /* |
| 550 | 550 | if ($from_archive === false) { |
@@ -562,8 +562,8 @@ discard block |
||
| 562 | 562 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
| 563 | 563 | } else $d = true; |
| 564 | 564 | $output_history .= '['; |
| 565 | - $output_history .= $spotter_history['longitude'].', '; |
|
| 566 | - $output_history .= $spotter_history['latitude']; |
|
| 565 | + $output_history .= $spotter_history['longitude'].', '; |
|
| 566 | + $output_history .= $spotter_history['latitude']; |
|
| 567 | 567 | $output_history .= '],'; |
| 568 | 568 | /* |
| 569 | 569 | if ($from_archive === false) { |
@@ -579,9 +579,9 @@ discard block |
||
| 579 | 579 | |
| 580 | 580 | if ($from_archive === false) { |
| 581 | 581 | $output_historyd = '['; |
| 582 | - $output_historyd .= $spotter_item['longitude'].', '; |
|
| 583 | - $output_historyd .= $spotter_item['latitude']; |
|
| 584 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
| 582 | + $output_historyd .= $spotter_item['longitude'].', '; |
|
| 583 | + $output_historyd .= $spotter_item['latitude']; |
|
| 584 | + if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
| 585 | 585 | $output_historyd .= '],'; |
| 586 | 586 | //$output_history = $output_historyd.$output_history; |
| 587 | 587 | $output_history = $output_history.$output_historyd; |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | } |
| 596 | 596 | } |
| 597 | 597 | |
| 598 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
| 598 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
| 599 | 599 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
| 600 | 600 | && (isset($spotter_item['departure_airport']) |
| 601 | 601 | && $spotter_item['departure_airport'] != 'NA' |
@@ -630,7 +630,7 @@ discard block |
||
| 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 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
| 633 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
| 634 | 634 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
| 635 | 635 | && (isset($spotter_item['arrival_airport']) |
| 636 | 636 | && $spotter_item['arrival_airport'] != 'NA' |
@@ -661,7 +661,7 @@ discard block |
||
| 661 | 661 | $output = substr($output, 0, -1); |
| 662 | 662 | $output .= ']'; |
| 663 | 663 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
| 664 | - $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
| 664 | + $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
| 665 | 665 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
| 666 | 666 | $output .= '"fc": "'.$j.'"'; |
| 667 | 667 | } else { |