@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['airport'])) { |
6 | - header('Location: '.$globalURL.'/airport'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/airport'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
10 | 10 | $Spotter = new Spotter(); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | function drawChart() { |
66 | 66 | var data = google.visualization.arrayToDataTable([ |
67 | 67 | ["'._("Country").'", "'._("# of times").'"], '; |
68 | - $country_data = ''; |
|
68 | + $country_data = ''; |
|
69 | 69 | foreach($airline_array as $airline_item) |
70 | 70 | { |
71 | 71 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
@@ -6,14 +6,14 @@ discard block |
||
6 | 6 | header('Location: '.$globalURL.'/airport'); |
7 | 7 | die(); |
8 | 8 | } |
9 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
9 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
10 | 10 | $Spotter = new Spotter(); |
11 | -$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1",""); |
|
11 | +$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", ""); |
|
12 | 12 | $airport_array = $Spotter->getAllAirportInfo($airport); |
13 | 13 | |
14 | 14 | if (!empty($airport_array)) |
15 | 15 | { |
16 | - $title = sprintf(_("Most Common Airlines by Country to/from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
16 | + $title = sprintf(_("Most Common Airlines by Country to/from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
17 | 17 | require_once('header.php'); |
18 | 18 | print '<div class="select-item">'; |
19 | 19 | print '<form action="'.$globalURL.'/airport" method="post">'; |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | print '<option></option>'; |
22 | 22 | $airport_names = $Spotter->getAllAirportNames(); |
23 | 23 | ksort($airport_names); |
24 | - foreach($airport_names as $airport_name) |
|
24 | + foreach ($airport_names as $airport_name) |
|
25 | 25 | { |
26 | - if($airport == $airport_name['airport_icao']) |
|
26 | + if ($airport == $airport_name['airport_icao']) |
|
27 | 27 | { |
28 | 28 | 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>'; |
29 | 29 | } else { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | include('airport-sub-menu.php'); |
55 | 55 | print '<div class="column">'; |
56 | 56 | print '<h2>'._("Most Common Airlines by Country").'</h2>'; |
57 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
57 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
58 | 58 | |
59 | 59 | $airline_array = $Spotter->countAllAirlineCountriesByAirport($airport); |
60 | 60 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | var data = google.visualization.arrayToDataTable([ |
67 | 67 | ["'._("Country").'", "'._("# of times").'"], '; |
68 | 68 | $country_data = ''; |
69 | - foreach($airline_array as $airline_item) |
|
69 | + foreach ($airline_array as $airline_item) |
|
70 | 70 | { |
71 | 71 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
72 | 72 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | print '</thead>'; |
101 | 101 | print '<tbody>'; |
102 | 102 | $i = 1; |
103 | - foreach($airline_array as $airline_item) |
|
103 | + foreach ($airline_array as $airline_item) |
|
104 | 104 | { |
105 | 105 | print '<tr>'; |
106 | 106 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -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="https://www.google.com/jsapi"></script>'; |
31 | 31 | print '<div id="chartCountry" class="chart" width="100%"></div> |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | var data = google.visualization.arrayToDataTable([ |
37 | 37 | ["'._("Country").'", "'._("# of times").'"], '; |
38 | 38 | $country_data = ''; |
39 | - foreach($airport_country_array as $airport_item) |
|
39 | + foreach ($airport_country_array as $airport_item) |
|
40 | 40 | { |
41 | 41 | $country_data .= '[ "'.$airport_item['arrival_airport_country'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
42 | 42 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | print '</thead>'; |
71 | 71 | print '<tbody>'; |
72 | 72 | $i = 1; |
73 | - foreach($airport_country_array as $airport_item) |
|
73 | + foreach ($airport_country_array as $airport_item) |
|
74 | 74 | { |
75 | 75 | print '<tr>'; |
76 | 76 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -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,12 +3,12 @@ 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 | -$spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort); |
|
6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
7 | +$spotter_array = $Spotter->getSpotterDataByDate($_GET['date'], "0,1", $sort); |
|
8 | 8 | |
9 | 9 | if (!empty($spotter_array)) |
10 | 10 | { |
11 | - $title = sprintf(_("Most Common Time of Day on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
11 | + $title = sprintf(_("Most Common Time of Day on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
12 | 12 | require_once('header.php'); |
13 | 13 | print '<div class="select-item">'; |
14 | 14 | print '<form action="'.$globalURL.'/date" method="post">'; |
@@ -18,13 +18,13 @@ discard block |
||
18 | 18 | print '</form>'; |
19 | 19 | print '</div>'; |
20 | 20 | print '<div class="info column">'; |
21 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
21 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
22 | 22 | print '</div>'; |
23 | 23 | |
24 | 24 | include('date-sub-menu.php'); |
25 | 25 | print '<div class="column">'; |
26 | 26 | print '<h2>'._("Most Common Time of Day").'</h2>'; |
27 | - 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>'; |
|
27 | + 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>'; |
|
28 | 28 | |
29 | 29 | $hour_array = $Spotter->countAllHoursByDate($_GET['date']); |
30 | 30 | print ' <script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
38 | 38 | |
39 | 39 | $hour_data = ''; |
40 | - foreach($hour_array as $hour_item) |
|
40 | + foreach ($hour_array as $hour_item) |
|
41 | 41 | { |
42 | 42 | $hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; |
43 | 43 | } |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | <div class="sub-menu sub-menu-container"> |
5 | 5 | <ul class="nav"> |
6 | 6 | <li class="dropdown"> |
7 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
7 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer") { print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
8 | 8 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
9 | 9 | </a> |
10 | 10 | <ul class="dropdown-menu"> |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | </ul> |
16 | 16 | </li> |
17 | 17 | <li class="dropdown"> |
18 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
18 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
19 | 19 | <?php echo _("Airline"); ?> <span class="caret"></span> |
20 | 20 | </a> |
21 | 21 | <ul class="dropdown-menu" role="menu"> |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | </ul> |
26 | 26 | </li> |
27 | 27 | <li class="dropdown"> |
28 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
28 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
29 | 29 | <?php echo _("Airport"); ?> <span class="caret"></span> |
30 | 30 | </a> |
31 | 31 | <ul class="dropdown-menu" role="menu"> |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | </ul> |
37 | 37 | </li> |
38 | 38 | <li class="dropdown"> |
39 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
39 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
40 | 40 | <?php echo _("Route"); ?> <span class="caret"></span> |
41 | 41 | </a> |
42 | 42 | <ul class="dropdown-menu" role="menu"> |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | </ul> |
46 | 46 | </li> |
47 | 47 | <li class="dropdown"> |
48 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
48 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
49 | 49 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
50 | 50 | </a> |
51 | 51 | <ul class="dropdown-menu" role="menu"> |
@@ -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'].'],'; |
@@ -6,14 +6,14 @@ discard block |
||
6 | 6 | require_once('require/class.SpotterLive.php'); |
7 | 7 | require_once('require/class.SpotterArchive.php'); |
8 | 8 | |
9 | -if (!isset($_GET['ident'])){ |
|
9 | +if (!isset($_GET['ident'])) { |
|
10 | 10 | header('Location: '.$globalURL.''); |
11 | 11 | } else { |
12 | 12 | $Spotter = new Spotter(); |
13 | 13 | $SpotterArchive = new SpotterArchive(); |
14 | 14 | $Translation = new Translation(); |
15 | 15 | //calculuation for the pagination |
16 | - if(!isset($_GET['limit'])) |
|
16 | + if (!isset($_GET['limit'])) |
|
17 | 17 | { |
18 | 18 | $limit_start = 0; |
19 | 19 | $limit_end = 25; |
@@ -34,18 +34,18 @@ discard block |
||
34 | 34 | |
35 | 35 | $page_url = $globalURL.'/ident/'.$_GET['ident']; |
36 | 36 | |
37 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
38 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
37 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
38 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
39 | 39 | if (isset($_GET['sort'])) |
40 | 40 | { |
41 | - $spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
41 | + $spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
42 | 42 | if (empty($spotter_array)) { |
43 | - $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
43 | + $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
44 | 44 | } |
45 | 45 | } else { |
46 | - $spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
46 | + $spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
47 | 47 | if (empty($spotter_array)) { |
48 | - $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
48 | + $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | if (!empty($spotter_array)) { |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | $ident = $new_ident; |
55 | 55 | if (isset($_GET['sort'])) |
56 | 56 | { |
57 | - $spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
57 | + $spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
58 | 58 | if (empty($spotter_array)) { |
59 | - $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
59 | + $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
60 | 60 | } |
61 | 61 | } else { |
62 | - $spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
62 | + $spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
63 | 63 | if (empty($spotter_array)) { |
64 | - $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
64 | + $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | if (!empty($spotter_array)) |
71 | 71 | { |
72 | - $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['ident']); |
|
72 | + $title = sprintf(_("Detailed View for %s"), $spotter_array[0]['ident']); |
|
73 | 73 | $ident = $spotter_array[0]['ident']; |
74 | 74 | if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
75 | 75 | if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | var data = google.visualization.arrayToDataTable([ |
91 | 91 | ["Hour","'._("Altitude").'","'._("Speed").'"], '; |
92 | 92 | $altitude_data = ''; |
93 | - foreach($all_data as $data) |
|
93 | + foreach ($all_data as $data) |
|
94 | 94 | { |
95 | - $altitude_data .= '[ "'.date("G:i",strtotime($data['date']." UTC")).'",'.$data['altitude'].','.$data['ground_speed'].'],'; |
|
95 | + $altitude_data .= '[ "'.date("G:i", strtotime($data['date']." UTC")).'",'.$data['altitude'].','.$data['ground_speed'].'],'; |
|
96 | 96 | } |
97 | 97 | $altitude_data = substr($altitude_data, 0, -1); |
98 | 98 | print $altitude_data.']); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | include('ident-sub-menu.php'); |
134 | 134 | print '<div class="table column">'; |
135 | - 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>'; |
|
135 | + 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>'; |
|
136 | 136 | |
137 | 137 | include('table-output.php'); |
138 | 138 | print '<div class="pagination">'; |
@@ -71,8 +71,12 @@ discard block |
||
71 | 71 | { |
72 | 72 | $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['ident']); |
73 | 73 | $ident = $spotter_array[0]['ident']; |
74 | - if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
|
75 | - if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
|
74 | + if (isset($spotter_array[0]['latitude'])) { |
|
75 | + $latitude = $spotter_array[0]['latitude']; |
|
76 | + } |
|
77 | + if (isset($spotter_array[0]['longitude'])) { |
|
78 | + $longitude = $spotter_array[0]['longitude']; |
|
79 | + } |
|
76 | 80 | require_once('header.php'); |
77 | 81 | if (isset($globalArchive) && $globalArchive) { |
78 | 82 | // Requirement for altitude graph |
@@ -80,7 +84,9 @@ discard block |
||
80 | 84 | $all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']); |
81 | 85 | if (isset($globalTimezone)) { |
82 | 86 | date_default_timezone_set($globalTimezone); |
83 | - } else date_default_timezone_set('UTC'); |
|
87 | + } else { |
|
88 | + date_default_timezone_set('UTC'); |
|
89 | + } |
|
84 | 90 | if (count($all_data) > 0) { |
85 | 91 | print '<div id="chart6" class="chart" width="100%"></div> |
86 | 92 | <script> |
@@ -3,8 +3,8 @@ |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['aircraft_manufacturer'])) { |
6 | - header('Location: '.$globalURL.'/manufacturer'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/manufacturer'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | $Spotter = new Spotter(); |
@@ -8,13 +8,13 @@ discard block |
||
8 | 8 | } |
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 Arrival Airports from %s"),$manufacturer); |
|
17 | + $title = sprintf(_("Most Common Arrival Airports from %s"), $manufacturer); |
|
18 | 18 | |
19 | 19 | require_once('header.php'); |
20 | 20 | print '<div class="select-item">'; |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
23 | 23 | print '<option></option>'; |
24 | 24 | $all_manufacturers = $Spotter->getAllManufacturers(); |
25 | - foreach($all_manufacturers as $all_manufacturer) |
|
25 | + foreach ($all_manufacturers as $all_manufacturer) |
|
26 | 26 | { |
27 | - if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
27 | + if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
28 | 28 | { |
29 | 29 | print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>'; |
30 | 30 | } else { |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | include('manufacturer-sub-menu.php'); |
44 | 44 | print '<div class="column">'; |
45 | 45 | print '<h2>'._("Most Common Arrival Airports").'</h2>'; |
46 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights from <strong>%s</strong>."),$manufacturer).'</p>'; |
|
46 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights from <strong>%s</strong>."), $manufacturer).'</p>'; |
|
47 | 47 | $airport_airport_array = $Spotter->countAllArrivalAirportsByManufacturer($manufacturer); |
48 | 48 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script> |
49 | 49 | <script> |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | ["'._("Airport").'", "'._("# of times").'"],'; |
59 | 59 | |
60 | 60 | $airport_data = ''; |
61 | - foreach($airport_airport_array as $airport_item) |
|
61 | + foreach ($airport_airport_array as $airport_item) |
|
62 | 62 | { |
63 | 63 | $name = $airport_item['airport_arrival_city'].', '.$airport_item['airport_arrival_country'].' ('.$airport_item['airport_arrival_icao'].')'; |
64 | 64 | $name = str_replace("'", "", $name); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | print '</thead>'; |
98 | 98 | print '<tbody>'; |
99 | 99 | $i = 1; |
100 | - foreach($airport_airport_array as $airport_item) |
|
100 | + foreach ($airport_airport_array as $airport_item) |
|
101 | 101 | { |
102 | 102 | print '<tr>'; |
103 | 103 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -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> |
@@ -3,8 +3,8 @@ |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['airport'])) { |
6 | - header('Location: '.$globalURL.'/airport'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/airport'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 |
@@ -8,13 +8,13 @@ discard block |
||
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | |
11 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
12 | -$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1",""); |
|
11 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
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 to/from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
17 | + $title = sprintf(_("Most Common Aircraft to/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">'; |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | print '<option></option>'; |
23 | 23 | $airport_names = $Spotter->getAllAirportNames(); |
24 | 24 | ksort($airport_names); |
25 | - foreach($airport_names as $airport_name) |
|
25 | + foreach ($airport_names as $airport_name) |
|
26 | 26 | { |
27 | - if($airport == $airport_name['airport_icao']) |
|
27 | + if ($airport == $airport_name['airport_icao']) |
|
28 | 28 | { |
29 | 29 | 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>'; |
30 | 30 | } else { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | include('airport-sub-menu.php'); |
56 | 56 | print '<div class="column">'; |
57 | 57 | print '<h2>'._("Most Common Aircraft").'</h2>'; |
58 | - print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
58 | + print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
59 | 59 | |
60 | 60 | $aircraft_array = $Spotter->countAllAircraftTypesByAirport($airport); |
61 | 61 | if (!empty($aircraft_array)) |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | print '</thead>'; |
71 | 71 | print '<tbody>'; |
72 | 72 | $i = 1; |
73 | - foreach($aircraft_array as $aircraft_item) |
|
73 | + foreach ($aircraft_array as $aircraft_item) |
|
74 | 74 | { |
75 | 75 | print '<tr>'; |
76 | 76 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -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); |