@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $metar_info = $METAR->getMETAR($airport_icao); |
47 | 47 | //print_r($metar_info); |
48 | 48 | if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']); |
49 | - //print_r($metar_parse); |
|
49 | + //print_r($metar_parse); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | $title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | function drawChart6() { |
100 | 100 | var data = google.visualization.arrayToDataTable([ |
101 | 101 | ["'._("Date").'","'._("Departure").'","'._("Arrival").'"], '; |
102 | - $airport_data = ''; |
|
103 | - foreach($all_data as $data) |
|
104 | - { |
|
105 | - $airport_data .= '[ "'.$data['date'].'",'.$data['departure'].','.$data['arrival'].'],'; |
|
106 | - } |
|
107 | - $airport_data = substr($airport_data, 0, -1); |
|
108 | - print $airport_data.']); |
|
102 | + $airport_data = ''; |
|
103 | + foreach($all_data as $data) |
|
104 | + { |
|
105 | + $airport_data .= '[ "'.$data['date'].'",'.$data['departure'].','.$data['arrival'].'],'; |
|
106 | + } |
|
107 | + $airport_data = substr($airport_data, 0, -1); |
|
108 | + print $airport_data.']); |
|
109 | 109 | |
110 | 110 | var options = { |
111 | 111 | legend: {position: "none"}, |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $limit_start = 0; |
16 | 16 | $limit_end = 25; |
17 | 17 | $absolute_difference = 25; |
18 | - } else { |
|
18 | + } else { |
|
19 | 19 | $limit_explode = explode(",", $_GET['limit']); |
20 | 20 | $limit_start = $limit_explode[0]; |
21 | 21 | $limit_end = $limit_explode[1]; |
@@ -45,7 +45,9 @@ discard block |
||
45 | 45 | $METAR = new METAR(); |
46 | 46 | $metar_info = $METAR->getMETAR($airport_icao); |
47 | 47 | //print_r($metar_info); |
48 | - if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']); |
|
48 | + if (isset($metar_info[0]['metar'])) { |
|
49 | + $metar_parse = $METAR->parse($metar_info[0]['metar']); |
|
50 | + } |
|
49 | 51 | //print_r($metar_parse); |
50 | 52 | } |
51 | 53 | |
@@ -90,7 +92,9 @@ discard block |
||
90 | 92 | $all_data = $Stats->getLast7DaysAirports($airport_icao); |
91 | 93 | if (isset($globalTimezone)) { |
92 | 94 | date_default_timezone_set($globalTimezone); |
93 | - } else date_default_timezone_set('UTC'); |
|
95 | + } else { |
|
96 | + date_default_timezone_set('UTC'); |
|
97 | + } |
|
94 | 98 | if (count($all_data) > 0) { |
95 | 99 | print '<div id="chart6" class="chart" width="100%"></div> |
96 | 100 | <script> |
@@ -5,17 +5,17 @@ discard block |
||
5 | 5 | require_once('require/class.Stats.php'); |
6 | 6 | require_once('require/class.METAR.php'); |
7 | 7 | |
8 | -if (!isset($_GET['airport'])){ |
|
8 | +if (!isset($_GET['airport'])) { |
|
9 | 9 | header('Location: '.$globalURL.'/airport'); |
10 | 10 | } else { |
11 | 11 | $Spotter = new Spotter(); |
12 | 12 | //calculuation for the pagination |
13 | - if(!isset($_GET['limit'])) |
|
13 | + if (!isset($_GET['limit'])) |
|
14 | 14 | { |
15 | 15 | $limit_start = 0; |
16 | 16 | $limit_end = 25; |
17 | 17 | $absolute_difference = 25; |
18 | - } else { |
|
18 | + } else { |
|
19 | 19 | $limit_explode = explode(",", $_GET['limit']); |
20 | 20 | $limit_start = $limit_explode[0]; |
21 | 21 | $limit_end = $limit_explode[1]; |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | $limit_next = $limit_end + $absolute_difference; |
29 | 29 | $limit_previous_1 = $limit_start - $absolute_difference; |
30 | 30 | $limit_previous_2 = $limit_end - $absolute_difference; |
31 | - $airport_icao = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
31 | + $airport_icao = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
32 | 32 | $page_url = $globalURL.'/airport/'.$airport_icao; |
33 | 33 | |
34 | 34 | if (isset($_GET['sort'])) { |
35 | - $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, $_GET['sort']); |
|
35 | + $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, $_GET['sort']); |
|
36 | 36 | } else { |
37 | - $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, ''); |
|
37 | + $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, ''); |
|
38 | 38 | } |
39 | 39 | $airport_array = $Spotter->getAllAirportInfo($airport_icao); |
40 | 40 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | //print_r($metar_parse); |
50 | 50 | } |
51 | 51 | |
52 | - $title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
52 | + $title = sprintf(_("Detailed View for %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
53 | 53 | |
54 | 54 | require_once('header.php'); |
55 | 55 | /* |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | var data = google.visualization.arrayToDataTable([ |
109 | 109 | ["'._("Date").'","'._("Departure").'","'._("Arrival").'"], '; |
110 | 110 | $airport_data = ''; |
111 | - foreach($all_data as $data) |
|
111 | + foreach ($all_data as $data) |
|
112 | 112 | { |
113 | 113 | $airport_data .= '[ "'.$data['date'].'",'.$data['departure'].','.$data['arrival'].'],'; |
114 | 114 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | print _("Dew point:").' '.$metar_parse['dew'].' °C'." - "; |
162 | 162 | } |
163 | 163 | if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) { |
164 | - $humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1); |
|
164 | + $humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1); |
|
165 | 165 | print _("Humidity:").' '.$humidity.'%'." - "; |
166 | 166 | } |
167 | 167 | if (isset($metar_parse['QNH'])) { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | print '<div class="table column">'; |
178 | 178 | if ($airport_array[0]['iata'] != "NA") |
179 | 179 | { |
180 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
180 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
181 | 181 | } |
182 | 182 | include('table-output.php'); |
183 | 183 | print '<div class="pagination">'; |
@@ -9,14 +9,14 @@ discard block |
||
9 | 9 | require_once('require/class.Language.php'); |
10 | 10 | |
11 | 11 | $Spotter = new Spotter(); |
12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
13 | 13 | if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) { |
14 | 14 | $spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort); |
15 | 15 | } else $spotter_array = array(); |
16 | 16 | |
17 | 17 | if (!empty($spotter_array)) |
18 | 18 | { |
19 | - $title = sprintf(_("Most Common Time of Day between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']); |
|
19 | + $title = sprintf(_("Most Common Time of Day between %s (%s), %s - %s (%s), %s"), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']); |
|
20 | 20 | require_once('header.php'); |
21 | 21 | print '<div class="info column">'; |
22 | 22 | print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>'; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | include('route-sub-menu.php'); |
28 | 28 | print '<div class="column">'; |
29 | 29 | print '<h2>'._("Most Common Time of Day").'</h2>'; |
30 | - print '<p>'.sprintf(_("The statistic below shows the most common time of day of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']).'</p>'; |
|
30 | + print '<p>'.sprintf(_("The statistic below shows the most common time of day of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']).'</p>'; |
|
31 | 31 | |
32 | 32 | $hour_array = $Spotter->countAllHoursByRoute($_GET['departure_airport'], $_GET['arrival_airport']); |
33 | 33 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | var data = google.visualization.arrayToDataTable([ |
40 | 40 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
41 | 41 | $hour_data = ''; |
42 | - foreach($hour_array as $hour_item) |
|
42 | + foreach ($hour_array as $hour_item) |
|
43 | 43 | { |
44 | 44 | $hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; |
45 | 45 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | function drawChart() { |
35 | 35 | var data = google.visualization.arrayToDataTable([ |
36 | 36 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
37 | - $hour_data = ''; |
|
37 | + $hour_data = ''; |
|
38 | 38 | foreach($hour_array as $hour_item) |
39 | 39 | { |
40 | 40 | $hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; |
@@ -12,7 +12,9 @@ |
||
12 | 12 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
13 | 13 | if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) { |
14 | 14 | $spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort); |
15 | -} else $spotter_array = array(); |
|
15 | +} else { |
|
16 | + $spotter_array = array(); |
|
17 | +} |
|
16 | 18 | |
17 | 19 | if (!empty($spotter_array)) |
18 | 20 | { |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
11 | -$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
12 | -$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort); |
|
10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
11 | +$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort); |
|
13 | 13 | |
14 | 14 | if (!empty($spotter_array)) |
15 | 15 | { |
16 | - $title = sprintf(_("Most Common Departure Airports of %s"),$spotter_array[0]['ident']); |
|
16 | + $title = sprintf(_("Most Common Departure Airports of %s"), $spotter_array[0]['ident']); |
|
17 | 17 | require_once('header.php'); |
18 | 18 | print '<div class="info column">'; |
19 | 19 | print '<h1>'.$spotter_array[0]['ident'].'</h1>'; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | include('ident-sub-menu.php'); |
25 | 25 | print '<div class="column">'; |
26 | 26 | print '<h2>'._("Most Common Departure Airports").'</h2>'; |
27 | - print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
27 | + print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
28 | 28 | $airport_airport_array = $Spotter->countAllDepartureAirportsByIdent($ident); |
29 | 29 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script> |
30 | 30 | <script> |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | ["'._("Airport").'", "'._("# of times").'"],'; |
40 | 40 | |
41 | 41 | $airport_data = ''; |
42 | - foreach($airport_airport_array as $airport_item) |
|
42 | + foreach ($airport_airport_array as $airport_item) |
|
43 | 43 | { |
44 | 44 | $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
45 | 45 | $name = str_replace("'", "", $name); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | print '</thead>'; |
79 | 79 | print '<tbody>'; |
80 | 80 | $i = 1; |
81 | - foreach($airport_airport_array as $airport_item) |
|
81 | + foreach ($airport_airport_array as $airport_item) |
|
82 | 82 | { |
83 | 83 | print '<tr>'; |
84 | 84 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -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['ident'])) { |
6 | - header('Location: '.$globalURL.'/ident'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/ident'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | $page_url = $globalURL.'/tools-notam'; |
12 | 12 | |
13 | -$message = filter_input(INPUT_POST,'notam_message',FILTER_SANITIZE_STRING); |
|
13 | +$message = filter_input(INPUT_POST, 'notam_message', FILTER_SANITIZE_STRING); |
|
14 | 14 | |
15 | 15 | print '<div class="info column">'; |
16 | 16 | print '<h1>'._("Parse NOTAM messages").'</h1>'; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | if (!empty($notam_parse)) { |
35 | 35 | print '<p>'._("NOTAM message in human readable format:").'</p>'; |
36 | 36 | foreach ($notam_parse as $key => $value) { |
37 | - print '<b>'.strtoupper(str_replace('_',' ',$key)).'</b>: '.$value.'<br />'; |
|
37 | + print '<b>'.strtoupper(str_replace('_', ' ', $key)).'</b>: '.$value.'<br />'; |
|
38 | 38 | } |
39 | 39 | } else { |
40 | 40 | print '<p>'._("This NOTAM message can't be translated in human readable format :(").'</p>'; |
@@ -23,7 +23,9 @@ |
||
23 | 23 | print '<fieldset class="form-group">'; |
24 | 24 | print '<label for="notam_message">'._("NOTAM Message").'</label>'; |
25 | 25 | print '<textarea class="form-control" name="notam_message" id="notam_message" rows="5">'; |
26 | -if ($message != '') print $message; |
|
26 | +if ($message != '') { |
|
27 | + print $message; |
|
28 | +} |
|
27 | 29 | print '</textarea>'; |
28 | 30 | print '</fieldset>'; |
29 | 31 | print '<button type="submit" class="btn btn-primary">Submit</button>'; |
@@ -20,16 +20,16 @@ discard block |
||
20 | 20 | print '<div class="select-item">'; |
21 | 21 | print '<form action="'.$globalURL.'/aircraft" method="post">'; |
22 | 22 | print '<select name="aircraft_type" class="selectpicker" data-live-search="true">'; |
23 | - print '<option></option>'; |
|
24 | - $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
25 | - foreach($aircraft_types as $aircrafttype) |
|
26 | - { |
|
27 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
28 | - { |
|
29 | - print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
|
30 | - } else { |
|
31 | - print '<option value="'.$aircrafttype['aircraft_icao'].'">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
|
32 | - } |
|
23 | + print '<option></option>'; |
|
24 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
25 | + foreach($aircraft_types as $aircrafttype) |
|
26 | + { |
|
27 | + if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
28 | + { |
|
29 | + print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
|
30 | + } else { |
|
31 | + print '<option value="'.$aircrafttype['aircraft_icao'].'">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
|
32 | + } |
|
33 | 33 | } |
34 | 34 | print '</select>'; |
35 | 35 | print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>'; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | function drawChart() { |
62 | 62 | var data = google.visualization.arrayToDataTable([ |
63 | 63 | ["Country", "# of times"], '; |
64 | - $country_data = ''; |
|
64 | + $country_data = ''; |
|
65 | 65 | foreach($airline_array as $airline_item) |
66 | 66 | { |
67 | 67 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
@@ -8,13 +8,13 @@ discard block |
||
8 | 8 | header('Location: '.$globalURL.'/aircraft'); |
9 | 9 | die(); |
10 | 10 | } |
11 | -$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
12 | -$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1",""); |
|
11 | +$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", ""); |
|
13 | 13 | |
14 | 14 | |
15 | 15 | if (!empty($spotter_array)) |
16 | 16 | { |
17 | - $title = sprintf(_("Most Common Airlines by Country from %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
17 | + $title = sprintf(_("Most Common Airlines by Country from %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
18 | 18 | require_once('header.php'); |
19 | 19 | |
20 | 20 | print '<div class="select-item">'; |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | print '<select name="aircraft_type" class="selectpicker" data-live-search="true">'; |
23 | 23 | print '<option></option>'; |
24 | 24 | $aircraft_types = $Spotter->getAllAircraftTypes(); |
25 | - foreach($aircraft_types as $aircrafttype) |
|
25 | + foreach ($aircraft_types as $aircrafttype) |
|
26 | 26 | { |
27 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
27 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
28 | 28 | { |
29 | 29 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
30 | 30 | } else { |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | include('aircraft-sub-menu.php'); |
51 | 51 | print '<div class="column">'; |
52 | 52 | print '<h2>'._("Most Common Airlines by Country").'</h2>'; |
53 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
53 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
54 | 54 | |
55 | 55 | $airline_array = $Spotter->countAllAirlineCountriesByAircraft($aircraft_type); |
56 | 56 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | var data = google.visualization.arrayToDataTable([ |
63 | 63 | ["Country", "# of times"], '; |
64 | 64 | $country_data = ''; |
65 | - foreach($airline_array as $airline_item) |
|
65 | + foreach ($airline_array as $airline_item) |
|
66 | 66 | { |
67 | 67 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
68 | 68 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | print '</thead>'; |
94 | 94 | print '<tbody>'; |
95 | 95 | $i = 1; |
96 | - foreach($airline_array as $airline_item) |
|
96 | + foreach ($airline_array as $airline_item) |
|
97 | 97 | { |
98 | 98 | print '<tr>'; |
99 | 99 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -63,7 +63,10 @@ |
||
63 | 63 | imagedestroy($image); |
64 | 64 | } else { |
65 | 65 | header('Content-type: image/png'); |
66 | - if ($color == 'FF0000') readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
67 | - else readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
68 | -} |
|
66 | + if ($color == 'FF0000') { |
|
67 | + readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
68 | + } else { |
|
69 | + readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
70 | + } |
|
71 | + } |
|
69 | 72 | ?> |
70 | 73 | \ No newline at end of file |
@@ -4,88 +4,88 @@ |
||
4 | 4 | $hex = str_replace("#", "", $hex); |
5 | 5 | $color = array(); |
6 | 6 | if (strlen($hex) == 3) { |
7 | - $color['r'] = hexdec(substr($hex, 0, 1) . substr($hex,0,1)); |
|
8 | - $color['g'] = hexdec(substr($hex, 1, 1) . substr($hex,1,1)); |
|
9 | - $color['b'] = hexdec(substr($hex, 2, 1) . substr($hex,2,1)); |
|
7 | + $color['r'] = hexdec(substr($hex, 0, 1) . substr($hex,0,1)); |
|
8 | + $color['g'] = hexdec(substr($hex, 1, 1) . substr($hex,1,1)); |
|
9 | + $color['b'] = hexdec(substr($hex, 2, 1) . substr($hex,2,1)); |
|
10 | 10 | } else if (strlen($hex) == 6) { |
11 | - $color['r'] = hexdec(substr($hex, 0, 2)); |
|
12 | - $color['g'] = hexdec(substr($hex, 2, 2)); |
|
13 | - $color['b'] = hexdec(substr($hex, 4, 2)); |
|
11 | + $color['r'] = hexdec(substr($hex, 0, 2)); |
|
12 | + $color['g'] = hexdec(substr($hex, 2, 2)); |
|
13 | + $color['b'] = hexdec(substr($hex, 4, 2)); |
|
14 | 14 | } |
15 | 15 | return $color; |
16 | 16 | } |
17 | 17 | |
18 | 18 | |
19 | 19 | if (!isset($_GET['color']) || $_GET['color'] == '' || !preg_match('/^([a-fA-F0-9]){3}(([a-fA-F0-9]){3})?\b/',$_GET['color'])) { |
20 | - exit(0); |
|
20 | + exit(0); |
|
21 | 21 | } |
22 | 22 | $color = $_GET['color']; |
23 | 23 | if (!isset($_GET['filename']) || !preg_match('/^[a-z0-9-_]+\.png$/', strtolower($_GET['filename']))) { |
24 | - echo "Incorrect filename"; |
|
25 | - exit(0); |
|
24 | + echo "Incorrect filename"; |
|
25 | + exit(0); |
|
26 | 26 | } |
27 | 27 | $filename = $_GET['filename']; |
28 | 28 | if (file_exists(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.$color.'-'.$filename)) { |
29 | - header('Content-type: image/png'); |
|
30 | - readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.$color.'-'.$filename); |
|
31 | - exit(0); |
|
29 | + header('Content-type: image/png'); |
|
30 | + readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.$color.'-'.$filename); |
|
31 | + exit(0); |
|
32 | 32 | } |
33 | 33 | $original = dirname(__FILE__).DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'aircrafts'.DIRECTORY_SEPARATOR.'new'.DIRECTORY_SEPARATOR.$filename; |
34 | 34 | if (!file_exists($original)) { |
35 | - echo "File not found"; |
|
35 | + echo "File not found"; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | if (extension_loaded('gd') && function_exists('gd_info')) { |
39 | - $image = imagecreatefrompng($original); |
|
40 | - $index = imagecolorexact($image,26,49,81); |
|
41 | - if ($index < 0) { |
|
39 | + $image = imagecreatefrompng($original); |
|
40 | + $index = imagecolorexact($image,26,49,81); |
|
41 | + if ($index < 0) { |
|
42 | 42 | $index = imagecolorexact($image,25,49,79); |
43 | - } |
|
44 | - if ($index < 0) { |
|
43 | + } |
|
44 | + if ($index < 0) { |
|
45 | 45 | $index = imagecolorexact($image,0,0,0); |
46 | - } |
|
47 | - $c = hexToRGB($color); |
|
48 | - imagecolorset($image,$index,$c['r'],$c['g'],$c['b']); |
|
46 | + } |
|
47 | + $c = hexToRGB($color); |
|
48 | + imagecolorset($image,$index,$c['r'],$c['g'],$c['b']); |
|
49 | 49 | /* |
50 | 50 | $ig = imagecolorat($image, 0, 0); |
51 | 51 | imagecolortransparent($image, $ig); |
52 | 52 | */ |
53 | 53 | |
54 | - header('Content-type: image/png'); |
|
55 | - if (isset($_GET['resize']) && function_exists('imagecopyresampled')) { |
|
54 | + header('Content-type: image/png'); |
|
55 | + if (isset($_GET['resize']) && function_exists('imagecopyresampled')) { |
|
56 | 56 | $resize = filter_input(INPUT_GET,'resize',FILTER_SANITIZE_NUMBER_INT); |
57 | 57 | $newimg = imagecreatetruecolor($resize,$resize); |
58 | - imagealphablending($newimg, false); |
|
58 | + imagealphablending($newimg, false); |
|
59 | 59 | imagesavealpha($newimg, true); |
60 | 60 | imagecopyresampled($newimg,$image,0,0,0,0,15,15,imagesx($image),imagesy($image)); |
61 | 61 | if (isset($_GET['heading'])) { |
62 | - $heading = filter_input(INPUT_GET,'heading',FILTER_SANITIZE_NUMBER_INT); |
|
63 | - $rotation = imagerotate($newimg,$heading,imageColorAllocateAlpha($newimg,0,0,0,127)); |
|
64 | - imagealphablending($rotation, false); |
|
65 | - imagesavealpha($rotation, true); |
|
66 | - imagepng($rotation); |
|
67 | - imagedestroy($newimg); |
|
68 | - imagedestroy($image); |
|
69 | - imagedestroy($rotation); |
|
62 | + $heading = filter_input(INPUT_GET,'heading',FILTER_SANITIZE_NUMBER_INT); |
|
63 | + $rotation = imagerotate($newimg,$heading,imageColorAllocateAlpha($newimg,0,0,0,127)); |
|
64 | + imagealphablending($rotation, false); |
|
65 | + imagesavealpha($rotation, true); |
|
66 | + imagepng($rotation); |
|
67 | + imagedestroy($newimg); |
|
68 | + imagedestroy($image); |
|
69 | + imagedestroy($rotation); |
|
70 | 70 | |
71 | 71 | } else { |
72 | - imagepng($newimg); |
|
73 | - imagedestroy($newimg); |
|
74 | - imagedestroy($image); |
|
75 | - } |
|
76 | - } else { |
|
72 | + imagepng($newimg); |
|
73 | + imagedestroy($newimg); |
|
74 | + imagedestroy($image); |
|
75 | + } |
|
76 | + } else { |
|
77 | 77 | imagealphablending($image, false); |
78 | - imagesavealpha($image, true); |
|
78 | + imagesavealpha($image, true); |
|
79 | 79 | imagepng($image); |
80 | 80 | imagepng($image); |
81 | 81 | if (is_writable('cache')) { |
82 | - imagepng($image,dirname(__FILE__).DIRECTORY_SEPARATOR.'cache/'.$color.'-'.$filename); |
|
82 | + imagepng($image,dirname(__FILE__).DIRECTORY_SEPARATOR.'cache/'.$color.'-'.$filename); |
|
83 | + } |
|
84 | + imagedestroy($image); |
|
83 | 85 | } |
84 | - imagedestroy($image); |
|
85 | - } |
|
86 | 86 | } else { |
87 | - header('Content-type: image/png'); |
|
88 | - if ($color == 'FF0000') readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
89 | - else readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
87 | + header('Content-type: image/png'); |
|
88 | + if ($color == 'FF0000') readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
89 | + else readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
90 | 90 | } |
91 | 91 | ?> |
92 | 92 | \ No newline at end of file |
@@ -4,9 +4,9 @@ discard block |
||
4 | 4 | $hex = str_replace("#", "", $hex); |
5 | 5 | $color = array(); |
6 | 6 | if (strlen($hex) == 3) { |
7 | - $color['r'] = hexdec(substr($hex, 0, 1) . substr($hex,0,1)); |
|
8 | - $color['g'] = hexdec(substr($hex, 1, 1) . substr($hex,1,1)); |
|
9 | - $color['b'] = hexdec(substr($hex, 2, 1) . substr($hex,2,1)); |
|
7 | + $color['r'] = hexdec(substr($hex, 0, 1).substr($hex, 0, 1)); |
|
8 | + $color['g'] = hexdec(substr($hex, 1, 1).substr($hex, 1, 1)); |
|
9 | + $color['b'] = hexdec(substr($hex, 2, 1).substr($hex, 2, 1)); |
|
10 | 10 | } else if (strlen($hex) == 6) { |
11 | 11 | $color['r'] = hexdec(substr($hex, 0, 2)); |
12 | 12 | $color['g'] = hexdec(substr($hex, 2, 2)); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | } |
17 | 17 | |
18 | 18 | |
19 | -if (!isset($_GET['color']) || $_GET['color'] == '' || !preg_match('/^([a-fA-F0-9]){3}(([a-fA-F0-9]){3})?\b/',$_GET['color'])) { |
|
19 | +if (!isset($_GET['color']) || $_GET['color'] == '' || !preg_match('/^([a-fA-F0-9]){3}(([a-fA-F0-9]){3})?\b/', $_GET['color'])) { |
|
20 | 20 | exit(0); |
21 | 21 | } |
22 | 22 | $color = $_GET['color']; |
@@ -37,15 +37,15 @@ discard block |
||
37 | 37 | |
38 | 38 | if (extension_loaded('gd') && function_exists('gd_info')) { |
39 | 39 | $image = imagecreatefrompng($original); |
40 | - $index = imagecolorexact($image,26,49,81); |
|
40 | + $index = imagecolorexact($image, 26, 49, 81); |
|
41 | 41 | if ($index < 0) { |
42 | - $index = imagecolorexact($image,25,49,79); |
|
42 | + $index = imagecolorexact($image, 25, 49, 79); |
|
43 | 43 | } |
44 | 44 | if ($index < 0) { |
45 | - $index = imagecolorexact($image,0,0,0); |
|
45 | + $index = imagecolorexact($image, 0, 0, 0); |
|
46 | 46 | } |
47 | 47 | $c = hexToRGB($color); |
48 | - imagecolorset($image,$index,$c['r'],$c['g'],$c['b']); |
|
48 | + imagecolorset($image, $index, $c['r'], $c['g'], $c['b']); |
|
49 | 49 | /* |
50 | 50 | $ig = imagecolorat($image, 0, 0); |
51 | 51 | imagecolortransparent($image, $ig); |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | |
54 | 54 | header('Content-type: image/png'); |
55 | 55 | if (isset($_GET['resize']) && function_exists('imagecopyresampled')) { |
56 | - $resize = filter_input(INPUT_GET,'resize',FILTER_SANITIZE_NUMBER_INT); |
|
57 | - $newimg = imagecreatetruecolor($resize,$resize); |
|
56 | + $resize = filter_input(INPUT_GET, 'resize', FILTER_SANITIZE_NUMBER_INT); |
|
57 | + $newimg = imagecreatetruecolor($resize, $resize); |
|
58 | 58 | imagealphablending($newimg, false); |
59 | 59 | imagesavealpha($newimg, true); |
60 | - imagecopyresampled($newimg,$image,0,0,0,0,15,15,imagesx($image),imagesy($image)); |
|
60 | + imagecopyresampled($newimg, $image, 0, 0, 0, 0, 15, 15, imagesx($image), imagesy($image)); |
|
61 | 61 | if (isset($_GET['heading'])) { |
62 | - $heading = filter_input(INPUT_GET,'heading',FILTER_SANITIZE_NUMBER_INT); |
|
63 | - $rotation = imagerotate($newimg,$heading,imageColorAllocateAlpha($newimg,0,0,0,127)); |
|
62 | + $heading = filter_input(INPUT_GET, 'heading', FILTER_SANITIZE_NUMBER_INT); |
|
63 | + $rotation = imagerotate($newimg, $heading, imageColorAllocateAlpha($newimg, 0, 0, 0, 127)); |
|
64 | 64 | imagealphablending($rotation, false); |
65 | 65 | imagesavealpha($rotation, true); |
66 | 66 | imagepng($rotation); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | imagepng($image); |
80 | 80 | imagepng($image); |
81 | 81 | if (is_writable('cache')) { |
82 | - imagepng($image,dirname(__FILE__).DIRECTORY_SEPARATOR.'cache/'.$color.'-'.$filename); |
|
82 | + imagepng($image, dirname(__FILE__).DIRECTORY_SEPARATOR.'cache/'.$color.'-'.$filename); |
|
83 | 83 | } |
84 | 84 | imagedestroy($image); |
85 | 85 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | $output = '{'; |
11 | 11 | $output .= '"flights": ['; |
12 | 12 | if (!empty($spotter_array)) { |
13 | - foreach($spotter_array as $spotter_item) |
|
13 | + foreach ($spotter_array as $spotter_item) |
|
14 | 14 | { |
15 | 15 | $output .= '{'; |
16 | 16 | $output .= '"flight_id": "'.$spotter_item['spotter_id'].'",'; |
@@ -3,17 +3,17 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | |
6 | -if (!isset($_GET['departure_airport']) || !isset($_GET['arrival_airport'])){ |
|
6 | +if (!isset($_GET['departure_airport']) || !isset($_GET['arrival_airport'])) { |
|
7 | 7 | header('Location: '.$globalURL.''); |
8 | 8 | } else { |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | //calculuation for the pagination |
11 | - if(!isset($_GET['limit'])) |
|
11 | + if (!isset($_GET['limit'])) |
|
12 | 12 | { |
13 | 13 | $limit_start = 0; |
14 | 14 | $limit_end = 25; |
15 | 15 | $absolute_difference = 25; |
16 | - } else { |
|
16 | + } else { |
|
17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
18 | 18 | $limit_start = $limit_explode[0]; |
19 | 19 | $limit_end = $limit_explode[1]; |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | $limit_previous_1 = $limit_start - $absolute_difference; |
28 | 28 | $limit_previous_2 = $limit_end - $absolute_difference; |
29 | 29 | |
30 | - $departure_airport = filter_input(INPUT_POST,'departure_airport',FILTER_SANITIZE_STRING); |
|
31 | - $arrival_airport = filter_input(INPUT_POST,'arrival_airport',FILTER_SANITIZE_STRING); |
|
30 | + $departure_airport = filter_input(INPUT_POST, 'departure_airport', FILTER_SANITIZE_STRING); |
|
31 | + $arrival_airport = filter_input(INPUT_POST, 'arrival_airport', FILTER_SANITIZE_STRING); |
|
32 | 32 | $page_url = $globalURL.'/route/'.$departure_airport.'/'.$arrival_airport; |
33 | 33 | |
34 | 34 | if (isset($_GET['sort'])) { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | if (!empty($spotter_array)) |
41 | 41 | { |
42 | - $title = sprintf(_("Detailed View for flights between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']); |
|
42 | + $title = sprintf(_("Detailed View for flights between %s (%s), %s - %s (%s), %s"), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']); |
|
43 | 43 | require_once('header.php'); |
44 | 44 | print '<div class="info column">'; |
45 | 45 | print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>'; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | include('route-sub-menu.php'); |
51 | 51 | print '<div class="table column">'; |
52 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights that used the route <strong>%s - %s</strong>."),$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['arrival_airport_icao']).'</p>'; |
|
52 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights that used the route <strong>%s - %s</strong>."), $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['arrival_airport_icao']).'</p>'; |
|
53 | 53 | |
54 | 54 | include('table-output.php'); |
55 | 55 | print '<div class="pagination">'; |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $limit_start = 0; |
14 | 14 | $limit_end = 25; |
15 | 15 | $absolute_difference = 25; |
16 | - } else { |
|
16 | + } else { |
|
17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
18 | 18 | $limit_start = $limit_explode[0]; |
19 | 19 | $limit_end = $limit_explode[1]; |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
11 | -$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
12 | -$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort); |
|
10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
11 | +$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort); |
|
13 | 13 | |
14 | 14 | if (!empty($spotter_array)) |
15 | 15 | { |
16 | - $title = sprintf(_("Most Common Routes of %s"),$spotter_array[0]['ident']); |
|
16 | + $title = sprintf(_("Most Common Routes of %s"), $spotter_array[0]['ident']); |
|
17 | 17 | require_once('header.php'); |
18 | 18 | print '<div class="info column">'; |
19 | 19 | print '<h1>'.$spotter_array[0]['ident'].'</h1>'; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | include('ident-sub-menu.php'); |
25 | 25 | print '<div class="column">'; |
26 | 26 | print '<h2>'._("Most Common Routes").'</h2>'; |
27 | - print '<p>'.sprintf(_("The statistic below shows the most common routes from flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
27 | + print '<p>'.sprintf(_("The statistic below shows the most common routes from flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
28 | 28 | |
29 | 29 | $route_array = $Spotter->countAllRoutesByIdent($ident); |
30 | 30 | if (!empty($route_array)) |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | print '</thead>'; |
42 | 42 | print '<tbody>'; |
43 | 43 | $i = 1; |
44 | - foreach($route_array as $route_item) |
|
44 | + foreach ($route_array as $route_item) |
|
45 | 45 | { |
46 | 46 | print '<tr>'; |
47 | 47 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -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['ident'])) { |
6 | - header('Location: '.$globalURL.'/ident'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/ident'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |