@@ -6,14 +6,14 @@ discard block |
||
| 6 | 6 | $Spotter = new Spotter(); |
| 7 | 7 | if (isset($_GET['start_date'])) { |
| 8 | 8 | //for the date manipulation into the query |
| 9 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 9 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
| 10 | 10 | $start_date = $_GET['start_date'].":00"; |
| 11 | 11 | $end_date = $_GET['end_date'].":00"; |
| 12 | 12 | $sql_date = $start_date.",".$end_date; |
| 13 | - } else if($_GET['start_date'] != ""){ |
|
| 13 | + } else if ($_GET['start_date'] != "") { |
|
| 14 | 14 | $start_date = $_GET['start_date'].":00"; |
| 15 | 15 | $sql_date = $start_date; |
| 16 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 16 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
| 17 | 17 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 18 | 18 | $sql_date = $end_date; |
| 19 | 19 | } else $sql_date = ''; |
@@ -21,38 +21,38 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | if (isset($_GET['highest_altitude'])) { |
| 23 | 23 | //for altitude manipulation |
| 24 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 25 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
| 26 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
| 24 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
| 25 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
| 26 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
| 27 | 27 | $sql_altitude = $start_altitude.",".$end_altitude; |
| 28 | - } else if($_GET['highest_altitude'] != ""){ |
|
| 29 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
| 28 | + } else if ($_GET['highest_altitude'] != "") { |
|
| 29 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
| 30 | 30 | $sql_altitude = $end_altitude; |
| 31 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 32 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
| 31 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
| 32 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
| 33 | 33 | $sql_altitude = $start_altitude; |
| 34 | 34 | } else $sql_altitude = ''; |
| 35 | 35 | } else $sql_altitude = ''; |
| 36 | 36 | |
| 37 | 37 | //calculuation for the pagination |
| 38 | -if(!isset($_GET['limit'])) |
|
| 38 | +if (!isset($_GET['limit'])) |
|
| 39 | 39 | { |
| 40 | 40 | if (!isset($_GET['number_results'])) { |
| 41 | 41 | $limit_start = 0; |
| 42 | 42 | $limit_end = 25; |
| 43 | 43 | $absolute_difference = 25; |
| 44 | 44 | } else { |
| 45 | - if ($_GET['number_results'] > 1000){ |
|
| 45 | + if ($_GET['number_results'] > 1000) { |
|
| 46 | 46 | $_GET['number_results'] = 1000; |
| 47 | 47 | } |
| 48 | 48 | $limit_start = 0; |
| 49 | - $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
| 50 | - $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
| 49 | + $limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
| 50 | + $absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
| 51 | 51 | } |
| 52 | -} else { |
|
| 52 | +} else { |
|
| 53 | 53 | $limit_explode = explode(",", $_GET['limit']); |
| 54 | - $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 55 | - $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 54 | + $limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 55 | + $limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -69,27 +69,27 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | if (isset($_GET['sort'])) $sort = $_GET['sort']; |
| 71 | 71 | else $sort = ''; |
| 72 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
| 73 | -$id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_STRING); |
|
| 74 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
| 75 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
| 76 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
| 77 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
| 78 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 79 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
| 80 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
| 81 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
| 82 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
| 83 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
| 84 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
| 85 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
| 86 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
| 87 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
| 88 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
| 72 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
| 73 | +$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING); |
|
| 74 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
| 75 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
| 76 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
| 77 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
| 78 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 79 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
| 80 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
| 81 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
| 82 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
| 83 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
| 84 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
| 85 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
| 86 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
| 87 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
| 88 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
| 89 | 89 | if ($id != '') { |
| 90 | 90 | $spotter_array = $Spotter->getSpotterDataByID($id); |
| 91 | 91 | } else { |
| 92 | - $spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,''); |
|
| 92 | + $spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, ''); |
|
| 93 | 93 | } |
| 94 | 94 | $output = '<?xml version="1.0" encoding="UTF-8"?>'; |
| 95 | 95 | $output .= '<kml xmlns="http://www.opengis.net/kml/2.2">'; |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $output .= '</Style>'; |
| 118 | 118 | |
| 119 | 119 | if (!empty($spotter_array)) { |
| 120 | - foreach($spotter_array as $spotter_item) { |
|
| 120 | + foreach ($spotter_array as $spotter_item) { |
|
| 121 | 121 | $altitude = $spotter_item['altitude'].'00'; |
| 122 | 122 | $SpotterArchive = new SpotterArchive(); |
| 123 | 123 | $archive_data = $SpotterArchive->getAllArchiveSpotterDataById($spotter_item['flightaware_id']); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | $output .= '<LineString>'; |
| 129 | 129 | $output .= '<coordinates>'; |
| 130 | 130 | foreach ($archive_data as $coord_data) { |
| 131 | - $output .= $coord_data['longitude'].','.$coord_data['latitude'].','.$coord_data['real_altitude'].' '; |
|
| 131 | + $output .= $coord_data['longitude'].','.$coord_data['latitude'].','.$coord_data['real_altitude'].' '; |
|
| 132 | 132 | } |
| 133 | 133 | $output .= '</coordinates>'; |
| 134 | 134 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $output .= ' ]]></description>'; |
| 192 | 192 | $output .= '<styleUrl>#departureAirport</styleUrl>'; |
| 193 | 193 | $output .= '<Point>'; |
| 194 | - $output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>'; |
|
| 194 | + $output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>'; |
|
| 195 | 195 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
| 196 | 196 | $output .= '</Point>'; |
| 197 | 197 | $output .= '</Placemark>'; |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | $output .= ' ]]></description>'; |
| 233 | 233 | $output .= '<styleUrl>#arrivalAirport</styleUrl>'; |
| 234 | 234 | $output .= '<Point>'; |
| 235 | - $output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>'; |
|
| 235 | + $output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>'; |
|
| 236 | 236 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
| 237 | 237 | $output .= '</Point>'; |
| 238 | 238 | $output .= '</Placemark>'; |
@@ -16,8 +16,12 @@ discard block |
||
| 16 | 16 | } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
| 17 | 17 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 18 | 18 | $sql_date = $end_date; |
| 19 | - } else $sql_date = ''; |
|
| 20 | -} else $sql_date = ''; |
|
| 19 | + } else { |
|
| 20 | + $sql_date = ''; |
|
| 21 | + } |
|
| 22 | + } else { |
|
| 23 | + $sql_date = ''; |
|
| 24 | +} |
|
| 21 | 25 | |
| 22 | 26 | if (isset($_GET['highest_altitude'])) { |
| 23 | 27 | //for altitude manipulation |
@@ -31,8 +35,12 @@ discard block |
||
| 31 | 35 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
| 32 | 36 | $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
| 33 | 37 | $sql_altitude = $start_altitude; |
| 34 | - } else $sql_altitude = ''; |
|
| 35 | -} else $sql_altitude = ''; |
|
| 38 | + } else { |
|
| 39 | + $sql_altitude = ''; |
|
| 40 | + } |
|
| 41 | + } else { |
|
| 42 | + $sql_altitude = ''; |
|
| 43 | +} |
|
| 36 | 44 | |
| 37 | 45 | //calculuation for the pagination |
| 38 | 46 | if(!isset($_GET['limit'])) |
@@ -49,7 +57,7 @@ discard block |
||
| 49 | 57 | $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
| 50 | 58 | $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
| 51 | 59 | } |
| 52 | -} else { |
|
| 60 | +} else { |
|
| 53 | 61 | $limit_explode = explode(",", $_GET['limit']); |
| 54 | 62 | $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
| 55 | 63 | $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
@@ -67,8 +75,11 @@ discard block |
||
| 67 | 75 | |
| 68 | 76 | header('Content-Type: text/xml'); |
| 69 | 77 | |
| 70 | -if (isset($_GET['sort'])) $sort = $_GET['sort']; |
|
| 71 | -else $sort = ''; |
|
| 78 | +if (isset($_GET['sort'])) { |
|
| 79 | + $sort = $_GET['sort']; |
|
| 80 | +} else { |
|
| 81 | + $sort = ''; |
|
| 82 | +} |
|
| 72 | 83 | $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
| 73 | 84 | $id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_STRING); |
| 74 | 85 | $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
@@ -3,17 +3,17 @@ discard block |
||
| 3 | 3 | require_once('require/class.Language.php'); |
| 4 | 4 | require_once('require/class.Spotter.php'); |
| 5 | 5 | require_once('require/class.SpotterArchive.php'); |
| 6 | -$Spotter=new Spotter(); |
|
| 6 | +$Spotter = new Spotter(); |
|
| 7 | 7 | if (isset($_GET['start_date'])) { |
| 8 | 8 | //for the date manipulation into the query |
| 9 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 9 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
| 10 | 10 | $start_date = $_GET['start_date'].":00"; |
| 11 | 11 | $end_date = $_GET['end_date'].":00"; |
| 12 | 12 | $sql_date = $start_date.",".$end_date; |
| 13 | - } else if($_GET['start_date'] != ""){ |
|
| 13 | + } else if ($_GET['start_date'] != "") { |
|
| 14 | 14 | $start_date = $_GET['start_date'].":00"; |
| 15 | 15 | $sql_date = $start_date; |
| 16 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 16 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
| 17 | 17 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 18 | 18 | $sql_date = $end_date; |
| 19 | 19 | } else $sql_date = ''; |
@@ -21,21 +21,21 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | if (isset($_GET['highest_altitude'])) { |
| 23 | 23 | //for altitude manipulation |
| 24 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 25 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
| 26 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
| 24 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
| 25 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
| 26 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
| 27 | 27 | $sql_altitude = $start_altitude.",".$end_altitude; |
| 28 | - } else if($_GET['highest_altitude'] != ""){ |
|
| 29 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
| 28 | + } else if ($_GET['highest_altitude'] != "") { |
|
| 29 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
| 30 | 30 | $sql_altitude = $end_altitude; |
| 31 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 32 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
| 31 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
| 32 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
| 33 | 33 | $sql_altitude = $start_altitude; |
| 34 | 34 | } else $sql_altitude = ''; |
| 35 | 35 | } else $sql_altitude = ''; |
| 36 | 36 | |
| 37 | 37 | //calculuation for the pagination |
| 38 | -if(!isset($_GET['limit'])) |
|
| 38 | +if (!isset($_GET['limit'])) |
|
| 39 | 39 | { |
| 40 | 40 | if (!isset($_GET['number_results'])) |
| 41 | 41 | { |
@@ -43,17 +43,17 @@ discard block |
||
| 43 | 43 | $limit_end = 25; |
| 44 | 44 | $absolute_difference = 25; |
| 45 | 45 | } else { |
| 46 | - if ($_GET['number_results'] > 1000){ |
|
| 46 | + if ($_GET['number_results'] > 1000) { |
|
| 47 | 47 | $_GET['number_results'] = 1000; |
| 48 | 48 | } |
| 49 | 49 | $limit_start = 0; |
| 50 | - $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
| 51 | - $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
| 50 | + $limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
| 51 | + $absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
| 52 | 52 | } |
| 53 | -} else { |
|
| 53 | +} else { |
|
| 54 | 54 | $limit_explode = explode(",", $_GET['limit']); |
| 55 | - $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 56 | - $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 55 | + $limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 56 | + $limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -70,34 +70,34 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | if (isset($_GET['sort'])) $sort = $_GET['sort']; |
| 72 | 72 | else $sort = ''; |
| 73 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
| 74 | -$id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_NUMBER_INT); |
|
| 75 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
| 76 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
| 77 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
| 78 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
| 79 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 80 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
| 81 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
| 82 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
| 83 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
| 84 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
| 85 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
| 86 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
| 87 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
| 88 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
| 89 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
| 73 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
| 74 | +$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT); |
|
| 75 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
| 76 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
| 77 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
| 78 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
| 79 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 80 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
| 81 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
| 82 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
| 83 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
| 84 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
| 85 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
| 86 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
| 87 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
| 88 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
| 89 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
| 90 | 90 | if ($id != '') { |
| 91 | 91 | $spotter_array = $Spotter->getSpotterDataByID($id); |
| 92 | 92 | } else { |
| 93 | - $spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,''); |
|
| 93 | + $spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, ''); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | $output = '{'; |
| 97 | 97 | $output .= '"type": "FeatureCollection",'; |
| 98 | 98 | $output .= '"features": ['; |
| 99 | 99 | if (!empty($spotter_array)) { |
| 100 | - foreach($spotter_array as $spotter_item) { |
|
| 100 | + foreach ($spotter_array as $spotter_item) { |
|
| 101 | 101 | //waypoint plotting |
| 102 | 102 | $output .= '{'; |
| 103 | 103 | $output .= '"type": "Feature",'; |
@@ -164,8 +164,8 @@ discard block |
||
| 164 | 164 | $output .= '"coordinates": ['; |
| 165 | 165 | foreach ($archive_data as $coord_data) { |
| 166 | 166 | $output .= '['; |
| 167 | - $output .= $coord_data['longitude'].', '; |
|
| 168 | - $output .= $coord_data['latitude']; |
|
| 167 | + $output .= $coord_data['longitude'].', '; |
|
| 168 | + $output .= $coord_data['latitude']; |
|
| 169 | 169 | $output .= '],'; |
| 170 | 170 | } |
| 171 | 171 | $output = substr($output, 0, -1); |