@@ -3,13 +3,13 @@ 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 | -$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
| 8 | -$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
| 6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 7 | +$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
| 8 | +$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort); |
|
| 9 | 9 | |
| 10 | 10 | if (!empty($spotter_array)) |
| 11 | 11 | { |
| 12 | - $title = sprintf(_("Most Common Time of Day on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 12 | + $title = sprintf(_("Most Common Time of Day on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 13 | 13 | require_once('header.php'); |
| 14 | 14 | print '<div class="select-item">'; |
| 15 | 15 | print '<form action="'.$globalURL.'/date" method="post" class="form-inline">'; |
@@ -26,13 +26,13 @@ discard block |
||
| 26 | 26 | print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>'; |
| 27 | 27 | print '<br />'; |
| 28 | 28 | print '<div class="info column">'; |
| 29 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 29 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 30 | 30 | print '</div>'; |
| 31 | 31 | |
| 32 | 32 | include('date-sub-menu.php'); |
| 33 | 33 | print '<div class="column">'; |
| 34 | 34 | print '<h2>'._("Most Common Time of Day").'</h2>'; |
| 35 | - print '<p>'.sprintf(_("The statistic below shows the most common time of day on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 35 | + print '<p>'.sprintf(_("The statistic below shows the most common time of day on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 36 | 36 | |
| 37 | 37 | $hour_array = $Spotter->countAllHoursByDate($date); |
| 38 | 38 | print ' <script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
| 46 | 46 | |
| 47 | 47 | $hour_data = ''; |
| 48 | - foreach($hour_array as $hour_item) |
|
| 48 | + foreach ($hour_array as $hour_item) |
|
| 49 | 49 | { |
| 50 | 50 | $hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; |
| 51 | 51 | } |
@@ -7,14 +7,14 @@ discard block |
||
| 7 | 7 | header('Location: '.$globalURL.'/airport'); |
| 8 | 8 | die(); |
| 9 | 9 | } |
| 10 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
| 10 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
| 11 | 11 | $Spotter = new Spotter(); |
| 12 | -$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1",""); |
|
| 12 | +$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", ""); |
|
| 13 | 13 | $airport_array = $Spotter->getAllAirportInfo($airport); |
| 14 | 14 | |
| 15 | 15 | if (!empty($airport_array)) |
| 16 | 16 | { |
| 17 | - $title = sprintf(_("Most Common Arrival Airports from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
| 17 | + $title = sprintf(_("Most Common Arrival Airports from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
| 18 | 18 | require_once('header.php'); |
| 19 | 19 | print '<div class="select-item">'; |
| 20 | 20 | print '<form action="'.$globalURL.'/airport" method="post">'; |
@@ -24,9 +24,9 @@ discard block |
||
| 24 | 24 | $airport_names = $Stats->getAllAirportNames(); |
| 25 | 25 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
| 26 | 26 | ksort($airport_names); |
| 27 | - foreach($airport_names as $airport_name) |
|
| 27 | + foreach ($airport_names as $airport_name) |
|
| 28 | 28 | { |
| 29 | - if($airport == $airport_name['airport_icao']) |
|
| 29 | + if ($airport == $airport_name['airport_icao']) |
|
| 30 | 30 | { |
| 31 | 31 | print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>'; |
| 32 | 32 | } else { |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | include('airport-sub-menu.php'); |
| 58 | 58 | print '<div class="column">'; |
| 59 | 59 | print '<h2>'._("Most Common Arrival Airports").'</h2>'; |
| 60 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
| 60 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
| 61 | 61 | $airport_airport_array = $Spotter->countAllArrivalAirportsByAirport($airport); |
| 62 | 62 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
| 63 | 63 | print '<script> |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | var data = google.visualization.arrayToDataTable([ |
| 72 | 72 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 73 | 73 | $airport_data = ''; |
| 74 | - foreach($airport_airport_array as $airport_item) |
|
| 74 | + foreach ($airport_airport_array as $airport_item) |
|
| 75 | 75 | { |
| 76 | 76 | $name = $airport_item['airport_arrival_city'].', '.$airport_item['airport_arrival_country'].' ('.$airport_item['airport_arrival_icao'].')'; |
| 77 | 77 | $name = str_replace("'", "", $name); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | print '</thead>'; |
| 111 | 111 | print '<tbody>'; |
| 112 | 112 | $i = 1; |
| 113 | - foreach($airport_airport_array as $airport_item) |
|
| 113 | + foreach ($airport_airport_array as $airport_item) |
|
| 114 | 114 | { |
| 115 | 115 | print '<tr>'; |
| 116 | 116 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['airport'])) { |
| 7 | - header('Location: '.$globalURL.'/airport'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/airport'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
| 11 | 11 | $Spotter = new Spotter(); |
@@ -23,7 +23,9 @@ |
||
| 23 | 23 | print '<option></option>'; |
| 24 | 24 | $Stats = new Stats(); |
| 25 | 25 | $airport_names = $Stats->getAllAirportNames(); |
| 26 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
| 26 | + if (empty($airport_names)) { |
|
| 27 | + $airport_names = $Spotter->getAllAirportNames(); |
|
| 28 | + } |
|
| 27 | 29 | ksort($airport_names); |
| 28 | 30 | foreach($airport_names as $airport_name) |
| 29 | 31 | { |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['airline'])) { |
| 7 | - header('Location: '.$globalURL.'/airline'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/airline'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 11 | 11 | $Spotter = new Spotter(); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | function drawChart() { |
| 74 | 74 | var data = google.visualization.arrayToDataTable([ |
| 75 | 75 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
| 76 | - $hour_data = ''; |
|
| 76 | + $hour_data = ''; |
|
| 77 | 77 | foreach($hour_array as $hour_item) |
| 78 | 78 | { |
| 79 | 79 | $hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; |
@@ -7,14 +7,14 @@ discard block |
||
| 7 | 7 | header('Location: '.$globalURL.'/airline'); |
| 8 | 8 | die(); |
| 9 | 9 | } |
| 10 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 10 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 11 | 11 | $Spotter = new Spotter(); |
| 12 | -$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1",""); |
|
| 12 | +$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", ""); |
|
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | if (!empty($spotter_array)) |
| 16 | 16 | { |
| 17 | - $title = sprintf(_("Most Common Time of Day from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']); |
|
| 17 | + $title = sprintf(_("Most Common Time of Day from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']); |
|
| 18 | 18 | require_once('header.php'); |
| 19 | 19 | print '<div class="select-item">'; |
| 20 | 20 | print '<form action="'.$globalURL.'/airline" method="post">'; |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | $Stats = new Stats(); |
| 24 | 24 | $airline_names = $Stats->getAllAirlineNames(); |
| 25 | 25 | if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
| 26 | - foreach($airline_names as $airline_name) |
|
| 26 | + foreach ($airline_names as $airline_name) |
|
| 27 | 27 | { |
| 28 | - if($airline == $airline_name['airline_icao']) |
|
| 28 | + if ($airline == $airline_name['airline_icao']) |
|
| 29 | 29 | { |
| 30 | 30 | print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>'; |
| 31 | 31 | } else { |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | include('airline-sub-menu.php'); |
| 64 | 64 | print '<div class="column">'; |
| 65 | 65 | print '<h2>'._("Most Common Time of Day").'</h2>'; |
| 66 | - print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>'; |
|
| 66 | + print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>'; |
|
| 67 | 67 | $hour_array = $Spotter->countAllHoursByAirline($airline); |
| 68 | 68 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
| 69 | 69 | print '<div id="chartHour" class="chart" width="100%"></div> |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | var data = google.visualization.arrayToDataTable([ |
| 75 | 75 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
| 76 | 76 | $hour_data = ''; |
| 77 | - foreach($hour_array as $hour_item) |
|
| 77 | + foreach ($hour_array as $hour_item) |
|
| 78 | 78 | { |
| 79 | 79 | $hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; |
| 80 | 80 | } |
@@ -21,7 +21,9 @@ discard block |
||
| 21 | 21 | print '<option></option>'; |
| 22 | 22 | $Stats = new Stats(); |
| 23 | 23 | $airline_names = $Stats->getAllAirlineNames(); |
| 24 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
| 24 | + if (empty($airline_names)) { |
|
| 25 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
| 26 | + } |
|
| 25 | 27 | foreach($airline_names as $airline_name) |
| 26 | 28 | { |
| 27 | 29 | if($airline == $airline_name['airline_icao']) |
@@ -43,8 +45,7 @@ discard block |
||
| 43 | 45 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
| 44 | 46 | { |
| 45 | 47 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
| 46 | - } |
|
| 47 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
| 48 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
| 48 | 49 | { |
| 49 | 50 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
| 50 | 51 | } |
@@ -22,7 +22,9 @@ |
||
| 22 | 22 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
| 23 | 23 | $Stats = new Stats(); |
| 24 | 24 | $all_manufacturers = $Stats->getAllManufacturers(); |
| 25 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
| 25 | + if (empty($all_manufacturers)) { |
|
| 26 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
| 27 | + } |
|
| 26 | 28 | foreach($all_manufacturers as $all_manufacturer) |
| 27 | 29 | { |
| 28 | 30 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['aircraft_manufacturer'])) { |
| 7 | - header('Location: '.$globalURL.'/manufacturer'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/manufacturer'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $Spotter = new Spotter(); |
| 11 | 11 | $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
@@ -8,13 +8,13 @@ discard block |
||
| 8 | 8 | die(); |
| 9 | 9 | } |
| 10 | 10 | $Spotter = new Spotter(); |
| 11 | -$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
|
| 12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 13 | -$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort); |
|
| 11 | +$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING))); |
|
| 12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 13 | +$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort); |
|
| 14 | 14 | |
| 15 | 15 | if (!empty($spotter_array)) |
| 16 | 16 | { |
| 17 | - $title = sprintf(_("'Most Common Departure Airports by Country from %s"),$manufacturer); |
|
| 17 | + $title = sprintf(_("'Most Common Departure Airports by Country from %s"), $manufacturer); |
|
| 18 | 18 | |
| 19 | 19 | require_once('header.php'); |
| 20 | 20 | print '<div class="select-item">'; |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | $Stats = new Stats(); |
| 24 | 24 | $all_manufacturers = $Stats->getAllManufacturers(); |
| 25 | 25 | if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
| 26 | - foreach($all_manufacturers as $all_manufacturer) |
|
| 26 | + foreach ($all_manufacturers as $all_manufacturer) |
|
| 27 | 27 | { |
| 28 | - if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
| 28 | + if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
| 29 | 29 | { |
| 30 | 30 | print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>'; |
| 31 | 31 | } else { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | include('manufacturer-sub-menu.php'); |
| 45 | 45 | print '<div class="column">'; |
| 46 | 46 | print '<h2>'._("Most Common Departure Airports by Country").'</h2>'; |
| 47 | - print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights from <strong>%s</strong>."),$manufacturer).'</p>'; |
|
| 47 | + print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights from <strong>%s</strong>."), $manufacturer).'</p>'; |
|
| 48 | 48 | |
| 49 | 49 | $airport_country_array = $Spotter->countAllDepartureAirportCountriesByManufacturer($manufacturer); |
| 50 | 50 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
| 54 | 54 | print 'var series = ['; |
| 55 | 55 | $country_data = ''; |
| 56 | - foreach($airport_country_array as $airport_item) |
|
| 56 | + foreach ($airport_country_array as $airport_item) |
|
| 57 | 57 | { |
| 58 | 58 | $country_data .= '[ "'.$airport_item['departure_airport_country_iso3'].'",'.$airport_item['airport_departure_country_count'].'],'; |
| 59 | 59 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | print '</thead>'; |
| 102 | 102 | print '<tbody>'; |
| 103 | 103 | $i = 1; |
| 104 | - foreach($airport_country_array as $airport_item) |
|
| 104 | + foreach ($airport_country_array as $airport_item) |
|
| 105 | 105 | { |
| 106 | 106 | print '<tr>'; |
| 107 | 107 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['aircraft_manufacturer'])) { |
| 7 | - header('Location: '.$globalURL.'/manufacturer'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/manufacturer'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $Spotter = new Spotter(); |
| 11 | 11 | $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | function drawChart() { |
| 56 | 56 | var data = google.visualization.arrayToDataTable([ |
| 57 | 57 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
| 58 | - $hour_data = ''; |
|
| 58 | + $hour_data = ''; |
|
| 59 | 59 | foreach($hour_array as $hour_item) |
| 60 | 60 | { |
| 61 | 61 | $hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; |
@@ -8,14 +8,14 @@ discard block |
||
| 8 | 8 | die(); |
| 9 | 9 | } |
| 10 | 10 | $Spotter = new Spotter(); |
| 11 | -$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
|
| 11 | +$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING))); |
|
| 12 | 12 | |
| 13 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 14 | -$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort); |
|
| 13 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 14 | +$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort); |
|
| 15 | 15 | |
| 16 | 16 | if (!empty($spotter_array)) |
| 17 | 17 | { |
| 18 | - $title = sprintf(_("Most Common Time of Day from %s"),$manufacturer); |
|
| 18 | + $title = sprintf(_("Most Common Time of Day from %s"), $manufacturer); |
|
| 19 | 19 | require_once('header.php'); |
| 20 | 20 | print '<div class="select-item">'; |
| 21 | 21 | print '<form action="'.$globalURL.'/manufacturer" method="post">'; |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | $Stats = new Stats(); |
| 24 | 24 | $all_manufacturers = $Stats->getAllManufacturers(); |
| 25 | 25 | if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
| 26 | - foreach($all_manufacturers as $all_manufacturer) |
|
| 26 | + foreach ($all_manufacturers as $all_manufacturer) |
|
| 27 | 27 | { |
| 28 | - if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
| 28 | + if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
| 29 | 29 | { |
| 30 | 30 | print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>'; |
| 31 | 31 | } else { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | include('manufacturer-sub-menu.php'); |
| 45 | 45 | print '<div class="column">'; |
| 46 | 46 | print '<h2>'._("Most Common Time of Day").'</h2>'; |
| 47 | - print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."),$manufacturer).'</p>'; |
|
| 47 | + print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."), $manufacturer).'</p>'; |
|
| 48 | 48 | |
| 49 | 49 | $hour_array = $Spotter->countAllHoursByManufacturer($manufacturer); |
| 50 | 50 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | var data = google.visualization.arrayToDataTable([ |
| 57 | 57 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
| 58 | 58 | $hour_data = ''; |
| 59 | - foreach($hour_array as $hour_item) |
|
| 59 | + foreach ($hour_array as $hour_item) |
|
| 60 | 60 | { |
| 61 | 61 | $hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; |
| 62 | 62 | } |
@@ -22,7 +22,9 @@ |
||
| 22 | 22 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
| 23 | 23 | $Stats = new Stats(); |
| 24 | 24 | $all_manufacturers = $Stats->getAllManufacturers(); |
| 25 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
| 25 | + if (empty($all_manufacturers)) { |
|
| 26 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
| 27 | + } |
|
| 26 | 28 | foreach($all_manufacturers as $all_manufacturer) |
| 27 | 29 | { |
| 28 | 30 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | <meta property="og:site_name" content="<?php print $globalName; ?>"/> |
| 41 | 41 | |
| 42 | 42 | <?php |
| 43 | - if (!isset($_SESSION['install']) && !$globalInstalled) { |
|
| 43 | + if (!isset($_SESSION['install']) && !$globalInstalled) { |
|
| 44 | 44 | ?> |
| 45 | 45 | <script language="JavaScript" type="text/javascript"> |
| 46 | 46 | function datasource_js() { |
@@ -121,22 +121,22 @@ discard block |
||
| 121 | 121 | } |
| 122 | 122 | </script> |
| 123 | 123 | <?php |
| 124 | - } |
|
| 124 | + } |
|
| 125 | 125 | ?> |
| 126 | 126 | |
| 127 | 127 | </head> |
| 128 | 128 | |
| 129 | 129 | <?php |
| 130 | - if (!isset($_SESSION['install']) && !$globalInstalled) { |
|
| 130 | + if (!isset($_SESSION['install']) && !$globalInstalled) { |
|
| 131 | 131 | ?> |
| 132 | 132 | |
| 133 | 133 | <body class="page-<?php print strtolower($current_page); ?>" onload="datasource_js(); metarcycle_js(); create_database_js(); daemon_js(); schedule_js()"> |
| 134 | 134 | <?php |
| 135 | - } else { |
|
| 135 | + } else { |
|
| 136 | 136 | ?> |
| 137 | 137 | <body class="page-<?php print strtolower($current_page); ?>"> |
| 138 | 138 | <?php |
| 139 | - } |
|
| 139 | + } |
|
| 140 | 140 | ?> |
| 141 | 141 | <div class="navbar navbar-fixed-top" role="navigation"> |
| 142 | 142 | <div class="container"> |
@@ -187,12 +187,12 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | <?php |
| 189 | 189 | if (isset($top_header)) { |
| 190 | - if ($top_header != "") |
|
| 191 | - { |
|
| 190 | + if ($top_header != "") |
|
| 191 | + { |
|
| 192 | 192 | print '<div class="top-header container clear" role="main">'; |
| 193 | 193 | print '<img src="../images/'.$top_header.'" alt="'.$title.'" title="'.$title.'" />'; |
| 194 | 194 | print '</div>'; |
| 195 | - } |
|
| 195 | + } |
|
| 196 | 196 | } |
| 197 | 197 | ?> |
| 198 | 198 | |
@@ -7,14 +7,14 @@ discard block |
||
| 7 | 7 | header('Location: '.$globalURL.'/airport'); |
| 8 | 8 | die(); |
| 9 | 9 | } |
| 10 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
| 10 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
| 11 | 11 | $Spotter = new Spotter(); |
| 12 | -$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1",""); |
|
| 12 | +$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", ""); |
|
| 13 | 13 | $airport_array = $Spotter->getAllAirportInfo($airport); |
| 14 | 14 | |
| 15 | 15 | if (!empty($airport_array)) |
| 16 | 16 | { |
| 17 | - $title = sprintf(_("Most Common Aircraft by Registration to/from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
| 17 | + $title = sprintf(_("Most Common Aircraft by Registration to/from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
| 18 | 18 | |
| 19 | 19 | require_once('header.php'); |
| 20 | 20 | print '<div class="select-item">'; |
@@ -25,9 +25,9 @@ discard block |
||
| 25 | 25 | $airport_names = $Stats->getAllAirportNames(); |
| 26 | 26 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
| 27 | 27 | ksort($airport_names); |
| 28 | - foreach($airport_names as $airport_name) |
|
| 28 | + foreach ($airport_names as $airport_name) |
|
| 29 | 29 | { |
| 30 | - if($_GET['airport'] == $airport_name['airport_icao']) |
|
| 30 | + if ($_GET['airport'] == $airport_name['airport_icao']) |
|
| 31 | 31 | { |
| 32 | 32 | print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>'; |
| 33 | 33 | } else { |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | include('airport-sub-menu.php'); |
| 59 | 59 | print '<div class="column">'; |
| 60 | 60 | print '<h2>'._("Most Common Aircraft by Registration").'</h2>'; |
| 61 | - print '<p>'.sprintf(_("The statistic below shows the most common aircraft by registration of flights to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
| 61 | + print '<p>'.sprintf(_("The statistic below shows the most common aircraft by registration of flights to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
| 62 | 62 | |
| 63 | 63 | $aircraft_array = $Spotter->countAllAircraftRegistrationByAirport($airport); |
| 64 | 64 | if (!empty($aircraft_array)) |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | print '</thead>'; |
| 76 | 76 | print '<tbody>'; |
| 77 | 77 | $i = 1; |
| 78 | - foreach($aircraft_array as $aircraft_item) |
|
| 78 | + foreach ($aircraft_array as $aircraft_item) |
|
| 79 | 79 | { |
| 80 | 80 | print '<tr>'; |
| 81 | 81 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['airport'])) { |
| 7 | - header('Location: '.$globalURL.'/airport'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/airport'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
| 11 | 11 | $Spotter = new Spotter(); |
@@ -23,7 +23,9 @@ |
||
| 23 | 23 | print '<option></option>'; |
| 24 | 24 | $Stats = new Stats(); |
| 25 | 25 | $airport_names = $Stats->getAllAirportNames(); |
| 26 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
| 26 | + if (empty($airport_names)) { |
|
| 27 | + $airport_names = $Spotter->getAllAirportNames(); |
|
| 28 | + } |
|
| 27 | 29 | ksort($airport_names); |
| 28 | 30 | foreach($airport_names as $airport_name) |
| 29 | 31 | { |
@@ -7,13 +7,13 @@ discard block |
||
| 7 | 7 | header('Location: '.$globalURL.'/airline'); |
| 8 | 8 | die(); |
| 9 | 9 | } |
| 10 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 10 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 11 | 11 | $Spotter = new Spotter(); |
| 12 | -$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1",""); |
|
| 12 | +$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", ""); |
|
| 13 | 13 | |
| 14 | 14 | if (!empty($spotter_array)) |
| 15 | 15 | { |
| 16 | - $title = sprintf(_("Most Common Routes from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']); |
|
| 16 | + $title = sprintf(_("Most Common Routes from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']); |
|
| 17 | 17 | require_once('header.php'); |
| 18 | 18 | print '<div class="select-item">'; |
| 19 | 19 | print '<form action="'.$globalURL.'/airline" method="post">'; |
@@ -22,9 +22,9 @@ discard block |
||
| 22 | 22 | $Stats = new Stats(); |
| 23 | 23 | $airline_names = $Stats->getAllAirlineNames(); |
| 24 | 24 | if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
| 25 | - foreach($airline_names as $airline_name) |
|
| 25 | + foreach ($airline_names as $airline_name) |
|
| 26 | 26 | { |
| 27 | - if($airline == $airline_name['airline_icao']) |
|
| 27 | + if ($airline == $airline_name['airline_icao']) |
|
| 28 | 28 | { |
| 29 | 29 | print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>'; |
| 30 | 30 | } else { |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | include('airline-sub-menu.php'); |
| 63 | 63 | print '<div class="column">'; |
| 64 | 64 | print '<h2>'._("Most Common Routes").'</h2>'; |
| 65 | - print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>'; |
|
| 65 | + print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>'; |
|
| 66 | 66 | $route_array = $Spotter->countAllRoutesByAirline($airline); |
| 67 | 67 | if (!empty($route_array)) |
| 68 | 68 | { |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | print '</thead>'; |
| 79 | 79 | print '<tbody>'; |
| 80 | 80 | $i = 1; |
| 81 | - foreach($route_array as $route_item) |
|
| 81 | + foreach ($route_array as $route_item) |
|
| 82 | 82 | { |
| 83 | 83 | print '<tr>'; |
| 84 | 84 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -21,7 +21,9 @@ discard block |
||
| 21 | 21 | print '<option></option>'; |
| 22 | 22 | $Stats = new Stats(); |
| 23 | 23 | $airline_names = $Stats->getAllAirlineNames(); |
| 24 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
| 24 | + if (empty($airline_names)) { |
|
| 25 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
| 26 | + } |
|
| 25 | 27 | foreach($airline_names as $airline_name) |
| 26 | 28 | { |
| 27 | 29 | if($airline == $airline_name['airline_icao']) |
@@ -43,8 +45,7 @@ discard block |
||
| 43 | 45 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
| 44 | 46 | { |
| 45 | 47 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
| 46 | - } |
|
| 47 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
| 48 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
| 48 | 49 | { |
| 49 | 50 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
| 50 | 51 | } |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['airline'])) { |
| 7 | - header('Location: '.$globalURL.'/airline'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/airline'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 11 | 11 | $Spotter = new Spotter(); |
@@ -3,13 +3,13 @@ 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 | -$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
| 8 | -$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
| 6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 7 | +$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
| 8 | +$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort); |
|
| 9 | 9 | |
| 10 | 10 | if (!empty($spotter_array)) |
| 11 | 11 | { |
| 12 | - $title = sprintf(_("Most Common Arrival Airports on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 12 | + $title = sprintf(_("Most Common Arrival Airports on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 13 | 13 | |
| 14 | 14 | require_once('header.php'); |
| 15 | 15 | print '<div class="select-item">'; |
@@ -27,13 +27,13 @@ discard block |
||
| 27 | 27 | print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>'; |
| 28 | 28 | print '<br />'; |
| 29 | 29 | print '<div class="info column">'; |
| 30 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 30 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 31 | 31 | print '</div>'; |
| 32 | 32 | |
| 33 | 33 | include('date-sub-menu.php'); |
| 34 | 34 | print '<div class="column">'; |
| 35 | 35 | print '<h2>'._("Most Common Arrival Airports").'</h2>'; |
| 36 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 36 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 37 | 37 | $airport_airport_array = $Spotter->countAllArrivalAirportsByDate($date); |
| 38 | 38 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script> |
| 39 | 39 | <script> |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 49 | 49 | |
| 50 | 50 | $airport_data = ''; |
| 51 | - foreach($airport_airport_array as $airport_item) |
|
| 51 | + foreach ($airport_airport_array as $airport_item) |
|
| 52 | 52 | { |
| 53 | 53 | $name = $airport_item['airport_arrival_city'].', '.$airport_item['airport_arrival_country'].' ('.$airport_item['airport_arrival_icao'].')'; |
| 54 | 54 | $name = str_replace("'", "", $name); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | print '</thead>'; |
| 88 | 88 | print '<tbody>'; |
| 89 | 89 | $i = 1; |
| 90 | - foreach($airport_airport_array as $airport_item) |
|
| 90 | + foreach ($airport_airport_array as $airport_item) |
|
| 91 | 91 | { |
| 92 | 92 | print '<tr>'; |
| 93 | 93 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $title = _("Unknown Date"); |
| 113 | 113 | require_once('header.php'); |
| 114 | 114 | print '<h1>'._("Error").'</h1>'; |
| 115 | - print '<p>'._("Sorry, this date does not exist in this database. :(");'</p>'; |
|
| 115 | + print '<p>'._("Sorry, this date does not exist in this database. :("); '</p>'; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | require_once('footer.php'); |