@@ -4,55 +4,55 @@ discard block |
||
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | $Spotter=new Spotter(); |
| 6 | 6 | if (isset($_GET['start_date'])) { |
| 7 | - //for the date manipulation into the query |
|
| 8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 9 | - $start_date = $_GET['start_date'].":00"; |
|
| 10 | - $end_date = $_GET['end_date'].":00"; |
|
| 11 | - $sql_date = $start_date.",".$end_date; |
|
| 12 | - } else if($_GET['start_date'] != ""){ |
|
| 13 | - $start_date = $_GET['start_date'].":00"; |
|
| 14 | - $sql_date = $start_date; |
|
| 15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 16 | - $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
|
| 17 | - $sql_date = $end_date; |
|
| 18 | - } else $sql_date = ''; |
|
| 7 | + //for the date manipulation into the query |
|
| 8 | + if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 9 | + $start_date = $_GET['start_date'].":00"; |
|
| 10 | + $end_date = $_GET['end_date'].":00"; |
|
| 11 | + $sql_date = $start_date.",".$end_date; |
|
| 12 | + } else if($_GET['start_date'] != ""){ |
|
| 13 | + $start_date = $_GET['start_date'].":00"; |
|
| 14 | + $sql_date = $start_date; |
|
| 15 | + } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 16 | + $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
|
| 17 | + $sql_date = $end_date; |
|
| 18 | + } else $sql_date = ''; |
|
| 19 | 19 | } else $sql_date = ''; |
| 20 | 20 | |
| 21 | 21 | if (isset($_GET['highest_altitude'])) { |
| 22 | - //for altitude manipulation |
|
| 23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 24 | - $end_altitude = $_GET['highest_altitude']; |
|
| 25 | - $start_altitude = $_GET['lowest_altitude']; |
|
| 26 | - $sql_altitude = $start_altitude.",".$end_altitude; |
|
| 27 | - } else if($_GET['highest_altitude'] != ""){ |
|
| 28 | - $end_altitude = $_GET['highest_altitude']; |
|
| 29 | - $sql_altitude = $end_altitude; |
|
| 30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 31 | - $start_altitude = $_GET['lowest_altitude'].",60000"; |
|
| 32 | - $sql_altitude = $start_altitude; |
|
| 33 | - } else $sql_altitude = ''; |
|
| 22 | + //for altitude manipulation |
|
| 23 | + if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 24 | + $end_altitude = $_GET['highest_altitude']; |
|
| 25 | + $start_altitude = $_GET['lowest_altitude']; |
|
| 26 | + $sql_altitude = $start_altitude.",".$end_altitude; |
|
| 27 | + } else if($_GET['highest_altitude'] != ""){ |
|
| 28 | + $end_altitude = $_GET['highest_altitude']; |
|
| 29 | + $sql_altitude = $end_altitude; |
|
| 30 | + } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 31 | + $start_altitude = $_GET['lowest_altitude'].",60000"; |
|
| 32 | + $sql_altitude = $start_altitude; |
|
| 33 | + } else $sql_altitude = ''; |
|
| 34 | 34 | } else $sql_altitude = ''; |
| 35 | 35 | |
| 36 | 36 | //calculuation for the pagination |
| 37 | 37 | if(!isset($_GET['limit'])) |
| 38 | 38 | { |
| 39 | - if (!isset($_GET['number_results'])) |
|
| 40 | - { |
|
| 41 | - $limit_start = 0; |
|
| 42 | - $limit_end = 25; |
|
| 43 | - $absolute_difference = 25; |
|
| 44 | - } else { |
|
| 45 | - if ($_GET['number_results'] > 1000){ |
|
| 46 | - $_GET['number_results'] = 1000; |
|
| 47 | - } |
|
| 48 | - $limit_start = 0; |
|
| 49 | - $limit_end = $_GET['number_results']; |
|
| 50 | - $absolute_difference = $_GET['number_results']; |
|
| 51 | - } |
|
| 39 | + if (!isset($_GET['number_results'])) |
|
| 40 | + { |
|
| 41 | + $limit_start = 0; |
|
| 42 | + $limit_end = 25; |
|
| 43 | + $absolute_difference = 25; |
|
| 44 | + } else { |
|
| 45 | + if ($_GET['number_results'] > 1000){ |
|
| 46 | + $_GET['number_results'] = 1000; |
|
| 47 | + } |
|
| 48 | + $limit_start = 0; |
|
| 49 | + $limit_end = $_GET['number_results']; |
|
| 50 | + $absolute_difference = $_GET['number_results']; |
|
| 51 | + } |
|
| 52 | 52 | } else { |
| 53 | - $limit_explode = explode(",", $_GET['limit']); |
|
| 54 | - $limit_start = $limit_explode[0]; |
|
| 55 | - $limit_end = $limit_explode[1]; |
|
| 53 | + $limit_explode = explode(",", $_GET['limit']); |
|
| 54 | + $limit_start = $limit_explode[0]; |
|
| 55 | + $limit_end = $limit_explode[1]; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -90,69 +90,69 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | $output = '{'; |
| 92 | 92 | $output .= '"type": "FeatureCollection",'; |
| 93 | - $output .= '"features": ['; |
|
| 93 | + $output .= '"features": ['; |
|
| 94 | 94 | |
| 95 | 95 | |
| 96 | - if (!empty($spotter_array)) |
|
| 96 | + if (!empty($spotter_array)) |
|
| 97 | 97 | { |
| 98 | - foreach($spotter_array as $spotter_item) |
|
| 99 | - { |
|
| 98 | + foreach($spotter_array as $spotter_item) |
|
| 99 | + { |
|
| 100 | 100 | |
| 101 | 101 | |
| 102 | 102 | //waypoint plotting |
| 103 | 103 | $output .= '{'; |
| 104 | 104 | $output .= '"type": "Feature",'; |
| 105 | - $output .= '"properties": {'; |
|
| 106 | - $output .= '"id": "'.$spotter_item['spotter_id'].'",'; |
|
| 107 | - $output .= '"ident": "'.$spotter_item['ident'].'",'; |
|
| 108 | - $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
| 109 | - $output .= '"aircraft_icao": "'.$spotter_item['aircraft_type'].'",'; |
|
| 110 | - $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].'",'; |
|
| 111 | - $output .= '"aircraft_manufacturer": "'.$spotter_item['aircraft_manufacturer'].'",'; |
|
| 112 | - $output .= '"airline_name": "'.$spotter_item['airline_name'].'",'; |
|
| 113 | - $output .= '"airline_icao": "'.$spotter_item['airline_icao'].'",'; |
|
| 114 | - $output .= '"airline_iata": "'.$spotter_item['airline_iata'].'",'; |
|
| 115 | - $output .= '"airline_country": "'.$spotter_item['airline_country'].'",'; |
|
| 116 | - $output .= '"airline_callsign": "'.$spotter_item['airline_callsign'].'",'; |
|
| 117 | - $output .= '"airline_type": "'.$spotter_item['airline_type'].'",'; |
|
| 118 | - $output .= '"departure_airport_city": "'.$spotter_item['departure_airport_city'].'",'; |
|
| 119 | - $output .= '"departure_airport_country": "'.$spotter_item['departure_airport_country'].'",'; |
|
| 120 | - $output .= '"departure_airport_iata": "'.$spotter_item['departure_airport_iata'].'",'; |
|
| 121 | - $output .= '"departure_airport_icao": "'.$spotter_item['departure_airport_icao'].'",'; |
|
| 122 | - $output .= '"departure_airport_latitude": "'.$spotter_item['departure_airport_latitude'].'",'; |
|
| 123 | - $output .= '"departure_airport_longitude": "'.$spotter_item['departure_airport_longitude'].'",'; |
|
| 124 | - $output .= '"departure_airport_altitude": "'.$spotter_item['departure_airport_altitude'].'",'; |
|
| 125 | - $output .= '"arrival_airport_city": "'.$spotter_item['arrival_airport_city'].'",'; |
|
| 126 | - $output .= '"arrival_airport_country": "'.$spotter_item['arrival_airport_country'].'",'; |
|
| 127 | - $output .= '"arrival_airport_iata": "'.$spotter_item['arrival_airport_iata'].'",'; |
|
| 128 | - $output .= '"departure_airport_icao": "'.$spotter_item['arrival_airport_icao'].'",'; |
|
| 129 | - $output .= '"arrival_airport_latitude": "'.$spotter_item['arrival_airport_latitude'].'",'; |
|
| 130 | - $output .= '"arrival_airport_longitude": "'.$spotter_item['arrival_airport_longitude'].'",'; |
|
| 131 | - $output .= '"arrival_airport_altitude": "'.$spotter_item['arrival_airport_altitude'].'",'; |
|
| 132 | - $output .= '"latitude": "'.$spotter_item['latitude'].'",'; |
|
| 133 | - $output .= '"longitude": "'.$spotter_item['longitude'].'",'; |
|
| 134 | - $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
| 135 | - $output .= '"ground_speed": "'.$spotter_item['ground_speed'].'",'; |
|
| 136 | - $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
| 137 | - $output .= '"heading_name": "'.$spotter_item['heading_name'].'",'; |
|
| 138 | - $output .= '"date": "'.date("c", strtotime($spotter_item['date_iso_8601'])).'"'; |
|
| 139 | - $output .= '}'; |
|
| 140 | - if ($spotter_item['waypoints'] != '') { |
|
| 141 | - $output .= ',"geometry": {'; |
|
| 142 | - $output .= '"type": "LineString",'; |
|
| 143 | - $output .= '"coordinates": ['; |
|
| 144 | - $waypoint_pieces = explode(' ', $spotter_item['waypoints']); |
|
| 105 | + $output .= '"properties": {'; |
|
| 106 | + $output .= '"id": "'.$spotter_item['spotter_id'].'",'; |
|
| 107 | + $output .= '"ident": "'.$spotter_item['ident'].'",'; |
|
| 108 | + $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
| 109 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_type'].'",'; |
|
| 110 | + $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].'",'; |
|
| 111 | + $output .= '"aircraft_manufacturer": "'.$spotter_item['aircraft_manufacturer'].'",'; |
|
| 112 | + $output .= '"airline_name": "'.$spotter_item['airline_name'].'",'; |
|
| 113 | + $output .= '"airline_icao": "'.$spotter_item['airline_icao'].'",'; |
|
| 114 | + $output .= '"airline_iata": "'.$spotter_item['airline_iata'].'",'; |
|
| 115 | + $output .= '"airline_country": "'.$spotter_item['airline_country'].'",'; |
|
| 116 | + $output .= '"airline_callsign": "'.$spotter_item['airline_callsign'].'",'; |
|
| 117 | + $output .= '"airline_type": "'.$spotter_item['airline_type'].'",'; |
|
| 118 | + $output .= '"departure_airport_city": "'.$spotter_item['departure_airport_city'].'",'; |
|
| 119 | + $output .= '"departure_airport_country": "'.$spotter_item['departure_airport_country'].'",'; |
|
| 120 | + $output .= '"departure_airport_iata": "'.$spotter_item['departure_airport_iata'].'",'; |
|
| 121 | + $output .= '"departure_airport_icao": "'.$spotter_item['departure_airport_icao'].'",'; |
|
| 122 | + $output .= '"departure_airport_latitude": "'.$spotter_item['departure_airport_latitude'].'",'; |
|
| 123 | + $output .= '"departure_airport_longitude": "'.$spotter_item['departure_airport_longitude'].'",'; |
|
| 124 | + $output .= '"departure_airport_altitude": "'.$spotter_item['departure_airport_altitude'].'",'; |
|
| 125 | + $output .= '"arrival_airport_city": "'.$spotter_item['arrival_airport_city'].'",'; |
|
| 126 | + $output .= '"arrival_airport_country": "'.$spotter_item['arrival_airport_country'].'",'; |
|
| 127 | + $output .= '"arrival_airport_iata": "'.$spotter_item['arrival_airport_iata'].'",'; |
|
| 128 | + $output .= '"departure_airport_icao": "'.$spotter_item['arrival_airport_icao'].'",'; |
|
| 129 | + $output .= '"arrival_airport_latitude": "'.$spotter_item['arrival_airport_latitude'].'",'; |
|
| 130 | + $output .= '"arrival_airport_longitude": "'.$spotter_item['arrival_airport_longitude'].'",'; |
|
| 131 | + $output .= '"arrival_airport_altitude": "'.$spotter_item['arrival_airport_altitude'].'",'; |
|
| 132 | + $output .= '"latitude": "'.$spotter_item['latitude'].'",'; |
|
| 133 | + $output .= '"longitude": "'.$spotter_item['longitude'].'",'; |
|
| 134 | + $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
| 135 | + $output .= '"ground_speed": "'.$spotter_item['ground_speed'].'",'; |
|
| 136 | + $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
| 137 | + $output .= '"heading_name": "'.$spotter_item['heading_name'].'",'; |
|
| 138 | + $output .= '"date": "'.date("c", strtotime($spotter_item['date_iso_8601'])).'"'; |
|
| 139 | + $output .= '}'; |
|
| 140 | + if ($spotter_item['waypoints'] != '') { |
|
| 141 | + $output .= ',"geometry": {'; |
|
| 142 | + $output .= '"type": "LineString",'; |
|
| 143 | + $output .= '"coordinates": ['; |
|
| 144 | + $waypoint_pieces = explode(' ', $spotter_item['waypoints']); |
|
| 145 | 145 | $waypoint_pieces = array_chunk($waypoint_pieces, 2); |
| 146 | 146 | |
| 147 | 147 | foreach ($waypoint_pieces as $waypoint_coordinate) |
| 148 | 148 | { |
| 149 | 149 | $output .= '['; |
| 150 | - $output .= $waypoint_coordinate[1].', '; |
|
| 151 | - $output .= $waypoint_coordinate[0]; |
|
| 150 | + $output .= $waypoint_coordinate[1].', '; |
|
| 151 | + $output .= $waypoint_coordinate[0]; |
|
| 152 | 152 | $output .= '],'; |
| 153 | 153 | |
| 154 | 154 | } |
| 155 | - $output = substr($output, 0, -1); |
|
| 155 | + $output = substr($output, 0, -1); |
|
| 156 | 156 | $output .= ']'; |
| 157 | 157 | $output .= '}'; |
| 158 | 158 | } |
@@ -161,50 +161,50 @@ discard block |
||
| 161 | 161 | //location of aircraft |
| 162 | 162 | $output .= '{'; |
| 163 | 163 | $output .= '"type": "Feature",'; |
| 164 | - $output .= '"properties": {'; |
|
| 165 | - $output .= '"id": "'.$spotter_item['spotter_id'].'",'; |
|
| 166 | - $output .= '"ident": "'.$spotter_item['ident'].'",'; |
|
| 167 | - $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
| 168 | - $output .= '"aircraft_icao": "'.$spotter_item['aircraft_type'].'",'; |
|
| 169 | - $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].'",'; |
|
| 170 | - $output .= '"aircraft_manufacturer": "'.$spotter_item['aircraft_manufacturer'].'",'; |
|
| 171 | - $output .= '"airline_name": "'.$spotter_item['airline_name'].'",'; |
|
| 172 | - $output .= '"airline_icao": "'.$spotter_item['airline_icao'].'",'; |
|
| 173 | - $output .= '"airline_iata": "'.$spotter_item['airline_iata'].'",'; |
|
| 174 | - $output .= '"airline_country": "'.$spotter_item['airline_country'].'",'; |
|
| 175 | - $output .= '"airline_callsign": "'.$spotter_item['airline_callsign'].'",'; |
|
| 176 | - $output .= '"airline_type": "'.$spotter_item['airline_type'].'",'; |
|
| 177 | - $output .= '"departure_airport_city": "'.$spotter_item['departure_airport_city'].'",'; |
|
| 178 | - $output .= '"departure_airport_country": "'.$spotter_item['departure_airport_country'].'",'; |
|
| 179 | - $output .= '"departure_airport_iata": "'.$spotter_item['departure_airport_iata'].'",'; |
|
| 180 | - $output .= '"departure_airport_icao": "'.$spotter_item['departure_airport_icao'].'",'; |
|
| 181 | - $output .= '"departure_airport_latitude": "'.$spotter_item['departure_airport_latitude'].'",'; |
|
| 182 | - $output .= '"departure_airport_longitude": "'.$spotter_item['departure_airport_longitude'].'",'; |
|
| 183 | - $output .= '"departure_airport_altitude": "'.$spotter_item['departure_airport_altitude'].'",'; |
|
| 184 | - $output .= '"arrival_airport_city": "'.$spotter_item['arrival_airport_city'].'",'; |
|
| 185 | - $output .= '"arrival_airport_country": "'.$spotter_item['arrival_airport_country'].'",'; |
|
| 186 | - $output .= '"arrival_airport_iata": "'.$spotter_item['arrival_airport_iata'].'",'; |
|
| 187 | - $output .= '"departure_airport_icao": "'.$spotter_item['arrival_airport_icao'].'",'; |
|
| 188 | - $output .= '"arrival_airport_latitude": "'.$spotter_item['arrival_airport_latitude'].'",'; |
|
| 189 | - $output .= '"arrival_airport_longitude": "'.$spotter_item['arrival_airport_longitude'].'",'; |
|
| 190 | - $output .= '"arrival_airport_altitude": "'.$spotter_item['arrival_airport_altitude'].'",'; |
|
| 191 | - $output .= '"latitude": "'.$spotter_item['latitude'].'",'; |
|
| 192 | - $output .= '"longitude": "'.$spotter_item['longitude'].'",'; |
|
| 193 | - $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
| 194 | - $output .= '"ground_speed": "'.$spotter_item['ground_speed'].'",'; |
|
| 195 | - $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
| 196 | - $output .= '"heading_name": "'.$spotter_item['heading_name'].'",'; |
|
| 197 | - $output .= '"date": "'.date("c", strtotime($spotter_item['date_iso_8601'])).'"'; |
|
| 198 | - $output .= '},'; |
|
| 199 | - $output .= '"geometry": {'; |
|
| 200 | - $output .= '"type": "Point",'; |
|
| 201 | - $output .= '"coordinates": ['; |
|
| 164 | + $output .= '"properties": {'; |
|
| 165 | + $output .= '"id": "'.$spotter_item['spotter_id'].'",'; |
|
| 166 | + $output .= '"ident": "'.$spotter_item['ident'].'",'; |
|
| 167 | + $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
| 168 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_type'].'",'; |
|
| 169 | + $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].'",'; |
|
| 170 | + $output .= '"aircraft_manufacturer": "'.$spotter_item['aircraft_manufacturer'].'",'; |
|
| 171 | + $output .= '"airline_name": "'.$spotter_item['airline_name'].'",'; |
|
| 172 | + $output .= '"airline_icao": "'.$spotter_item['airline_icao'].'",'; |
|
| 173 | + $output .= '"airline_iata": "'.$spotter_item['airline_iata'].'",'; |
|
| 174 | + $output .= '"airline_country": "'.$spotter_item['airline_country'].'",'; |
|
| 175 | + $output .= '"airline_callsign": "'.$spotter_item['airline_callsign'].'",'; |
|
| 176 | + $output .= '"airline_type": "'.$spotter_item['airline_type'].'",'; |
|
| 177 | + $output .= '"departure_airport_city": "'.$spotter_item['departure_airport_city'].'",'; |
|
| 178 | + $output .= '"departure_airport_country": "'.$spotter_item['departure_airport_country'].'",'; |
|
| 179 | + $output .= '"departure_airport_iata": "'.$spotter_item['departure_airport_iata'].'",'; |
|
| 180 | + $output .= '"departure_airport_icao": "'.$spotter_item['departure_airport_icao'].'",'; |
|
| 181 | + $output .= '"departure_airport_latitude": "'.$spotter_item['departure_airport_latitude'].'",'; |
|
| 182 | + $output .= '"departure_airport_longitude": "'.$spotter_item['departure_airport_longitude'].'",'; |
|
| 183 | + $output .= '"departure_airport_altitude": "'.$spotter_item['departure_airport_altitude'].'",'; |
|
| 184 | + $output .= '"arrival_airport_city": "'.$spotter_item['arrival_airport_city'].'",'; |
|
| 185 | + $output .= '"arrival_airport_country": "'.$spotter_item['arrival_airport_country'].'",'; |
|
| 186 | + $output .= '"arrival_airport_iata": "'.$spotter_item['arrival_airport_iata'].'",'; |
|
| 187 | + $output .= '"departure_airport_icao": "'.$spotter_item['arrival_airport_icao'].'",'; |
|
| 188 | + $output .= '"arrival_airport_latitude": "'.$spotter_item['arrival_airport_latitude'].'",'; |
|
| 189 | + $output .= '"arrival_airport_longitude": "'.$spotter_item['arrival_airport_longitude'].'",'; |
|
| 190 | + $output .= '"arrival_airport_altitude": "'.$spotter_item['arrival_airport_altitude'].'",'; |
|
| 191 | + $output .= '"latitude": "'.$spotter_item['latitude'].'",'; |
|
| 192 | + $output .= '"longitude": "'.$spotter_item['longitude'].'",'; |
|
| 193 | + $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
| 194 | + $output .= '"ground_speed": "'.$spotter_item['ground_speed'].'",'; |
|
| 195 | + $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
| 196 | + $output .= '"heading_name": "'.$spotter_item['heading_name'].'",'; |
|
| 197 | + $output .= '"date": "'.date("c", strtotime($spotter_item['date_iso_8601'])).'"'; |
|
| 198 | + $output .= '},'; |
|
| 199 | + $output .= '"geometry": {'; |
|
| 200 | + $output .= '"type": "Point",'; |
|
| 201 | + $output .= '"coordinates": ['; |
|
| 202 | 202 | $output .= $spotter_item['longitude'].', '; |
| 203 | 203 | $output .= $spotter_item['latitude']; |
| 204 | 204 | $output .= ']'; |
| 205 | 205 | $output .= '}'; |
| 206 | 206 | $output .= '},'; |
| 207 | - } |
|
| 207 | + } |
|
| 208 | 208 | } |
| 209 | 209 | $output = substr($output, 0, -1); |
| 210 | 210 | |
@@ -2,17 +2,17 @@ discard block |
||
| 2 | 2 | require_once('require/class.Connection.php'); |
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | -$Spotter=new Spotter(); |
|
| 5 | +$Spotter = new Spotter(); |
|
| 6 | 6 | if (isset($_GET['start_date'])) { |
| 7 | 7 | //for the date manipulation into the query |
| 8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 8 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
| 9 | 9 | $start_date = $_GET['start_date'].":00"; |
| 10 | 10 | $end_date = $_GET['end_date'].":00"; |
| 11 | 11 | $sql_date = $start_date.",".$end_date; |
| 12 | - } else if($_GET['start_date'] != ""){ |
|
| 12 | + } else if ($_GET['start_date'] != "") { |
|
| 13 | 13 | $start_date = $_GET['start_date'].":00"; |
| 14 | 14 | $sql_date = $start_date; |
| 15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 15 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
| 16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 17 | 17 | $sql_date = $end_date; |
| 18 | 18 | } else $sql_date = ''; |
@@ -20,21 +20,21 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | if (isset($_GET['highest_altitude'])) { |
| 22 | 22 | //for altitude manipulation |
| 23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 23 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
| 24 | 24 | $end_altitude = $_GET['highest_altitude']; |
| 25 | 25 | $start_altitude = $_GET['lowest_altitude']; |
| 26 | 26 | $sql_altitude = $start_altitude.",".$end_altitude; |
| 27 | - } else if($_GET['highest_altitude'] != ""){ |
|
| 27 | + } else if ($_GET['highest_altitude'] != "") { |
|
| 28 | 28 | $end_altitude = $_GET['highest_altitude']; |
| 29 | 29 | $sql_altitude = $end_altitude; |
| 30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 30 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
| 31 | 31 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
| 32 | 32 | $sql_altitude = $start_altitude; |
| 33 | 33 | } else $sql_altitude = ''; |
| 34 | 34 | } else $sql_altitude = ''; |
| 35 | 35 | |
| 36 | 36 | //calculuation for the pagination |
| 37 | -if(!isset($_GET['limit'])) |
|
| 37 | +if (!isset($_GET['limit'])) |
|
| 38 | 38 | { |
| 39 | 39 | if (!isset($_GET['number_results'])) |
| 40 | 40 | { |
@@ -42,14 +42,14 @@ discard block |
||
| 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 | 49 | $limit_end = $_GET['number_results']; |
| 50 | 50 | $absolute_difference = $_GET['number_results']; |
| 51 | 51 | } |
| 52 | -} else { |
|
| 52 | +} else { |
|
| 53 | 53 | $limit_explode = explode(",", $_GET['limit']); |
| 54 | 54 | $limit_start = $limit_explode[0]; |
| 55 | 55 | $limit_end = $limit_explode[1]; |
@@ -69,23 +69,23 @@ 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 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
| 74 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
| 75 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
| 76 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
| 77 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 78 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
| 79 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
| 80 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
| 81 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
| 82 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
| 83 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
| 84 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
| 85 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
| 86 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
| 87 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
| 88 | -$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,''); |
|
| 72 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
| 73 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
| 74 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
| 75 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
| 76 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
| 77 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 78 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
| 79 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
| 80 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
| 81 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
| 82 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
| 83 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
| 84 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
| 85 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
| 86 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
| 87 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
| 88 | +$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, ''); |
|
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | $output = '{'; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | if (!empty($spotter_array)) |
| 97 | 97 | { |
| 98 | - foreach($spotter_array as $spotter_item) |
|
| 98 | + foreach ($spotter_array as $spotter_item) |
|
| 99 | 99 | { |
| 100 | 100 | |
| 101 | 101 | |
@@ -147,8 +147,8 @@ discard block |
||
| 147 | 147 | foreach ($waypoint_pieces as $waypoint_coordinate) |
| 148 | 148 | { |
| 149 | 149 | $output .= '['; |
| 150 | - $output .= $waypoint_coordinate[1].', '; |
|
| 151 | - $output .= $waypoint_coordinate[0]; |
|
| 150 | + $output .= $waypoint_coordinate[1].', '; |
|
| 151 | + $output .= $waypoint_coordinate[0]; |
|
| 152 | 152 | $output .= '],'; |
| 153 | 153 | |
| 154 | 154 | } |
@@ -199,8 +199,8 @@ discard block |
||
| 199 | 199 | $output .= '"geometry": {'; |
| 200 | 200 | $output .= '"type": "Point",'; |
| 201 | 201 | $output .= '"coordinates": ['; |
| 202 | - $output .= $spotter_item['longitude'].', '; |
|
| 203 | - $output .= $spotter_item['latitude']; |
|
| 202 | + $output .= $spotter_item['longitude'].', '; |
|
| 203 | + $output .= $spotter_item['latitude']; |
|
| 204 | 204 | $output .= ']'; |
| 205 | 205 | $output .= '}'; |
| 206 | 206 | $output .= '},'; |
@@ -15,8 +15,12 @@ discard block |
||
| 15 | 15 | } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
| 16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 17 | 17 | $sql_date = $end_date; |
| 18 | - } else $sql_date = ''; |
|
| 19 | -} else $sql_date = ''; |
|
| 18 | + } else { |
|
| 19 | + $sql_date = ''; |
|
| 20 | + } |
|
| 21 | + } else { |
|
| 22 | + $sql_date = ''; |
|
| 23 | +} |
|
| 20 | 24 | |
| 21 | 25 | if (isset($_GET['highest_altitude'])) { |
| 22 | 26 | //for altitude manipulation |
@@ -30,8 +34,12 @@ discard block |
||
| 30 | 34 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
| 31 | 35 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
| 32 | 36 | $sql_altitude = $start_altitude; |
| 33 | - } else $sql_altitude = ''; |
|
| 34 | -} else $sql_altitude = ''; |
|
| 37 | + } else { |
|
| 38 | + $sql_altitude = ''; |
|
| 39 | + } |
|
| 40 | + } else { |
|
| 41 | + $sql_altitude = ''; |
|
| 42 | +} |
|
| 35 | 43 | |
| 36 | 44 | //calculuation for the pagination |
| 37 | 45 | if(!isset($_GET['limit'])) |
@@ -49,7 +57,7 @@ discard block |
||
| 49 | 57 | $limit_end = $_GET['number_results']; |
| 50 | 58 | $absolute_difference = $_GET['number_results']; |
| 51 | 59 | } |
| 52 | -} else { |
|
| 60 | +} else { |
|
| 53 | 61 | $limit_explode = explode(",", $_GET['limit']); |
| 54 | 62 | $limit_start = $limit_explode[0]; |
| 55 | 63 | $limit_end = $limit_explode[1]; |
@@ -67,8 +75,11 @@ discard block |
||
| 67 | 75 | |
| 68 | 76 | header("Content-type: text/yaml"); |
| 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 | $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
| 74 | 85 | $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | var data = google.visualization.arrayToDataTable([ |
| 24 | 24 | ["'._("Country").'", "'._("# of times").'"], '; |
| 25 | 25 | $country_data = ''; |
| 26 | -foreach($airline_array as $airline_item) |
|
| 26 | +foreach ($airline_array as $airline_item) |
|
| 27 | 27 | { |
| 28 | 28 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
| 29 | 29 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | print '</thead>'; |
| 58 | 58 | print '<tbody>'; |
| 59 | 59 | $i = 1; |
| 60 | - foreach($airline_array as $airline_item) |
|
| 60 | + foreach ($airline_array as $airline_item) |
|
| 61 | 61 | { |
| 62 | 62 | print '<tr>'; |
| 63 | 63 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | $page_url = $globalURL.'/tools-metar'; |
| 12 | 12 | |
| 13 | -$message = filter_input(INPUT_POST,'metar_message',FILTER_SANITIZE_STRING); |
|
| 13 | +$message = filter_input(INPUT_POST, 'metar_message', FILTER_SANITIZE_STRING); |
|
| 14 | 14 | |
| 15 | 15 | print '<div class="info column">'; |
| 16 | 16 | print '<h1>'._("Parse METAR messages").'</h1>'; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | print '<b>'._("Dew point:").'</b> '.$metar_parse['dew'].' °C'." "; |
| 72 | 72 | } |
| 73 | 73 | if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) { |
| 74 | - $humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1); |
|
| 74 | + $humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1); |
|
| 75 | 75 | print '<b>'._("Humidity:").'</b> '.$humidity.'%'." "; |
| 76 | 76 | } |
| 77 | 77 | if (isset($metar_parse['QNH'])) { |
@@ -23,7 +23,9 @@ discard block |
||
| 23 | 23 | print '<fieldset class="form-group">'; |
| 24 | 24 | print '<label for="metar_message">'._("METAR Message").'</label>'; |
| 25 | 25 | print '<textarea class="form-control" name="metar_message" id="metar_message" rows="5">'; |
| 26 | -if ($message != '') print $message; |
|
| 26 | +if ($message != '') { |
|
| 27 | + print $message; |
|
| 28 | +} |
|
| 27 | 29 | print '</textarea>'; |
| 28 | 30 | print '</fieldset>'; |
| 29 | 31 | print '<button type="submit" class="btn btn-primary">Submit</button>'; |
@@ -59,7 +61,9 @@ discard block |
||
| 59 | 61 | if (isset($metar_parse['cloud'])) { |
| 60 | 62 | print '<b>'._("Cloud:").'</b> '; |
| 61 | 63 | foreach ($metar_parse['cloud'] as $key => $cloud) { |
| 62 | - if ($key > 0) print ' / '; |
|
| 64 | + if ($key > 0) { |
|
| 65 | + print ' / '; |
|
| 66 | + } |
|
| 63 | 67 | print $cloud['type'].' at '.$cloud['level'].' m'; |
| 64 | 68 | } |
| 65 | 69 | print " "; |
@@ -4,55 +4,55 @@ discard block |
||
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | $Spotter = new Spotter(); |
| 6 | 6 | if (isset($_GET['start_date'])) { |
| 7 | - //for the date manipulation into the query |
|
| 8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 9 | - $start_date = $_GET['start_date'].":00"; |
|
| 10 | - $end_date = $_GET['end_date'].":00"; |
|
| 11 | - $sql_date = $start_date.",".$end_date; |
|
| 12 | - } else if($_GET['start_date'] != ""){ |
|
| 13 | - $start_date = $_GET['start_date'].":00"; |
|
| 14 | - $sql_date = $start_date; |
|
| 15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 16 | - $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
|
| 17 | - $sql_date = $end_date; |
|
| 18 | - } else $sql_date = ''; |
|
| 7 | + //for the date manipulation into the query |
|
| 8 | + if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 9 | + $start_date = $_GET['start_date'].":00"; |
|
| 10 | + $end_date = $_GET['end_date'].":00"; |
|
| 11 | + $sql_date = $start_date.",".$end_date; |
|
| 12 | + } else if($_GET['start_date'] != ""){ |
|
| 13 | + $start_date = $_GET['start_date'].":00"; |
|
| 14 | + $sql_date = $start_date; |
|
| 15 | + } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 16 | + $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
|
| 17 | + $sql_date = $end_date; |
|
| 18 | + } else $sql_date = ''; |
|
| 19 | 19 | } else $sql_date = ''; |
| 20 | 20 | |
| 21 | 21 | if (isset($_GET['highest_altitude'])) { |
| 22 | - //for altitude manipulation |
|
| 23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 24 | - $end_altitude = $_GET['highest_altitude']; |
|
| 25 | - $start_altitude = $_GET['lowest_altitude']; |
|
| 26 | - $sql_altitude = $start_altitude.",".$end_altitude; |
|
| 27 | - } else if($_GET['highest_altitude'] != ""){ |
|
| 28 | - $end_altitude = $_GET['highest_altitude']; |
|
| 29 | - $sql_altitude = $end_altitude; |
|
| 30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 31 | - $start_altitude = $_GET['lowest_altitude'].",60000"; |
|
| 32 | - $sql_altitude = $start_altitude; |
|
| 33 | - } else $sql_altitude = ''; |
|
| 22 | + //for altitude manipulation |
|
| 23 | + if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 24 | + $end_altitude = $_GET['highest_altitude']; |
|
| 25 | + $start_altitude = $_GET['lowest_altitude']; |
|
| 26 | + $sql_altitude = $start_altitude.",".$end_altitude; |
|
| 27 | + } else if($_GET['highest_altitude'] != ""){ |
|
| 28 | + $end_altitude = $_GET['highest_altitude']; |
|
| 29 | + $sql_altitude = $end_altitude; |
|
| 30 | + } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 31 | + $start_altitude = $_GET['lowest_altitude'].",60000"; |
|
| 32 | + $sql_altitude = $start_altitude; |
|
| 33 | + } else $sql_altitude = ''; |
|
| 34 | 34 | } else $sql_altitude = ''; |
| 35 | 35 | |
| 36 | 36 | //calculuation for the pagination |
| 37 | 37 | if(!isset($_GET['limit'])) |
| 38 | 38 | { |
| 39 | - if (!isset($_GET['number_results'])) |
|
| 40 | - { |
|
| 41 | - $limit_start = 0; |
|
| 42 | - $limit_end = 25; |
|
| 43 | - $absolute_difference = 25; |
|
| 44 | - } else { |
|
| 45 | - if ($_GET['number_results'] > 1000){ |
|
| 46 | - $_GET['number_results'] = 1000; |
|
| 47 | - } |
|
| 48 | - $limit_start = 0; |
|
| 49 | - $limit_end = $_GET['number_results']; |
|
| 50 | - $absolute_difference = $_GET['number_results']; |
|
| 51 | - } |
|
| 39 | + if (!isset($_GET['number_results'])) |
|
| 40 | + { |
|
| 41 | + $limit_start = 0; |
|
| 42 | + $limit_end = 25; |
|
| 43 | + $absolute_difference = 25; |
|
| 44 | + } else { |
|
| 45 | + if ($_GET['number_results'] > 1000){ |
|
| 46 | + $_GET['number_results'] = 1000; |
|
| 47 | + } |
|
| 48 | + $limit_start = 0; |
|
| 49 | + $limit_end = $_GET['number_results']; |
|
| 50 | + $absolute_difference = $_GET['number_results']; |
|
| 51 | + } |
|
| 52 | 52 | } else { |
| 53 | - $limit_explode = explode(",", $_GET['limit']); |
|
| 54 | - $limit_start = $limit_explode[0]; |
|
| 55 | - $limit_end = $limit_explode[1]; |
|
| 53 | + $limit_explode = explode(",", $_GET['limit']); |
|
| 54 | + $limit_start = $limit_explode[0]; |
|
| 55 | + $limit_end = $limit_explode[1]; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -98,8 +98,8 @@ discard block |
||
| 98 | 98 | print '<subtitle>The latest airplanes</subtitle>'; |
| 99 | 99 | print '<updated>'.$date.'</updated>'; |
| 100 | 100 | print '<author>'; |
| 101 | - print '<name>FlightAirMap</name>'; |
|
| 102 | - print '<email>[email protected]</email>'; |
|
| 101 | + print '<name>FlightAirMap</name>'; |
|
| 102 | + print '<email>[email protected]</email>'; |
|
| 103 | 103 | print '</author>'; |
| 104 | 104 | print '<id>FlightAirMap</id>'; |
| 105 | 105 | |
@@ -110,14 +110,14 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | print '<entry>'; |
| 113 | - print '<title>'.$spotter_item['ident'].' '.$spotter_item['airline_name'].' | '.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].') | '.$spotter_item['departure_airport'].' - '.$spotter_item['arrival_airport'].'</title>'; |
|
| 114 | - print '<link href="http://www.flightairmap.fr/flightid/'.$spotter_item['spotter_id'].'"/>'; |
|
| 115 | - print '<id>http://www.flightairmap.fr/flightid/'.$spotter_item['spotter_id'].'</id>'; |
|
| 116 | - print '<content>Ident: '.$spotter_item['ident'].' | Registration: '.$spotter_item['registration'].' | Aircraft: '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].') | Airline: '.$spotter_item['airline_name'].' | Coming From: '.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country'].' ('.$spotter_item['departure_airport'].') | Flying to: '.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].') | Flew nearby on: '.date("M j, Y, g:i a T", strtotime($spotter_item['date_iso_8601'])).'</content>'; |
|
| 117 | - print '<updated>'.$date.'</updated>'; |
|
| 118 | - if ($spotter_item['waypoints'] != "") |
|
| 119 | - { |
|
| 120 | - print '<georss:where>'; |
|
| 113 | + print '<title>'.$spotter_item['ident'].' '.$spotter_item['airline_name'].' | '.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].') | '.$spotter_item['departure_airport'].' - '.$spotter_item['arrival_airport'].'</title>'; |
|
| 114 | + print '<link href="http://www.flightairmap.fr/flightid/'.$spotter_item['spotter_id'].'"/>'; |
|
| 115 | + print '<id>http://www.flightairmap.fr/flightid/'.$spotter_item['spotter_id'].'</id>'; |
|
| 116 | + print '<content>Ident: '.$spotter_item['ident'].' | Registration: '.$spotter_item['registration'].' | Aircraft: '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].') | Airline: '.$spotter_item['airline_name'].' | Coming From: '.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country'].' ('.$spotter_item['departure_airport'].') | Flying to: '.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].') | Flew nearby on: '.date("M j, Y, g:i a T", strtotime($spotter_item['date_iso_8601'])).'</content>'; |
|
| 117 | + print '<updated>'.$date.'</updated>'; |
|
| 118 | + if ($spotter_item['waypoints'] != "") |
|
| 119 | + { |
|
| 120 | + print '<georss:where>'; |
|
| 121 | 121 | print '<gml:LineString>'; |
| 122 | 122 | print '<gml:posList>'; |
| 123 | 123 | $waypoint_pieces = explode(' ', $spotter_item['waypoints']); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | foreach ($waypoint_pieces as $waypoint_coordinate) |
| 127 | 127 | { |
| 128 | - print $waypoint_coordinate[0].' '.$waypoint_coordinate[1].' '; |
|
| 128 | + print $waypoint_coordinate[0].' '.$waypoint_coordinate[1].' '; |
|
| 129 | 129 | |
| 130 | 130 | } |
| 131 | 131 | print '</gml:posList>'; |
@@ -5,14 +5,14 @@ discard block |
||
| 5 | 5 | $Spotter = new Spotter(); |
| 6 | 6 | if (isset($_GET['start_date'])) { |
| 7 | 7 | //for the date manipulation into the query |
| 8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 8 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
| 9 | 9 | $start_date = $_GET['start_date'].":00"; |
| 10 | 10 | $end_date = $_GET['end_date'].":00"; |
| 11 | 11 | $sql_date = $start_date.",".$end_date; |
| 12 | - } else if($_GET['start_date'] != ""){ |
|
| 12 | + } else if ($_GET['start_date'] != "") { |
|
| 13 | 13 | $start_date = $_GET['start_date'].":00"; |
| 14 | 14 | $sql_date = $start_date; |
| 15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 15 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
| 16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 17 | 17 | $sql_date = $end_date; |
| 18 | 18 | } else $sql_date = ''; |
@@ -20,21 +20,21 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | if (isset($_GET['highest_altitude'])) { |
| 22 | 22 | //for altitude manipulation |
| 23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 23 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
| 24 | 24 | $end_altitude = $_GET['highest_altitude']; |
| 25 | 25 | $start_altitude = $_GET['lowest_altitude']; |
| 26 | 26 | $sql_altitude = $start_altitude.",".$end_altitude; |
| 27 | - } else if($_GET['highest_altitude'] != ""){ |
|
| 27 | + } else if ($_GET['highest_altitude'] != "") { |
|
| 28 | 28 | $end_altitude = $_GET['highest_altitude']; |
| 29 | 29 | $sql_altitude = $end_altitude; |
| 30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 30 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
| 31 | 31 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
| 32 | 32 | $sql_altitude = $start_altitude; |
| 33 | 33 | } else $sql_altitude = ''; |
| 34 | 34 | } else $sql_altitude = ''; |
| 35 | 35 | |
| 36 | 36 | //calculuation for the pagination |
| 37 | -if(!isset($_GET['limit'])) |
|
| 37 | +if (!isset($_GET['limit'])) |
|
| 38 | 38 | { |
| 39 | 39 | if (!isset($_GET['number_results'])) |
| 40 | 40 | { |
@@ -42,14 +42,14 @@ discard block |
||
| 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 | 49 | $limit_end = $_GET['number_results']; |
| 50 | 50 | $absolute_difference = $_GET['number_results']; |
| 51 | 51 | } |
| 52 | -} else { |
|
| 52 | +} else { |
|
| 53 | 53 | $limit_explode = explode(",", $_GET['limit']); |
| 54 | 54 | $limit_start = $limit_explode[0]; |
| 55 | 55 | $limit_end = $limit_explode[1]; |
@@ -72,23 +72,23 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | if (isset($_GET['sort'])) $sort = $_GET['sort']; |
| 74 | 74 | else $sort = ''; |
| 75 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
| 76 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
| 77 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
| 78 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
| 79 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
| 80 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 81 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
| 82 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
| 83 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
| 84 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
| 85 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
| 86 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
| 87 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
| 88 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
| 89 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
| 90 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
| 91 | -$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,''); |
|
| 75 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
| 76 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
| 77 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
| 78 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
| 79 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
| 80 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 81 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
| 82 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
| 83 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
| 84 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
| 85 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
| 86 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
| 87 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
| 88 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
| 89 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
| 90 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
| 91 | +$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 | 92 | |
| 93 | 93 | print '<?xml version="1.0" encoding="UTF-8" ?>'; |
| 94 | 94 | print '<feed xmlns="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">'; |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | if (!empty($spotter_array)) |
| 107 | 107 | { |
| 108 | - foreach($spotter_array as $spotter_item) |
|
| 108 | + foreach ($spotter_array as $spotter_item) |
|
| 109 | 109 | { |
| 110 | 110 | |
| 111 | 111 | |
@@ -15,8 +15,12 @@ discard block |
||
| 15 | 15 | } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
| 16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 17 | 17 | $sql_date = $end_date; |
| 18 | - } else $sql_date = ''; |
|
| 19 | -} else $sql_date = ''; |
|
| 18 | + } else { |
|
| 19 | + $sql_date = ''; |
|
| 20 | + } |
|
| 21 | + } else { |
|
| 22 | + $sql_date = ''; |
|
| 23 | +} |
|
| 20 | 24 | |
| 21 | 25 | if (isset($_GET['highest_altitude'])) { |
| 22 | 26 | //for altitude manipulation |
@@ -30,8 +34,12 @@ discard block |
||
| 30 | 34 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
| 31 | 35 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
| 32 | 36 | $sql_altitude = $start_altitude; |
| 33 | - } else $sql_altitude = ''; |
|
| 34 | -} else $sql_altitude = ''; |
|
| 37 | + } else { |
|
| 38 | + $sql_altitude = ''; |
|
| 39 | + } |
|
| 40 | + } else { |
|
| 41 | + $sql_altitude = ''; |
|
| 42 | +} |
|
| 35 | 43 | |
| 36 | 44 | //calculuation for the pagination |
| 37 | 45 | if(!isset($_GET['limit'])) |
@@ -49,7 +57,7 @@ discard block |
||
| 49 | 57 | $limit_end = $_GET['number_results']; |
| 50 | 58 | $absolute_difference = $_GET['number_results']; |
| 51 | 59 | } |
| 52 | -} else { |
|
| 60 | +} else { |
|
| 53 | 61 | $limit_explode = explode(",", $_GET['limit']); |
| 54 | 62 | $limit_start = $limit_explode[0]; |
| 55 | 63 | $limit_end = $limit_explode[1]; |
@@ -67,8 +75,11 @@ discard block |
||
| 67 | 75 | |
| 68 | 76 | header("Content-type: text/yaml"); |
| 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 | $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
| 74 | 85 | $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | <?php |
| 333 | 333 | if (isset($_COOKIE['AirportZoom'])) $getZoom = $_COOKIE['AirportZoom']; |
| 334 | 334 | else $getZoom = '7'; |
| 335 | - ?> |
|
| 335 | + ?> |
|
| 336 | 336 | //if (map.getZoom() <= <?php print $getZoom; ?>) { |
| 337 | 337 | if (typeof airportsLayer != 'undefined') { |
| 338 | 338 | if (map.hasLayer(airportsLayer) == true) { |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | update_locationsLayer(); |
| 486 | 486 | |
| 487 | 487 | <?php |
| 488 | - if (!isset($ident) && !isset($flightaware_id)) { |
|
| 488 | + if (!isset($ident) && !isset($flightaware_id)) { |
|
| 489 | 489 | ?> |
| 490 | 490 | |
| 491 | 491 | var info = L.control(); |
@@ -506,11 +506,11 @@ discard block |
||
| 506 | 506 | |
| 507 | 507 | |
| 508 | 508 | <?php |
| 509 | - } |
|
| 509 | + } |
|
| 510 | 510 | ?> |
| 511 | 511 | |
| 512 | 512 | <?php |
| 513 | - if (isset($_GET['archive'])) { |
|
| 513 | + if (isset($_GET['archive'])) { |
|
| 514 | 514 | ?> |
| 515 | 515 | var archive = L.control(); |
| 516 | 516 | archive.onAdd = function (map) { |
@@ -529,12 +529,12 @@ discard block |
||
| 529 | 529 | }; |
| 530 | 530 | archive.addTo(map); |
| 531 | 531 | <?php |
| 532 | - } |
|
| 532 | + } |
|
| 533 | 533 | ?> |
| 534 | 534 | |
| 535 | 535 | |
| 536 | 536 | <?php |
| 537 | - //if ((isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'false') || (isset($globalMapPopup) && !$globalMapPopup)) { |
|
| 537 | + //if ((isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'false') || (isset($globalMapPopup) && !$globalMapPopup)) { |
|
| 538 | 538 | ?> |
| 539 | 539 | var showdetails = L.control(); |
| 540 | 540 | showdetails.onAdd = function (map) { |
@@ -1016,15 +1016,15 @@ discard block |
||
| 1016 | 1016 | if (map.getZoom() > 7) { |
| 1017 | 1017 | var style = { |
| 1018 | 1018 | <?php |
| 1019 | - if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
| 1019 | + if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
| 1020 | 1020 | ?> |
| 1021 | 1021 | "color": "#1a3151", |
| 1022 | 1022 | <?php |
| 1023 | - } else { |
|
| 1023 | + } else { |
|
| 1024 | 1024 | ?> |
| 1025 | 1025 | "color": getAltitudeColor(altitude), |
| 1026 | 1026 | <?php |
| 1027 | - } |
|
| 1027 | + } |
|
| 1028 | 1028 | ?> |
| 1029 | 1029 | "weight": 3, |
| 1030 | 1030 | "opacity": 1 |
@@ -1034,15 +1034,15 @@ discard block |
||
| 1034 | 1034 | } else { |
| 1035 | 1035 | var style = { |
| 1036 | 1036 | <?php |
| 1037 | - if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
| 1037 | + if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
| 1038 | 1038 | ?> |
| 1039 | 1039 | "color": "#1a3151", |
| 1040 | 1040 | <?php |
| 1041 | - } else { |
|
| 1041 | + } else { |
|
| 1042 | 1042 | ?> |
| 1043 | 1043 | "color": getAltitudeColor(altitude), |
| 1044 | 1044 | <?php |
| 1045 | - } |
|
| 1045 | + } |
|
| 1046 | 1046 | ?> |
| 1047 | 1047 | "weight": 2, |
| 1048 | 1048 | "opacity": 1 |
@@ -1054,15 +1054,15 @@ discard block |
||
| 1054 | 1054 | if (map.getZoom() > 7) { |
| 1055 | 1055 | var style = { |
| 1056 | 1056 | <?php |
| 1057 | - if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
| 1057 | + if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
| 1058 | 1058 | ?> |
| 1059 | 1059 | "color": "#1a3151", |
| 1060 | 1060 | <?php |
| 1061 | - } else { |
|
| 1061 | + } else { |
|
| 1062 | 1062 | ?> |
| 1063 | 1063 | "color": getAltitudeColor(altitude), |
| 1064 | 1064 | <?php |
| 1065 | - } |
|
| 1065 | + } |
|
| 1066 | 1066 | ?> |
| 1067 | 1067 | "weight": 3, |
| 1068 | 1068 | "opacity": 0.6 |
@@ -1072,15 +1072,15 @@ discard block |
||
| 1072 | 1072 | } else { |
| 1073 | 1073 | var style = { |
| 1074 | 1074 | <?php |
| 1075 | - if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
| 1075 | + if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
|
| 1076 | 1076 | ?> |
| 1077 | 1077 | "color": "#1a3151", |
| 1078 | 1078 | <?php |
| 1079 | - } else { |
|
| 1079 | + } else { |
|
| 1080 | 1080 | ?> |
| 1081 | 1081 | "color": getAltitudeColor(altitude), |
| 1082 | 1082 | <?php |
| 1083 | - } |
|
| 1083 | + } |
|
| 1084 | 1084 | ?> |
| 1085 | 1085 | "weight": 2, |
| 1086 | 1086 | "opacity": 0.6 |
@@ -1090,21 +1090,21 @@ discard block |
||
| 1090 | 1090 | } |
| 1091 | 1091 | } |
| 1092 | 1092 | <?php |
| 1093 | - } else { |
|
| 1094 | - ?> |
|
| 1093 | + } else { |
|
| 1094 | + ?> |
|
| 1095 | 1095 | if (map.getZoom() > 7) { |
| 1096 | 1096 | var style = { |
| 1097 | 1097 | <?php |
| 1098 | 1098 | if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
| 1099 | - ?> |
|
| 1099 | + ?> |
|
| 1100 | 1100 | "color": "#1a3151", |
| 1101 | 1101 | <?php |
| 1102 | 1102 | } else { |
| 1103 | - ?> |
|
| 1103 | + ?> |
|
| 1104 | 1104 | "color": getAltitudeColor(altitude), |
| 1105 | 1105 | <?php |
| 1106 | 1106 | } |
| 1107 | - ?> |
|
| 1107 | + ?> |
|
| 1108 | 1108 | "weight": 3, |
| 1109 | 1109 | "opacity": 0.6 |
| 1110 | 1110 | }; |
@@ -1114,15 +1114,15 @@ discard block |
||
| 1114 | 1114 | var style = { |
| 1115 | 1115 | <?php |
| 1116 | 1116 | if (isset($globalMapAltitudeColor) && !$globalMapAltitudeColor) { |
| 1117 | - ?> |
|
| 1117 | + ?> |
|
| 1118 | 1118 | "color": "#1a3151", |
| 1119 | 1119 | <?php |
| 1120 | 1120 | } else { |
| 1121 | - ?> |
|
| 1121 | + ?> |
|
| 1122 | 1122 | "color": getAltitudeColor(altitude), |
| 1123 | 1123 | <?php |
| 1124 | 1124 | } |
| 1125 | - ?> |
|
| 1125 | + ?> |
|
| 1126 | 1126 | "weight": 2, |
| 1127 | 1127 | "opacity": 0.6 |
| 1128 | 1128 | }; |
@@ -1130,7 +1130,7 @@ discard block |
||
| 1130 | 1130 | layer_data.addLayer(layer); |
| 1131 | 1131 | } |
| 1132 | 1132 | <?php |
| 1133 | - } |
|
| 1133 | + } |
|
| 1134 | 1134 | ?> |
| 1135 | 1135 | } |
| 1136 | 1136 | } |
@@ -1190,10 +1190,10 @@ discard block |
||
| 1190 | 1190 | |
| 1191 | 1191 | |
| 1192 | 1192 | <?php |
| 1193 | - // Add support for custom json via $globalMapJson |
|
| 1194 | - if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
| 1193 | + // Add support for custom json via $globalMapJson |
|
| 1194 | + if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
| 1195 | 1195 | foreach ($globalMapJson as $json) { |
| 1196 | - if (isset($json['url'])) { |
|
| 1196 | + if (isset($json['url'])) { |
|
| 1197 | 1197 | ?> |
| 1198 | 1198 | update_genLayer('<?php print $json['url']; ?>'); |
| 1199 | 1199 | <?php |
@@ -1202,9 +1202,9 @@ discard block |
||
| 1202 | 1202 | setInterval(function(){update_genLayer('<?php print $json['url']; ?>')}, <?php print $json['refresh']; ?>); |
| 1203 | 1203 | <?php |
| 1204 | 1204 | } |
| 1205 | - } |
|
| 1205 | + } |
|
| 1206 | + } |
|
| 1206 | 1207 | } |
| 1207 | - } |
|
| 1208 | 1208 | |
| 1209 | 1209 | ?> |
| 1210 | 1210 | |
@@ -5,8 +5,11 @@ discard block |
||
| 5 | 5 | $_COOKIE['MapFormat'] = '2d'; |
| 6 | 6 | |
| 7 | 7 | // Compressed GeoJson is used if true |
| 8 | -if (!isset($globalJsonCompress)) $compress = true; |
|
| 9 | -else $compress = $globalJsonCompress; |
|
| 8 | +if (!isset($globalJsonCompress)) { |
|
| 9 | + $compress = true; |
|
| 10 | +} else { |
|
| 11 | + $compress = $globalJsonCompress; |
|
| 12 | +} |
|
| 10 | 13 | ?> |
| 11 | 14 | <?php |
| 12 | 15 | if (isset($_GET['archive'])) { |
@@ -18,8 +21,11 @@ discard block |
||
| 18 | 21 | //$lastupd = round(($_GET['enddate']-$_GET['begindate'])/(($_GET['during']*60)/10)); |
| 19 | 22 | //$lastupd = 20; |
| 20 | 23 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
| 21 | - if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
|
| 22 | - else $enddate = time(); |
|
| 24 | + if (isset($_GET['enddate']) && $_GET['enddate'] != '') { |
|
| 25 | + $enddate = $_GET['enddate']; |
|
| 26 | + } else { |
|
| 27 | + $enddate = time(); |
|
| 28 | + } |
|
| 23 | 29 | setcookie("archive_begin",$begindate); |
| 24 | 30 | setcookie("archive_end",$enddate); |
| 25 | 31 | setcookie("archive_update",$lastupd); |
@@ -109,7 +115,17 @@ discard block |
||
| 109 | 115 | } |
| 110 | 116 | |
| 111 | 117 | //create the map |
| 112 | - map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) print $latitude; else print $globalCenterLatitude; ?>,<?php if (isset($longitude)) print $longitude; else print $globalCenterLongitude; ?>], zoom); |
|
| 118 | + map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) { |
|
| 119 | + print $latitude; |
|
| 120 | +} else { |
|
| 121 | + print $globalCenterLatitude; |
|
| 122 | +} |
|
| 123 | +?>,<?php if (isset($longitude)) { |
|
| 124 | + print $longitude; |
|
| 125 | +} else { |
|
| 126 | + print $globalCenterLongitude; |
|
| 127 | +} |
|
| 128 | +?>], zoom); |
|
| 113 | 129 | <?php |
| 114 | 130 | } else { |
| 115 | 131 | ?> |
@@ -122,9 +138,19 @@ discard block |
||
| 122 | 138 | || navigator.userAgent.match(/BlackBerry/i) |
| 123 | 139 | || navigator.userAgent.match(/Windows Phone/i)) |
| 124 | 140 | { |
| 125 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
| 141 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
| 142 | + print $globalLiveZoom-1; |
|
| 143 | +} else { |
|
| 144 | + print '8'; |
|
| 145 | +} |
|
| 146 | +?>; |
|
| 126 | 147 | } else { |
| 127 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
|
| 148 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
| 149 | + print $globalLiveZoom; |
|
| 150 | +} else { |
|
| 151 | + print '9'; |
|
| 152 | +} |
|
| 153 | +?>; |
|
| 128 | 154 | } |
| 129 | 155 | |
| 130 | 156 | //create the map |
@@ -149,16 +175,27 @@ discard block |
||
| 149 | 175 | bounds = L.latLngBounds(southWest,northEast); |
| 150 | 176 | //a few title layers |
| 151 | 177 | <?php |
| 152 | - if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType']; |
|
| 153 | - else $MapType = $globalMapProvider; |
|
| 178 | + if (isset($_COOKIE['MapType'])) { |
|
| 179 | + $MapType = $_COOKIE['MapType']; |
|
| 180 | + } else { |
|
| 181 | + $MapType = $globalMapProvider; |
|
| 182 | + } |
|
| 154 | 183 | |
| 155 | 184 | if ($MapType == 'Mapbox') { |
| 156 | - if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId; |
|
| 157 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
| 158 | -?> |
|
| 185 | + if ($_COOKIE['MapTypeId'] == 'default') { |
|
| 186 | + $MapBoxId = $globalMapboxId; |
|
| 187 | + } else { |
|
| 188 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
| 189 | + } |
|
| 190 | + ?> |
|
| 159 | 191 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
| 160 | 192 | maxZoom: 18, |
| 161 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
| 193 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
| 194 | + print 'false'; |
|
| 195 | +} else { |
|
| 196 | + print 'true'; |
|
| 197 | +} |
|
| 198 | +?>, |
|
| 162 | 199 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
| 163 | 200 | '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + |
| 164 | 201 | 'Imagery © <a href="http://mapbox.com">Mapbox</a>', |
@@ -170,7 +207,12 @@ discard block |
||
| 170 | 207 | ?> |
| 171 | 208 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
| 172 | 209 | maxZoom: 18, |
| 173 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
| 210 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
| 211 | + print 'false'; |
|
| 212 | +} else { |
|
| 213 | + print 'true'; |
|
| 214 | +} |
|
| 215 | +?>, |
|
| 174 | 216 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
| 175 | 217 | '<a href="www.openstreetmap.org/copyright">Open Database Licence</a>' |
| 176 | 218 | }).addTo(map); |
@@ -216,20 +258,26 @@ discard block |
||
| 216 | 258 | map.addLayer(yandexLayer); |
| 217 | 259 | <?php |
| 218 | 260 | } elseif ($MapType == 'Bing-Aerial') { |
| 219 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 220 | -?> |
|
| 261 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
| 262 | + setcookie('MapType','OpenStreetMap'); |
|
| 263 | + } |
|
| 264 | + ?> |
|
| 221 | 265 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
| 222 | 266 | map.addLayer(bingLayer); |
| 223 | 267 | <?php |
| 224 | 268 | } elseif ($MapType == 'Bing-Hybrid') { |
| 225 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 226 | -?> |
|
| 269 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
| 270 | + setcookie('MapType','OpenStreetMap'); |
|
| 271 | + } |
|
| 272 | + ?> |
|
| 227 | 273 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
| 228 | 274 | map.addLayer(bingLayer); |
| 229 | 275 | <?php |
| 230 | 276 | } elseif ($MapType == 'Bing-Road') { |
| 231 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 232 | -?> |
|
| 277 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
| 278 | + setcookie('MapType','OpenStreetMap'); |
|
| 279 | + } |
|
| 280 | + ?> |
|
| 233 | 281 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
| 234 | 282 | map.addLayer(bingLayer); |
| 235 | 283 | <?php |
@@ -277,7 +325,12 @@ discard block |
||
| 277 | 325 | } |
| 278 | 326 | } elseif ($globalBounding == 'circle') { |
| 279 | 327 | ?> |
| 280 | - var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) print $globalBoundingCircleSize; else print '70000'; ?>,{ |
|
| 328 | + var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) { |
|
| 329 | + print $globalBoundingCircleSize; |
|
| 330 | +} else { |
|
| 331 | + print '70000'; |
|
| 332 | +} |
|
| 333 | +?>,{ |
|
| 281 | 334 | color: '#92C7D1', |
| 282 | 335 | fillColor: '#92C7D1', |
| 283 | 336 | fillOpacity: 0.3, |
@@ -336,8 +389,11 @@ discard block |
||
| 336 | 389 | |
| 337 | 390 | function update_airportsLayer() { |
| 338 | 391 | <?php |
| 339 | - if (isset($_COOKIE['AirportZoom'])) $getZoom = $_COOKIE['AirportZoom']; |
|
| 340 | - else $getZoom = '7'; |
|
| 392 | + if (isset($_COOKIE['AirportZoom'])) { |
|
| 393 | + $getZoom = $_COOKIE['AirportZoom']; |
|
| 394 | + } else { |
|
| 395 | + $getZoom = '7'; |
|
| 396 | + } |
|
| 341 | 397 | ?> |
| 342 | 398 | //if (map.getZoom() <= <?php print $getZoom; ?>) { |
| 343 | 399 | if (typeof airportsLayer != 'undefined') { |
@@ -660,9 +716,13 @@ discard block |
||
| 660 | 716 | if (callsign != ""){ markerLabel += callsign; } |
| 661 | 717 | if (departure_airport_code != "" && arrival_airport_code != "" && departure_airport_code != "NA" && arrival_airport_code != "NA"){ markerLabel += ' ( '+departure_airport_code+' - '+arrival_airport_code+' )'; } |
| 662 | 718 | <?php |
| 663 | - if (isset($_COOKIE['IconColor'])) $IconColor = $_COOKIE['IconColor']; |
|
| 664 | - elseif (isset($globalAircraftIconColor)) $IconColor = $globalAircraftIconColor; |
|
| 665 | - else $IconColor = '1a3151'; |
|
| 719 | + if (isset($_COOKIE['IconColor'])) { |
|
| 720 | + $IconColor = $_COOKIE['IconColor']; |
|
| 721 | + } elseif (isset($globalAircraftIconColor)) { |
|
| 722 | + $IconColor = $globalAircraftIconColor; |
|
| 723 | + } else { |
|
| 724 | + $IconColor = '1a3151'; |
|
| 725 | + } |
|
| 666 | 726 | if (!isset($ident) && !isset($flightaware_id)) { |
| 667 | 727 | ?> |
| 668 | 728 | info_update(feature.properties.fc); |
@@ -710,7 +770,12 @@ discard block |
||
| 710 | 770 | <?php |
| 711 | 771 | } else { |
| 712 | 772 | ?> |
| 713 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 773 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
| 774 | + print $archiveupdatetime*1000; |
|
| 775 | +} else { |
|
| 776 | + print $globalMapRefresh*1000+20000; |
|
| 777 | +} |
|
| 778 | +?>+feature.properties.sqt*1000); |
|
| 714 | 779 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 715 | 780 | <?php |
| 716 | 781 | } |
@@ -755,7 +820,12 @@ discard block |
||
| 755 | 820 | <?php |
| 756 | 821 | } else { |
| 757 | 822 | ?> |
| 758 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 823 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
| 824 | + print $archiveupdatetime*1000; |
|
| 825 | +} else { |
|
| 826 | + print $globalMapRefresh*1000+20000; |
|
| 827 | +} |
|
| 828 | +?>+feature.properties.sqt*1000); |
|
| 759 | 829 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 760 | 830 | <?php |
| 761 | 831 | } |
@@ -799,7 +869,12 @@ discard block |
||
| 799 | 869 | <?php |
| 800 | 870 | } else { |
| 801 | 871 | ?> |
| 802 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 872 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
| 873 | + print $archiveupdatetime*1000; |
|
| 874 | +} else { |
|
| 875 | + print $globalMapRefresh*1000+20000; |
|
| 876 | +} |
|
| 877 | +?>+feature.properties.sqt*1000); |
|
| 803 | 878 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 804 | 879 | <?php |
| 805 | 880 | } |
@@ -1141,19 +1216,34 @@ discard block |
||
| 1141 | 1216 | if (isset($_GET['archive'])) { |
| 1142 | 1217 | ?> |
| 1143 | 1218 | //then load it again every 30 seconds |
| 1144 | -// var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
| 1219 | +// var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) { |
|
| 1220 | + print ($globalMapRefresh*1000)/2; |
|
| 1221 | +} else { |
|
| 1222 | + print '15000'; |
|
| 1223 | +} |
|
| 1224 | +?>); |
|
| 1145 | 1225 | reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php print $archiveupdatetime*1000; ?>); |
| 1146 | 1226 | <?php |
| 1147 | 1227 | } else { |
| 1148 | 1228 | ?> |
| 1149 | 1229 | //then load it again every 30 seconds |
| 1150 | -reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
| 1230 | +reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) { |
|
| 1231 | + print $globalMapRefresh*1000; |
|
| 1232 | +} else { |
|
| 1233 | + print '30000'; |
|
| 1234 | +} |
|
| 1235 | +?>); |
|
| 1151 | 1236 | |
| 1152 | 1237 | <?php |
| 1153 | 1238 | if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
| 1154 | 1239 | ?> |
| 1155 | 1240 | update_polarLayer(); |
| 1156 | -setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
| 1241 | +setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) { |
|
| 1242 | + print $globalMapRefresh*1000*2; |
|
| 1243 | +} else { |
|
| 1244 | + print '60000'; |
|
| 1245 | +} |
|
| 1246 | +?>); |
|
| 1157 | 1247 | <?php |
| 1158 | 1248 | } |
| 1159 | 1249 | ?> |
@@ -1168,7 +1258,12 @@ discard block |
||
| 1168 | 1258 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) ) { |
| 1169 | 1259 | ?> |
| 1170 | 1260 | update_atcLayer(); |
| 1171 | -setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
| 1261 | +setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) { |
|
| 1262 | + print $globalMapRefresh*1000*2; |
|
| 1263 | +} else { |
|
| 1264 | + print '60000'; |
|
| 1265 | +} |
|
| 1266 | +?>); |
|
| 1172 | 1267 | <?php |
| 1173 | 1268 | } |
| 1174 | 1269 | ?> |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | require_once('../require/settings.php'); |
| 3 | 3 | require_once('../require/class.Language.php'); |
| 4 | 4 | |
| 5 | -setcookie("MapFormat",'2d'); |
|
| 5 | +setcookie("MapFormat", '2d'); |
|
| 6 | 6 | //$_COOKIE['MapFormat'] = '2d'; |
| 7 | 7 | |
| 8 | 8 | // Compressed GeoJson is used if true |
@@ -21,10 +21,10 @@ discard block |
||
| 21 | 21 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
| 22 | 22 | if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
| 23 | 23 | else $enddate = time(); |
| 24 | - setcookie("archive_begin",$begindate); |
|
| 25 | - setcookie("archive_end",$enddate); |
|
| 26 | - setcookie("archive_update",$lastupd); |
|
| 27 | - setcookie("archive_speed",$archivespeed); |
|
| 24 | + setcookie("archive_begin", $begindate); |
|
| 25 | + setcookie("archive_end", $enddate); |
|
| 26 | + setcookie("archive_update", $lastupd); |
|
| 27 | + setcookie("archive_speed", $archivespeed); |
|
| 28 | 28 | ?> |
| 29 | 29 | |
| 30 | 30 | document.cookie = 'archive_begin=<?php print $begindate; ?>; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'; |
@@ -95,16 +95,16 @@ discard block |
||
| 95 | 95 | <?php |
| 96 | 96 | } |
| 97 | 97 | if (isset($_GET['ident'])) { |
| 98 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
| 98 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
| 99 | 99 | } |
| 100 | 100 | if (isset($_GET['flightaware_id'])) { |
| 101 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
| 101 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
| 102 | 102 | } |
| 103 | 103 | if (isset($_GET['latitude'])) { |
| 104 | - $latitude = filter_input(INPUT_GET,'latitude',FILTER_SANITIZE_STRING); |
|
| 104 | + $latitude = filter_input(INPUT_GET, 'latitude', FILTER_SANITIZE_STRING); |
|
| 105 | 105 | } |
| 106 | 106 | if (isset($_GET['longitude'])) { |
| 107 | - $longitude = filter_input(INPUT_GET,'longitude',FILTER_SANITIZE_STRING); |
|
| 107 | + $longitude = filter_input(INPUT_GET, 'longitude', FILTER_SANITIZE_STRING); |
|
| 108 | 108 | } |
| 109 | 109 | ?> |
| 110 | 110 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | || navigator.userAgent.match(/BlackBerry/i) |
| 140 | 140 | || navigator.userAgent.match(/Windows Phone/i)) |
| 141 | 141 | { |
| 142 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
| 142 | + var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom - 1; else print '8'; ?>; |
|
| 143 | 143 | } else { |
| 144 | 144 | var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
| 145 | 145 | } |
@@ -233,19 +233,19 @@ discard block |
||
| 233 | 233 | map.addLayer(yandexLayer); |
| 234 | 234 | <?php |
| 235 | 235 | } elseif ($MapType == 'Bing-Aerial') { |
| 236 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 236 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
| 237 | 237 | ?> |
| 238 | 238 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
| 239 | 239 | map.addLayer(bingLayer); |
| 240 | 240 | <?php |
| 241 | 241 | } elseif ($MapType == 'Bing-Hybrid') { |
| 242 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 242 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
| 243 | 243 | ?> |
| 244 | 244 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
| 245 | 245 | map.addLayer(bingLayer); |
| 246 | 246 | <?php |
| 247 | 247 | } elseif ($MapType == 'Bing-Road') { |
| 248 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 248 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
| 249 | 249 | ?> |
| 250 | 250 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
| 251 | 251 | map.addLayer(bingLayer); |
@@ -535,10 +535,10 @@ discard block |
||
| 535 | 535 | }; |
| 536 | 536 | archive.update = function (props) { |
| 537 | 537 | if (typeof props != 'undefined') { |
| 538 | - //this._div.innerHTML = '<h4><?php echo str_replace("'","\'",_("Archive Date & Time")); ?></h4>' + '<b>' + props.archive_date + ' UTC </b>' + '<br/><i class="fa fa-fast-backward" aria-hidden="true"></i> <i class="fa fa-backward" aria-hidden="true"></i> <a href="#" onClick="archivePause();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="archivePlay();"><i class="fa fa-play" aria-hidden="true"></i></a> <i class="fa fa-forward" aria-hidden="true"></i> <i class="fa fa-fast-forward" aria-hidden="true"></i>'; |
|
| 539 | - this._div.innerHTML = '<h4><?php echo str_replace("'","\'",_("Archive Date & Time")); ?></h4>' + '<b>' + props.archive_date + ' UTC </b>' + '<br/><a href="#" onClick="archivePause();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="archivePlay();"><i class="fa fa-play" aria-hidden="true"></i></a>'; |
|
| 538 | + //this._div.innerHTML = '<h4><?php echo str_replace("'", "\'", _("Archive Date & Time")); ?></h4>' + '<b>' + props.archive_date + ' UTC </b>' + '<br/><i class="fa fa-fast-backward" aria-hidden="true"></i> <i class="fa fa-backward" aria-hidden="true"></i> <a href="#" onClick="archivePause();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="archivePlay();"><i class="fa fa-play" aria-hidden="true"></i></a> <i class="fa fa-forward" aria-hidden="true"></i> <i class="fa fa-fast-forward" aria-hidden="true"></i>'; |
|
| 539 | + this._div.innerHTML = '<h4><?php echo str_replace("'", "\'", _("Archive Date & Time")); ?></h4>' + '<b>' + props.archive_date + ' UTC </b>' + '<br/><a href="#" onClick="archivePause();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="archivePlay();"><i class="fa fa-play" aria-hidden="true"></i></a>'; |
|
| 540 | 540 | } else { |
| 541 | - this._div.innerHTML = '<h4><?php echo str_replace("'","\'",_("Archive Date & Time")); ?></h4>' + '<b><i class="fa fa-spinner fa-pulse fa-2x fa-fw margin-bottom"></i></b>'; |
|
| 541 | + this._div.innerHTML = '<h4><?php echo str_replace("'", "\'", _("Archive Date & Time")); ?></h4>' + '<b><i class="fa fa-spinner fa-pulse fa-2x fa-fw margin-bottom"></i></b>'; |
|
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | }; |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | <?php |
| 739 | 739 | } else { |
| 740 | 740 | ?> |
| 741 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 741 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 742 | 742 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 743 | 743 | <?php |
| 744 | 744 | } |
@@ -753,7 +753,7 @@ discard block |
||
| 753 | 753 | iconAnchor: [<?php print $globalAircraftSize/2; ?>, <?php print $globalAircraftSize; ?>], |
| 754 | 754 | shadowUrl: iconURLShadowpath, |
| 755 | 755 | shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>], |
| 756 | - shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>] |
|
| 756 | + shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>] |
|
| 757 | 757 | }) |
| 758 | 758 | }) |
| 759 | 759 | <?php |
@@ -785,7 +785,7 @@ discard block |
||
| 785 | 785 | <?php |
| 786 | 786 | } else { |
| 787 | 787 | ?> |
| 788 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 788 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 789 | 789 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 790 | 790 | <?php |
| 791 | 791 | } |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | <?php |
| 832 | 832 | } else { |
| 833 | 833 | ?> |
| 834 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 834 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 835 | 835 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 836 | 836 | <?php |
| 837 | 837 | } |
@@ -1420,12 +1420,12 @@ discard block |
||
| 1420 | 1420 | airs.push(air.value); |
| 1421 | 1421 | } |
| 1422 | 1422 | } |
| 1423 | - document.cookie = 'Airlines='+airs.join()+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+1, date("Y"))); ?>; path=/' |
|
| 1423 | + document.cookie = 'Airlines='+airs.join()+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"))); ?>; path=/' |
|
| 1424 | 1424 | } |
| 1425 | 1425 | function airlinestype(selectObj) { |
| 1426 | 1426 | var idx = selectObj.selectedIndex; |
| 1427 | 1427 | var airtype = selectObj.options[idx].value; |
| 1428 | - document.cookie = 'airlinestype='+airtype+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+1, date("Y"))); ?>; path=/' |
|
| 1428 | + document.cookie = 'airlinestype='+airtype+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"))); ?>; path=/' |
|
| 1429 | 1429 | } |
| 1430 | 1430 | function sources(selectObj) { |
| 1431 | 1431 | var sources = [], source; |
@@ -1436,7 +1436,7 @@ discard block |
||
| 1436 | 1436 | } |
| 1437 | 1437 | } |
| 1438 | 1438 | //document.cookie = 'Sources='+sources.join()+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
| 1439 | - document.cookie = 'Sources='+sources.join()+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+1, date("Y"))); ?>; path=/' |
|
| 1439 | + document.cookie = 'Sources='+sources.join()+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"))); ?>; path=/' |
|
| 1440 | 1440 | } |
| 1441 | 1441 | |
| 1442 | 1442 | function show3D() { |
@@ -1459,23 +1459,23 @@ discard block |
||
| 1459 | 1459 | |
| 1460 | 1460 | function clickVATSIM(cb) { |
| 1461 | 1461 | //document.cookie = 'ShowVATSIM='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
| 1462 | - document.cookie = 'ShowVATSIM='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
| 1462 | + document.cookie = 'ShowVATSIM='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
| 1463 | 1463 | } |
| 1464 | 1464 | function clickIVAO(cb) { |
| 1465 | 1465 | //document.cookie = 'ShowIVAO='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
| 1466 | - document.cookie = 'ShowIVAO='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
| 1466 | + document.cookie = 'ShowIVAO='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
| 1467 | 1467 | } |
| 1468 | 1468 | function clickphpVMS(cb) { |
| 1469 | 1469 | //document.cookie = 'ShowVMS='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
| 1470 | - document.cookie = 'ShowVMS='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
| 1470 | + document.cookie = 'ShowVMS='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
| 1471 | 1471 | } |
| 1472 | 1472 | function clickSBS1(cb) { |
| 1473 | 1473 | //document.cookie = 'ShowSBS1='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
| 1474 | - document.cookie = 'ShowSBS1='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
| 1474 | + document.cookie = 'ShowSBS1='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
| 1475 | 1475 | } |
| 1476 | 1476 | function clickAPRS(cb) { |
| 1477 | 1477 | //document.cookie = 'ShowAPRS='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
| 1478 | - document.cookie = 'ShowAPRS='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
| 1478 | + document.cookie = 'ShowAPRS='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
| 1479 | 1479 | } |
| 1480 | 1480 | function clickFlightPopup(cb) { |
| 1481 | 1481 | document.cookie = 'flightpopup='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
@@ -4,55 +4,55 @@ discard block |
||
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | $Spotter = new Spotter(); |
| 6 | 6 | if (isset($_GET['start_date'])) { |
| 7 | - //for the date manipulation into the query |
|
| 8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 9 | - $start_date = $_GET['start_date'].":00"; |
|
| 10 | - $end_date = $_GET['end_date'].":00"; |
|
| 11 | - $sql_date = $start_date.",".$end_date; |
|
| 12 | - } else if($_GET['start_date'] != ""){ |
|
| 13 | - $start_date = $_GET['start_date'].":00"; |
|
| 14 | - $sql_date = $start_date; |
|
| 15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 16 | - $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
|
| 17 | - $sql_date = $end_date; |
|
| 18 | - } else $sql_date = ''; |
|
| 7 | + //for the date manipulation into the query |
|
| 8 | + if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 9 | + $start_date = $_GET['start_date'].":00"; |
|
| 10 | + $end_date = $_GET['end_date'].":00"; |
|
| 11 | + $sql_date = $start_date.",".$end_date; |
|
| 12 | + } else if($_GET['start_date'] != ""){ |
|
| 13 | + $start_date = $_GET['start_date'].":00"; |
|
| 14 | + $sql_date = $start_date; |
|
| 15 | + } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 16 | + $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
|
| 17 | + $sql_date = $end_date; |
|
| 18 | + } else $sql_date = ''; |
|
| 19 | 19 | } else $sql_date = ''; |
| 20 | 20 | |
| 21 | 21 | if (isset($_GET['highest_altitude'])) { |
| 22 | - //for altitude manipulation |
|
| 23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 24 | - $end_altitude = $_GET['highest_altitude']; |
|
| 25 | - $start_altitude = $_GET['lowest_altitude']; |
|
| 26 | - $sql_altitude = $start_altitude.",".$end_altitude; |
|
| 27 | - } else if($_GET['highest_altitude'] != ""){ |
|
| 28 | - $end_altitude = $_GET['highest_altitude']; |
|
| 29 | - $sql_altitude = $end_altitude; |
|
| 30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 31 | - $start_altitude = $_GET['lowest_altitude'].",60000"; |
|
| 32 | - $sql_altitude = $start_altitude; |
|
| 33 | - } else $sql_altitude = ''; |
|
| 22 | + //for altitude manipulation |
|
| 23 | + if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 24 | + $end_altitude = $_GET['highest_altitude']; |
|
| 25 | + $start_altitude = $_GET['lowest_altitude']; |
|
| 26 | + $sql_altitude = $start_altitude.",".$end_altitude; |
|
| 27 | + } else if($_GET['highest_altitude'] != ""){ |
|
| 28 | + $end_altitude = $_GET['highest_altitude']; |
|
| 29 | + $sql_altitude = $end_altitude; |
|
| 30 | + } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 31 | + $start_altitude = $_GET['lowest_altitude'].",60000"; |
|
| 32 | + $sql_altitude = $start_altitude; |
|
| 33 | + } else $sql_altitude = ''; |
|
| 34 | 34 | } else $sql_altitude = ''; |
| 35 | 35 | |
| 36 | 36 | //calculuation for the pagination |
| 37 | 37 | if(!isset($_GET['limit'])) |
| 38 | 38 | { |
| 39 | - if (!isset($_GET['number_results'])) |
|
| 40 | - { |
|
| 41 | - $limit_start = 0; |
|
| 42 | - $limit_end = 25; |
|
| 43 | - $absolute_difference = 25; |
|
| 44 | - } else { |
|
| 45 | - if ($_GET['number_results'] > 1000){ |
|
| 46 | - $_GET['number_results'] = 1000; |
|
| 47 | - } |
|
| 48 | - $limit_start = 0; |
|
| 49 | - $limit_end = $_GET['number_results']; |
|
| 50 | - $absolute_difference = $_GET['number_results']; |
|
| 51 | - } |
|
| 39 | + if (!isset($_GET['number_results'])) |
|
| 40 | + { |
|
| 41 | + $limit_start = 0; |
|
| 42 | + $limit_end = 25; |
|
| 43 | + $absolute_difference = 25; |
|
| 44 | + } else { |
|
| 45 | + if ($_GET['number_results'] > 1000){ |
|
| 46 | + $_GET['number_results'] = 1000; |
|
| 47 | + } |
|
| 48 | + $limit_start = 0; |
|
| 49 | + $limit_end = $_GET['number_results']; |
|
| 50 | + $absolute_difference = $_GET['number_results']; |
|
| 51 | + } |
|
| 52 | 52 | } else { |
| 53 | - $limit_explode = explode(",", $_GET['limit']); |
|
| 54 | - $limit_start = $limit_explode[0]; |
|
| 55 | - $limit_end = $limit_explode[1]; |
|
| 53 | + $limit_explode = explode(",", $_GET['limit']); |
|
| 54 | + $limit_start = $limit_explode[0]; |
|
| 55 | + $limit_end = $limit_explode[1]; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -95,39 +95,39 @@ discard block |
||
| 95 | 95 | { |
| 96 | 96 | |
| 97 | 97 | array_push($flights, array( |
| 98 | - "id" => $spotter_item['spotter_id'], |
|
| 98 | + "id" => $spotter_item['spotter_id'], |
|
| 99 | 99 | "ident" => $spotter_item['ident'], |
| 100 | 100 | "registration" => $spotter_item['registration'], |
| 101 | 101 | "aircraft_icao" => $spotter_item['aircraft_type'], |
| 102 | - "aircraft_name" => $spotter_item['aircraft_name'], |
|
| 103 | - "aircraft_manufacturer" => $spotter_item['aircraft_manufacturer'], |
|
| 102 | + "aircraft_name" => $spotter_item['aircraft_name'], |
|
| 103 | + "aircraft_manufacturer" => $spotter_item['aircraft_manufacturer'], |
|
| 104 | 104 | "airline_name" => $spotter_item['airline_name'], |
| 105 | - "airline_icao" => $spotter_item['airline_icao'], |
|
| 106 | - "airline_iata" => $spotter_item['airline_iata'], |
|
| 107 | - "airline_country" => $spotter_item['airline_country'], |
|
| 108 | - "airline_callsign" => $spotter_item['airline_callsign'], |
|
| 109 | - "airline_type" => $spotter_item['airline_type'], |
|
| 110 | - "departure_airport_city" => $spotter_item['departure_airport_city'], |
|
| 111 | - "departure_airport_country" => $spotter_item['departure_airport_country'], |
|
| 112 | - "departure_airport_iata" => $spotter_item['departure_airport_iata'], |
|
| 113 | - "departure_airport_icao" => $spotter_item['departure_airport_icao'], |
|
| 114 | - "departure_airport_latitude" => $spotter_item['departure_airport_latitude'], |
|
| 115 | - "departure_airport_longitude" => $spotter_item['departure_airport_longitude'], |
|
| 116 | - "departure_airport_altitude" => $spotter_item['departure_airport_altitude'], |
|
| 117 | - "arrival_airport_city" => $spotter_item['arrival_airport_city'], |
|
| 118 | - "arrival_airport_country" => $spotter_item['arrival_airport_country'], |
|
| 119 | - "arrival_airport_iata" => $spotter_item['arrival_airport_iata'], |
|
| 120 | - "arrival_airport_icao" => $spotter_item['arrival_airport_icao'], |
|
| 121 | - "arrival_airport_latitude" => $spotter_item['arrival_airport_latitude'], |
|
| 122 | - "arrival_airport_longitude" => $spotter_item['arrival_airport_longitude'], |
|
| 123 | - "arrival_airport_altitude" => $spotter_item['arrival_airport_altitude'], |
|
| 124 | - "latitude" => $spotter_item['latitude'], |
|
| 125 | - "longitude" => $spotter_item['longitude'], |
|
| 126 | - "altitude" => $spotter_item['altitude'], |
|
| 127 | - "ground_speed" => $spotter_item['ground_speed'], |
|
| 128 | - "heading" => $spotter_item['heading'], |
|
| 129 | - "heading_name" => $spotter_item['heading_name'], |
|
| 130 | - "waypoints" => $spotter_item['waypoints'], |
|
| 105 | + "airline_icao" => $spotter_item['airline_icao'], |
|
| 106 | + "airline_iata" => $spotter_item['airline_iata'], |
|
| 107 | + "airline_country" => $spotter_item['airline_country'], |
|
| 108 | + "airline_callsign" => $spotter_item['airline_callsign'], |
|
| 109 | + "airline_type" => $spotter_item['airline_type'], |
|
| 110 | + "departure_airport_city" => $spotter_item['departure_airport_city'], |
|
| 111 | + "departure_airport_country" => $spotter_item['departure_airport_country'], |
|
| 112 | + "departure_airport_iata" => $spotter_item['departure_airport_iata'], |
|
| 113 | + "departure_airport_icao" => $spotter_item['departure_airport_icao'], |
|
| 114 | + "departure_airport_latitude" => $spotter_item['departure_airport_latitude'], |
|
| 115 | + "departure_airport_longitude" => $spotter_item['departure_airport_longitude'], |
|
| 116 | + "departure_airport_altitude" => $spotter_item['departure_airport_altitude'], |
|
| 117 | + "arrival_airport_city" => $spotter_item['arrival_airport_city'], |
|
| 118 | + "arrival_airport_country" => $spotter_item['arrival_airport_country'], |
|
| 119 | + "arrival_airport_iata" => $spotter_item['arrival_airport_iata'], |
|
| 120 | + "arrival_airport_icao" => $spotter_item['arrival_airport_icao'], |
|
| 121 | + "arrival_airport_latitude" => $spotter_item['arrival_airport_latitude'], |
|
| 122 | + "arrival_airport_longitude" => $spotter_item['arrival_airport_longitude'], |
|
| 123 | + "arrival_airport_altitude" => $spotter_item['arrival_airport_altitude'], |
|
| 124 | + "latitude" => $spotter_item['latitude'], |
|
| 125 | + "longitude" => $spotter_item['longitude'], |
|
| 126 | + "altitude" => $spotter_item['altitude'], |
|
| 127 | + "ground_speed" => $spotter_item['ground_speed'], |
|
| 128 | + "heading" => $spotter_item['heading'], |
|
| 129 | + "heading_name" => $spotter_item['heading_name'], |
|
| 130 | + "waypoints" => $spotter_item['waypoints'], |
|
| 131 | 131 | "date" => date("c", strtotime($spotter_item['date_iso_8601'])) |
| 132 | 132 | ) |
| 133 | 133 | ); |
@@ -5,14 +5,14 @@ discard block |
||
| 5 | 5 | $Spotter = new Spotter(); |
| 6 | 6 | if (isset($_GET['start_date'])) { |
| 7 | 7 | //for the date manipulation into the query |
| 8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 8 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
| 9 | 9 | $start_date = $_GET['start_date'].":00"; |
| 10 | 10 | $end_date = $_GET['end_date'].":00"; |
| 11 | 11 | $sql_date = $start_date.",".$end_date; |
| 12 | - } else if($_GET['start_date'] != ""){ |
|
| 12 | + } else if ($_GET['start_date'] != "") { |
|
| 13 | 13 | $start_date = $_GET['start_date'].":00"; |
| 14 | 14 | $sql_date = $start_date; |
| 15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 15 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
| 16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 17 | 17 | $sql_date = $end_date; |
| 18 | 18 | } else $sql_date = ''; |
@@ -20,21 +20,21 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | if (isset($_GET['highest_altitude'])) { |
| 22 | 22 | //for altitude manipulation |
| 23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 23 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
| 24 | 24 | $end_altitude = $_GET['highest_altitude']; |
| 25 | 25 | $start_altitude = $_GET['lowest_altitude']; |
| 26 | 26 | $sql_altitude = $start_altitude.",".$end_altitude; |
| 27 | - } else if($_GET['highest_altitude'] != ""){ |
|
| 27 | + } else if ($_GET['highest_altitude'] != "") { |
|
| 28 | 28 | $end_altitude = $_GET['highest_altitude']; |
| 29 | 29 | $sql_altitude = $end_altitude; |
| 30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 30 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
| 31 | 31 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
| 32 | 32 | $sql_altitude = $start_altitude; |
| 33 | 33 | } else $sql_altitude = ''; |
| 34 | 34 | } else $sql_altitude = ''; |
| 35 | 35 | |
| 36 | 36 | //calculuation for the pagination |
| 37 | -if(!isset($_GET['limit'])) |
|
| 37 | +if (!isset($_GET['limit'])) |
|
| 38 | 38 | { |
| 39 | 39 | if (!isset($_GET['number_results'])) |
| 40 | 40 | { |
@@ -42,14 +42,14 @@ discard block |
||
| 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 | 49 | $limit_end = $_GET['number_results']; |
| 50 | 50 | $absolute_difference = $_GET['number_results']; |
| 51 | 51 | } |
| 52 | -} else { |
|
| 52 | +} else { |
|
| 53 | 53 | $limit_explode = explode(",", $_GET['limit']); |
| 54 | 54 | $limit_start = $limit_explode[0]; |
| 55 | 55 | $limit_end = $limit_explode[1]; |
@@ -69,29 +69,29 @@ 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 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
| 74 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
| 75 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
| 76 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
| 77 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 78 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
| 79 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
| 80 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
| 81 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
| 82 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
| 83 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
| 84 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
| 85 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
| 86 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
| 87 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
| 88 | -$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,''); |
|
| 72 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
| 73 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
| 74 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
| 75 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
| 76 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
| 77 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 78 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
| 79 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
| 80 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
| 81 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
| 82 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
| 83 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
| 84 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
| 85 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
| 86 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
| 87 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
| 88 | +$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, ''); |
|
| 89 | 89 | |
| 90 | 90 | $output = "-flights:\n"; |
| 91 | 91 | |
| 92 | 92 | if (!empty($spotter_array)) |
| 93 | 93 | { |
| 94 | - foreach($spotter_array as $spotter_item) |
|
| 94 | + foreach ($spotter_array as $spotter_item) |
|
| 95 | 95 | { |
| 96 | 96 | |
| 97 | 97 | $output .= ' - id: '.$spotter_item['spotter_id']; |
@@ -15,8 +15,12 @@ discard block |
||
| 15 | 15 | } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
| 16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 17 | 17 | $sql_date = $end_date; |
| 18 | - } else $sql_date = ''; |
|
| 19 | -} else $sql_date = ''; |
|
| 18 | + } else { |
|
| 19 | + $sql_date = ''; |
|
| 20 | + } |
|
| 21 | + } else { |
|
| 22 | + $sql_date = ''; |
|
| 23 | +} |
|
| 20 | 24 | |
| 21 | 25 | if (isset($_GET['highest_altitude'])) { |
| 22 | 26 | //for altitude manipulation |
@@ -30,8 +34,12 @@ discard block |
||
| 30 | 34 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
| 31 | 35 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
| 32 | 36 | $sql_altitude = $start_altitude; |
| 33 | - } else $sql_altitude = ''; |
|
| 34 | -} else $sql_altitude = ''; |
|
| 37 | + } else { |
|
| 38 | + $sql_altitude = ''; |
|
| 39 | + } |
|
| 40 | + } else { |
|
| 41 | + $sql_altitude = ''; |
|
| 42 | +} |
|
| 35 | 43 | |
| 36 | 44 | //calculuation for the pagination |
| 37 | 45 | if(!isset($_GET['limit'])) |
@@ -49,7 +57,7 @@ discard block |
||
| 49 | 57 | $limit_end = $_GET['number_results']; |
| 50 | 58 | $absolute_difference = $_GET['number_results']; |
| 51 | 59 | } |
| 52 | -} else { |
|
| 60 | +} else { |
|
| 53 | 61 | $limit_explode = explode(",", $_GET['limit']); |
| 54 | 62 | $limit_start = $limit_explode[0]; |
| 55 | 63 | $limit_end = $limit_explode[1]; |
@@ -67,8 +75,11 @@ discard block |
||
| 67 | 75 | |
| 68 | 76 | header("Content-type: text/yaml"); |
| 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 | $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
| 74 | 85 | $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
@@ -9,14 +9,14 @@ discard block |
||
| 9 | 9 | require_once('require/class.Language.php'); |
| 10 | 10 | |
| 11 | 11 | $Spotter = new Spotter(); |
| 12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 13 | 13 | if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) { |
| 14 | 14 | $spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort); |
| 15 | 15 | } else $spotter_array = array(); |
| 16 | 16 | |
| 17 | 17 | if (!empty($spotter_array)) |
| 18 | 18 | { |
| 19 | - $title = sprintf(_("Most Common Aircraft Manufacturer between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']); |
|
| 19 | + $title = sprintf(_("Most Common Aircraft Manufacturer between %s (%s), %s - %s (%s), %s"), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']); |
|
| 20 | 20 | require_once('header.php'); |
| 21 | 21 | print '<div class="info column">'; |
| 22 | 22 | print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>'; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | include('route-sub-menu.php'); |
| 28 | 28 | print '<div class="column">'; |
| 29 | 29 | print '<h2>'._("Most Common Aircraft Manufacturer").'</h2>'; |
| 30 | - print '<p>'.sprintf(_("The statistic below shows the most common Aircraft Manufacturer of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']).'</p>'; |
|
| 30 | + print '<p>'.sprintf(_("The statistic below shows the most common Aircraft Manufacturer of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']).'</p>'; |
|
| 31 | 31 | |
| 32 | 32 | $manufacturers_array = $Spotter->countAllAircraftManufacturerByRoute($_GET['departure_airport'], $_GET['arrival_airport']); |
| 33 | 33 | if (!empty($manufacturers_array)) |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | print '</thead>'; |
| 43 | 43 | print '<tbody>'; |
| 44 | 44 | $i = 1; |
| 45 | - foreach($manufacturers_array as $manufacturer_item) |
|
| 45 | + foreach ($manufacturers_array as $manufacturer_item) |
|
| 46 | 46 | { |
| 47 | 47 | print '<tr>'; |
| 48 | 48 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -12,7 +12,9 @@ |
||
| 12 | 12 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
| 13 | 13 | if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) { |
| 14 | 14 | $spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort); |
| 15 | -} else $spotter_array = array(); |
|
| 15 | +} else { |
|
| 16 | + $spotter_array = array(); |
|
| 17 | +} |
|
| 16 | 18 | |
| 17 | 19 | if (!empty($spotter_array)) |
| 18 | 20 | { |
@@ -9,14 +9,14 @@ discard block |
||
| 9 | 9 | require_once('require/class.Language.php'); |
| 10 | 10 | |
| 11 | 11 | $Spotter = new Spotter(); |
| 12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 13 | 13 | if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) { |
| 14 | 14 | $spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort); |
| 15 | 15 | } else $spotter_array = array(); |
| 16 | 16 | |
| 17 | 17 | if (!empty($spotter_array)) |
| 18 | 18 | { |
| 19 | - $title = sprintf(_("Most Common Aircraft by Registration between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']); |
|
| 19 | + $title = sprintf(_("Most Common Aircraft by Registration between %s (%s), %s - %s (%s), %s"), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']); |
|
| 20 | 20 | require_once('header.php'); |
| 21 | 21 | print '<div class="info column">'; |
| 22 | 22 | print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>'; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | include('route-sub-menu.php'); |
| 28 | 28 | print '<div class="column">'; |
| 29 | 29 | print '<h2>'._("Most Common Aircraft by Registration").'</h2>'; |
| 30 | - print '<p>'.sprintf(_("The statistic below shows the most common aircraft by registration of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']).'</p>'; |
|
| 30 | + print '<p>'.sprintf(_("The statistic below shows the most common aircraft by registration of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']).'</p>'; |
|
| 31 | 31 | |
| 32 | 32 | $aircraft_array = $Spotter->countAllAircraftRegistrationByRoute($_GET['departure_airport'], $_GET['arrival_airport']); |
| 33 | 33 | if (!empty($aircraft_array)) |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | print '</thead>'; |
| 45 | 45 | print '<tbody>'; |
| 46 | 46 | $i = 1; |
| 47 | - foreach($aircraft_array as $aircraft_item) |
|
| 47 | + foreach ($aircraft_array as $aircraft_item) |
|
| 48 | 48 | { |
| 49 | 49 | print '<tr>'; |
| 50 | 50 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -12,7 +12,9 @@ |
||
| 12 | 12 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
| 13 | 13 | if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) { |
| 14 | 14 | $spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort); |
| 15 | -} else $spotter_array = array(); |
|
| 15 | +} else { |
|
| 16 | + $spotter_array = array(); |
|
| 17 | +} |
|
| 16 | 18 | |
| 17 | 19 | if (!empty($spotter_array)) |
| 18 | 20 | { |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | |
| 6 | 6 | if (!isset($_GET['aircraft_type'])) { |
| 7 | - header('Location: '.$globalURL.'/aircraft'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/aircraft'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
| 11 | 11 | $Spotter = new Spotter(); |
@@ -7,23 +7,23 @@ discard block |
||
| 7 | 7 | header('Location: '.$globalURL.'/aircraft'); |
| 8 | 8 | die(); |
| 9 | 9 | } |
| 10 | -$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
| 10 | +$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
| 11 | 11 | $Spotter = new Spotter(); |
| 12 | -$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1",""); |
|
| 12 | +$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", ""); |
|
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | if (!empty($spotter_array)) |
| 16 | 16 | { |
| 17 | - $title = sprintf(_("Most Common Airlines from %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
| 17 | + $title = sprintf(_("Most Common Airlines from %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
| 18 | 18 | require_once('header.php'); |
| 19 | 19 | print '<div class="select-item">'; |
| 20 | 20 | print '<form action="'.$globalURL.'/aircraft" method="post">'; |
| 21 | 21 | print '<select name="aircraft_type" class="selectpicker" data-live-search="true">'; |
| 22 | 22 | print '<option></option>'; |
| 23 | 23 | $aircraft_types = $Spotter->getAllAircraftTypes(); |
| 24 | - foreach($aircraft_types as $aircrafttype) |
|
| 24 | + foreach ($aircraft_types as $aircrafttype) |
|
| 25 | 25 | { |
| 26 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
| 26 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
| 27 | 27 | { |
| 28 | 28 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
| 29 | 29 | } else { |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | include('aircraft-sub-menu.php'); |
| 50 | 50 | print '<div class="column">'; |
| 51 | 51 | print '<h2>'._("Most Common Airlines").'</h2>'; |
| 52 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
| 52 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
| 53 | 53 | |
| 54 | 54 | $airline_array = $Spotter->countAllAirlinesByAircraft($aircraft_type); |
| 55 | 55 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | print '</thead>'; |
| 68 | 68 | print '<tbody>'; |
| 69 | 69 | $i = 1; |
| 70 | - foreach($airline_array as $airline_item) |
|
| 70 | + foreach ($airline_array as $airline_item) |
|
| 71 | 71 | { |
| 72 | 72 | print '<tr>'; |
| 73 | 73 | print '<td><strong>'.$i.'</strong></td>'; |