@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
19 | 19 | |
20 | 20 | $spotter_array = $Spotter->getAllFlightsforSitemap(); |
21 | - foreach($spotter_array as $spotter_item) |
|
21 | + foreach ($spotter_array as $spotter_item) |
|
22 | 22 | { |
23 | 23 | $output .= '<url>'; |
24 | 24 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/flightid/'.$spotter_item['spotter_id'].'</loc>'; |
@@ -29,13 +29,13 @@ discard block |
||
29 | 29 | $output .= '</urlset>'; |
30 | 30 | |
31 | 31 | |
32 | -} else if (isset($_GET['type']) && $_GET['type'] == "aircraft"){ |
|
32 | +} else if (isset($_GET['type']) && $_GET['type'] == "aircraft") { |
|
33 | 33 | |
34 | 34 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
35 | 35 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
36 | 36 | $aircraft_types = $Stats->getAllAircraftTypes(); |
37 | 37 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
38 | - foreach($aircraft_types as $aircraft_item) |
|
38 | + foreach ($aircraft_types as $aircraft_item) |
|
39 | 39 | { |
40 | 40 | $output .= '<url>'; |
41 | 41 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/aircraft/'.urlencode($aircraft_item['aircraft_icao']).'</loc>'; |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | $output .= '</urlset>'; |
47 | 47 | |
48 | 48 | |
49 | -} else if (isset($_GET['type']) && $_GET['type'] == "registration"){ |
|
49 | +} else if (isset($_GET['type']) && $_GET['type'] == "registration") { |
|
50 | 50 | |
51 | 51 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
52 | 52 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
53 | 53 | |
54 | 54 | $aircraft_registrations = $Spotter->getAllAircraftRegistrations(); |
55 | - foreach($aircraft_registrations as $aircraft_item) |
|
55 | + foreach ($aircraft_registrations as $aircraft_item) |
|
56 | 56 | { |
57 | 57 | $output .= '<url>'; |
58 | 58 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/registration/'.urlencode($aircraft_item['registration']).'</loc>'; |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | } |
63 | 63 | $output .= '</urlset>'; |
64 | 64 | |
65 | -} else if (isset($_GET['type']) && $_GET['type'] == "airline"){ |
|
65 | +} else if (isset($_GET['type']) && $_GET['type'] == "airline") { |
|
66 | 66 | |
67 | 67 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
68 | 68 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
69 | 69 | |
70 | 70 | $airline_names = $Stats->getAllAirlineNames(); |
71 | - foreach($airline_names as $airline_item) |
|
71 | + foreach ($airline_names as $airline_item) |
|
72 | 72 | { |
73 | 73 | $output .= '<url>'; |
74 | 74 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/airline/'.urlencode($airline_item['airline_icao']).'</loc>'; |
@@ -78,14 +78,14 @@ discard block |
||
78 | 78 | } |
79 | 79 | $output .= '</urlset>'; |
80 | 80 | |
81 | -} else if (isset($_GET['type']) && $_GET['type'] == "airport"){ |
|
81 | +} else if (isset($_GET['type']) && $_GET['type'] == "airport") { |
|
82 | 82 | |
83 | 83 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
84 | 84 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
85 | 85 | |
86 | 86 | $airport_names = $Stats->getAllAirportNames(); |
87 | 87 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
88 | - foreach($airport_names as $airport_item) |
|
88 | + foreach ($airport_names as $airport_item) |
|
89 | 89 | { |
90 | 90 | $output .= '<url>'; |
91 | 91 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/airport/'.$airport_item['airport_icao'].'</loc>'; |
@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | } |
96 | 96 | $output .= '</urlset>'; |
97 | 97 | |
98 | -} else if (isset($_GET['type']) && $_GET['type'] == "manufacturer"){ |
|
98 | +} else if (isset($_GET['type']) && $_GET['type'] == "manufacturer") { |
|
99 | 99 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
100 | 100 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
101 | 101 | $manufacturer_names = $Stats->getAllManufacturers(); |
102 | 102 | if (empty($manufacturer_names)) $manufacturer_names = $Spotter->getAllManufacturers(); |
103 | - foreach($manufacturer_names as $manufacturer_item) |
|
103 | + foreach ($manufacturer_names as $manufacturer_item) |
|
104 | 104 | { |
105 | 105 | $output .= '<url>'; |
106 | 106 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/manufacturer/'.urlencode(strtolower(str_replace(" ", "-", $manufacturer_item['aircraft_manufacturer']))).'</loc>'; |
@@ -109,11 +109,11 @@ discard block |
||
109 | 109 | $output .= '</url>'; |
110 | 110 | } |
111 | 111 | $output .= '</urlset>'; |
112 | -} else if (isset($_GET['type']) && $_GET['type'] == "country"){ |
|
112 | +} else if (isset($_GET['type']) && $_GET['type'] == "country") { |
|
113 | 113 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
114 | 114 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
115 | 115 | $country_names = $Spotter->getAllCountries(); |
116 | - foreach($country_names as $country_item) |
|
116 | + foreach ($country_names as $country_item) |
|
117 | 117 | { |
118 | 118 | $output .= '<url>'; |
119 | 119 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/country/'.urlencode(strtolower(str_replace(" ", "-", $country_item['country']))).'</loc>'; |
@@ -122,11 +122,11 @@ discard block |
||
122 | 122 | $output .= '</url>'; |
123 | 123 | } |
124 | 124 | $output .= '</urlset>'; |
125 | -} else if (isset($_GET['type']) && $_GET['type'] == "ident"){ |
|
125 | +} else if (isset($_GET['type']) && $_GET['type'] == "ident") { |
|
126 | 126 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
127 | 127 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
128 | 128 | $ident_names = $Spotter->getAllIdents(); |
129 | - foreach($ident_names as $ident_item) |
|
129 | + foreach ($ident_names as $ident_item) |
|
130 | 130 | { |
131 | 131 | if (ctype_alnum($ident_item['ident'])) { |
132 | 132 | $output .= '<url>'; |
@@ -137,11 +137,11 @@ discard block |
||
137 | 137 | } |
138 | 138 | } |
139 | 139 | $output .= '</urlset>'; |
140 | -} else if (isset($_GET['type']) && $_GET['type'] == "marine-ident"){ |
|
140 | +} else if (isset($_GET['type']) && $_GET['type'] == "marine-ident") { |
|
141 | 141 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
142 | 142 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
143 | 143 | $ident_names = $Marine->getAllIdents(); |
144 | - foreach($ident_names as $ident_item) |
|
144 | + foreach ($ident_names as $ident_item) |
|
145 | 145 | { |
146 | 146 | if (ctype_alnum($ident_item['ident'])) { |
147 | 147 | $output .= '<url>'; |
@@ -152,11 +152,11 @@ discard block |
||
152 | 152 | } |
153 | 153 | } |
154 | 154 | $output .= '</urlset>'; |
155 | -} else if (isset($_GET['type']) && $_GET['type'] == "date"){ |
|
155 | +} else if (isset($_GET['type']) && $_GET['type'] == "date") { |
|
156 | 156 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
157 | 157 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
158 | 158 | $date_names = $Spotter->getAllDates(); |
159 | - foreach($date_names as $date_item) |
|
159 | + foreach ($date_names as $date_item) |
|
160 | 160 | { |
161 | 161 | $output .= '<url>'; |
162 | 162 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/date/'.date("Y-m-d", strtotime($date_item['date'])).'</loc>'; |
@@ -165,11 +165,11 @@ discard block |
||
165 | 165 | $output .= '</url>'; |
166 | 166 | } |
167 | 167 | $output .= '</urlset>'; |
168 | -} else if (isset($_GET['type']) && $_GET['type'] == "marine-date"){ |
|
168 | +} else if (isset($_GET['type']) && $_GET['type'] == "marine-date") { |
|
169 | 169 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
170 | 170 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
171 | 171 | $date_names = $Marine->getAllDates(); |
172 | - foreach($date_names as $date_item) |
|
172 | + foreach ($date_names as $date_item) |
|
173 | 173 | { |
174 | 174 | $output .= '<url>'; |
175 | 175 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/marine/date/'.date("Y-m-d", strtotime($date_item['date'])).'</loc>'; |
@@ -178,11 +178,11 @@ discard block |
||
178 | 178 | $output .= '</url>'; |
179 | 179 | } |
180 | 180 | $output .= '</urlset>'; |
181 | -} else if (isset($_GET['type']) && $_GET['type'] == "tracker-date"){ |
|
181 | +} else if (isset($_GET['type']) && $_GET['type'] == "tracker-date") { |
|
182 | 182 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
183 | 183 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
184 | 184 | $date_names = $Tracker->getAllDates(); |
185 | - foreach($date_names as $date_item) |
|
185 | + foreach ($date_names as $date_item) |
|
186 | 186 | { |
187 | 187 | $output .= '<url>'; |
188 | 188 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/tracker/date/'.date("Y-m-d", strtotime($date_item['date'])).'</loc>'; |
@@ -191,11 +191,11 @@ discard block |
||
191 | 191 | $output .= '</url>'; |
192 | 192 | } |
193 | 193 | $output .= '</urlset>'; |
194 | -} else if (isset($_GET['type']) && $_GET['type'] == "route"){ |
|
194 | +} else if (isset($_GET['type']) && $_GET['type'] == "route") { |
|
195 | 195 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
196 | 196 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
197 | 197 | $route_names = $Spotter->getAllRoutes(); |
198 | - foreach($route_names as $route_item) |
|
198 | + foreach ($route_names as $route_item) |
|
199 | 199 | { |
200 | 200 | $output .= '<url>'; |
201 | 201 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/route/'.$route_item['airport_departure_icao'].'/'.$route_item['airport_arrival_icao'].'</loc>'; |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | $output .= '</url>'; |
205 | 205 | } |
206 | 206 | $output .= '</urlset>'; |
207 | -} else if (isset($_GET['type']) && $_GET['type'] == "static"){ |
|
207 | +} else if (isset($_GET['type']) && $_GET['type'] == "static") { |
|
208 | 208 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
209 | 209 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
210 | 210 | /* STATIC PAGES */ |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | $output .= '<changefreq>daily</changefreq>'; |
323 | 323 | $output .= '</url>'; |
324 | 324 | $output .= '</urlset>'; |
325 | -} else if (isset($_GET['type']) && $_GET['type'] == "marine-static"){ |
|
325 | +} else if (isset($_GET['type']) && $_GET['type'] == "marine-static") { |
|
326 | 326 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
327 | 327 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
328 | 328 | /* STATIC PAGES */ |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | $output .= '<changefreq>daily</changefreq>'; |
349 | 349 | $output .= '</url>'; |
350 | 350 | $output .= '</urlset>'; |
351 | -} else if (isset($_GET['type']) && $_GET['type'] == "tracker-static"){ |
|
351 | +} else if (isset($_GET['type']) && $_GET['type'] == "tracker-static") { |
|
352 | 352 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
353 | 353 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
354 | 354 | /* STATIC PAGES */ |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | } else { |
20 | 20 | $title = _("Statistics").' - '._("Most common Country a flight was over"); |
21 | 21 | } |
22 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
22 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
23 | 23 | if ($airline_icao == '' && isset($globalFilter)) { |
24 | 24 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
25 | 25 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | if ($type == 'aircraft') { |
51 | - $flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name); |
|
51 | + $flightover_array = $Stats->countAllFlightOverCountries(false, $airline_icao, $filter_name); |
|
52 | 52 | } elseif ($type == 'marine') { |
53 | 53 | $flightover_array = $Marine->countAllMarineOverCountries(); |
54 | 54 | } elseif ($type == 'tracker') { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | print '<div id="chart" class="chart" width="100%"></div><script>'; |
63 | 63 | print 'var series = ['; |
64 | 64 | $flightover_data = ''; |
65 | -foreach($flightover_array as $flightover_item) |
|
65 | +foreach ($flightover_array as $flightover_item) |
|
66 | 66 | { |
67 | 67 | if ($type == 'aircraft') $flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],'; |
68 | 68 | elseif ($type == 'marine') $flightover_data .= '[ "'.$flightover_item['marine_country_iso3'].'",'.$flightover_item['marine_count'].'],'; |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | print '</thead>'; |
114 | 114 | print '<tbody>'; |
115 | 115 | $i = 1; |
116 | - array_splice($flightover_array,10); |
|
117 | - foreach($flightover_array as $flightover_item) |
|
116 | + array_splice($flightover_array, 10); |
|
117 | + foreach ($flightover_array as $flightover_item) |
|
118 | 118 | { |
119 | 119 | print '<tr>'; |
120 | 120 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | default: |
42 | 42 | throw new \Exception("bad resolution can be only one of 1,3"); |
43 | 43 | } |
44 | - register_shutdown_function(function () { |
|
44 | + register_shutdown_function(function() { |
|
45 | 45 | $this->closeAllFiles(); |
46 | 46 | }); |
47 | 47 | } |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | |
56 | 56 | private function getElevationAtPosition($fileName, $row, $column) { |
57 | 57 | if (!array_key_exists($fileName, $this->openedFiles)) { |
58 | - if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) { |
|
58 | + if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName)) { |
|
59 | 59 | throw new \Exception("File '{$fileName}' not exists."); |
60 | 60 | } |
61 | - $file = fopen($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName, "r"); |
|
61 | + $file = fopen($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName, "r"); |
|
62 | 62 | if ($file === false) { |
63 | 63 | throw new \Exception("Cant open file '{$fileName}' for reading."); |
64 | 64 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | throw new \Exception("Not implemented yet"); |
73 | 73 | } |
74 | 74 | $aRow = $this->measPerDeg - $row; |
75 | - $position = ($this->measPerDeg * ($aRow - 1)) + $column; |
|
75 | + $position = ($this->measPerDeg*($aRow - 1)) + $column; |
|
76 | 76 | $position *= 2; |
77 | 77 | fseek($file, $position); |
78 | 78 | $short = fread($file, 2); |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | $latSec = $this->getSec($lat); |
101 | 101 | $lonSec = $this->getSec($lon); |
102 | 102 | |
103 | - $Xn = round($latSec / $this->resolution, 3); |
|
104 | - $Yn = round($lonSec / $this->resolution, 3); |
|
103 | + $Xn = round($latSec/$this->resolution, 3); |
|
104 | + $Yn = round($lonSec/$this->resolution, 3); |
|
105 | 105 | |
106 | 106 | $a1 = round($Xn); |
107 | 107 | $a2 = round($Yn); |
@@ -133,55 +133,55 @@ discard block |
||
133 | 133 | $b3 = $this->getElevationAtPosition($fName, $b1, $b2); |
134 | 134 | $c3 = $this->getElevationAtPosition($fName, $c1, $c2); |
135 | 135 | |
136 | - $n1 = ($c2 - $a2) * ($b3 - $a3) - ($c3 - $a3) * ($b2 - $a2); |
|
137 | - $n2 = ($c3 - $a3) * ($b1 - $a1) - ($c1 - $a1) * ($b3 - $a3); |
|
138 | - $n3 = ($c1 - $a1) * ($b2 - $a2) - ($c2 - $a2) * ($b1 - $a1); |
|
136 | + $n1 = ($c2 - $a2)*($b3 - $a3) - ($c3 - $a3)*($b2 - $a2); |
|
137 | + $n2 = ($c3 - $a3)*($b1 - $a1) - ($c1 - $a1)*($b3 - $a3); |
|
138 | + $n3 = ($c1 - $a1)*($b2 - $a2) - ($c2 - $a2)*($b1 - $a1); |
|
139 | 139 | |
140 | - $d = -$n1 * $a1 - $n2 * $a2 - $n3 * $a3; |
|
141 | - $zN = (-$n1 * $Xn - $n2 * $Yn - $d) / $n3; |
|
140 | + $d = -$n1*$a1 - $n2*$a2 - $n3*$a3; |
|
141 | + $zN = (-$n1*$Xn - $n2*$Yn - $d)/$n3; |
|
142 | 142 | |
143 | 143 | return $zN; |
144 | 144 | } |
145 | 145 | |
146 | 146 | private function getDeg($deg, $numPrefix) { |
147 | 147 | $deg = abs($deg); |
148 | - $d = floor($deg); // round degrees |
|
148 | + $d = floor($deg); // round degrees |
|
149 | 149 | if ($numPrefix >= 3) { |
150 | 150 | if ($d < 100) { |
151 | - $d = '0' . $d; |
|
151 | + $d = '0'.$d; |
|
152 | 152 | } |
153 | 153 | } // pad with leading zeros |
154 | 154 | if ($d < 10) { |
155 | - $d = '0' . $d; |
|
155 | + $d = '0'.$d; |
|
156 | 156 | } |
157 | 157 | return $d; |
158 | 158 | } |
159 | 159 | |
160 | 160 | private function getSec($deg) { |
161 | 161 | $deg = abs($deg); |
162 | - $sec = round($deg * 3600, 4); |
|
163 | - $m = fmod(floor($sec / 60), 60); |
|
162 | + $sec = round($deg*3600, 4); |
|
163 | + $m = fmod(floor($sec/60), 60); |
|
164 | 164 | $s = round(fmod($sec, 60), 4); |
165 | - return ($m * 60) + $s; |
|
165 | + return ($m*60) + $s; |
|
166 | 166 | } |
167 | 167 | |
168 | - public function download($lat,$lon, $debug = false) { |
|
168 | + public function download($lat, $lon, $debug = false) { |
|
169 | 169 | $N = $this->getDeg($lat, 2); |
170 | 170 | $E = $this->getDeg($lon, 3); |
171 | - $fileName = "N{$N}E{$E}.hgt"; |
|
172 | - if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) { |
|
171 | + $fileName = "N{$N}E{$E}.hgt"; |
|
172 | + if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName)) { |
|
173 | 173 | $Common = new Common(); |
174 | 174 | if ($debug) echo 'Downloading '.$fileName.'.gz ...'; |
175 | - $Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz'); |
|
176 | - if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz')) { |
|
175 | + $Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz', $this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz'); |
|
176 | + if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz')) { |
|
177 | 177 | if ($debug) echo "File '{$fileName}.gz' not exists."; |
178 | 178 | return false; |
179 | 179 | } |
180 | 180 | if ($debug) echo 'Done'."\n"; |
181 | 181 | if ($debug) echo 'Decompress '.$fileName.' ....'; |
182 | - $Common->gunzip($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName); |
|
182 | + $Common->gunzip($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz', $this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName); |
|
183 | 183 | if ($debug) echo 'Done'."\n"; |
184 | - unlink($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz'); |
|
184 | + unlink($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz'); |
|
185 | 185 | } |
186 | 186 | return true; |
187 | 187 | } |
@@ -194,22 +194,22 @@ discard block |
||
194 | 194 | try { |
195 | 195 | $sth = $db->prepare($query); |
196 | 196 | $sth->execute($query_values); |
197 | - } catch(PDOException $e) { |
|
197 | + } catch (PDOException $e) { |
|
198 | 198 | return "error : ".$e->getMessage(); |
199 | 199 | } |
200 | 200 | while ($data = $sth->fetch(PDO::FETCH_ASSOC)) { |
201 | - $this->download($data['latitude'],$data['longitude'],true); |
|
201 | + $this->download($data['latitude'], $data['longitude'], true); |
|
202 | 202 | } |
203 | 203 | $query = 'SELECT latitude, longitude FROM tracker_output WHERE latitude <> 0 AND longitude <> 0 ORDER BY date DESC LIMIT 10'; |
204 | 204 | $query_values = array(); |
205 | 205 | try { |
206 | 206 | $sth = $db->prepare($query); |
207 | 207 | $sth->execute($query_values); |
208 | - } catch(PDOException $e) { |
|
208 | + } catch (PDOException $e) { |
|
209 | 209 | return "error : ".$e->getMessage(); |
210 | 210 | } |
211 | 211 | while ($data = $sth->fetch(PDO::FETCH_ASSOC)) { |
212 | - $this->download($data['latitude'],$data['longitude'],true); |
|
212 | + $this->download($data['latitude'], $data['longitude'], true); |
|
213 | 213 | } |
214 | 214 | } |
215 | 215 | } |
@@ -7,18 +7,18 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
11 | -$owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING)); |
|
12 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
13 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
11 | +$owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING)); |
|
12 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
13 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
14 | 14 | $filter = array(); |
15 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
16 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | -$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
|
15 | +if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
16 | +if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
17 | +$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
18 | 18 | |
19 | 19 | if (!empty($spotter_array)) |
20 | 20 | { |
21 | - $title = sprintf(_("Most Common Departure Airports by Owner of %s"),$spotter_array[0]['aircraft_owner']); |
|
21 | + $title = sprintf(_("Most Common Departure Airports by Owner of %s"), $spotter_array[0]['aircraft_owner']); |
|
22 | 22 | require_once('header.php'); |
23 | 23 | print '<div class="info column">'; |
24 | 24 | print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>'; |
@@ -28,16 +28,16 @@ discard block |
||
28 | 28 | include('owner-sub-menu.php'); |
29 | 29 | print '<div class="column">'; |
30 | 30 | print '<h2>'._("Most Common Departure Airports by Country").'</h2>'; |
31 | - print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>'; |
|
31 | + print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>'; |
|
32 | 32 | |
33 | - $airport_country_array = $Spotter->countAllDepartureAirportCountriesByOwner($owner,$filter); |
|
33 | + $airport_country_array = $Spotter->countAllDepartureAirportCountriesByOwner($owner, $filter); |
|
34 | 34 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
35 | 35 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
36 | 36 | print '<script type="text/javascript" src="'.$globalURL.'/js/datamaps.world.min.js"></script>'; |
37 | 37 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
38 | 38 | print 'var series = ['; |
39 | 39 | $country_data = ''; |
40 | - foreach($airport_country_array as $airport_item) |
|
40 | + foreach ($airport_country_array as $airport_item) |
|
41 | 41 | { |
42 | 42 | $country_data .= '[ "'.$airport_item['airport_departure_country_iso3'].'",'.$airport_item['airport_departure_country_count'].'],'; |
43 | 43 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | print '</thead>'; |
85 | 85 | print '<tbody>'; |
86 | 86 | $i = 1; |
87 | - foreach($airport_country_array as $airport_item) |
|
87 | + foreach ($airport_country_array as $airport_item) |
|
88 | 88 | { |
89 | 89 | print '<tr>'; |
90 | 90 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,21 +7,21 @@ discard block |
||
7 | 7 | header('Location: '.$globalURL.'/airline'); |
8 | 8 | die(); |
9 | 9 | } |
10 | -$airline = urldecode(filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING)); |
|
10 | +$airline = urldecode(filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING)); |
|
11 | 11 | $Spotter = new Spotter(); |
12 | 12 | $alliance = false; |
13 | -if (strpos($airline,'alliance_') !== FALSE) { |
|
13 | +if (strpos($airline, 'alliance_') !== FALSE) { |
|
14 | 14 | $alliance = true; |
15 | 15 | } else { |
16 | - $spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1",""); |
|
16 | + $spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", ""); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | if (!empty($spotter_array) || $alliance === true) |
20 | 20 | { |
21 | 21 | if ($alliance) { |
22 | - $title = sprintf(_("Most Common Routes from %s"),str_replace('_',' ',str_replace('alliance_','',$airline))); |
|
22 | + $title = sprintf(_("Most Common Routes from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline))); |
|
23 | 23 | } else { |
24 | - $title = sprintf(_("Most Common Routes from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']); |
|
24 | + $title = sprintf(_("Most Common Routes from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']); |
|
25 | 25 | } |
26 | 26 | require_once('header.php'); |
27 | 27 | print '<div class="select-item">'; |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | $alliances = $Spotter->getAllAllianceNames(); |
32 | 32 | if (!empty($alliances)) { |
33 | 33 | foreach ($alliances as $al) { |
34 | - if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) { |
|
35 | - print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>'; |
|
34 | + if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) { |
|
35 | + print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>'; |
|
36 | 36 | } else { |
37 | - print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>'; |
|
37 | + print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>'; |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | print '<option disabled>───────────────────</option>'; |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | $Stats = new Stats(); |
43 | 43 | $airline_names = $Stats->getAllAirlineNames(); |
44 | 44 | if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
45 | - foreach($airline_names as $airline_name) |
|
45 | + foreach ($airline_names as $airline_name) |
|
46 | 46 | { |
47 | - if($airline == $airline_name['airline_icao']) |
|
47 | + if ($airline == $airline_name['airline_icao']) |
|
48 | 48 | { |
49 | 49 | print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>'; |
50 | 50 | } else { |
@@ -78,12 +78,12 @@ discard block |
||
78 | 78 | print '</div>'; |
79 | 79 | } else { |
80 | 80 | print '<div class="info column">'; |
81 | - print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>'; |
|
82 | - if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png')) |
|
81 | + print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>'; |
|
82 | + if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png')) |
|
83 | 83 | { |
84 | - print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />'; |
|
84 | + print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />'; |
|
85 | 85 | } |
86 | - print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>'; |
|
86 | + print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>'; |
|
87 | 87 | print '</div>'; |
88 | 88 | } |
89 | 89 | } else { |
@@ -94,12 +94,12 @@ discard block |
||
94 | 94 | print '<div class="column">'; |
95 | 95 | print '<h2>'._("Most Common Routes").'</h2>'; |
96 | 96 | if ($alliance) { |
97 | - print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>'; |
|
97 | + print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>'; |
|
98 | 98 | } else { |
99 | - print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>'; |
|
99 | + print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>'; |
|
100 | 100 | } |
101 | 101 | if ($alliance) { |
102 | - $route_array = $Spotter->countAllRoutesByAirline('',array('alliance' => str_replace('_',' ',str_replace('alliance_','',$airline)))); |
|
102 | + $route_array = $Spotter->countAllRoutesByAirline('', array('alliance' => str_replace('_', ' ', str_replace('alliance_', '', $airline)))); |
|
103 | 103 | } else { |
104 | 104 | $route_array = $Spotter->countAllRoutesByAirline($airline); |
105 | 105 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | print '</thead>'; |
118 | 118 | print '<tbody>'; |
119 | 119 | $i = 1; |
120 | - foreach($route_array as $route_item) |
|
120 | + foreach ($route_array as $route_item) |
|
121 | 121 | { |
122 | 122 | print '<tr>'; |
123 | 123 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)))); |
|
11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
10 | +$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING)))); |
|
11 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
12 | 12 | if (isset($_GET['sort'])) { |
13 | 13 | $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort); |
14 | 14 | } else { |
@@ -17,16 +17,16 @@ discard block |
||
17 | 17 | |
18 | 18 | if (!empty($spotter_array)) |
19 | 19 | { |
20 | - $title = sprintf(_("Most Common Aircraft by registration from %s"),$country); |
|
20 | + $title = sprintf(_("Most Common Aircraft by registration from %s"), $country); |
|
21 | 21 | require_once('header.php'); |
22 | 22 | print '<div class="select-item">'; |
23 | 23 | print '<form action="'.$globalURL.'/country" method="post">'; |
24 | 24 | print '<select name="country" class="selectpicker" data-live-search="true">'; |
25 | 25 | print '<option></option>'; |
26 | 26 | $all_countries = $Spotter->getAllCountries(); |
27 | - foreach($all_countries as $all_country) |
|
27 | + foreach ($all_countries as $all_country) |
|
28 | 28 | { |
29 | - if($country == $all_country['country']) |
|
29 | + if ($country == $all_country['country']) |
|
30 | 30 | { |
31 | 31 | print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; |
32 | 32 | } else { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | if ($_GET['country'] != "NA") |
42 | 42 | { |
43 | 43 | print '<div class="info column">'; |
44 | - print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; |
|
44 | + print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; |
|
45 | 45 | print '</div>'; |
46 | 46 | } else { |
47 | 47 | print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>'; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | include('country-sub-menu.php'); |
51 | 51 | print '<div class="column">'; |
52 | 52 | print '<h2>'._("Most Common Aircraft by Registration").'</h2>'; |
53 | - print '<p>'.sprintf(_("The statistic below shows the most common aircraft by registration of airlines or departure/arrival airports from <strong>%s</strong>."),$country).'</p>'; |
|
53 | + print '<p>'.sprintf(_("The statistic below shows the most common aircraft by registration of airlines or departure/arrival airports from <strong>%s</strong>."), $country).'</p>'; |
|
54 | 54 | $aircraft_array = $Spotter->countAllAircraftRegistrationByCountry($country); |
55 | 55 | if (!empty($aircraft_array)) |
56 | 56 | { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | print '</thead>'; |
66 | 66 | print '<tbody>'; |
67 | 67 | $i = 1; |
68 | - foreach($aircraft_array as $aircraft_item) |
|
68 | + foreach ($aircraft_array as $aircraft_item) |
|
69 | 69 | { |
70 | 70 | print '<tr>'; |
71 | 71 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | </span> |
16 | 16 | <div class="sub-menu sub-menu-container"> |
17 | 17 | <ul class="nav nav-pills"> |
18 | - <li><a href="<?php print $globalURL; ?>/registration/<?php print $_GET['registration']; ?>" <?php if (strtolower($current_page) == "registration-detailed"){ print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li> |
|
18 | + <li><a href="<?php print $globalURL; ?>/registration/<?php print $_GET['registration']; ?>" <?php if (strtolower($current_page) == "registration-detailed") { print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li> |
|
19 | 19 | <li class="dropdown"> |
20 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "registration-statistics-departure-airport" || strtolower($current_page) == "registration-statistics-departure-airport-country" || strtolower($current_page) == "registration-statistics-arrival-airport" || strtolower($current_page) == "registration-statistics-arrival-airport-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
20 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "registration-statistics-departure-airport" || strtolower($current_page) == "registration-statistics-departure-airport-country" || strtolower($current_page) == "registration-statistics-arrival-airport" || strtolower($current_page) == "registration-statistics-arrival-airport-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
21 | 21 | <?php _("Airport"); ?> <span class="caret"></span> |
22 | 22 | </a> |
23 | 23 | <ul class="dropdown-menu" role="menu"> |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | <li><a href="<?php print $globalURL; ?>/registration/statistics/arrival-airport-country/<?php print $registration; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
28 | 28 | </ul> |
29 | 29 | </li> |
30 | - <li><a href="<?php print $globalURL; ?>/registration/statistics/route/<?php print $registration; ?>" <?php if (strtolower($current_page) == "registration-statistics-route"){ print 'class="active"'; } ?>><?php echo _("Route"); ?></a></li> |
|
31 | - <li><a href="<?php print $globalURL; ?>/registration/statistics/time/<?php print $registration; ?>" <?php if (strtolower($current_page) == "registration-statistics-time"){ print 'class="active"'; } ?>><?php echo _("Time"); ?></a></li> |
|
30 | + <li><a href="<?php print $globalURL; ?>/registration/statistics/route/<?php print $registration; ?>" <?php if (strtolower($current_page) == "registration-statistics-route") { print 'class="active"'; } ?>><?php echo _("Route"); ?></a></li> |
|
31 | + <li><a href="<?php print $globalURL; ?>/registration/statistics/time/<?php print $registration; ?>" <?php if (strtolower($current_page) == "registration-statistics-time") { print 'class="active"'; } ?>><?php echo _("Time"); ?></a></li> |
|
32 | 32 | </ul> |
33 | 33 | </div> |
34 | 34 | \ No newline at end of file |
@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)))); |
|
11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
10 | +$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING)))); |
|
11 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
12 | 12 | |
13 | 13 | if (isset($_GET['sort'])) { |
14 | 14 | $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort); |
@@ -18,16 +18,16 @@ discard block |
||
18 | 18 | |
19 | 19 | if (!empty($spotter_array)) |
20 | 20 | { |
21 | - $title = sprintf(_("Most Common Departure Airports from %s"),$country); |
|
21 | + $title = sprintf(_("Most Common Departure Airports from %s"), $country); |
|
22 | 22 | require_once('header.php'); |
23 | 23 | print '<div class="select-item">'; |
24 | 24 | print '<form action="'.$globalURL.'/country" method="post">'; |
25 | 25 | print '<select name="country" class="selectpicker" data-live-search="true">'; |
26 | 26 | print '<option></option>'; |
27 | 27 | $all_countries = $Spotter->getAllCountries(); |
28 | - foreach($all_countries as $all_country) |
|
28 | + foreach ($all_countries as $all_country) |
|
29 | 29 | { |
30 | - if($country == $all_country['country']) |
|
30 | + if ($country == $all_country['country']) |
|
31 | 31 | { |
32 | 32 | print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; |
33 | 33 | } else { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | if ($_GET['country'] != "NA") |
42 | 42 | { |
43 | 43 | print '<div class="info column">'; |
44 | - print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; |
|
44 | + print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; |
|
45 | 45 | print '</div>'; |
46 | 46 | } else { |
47 | 47 | print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>'; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | include('country-sub-menu.php'); |
51 | 51 | print '<div class="column">'; |
52 | 52 | print '<h2>'._("Most Common Departure Airports").'</h2>'; |
53 | - print '<p>'.sprintf(_("The statistic below shows all departure airports of flights of airports & airlines from <strong>%s</strong>."),$country).'</p>'; |
|
53 | + print '<p>'.sprintf(_("The statistic below shows all departure airports of flights of airports & airlines from <strong>%s</strong>."), $country).'</p>'; |
|
54 | 54 | |
55 | 55 | $airport_airport_array = $Spotter->countAllDepartureAirportsByCountry($country); |
56 | 56 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | print '<script>'; |
61 | 61 | print 'var series = ['; |
62 | 62 | $airport_data = ''; |
63 | - foreach($airport_airport_array as $airport_item) |
|
63 | + foreach ($airport_airport_array as $airport_item) |
|
64 | 64 | { |
65 | 65 | $airport_data .= '[ "'.$airport_item['airport_departure_icao_count'].'", "'.$airport_item['airport_departure_icao'].'",'.$airport_item['airport_departure_latitude'].','.$airport_item['airport_departure_longitude'].'],'; |
66 | 66 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | print '</thead>'; |
115 | 115 | print '<tbody>'; |
116 | 116 | $i = 1; |
117 | - foreach($airport_airport_array as $airport_item) |
|
117 | + foreach ($airport_airport_array as $airport_item) |
|
118 | 118 | { |
119 | 119 | print '<tr>'; |
120 | 120 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -8,13 +8,13 @@ discard block |
||
8 | 8 | die(); |
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | -$manufacturer = ucwords(str_replace("-", " ", urldecode(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("-", " ", urldecode(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 from %s"),$manufacturer); |
|
17 | + $title = sprintf(_("Most Common Departure Airports 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").'</h2>'; |
47 | - print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s</strong>."),$manufacturer).'</p>'; |
|
47 | + print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s</strong>."), $manufacturer).'</p>'; |
|
48 | 48 | $airport_airport_array = $Spotter->countAllDepartureAirportsByManufacturer($manufacturer); |
49 | 49 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
50 | 50 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | print '<script>'; |
54 | 54 | print 'var series = ['; |
55 | 55 | $airport_data = ''; |
56 | - foreach($airport_airport_array as $airport_item) |
|
56 | + foreach ($airport_airport_array as $airport_item) |
|
57 | 57 | { |
58 | 58 | $airport_data .= '[ "'.$airport_item['airport_departure_icao_count'].'", "'.$airport_item['airport_departure_icao'].'",'.$airport_item['airport_departure_latitude'].','.$airport_item['airport_departure_longitude'].'],'; |
59 | 59 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | print '</thead>'; |
109 | 109 | print '<tbody>'; |
110 | 110 | $i = 1; |
111 | - foreach($airport_airport_array as $airport_item) |
|
111 | + foreach ($airport_airport_array as $airport_item) |
|
112 | 112 | { |
113 | 113 | print '<tr>'; |
114 | 114 | print '<td><strong>'.$i.'</strong></td>'; |