@@ -62,7 +62,7 @@ |
||
| 62 | 62 | function drawChart6() { |
| 63 | 63 | var data = google.visualization.arrayToDataTable([ |
| 64 | 64 | ["Hour","Altitude","Speed"], '; |
| 65 | - $altitude_data = ''; |
|
| 65 | + $altitude_data = ''; |
|
| 66 | 66 | foreach($all_data as $data) |
| 67 | 67 | { |
| 68 | 68 | $altitude_data .= '[ "'.date("G:i",strtotime($data['date']." UTC")).'",'.$data['altitude'].','.$data['ground_speed'].'],'; |
@@ -51,7 +51,9 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | if (isset($globalTimezone)) { |
| 53 | 53 | date_default_timezone_set($globalTimezone); |
| 54 | - } else date_default_timezone_set('UTC'); |
|
| 54 | + } else { |
|
| 55 | + date_default_timezone_set('UTC'); |
|
| 56 | + } |
|
| 55 | 57 | |
| 56 | 58 | //date_default_timezone_set('UTC'); |
| 57 | 59 | if (is_array($all_data) && count($all_data) > 0) { |
@@ -300,9 +302,13 @@ discard block |
||
| 300 | 302 | print '<div>'; |
| 301 | 303 | if (isset($spotter_item['pilot_id']) && $spotter_item['pilot_id'] != "") |
| 302 | 304 | { |
| 303 | - if ($spotter_item['format_source'] == 'whazzup') print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
| 304 | - elseif ($spotter_item['format_source'] == 'vatsimtxt') print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
| 305 | - else print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
| 305 | + if ($spotter_item['format_source'] == 'whazzup') { |
|
| 306 | + print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
| 307 | + } elseif ($spotter_item['format_source'] == 'vatsimtxt') { |
|
| 308 | + print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
| 309 | + } else { |
|
| 310 | + print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
| 311 | + } |
|
| 306 | 312 | } else { |
| 307 | 313 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != "") |
| 308 | 314 | { |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -$id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_STRING); |
|
| 2 | +$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING); |
|
| 3 | 3 | if ($id == "") |
| 4 | 4 | { |
| 5 | 5 | header('Location: /'); |
@@ -16,30 +16,30 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | if (!empty($spotter_array)) |
| 18 | 18 | { |
| 19 | - if(isset($spotter_array[0]['flightaware_id'])) { |
|
| 19 | + if (isset($spotter_array[0]['flightaware_id'])) { |
|
| 20 | 20 | $flightaware_id = $spotter_array[0]['flightaware_id']; |
| 21 | 21 | } |
| 22 | - if(isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') { |
|
| 22 | + if (isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') { |
|
| 23 | 23 | $latitude = $spotter_array[0]['last_latitude']; |
| 24 | - } elseif(isset($spotter_array[0]['latitude'])) { |
|
| 24 | + } elseif (isset($spotter_array[0]['latitude'])) { |
|
| 25 | 25 | $latitude = $spotter_array[0]['latitude']; |
| 26 | 26 | } |
| 27 | - if(isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') { |
|
| 27 | + if (isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') { |
|
| 28 | 28 | $longitude = $spotter_array[0]['last_longitude']; |
| 29 | - } elseif(isset($spotter_array[0]['longitude'])) { |
|
| 29 | + } elseif (isset($spotter_array[0]['longitude'])) { |
|
| 30 | 30 | $longitude = $spotter_array[0]['longitude']; |
| 31 | 31 | } |
| 32 | 32 | $title = ''; |
| 33 | - if(isset($spotter_array[0]['ident'])) { |
|
| 33 | + if (isset($spotter_array[0]['ident'])) { |
|
| 34 | 34 | $title .= $spotter_array[0]['ident']; |
| 35 | 35 | } |
| 36 | - if(isset($spotter_array[0]['airline_name'])) { |
|
| 36 | + if (isset($spotter_array[0]['airline_name'])) { |
|
| 37 | 37 | $title .= ' - '.$spotter_array[0]['airline_name']; |
| 38 | 38 | } |
| 39 | - if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
| 39 | + if (isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
| 40 | 40 | $title .= ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')'; |
| 41 | 41 | } |
| 42 | - if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') { |
|
| 42 | + if (isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') { |
|
| 43 | 43 | $title .= ' - '.$spotter_array[0]['registration']; |
| 44 | 44 | } |
| 45 | 45 | //$facebook_meta_image = $spotter_array[0]['image']; |
@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | var data = google.visualization.arrayToDataTable([ |
| 65 | 65 | ["Hour","Altitude","Speed"], '; |
| 66 | 66 | $altitude_data = ''; |
| 67 | - foreach($all_data as $data) |
|
| 67 | + foreach ($all_data as $data) |
|
| 68 | 68 | { |
| 69 | - $altitude_data .= '[ "'.date("G:i",strtotime($data['date']." UTC")).'",'.$data['altitude'].','.$data['ground_speed'].'],'; |
|
| 69 | + $altitude_data .= '[ "'.date("G:i", strtotime($data['date']." UTC")).'",'.$data['altitude'].','.$data['ground_speed'].'],'; |
|
| 70 | 70 | } |
| 71 | 71 | $altitude_data = substr($altitude_data, 0, -1); |
| 72 | 72 | print $altitude_data.']); |
@@ -108,16 +108,16 @@ discard block |
||
| 108 | 108 | print '<a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a> '; |
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | - if(isset($spotter_array[0]['ident'])) { |
|
| 111 | + if (isset($spotter_array[0]['ident'])) { |
|
| 112 | 112 | print $spotter_array[0]['ident']; |
| 113 | 113 | } |
| 114 | - if(isset($spotter_array[0]['airline_name'])) { |
|
| 114 | + if (isset($spotter_array[0]['airline_name'])) { |
|
| 115 | 115 | print ' - '.$spotter_array[0]['airline_name']; |
| 116 | 116 | } |
| 117 | - if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
| 117 | + if (isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
| 118 | 118 | print ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')'; |
| 119 | 119 | } |
| 120 | - if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') { |
|
| 120 | + if (isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') { |
|
| 121 | 121 | print ' - '.$spotter_array[0]['registration']; |
| 122 | 122 | } |
| 123 | 123 | print '</h1>'; |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | print '</div>'; |
| 272 | 272 | */ |
| 273 | 273 | |
| 274 | - foreach($spotter_array as $spotter_item) |
|
| 274 | + foreach ($spotter_array as $spotter_item) |
|
| 275 | 275 | { |
| 276 | 276 | print '<div class="details">'; |
| 277 | 277 | print '<h3>'._("Flight Information").'</h3>'; |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') { |
| 372 | 372 | if ($spotter_item['departure_airport_time'] > 2460) { |
| 373 | 373 | print '<div class="time">'; |
| 374 | - print 'at '.date('H:m',$spotter_item['departure_airport_time']); |
|
| 374 | + print 'at '.date('H:m', $spotter_item['departure_airport_time']); |
|
| 375 | 375 | print '</div>'; |
| 376 | 376 | } else { |
| 377 | 377 | print '<div class="time">'; |
@@ -520,19 +520,19 @@ discard block |
||
| 520 | 520 | $departure_airport_info = $Spotter->getAllAirportInfo($spotter_item['departure_airport']); |
| 521 | 521 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
| 522 | 522 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
| 523 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm'; |
|
| 523 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'nm').' nm'; |
|
| 524 | 524 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
| 525 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi'; |
|
| 525 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'mi').' mi'; |
|
| 526 | 526 | } else { |
| 527 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km'; |
|
| 527 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'km').' km'; |
|
| 528 | 528 | } |
| 529 | 529 | } else { |
| 530 | 530 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
| 531 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm'; |
|
| 531 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'nm').' nm'; |
|
| 532 | 532 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
| 533 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi'; |
|
| 533 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'mi').' mi'; |
|
| 534 | 534 | } else { |
| 535 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km'; |
|
| 535 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'km').' km'; |
|
| 536 | 536 | } |
| 537 | 537 | } |
| 538 | 538 | print '</div>'; |
@@ -546,19 +546,19 @@ discard block |
||
| 546 | 546 | $arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
| 547 | 547 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
| 548 | 548 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
| 549 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm'; |
|
| 549 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'nm').' nm'; |
|
| 550 | 550 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
| 551 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi'; |
|
| 551 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'mi').' mi'; |
|
| 552 | 552 | } else { |
| 553 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km'; |
|
| 553 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'km').' km'; |
|
| 554 | 554 | } |
| 555 | 555 | } else { |
| 556 | 556 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
| 557 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm'; |
|
| 557 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'nm').' nm'; |
|
| 558 | 558 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
| 559 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi'; |
|
| 559 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'mi').' mi'; |
|
| 560 | 560 | } else { |
| 561 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km'; |
|
| 561 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'km').' km'; |
|
| 562 | 562 | } |
| 563 | 563 | } |
| 564 | 564 | print '</div>'; |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | print '<div class="last-flights">'; |
| 578 | 578 | print '<h3>'._("Last 5 Flights of this Aircraft").' ('.$spotter_array[0]['registration'].')</h3>'; |
| 579 | 579 | $hide_th_links = true; |
| 580 | - $spotter_array = $Spotter->getSpotterDataByRegistration($spotter_array[0]['registration'],"0,5", ""); |
|
| 580 | + $spotter_array = $Spotter->getSpotterDataByRegistration($spotter_array[0]['registration'], "0,5", ""); |
|
| 581 | 581 | include('table-output.php'); |
| 582 | 582 | print '<div class="more">'; |
| 583 | 583 | print '<a href="'.$globalURL.'/registration/'.$spotter_array[0]['registration'].'" class="btn btn-default btn" role="button">See all Flights»</a>'; |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | $page_url = $globalURL.'/acars-latest'; |
| 10 | 10 | |
| 11 | -if(!isset($_GET['limit'])) |
|
| 11 | +if (!isset($_GET['limit'])) |
|
| 12 | 12 | { |
| 13 | 13 | $limit_start = 0; |
| 14 | 14 | $limit_end = 25; |
@@ -38,8 +38,12 @@ |
||
| 38 | 38 | if (!empty($spotter_array) && $spotter_array[0]['query_number_rows'] != 0) { |
| 39 | 39 | include('table-output.php'); |
| 40 | 40 | print '<div class="pagination">'; |
| 41 | - if ($limit_previous_1 >= 0) print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; |
|
| 42 | - if ($spotter_array[0]['query_number_rows'] == $absolute_difference) print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; |
|
| 41 | + if ($limit_previous_1 >= 0) { |
|
| 42 | + print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; |
|
| 43 | + } |
|
| 44 | + if ($spotter_array[0]['query_number_rows'] == $absolute_difference) { |
|
| 45 | + print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; |
|
| 46 | + } |
|
| 43 | 47 | print '</div>'; |
| 44 | 48 | } |
| 45 | 49 | print '</div>'; |
@@ -8,7 +8,9 @@ |
||
| 8 | 8 | if ($registration != '') { |
| 9 | 9 | $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1", $sort); |
| 10 | 10 | $aircraft_array = $Spotter->getAircraftInfoByRegistration($registration); |
| 11 | -} else $spotter_array=array(); |
|
| 11 | +} else { |
|
| 12 | + $spotter_array=array(); |
|
| 13 | +} |
|
| 12 | 14 | |
| 13 | 15 | |
| 14 | 16 | if (!empty($spotter_array)) |
@@ -3,17 +3,17 @@ discard block |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | $Spotter = new Spotter(); |
| 6 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 7 | -$registration = filter_input(INPUT_GET,'registration',FILTER_SANITIZE_STRING); |
|
| 6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 7 | +$registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING); |
|
| 8 | 8 | if ($registration != '') { |
| 9 | 9 | $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1", $sort); |
| 10 | 10 | $aircraft_array = $Spotter->getAircraftInfoByRegistration($registration); |
| 11 | -} else $spotter_array=array(); |
|
| 11 | +} else $spotter_array = array(); |
|
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | if (!empty($spotter_array)) |
| 15 | 15 | { |
| 16 | - $title = sprintf(_("Most Common Arrival Airports by Country of aircraft with registration %s"),$registration); |
|
| 16 | + $title = sprintf(_("Most Common Arrival Airports by Country of aircraft with registration %s"), $registration); |
|
| 17 | 17 | require_once('header.php'); |
| 18 | 18 | print '<div class="info column">'; |
| 19 | 19 | print '<h1>'.$_GET['registration'].' - '.$aircraft_array[0]['aircraft_name'].' ('.$aircraft_array[0]['aircraft_icao'].')</h1>'; |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | include('registration-sub-menu.php'); |
| 26 | 26 | print '<div class="column">'; |
| 27 | 27 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
| 28 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights with aircraft registration <strong>%s</strong>."),$registration).'</p>'; |
|
| 28 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights with aircraft registration <strong>%s</strong>."), $registration).'</p>'; |
|
| 29 | 29 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByRegistration($registration); |
| 30 | 30 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
| 31 | 31 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
| 34 | 34 | print 'var series = ['; |
| 35 | 35 | $country_data = ''; |
| 36 | - foreach($airport_country_array as $airport_item) |
|
| 36 | + foreach ($airport_country_array as $airport_item) |
|
| 37 | 37 | { |
| 38 | 38 | $country_data .= '[ "'.$airport_item['arrival_airport_country_iso3'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
| 39 | 39 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | print '</thead>'; |
| 82 | 82 | print '<tbody>'; |
| 83 | 83 | $i = 1; |
| 84 | - foreach($airport_country_array as $airport_item) |
|
| 84 | + foreach ($airport_country_array as $airport_item) |
|
| 85 | 85 | { |
| 86 | 86 | print '<tr>'; |
| 87 | 87 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | function drawChart6() { |
| 90 | 90 | var data = google.visualization.arrayToDataTable([ |
| 91 | 91 | ["Hour","'._("Altitude").'","'._("Speed").'"], '; |
| 92 | - $altitude_data = ''; |
|
| 92 | + $altitude_data = ''; |
|
| 93 | 93 | foreach($all_data as $data) |
| 94 | 94 | { |
| 95 | 95 | $altitude_data .= '[ "'.date("G:i",strtotime($data['date']." UTC")).'",'.$data['altitude'].','.$data['ground_speed'].'],'; |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | require_once('require/class.Language.php'); |
| 4 | 4 | require_once('require/class.Translation.php'); |
| 5 | 5 | $type = ''; |
| 6 | -$ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING)); |
|
| 6 | +$ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING)); |
|
| 7 | 7 | if (isset($_GET['marine'])) { |
| 8 | 8 | require_once('require/class.Marine.php'); |
| 9 | 9 | require_once('require/class.MarineLive.php'); |
@@ -30,12 +30,12 @@ discard block |
||
| 30 | 30 | $page_url = $globalURL.'/ident/'.$_GET['ident']; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | -if (!isset($_GET['ident'])){ |
|
| 33 | +if (!isset($_GET['ident'])) { |
|
| 34 | 34 | header('Location: '.$globalURL.''); |
| 35 | 35 | } else { |
| 36 | 36 | $Translation = new Translation(); |
| 37 | 37 | //calculuation for the pagination |
| 38 | - if(!isset($_GET['limit'])) |
|
| 38 | + if (!isset($_GET['limit'])) |
|
| 39 | 39 | { |
| 40 | 40 | $limit_start = 0; |
| 41 | 41 | $limit_end = 25; |
@@ -54,18 +54,18 @@ discard block |
||
| 54 | 54 | $limit_previous_1 = $limit_start - $absolute_difference; |
| 55 | 55 | $limit_previous_2 = $limit_end - $absolute_difference; |
| 56 | 56 | |
| 57 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 57 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 58 | 58 | if ($type == 'aircraft') { |
| 59 | 59 | if ($sort != '') |
| 60 | 60 | { |
| 61 | - $spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
| 61 | + $spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
| 62 | 62 | if (empty($spotter_array)) { |
| 63 | - $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
| 63 | + $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
| 64 | 64 | } |
| 65 | 65 | } else { |
| 66 | - $spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
| 66 | + $spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
| 67 | 67 | if (empty($spotter_array)) { |
| 68 | - $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
| 68 | + $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | if (empty($spotter_array)) { |
@@ -74,14 +74,14 @@ discard block |
||
| 74 | 74 | $ident = $new_ident; |
| 75 | 75 | if ($sort != '') |
| 76 | 76 | { |
| 77 | - $spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
| 77 | + $spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
| 78 | 78 | if (empty($spotter_array)) { |
| 79 | - $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
| 79 | + $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
| 80 | 80 | } |
| 81 | 81 | } else { |
| 82 | - $spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
| 82 | + $spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
| 83 | 83 | if (empty($spotter_array)) { |
| 84 | - $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
| 84 | + $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | } |
@@ -89,34 +89,34 @@ discard block |
||
| 89 | 89 | } elseif ($type == 'marine') { |
| 90 | 90 | if ($sort != '') |
| 91 | 91 | { |
| 92 | - $spotter_array = $Marine->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
| 92 | + $spotter_array = $Marine->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
| 93 | 93 | if (empty($spotter_array)) { |
| 94 | - $spotter_array = $MarineArchive->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
| 94 | + $spotter_array = $MarineArchive->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
| 95 | 95 | } |
| 96 | 96 | } else { |
| 97 | - $spotter_array = $Marine->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
| 97 | + $spotter_array = $Marine->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
| 98 | 98 | if (empty($spotter_array)) { |
| 99 | - $spotter_array = $MarineArchive->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
| 99 | + $spotter_array = $MarineArchive->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | } elseif ($type == 'tracker') { |
| 103 | 103 | if ($sort != '') |
| 104 | 104 | { |
| 105 | - $spotter_array = $Tracker->getTrackerDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
| 105 | + $spotter_array = $Tracker->getTrackerDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
| 106 | 106 | if (empty($spotter_array)) { |
| 107 | - $spotter_array = $TrackerArchive->getTrackerDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
| 107 | + $spotter_array = $TrackerArchive->getTrackerDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
| 108 | 108 | } |
| 109 | 109 | } else { |
| 110 | - $spotter_array = $Tracker->getTrackerDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
| 110 | + $spotter_array = $Tracker->getTrackerDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
| 111 | 111 | if (empty($spotter_array)) { |
| 112 | - $spotter_array = $TrackerArchive->getTrackerDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
| 112 | + $spotter_array = $TrackerArchive->getTrackerDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | if (!empty($spotter_array)) |
| 118 | 118 | { |
| 119 | - $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['ident']); |
|
| 119 | + $title = sprintf(_("Detailed View for %s"), $spotter_array[0]['ident']); |
|
| 120 | 120 | $ident = $spotter_array[0]['ident']; |
| 121 | 121 | if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
| 122 | 122 | if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
@@ -137,9 +137,9 @@ discard block |
||
| 137 | 137 | var data = google.visualization.arrayToDataTable([ |
| 138 | 138 | ["Hour","'._("Altitude").'","'._("Speed").'"], '; |
| 139 | 139 | $altitude_data = ''; |
| 140 | - foreach($all_data as $data) |
|
| 140 | + foreach ($all_data as $data) |
|
| 141 | 141 | { |
| 142 | - $altitude_data .= '[ "'.date("G:i",strtotime($data['date']." UTC")).'",'.$data['altitude'].','.$data['ground_speed'].'],'; |
|
| 142 | + $altitude_data .= '[ "'.date("G:i", strtotime($data['date']." UTC")).'",'.$data['altitude'].','.$data['ground_speed'].'],'; |
|
| 143 | 143 | } |
| 144 | 144 | $altitude_data = substr($altitude_data, 0, -1); |
| 145 | 145 | print $altitude_data.']); |
@@ -179,9 +179,9 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | if ($type == 'aircraft') include('ident-sub-menu.php'); |
| 181 | 181 | print '<div class="table column">'; |
| 182 | - if ($type == 'aircraft') print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 183 | - elseif ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 184 | - elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 182 | + if ($type == 'aircraft') print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
| 183 | + elseif ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
| 184 | + elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
| 185 | 185 | |
| 186 | 186 | include('table-output.php'); |
| 187 | 187 | print '<div class="pagination">'; |
@@ -118,8 +118,12 @@ discard block |
||
| 118 | 118 | { |
| 119 | 119 | $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['ident']); |
| 120 | 120 | $ident = $spotter_array[0]['ident']; |
| 121 | - if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
|
| 122 | - if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
|
| 121 | + if (isset($spotter_array[0]['latitude'])) { |
|
| 122 | + $latitude = $spotter_array[0]['latitude']; |
|
| 123 | + } |
|
| 124 | + if (isset($spotter_array[0]['longitude'])) { |
|
| 125 | + $longitude = $spotter_array[0]['longitude']; |
|
| 126 | + } |
|
| 123 | 127 | require_once('header.php'); |
| 124 | 128 | if (isset($globalArchive) && $globalArchive && $type == 'aircraft') { |
| 125 | 129 | // Requirement for altitude graph |
@@ -127,7 +131,9 @@ discard block |
||
| 127 | 131 | $all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']); |
| 128 | 132 | if (isset($globalTimezone)) { |
| 129 | 133 | date_default_timezone_set($globalTimezone); |
| 130 | - } else date_default_timezone_set('UTC'); |
|
| 134 | + } else { |
|
| 135 | + date_default_timezone_set('UTC'); |
|
| 136 | + } |
|
| 131 | 137 | if (count($all_data) > 0) { |
| 132 | 138 | print '<div id="chart6" class="chart" width="100%"></div> |
| 133 | 139 | <script> |
@@ -174,14 +180,22 @@ discard block |
||
| 174 | 180 | if (isset($spotter_array[0]['airline_icao'])) { |
| 175 | 181 | print '<div><span class="label">'._("Airline").'</span><a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a></div>'; |
| 176 | 182 | } |
| 177 | - if ($type == 'aircraft') print '<div><span class="label">'._("Flight History").'</span><a href="http://flightaware.com/live/flight/'.$spotter_array[0]['ident'].'" target="_blank">'._("View the Flight History of this callsign").'</a></div>'; |
|
| 183 | + if ($type == 'aircraft') { |
|
| 184 | + print '<div><span class="label">'._("Flight History").'</span><a href="http://flightaware.com/live/flight/'.$spotter_array[0]['ident'].'" target="_blank">'._("View the Flight History of this callsign").'</a></div>'; |
|
| 185 | + } |
|
| 178 | 186 | print '</div>'; |
| 179 | 187 | |
| 180 | - if ($type == 'aircraft') include('ident-sub-menu.php'); |
|
| 188 | + if ($type == 'aircraft') { |
|
| 189 | + include('ident-sub-menu.php'); |
|
| 190 | + } |
|
| 181 | 191 | print '<div class="table column">'; |
| 182 | - if ($type == 'aircraft') print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 183 | - elseif ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 184 | - elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 192 | + if ($type == 'aircraft') { |
|
| 193 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 194 | + } elseif ($type == 'marine') { |
|
| 195 | + print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 196 | + } elseif ($type == 'tracker') { |
|
| 197 | + print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 198 | + } |
|
| 185 | 199 | |
| 186 | 200 | include('table-output.php'); |
| 187 | 201 | print '<div class="pagination">'; |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | <div class="info column"> |
| 12 | 12 | <h1>About <?php print $globalName; ?></h1> |
| 13 | 13 | <?php |
| 14 | - if ($globalName == 'FlightAirMap') { |
|
| 14 | + if ($globalName == 'FlightAirMap') { |
|
| 15 | 15 | ?> |
| 16 | 16 | <p>This is an open source project displaying <u>most</u> (mostly <a href="http://en.wikipedia.org/wiki/Instrument_flight_rules" target="_blank">IFR</a>) flights that have flown near this site area. |
| 17 | 17 | <?php if ($globalADSBHUB) { ?> Some ADS-B sources come from <a href="http://www.adsbhub.net">ADSBHUB.net</a>.<?php } ?> |
@@ -27,18 +27,18 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | <br /><br /> |
| 29 | 29 | <?php |
| 30 | - } else { |
|
| 30 | + } else { |
|
| 31 | 31 | ?> |
| 32 | 32 | <p>This project use <a href="http://www.flightairmap.fr/">FlightAirMap</a> (<a href="https://github.com/Ysurac/FlightAirMap/">source</a>) by Ycarus from <a href="http://www.zugaina.com/">Zugaina</a>.</p> |
| 33 | 33 | <?php |
| 34 | - } |
|
| 34 | + } |
|
| 35 | 35 | ?> |
| 36 | 36 | <a name="source"></a> |
| 37 | 37 | <h3>Source & Credits</h3> |
| 38 | 38 | |
| 39 | 39 | <?php |
| 40 | 40 | if ($globalFlightAware) { |
| 41 | - ?> |
|
| 41 | + ?> |
|
| 42 | 42 | <p>The data from FlightAware is coming from multiple sources. Not every aircraft is tracked on FlightAware, especially not older aircrafts as well as government aircrafts, however most modern airliners will work. You can learn more about how it works on <a href="http://flightaware.com/adsb/" target="_blank">FlightAware's ADS-B</a> page. Also, not every aircraft is shown to have flown exactly at that minute as seen on this site (aka real-time). There is a 5 minute delay on some of the sources.</p> |
| 43 | 43 | <?php } ?> |
| 44 | 44 | <p>None of this project would have been possible without the help and contributions of these organizations and people:</p> |
@@ -5,55 +5,55 @@ discard block |
||
| 5 | 5 | $Spotter = new Spotter(); |
| 6 | 6 | |
| 7 | 7 | if (isset($_GET['start_date'])) { |
| 8 | - //for the date manipulation into the query |
|
| 9 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 10 | - $start_date = $_GET['start_date'].":00"; |
|
| 11 | - $end_date = $_GET['end_date'].":00"; |
|
| 12 | - $sql_date = $start_date.",".$end_date; |
|
| 13 | - } else if($_GET['start_date'] != ""){ |
|
| 14 | - $start_date = $_GET['start_date'].":00"; |
|
| 15 | - $sql_date = $start_date; |
|
| 16 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 17 | - $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
|
| 18 | - $sql_date = $end_date; |
|
| 19 | - } else $sql_date = ''; |
|
| 8 | + //for the date manipulation into the query |
|
| 9 | + if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 10 | + $start_date = $_GET['start_date'].":00"; |
|
| 11 | + $end_date = $_GET['end_date'].":00"; |
|
| 12 | + $sql_date = $start_date.",".$end_date; |
|
| 13 | + } else if($_GET['start_date'] != ""){ |
|
| 14 | + $start_date = $_GET['start_date'].":00"; |
|
| 15 | + $sql_date = $start_date; |
|
| 16 | + } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 17 | + $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
|
| 18 | + $sql_date = $end_date; |
|
| 19 | + } else $sql_date = ''; |
|
| 20 | 20 | } else $sql_date = ''; |
| 21 | 21 | |
| 22 | 22 | if (isset($_GET['highest_altitude'])) { |
| 23 | - //for altitude manipulation |
|
| 24 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 25 | - $end_altitude = $_GET['highest_altitude']; |
|
| 26 | - $start_altitude = $_GET['lowest_altitude']; |
|
| 27 | - $sql_altitude = $start_altitude.",".$end_altitude; |
|
| 28 | - } else if($_GET['highest_altitude'] != ""){ |
|
| 29 | - $end_altitude = $_GET['highest_altitude']; |
|
| 30 | - $sql_altitude = $end_altitude; |
|
| 31 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 32 | - $start_altitude = $_GET['lowest_altitude'].",60000"; |
|
| 33 | - $sql_altitude = $start_altitude; |
|
| 34 | - } else $sql_altitude = ''; |
|
| 23 | + //for altitude manipulation |
|
| 24 | + if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 25 | + $end_altitude = $_GET['highest_altitude']; |
|
| 26 | + $start_altitude = $_GET['lowest_altitude']; |
|
| 27 | + $sql_altitude = $start_altitude.",".$end_altitude; |
|
| 28 | + } else if($_GET['highest_altitude'] != ""){ |
|
| 29 | + $end_altitude = $_GET['highest_altitude']; |
|
| 30 | + $sql_altitude = $end_altitude; |
|
| 31 | + } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 32 | + $start_altitude = $_GET['lowest_altitude'].",60000"; |
|
| 33 | + $sql_altitude = $start_altitude; |
|
| 34 | + } else $sql_altitude = ''; |
|
| 35 | 35 | } else $sql_altitude = ''; |
| 36 | 36 | |
| 37 | 37 | //calculuation for the pagination |
| 38 | 38 | if(!isset($_GET['limit'])) |
| 39 | 39 | { |
| 40 | - if (!isset($_GET['number_results'])) |
|
| 41 | - { |
|
| 42 | - $limit_start = 0; |
|
| 43 | - $limit_end = 25; |
|
| 44 | - $absolute_difference = 25; |
|
| 45 | - } else { |
|
| 46 | - if ($_GET['number_results'] > 1000){ |
|
| 47 | - $_GET['number_results'] = 1000; |
|
| 48 | - } |
|
| 49 | - $limit_start = 0; |
|
| 50 | - $limit_end = $_GET['number_results']; |
|
| 51 | - $absolute_difference = $_GET['number_results']; |
|
| 52 | - } |
|
| 40 | + if (!isset($_GET['number_results'])) |
|
| 41 | + { |
|
| 42 | + $limit_start = 0; |
|
| 43 | + $limit_end = 25; |
|
| 44 | + $absolute_difference = 25; |
|
| 45 | + } else { |
|
| 46 | + if ($_GET['number_results'] > 1000){ |
|
| 47 | + $_GET['number_results'] = 1000; |
|
| 48 | + } |
|
| 49 | + $limit_start = 0; |
|
| 50 | + $limit_end = $_GET['number_results']; |
|
| 51 | + $absolute_difference = $_GET['number_results']; |
|
| 52 | + } |
|
| 53 | 53 | } else { |
| 54 | - $limit_explode = explode(",", $_GET['limit']); |
|
| 55 | - $limit_start = $limit_explode[0]; |
|
| 56 | - $limit_end = $limit_explode[1]; |
|
| 54 | + $limit_explode = explode(",", $_GET['limit']); |
|
| 55 | + $limit_start = $limit_explode[0]; |
|
| 56 | + $limit_end = $limit_explode[1]; |
|
| 57 | 57 | } |
| 58 | 58 | $absolute_difference = abs($limit_start - $limit_end); |
| 59 | 59 | $limit_next = $limit_end + $absolute_difference; |
@@ -96,41 +96,41 @@ discard block |
||
| 96 | 96 | foreach($spotter_array as $spotter_item) |
| 97 | 97 | { |
| 98 | 98 | |
| 99 | - $output .= $spotter_item['spotter_id'].','; |
|
| 100 | - $output .= $spotter_item['ident'].','; |
|
| 101 | - $output .= $spotter_item['registration'].','; |
|
| 102 | - $output .= $spotter_item['aircraft_type'].','; |
|
| 103 | - $output .= $spotter_item['aircraft_name'].','; |
|
| 104 | - $output .= $spotter_item['aircraft_manufacturer'].','; |
|
| 105 | - $output .= $spotter_item['airline_name'].','; |
|
| 106 | - $output .= $spotter_item['airline_icao'].','; |
|
| 107 | - $output .= $spotter_item['airline_iata'].','; |
|
| 108 | - $output .= $spotter_item['airline_country'].','; |
|
| 109 | - $output .= $spotter_item['airline_callsign'].','; |
|
| 110 | - $output .= $spotter_item['airline_type'].','; |
|
| 111 | - $output .= $spotter_item['departure_airport_city'].','; |
|
| 112 | - $output .= $spotter_item['departure_airport_country'].','; |
|
| 113 | - $output .= $spotter_item['departure_airport_iata'].','; |
|
| 114 | - $output .= $spotter_item['departure_airport_icao'].','; |
|
| 115 | - $output .= $spotter_item['departure_airport_latitude'].','; |
|
| 116 | - $output .= $spotter_item['departure_airport_longitude'].','; |
|
| 117 | - $output .= $spotter_item['departure_airport_altitude'].','; |
|
| 118 | - $output .= $spotter_item['arrival_airport_city'].','; |
|
| 119 | - $output .= $spotter_item['arrival_airport_country'].','; |
|
| 120 | - $output .= $spotter_item['arrival_airport_iata'].','; |
|
| 121 | - $output .= $spotter_item['arrival_airport_icao'].','; |
|
| 122 | - $output .= $spotter_item['arrival_airport_latitude'].','; |
|
| 123 | - $output .= $spotter_item['arrival_airport_longitude'].','; |
|
| 124 | - $output .= $spotter_item['arrival_airport_altitude'].','; |
|
| 125 | - $output .= $spotter_item['latitude'].','; |
|
| 126 | - $output .= $spotter_item['longitude'].','; |
|
| 127 | - $output .= $spotter_item['altitude'].','; |
|
| 128 | - $output .= $spotter_item['ground_speed'].','; |
|
| 129 | - $output .= $spotter_item['heading'].','; |
|
| 130 | - $output .= $spotter_item['heading_name'].','; |
|
| 131 | - $output .= $spotter_item['waypoints'].','; |
|
| 132 | - $output .= date("c", strtotime($spotter_item['date_iso_8601'])); |
|
| 133 | - $output .= "\n"; |
|
| 99 | + $output .= $spotter_item['spotter_id'].','; |
|
| 100 | + $output .= $spotter_item['ident'].','; |
|
| 101 | + $output .= $spotter_item['registration'].','; |
|
| 102 | + $output .= $spotter_item['aircraft_type'].','; |
|
| 103 | + $output .= $spotter_item['aircraft_name'].','; |
|
| 104 | + $output .= $spotter_item['aircraft_manufacturer'].','; |
|
| 105 | + $output .= $spotter_item['airline_name'].','; |
|
| 106 | + $output .= $spotter_item['airline_icao'].','; |
|
| 107 | + $output .= $spotter_item['airline_iata'].','; |
|
| 108 | + $output .= $spotter_item['airline_country'].','; |
|
| 109 | + $output .= $spotter_item['airline_callsign'].','; |
|
| 110 | + $output .= $spotter_item['airline_type'].','; |
|
| 111 | + $output .= $spotter_item['departure_airport_city'].','; |
|
| 112 | + $output .= $spotter_item['departure_airport_country'].','; |
|
| 113 | + $output .= $spotter_item['departure_airport_iata'].','; |
|
| 114 | + $output .= $spotter_item['departure_airport_icao'].','; |
|
| 115 | + $output .= $spotter_item['departure_airport_latitude'].','; |
|
| 116 | + $output .= $spotter_item['departure_airport_longitude'].','; |
|
| 117 | + $output .= $spotter_item['departure_airport_altitude'].','; |
|
| 118 | + $output .= $spotter_item['arrival_airport_city'].','; |
|
| 119 | + $output .= $spotter_item['arrival_airport_country'].','; |
|
| 120 | + $output .= $spotter_item['arrival_airport_iata'].','; |
|
| 121 | + $output .= $spotter_item['arrival_airport_icao'].','; |
|
| 122 | + $output .= $spotter_item['arrival_airport_latitude'].','; |
|
| 123 | + $output .= $spotter_item['arrival_airport_longitude'].','; |
|
| 124 | + $output .= $spotter_item['arrival_airport_altitude'].','; |
|
| 125 | + $output .= $spotter_item['latitude'].','; |
|
| 126 | + $output .= $spotter_item['longitude'].','; |
|
| 127 | + $output .= $spotter_item['altitude'].','; |
|
| 128 | + $output .= $spotter_item['ground_speed'].','; |
|
| 129 | + $output .= $spotter_item['heading'].','; |
|
| 130 | + $output .= $spotter_item['heading_name'].','; |
|
| 131 | + $output .= $spotter_item['waypoints'].','; |
|
| 132 | + $output .= date("c", strtotime($spotter_item['date_iso_8601'])); |
|
| 133 | + $output .= "\n"; |
|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
@@ -6,14 +6,14 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | if (isset($_GET['start_date'])) { |
| 8 | 8 | //for the date manipulation into the query |
| 9 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
| 9 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
| 10 | 10 | $start_date = $_GET['start_date'].":00"; |
| 11 | 11 | $end_date = $_GET['end_date'].":00"; |
| 12 | 12 | $sql_date = $start_date.",".$end_date; |
| 13 | - } else if($_GET['start_date'] != ""){ |
|
| 13 | + } else if ($_GET['start_date'] != "") { |
|
| 14 | 14 | $start_date = $_GET['start_date'].":00"; |
| 15 | 15 | $sql_date = $start_date; |
| 16 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
| 16 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
| 17 | 17 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 18 | 18 | $sql_date = $end_date; |
| 19 | 19 | } else $sql_date = ''; |
@@ -21,21 +21,21 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | if (isset($_GET['highest_altitude'])) { |
| 23 | 23 | //for altitude manipulation |
| 24 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
| 24 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
| 25 | 25 | $end_altitude = $_GET['highest_altitude']; |
| 26 | 26 | $start_altitude = $_GET['lowest_altitude']; |
| 27 | 27 | $sql_altitude = $start_altitude.",".$end_altitude; |
| 28 | - } else if($_GET['highest_altitude'] != ""){ |
|
| 28 | + } else if ($_GET['highest_altitude'] != "") { |
|
| 29 | 29 | $end_altitude = $_GET['highest_altitude']; |
| 30 | 30 | $sql_altitude = $end_altitude; |
| 31 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
| 31 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
| 32 | 32 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
| 33 | 33 | $sql_altitude = $start_altitude; |
| 34 | 34 | } else $sql_altitude = ''; |
| 35 | 35 | } else $sql_altitude = ''; |
| 36 | 36 | |
| 37 | 37 | //calculuation for the pagination |
| 38 | -if(!isset($_GET['limit'])) |
|
| 38 | +if (!isset($_GET['limit'])) |
|
| 39 | 39 | { |
| 40 | 40 | if (!isset($_GET['number_results'])) |
| 41 | 41 | { |
@@ -43,14 +43,14 @@ discard block |
||
| 43 | 43 | $limit_end = 25; |
| 44 | 44 | $absolute_difference = 25; |
| 45 | 45 | } else { |
| 46 | - if ($_GET['number_results'] > 1000){ |
|
| 46 | + if ($_GET['number_results'] > 1000) { |
|
| 47 | 47 | $_GET['number_results'] = 1000; |
| 48 | 48 | } |
| 49 | 49 | $limit_start = 0; |
| 50 | 50 | $limit_end = $_GET['number_results']; |
| 51 | 51 | $absolute_difference = $_GET['number_results']; |
| 52 | 52 | } |
| 53 | -} else { |
|
| 53 | +} else { |
|
| 54 | 54 | $limit_explode = explode(",", $_GET['limit']); |
| 55 | 55 | $limit_start = $limit_explode[0]; |
| 56 | 56 | $limit_end = $limit_explode[1]; |
@@ -70,30 +70,30 @@ discard block |
||
| 70 | 70 | if (isset($_GET['sort'])) $sort = $_GET['sort']; |
| 71 | 71 | else $sort = ''; |
| 72 | 72 | |
| 73 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
| 74 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
| 75 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
| 76 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
| 77 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
| 78 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 79 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
| 80 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
| 81 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
| 82 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
| 83 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
| 84 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
| 85 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
| 86 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
| 87 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
| 88 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
| 89 | -$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,''); |
|
| 73 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
| 74 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
| 75 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
| 76 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
| 77 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
| 78 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 79 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
| 80 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
| 81 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
| 82 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
| 83 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
| 84 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
| 85 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
| 86 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
| 87 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
| 88 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
| 89 | +$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, ''); |
|
| 90 | 90 | |
| 91 | 91 | |
| 92 | 92 | $output = "id,ident,registration,aircraft_icao,aircraft_name,aircraft_manufacturer,airline,airline_icao,airline_iata,airline_country,airline_callsign,airline_type,departure_airport_city,departure_airport_country,departure_airport_iata,departure_airport_icao,departure_airport_latitude,departure_airport_longitude,departure_airport_altitude,arrival_airport_city,arrival_airport_country,arrival_airport_iata,arrival_airport_icao,arrival_airport_latitude,arrival_airport_longitude,arrival_airport_altitude,latitude,longitude,altitude,ground_speed,heading,heading_name,waypoints,date\n"; |
| 93 | 93 | |
| 94 | 94 | if (!empty($spotter_array)) |
| 95 | 95 | { |
| 96 | - foreach($spotter_array as $spotter_item) |
|
| 96 | + foreach ($spotter_array as $spotter_item) |
|
| 97 | 97 | { |
| 98 | 98 | |
| 99 | 99 | $output .= $spotter_item['spotter_id'].','; |
@@ -16,8 +16,12 @@ discard block |
||
| 16 | 16 | } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
| 17 | 17 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 18 | 18 | $sql_date = $end_date; |
| 19 | - } else $sql_date = ''; |
|
| 20 | -} else $sql_date = ''; |
|
| 19 | + } else { |
|
| 20 | + $sql_date = ''; |
|
| 21 | + } |
|
| 22 | + } else { |
|
| 23 | + $sql_date = ''; |
|
| 24 | +} |
|
| 21 | 25 | |
| 22 | 26 | if (isset($_GET['highest_altitude'])) { |
| 23 | 27 | //for altitude manipulation |
@@ -31,8 +35,12 @@ discard block |
||
| 31 | 35 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
| 32 | 36 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
| 33 | 37 | $sql_altitude = $start_altitude; |
| 34 | - } else $sql_altitude = ''; |
|
| 35 | -} else $sql_altitude = ''; |
|
| 38 | + } else { |
|
| 39 | + $sql_altitude = ''; |
|
| 40 | + } |
|
| 41 | + } else { |
|
| 42 | + $sql_altitude = ''; |
|
| 43 | +} |
|
| 36 | 44 | |
| 37 | 45 | //calculuation for the pagination |
| 38 | 46 | if(!isset($_GET['limit'])) |
@@ -50,7 +58,7 @@ discard block |
||
| 50 | 58 | $limit_end = $_GET['number_results']; |
| 51 | 59 | $absolute_difference = $_GET['number_results']; |
| 52 | 60 | } |
| 53 | -} else { |
|
| 61 | +} else { |
|
| 54 | 62 | $limit_explode = explode(",", $_GET['limit']); |
| 55 | 63 | $limit_start = $limit_explode[0]; |
| 56 | 64 | $limit_end = $limit_explode[1]; |
@@ -67,8 +75,11 @@ discard block |
||
| 67 | 75 | |
| 68 | 76 | header("Content-type: text/csv"); |
| 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 | |
| 73 | 84 | $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
| 74 | 85 | $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | $limit_start = 0; |
| 13 | 13 | $limit_end = 28; |
| 14 | 14 | $absolute_difference = 28; |
| 15 | -} else { |
|
| 15 | +} else { |
|
| 16 | 16 | $limit_explode = explode(",", $_GET['limit']); |
| 17 | 17 | $limit_start = $limit_explode[0]; |
| 18 | 18 | $limit_end = $limit_explode[1]; |
@@ -7,12 +7,12 @@ discard block |
||
| 7 | 7 | require_once('header.php'); |
| 8 | 8 | |
| 9 | 9 | //calculuation for the pagination |
| 10 | -if(!isset($_GET['limit'])) |
|
| 10 | +if (!isset($_GET['limit'])) |
|
| 11 | 11 | { |
| 12 | 12 | $limit_start = 0; |
| 13 | 13 | $limit_end = 28; |
| 14 | 14 | $absolute_difference = 28; |
| 15 | -} else { |
|
| 15 | +} else { |
|
| 16 | 16 | $limit_explode = explode(",", $_GET['limit']); |
| 17 | 17 | $limit_start = $limit_explode[0]; |
| 18 | 18 | $limit_end = $limit_explode[1]; |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | print '<div class="column">'; |
| 40 | 40 | print '<p>'._("The view below shows all aircrafts that have been selected to have some sort of special characteristic about them, such as unique liveries, destinations etc.").'</p>'; |
| 41 | 41 | |
| 42 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 42 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 43 | 43 | if ($sort != '') { |
| 44 | 44 | $spotter_array = $Spotter->getSpotterDataByHighlight($limit_start.",".$absolute_difference, $sort); |
| 45 | 45 | } else { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | if (!empty($spotter_array)) |
| 49 | 49 | { |
| 50 | 50 | print '<div class="dispay-view">'; |
| 51 | - foreach($spotter_array as $spotter_item) |
|
| 51 | + foreach ($spotter_array as $spotter_item) |
|
| 52 | 52 | { |
| 53 | 53 | if (isset($spotter_item['image']) && $spotter_item['image'] != "") |
| 54 | 54 | { |
@@ -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,22 +90,22 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | $output = '<?xml version="1.0" encoding="UTF-8"?>'; |
| 92 | 92 | $output .= '<kml xmlns="http://www.opengis.net/kml/2.2">'; |
| 93 | - $output .= '<Document>'; |
|
| 94 | - $output .= '<Style id="departureAirport">'; |
|
| 95 | - $output .= '<IconStyle>'; |
|
| 96 | - $output .= '<Icon>'; |
|
| 97 | - $output .= '<href>http://www.flightairmap.fr/images/kml_departure_airport.png</href>'; |
|
| 98 | - $output .= '</Icon>'; |
|
| 99 | - $output .= '</IconStyle>'; |
|
| 100 | - $output .= '</Style>'; |
|
| 101 | - $output .= '<Style id="arrivalAirport">'; |
|
| 102 | - $output .= '<IconStyle>'; |
|
| 103 | - $output .= '<Icon>'; |
|
| 104 | - $output .= '<href>http://www.flightairmap.fr/images/kml_arrival_airport.png</href>'; |
|
| 105 | - $output .= '</Icon>'; |
|
| 106 | - $output .= '</IconStyle>'; |
|
| 107 | - $output .= '</Style>'; |
|
| 108 | - $output .= '<Style id="route">'; |
|
| 93 | + $output .= '<Document>'; |
|
| 94 | + $output .= '<Style id="departureAirport">'; |
|
| 95 | + $output .= '<IconStyle>'; |
|
| 96 | + $output .= '<Icon>'; |
|
| 97 | + $output .= '<href>http://www.flightairmap.fr/images/kml_departure_airport.png</href>'; |
|
| 98 | + $output .= '</Icon>'; |
|
| 99 | + $output .= '</IconStyle>'; |
|
| 100 | + $output .= '</Style>'; |
|
| 101 | + $output .= '<Style id="arrivalAirport">'; |
|
| 102 | + $output .= '<IconStyle>'; |
|
| 103 | + $output .= '<Icon>'; |
|
| 104 | + $output .= '<href>http://www.flightairmap.fr/images/kml_arrival_airport.png</href>'; |
|
| 105 | + $output .= '</Icon>'; |
|
| 106 | + $output .= '</IconStyle>'; |
|
| 107 | + $output .= '</Style>'; |
|
| 108 | + $output .= '<Style id="route">'; |
|
| 109 | 109 | $output .= '<LineStyle>'; |
| 110 | 110 | $output .= '<color>7f0000ff</color>'; |
| 111 | 111 | $output .= '<width>2</width>'; |
@@ -113,10 +113,10 @@ discard block |
||
| 113 | 113 | $output .= '</LineStyle>'; |
| 114 | 114 | $output .= '</Style>'; |
| 115 | 115 | |
| 116 | - if (!empty($spotter_array)) |
|
| 116 | + if (!empty($spotter_array)) |
|
| 117 | 117 | { |
| 118 | - foreach($spotter_array as $spotter_item) |
|
| 119 | - { |
|
| 118 | + foreach($spotter_array as $spotter_item) |
|
| 119 | + { |
|
| 120 | 120 | |
| 121 | 121 | |
| 122 | 122 | $altitude = $spotter_item['altitude'].'00'; |
@@ -127,12 +127,12 @@ discard block |
||
| 127 | 127 | $output .= '<styleUrl>#route</styleUrl>'; |
| 128 | 128 | $output .= '<LineString>'; |
| 129 | 129 | $output .= '<coordinates>'; |
| 130 | - $waypoint_pieces = explode(' ', $spotter_item['waypoints']); |
|
| 130 | + $waypoint_pieces = explode(' ', $spotter_item['waypoints']); |
|
| 131 | 131 | $waypoint_pieces = array_chunk($waypoint_pieces, 2); |
| 132 | 132 | |
| 133 | 133 | foreach ($waypoint_pieces as $waypoint_coordinate) |
| 134 | 134 | { |
| 135 | - $output .= $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' '; |
|
| 135 | + $output .= $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' '; |
|
| 136 | 136 | |
| 137 | 137 | } |
| 138 | 138 | $output .= '</coordinates>'; |
@@ -144,38 +144,38 @@ discard block |
||
| 144 | 144 | //departure airport |
| 145 | 145 | $output .= '<Placemark>'; |
| 146 | 146 | $output .= '<name>'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country'].' ('.$spotter_item['departure_airport'].')</name>'; |
| 147 | - $output .= '<description><![CDATA[ '; |
|
| 148 | - $output .= '<div class="ge-balloon">'; |
|
| 149 | - $output .= '<div class="ge-row">'; |
|
| 150 | - $output .= '<span>Name</span>'; |
|
| 151 | - $output .= $spotter_item['departure_airport_name']; |
|
| 152 | - $output .= '</div>'; |
|
| 153 | - $output .= '<div class="ge-row">'; |
|
| 154 | - $output .= '<span>City</span>'; |
|
| 155 | - $output .= $spotter_item['departure_airport_city']; |
|
| 156 | - $output .= '</div>'; |
|
| 157 | - $output .= '<div class="ge-row">'; |
|
| 158 | - $output .= '<span>Country</span>'; |
|
| 159 | - $output .= $spotter_item['departure_airport_country']; |
|
| 160 | - $output .= '</div>'; |
|
| 161 | - $output .= '<div class="ge-row">'; |
|
| 162 | - $output .= '<span>ICAO</span>'; |
|
| 163 | - $output .= $spotter_item['departure_airport_icao']; |
|
| 164 | - $output .= '</div>'; |
|
| 165 | - $output .= '<div class="ge-row">'; |
|
| 166 | - $output .= '<span>IATA</span>'; |
|
| 167 | - $output .= $spotter_item['departure_airport_iata']; |
|
| 168 | - $output .= '</div>'; |
|
| 169 | - $output .= '<div class="ge-row">'; |
|
| 170 | - $output .= '<span>Coordinates</span>'; |
|
| 171 | - $output .= $spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_longitude']; |
|
| 172 | - $output .= '</div>'; |
|
| 173 | - $output .= '<div class="ge-row">'; |
|
| 174 | - $output .= '<span>Altitude</span>'; |
|
| 175 | - $output .= $spotter_item['departure_airport_altitude']; |
|
| 176 | - $output .= '</div>'; |
|
| 177 | - $output .= '</div>'; |
|
| 178 | - $output .= ' ]]></description>'; |
|
| 147 | + $output .= '<description><![CDATA[ '; |
|
| 148 | + $output .= '<div class="ge-balloon">'; |
|
| 149 | + $output .= '<div class="ge-row">'; |
|
| 150 | + $output .= '<span>Name</span>'; |
|
| 151 | + $output .= $spotter_item['departure_airport_name']; |
|
| 152 | + $output .= '</div>'; |
|
| 153 | + $output .= '<div class="ge-row">'; |
|
| 154 | + $output .= '<span>City</span>'; |
|
| 155 | + $output .= $spotter_item['departure_airport_city']; |
|
| 156 | + $output .= '</div>'; |
|
| 157 | + $output .= '<div class="ge-row">'; |
|
| 158 | + $output .= '<span>Country</span>'; |
|
| 159 | + $output .= $spotter_item['departure_airport_country']; |
|
| 160 | + $output .= '</div>'; |
|
| 161 | + $output .= '<div class="ge-row">'; |
|
| 162 | + $output .= '<span>ICAO</span>'; |
|
| 163 | + $output .= $spotter_item['departure_airport_icao']; |
|
| 164 | + $output .= '</div>'; |
|
| 165 | + $output .= '<div class="ge-row">'; |
|
| 166 | + $output .= '<span>IATA</span>'; |
|
| 167 | + $output .= $spotter_item['departure_airport_iata']; |
|
| 168 | + $output .= '</div>'; |
|
| 169 | + $output .= '<div class="ge-row">'; |
|
| 170 | + $output .= '<span>Coordinates</span>'; |
|
| 171 | + $output .= $spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_longitude']; |
|
| 172 | + $output .= '</div>'; |
|
| 173 | + $output .= '<div class="ge-row">'; |
|
| 174 | + $output .= '<span>Altitude</span>'; |
|
| 175 | + $output .= $spotter_item['departure_airport_altitude']; |
|
| 176 | + $output .= '</div>'; |
|
| 177 | + $output .= '</div>'; |
|
| 178 | + $output .= ' ]]></description>'; |
|
| 179 | 179 | $output .= '<styleUrl>#departureAirport</styleUrl>'; |
| 180 | 180 | $output .= '<Point>'; |
| 181 | 181 | $output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>'; |
@@ -186,38 +186,38 @@ discard block |
||
| 186 | 186 | //arrival airport |
| 187 | 187 | $output .= '<Placemark>'; |
| 188 | 188 | $output .= '<name>'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</name>'; |
| 189 | - $output .= '<description><![CDATA[ '; |
|
| 190 | - $output .= '<div class="ge-balloon">'; |
|
| 191 | - $output .= '<div class="ge-row">'; |
|
| 192 | - $output .= '<span>Name</span>'; |
|
| 193 | - $output .= $spotter_item['arrival_airport_name']; |
|
| 194 | - $output .= '</div>'; |
|
| 195 | - $output .= '<div class="ge-row">'; |
|
| 196 | - $output .= '<span>City</span>'; |
|
| 197 | - $output .= $spotter_item['arrival_airport_city']; |
|
| 198 | - $output .= '</div>'; |
|
| 199 | - $output .= '<div class="ge-row">'; |
|
| 200 | - $output .= '<span>Country</span>'; |
|
| 201 | - $output .= $spotter_item['arrival_airport_country']; |
|
| 202 | - $output .= '</div>'; |
|
| 203 | - $output .= '<div class="ge-row">'; |
|
| 204 | - $output .= '<span>ICAO</span>'; |
|
| 205 | - $output .= $spotter_item['arrival_airport_icao']; |
|
| 206 | - $output .= '</div>'; |
|
| 207 | - $output .= '<div class="ge-row">'; |
|
| 208 | - $output .= '<span>IATA</span>'; |
|
| 209 | - $output .= $spotter_item['arrival_airport_iata']; |
|
| 210 | - $output .= '</div>'; |
|
| 211 | - $output .= '<div class="ge-row">'; |
|
| 212 | - $output .= '<span>Coordinates</span>'; |
|
| 213 | - $output .= $spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_longitude']; |
|
| 214 | - $output .= '</div>'; |
|
| 215 | - $output .= '<div class="ge-row">'; |
|
| 216 | - $output .= '<span>Altitude</span>'; |
|
| 217 | - $output .= $spotter_item['arrival_airport_altitude']; |
|
| 218 | - $output .= '</div>'; |
|
| 219 | - $output .= '</div>'; |
|
| 220 | - $output .= ' ]]></description>'; |
|
| 189 | + $output .= '<description><![CDATA[ '; |
|
| 190 | + $output .= '<div class="ge-balloon">'; |
|
| 191 | + $output .= '<div class="ge-row">'; |
|
| 192 | + $output .= '<span>Name</span>'; |
|
| 193 | + $output .= $spotter_item['arrival_airport_name']; |
|
| 194 | + $output .= '</div>'; |
|
| 195 | + $output .= '<div class="ge-row">'; |
|
| 196 | + $output .= '<span>City</span>'; |
|
| 197 | + $output .= $spotter_item['arrival_airport_city']; |
|
| 198 | + $output .= '</div>'; |
|
| 199 | + $output .= '<div class="ge-row">'; |
|
| 200 | + $output .= '<span>Country</span>'; |
|
| 201 | + $output .= $spotter_item['arrival_airport_country']; |
|
| 202 | + $output .= '</div>'; |
|
| 203 | + $output .= '<div class="ge-row">'; |
|
| 204 | + $output .= '<span>ICAO</span>'; |
|
| 205 | + $output .= $spotter_item['arrival_airport_icao']; |
|
| 206 | + $output .= '</div>'; |
|
| 207 | + $output .= '<div class="ge-row">'; |
|
| 208 | + $output .= '<span>IATA</span>'; |
|
| 209 | + $output .= $spotter_item['arrival_airport_iata']; |
|
| 210 | + $output .= '</div>'; |
|
| 211 | + $output .= '<div class="ge-row">'; |
|
| 212 | + $output .= '<span>Coordinates</span>'; |
|
| 213 | + $output .= $spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_longitude']; |
|
| 214 | + $output .= '</div>'; |
|
| 215 | + $output .= '<div class="ge-row">'; |
|
| 216 | + $output .= '<span>Altitude</span>'; |
|
| 217 | + $output .= $spotter_item['arrival_airport_altitude']; |
|
| 218 | + $output .= '</div>'; |
|
| 219 | + $output .= '</div>'; |
|
| 220 | + $output .= ' ]]></description>'; |
|
| 221 | 221 | $output .= '<styleUrl>#arrivalAirport</styleUrl>'; |
| 222 | 222 | $output .= '<Point>'; |
| 223 | 223 | $output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>'; |
@@ -230,41 +230,41 @@ discard block |
||
| 230 | 230 | $output .= '<Placemark>'; |
| 231 | 231 | $output .= '<name>'.$spotter_item['ident'].' - '.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'</name>'; |
| 232 | 232 | $output .= '<description><![CDATA[ '; |
| 233 | - $output .= '<div class="ge-balloon">'; |
|
| 234 | - if ($spotter_item['image_thumbnail'] != "") |
|
| 235 | - { |
|
| 236 | - $output .= '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'" target="_blank"><img src="'.$spotter_item['image_thumbnail'].'" alt="Click on image to see Flight profile" title="Click on image to see Flight profile" class="ge-image" /></a>'; |
|
| 237 | - } |
|
| 238 | - $output .= '<div class="ge-row">'; |
|
| 239 | - $output .= '<span>Ident</span>'; |
|
| 240 | - $output .= '<a href="'.$globalURL.'/ident/'.$spotter_item['ident'].'" target="_blank">'.$spotter_item['ident'].'</a>'; |
|
| 241 | - $output .= '</div>'; |
|
| 242 | - $output .= '<div class="ge-row">'; |
|
| 243 | - $output .= '<span>Registration</span>'; |
|
| 244 | - $output .= '<a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a>'; |
|
| 245 | - $output .= '</div>'; |
|
| 246 | - $output .= '<div class="ge-row">'; |
|
| 247 | - $output .= '<span>Aircraft</span>'; |
|
| 248 | - $output .= '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" target="_blank">'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
| 249 | - $output .= '</div>'; |
|
| 250 | - $output .= '<div class="ge-row">'; |
|
| 251 | - $output .= '<span>Airline</span>'; |
|
| 252 | - $output .= '<a href="'.$globalURL.'/airline/'.$spotter_item['airline_icao'].'" target="_blank">'.$spotter_item['airline_name'].'</a>'; |
|
| 253 | - $output .= '</div>'; |
|
| 254 | - $output .= '<div class="ge-row">'; |
|
| 255 | - $output .= '<span>Departure Airport</span>'; |
|
| 256 | - $output .= '<a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country'].' ('.$spotter_item['departure_airport'].')</a>'; |
|
| 257 | - $output .= '</div>'; |
|
| 258 | - $output .= '<div class="ge-row">'; |
|
| 259 | - $output .= '<span>Arrival Airport</span>'; |
|
| 260 | - $output .= '<a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'" target="_blank">'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</a>'; |
|
| 261 | - $output .= '</div>'; |
|
| 233 | + $output .= '<div class="ge-balloon">'; |
|
| 234 | + if ($spotter_item['image_thumbnail'] != "") |
|
| 235 | + { |
|
| 236 | + $output .= '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'" target="_blank"><img src="'.$spotter_item['image_thumbnail'].'" alt="Click on image to see Flight profile" title="Click on image to see Flight profile" class="ge-image" /></a>'; |
|
| 237 | + } |
|
| 238 | + $output .= '<div class="ge-row">'; |
|
| 239 | + $output .= '<span>Ident</span>'; |
|
| 240 | + $output .= '<a href="'.$globalURL.'/ident/'.$spotter_item['ident'].'" target="_blank">'.$spotter_item['ident'].'</a>'; |
|
| 241 | + $output .= '</div>'; |
|
| 242 | + $output .= '<div class="ge-row">'; |
|
| 243 | + $output .= '<span>Registration</span>'; |
|
| 244 | + $output .= '<a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a>'; |
|
| 245 | + $output .= '</div>'; |
|
| 246 | + $output .= '<div class="ge-row">'; |
|
| 247 | + $output .= '<span>Aircraft</span>'; |
|
| 248 | + $output .= '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" target="_blank">'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
| 249 | + $output .= '</div>'; |
|
| 250 | + $output .= '<div class="ge-row">'; |
|
| 251 | + $output .= '<span>Airline</span>'; |
|
| 252 | + $output .= '<a href="'.$globalURL.'/airline/'.$spotter_item['airline_icao'].'" target="_blank">'.$spotter_item['airline_name'].'</a>'; |
|
| 253 | + $output .= '</div>'; |
|
| 254 | + $output .= '<div class="ge-row">'; |
|
| 255 | + $output .= '<span>Departure Airport</span>'; |
|
| 256 | + $output .= '<a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country'].' ('.$spotter_item['departure_airport'].')</a>'; |
|
| 257 | + $output .= '</div>'; |
|
| 258 | + $output .= '<div class="ge-row">'; |
|
| 259 | + $output .= '<span>Arrival Airport</span>'; |
|
| 260 | + $output .= '<a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'" target="_blank">'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</a>'; |
|
| 261 | + $output .= '</div>'; |
|
| 262 | 262 | $output .= '<div class="ge-row">'; |
| 263 | - $output .= '<span>Date</span>'; |
|
| 264 | - $output .= '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'" target="_blank">'.date("D M j, Y, g:i a T", strtotime($spotter_item['date_iso_8601'])).'</a>'; |
|
| 265 | - $output .= '</div>'; |
|
| 266 | - $output .= '</div>'; |
|
| 267 | - $output .= ' ]]></description>'; |
|
| 263 | + $output .= '<span>Date</span>'; |
|
| 264 | + $output .= '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'" target="_blank">'.date("D M j, Y, g:i a T", strtotime($spotter_item['date_iso_8601'])).'</a>'; |
|
| 265 | + $output .= '</div>'; |
|
| 266 | + $output .= '</div>'; |
|
| 267 | + $output .= ' ]]></description>'; |
|
| 268 | 268 | $output .= '<styleUrl>#aircraft_'.$spotter_item['spotter_id'].'</styleUrl>'; |
| 269 | 269 | $output .= '<Point>'; |
| 270 | 270 | $output .= '<coordinates>'.$spotter_item['longitude'].', '.$spotter_item['latitude'].', '.$altitude.'</coordinates>'; |
@@ -273,14 +273,14 @@ discard block |
||
| 273 | 273 | $output .= '</Placemark>'; |
| 274 | 274 | |
| 275 | 275 | $output .= '<Style id="aircraft_'.$spotter_item['spotter_id'].'">'; |
| 276 | - $output .= '<IconStyle>'; |
|
| 277 | - $output .= '<Icon>'; |
|
| 278 | - $output .= '<href>http://www.flightairmap.fr/images/kml_aircraft.png</href>'; |
|
| 279 | - $output .= '</Icon>'; |
|
| 280 | - $output .= '<heading>'.$spotter_item['heading'].'</heading>'; |
|
| 281 | - $output .= '</IconStyle>'; |
|
| 282 | - $output .= '</Style>'; |
|
| 283 | - } |
|
| 276 | + $output .= '<IconStyle>'; |
|
| 277 | + $output .= '<Icon>'; |
|
| 278 | + $output .= '<href>http://www.flightairmap.fr/images/kml_aircraft.png</href>'; |
|
| 279 | + $output .= '</Icon>'; |
|
| 280 | + $output .= '<heading>'.$spotter_item['heading'].'</heading>'; |
|
| 281 | + $output .= '</IconStyle>'; |
|
| 282 | + $output .= '</Style>'; |
|
| 283 | + } |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | $output .= '</Document>'; |
@@ -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,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 = '<?xml version="1.0" encoding="UTF-8"?>'; |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | if (!empty($spotter_array)) |
| 117 | 117 | { |
| 118 | - foreach($spotter_array as $spotter_item) |
|
| 118 | + foreach ($spotter_array as $spotter_item) |
|
| 119 | 119 | { |
| 120 | 120 | |
| 121 | 121 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | foreach ($waypoint_pieces as $waypoint_coordinate) |
| 134 | 134 | { |
| 135 | - $output .= $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' '; |
|
| 135 | + $output .= $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' '; |
|
| 136 | 136 | |
| 137 | 137 | } |
| 138 | 138 | $output .= '</coordinates>'; |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $output .= ' ]]></description>'; |
| 179 | 179 | $output .= '<styleUrl>#departureAirport</styleUrl>'; |
| 180 | 180 | $output .= '<Point>'; |
| 181 | - $output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>'; |
|
| 181 | + $output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>'; |
|
| 182 | 182 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
| 183 | 183 | $output .= '</Point>'; |
| 184 | 184 | $output .= '</Placemark>'; |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $output .= ' ]]></description>'; |
| 221 | 221 | $output .= '<styleUrl>#arrivalAirport</styleUrl>'; |
| 222 | 222 | $output .= '<Point>'; |
| 223 | - $output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>'; |
|
| 223 | + $output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>'; |
|
| 224 | 224 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
| 225 | 225 | $output .= '</Point>'; |
| 226 | 226 | $output .= '</Placemark>'; |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | $output .= ' ]]></description>'; |
| 268 | 268 | $output .= '<styleUrl>#aircraft_'.$spotter_item['spotter_id'].'</styleUrl>'; |
| 269 | 269 | $output .= '<Point>'; |
| 270 | - $output .= '<coordinates>'.$spotter_item['longitude'].', '.$spotter_item['latitude'].', '.$altitude.'</coordinates>'; |
|
| 270 | + $output .= '<coordinates>'.$spotter_item['longitude'].', '.$spotter_item['latitude'].', '.$altitude.'</coordinates>'; |
|
| 271 | 271 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
| 272 | 272 | $output .= '</Point>'; |
| 273 | 273 | $output .= '</Placemark>'; |
@@ -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/xml'); |
| 69 | 77 | |
| 70 | -if (isset($_GET['sort'])) $sort = $_GET['sort']; |
|
| 71 | -else $sort = ''; |
|
| 78 | +if (isset($_GET['sort'])) { |
|
| 79 | + $sort = $_GET['sort']; |
|
| 80 | +} else { |
|
| 81 | + $sort = ''; |
|
| 82 | +} |
|
| 72 | 83 | $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
| 73 | 84 | $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
| 74 | 85 | $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
@@ -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); |
@@ -102,16 +102,16 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | if (!empty($spotter_array)) |
| 104 | 104 | { |
| 105 | - foreach($spotter_array as $spotter_item) |
|
| 106 | - { |
|
| 105 | + foreach($spotter_array as $spotter_item) |
|
| 106 | + { |
|
| 107 | 107 | |
| 108 | 108 | |
| 109 | 109 | print '<item>'; |
| 110 | - 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>'; |
|
| 111 | - print '<link>http://www.flightairmap.fr/flightid/'.$spotter_item['spotter_id'].'</link>'; |
|
| 112 | - print '<guid isPermaLink="false">http://www.flightairmap.fr/flightid/'.$spotter_item['spotter_id'].'</guid>'; |
|
| 113 | - print '<description>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'])).'</description>'; |
|
| 114 | - print '<pubDate>'.$date.'</pubDate>'; |
|
| 110 | + 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>'; |
|
| 111 | + print '<link>http://www.flightairmap.fr/flightid/'.$spotter_item['spotter_id'].'</link>'; |
|
| 112 | + print '<guid isPermaLink="false">http://www.flightairmap.fr/flightid/'.$spotter_item['spotter_id'].'</guid>'; |
|
| 113 | + print '<description>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'])).'</description>'; |
|
| 114 | + print '<pubDate>'.$date.'</pubDate>'; |
|
| 115 | 115 | print '</item>'; |
| 116 | 116 | |
| 117 | 117 | } |
@@ -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_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
| 88 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',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_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
| 88 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', 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 '<rss xmlns:flightairmap="http://'.$_SERVER['HTTP_HOST'].''.htmlentities($_SERVER['REQUEST_URI']).'" version="2.0">'; |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | if (!empty($spotter_array)) |
| 104 | 104 | { |
| 105 | - foreach($spotter_array as $spotter_item) |
|
| 105 | + foreach ($spotter_array as $spotter_item) |
|
| 106 | 106 | { |
| 107 | 107 | |
| 108 | 108 | |
@@ -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]; |
@@ -70,8 +78,11 @@ discard block |
||
| 70 | 78 | |
| 71 | 79 | $date = date("D, d M Y H:i:s T", time()); |
| 72 | 80 | |
| 73 | -if (isset($_GET['sort'])) $sort = $_GET['sort']; |
|
| 74 | -else $sort = ''; |
|
| 81 | +if (isset($_GET['sort'])) { |
|
| 82 | + $sort = $_GET['sort']; |
|
| 83 | +} else { |
|
| 84 | + $sort = ''; |
|
| 85 | +} |
|
| 75 | 86 | $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
| 76 | 87 | $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
| 77 | 88 | $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |