@@ -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 Arrival Airports by Country of %s"),$spotter_array[0]['ident']); |
|
16 | + $title = sprintf(_("Most Common Arrival Airports by Country 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 Arrival Airports by Country").'</h2>'; |
27 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
27 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
28 | 28 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByIdent($ident); |
29 | 29 | //print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
30 | 30 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | print 'var series = ['; |
65 | 65 | $country_data = ''; |
66 | - foreach($airport_country_array as $airport_item) |
|
66 | + foreach ($airport_country_array as $airport_item) |
|
67 | 67 | { |
68 | 68 | $country_data .= '[ "'.$airport_item['arrival_airport_country_iso3'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
69 | 69 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | print '</thead>'; |
112 | 112 | print '<tbody>'; |
113 | 113 | $i = 1; |
114 | - foreach($airport_country_array as $airport_item) |
|
114 | + foreach ($airport_country_array as $airport_item) |
|
115 | 115 | { |
116 | 116 | print '<tr>'; |
117 | 117 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -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 by Country on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
12 | + $title = sprintf(_("Most Common Arrival Airports by Country 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 Arrival Airports by Country").'</h2>'; |
35 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights 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 all arrival airports by Country of origin of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
36 | 36 | |
37 | 37 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByDate($date); |
38 | 38 | //print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | print 'var series = ['; |
75 | 75 | $country_data = ''; |
76 | - foreach($airport_country_array as $airport_item) |
|
76 | + foreach ($airport_country_array as $airport_item) |
|
77 | 77 | { |
78 | 78 | $country_data .= '[ "'.$airport_item['arrival_airport_country_iso3'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
79 | 79 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | print '</thead>'; |
122 | 122 | print '<tbody>'; |
123 | 123 | $i = 1; |
124 | - foreach($airport_country_array as $airport_item) |
|
124 | + foreach ($airport_country_array as $airport_item) |
|
125 | 125 | { |
126 | 126 | print '<tr>'; |
127 | 127 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -14,12 +14,12 @@ discard block |
||
14 | 14 | * @param Array $headers header to submit with the form |
15 | 15 | * @return String the result |
16 | 16 | */ |
17 | - public function getData($url, $type = 'get', $data = '', $headers = '',$cookie = '',$referer = '',$timeout = '',$useragent = '') { |
|
17 | + public function getData($url, $type = 'get', $data = '', $headers = '', $cookie = '', $referer = '', $timeout = '', $useragent = '') { |
|
18 | 18 | global $globalProxy, $globalForceIPv4; |
19 | 19 | $ch = curl_init(); |
20 | 20 | curl_setopt($ch, CURLOPT_URL, $url); |
21 | 21 | if (isset($globalForceIPv4) && $globalForceIPv4) { |
22 | - if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')){ |
|
22 | + if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')) { |
|
23 | 23 | curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); |
24 | 24 | } |
25 | 25 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
30 | 30 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
31 | 31 | curl_setopt($ch, CURLINFO_HEADER_OUT, true); |
32 | - curl_setopt($ch,CURLOPT_ENCODING , "gzip"); |
|
32 | + curl_setopt($ch, CURLOPT_ENCODING, "gzip"); |
|
33 | 33 | //curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5'); |
34 | 34 | // curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0'); |
35 | 35 | if ($useragent == '') { |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | } |
40 | 40 | if ($timeout == '') curl_setopt($ch, CURLOPT_TIMEOUT, 10); |
41 | 41 | else curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); |
42 | - curl_setopt($ch, CURLOPT_HEADERFUNCTION, array('Common',"curlResponseHeaderCallback")); |
|
42 | + curl_setopt($ch, CURLOPT_HEADERFUNCTION, array('Common', "curlResponseHeaderCallback")); |
|
43 | 43 | if ($type == 'post') { |
44 | 44 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); |
45 | 45 | if (is_array($data)) { |
46 | 46 | curl_setopt($ch, CURLOPT_POST, count($data)); |
47 | 47 | $data_string = ''; |
48 | - foreach($data as $key=>$value) { $data_string .= $key.'='.$value.'&'; } |
|
48 | + foreach ($data as $key=>$value) { $data_string .= $key.'='.$value.'&'; } |
|
49 | 49 | rtrim($data_string, '&'); |
50 | 50 | curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); |
51 | 51 | } else { |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | if ($cookie != '') { |
59 | 59 | if (is_array($cookie)) { |
60 | - curl_setopt($ch, CURLOPT_COOKIE, implode($cookie,';')); |
|
60 | + curl_setopt($ch, CURLOPT_COOKIE, implode($cookie, ';')); |
|
61 | 61 | } else { |
62 | 62 | curl_setopt($ch, CURLOPT_COOKIE, $cookie); |
63 | 63 | } |
@@ -69,13 +69,13 @@ discard block |
||
69 | 69 | $info = curl_getinfo($ch); |
70 | 70 | //var_dump($info); |
71 | 71 | curl_close($ch); |
72 | - if ($info['http_code'] == '503' && strstr($result,'DDoS protection by CloudFlare')) { |
|
72 | + if ($info['http_code'] == '503' && strstr($result, 'DDoS protection by CloudFlare')) { |
|
73 | 73 | echo "Cloudflare Detected\n"; |
74 | 74 | require_once(dirname(__FILE__).'/libs/cloudflare-bypass/libraries/cloudflareClass.php'); |
75 | 75 | $useragent = UAgent::random(); |
76 | 76 | cloudflare::useUserAgent($useragent); |
77 | 77 | if ($clearanceCookie = cloudflare::bypass($url)) { |
78 | - return $this->getData($url,'get',$data,$headers,$clearanceCookie,$referer,$timeout,$useragent); |
|
78 | + return $this->getData($url, 'get', $data, $headers, $clearanceCookie, $referer, $timeout, $useragent); |
|
79 | 79 | } |
80 | 80 | } else { |
81 | 81 | return $result; |
@@ -116,27 +116,27 @@ discard block |
||
116 | 116 | if ($data == '') return array(); |
117 | 117 | $html = str_get_html($data); |
118 | 118 | if ($html === false) return array(); |
119 | - $tabledata=array(); |
|
120 | - foreach($html->find('tr') as $element) |
|
119 | + $tabledata = array(); |
|
120 | + foreach ($html->find('tr') as $element) |
|
121 | 121 | { |
122 | 122 | $td = array(); |
123 | - foreach( $element->find('th') as $row) |
|
123 | + foreach ($element->find('th') as $row) |
|
124 | 124 | { |
125 | 125 | $td [] = trim($row->plaintext); |
126 | 126 | } |
127 | - $td=array_filter($td); |
|
127 | + $td = array_filter($td); |
|
128 | 128 | $tabledata[] = $td; |
129 | 129 | |
130 | 130 | $td = array(); |
131 | 131 | $tdi = array(); |
132 | - foreach( $element->find('td') as $row) |
|
132 | + foreach ($element->find('td') as $row) |
|
133 | 133 | { |
134 | 134 | $td [] = trim($row->plaintext); |
135 | 135 | $tdi [] = trim($row->innertext); |
136 | 136 | } |
137 | - $td=array_filter($td); |
|
138 | - $tdi=array_filter($tdi); |
|
139 | - $tabledata[]=array_merge($td,$tdi); |
|
137 | + $td = array_filter($td); |
|
138 | + $tdi = array_filter($tdi); |
|
139 | + $tabledata[] = array_merge($td, $tdi); |
|
140 | 140 | } |
141 | 141 | $html->clear(); |
142 | 142 | unset($html); |
@@ -151,8 +151,8 @@ discard block |
||
151 | 151 | public function text2array($data) { |
152 | 152 | $html = str_get_html($data); |
153 | 153 | if ($html === false) return array(); |
154 | - $tabledata=array(); |
|
155 | - foreach($html->find('p') as $element) |
|
154 | + $tabledata = array(); |
|
155 | + foreach ($html->find('p') as $element) |
|
156 | 156 | { |
157 | 157 | $tabledata [] = trim($element->plaintext); |
158 | 158 | } |
@@ -172,11 +172,11 @@ discard block |
||
172 | 172 | */ |
173 | 173 | public function distance($lat, $lon, $latc, $lonc, $unit = 'km') { |
174 | 174 | if ($lat == $latc && $lon == $lonc) return 0; |
175 | - $dist = rad2deg(acos(sin(deg2rad(floatval($lat)))*sin(deg2rad(floatval($latc)))+ cos(deg2rad(floatval($lat)))*cos(deg2rad(floatval($latc)))*cos(deg2rad(floatval($lon)-floatval($lonc)))))*60*1.1515; |
|
175 | + $dist = rad2deg(acos(sin(deg2rad(floatval($lat)))*sin(deg2rad(floatval($latc))) + cos(deg2rad(floatval($lat)))*cos(deg2rad(floatval($latc)))*cos(deg2rad(floatval($lon) - floatval($lonc)))))*60*1.1515; |
|
176 | 176 | if ($unit == "km") { |
177 | - return round($dist * 1.609344); |
|
177 | + return round($dist*1.609344); |
|
178 | 178 | } elseif ($unit == "m") { |
179 | - return round($dist * 1.609344 * 1000); |
|
179 | + return round($dist*1.609344*1000); |
|
180 | 180 | } elseif ($unit == "mile" || $unit == "mi") { |
181 | 181 | return round($dist); |
182 | 182 | } elseif ($unit == "nm") { |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * @param float $distance distance covered |
193 | 193 | * @return whether distance is realistic |
194 | 194 | */ |
195 | - public function withinThreshold ($timeDifference, $distance) { |
|
195 | + public function withinThreshold($timeDifference, $distance) { |
|
196 | 196 | $x = abs($timeDifference); |
197 | 197 | $d = abs($distance); |
198 | 198 | if ($x == 0 || $d == 0) return true; |
@@ -208,12 +208,12 @@ discard block |
||
208 | 208 | return ($array !== array_values($array)); |
209 | 209 | } |
210 | 210 | |
211 | - public function isInteger($input){ |
|
211 | + public function isInteger($input) { |
|
212 | 212 | return(ctype_digit(strval($input))); |
213 | 213 | } |
214 | 214 | |
215 | 215 | |
216 | - public function convertDec($dms,$latlong) { |
|
216 | + public function convertDec($dms, $latlong) { |
|
217 | 217 | if ($latlong == 'latitude') { |
218 | 218 | $deg = substr($dms, 0, 2); |
219 | 219 | $min = substr($dms, 2, 4); |
@@ -221,10 +221,10 @@ discard block |
||
221 | 221 | $deg = substr($dms, 0, 3); |
222 | 222 | $min = substr($dms, 3, 5); |
223 | 223 | } |
224 | - return $deg+(($min*60)/3600); |
|
224 | + return $deg + (($min*60)/3600); |
|
225 | 225 | } |
226 | 226 | |
227 | - public function convertDM($coord,$latlong) { |
|
227 | + public function convertDM($coord, $latlong) { |
|
228 | 228 | if ($latlong == 'latitude') { |
229 | 229 | if ($coord < 0) $NSEW = 'S'; |
230 | 230 | else $NSEW = 'N'; |
@@ -234,9 +234,9 @@ discard block |
||
234 | 234 | } |
235 | 235 | $coord = abs($coord); |
236 | 236 | $deg = floor($coord); |
237 | - $coord = ($coord-$deg)*60; |
|
237 | + $coord = ($coord - $deg)*60; |
|
238 | 238 | $min = $coord; |
239 | - return array('deg' => $deg,'min' => $min,'NSEW' => $NSEW); |
|
239 | + return array('deg' => $deg, 'min' => $min, 'NSEW' => $NSEW); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | /** |
@@ -248,8 +248,8 @@ discard block |
||
248 | 248 | public function xcopy($source, $dest) |
249 | 249 | { |
250 | 250 | $files = glob($source.'*.*'); |
251 | - foreach($files as $file){ |
|
252 | - $file_to_go = str_replace($source,$dest,$file); |
|
251 | + foreach ($files as $file) { |
|
252 | + $file_to_go = str_replace($source, $dest, $file); |
|
253 | 253 | copy($file, $file_to_go); |
254 | 254 | } |
255 | 255 | return true; |
@@ -260,9 +260,9 @@ discard block |
||
260 | 260 | * @param String $url url to check |
261 | 261 | * @return bool Return true on succes false on failure |
262 | 262 | */ |
263 | - public function urlexist($url){ |
|
264 | - $headers=get_headers($url); |
|
265 | - return stripos($headers[0],"200 OK")?true:false; |
|
263 | + public function urlexist($url) { |
|
264 | + $headers = get_headers($url); |
|
265 | + return stripos($headers[0], "200 OK") ? true : false; |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | public function hex2str($hex) { |
274 | 274 | $str = ''; |
275 | 275 | $hexln = strlen($hex); |
276 | - for($i=0;$i<$hexln;$i+=2) $str .= chr(hexdec(substr($hex,$i,2))); |
|
276 | + for ($i = 0; $i < $hexln; $i += 2) $str .= chr(hexdec(substr($hex, $i, 2))); |
|
277 | 277 | return $str; |
278 | 278 | } |
279 | 279 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * @return String Return result |
284 | 284 | */ |
285 | 285 | public function hex2rgb($hex) { |
286 | - $hex = str_replace('#','',$hex); |
|
286 | + $hex = str_replace('#', '', $hex); |
|
287 | 287 | return sscanf($hex, "%02x%02x%02x"); |
288 | 288 | } |
289 | 289 | |
@@ -291,33 +291,33 @@ discard block |
||
291 | 291 | //difference in longitudinal coordinates |
292 | 292 | $dLon = deg2rad($lon2) - deg2rad($lon1); |
293 | 293 | //difference in the phi of latitudinal coordinates |
294 | - $dPhi = log(tan(deg2rad($lat2) / 2 + pi() / 4) / tan(deg2rad($lat1) / 2 + pi() / 4)); |
|
294 | + $dPhi = log(tan(deg2rad($lat2)/2 + pi()/4)/tan(deg2rad($lat1)/2 + pi()/4)); |
|
295 | 295 | //we need to recalculate $dLon if it is greater than pi |
296 | - if(abs($dLon) > pi()) { |
|
297 | - if($dLon > 0) { |
|
298 | - $dLon = (2 * pi() - $dLon) * -1; |
|
296 | + if (abs($dLon) > pi()) { |
|
297 | + if ($dLon > 0) { |
|
298 | + $dLon = (2*pi() - $dLon)*-1; |
|
299 | 299 | } else { |
300 | - $dLon = 2 * pi() + $dLon; |
|
300 | + $dLon = 2*pi() + $dLon; |
|
301 | 301 | } |
302 | 302 | } |
303 | 303 | //return the angle, normalized |
304 | - return (rad2deg(atan2($dLon, $dPhi)) + 360) % 360; |
|
304 | + return (rad2deg(atan2($dLon, $dPhi)) + 360)%360; |
|
305 | 305 | } |
306 | 306 | |
307 | - public function checkLine($lat1,$lon1,$lat2,$lon2,$lat3,$lon3,$approx = 0.2) { |
|
307 | + public function checkLine($lat1, $lon1, $lat2, $lon2, $lat3, $lon3, $approx = 0.2) { |
|
308 | 308 | //$a = ($lon2-$lon1)*$lat3+($lat2-$lat1)*$lon3+($lat1*$lon2+$lat2*$lon1); |
309 | - $a = -($lon2-$lon1); |
|
309 | + $a = -($lon2 - $lon1); |
|
310 | 310 | $b = $lat2 - $lat1; |
311 | - $c = -($a*$lat1+$b*$lon1); |
|
312 | - $d = $a*$lat3+$b*$lon3+$c; |
|
311 | + $c = -($a*$lat1 + $b*$lon1); |
|
312 | + $d = $a*$lat3 + $b*$lon3 + $c; |
|
313 | 313 | if ($d > -$approx && $d < $approx) return true; |
314 | 314 | else return false; |
315 | 315 | } |
316 | 316 | |
317 | 317 | public function array_merge_noappend() { |
318 | 318 | $output = array(); |
319 | - foreach(func_get_args() as $array) { |
|
320 | - foreach($array as $key => $value) { |
|
319 | + foreach (func_get_args() as $array) { |
|
320 | + foreach ($array as $key => $value) { |
|
321 | 321 | $output[$key] = isset($output[$key]) ? |
322 | 322 | array_merge($output[$key], $value) : $value; |
323 | 323 | } |
@@ -381,34 +381,34 @@ discard block |
||
381 | 381 | return $result; |
382 | 382 | } |
383 | 383 | |
384 | - public function nextcoord($latitude, $longitude, $speed, $heading, $archivespeed = 1){ |
|
384 | + public function nextcoord($latitude, $longitude, $speed, $heading, $archivespeed = 1) { |
|
385 | 385 | global $globalMapRefresh; |
386 | 386 | $distance = ($speed*0.514444*$globalMapRefresh*$archivespeed)/1000; |
387 | 387 | $r = 6378; |
388 | 388 | $latitude = deg2rad($latitude); |
389 | 389 | $longitude = deg2rad($longitude); |
390 | 390 | $bearing = deg2rad($heading); |
391 | - $latitude2 = asin( (sin($latitude) * cos($distance/$r)) + (cos($latitude) * sin($distance/$r) * cos($bearing)) ); |
|
392 | - $longitude2 = $longitude + atan2( sin($bearing)*sin($distance/$r)*cos($latitude), cos($distance/$r)-(sin($latitude)*sin($latitude2)) ); |
|
393 | - return array('latitude' => number_format(rad2deg($latitude2),5,'.',''),'longitude' => number_format(rad2deg($longitude2),5,'.','')); |
|
391 | + $latitude2 = asin((sin($latitude)*cos($distance/$r)) + (cos($latitude)*sin($distance/$r)*cos($bearing))); |
|
392 | + $longitude2 = $longitude + atan2(sin($bearing)*sin($distance/$r)*cos($latitude), cos($distance/$r) - (sin($latitude)*sin($latitude2))); |
|
393 | + return array('latitude' => number_format(rad2deg($latitude2), 5, '.', ''), 'longitude' => number_format(rad2deg($longitude2), 5, '.', '')); |
|
394 | 394 | } |
395 | 395 | |
396 | - public function getCoordfromDistanceBearing($latitude,$longitude,$bearing,$distance) { |
|
396 | + public function getCoordfromDistanceBearing($latitude, $longitude, $bearing, $distance) { |
|
397 | 397 | // distance in meter |
398 | 398 | $R = 6378.14; |
399 | - $latitude1 = $latitude * (M_PI/180); |
|
400 | - $longitude1 = $longitude * (M_PI/180); |
|
401 | - $brng = $bearing * (M_PI/180); |
|
399 | + $latitude1 = $latitude*(M_PI/180); |
|
400 | + $longitude1 = $longitude*(M_PI/180); |
|
401 | + $brng = $bearing*(M_PI/180); |
|
402 | 402 | $d = $distance; |
403 | 403 | |
404 | 404 | $latitude2 = asin(sin($latitude1)*cos($d/$R) + cos($latitude1)*sin($d/$R)*cos($brng)); |
405 | - $longitude2 = $longitude1 + atan2(sin($brng)*sin($d/$R)*cos($latitude1),cos($d/$R)-sin($latitude1)*sin($latitude2)); |
|
405 | + $longitude2 = $longitude1 + atan2(sin($brng)*sin($d/$R)*cos($latitude1), cos($d/$R) - sin($latitude1)*sin($latitude2)); |
|
406 | 406 | |
407 | - $latitude2 = $latitude2 * (180/M_PI); |
|
408 | - $longitude2 = $longitude2 * (180/M_PI); |
|
407 | + $latitude2 = $latitude2*(180/M_PI); |
|
408 | + $longitude2 = $longitude2*(180/M_PI); |
|
409 | 409 | |
410 | - $flat = round ($latitude2,6); |
|
411 | - $flong = round ($longitude2,6); |
|
410 | + $flat = round($latitude2, 6); |
|
411 | + $flong = round($longitude2, 6); |
|
412 | 412 | /* |
413 | 413 | $dx = $distance*cos($bearing); |
414 | 414 | $dy = $distance*sin($bearing); |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | $flong = $longitude + $dlong; |
418 | 418 | $flat = $latitude + $dlat; |
419 | 419 | */ |
420 | - return array('latitude' => $flat,'longitude' => $flong); |
|
420 | + return array('latitude' => $flat, 'longitude' => $flong); |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | /** |
@@ -431,14 +431,14 @@ discard block |
||
431 | 431 | * @param integer $level GZIP compression level (default: 9) |
432 | 432 | * @return string New filename (with .gz appended) if success, or false if operation fails |
433 | 433 | */ |
434 | - public function gzCompressFile($source, $level = 9){ |
|
435 | - $dest = $source . '.gz'; |
|
436 | - $mode = 'wb' . $level; |
|
434 | + public function gzCompressFile($source, $level = 9) { |
|
435 | + $dest = $source.'.gz'; |
|
436 | + $mode = 'wb'.$level; |
|
437 | 437 | $error = false; |
438 | 438 | if ($fp_out = gzopen($dest, $mode)) { |
439 | - if ($fp_in = fopen($source,'rb')) { |
|
439 | + if ($fp_in = fopen($source, 'rb')) { |
|
440 | 440 | while (!feof($fp_in)) |
441 | - gzwrite($fp_out, fread($fp_in, 1024 * 512)); |
|
441 | + gzwrite($fp_out, fread($fp_in, 1024*512)); |
|
442 | 442 | fclose($fp_in); |
443 | 443 | } else { |
444 | 444 | $error = true; |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | } |
455 | 455 | |
456 | 456 | public function remove_accents($string) { |
457 | - if ( !preg_match('/[\x80-\xff]/', $string) ) return $string; |
|
457 | + if (!preg_match('/[\x80-\xff]/', $string)) return $string; |
|
458 | 458 | $chars = array( |
459 | 459 | // Decompositions for Latin-1 Supplement |
460 | 460 | chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', |
512 | 512 | chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', |
513 | 513 | chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', |
514 | - chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', |
|
514 | + chr(196).chr(178) => 'IJ', chr(196).chr(179) => 'ij', |
|
515 | 515 | chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', |
516 | 516 | chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', |
517 | 517 | chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', |
@@ -527,13 +527,13 @@ discard block |
||
527 | 527 | chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', |
528 | 528 | chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', |
529 | 529 | chr(197).chr(144) => 'O', chr(197).chr(145) => 'o', |
530 | - chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe', |
|
531 | - chr(197).chr(148) => 'R',chr(197).chr(149) => 'r', |
|
532 | - chr(197).chr(150) => 'R',chr(197).chr(151) => 'r', |
|
533 | - chr(197).chr(152) => 'R',chr(197).chr(153) => 'r', |
|
534 | - chr(197).chr(154) => 'S',chr(197).chr(155) => 's', |
|
535 | - chr(197).chr(156) => 'S',chr(197).chr(157) => 's', |
|
536 | - chr(197).chr(158) => 'S',chr(197).chr(159) => 's', |
|
530 | + chr(197).chr(146) => 'OE', chr(197).chr(147) => 'oe', |
|
531 | + chr(197).chr(148) => 'R', chr(197).chr(149) => 'r', |
|
532 | + chr(197).chr(150) => 'R', chr(197).chr(151) => 'r', |
|
533 | + chr(197).chr(152) => 'R', chr(197).chr(153) => 'r', |
|
534 | + chr(197).chr(154) => 'S', chr(197).chr(155) => 's', |
|
535 | + chr(197).chr(156) => 'S', chr(197).chr(157) => 's', |
|
536 | + chr(197).chr(158) => 'S', chr(197).chr(159) => 's', |
|
537 | 537 | chr(197).chr(160) => 'S', chr(197).chr(161) => 's', |
538 | 538 | chr(197).chr(162) => 'T', chr(197).chr(163) => 't', |
539 | 539 | chr(197).chr(164) => 'T', chr(197).chr(165) => 't', |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | for ($i = 0, $int = '', $concat_flag = true; $i < $length; $i++) { |
568 | 568 | if (is_numeric($string[$i]) && $concat_flag) { |
569 | 569 | $int .= $string[$i]; |
570 | - } elseif(!$concat && $concat_flag && strlen($int) > 0) { |
|
570 | + } elseif (!$concat && $concat_flag && strlen($int) > 0) { |
|
571 | 571 | $concat_flag = false; |
572 | 572 | } |
573 | 573 | } |
@@ -3,17 +3,17 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
7 | -$registration = filter_input(INPUT_GET,'registration',FILTER_SANITIZE_STRING); |
|
6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
7 | +$registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING); |
|
8 | 8 | if ($registration != '') { |
9 | 9 | $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1", $sort); |
10 | 10 | $aircraft_array = $Spotter->getAircraftInfoByRegistration($registration); |
11 | -} else $spotter_array=array(); |
|
11 | +} else $spotter_array = array(); |
|
12 | 12 | |
13 | 13 | |
14 | 14 | if (!empty($spotter_array)) |
15 | 15 | { |
16 | - $title = sprintf(_("Most Common Arrival Airports by Country of aircraft with registration %s"),$registration); |
|
16 | + $title = sprintf(_("Most Common Arrival Airports by Country of aircraft with registration %s"), $registration); |
|
17 | 17 | require_once('header.php'); |
18 | 18 | print '<div class="info column">'; |
19 | 19 | print '<h1>'.$_GET['registration'].' - '.$aircraft_array[0]['aircraft_name'].' ('.$aircraft_array[0]['aircraft_icao'].')</h1>'; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | include('registration-sub-menu.php'); |
26 | 26 | print '<div class="column">'; |
27 | 27 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
28 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights with aircraft registration <strong>%s</strong>."),$registration).'</p>'; |
|
28 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights with aircraft registration <strong>%s</strong>."), $registration).'</p>'; |
|
29 | 29 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByRegistration($registration); |
30 | 30 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
31 | 31 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
34 | 34 | print 'var series = ['; |
35 | 35 | $country_data = ''; |
36 | - foreach($airport_country_array as $airport_item) |
|
36 | + foreach ($airport_country_array as $airport_item) |
|
37 | 37 | { |
38 | 38 | $country_data .= '[ "'.$airport_item['arrival_airport_country_iso3'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
39 | 39 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | print '</thead>'; |
82 | 82 | print '<tbody>'; |
83 | 83 | $i = 1; |
84 | - foreach($airport_country_array as $airport_item) |
|
84 | + foreach ($airport_country_array as $airport_item) |
|
85 | 85 | { |
86 | 86 | print '<tr>'; |
87 | 87 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -9,13 +9,13 @@ discard block |
||
9 | 9 | } |
10 | 10 | |
11 | 11 | $Spotter = new Spotter(); |
12 | -$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
|
13 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
14 | -$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort); |
|
12 | +$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING))); |
|
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 Arrival Airports by Country from %s"),$manufacturer); |
|
18 | + $title = sprintf(_("Most Common Arrival Airports by Country from %s"), $manufacturer); |
|
19 | 19 | |
20 | 20 | require_once('header.php'); |
21 | 21 | print '<div class="select-item">'; |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | $Stats = new Stats(); |
25 | 25 | $all_manufacturers = $Stats->getAllManufacturers(); |
26 | 26 | if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
27 | - foreach($all_manufacturers as $all_manufacturer) |
|
27 | + foreach ($all_manufacturers as $all_manufacturer) |
|
28 | 28 | { |
29 | - if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
29 | + if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
30 | 30 | { |
31 | 31 | print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>'; |
32 | 32 | } else { |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | include('manufacturer-sub-menu.php'); |
46 | 46 | print '<div class="column">'; |
47 | 47 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
48 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s</strong>."),$manufacturer).'</p>'; |
|
48 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s</strong>."), $manufacturer).'</p>'; |
|
49 | 49 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByManufacturer($manufacturer); |
50 | 50 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
51 | 51 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.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['arrival_airport_country_iso3'].'",'.$airport_item['airport_arrival_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,16 +4,16 @@ discard block |
||
4 | 4 | require_once('require/class.Stats.php'); |
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | $Spotter = new Spotter(); |
7 | -if (!isset($_GET['aircraft_manufacturer'])){ |
|
7 | +if (!isset($_GET['aircraft_manufacturer'])) { |
|
8 | 8 | header('Location: '.$globalURL.''); |
9 | 9 | } else { |
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,19 +27,19 @@ discard block |
||
27 | 27 | $limit_previous_1 = $limit_start - $absolute_difference; |
28 | 28 | $limit_previous_2 = $limit_end - $absolute_difference; |
29 | 29 | |
30 | - $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
|
31 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
30 | + $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING))); |
|
31 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
32 | 32 | $page_url = $globalURL.'/manufacturer/'.$manufacturer; |
33 | 33 | |
34 | 34 | if ($sort != '') { |
35 | - $spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,$limit_start.",".$absolute_difference, $sort); |
|
35 | + $spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, $limit_start.",".$absolute_difference, $sort); |
|
36 | 36 | } else { |
37 | - $spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,$limit_start.",".$absolute_difference, ''); |
|
37 | + $spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, $limit_start.",".$absolute_difference, ''); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | if (!empty($spotter_array)) |
41 | 41 | { |
42 | - $title = sprintf(_("Detailed View for %s"),$manufacturer); |
|
42 | + $title = sprintf(_("Detailed View for %s"), $manufacturer); |
|
43 | 43 | |
44 | 44 | require_once('header.php'); |
45 | 45 | print '<div class="select-item">'; |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | $Stats = new Stats(); |
49 | 49 | $all_manufacturers = $Stats->getAllManufacturers(); |
50 | 50 | if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
51 | - foreach($all_manufacturers as $all_manufacturer) |
|
51 | + foreach ($all_manufacturers as $all_manufacturer) |
|
52 | 52 | { |
53 | - if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
53 | + if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
54 | 54 | { |
55 | 55 | print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>'; |
56 | 56 | } else { |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | print '</div>'; |
68 | 68 | |
69 | 69 | print '<div class="table column">'; |
70 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s</strong."),$manufacturer).'</p>'; |
|
70 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s</strong."), $manufacturer).'</p>'; |
|
71 | 71 | |
72 | 72 | include('manufacturer-sub-menu.php'); |
73 | 73 | include('table-output.php'); |
@@ -3,16 +3,16 @@ 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); |
|
6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
7 | 7 | if (isset($_GET['registration'])) { |
8 | - $registration = filter_input(INPUT_GET,'registration',FILTER_SANITIZE_STRING); |
|
8 | + $registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING); |
|
9 | 9 | $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1", $sort); |
10 | 10 | $aircraft_array = $Spotter->getAircraftInfoByRegistration($registration); |
11 | 11 | } else $spotter_array = array(); |
12 | 12 | |
13 | 13 | if (!empty($spotter_array)) |
14 | 14 | { |
15 | - $title = sprintf(_("Most Common Departure Airports by Country of aircraft with registration %s"),$registration); |
|
15 | + $title = sprintf(_("Most Common Departure Airports by Country of aircraft with registration %s"), $registration); |
|
16 | 16 | require_once('header.php'); |
17 | 17 | print '<div class="info column">'; |
18 | 18 | print '<h1>'.$registration.' - '.$aircraft_array[0]['aircraft_name'].' ('.$aircraft_array[0]['aircraft_icao'].')</h1>'; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | include('registration-sub-menu.php'); |
25 | 25 | print '<div class="column">'; |
26 | 26 | print '<h2>'._("Most Common Departure Airports by Country").'</h2>'; |
27 | - print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights with aircraft registration <strong>%s</strong>."),$registration).'</p>'; |
|
27 | + print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights with aircraft registration <strong>%s</strong>."), $registration).'</p>'; |
|
28 | 28 | $airport_country_array = $Spotter->countAllDepartureAirportCountriesByRegistration($registration); |
29 | 29 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
30 | 30 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
33 | 33 | print 'var series = ['; |
34 | 34 | $country_data = ''; |
35 | - foreach($airport_country_array as $airport_item) |
|
35 | + foreach ($airport_country_array as $airport_item) |
|
36 | 36 | { |
37 | 37 | $country_data .= '[ "'.$airport_item['departure_airport_country_iso3'].'",'.$airport_item['airport_departure_country_count'].'],'; |
38 | 38 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | print '</thead>'; |
81 | 81 | print '<tbody>'; |
82 | 82 | $i = 1; |
83 | - foreach($airport_country_array as $airport_item) |
|
83 | + foreach ($airport_country_array as $airport_item) |
|
84 | 84 | { |
85 | 85 | print '<tr>'; |
86 | 86 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,9 +3,9 @@ discard block |
||
3 | 3 | </span> |
4 | 4 | <div class="sub-menu sub-menu-container"> |
5 | 5 | <ul class="nav nav-pills"> |
6 | - <li><a href="<?php print $globalURL; ?>/manufacturer/<?php print $manufacturer; ?>" <?php if (strtolower($current_page) == "manufacturer-detailed"){ print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li> |
|
6 | + <li><a href="<?php print $globalURL; ?>/manufacturer/<?php print $manufacturer; ?>" <?php if (strtolower($current_page) == "manufacturer-detailed") { print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li> |
|
7 | 7 | <li class="dropdown"> |
8 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "manufacturer-statistics-aircraft" || strtolower($current_page) == "manufacturer-statistics-registration"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
8 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "manufacturer-statistics-aircraft" || strtolower($current_page) == "manufacturer-statistics-registration") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
9 | 9 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
10 | 10 | </a> |
11 | 11 | <ul class="dropdown-menu" role="menu"> |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | </ul> |
15 | 15 | </li> |
16 | 16 | <li class="dropdown"> |
17 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "manufacturer-statistics-airline" || strtolower($current_page) == "manufacturer-statistics-airline-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
17 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "manufacturer-statistics-airline" || strtolower($current_page) == "manufacturer-statistics-airline-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
18 | 18 | <?php echo _("Airline"); ?> <span class="caret"></span> |
19 | 19 | </a> |
20 | 20 | <ul class="dropdown-menu" role="menu"> |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | </ul> |
24 | 24 | </li> |
25 | 25 | <li class="dropdown"> |
26 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "manufacturer-statistics-departure-airport" || strtolower($current_page) == "manufacturer-statistics-departure-airport-country" || strtolower($current_page) == "manufacturer-statistics-arrival-airport" || strtolower($current_page) == "manufacturer-statistics-arrival-airport-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
26 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "manufacturer-statistics-departure-airport" || strtolower($current_page) == "manufacturer-statistics-departure-airport-country" || strtolower($current_page) == "manufacturer-statistics-arrival-airport" || strtolower($current_page) == "manufacturer-statistics-arrival-airport-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
27 | 27 | <?php echo _("Airport"); ?> <span class="caret"></span> |
28 | 28 | </a> |
29 | 29 | <ul class="dropdown-menu" role="menu"> |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | <li><a href="<?php print $globalURL; ?>/manufacturer/statistics/arrival-airport-country/<?php print $manufacturer; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
34 | 34 | </ul> |
35 | 35 | </li> |
36 | - <li><a href="<?php print $globalURL; ?>/manufacturer/statistics/route/<?php print $manufacturer; ?>" <?php if (strtolower($current_page) == "manufacturer-statistics-route"){ print 'class="active"'; } ?>><?php echo _("Route"); ?></a></li> |
|
37 | - <li><a href="<?php print $globalURL; ?>/manufacturer/statistics/time/<?php print $manufacturer; ?>" <?php if (strtolower($current_page) == "manufacturer-statistics-time"){ print 'class="active"'; } ?>><?php echo _("Time"); ?></a></li> |
|
36 | + <li><a href="<?php print $globalURL; ?>/manufacturer/statistics/route/<?php print $manufacturer; ?>" <?php if (strtolower($current_page) == "manufacturer-statistics-route") { print 'class="active"'; } ?>><?php echo _("Route"); ?></a></li> |
|
37 | + <li><a href="<?php print $globalURL; ?>/manufacturer/statistics/time/<?php print $manufacturer; ?>" <?php if (strtolower($current_page) == "manufacturer-statistics-time") { print 'class="active"'; } ?>><?php echo _("Time"); ?></a></li> |
|
38 | 38 | </ul> |
39 | 39 | </div> |
40 | 40 | \ No newline at end of file |
@@ -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>'; |