@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | $Spotter = new Spotter(); |
| 8 | 8 | $orderby = $Spotter->getOrderBy(); |
| 9 | 9 | |
| 10 | -$ask = filter_input(INPUT_GET,'ask',FILTER_SANITIZE_STRING); |
|
| 10 | +$ask = filter_input(INPUT_GET, 'ask', FILTER_SANITIZE_STRING); |
|
| 11 | 11 | if ($ask == 'aircraftsdetected') { |
| 12 | 12 | require_once('require/class.SpotterLive.php'); |
| 13 | 13 | $SpotterLive = new SpotterLive(); |
@@ -27,16 +27,16 @@ discard block |
||
| 27 | 27 | $manufacturers = $Stats->getAllManufacturers(); |
| 28 | 28 | if (empty($manufacturers)) $manufacturers = $Spotter->getAllManufacturers(); |
| 29 | 29 | $all_manufacturers = array(); |
| 30 | - foreach($manufacturers as $manufacturer) |
|
| 30 | + foreach ($manufacturers as $manufacturer) |
|
| 31 | 31 | { |
| 32 | - $all_manufacturers[] = array('value' => $manufacturer['aircraft_manufacturer'], 'id' => strtolower(str_replace(' ','-',$manufacturer['aircraft_manufacturer']))); |
|
| 32 | + $all_manufacturers[] = array('value' => $manufacturer['aircraft_manufacturer'], 'id' => strtolower(str_replace(' ', '-', $manufacturer['aircraft_manufacturer']))); |
|
| 33 | 33 | } |
| 34 | 34 | echo json_encode($all_manufacturers); |
| 35 | 35 | } elseif ($ask == 'aircrafttypes') { |
| 36 | 36 | $aircraft_types = $Stats->getAllAircraftTypes(); |
| 37 | 37 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
| 38 | 38 | $all_aircraft_types = array(); |
| 39 | - foreach($aircraft_types as $aircraft_type) |
|
| 39 | + foreach ($aircraft_types as $aircraft_type) |
|
| 40 | 40 | { |
| 41 | 41 | $all_aircraft_types[] = array('id' => $aircraft_type['aircraft_icao'], 'value' => $aircraft_type['aircraft_name'].' ('.$aircraft_type['aircraft_icao'].')'); |
| 42 | 42 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | } elseif ($ask == 'airlinenames') { |
| 45 | 45 | $airline_names = $Stats->getAllAirlineNames(); |
| 46 | 46 | $all_airline_names = array(); |
| 47 | - foreach($airline_names as $airline_name) |
|
| 47 | + foreach ($airline_names as $airline_name) |
|
| 48 | 48 | { |
| 49 | 49 | $all_airline_names[] = array('id' => $airline_name['airline_icao'], 'value' => $airline_name['airline_name'].' ('.$airline_name['airline_icao'].')'); |
| 50 | 50 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } elseif ($ask == 'airlinecountries') { |
| 53 | 53 | $airline_countries = $Spotter->getAllAirlineCountries(); |
| 54 | 54 | $all_airline_countries = array(); |
| 55 | - foreach($airline_countries as $airline_country) |
|
| 55 | + foreach ($airline_countries as $airline_country) |
|
| 56 | 56 | { |
| 57 | 57 | $all_airline_countries[] = array('id' => $airline_country['airline_country'], 'value' => $airline_country['airline_country']); |
| 58 | 58 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
| 63 | 63 | ksort($airport_names); |
| 64 | 64 | $all_airport_names = array(); |
| 65 | - foreach($airport_names as $airport_name) |
|
| 65 | + foreach ($airport_names as $airport_name) |
|
| 66 | 66 | { |
| 67 | 67 | $all_airport_names[] = array('id' => $airport_name['airport_icao'], 'value' => $airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')'); |
| 68 | 68 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | } elseif ($ask == 'airportcountries') { |
| 71 | 71 | $airport_countries = $Spotter->getAllAirportCountries(); |
| 72 | 72 | $all_airport_countries = array(); |
| 73 | - foreach($airport_countries as $airport_country) |
|
| 73 | + foreach ($airport_countries as $airport_country) |
|
| 74 | 74 | { |
| 75 | 75 | $all_airport_countries[] = array('id' => $airport_country['airport_country'], 'value' => $airport_country['airport_country']); |
| 76 | 76 | } |
@@ -25,7 +25,9 @@ discard block |
||
| 25 | 25 | echo json_encode($marinecnt); |
| 26 | 26 | } elseif ($ask == 'manufacturer') { |
| 27 | 27 | $manufacturers = $Stats->getAllManufacturers(); |
| 28 | - if (empty($manufacturers)) $manufacturers = $Spotter->getAllManufacturers(); |
|
| 28 | + if (empty($manufacturers)) { |
|
| 29 | + $manufacturers = $Spotter->getAllManufacturers(); |
|
| 30 | + } |
|
| 29 | 31 | $all_manufacturers = array(); |
| 30 | 32 | foreach($manufacturers as $manufacturer) |
| 31 | 33 | { |
@@ -34,7 +36,9 @@ discard block |
||
| 34 | 36 | echo json_encode($all_manufacturers); |
| 35 | 37 | } elseif ($ask == 'aircrafttypes') { |
| 36 | 38 | $aircraft_types = $Stats->getAllAircraftTypes(); |
| 37 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
| 39 | + if (empty($aircraft_types)) { |
|
| 40 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
| 41 | + } |
|
| 38 | 42 | $all_aircraft_types = array(); |
| 39 | 43 | foreach($aircraft_types as $aircraft_type) |
| 40 | 44 | { |
@@ -59,7 +63,9 @@ discard block |
||
| 59 | 63 | echo json_encode($all_airline_countries); |
| 60 | 64 | } elseif ($ask == 'airportnames' || $ask == 'departureairportnames' || $ask == 'arrivalairportnames') { |
| 61 | 65 | $airport_names = $Stats->getAllAirportNames(); |
| 62 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
| 66 | + if (empty($airport_names)) { |
|
| 67 | + $airport_names = $Spotter->getAllAirportNames(); |
|
| 68 | + } |
|
| 63 | 69 | ksort($airport_names); |
| 64 | 70 | $all_airport_names = array(); |
| 65 | 71 | foreach($airport_names as $airport_name) |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
| 15 | 15 | |
| 16 | 16 | $spotter_array = $Spotter->getAllFlightsforSitemap(); |
| 17 | - foreach($spotter_array as $spotter_item) |
|
| 17 | + foreach ($spotter_array as $spotter_item) |
|
| 18 | 18 | { |
| 19 | 19 | $output .= '<url>'; |
| 20 | 20 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/flightid/'.$spotter_item['spotter_id'].'</loc>'; |
@@ -25,14 +25,14 @@ discard block |
||
| 25 | 25 | $output .= '</urlset>'; |
| 26 | 26 | |
| 27 | 27 | |
| 28 | -} else if (isset($_GET['type']) && $_GET['type'] == "aircraft"){ |
|
| 28 | +} else if (isset($_GET['type']) && $_GET['type'] == "aircraft") { |
|
| 29 | 29 | |
| 30 | 30 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
| 31 | 31 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
| 32 | 32 | |
| 33 | 33 | $aircraft_types = $Stats->getAllAircraftTypes(); |
| 34 | 34 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
| 35 | - foreach($aircraft_types as $aircraft_item) |
|
| 35 | + foreach ($aircraft_types as $aircraft_item) |
|
| 36 | 36 | { |
| 37 | 37 | $output .= '<url>'; |
| 38 | 38 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/aircraft/'.$aircraft_item['aircraft_icao'].'</loc>'; |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | $output .= '</urlset>'; |
| 44 | 44 | |
| 45 | 45 | |
| 46 | -} else if (isset($_GET['type']) && $_GET['type'] == "registration"){ |
|
| 46 | +} else if (isset($_GET['type']) && $_GET['type'] == "registration") { |
|
| 47 | 47 | |
| 48 | 48 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
| 49 | 49 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
| 50 | 50 | |
| 51 | 51 | $aircraft_registrations = $Spotter->getAllAircraftRegistrations(); |
| 52 | - foreach($aircraft_registrations as $aircraft_item) |
|
| 52 | + foreach ($aircraft_registrations as $aircraft_item) |
|
| 53 | 53 | { |
| 54 | 54 | $output .= '<url>'; |
| 55 | 55 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/registration/'.$aircraft_item['registration'].'</loc>'; |
@@ -59,13 +59,13 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | $output .= '</urlset>'; |
| 61 | 61 | |
| 62 | -} else if (isset($_GET['type']) && $_GET['type'] == "airline"){ |
|
| 62 | +} else if (isset($_GET['type']) && $_GET['type'] == "airline") { |
|
| 63 | 63 | |
| 64 | 64 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
| 65 | 65 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
| 66 | 66 | |
| 67 | 67 | $airline_names = $Stats->getAllAirlineNames(); |
| 68 | - foreach($airline_names as $airline_item) |
|
| 68 | + foreach ($airline_names as $airline_item) |
|
| 69 | 69 | { |
| 70 | 70 | $output .= '<url>'; |
| 71 | 71 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/airline/'.$airline_item['airline_icao'].'</loc>'; |
@@ -75,14 +75,14 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | $output .= '</urlset>'; |
| 77 | 77 | |
| 78 | -} else if (isset($_GET['type']) && $_GET['type'] == "airport"){ |
|
| 78 | +} else if (isset($_GET['type']) && $_GET['type'] == "airport") { |
|
| 79 | 79 | |
| 80 | 80 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
| 81 | 81 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
| 82 | 82 | |
| 83 | 83 | $airport_names = $Stats->getAllAirportNames(); |
| 84 | 84 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
| 85 | - foreach($airport_names as $airport_item) |
|
| 85 | + foreach ($airport_names as $airport_item) |
|
| 86 | 86 | { |
| 87 | 87 | $output .= '<url>'; |
| 88 | 88 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/airport/'.$airport_item['airport_icao'].'</loc>'; |
@@ -92,14 +92,14 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | $output .= '</urlset>'; |
| 94 | 94 | |
| 95 | -} else if (isset($_GET['type']) && $_GET['type'] == "manufacturer"){ |
|
| 95 | +} else if (isset($_GET['type']) && $_GET['type'] == "manufacturer") { |
|
| 96 | 96 | |
| 97 | 97 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
| 98 | 98 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
| 99 | 99 | |
| 100 | 100 | $manufacturer_names = $Stats->getAllManufacturers(); |
| 101 | 101 | if (empty($manufacturer_names)) $manufacturer_names = $Spotter->getAllManufacturers(); |
| 102 | - foreach($manufacturer_names as $manufacturer_item) |
|
| 102 | + foreach ($manufacturer_names as $manufacturer_item) |
|
| 103 | 103 | { |
| 104 | 104 | $output .= '<url>'; |
| 105 | 105 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/manufacturer/'.strtolower(str_replace(" ", "-", $manufacturer_item['aircraft_manufacturer'])).'</loc>'; |
@@ -109,13 +109,13 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | $output .= '</urlset>'; |
| 111 | 111 | |
| 112 | -} else if (isset($_GET['type']) && $_GET['type'] == "country"){ |
|
| 112 | +} else if (isset($_GET['type']) && $_GET['type'] == "country") { |
|
| 113 | 113 | |
| 114 | 114 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
| 115 | 115 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
| 116 | 116 | |
| 117 | 117 | $country_names = $Spotter->getAllCountries(); |
| 118 | - foreach($country_names as $country_item) |
|
| 118 | + foreach ($country_names as $country_item) |
|
| 119 | 119 | { |
| 120 | 120 | $output .= '<url>'; |
| 121 | 121 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/country/'.strtolower(str_replace(" ", "-", $country_item['country'])).'</loc>'; |
@@ -125,13 +125,13 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | $output .= '</urlset>'; |
| 127 | 127 | |
| 128 | -} else if (isset($_GET['type']) && $_GET['type'] == "ident"){ |
|
| 128 | +} else if (isset($_GET['type']) && $_GET['type'] == "ident") { |
|
| 129 | 129 | |
| 130 | 130 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
| 131 | 131 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
| 132 | 132 | |
| 133 | 133 | $ident_names = $Spotter->getAllIdents(); |
| 134 | - foreach($ident_names as $ident_item) |
|
| 134 | + foreach ($ident_names as $ident_item) |
|
| 135 | 135 | { |
| 136 | 136 | if (ctype_alnum($ident_item['ident'])) { |
| 137 | 137 | $output .= '<url>'; |
@@ -143,13 +143,13 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | $output .= '</urlset>'; |
| 145 | 145 | |
| 146 | -} else if (isset($_GET['type']) && $_GET['type'] == "date"){ |
|
| 146 | +} else if (isset($_GET['type']) && $_GET['type'] == "date") { |
|
| 147 | 147 | |
| 148 | 148 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
| 149 | 149 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
| 150 | 150 | |
| 151 | 151 | $date_names = $Spotter->getAllDates(); |
| 152 | - foreach($date_names as $date_item) |
|
| 152 | + foreach ($date_names as $date_item) |
|
| 153 | 153 | { |
| 154 | 154 | $output .= '<url>'; |
| 155 | 155 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/date/'.date("Y-m-d", strtotime($date_item['date'])).'</loc>'; |
@@ -159,13 +159,13 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | $output .= '</urlset>'; |
| 161 | 161 | |
| 162 | -} else if (isset($_GET['type']) && $_GET['type'] == "route"){ |
|
| 162 | +} else if (isset($_GET['type']) && $_GET['type'] == "route") { |
|
| 163 | 163 | |
| 164 | 164 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
| 165 | 165 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
| 166 | 166 | |
| 167 | 167 | $route_names = $Spotter->getAllRoutes(); |
| 168 | - foreach($route_names as $route_item) |
|
| 168 | + foreach ($route_names as $route_item) |
|
| 169 | 169 | { |
| 170 | 170 | $output .= '<url>'; |
| 171 | 171 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/route/'.$route_item['airport_departure_icao'].'/'.$route_item['airport_arrival_icao'].'</loc>'; |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | } |
| 176 | 176 | $output .= '</urlset>'; |
| 177 | 177 | |
| 178 | -} else if (isset($_GET['type']) && $_GET['type'] == "static"){ |
|
| 178 | +} else if (isset($_GET['type']) && $_GET['type'] == "static") { |
|
| 179 | 179 | |
| 180 | 180 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
| 181 | 181 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
@@ -31,7 +31,9 @@ discard block |
||
| 31 | 31 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
| 32 | 32 | |
| 33 | 33 | $aircraft_types = $Stats->getAllAircraftTypes(); |
| 34 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
| 34 | + if (empty($aircraft_types)) { |
|
| 35 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
| 36 | + } |
|
| 35 | 37 | foreach($aircraft_types as $aircraft_item) |
| 36 | 38 | { |
| 37 | 39 | $output .= '<url>'; |
@@ -81,7 +83,9 @@ discard block |
||
| 81 | 83 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
| 82 | 84 | |
| 83 | 85 | $airport_names = $Stats->getAllAirportNames(); |
| 84 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
| 86 | + if (empty($airport_names)) { |
|
| 87 | + $airport_names = $Spotter->getAllAirportNames(); |
|
| 88 | + } |
|
| 85 | 89 | foreach($airport_names as $airport_item) |
| 86 | 90 | { |
| 87 | 91 | $output .= '<url>'; |
@@ -98,7 +102,9 @@ discard block |
||
| 98 | 102 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
| 99 | 103 | |
| 100 | 104 | $manufacturer_names = $Stats->getAllManufacturers(); |
| 101 | - if (empty($manufacturer_names)) $manufacturer_names = $Spotter->getAllManufacturers(); |
|
| 105 | + if (empty($manufacturer_names)) { |
|
| 106 | + $manufacturer_names = $Spotter->getAllManufacturers(); |
|
| 107 | + } |
|
| 102 | 108 | foreach($manufacturer_names as $manufacturer_item) |
| 103 | 109 | { |
| 104 | 110 | $output .= '<url>'; |