@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['country'])) { |
6 | - header('Location: '.$globalURL.'/country'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/country'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | $country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | include('country-sub-menu.php'); |
52 | 52 | print '<div class="column">'; |
53 | 53 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
54 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports & airlines from <strong>%s</strong>."),$country).'</p>'; |
|
54 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports & airlines from <strong>%s</strong>."),$country).'</p>'; |
|
55 | 55 | |
56 | 56 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByCountry($country); |
57 | 57 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -12,11 +12,11 @@ discard block |
||
12 | 12 | } |
13 | 13 | |
14 | 14 | /** |
15 | - * Gets the images based on the aircraft registration |
|
16 | - * |
|
17 | - * @return Array the images list |
|
18 | - * |
|
19 | - */ |
|
15 | + * Gets the images based on the aircraft registration |
|
16 | + * |
|
17 | + * @return Array the images list |
|
18 | + * |
|
19 | + */ |
|
20 | 20 | public function getSpotterImage($registration,$aircraft_icao = '', $airline_icao = '') |
21 | 21 | { |
22 | 22 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
39 | - * Gets the image copyright based on the Exif data |
|
40 | - * |
|
41 | - * @return String image copyright |
|
42 | - * |
|
43 | - */ |
|
39 | + * Gets the image copyright based on the Exif data |
|
40 | + * |
|
41 | + * @return String image copyright |
|
42 | + * |
|
43 | + */ |
|
44 | 44 | public function getExifCopyright($url) { |
45 | 45 | $exif = exif_read_data($url); |
46 | 46 | $copyright = ''; |
@@ -55,11 +55,11 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
58 | - * Adds the images based on the aircraft registration |
|
59 | - * |
|
60 | - * @return String either success or error |
|
61 | - * |
|
62 | - */ |
|
58 | + * Adds the images based on the aircraft registration |
|
59 | + * |
|
60 | + * @return String either success or error |
|
61 | + * |
|
62 | + */ |
|
63 | 63 | public function addSpotterImage($registration,$aircraft_icao = '', $airline_icao = '') |
64 | 64 | { |
65 | 65 | global $globalDebug,$globalAircraftImageFetch; |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
91 | - * Gets the aircraft image |
|
92 | - * |
|
93 | - * @param String $aircraft_registration the registration of the aircraft |
|
94 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
95 | - * |
|
96 | - */ |
|
91 | + * Gets the aircraft image |
|
92 | + * |
|
93 | + * @param String $aircraft_registration the registration of the aircraft |
|
94 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
95 | + * |
|
96 | + */ |
|
97 | 97 | public function findAircraftImage($aircraft_registration, $aircraft_icao = '', $airline_icao = '') |
98 | 98 | { |
99 | 99 | global $globalAircraftImageSources, $globalIVAO, $globalAircraftImageCheckICAO; |
@@ -136,13 +136,13 @@ discard block |
||
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
139 | - * Gets the aircraft image from Planespotters |
|
140 | - * |
|
141 | - * @param String $aircraft_registration the registration of the aircraft |
|
142 | - * @param String $aircraft_name type of the aircraft |
|
143 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
144 | - * |
|
145 | - */ |
|
139 | + * Gets the aircraft image from Planespotters |
|
140 | + * |
|
141 | + * @param String $aircraft_registration the registration of the aircraft |
|
142 | + * @param String $aircraft_name type of the aircraft |
|
143 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
144 | + * |
|
145 | + */ |
|
146 | 146 | public function fromPlanespotters($aircraft_registration, $aircraft_name='') { |
147 | 147 | $Common = new Common(); |
148 | 148 | // If aircraft registration is only number, also check with aircraft model |
@@ -169,13 +169,13 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
172 | - * Gets the aircraft image from Deviantart |
|
173 | - * |
|
174 | - * @param String $aircraft_registration the registration of the aircraft |
|
175 | - * @param String $aircraft_name type of the aircraft |
|
176 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
177 | - * |
|
178 | - */ |
|
172 | + * Gets the aircraft image from Deviantart |
|
173 | + * |
|
174 | + * @param String $aircraft_registration the registration of the aircraft |
|
175 | + * @param String $aircraft_name type of the aircraft |
|
176 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
177 | + * |
|
178 | + */ |
|
179 | 179 | public function fromDeviantart($aircraft_registration, $aircraft_name='') { |
180 | 180 | $Common = new Common(); |
181 | 181 | // If aircraft registration is only number, also check with aircraft model |
@@ -203,13 +203,13 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | /** |
206 | - * Gets the aircraft image from JetPhotos |
|
207 | - * |
|
208 | - * @param String $aircraft_registration the registration of the aircraft |
|
209 | - * @param String $aircraft_name type of the aircraft |
|
210 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
211 | - * |
|
212 | - */ |
|
206 | + * Gets the aircraft image from JetPhotos |
|
207 | + * |
|
208 | + * @param String $aircraft_registration the registration of the aircraft |
|
209 | + * @param String $aircraft_name type of the aircraft |
|
210 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
211 | + * |
|
212 | + */ |
|
213 | 213 | public function fromJetPhotos($aircraft_registration, $aircraft_name='') { |
214 | 214 | $Common = new Common(); |
215 | 215 | $url= 'http://jetphotos.net/showphotos.php?displaymode=2®search='.$aircraft_registration; |
@@ -245,13 +245,13 @@ discard block |
||
245 | 245 | } |
246 | 246 | |
247 | 247 | /** |
248 | - * Gets the aircraft image from PlanePictures |
|
249 | - * |
|
250 | - * @param String $aircraft_registration the registration of the aircraft |
|
251 | - * @param String $aircraft_name type of the aircraft |
|
252 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
253 | - * |
|
254 | - */ |
|
248 | + * Gets the aircraft image from PlanePictures |
|
249 | + * |
|
250 | + * @param String $aircraft_registration the registration of the aircraft |
|
251 | + * @param String $aircraft_name type of the aircraft |
|
252 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
253 | + * |
|
254 | + */ |
|
255 | 255 | public function fromPlanePictures($aircraft_registration, $aircraft_name='') { |
256 | 256 | $Common = new Common(); |
257 | 257 | $url= 'http://www.planepictures.net/netsearch4.cgi?srch='.$aircraft_registration.'&stype=reg&srng=2'; |
@@ -279,13 +279,13 @@ discard block |
||
279 | 279 | } |
280 | 280 | |
281 | 281 | /** |
282 | - * Gets the aircraft image from Flickr |
|
283 | - * |
|
284 | - * @param String $aircraft_registration the registration of the aircraft |
|
285 | - * @param String $aircraft_name type of the aircraft |
|
286 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
287 | - * |
|
288 | - */ |
|
282 | + * Gets the aircraft image from Flickr |
|
283 | + * |
|
284 | + * @param String $aircraft_registration the registration of the aircraft |
|
285 | + * @param String $aircraft_name type of the aircraft |
|
286 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
287 | + * |
|
288 | + */ |
|
289 | 289 | public function fromFlickr($aircraft_registration,$aircraft_name='') { |
290 | 290 | $Common = new Common(); |
291 | 291 | if ($aircraft_name != '') $url = 'https://api.flickr.com/services/feeds/photos_public.gne?format=rss2&license=1,2,3,4,5,6,7&per_page=1&tags='.$aircraft_registration.','.urlencode($aircraft_name); |
@@ -323,13 +323,13 @@ discard block |
||
323 | 323 | } |
324 | 324 | |
325 | 325 | /** |
326 | - * Gets the aircraft image from Bing |
|
327 | - * |
|
328 | - * @param String $aircraft_registration the registration of the aircraft |
|
329 | - * @param String $aircraft_name type of the aircraft |
|
330 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
331 | - * |
|
332 | - */ |
|
326 | + * Gets the aircraft image from Bing |
|
327 | + * |
|
328 | + * @param String $aircraft_registration the registration of the aircraft |
|
329 | + * @param String $aircraft_name type of the aircraft |
|
330 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
331 | + * |
|
332 | + */ |
|
333 | 333 | public function fromBing($aircraft_registration,$aircraft_name='') { |
334 | 334 | global $globalImageBingKey; |
335 | 335 | $Common = new Common(); |
@@ -355,13 +355,13 @@ discard block |
||
355 | 355 | } |
356 | 356 | |
357 | 357 | /** |
358 | - * Gets the aircraft image from airport-data |
|
359 | - * |
|
360 | - * @param String $aircraft_registration the registration of the aircraft |
|
361 | - * @param String $aircraft_name type of the aircraft |
|
362 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
363 | - * |
|
364 | - */ |
|
358 | + * Gets the aircraft image from airport-data |
|
359 | + * |
|
360 | + * @param String $aircraft_registration the registration of the aircraft |
|
361 | + * @param String $aircraft_name type of the aircraft |
|
362 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
363 | + * |
|
364 | + */ |
|
365 | 365 | public function fromAirportData($aircraft_registration,$aircraft_name='') { |
366 | 366 | $Common = new Common(); |
367 | 367 | $url = 'http://www.airport-data.com/api/ac_thumb.json?&n=1&r='.$aircraft_registration; |
@@ -380,13 +380,13 @@ discard block |
||
380 | 380 | } |
381 | 381 | |
382 | 382 | /** |
383 | - * Gets the aircraft image from WikiMedia |
|
384 | - * |
|
385 | - * @param String $aircraft_registration the registration of the aircraft |
|
386 | - * @param String $aircraft_name type of the aircraft |
|
387 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
388 | - * |
|
389 | - */ |
|
383 | + * Gets the aircraft image from WikiMedia |
|
384 | + * |
|
385 | + * @param String $aircraft_registration the registration of the aircraft |
|
386 | + * @param String $aircraft_name type of the aircraft |
|
387 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
388 | + * |
|
389 | + */ |
|
390 | 390 | public function fromWikimedia($aircraft_registration,$aircraft_name='') { |
391 | 391 | $Common = new Common(); |
392 | 392 | if ($aircraft_name != '') $url = 'https://commons.wikimedia.org/w/api.php?action=query&list=search&format=json&srlimit=1&srnamespace=6&continue&srsearch="'.$aircraft_registration.'"%20'.urlencode($aircraft_name); |
@@ -436,13 +436,13 @@ discard block |
||
436 | 436 | } |
437 | 437 | |
438 | 438 | /** |
439 | - * Gets the aircraft image from custom url |
|
440 | - * |
|
441 | - * @param String $aircraft_registration the registration of the aircraft |
|
442 | - * @param String $aircraft_name type of the aircraft |
|
443 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
444 | - * |
|
445 | - */ |
|
439 | + * Gets the aircraft image from custom url |
|
440 | + * |
|
441 | + * @param String $aircraft_registration the registration of the aircraft |
|
442 | + * @param String $aircraft_name type of the aircraft |
|
443 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
444 | + * |
|
445 | + */ |
|
446 | 446 | public function fromCustomSource($aircraft_registration,$aircraft_name='') { |
447 | 447 | global $globalAircraftImageCustomSources, $globalDebug; |
448 | 448 | //$globalAircraftImageCustomSource[] = array('thumbnail' => '','original' => '', 'copyright' => '', 'source_website' => '', 'source' => '','exif' => true); |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | //protected $cookies = array(); |
8 | 8 | |
9 | 9 | /** |
10 | - * Get data from form result |
|
11 | - * @param String $url form URL |
|
12 | - * @param String $type type of submit form method (get or post) |
|
13 | - * @param String|Array $data values form post method |
|
14 | - * @param Array $headers header to submit with the form |
|
15 | - * @return String the result |
|
16 | - */ |
|
10 | + * Get data from form result |
|
11 | + * @param String $url form URL |
|
12 | + * @param String $type type of submit form method (get or post) |
|
13 | + * @param String|Array $data values form post method |
|
14 | + * @param Array $headers header to submit with the form |
|
15 | + * @return String the result |
|
16 | + */ |
|
17 | 17 | public function getData($url, $type = 'get', $data = '', $headers = '',$cookie = '',$referer = '',$timeout = '',$useragent = '') { |
18 | 18 | global $globalProxy, $globalForceIPv4; |
19 | 19 | $ch = curl_init(); |
@@ -107,10 +107,10 @@ discard block |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
110 | - * Convert a HTML table to an array |
|
111 | - * @param String $data HTML page |
|
112 | - * @return Array array of the tables in HTML page |
|
113 | - */ |
|
110 | + * Convert a HTML table to an array |
|
111 | + * @param String $data HTML page |
|
112 | + * @return Array array of the tables in HTML page |
|
113 | + */ |
|
114 | 114 | public function table2array($data) { |
115 | 115 | if (!is_string($data)) return array(); |
116 | 116 | if ($data == '') return array(); |
@@ -144,10 +144,10 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
147 | - * Convert <p> part of a HTML page to an array |
|
148 | - * @param String $data HTML page |
|
149 | - * @return Array array of the <p> in HTML page |
|
150 | - */ |
|
147 | + * Convert <p> part of a HTML page to an array |
|
148 | + * @param String $data HTML page |
|
149 | + * @return Array array of the <p> in HTML page |
|
150 | + */ |
|
151 | 151 | public function text2array($data) { |
152 | 152 | $html = str_get_html($data); |
153 | 153 | if ($html === false) return array(); |
@@ -162,14 +162,14 @@ discard block |
||
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
165 | - * Give distance between 2 coordonnates |
|
166 | - * @param Float $lat latitude of first point |
|
167 | - * @param Float $lon longitude of first point |
|
168 | - * @param Float $latc latitude of second point |
|
169 | - * @param Float $lonc longitude of second point |
|
170 | - * @param String $unit km else no unit used |
|
171 | - * @return Float Distance in $unit |
|
172 | - */ |
|
165 | + * Give distance between 2 coordonnates |
|
166 | + * @param Float $lat latitude of first point |
|
167 | + * @param Float $lon longitude of first point |
|
168 | + * @param Float $latc latitude of second point |
|
169 | + * @param Float $lonc longitude of second point |
|
170 | + * @param String $unit km else no unit used |
|
171 | + * @return Float Distance in $unit |
|
172 | + */ |
|
173 | 173 | public function distance($lat, $lon, $latc, $lonc, $unit = 'km') { |
174 | 174 | if ($lat == $latc && $lon == $lonc) return 0; |
175 | 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; |
@@ -187,11 +187,11 @@ discard block |
||
187 | 187 | } |
188 | 188 | |
189 | 189 | /** |
190 | - * Check is distance realistic |
|
191 | - * @param int $timeDifference the time between the reception of both messages |
|
192 | - * @param float $distance distance covered |
|
193 | - * @return whether distance is realistic |
|
194 | - */ |
|
190 | + * Check is distance realistic |
|
191 | + * @param int $timeDifference the time between the reception of both messages |
|
192 | + * @param float $distance distance covered |
|
193 | + * @return whether distance is realistic |
|
194 | + */ |
|
195 | 195 | public function withinThreshold ($timeDifference, $distance) { |
196 | 196 | $x = abs($timeDifference); |
197 | 197 | $d = abs($distance); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | } |
210 | 210 | |
211 | 211 | public function isInteger($input){ |
212 | - return(ctype_digit(strval($input))); |
|
212 | + return(ctype_digit(strval($input))); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | |
@@ -240,11 +240,11 @@ discard block |
||
240 | 240 | } |
241 | 241 | |
242 | 242 | /** |
243 | - * Copy folder contents |
|
244 | - * @param string $source Source path |
|
245 | - * @param string $dest Destination path |
|
246 | - * @return bool Returns true on success, false on failure |
|
247 | - */ |
|
243 | + * Copy folder contents |
|
244 | + * @param string $source Source path |
|
245 | + * @param string $dest Destination path |
|
246 | + * @return bool Returns true on success, false on failure |
|
247 | + */ |
|
248 | 248 | public function xcopy($source, $dest) |
249 | 249 | { |
250 | 250 | $files = glob($source.'*.*'); |
@@ -256,20 +256,20 @@ discard block |
||
256 | 256 | } |
257 | 257 | |
258 | 258 | /** |
259 | - * Check if an url exist |
|
260 | - * @param String $url url to check |
|
261 | - * @return bool Return true on succes false on failure |
|
262 | - */ |
|
259 | + * Check if an url exist |
|
260 | + * @param String $url url to check |
|
261 | + * @return bool Return true on succes false on failure |
|
262 | + */ |
|
263 | 263 | public function urlexist($url){ |
264 | 264 | $headers=get_headers($url); |
265 | 265 | return stripos($headers[0],"200 OK")?true:false; |
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
269 | - * Convert hexa to string |
|
270 | - * @param String $hex data in hexa |
|
271 | - * @return String Return result |
|
272 | - */ |
|
269 | + * Convert hexa to string |
|
270 | + * @param String $hex data in hexa |
|
271 | + * @return String Return result |
|
272 | + */ |
|
273 | 273 | public function hex2str($hex) { |
274 | 274 | $str = ''; |
275 | 275 | $hexln = strlen($hex); |
@@ -278,10 +278,10 @@ discard block |
||
278 | 278 | } |
279 | 279 | |
280 | 280 | /** |
281 | - * Convert hexa color to rgb |
|
282 | - * @param String $hex data in hexa |
|
283 | - * @return String Return result |
|
284 | - */ |
|
281 | + * Convert hexa color to rgb |
|
282 | + * @param String $hex data in hexa |
|
283 | + * @return String Return result |
|
284 | + */ |
|
285 | 285 | public function hex2rgb($hex) { |
286 | 286 | $hex = str_replace('#','',$hex); |
287 | 287 | return sscanf($hex, "%02x%02x%02x"); |
@@ -359,9 +359,9 @@ discard block |
||
359 | 359 | } |
360 | 360 | |
361 | 361 | /** |
362 | - * Returns list of available locales |
|
363 | - * |
|
364 | - * @return array |
|
362 | + * Returns list of available locales |
|
363 | + * |
|
364 | + * @return array |
|
365 | 365 | */ |
366 | 366 | public function listLocaleDir() |
367 | 367 | { |
@@ -456,100 +456,100 @@ discard block |
||
456 | 456 | public function remove_accents($string) { |
457 | 457 | if ( !preg_match('/[\x80-\xff]/', $string) ) return $string; |
458 | 458 | $chars = array( |
459 | - // Decompositions for Latin-1 Supplement |
|
460 | - chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', |
|
461 | - chr(195).chr(130) => 'A', chr(195).chr(131) => 'A', |
|
462 | - chr(195).chr(132) => 'A', chr(195).chr(133) => 'A', |
|
463 | - chr(195).chr(135) => 'C', chr(195).chr(136) => 'E', |
|
464 | - chr(195).chr(137) => 'E', chr(195).chr(138) => 'E', |
|
465 | - chr(195).chr(139) => 'E', chr(195).chr(140) => 'I', |
|
466 | - chr(195).chr(141) => 'I', chr(195).chr(142) => 'I', |
|
467 | - chr(195).chr(143) => 'I', chr(195).chr(145) => 'N', |
|
468 | - chr(195).chr(146) => 'O', chr(195).chr(147) => 'O', |
|
469 | - chr(195).chr(148) => 'O', chr(195).chr(149) => 'O', |
|
470 | - chr(195).chr(150) => 'O', chr(195).chr(153) => 'U', |
|
471 | - chr(195).chr(154) => 'U', chr(195).chr(155) => 'U', |
|
472 | - chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y', |
|
473 | - chr(195).chr(159) => 's', chr(195).chr(160) => 'a', |
|
474 | - chr(195).chr(161) => 'a', chr(195).chr(162) => 'a', |
|
475 | - chr(195).chr(163) => 'a', chr(195).chr(164) => 'a', |
|
476 | - chr(195).chr(165) => 'a', chr(195).chr(167) => 'c', |
|
477 | - chr(195).chr(168) => 'e', chr(195).chr(169) => 'e', |
|
478 | - chr(195).chr(170) => 'e', chr(195).chr(171) => 'e', |
|
479 | - chr(195).chr(172) => 'i', chr(195).chr(173) => 'i', |
|
480 | - chr(195).chr(174) => 'i', chr(195).chr(175) => 'i', |
|
481 | - chr(195).chr(177) => 'n', chr(195).chr(178) => 'o', |
|
482 | - chr(195).chr(179) => 'o', chr(195).chr(180) => 'o', |
|
483 | - chr(195).chr(181) => 'o', chr(195).chr(182) => 'o', |
|
484 | - chr(195).chr(182) => 'o', chr(195).chr(185) => 'u', |
|
485 | - chr(195).chr(186) => 'u', chr(195).chr(187) => 'u', |
|
486 | - chr(195).chr(188) => 'u', chr(195).chr(189) => 'y', |
|
487 | - chr(195).chr(191) => 'y', |
|
488 | - // Decompositions for Latin Extended-A |
|
489 | - chr(196).chr(128) => 'A', chr(196).chr(129) => 'a', |
|
490 | - chr(196).chr(130) => 'A', chr(196).chr(131) => 'a', |
|
491 | - chr(196).chr(132) => 'A', chr(196).chr(133) => 'a', |
|
492 | - chr(196).chr(134) => 'C', chr(196).chr(135) => 'c', |
|
493 | - chr(196).chr(136) => 'C', chr(196).chr(137) => 'c', |
|
494 | - chr(196).chr(138) => 'C', chr(196).chr(139) => 'c', |
|
495 | - chr(196).chr(140) => 'C', chr(196).chr(141) => 'c', |
|
496 | - chr(196).chr(142) => 'D', chr(196).chr(143) => 'd', |
|
497 | - chr(196).chr(144) => 'D', chr(196).chr(145) => 'd', |
|
498 | - chr(196).chr(146) => 'E', chr(196).chr(147) => 'e', |
|
499 | - chr(196).chr(148) => 'E', chr(196).chr(149) => 'e', |
|
500 | - chr(196).chr(150) => 'E', chr(196).chr(151) => 'e', |
|
501 | - chr(196).chr(152) => 'E', chr(196).chr(153) => 'e', |
|
502 | - chr(196).chr(154) => 'E', chr(196).chr(155) => 'e', |
|
503 | - chr(196).chr(156) => 'G', chr(196).chr(157) => 'g', |
|
504 | - chr(196).chr(158) => 'G', chr(196).chr(159) => 'g', |
|
505 | - chr(196).chr(160) => 'G', chr(196).chr(161) => 'g', |
|
506 | - chr(196).chr(162) => 'G', chr(196).chr(163) => 'g', |
|
507 | - chr(196).chr(164) => 'H', chr(196).chr(165) => 'h', |
|
508 | - chr(196).chr(166) => 'H', chr(196).chr(167) => 'h', |
|
509 | - chr(196).chr(168) => 'I', chr(196).chr(169) => 'i', |
|
510 | - chr(196).chr(170) => 'I', chr(196).chr(171) => 'i', |
|
511 | - chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', |
|
512 | - chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', |
|
513 | - chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', |
|
514 | - chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', |
|
515 | - chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', |
|
516 | - chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', |
|
517 | - chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', |
|
518 | - chr(196).chr(186) => 'l', chr(196).chr(187) => 'L', |
|
519 | - chr(196).chr(188) => 'l', chr(196).chr(189) => 'L', |
|
520 | - chr(196).chr(190) => 'l', chr(196).chr(191) => 'L', |
|
521 | - chr(197).chr(128) => 'l', chr(197).chr(129) => 'L', |
|
522 | - chr(197).chr(130) => 'l', chr(197).chr(131) => 'N', |
|
523 | - chr(197).chr(132) => 'n', chr(197).chr(133) => 'N', |
|
524 | - chr(197).chr(134) => 'n', chr(197).chr(135) => 'N', |
|
525 | - chr(197).chr(136) => 'n', chr(197).chr(137) => 'N', |
|
526 | - chr(197).chr(138) => 'n', chr(197).chr(139) => 'N', |
|
527 | - chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', |
|
528 | - chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', |
|
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', |
|
537 | - chr(197).chr(160) => 'S', chr(197).chr(161) => 's', |
|
538 | - chr(197).chr(162) => 'T', chr(197).chr(163) => 't', |
|
539 | - chr(197).chr(164) => 'T', chr(197).chr(165) => 't', |
|
540 | - chr(197).chr(166) => 'T', chr(197).chr(167) => 't', |
|
541 | - chr(197).chr(168) => 'U', chr(197).chr(169) => 'u', |
|
542 | - chr(197).chr(170) => 'U', chr(197).chr(171) => 'u', |
|
543 | - chr(197).chr(172) => 'U', chr(197).chr(173) => 'u', |
|
544 | - chr(197).chr(174) => 'U', chr(197).chr(175) => 'u', |
|
545 | - chr(197).chr(176) => 'U', chr(197).chr(177) => 'u', |
|
546 | - chr(197).chr(178) => 'U', chr(197).chr(179) => 'u', |
|
547 | - chr(197).chr(180) => 'W', chr(197).chr(181) => 'w', |
|
548 | - chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y', |
|
549 | - chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z', |
|
550 | - chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z', |
|
551 | - chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z', |
|
552 | - chr(197).chr(190) => 'z', chr(197).chr(191) => 's' |
|
459 | + // Decompositions for Latin-1 Supplement |
|
460 | + chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', |
|
461 | + chr(195).chr(130) => 'A', chr(195).chr(131) => 'A', |
|
462 | + chr(195).chr(132) => 'A', chr(195).chr(133) => 'A', |
|
463 | + chr(195).chr(135) => 'C', chr(195).chr(136) => 'E', |
|
464 | + chr(195).chr(137) => 'E', chr(195).chr(138) => 'E', |
|
465 | + chr(195).chr(139) => 'E', chr(195).chr(140) => 'I', |
|
466 | + chr(195).chr(141) => 'I', chr(195).chr(142) => 'I', |
|
467 | + chr(195).chr(143) => 'I', chr(195).chr(145) => 'N', |
|
468 | + chr(195).chr(146) => 'O', chr(195).chr(147) => 'O', |
|
469 | + chr(195).chr(148) => 'O', chr(195).chr(149) => 'O', |
|
470 | + chr(195).chr(150) => 'O', chr(195).chr(153) => 'U', |
|
471 | + chr(195).chr(154) => 'U', chr(195).chr(155) => 'U', |
|
472 | + chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y', |
|
473 | + chr(195).chr(159) => 's', chr(195).chr(160) => 'a', |
|
474 | + chr(195).chr(161) => 'a', chr(195).chr(162) => 'a', |
|
475 | + chr(195).chr(163) => 'a', chr(195).chr(164) => 'a', |
|
476 | + chr(195).chr(165) => 'a', chr(195).chr(167) => 'c', |
|
477 | + chr(195).chr(168) => 'e', chr(195).chr(169) => 'e', |
|
478 | + chr(195).chr(170) => 'e', chr(195).chr(171) => 'e', |
|
479 | + chr(195).chr(172) => 'i', chr(195).chr(173) => 'i', |
|
480 | + chr(195).chr(174) => 'i', chr(195).chr(175) => 'i', |
|
481 | + chr(195).chr(177) => 'n', chr(195).chr(178) => 'o', |
|
482 | + chr(195).chr(179) => 'o', chr(195).chr(180) => 'o', |
|
483 | + chr(195).chr(181) => 'o', chr(195).chr(182) => 'o', |
|
484 | + chr(195).chr(182) => 'o', chr(195).chr(185) => 'u', |
|
485 | + chr(195).chr(186) => 'u', chr(195).chr(187) => 'u', |
|
486 | + chr(195).chr(188) => 'u', chr(195).chr(189) => 'y', |
|
487 | + chr(195).chr(191) => 'y', |
|
488 | + // Decompositions for Latin Extended-A |
|
489 | + chr(196).chr(128) => 'A', chr(196).chr(129) => 'a', |
|
490 | + chr(196).chr(130) => 'A', chr(196).chr(131) => 'a', |
|
491 | + chr(196).chr(132) => 'A', chr(196).chr(133) => 'a', |
|
492 | + chr(196).chr(134) => 'C', chr(196).chr(135) => 'c', |
|
493 | + chr(196).chr(136) => 'C', chr(196).chr(137) => 'c', |
|
494 | + chr(196).chr(138) => 'C', chr(196).chr(139) => 'c', |
|
495 | + chr(196).chr(140) => 'C', chr(196).chr(141) => 'c', |
|
496 | + chr(196).chr(142) => 'D', chr(196).chr(143) => 'd', |
|
497 | + chr(196).chr(144) => 'D', chr(196).chr(145) => 'd', |
|
498 | + chr(196).chr(146) => 'E', chr(196).chr(147) => 'e', |
|
499 | + chr(196).chr(148) => 'E', chr(196).chr(149) => 'e', |
|
500 | + chr(196).chr(150) => 'E', chr(196).chr(151) => 'e', |
|
501 | + chr(196).chr(152) => 'E', chr(196).chr(153) => 'e', |
|
502 | + chr(196).chr(154) => 'E', chr(196).chr(155) => 'e', |
|
503 | + chr(196).chr(156) => 'G', chr(196).chr(157) => 'g', |
|
504 | + chr(196).chr(158) => 'G', chr(196).chr(159) => 'g', |
|
505 | + chr(196).chr(160) => 'G', chr(196).chr(161) => 'g', |
|
506 | + chr(196).chr(162) => 'G', chr(196).chr(163) => 'g', |
|
507 | + chr(196).chr(164) => 'H', chr(196).chr(165) => 'h', |
|
508 | + chr(196).chr(166) => 'H', chr(196).chr(167) => 'h', |
|
509 | + chr(196).chr(168) => 'I', chr(196).chr(169) => 'i', |
|
510 | + chr(196).chr(170) => 'I', chr(196).chr(171) => 'i', |
|
511 | + chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', |
|
512 | + chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', |
|
513 | + chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', |
|
514 | + chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', |
|
515 | + chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', |
|
516 | + chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', |
|
517 | + chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', |
|
518 | + chr(196).chr(186) => 'l', chr(196).chr(187) => 'L', |
|
519 | + chr(196).chr(188) => 'l', chr(196).chr(189) => 'L', |
|
520 | + chr(196).chr(190) => 'l', chr(196).chr(191) => 'L', |
|
521 | + chr(197).chr(128) => 'l', chr(197).chr(129) => 'L', |
|
522 | + chr(197).chr(130) => 'l', chr(197).chr(131) => 'N', |
|
523 | + chr(197).chr(132) => 'n', chr(197).chr(133) => 'N', |
|
524 | + chr(197).chr(134) => 'n', chr(197).chr(135) => 'N', |
|
525 | + chr(197).chr(136) => 'n', chr(197).chr(137) => 'N', |
|
526 | + chr(197).chr(138) => 'n', chr(197).chr(139) => 'N', |
|
527 | + chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', |
|
528 | + chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', |
|
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', |
|
537 | + chr(197).chr(160) => 'S', chr(197).chr(161) => 's', |
|
538 | + chr(197).chr(162) => 'T', chr(197).chr(163) => 't', |
|
539 | + chr(197).chr(164) => 'T', chr(197).chr(165) => 't', |
|
540 | + chr(197).chr(166) => 'T', chr(197).chr(167) => 't', |
|
541 | + chr(197).chr(168) => 'U', chr(197).chr(169) => 'u', |
|
542 | + chr(197).chr(170) => 'U', chr(197).chr(171) => 'u', |
|
543 | + chr(197).chr(172) => 'U', chr(197).chr(173) => 'u', |
|
544 | + chr(197).chr(174) => 'U', chr(197).chr(175) => 'u', |
|
545 | + chr(197).chr(176) => 'U', chr(197).chr(177) => 'u', |
|
546 | + chr(197).chr(178) => 'U', chr(197).chr(179) => 'u', |
|
547 | + chr(197).chr(180) => 'W', chr(197).chr(181) => 'w', |
|
548 | + chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y', |
|
549 | + chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z', |
|
550 | + chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z', |
|
551 | + chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z', |
|
552 | + chr(197).chr(190) => 'z', chr(197).chr(191) => 's' |
|
553 | 553 | ); |
554 | 554 | $string = strtr($string, $chars); |
555 | 555 | return $string; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | <div id="showdetails" class="showdetails"></div> |
37 | 37 | <div id="infobox" class="infobox"><h4><?php echo _("Aircrafts detected"); ?></h4><br /><i class="fa fa-spinner fa-pulse fa-fw"></i></div> |
38 | 38 | <?php |
39 | - if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) { |
|
39 | + if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) { |
|
40 | 40 | |
41 | 41 | ?> |
42 | 42 | <script src="<?php echo $globalURL; ?>/js/map.3d.js.php"></script> |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | <script src="<?php echo $globalURL; ?>/js/map-marine.3d.js.php"></script> |
57 | 57 | <?php |
58 | 58 | } |
59 | - } |
|
59 | + } |
|
60 | 60 | ?> |
61 | 61 | <div id="dialog" title="<?php echo _("Session has timed-out"); ?>"> |
62 | 62 | <p><?php echo _("In order to save data consumption web page times out after 30 minutes. Close this dialog to continue."); ?></p> |
@@ -70,34 +70,34 @@ discard block |
||
70 | 70 | <li><a href="#" onclick="getUserLocation(); return false;" title="<?php echo _("Plot your Location"); ?>"><i class="fa fa-map-marker"></i></a></li> |
71 | 71 | <li><a href="#" onclick="getCompassDirection(); return false;" title="<?php echo _("Compass Mode"); ?>"><i class="fa fa-compass"></i></a></li> |
72 | 72 | <?php |
73 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
73 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
74 | 74 | if (isset($globalArchive) && $globalArchive == TRUE) { |
75 | 75 | ?> |
76 | 76 | <li><a href="#archive" role="tab" title="<?php echo _("Archive"); ?>"><i class="fa fa-archive"></i></a></li> |
77 | 77 | <?php |
78 | 78 | } |
79 | - } |
|
79 | + } |
|
80 | 80 | ?> |
81 | 81 | <li><a href="#home" role="tab" title="<?php echo _("Layers"); ?>"><i class="fa fa-map"></i></a></li> |
82 | 82 | <li><a href="#filters" role="tab" title="<?php echo _("Filters"); ?>"><i class="fa fa-filter"></i></a></li> |
83 | 83 | <li><a href="#settings" role="tab" title="<?php echo _("Settings"); ?>"><i class="fa fa-gears"></i></a></li> |
84 | 84 | <?php |
85 | - if (isset($globalMap3D) && $globalMap3D) { |
|
85 | + if (isset($globalMap3D) && $globalMap3D) { |
|
86 | 86 | if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
87 | 87 | ?> |
88 | 88 | <li><a href="#" onclick="show3D(); return false;" role="tab" title="3D"><b>3D</b></a></li> |
89 | 89 | <?php |
90 | - } else { |
|
91 | - if (isset($globalMapSatellites) && $globalMapSatellites) { |
|
90 | + } else { |
|
91 | + if (isset($globalMapSatellites) && $globalMapSatellites) { |
|
92 | 92 | ?> |
93 | 93 | <li><a href="#satellites" role="tab" title="<?php echo _("Satellites"); ?>"><i class="satellite"></i></a></li> |
94 | 94 | <?php |
95 | - } |
|
95 | + } |
|
96 | 96 | ?> |
97 | 97 | <li><a href="#" onclick="show2D(); return false;" role="tab" title="2D"><b>2D</b></a></li> |
98 | 98 | <?php |
99 | 99 | } |
100 | - } |
|
100 | + } |
|
101 | 101 | ?> |
102 | 102 | </ul> |
103 | 103 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | ?> |
172 | 172 | </div> |
173 | 173 | <?php |
174 | - if (isset($globalArchive) && $globalArchive == TRUE) { |
|
174 | + if (isset($globalArchive) && $globalArchive == TRUE) { |
|
175 | 175 | ?> |
176 | 176 | <div class="sidebar-pane" id="archive"> |
177 | 177 | <h1 class="sidebar-header"><?php echo _("Playback"); ?> <i>Bêta</i><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | </form> |
232 | 232 | </div> |
233 | 233 | <?php |
234 | - } |
|
234 | + } |
|
235 | 235 | ?> |
236 | 236 | <div class="sidebar-pane" id="settings"> |
237 | 237 | <h1 class="sidebar-header"><?php echo _("Settings"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
@@ -242,56 +242,56 @@ discard block |
||
242 | 242 | <?php |
243 | 243 | if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider; |
244 | 244 | else $MapType = $_COOKIE['MapType']; |
245 | - ?> |
|
245 | + ?> |
|
246 | 246 | <?php |
247 | 247 | if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
248 | - ?> |
|
248 | + ?> |
|
249 | 249 | <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option> |
250 | 250 | <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option> |
251 | 251 | <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option> |
252 | 252 | <?php |
253 | 253 | } |
254 | - ?> |
|
254 | + ?> |
|
255 | 255 | <?php |
256 | - if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
257 | - ?> |
|
256 | + if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
257 | + ?> |
|
258 | 258 | <?php |
259 | - if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
|
260 | - ?> |
|
259 | + if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
|
260 | + ?> |
|
261 | 261 | <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option> |
262 | 262 | <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option> |
263 | 263 | <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option> |
264 | 264 | <?php |
265 | - } |
|
266 | - ?> |
|
265 | + } |
|
266 | + ?> |
|
267 | 267 | <?php |
268 | - if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') { |
|
269 | - ?> |
|
268 | + if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') { |
|
269 | + ?> |
|
270 | 270 | <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option> |
271 | 271 | <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option> |
272 | 272 | <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option> |
273 | 273 | <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option> |
274 | 274 | <?php |
275 | - } |
|
276 | - ?> |
|
275 | + } |
|
276 | + ?> |
|
277 | 277 | <?php |
278 | - if (isset($globalMapQuestKey) && $globalMapQuestKey != '') { |
|
279 | - ?> |
|
278 | + if (isset($globalMapQuestKey) && $globalMapQuestKey != '') { |
|
279 | + ?> |
|
280 | 280 | <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option> |
281 | 281 | <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option> |
282 | 282 | <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option> |
283 | 283 | <?php |
284 | - } |
|
285 | - ?> |
|
284 | + } |
|
285 | + ?> |
|
286 | 286 | <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option> |
287 | 287 | <?php |
288 | 288 | } |
289 | - ?> |
|
289 | + ?> |
|
290 | 290 | <?php |
291 | - if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
|
291 | + if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
|
292 | 292 | if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default'; |
293 | 293 | else $MapBoxId = $_COOKIE['MapTypeId']; |
294 | - ?> |
|
294 | + ?> |
|
295 | 295 | <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option> |
296 | 296 | <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option> |
297 | 297 | <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option> |
@@ -305,13 +305,13 @@ discard block |
||
305 | 305 | <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option> |
306 | 306 | <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option> |
307 | 307 | <?php |
308 | - } |
|
309 | - ?> |
|
308 | + } |
|
309 | + ?> |
|
310 | 310 | <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option> |
311 | 311 | </select> |
312 | 312 | </li> |
313 | 313 | <?php |
314 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
314 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
315 | 315 | ?> |
316 | 316 | <li><?php echo _("Type of Terrain:"); ?> |
317 | 317 | <select class="selectpicker" onchange="terrainType(this);"> |
@@ -321,10 +321,10 @@ discard block |
||
321 | 321 | </select> |
322 | 322 | </li> |
323 | 323 | <?php |
324 | - } |
|
324 | + } |
|
325 | 325 | ?> |
326 | 326 | <?php |
327 | - if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
327 | + if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
328 | 328 | ?> |
329 | 329 | |
330 | 330 | <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') print 'checked'; ?> ><?php echo _("Display flight info as popup"); ?></label></div></li> |
@@ -332,59 +332,59 @@ discard block |
||
332 | 332 | <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || !isset($_COOKIE['MapRoute'])) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li> |
333 | 333 | <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Planes animate between updates"); ?></label></div></li> |
334 | 334 | <?php |
335 | - } |
|
335 | + } |
|
336 | 336 | ?> |
337 | 337 | <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true') print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li> |
338 | 338 | <?php |
339 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
339 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
340 | 340 | ?> |
341 | 341 | <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li> |
342 | 342 | <?php |
343 | - } |
|
344 | - if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
|
343 | + } |
|
344 | + if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
|
345 | 345 | ?> |
346 | 346 | <li><div class="checkbox"><label><input type="checkbox" name="displaysanta" value="1" onclick="clickSanta(this)"><i class="fa fa-snowflake-o" aria-hidden="true"></i> <?php echo _("Show Santa Claus now"); ?> <i class="fa fa-snowflake-o" aria-hidden="true"></i></label></div></li> |
347 | 347 | <?php |
348 | - } |
|
348 | + } |
|
349 | 349 | ?> |
350 | 350 | |
351 | 351 | <?php |
352 | 352 | if (function_exists('array_column')) { |
353 | - if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
|
354 | - ?> |
|
353 | + if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
|
354 | + ?> |
|
355 | 355 | <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
356 | 356 | <?php |
357 | - } |
|
357 | + } |
|
358 | 358 | } elseif (isset($globalSources)) { |
359 | - $dispolar = false; |
|
360 | - foreach ($globalSources as $testsource) { |
|
361 | - if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
362 | - } |
|
363 | - if ($dispolar) { |
|
364 | - ?> |
|
359 | + $dispolar = false; |
|
360 | + foreach ($globalSources as $testsource) { |
|
361 | + if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
362 | + } |
|
363 | + if ($dispolar) { |
|
364 | + ?> |
|
365 | 365 | <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
366 | 366 | <?php |
367 | - } |
|
368 | - } |
|
369 | - ?> |
|
367 | + } |
|
368 | + } |
|
369 | + ?> |
|
370 | 370 | <?php |
371 | - if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
371 | + if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
372 | 372 | ?> |
373 | 373 | |
374 | 374 | <?php |
375 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
376 | - ?> |
|
375 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
376 | + ?> |
|
377 | 377 | <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li> |
378 | 378 | <?php |
379 | 379 | if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') { |
380 | - ?> |
|
380 | + ?> |
|
381 | 381 | <li><?php echo _("Aircraft icon color:"); ?> |
382 | 382 | <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>"> |
383 | 383 | </li> |
384 | 384 | <?php |
385 | - } |
|
386 | - } |
|
387 | - ?> |
|
385 | + } |
|
386 | + } |
|
387 | + ?> |
|
388 | 388 | <li><?php echo _("Show airport icon at zoom level:"); ?> |
389 | 389 | <div class="range"> |
390 | 390 | <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>"> |
@@ -392,14 +392,14 @@ discard block |
||
392 | 392 | </div> |
393 | 393 | </li> |
394 | 394 | <?php |
395 | - } elseif (isset($_COOKIE['MapFormat']) || $_COOKIE['MapFOrmat'] == '3d') { |
|
395 | + } elseif (isset($_COOKIE['MapFormat']) || $_COOKIE['MapFOrmat'] == '3d') { |
|
396 | 396 | ?> |
397 | 397 | <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Aircraft color"); ?></li> |
398 | 398 | <li><?php echo _("Aircraft icon color:"); ?> |
399 | 399 | <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print 'ff0000'; ?>"> |
400 | 400 | </li> |
401 | 401 | <?php |
402 | - } |
|
402 | + } |
|
403 | 403 | ?> |
404 | 404 | <li><?php echo _("Distance unit:"); ?> |
405 | 405 | <select class="selectpicker" onchange="unitdistance(this);"> |
@@ -432,16 +432,16 @@ discard block |
||
432 | 432 | <ul> |
433 | 433 | <?php |
434 | 434 | if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) { |
435 | - ?> |
|
435 | + ?> |
|
436 | 436 | <?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?> |
437 | 437 | <?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?> |
438 | 438 | <?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?> |
439 | 439 | <?php |
440 | 440 | } |
441 | - ?> |
|
441 | + ?> |
|
442 | 442 | <?php |
443 | 443 | if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) { |
444 | - ?> |
|
444 | + ?> |
|
445 | 445 | <?php if (isset($globalSBS1) && $globalSBS1) { ?> |
446 | 446 | <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li> |
447 | 447 | <?php } ?> |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | <?php } ?> |
451 | 451 | <?php |
452 | 452 | } |
453 | - ?> |
|
453 | + ?> |
|
454 | 454 | <li><?php echo _("Display airlines:"); ?> |
455 | 455 | <br/> |
456 | 456 | <select class="selectpicker" multiple onchange="airlines(this);" id="display_airlines"> |
@@ -470,14 +470,14 @@ discard block |
||
470 | 470 | echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>'; |
471 | 471 | } |
472 | 472 | } |
473 | - ?> |
|
473 | + ?> |
|
474 | 474 | </select> |
475 | 475 | </li> |
476 | 476 | <?php |
477 | 477 | $Spotter = new Spotter(); |
478 | 478 | $allalliancenames = $Spotter->getAllAllianceNames(); |
479 | 479 | if (!empty($allalliancenames)) { |
480 | - ?> |
|
480 | + ?> |
|
481 | 481 | <li><?php echo _("Display alliance:"); ?> |
482 | 482 | <br/> |
483 | 483 | <select class="selectpicker" onchange="alliance(this);" id="display_alliance"> |
@@ -491,15 +491,15 @@ discard block |
||
491 | 491 | echo '<option value="'.$alliance_name.'">'.$alliance_name.'</option>'; |
492 | 492 | } |
493 | 493 | } |
494 | - ?> |
|
494 | + ?> |
|
495 | 495 | </select> |
496 | 496 | </li> |
497 | 497 | <?php |
498 | 498 | } |
499 | - ?> |
|
499 | + ?> |
|
500 | 500 | <?php |
501 | 501 | if (isset($globalAPRS) && $globalAPRS) { |
502 | - ?> |
|
502 | + ?> |
|
503 | 503 | <li><?php echo _("Display APRS sources name:"); ?> |
504 | 504 | <select class="selectpicker" multiple onchange="sources(this);"> |
505 | 505 | <?php |
@@ -511,15 +511,15 @@ discard block |
||
511 | 511 | echo '<option value="'.$source['source_name'].'">'.$source['source_name'].'</option>'; |
512 | 512 | } |
513 | 513 | } |
514 | - ?> |
|
514 | + ?> |
|
515 | 515 | </select> |
516 | 516 | </li> |
517 | 517 | <?php |
518 | 518 | } |
519 | - ?> |
|
519 | + ?> |
|
520 | 520 | <?php |
521 | 521 | if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) { |
522 | - ?> |
|
522 | + ?> |
|
523 | 523 | <li><?php echo _("Display airlines of type:"); ?><br/> |
524 | 524 | <select class="selectpicker" onchange="airlinestype(this);"> |
525 | 525 | <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | </li> |
531 | 531 | <?php |
532 | 532 | } |
533 | - ?> |
|
533 | + ?> |
|
534 | 534 | <li> |
535 | 535 | <?php echo _("Display flight with ident:"); ?> |
536 | 536 | <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" /> |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | </form> |
544 | 544 | </div> |
545 | 545 | <?php |
546 | - if (isset($globalMapSatellites) && $globalMapSatellites && isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
546 | + if (isset($globalMapSatellites) && $globalMapSatellites && isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
547 | 547 | ?> |
548 | 548 | <div class="sidebar-pane" id="satellites"> |
549 | 549 | <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
@@ -583,14 +583,14 @@ discard block |
||
583 | 583 | print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>'; |
584 | 584 | } |
585 | 585 | } |
586 | - ?> |
|
586 | + ?> |
|
587 | 587 | </select> |
588 | 588 | </li> |
589 | 589 | </ul> |
590 | 590 | </form> |
591 | 591 | </div> |
592 | 592 | <?php |
593 | - } |
|
593 | + } |
|
594 | 594 | ?> |
595 | 595 | </div> |
596 | 596 | </div> |
@@ -5,23 +5,23 @@ discard block |
||
5 | 5 | $marine = false; |
6 | 6 | $usecoord = false; |
7 | 7 | if (isset($_GET['tracker'])) { |
8 | - $tracker = true; |
|
8 | + $tracker = true; |
|
9 | 9 | } |
10 | 10 | if (isset($_GET['marine'])) { |
11 | - $marine = true; |
|
11 | + $marine = true; |
|
12 | 12 | } |
13 | 13 | if ($tracker) { |
14 | - require_once('require/class.Tracker.php'); |
|
15 | - require_once('require/class.TrackerLive.php'); |
|
16 | - //require_once('require/class.TrackerArchive.php'); |
|
14 | + require_once('require/class.Tracker.php'); |
|
15 | + require_once('require/class.TrackerLive.php'); |
|
16 | + //require_once('require/class.TrackerArchive.php'); |
|
17 | 17 | } elseif ($marine) { |
18 | - require_once('require/class.Marine.php'); |
|
19 | - require_once('require/class.MarineLive.php'); |
|
20 | - //require_once('require/class.MarineArchive.php'); |
|
18 | + require_once('require/class.Marine.php'); |
|
19 | + require_once('require/class.MarineLive.php'); |
|
20 | + //require_once('require/class.MarineArchive.php'); |
|
21 | 21 | } else { |
22 | - require_once('require/class.Spotter.php'); |
|
23 | - require_once('require/class.SpotterLive.php'); |
|
24 | - require_once('require/class.SpotterArchive.php'); |
|
22 | + require_once('require/class.Spotter.php'); |
|
23 | + require_once('require/class.SpotterLive.php'); |
|
24 | + require_once('require/class.SpotterArchive.php'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | $begintime = microtime(true); |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | $Common = new Common(); |
42 | 42 | |
43 | 43 | if (isset($_GET['download'])) { |
44 | - if ($_GET['download'] == "true") |
|
45 | - { |
|
44 | + if ($_GET['download'] == "true") |
|
45 | + { |
|
46 | 46 | header('Content-disposition: attachment; filename="flightairmap.json"'); |
47 | - } |
|
47 | + } |
|
48 | 48 | } |
49 | 49 | header('Content-Type: text/javascript'); |
50 | 50 | |
@@ -496,13 +496,13 @@ discard block |
||
496 | 496 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
497 | 497 | |
498 | 498 | if ( |
499 | - (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
500 | - || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
499 | + (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
500 | + || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
501 | 501 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
502 | 502 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
503 | - || (isset($history) && $history != '' && $history != 'NA' && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
504 | - || (isset($history) && $history == '' && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
505 | - ) { |
|
503 | + || (isset($history) && $history != '' && $history != 'NA' && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
504 | + || (isset($history) && $history == '' && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
505 | + ) { |
|
506 | 506 | if ($tracker) { |
507 | 507 | $spotter_history_array = $TrackerLive->getAllLiveTrackerDataById($spotter_item['famtrackid']); |
508 | 508 | } elseif ($marine) { |
@@ -555,26 +555,26 @@ discard block |
||
555 | 555 | } |
556 | 556 | |
557 | 557 | if (isset($history) && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
558 | - $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
559 | - if (isset($spotter_item['departure_airport_latitude'])) { |
|
558 | + $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
559 | + if (isset($spotter_item['departure_airport_latitude'])) { |
|
560 | 560 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
561 | - } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
561 | + } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
562 | 562 | $dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']); |
563 | 563 | if (isset($dairport[0]['latitude'])) { |
564 | - $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
564 | + $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
565 | 565 | } |
566 | - } |
|
567 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
566 | + } |
|
567 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
568 | 568 | $output_air .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].']'; |
569 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
569 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
570 | 570 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
571 | 571 | if (isset($aairport[0]['latitude'])) { |
572 | - $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
572 | + $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
573 | 573 | } |
574 | - } |
|
575 | - $output_air .= ']}},'; |
|
576 | - $output .= $output_air; |
|
577 | - unset($output_air); |
|
574 | + } |
|
575 | + $output_air .= ']}},'; |
|
576 | + $output .= $output_air; |
|
577 | + unset($output_air); |
|
578 | 578 | } |
579 | 579 | } |
580 | 580 | $output = substr($output, 0, -1); |
@@ -12,10 +12,10 @@ discard block |
||
12 | 12 | |
13 | 13 | |
14 | 14 | /** |
15 | - * Get SQL query part for filter used |
|
16 | - * @param Array $filter the filter |
|
17 | - * @return Array the SQL part |
|
18 | - */ |
|
15 | + * Get SQL query part for filter used |
|
16 | + * @param Array $filter the filter |
|
17 | + * @return Array the SQL part |
|
18 | + */ |
|
19 | 19 | public function getFilter($filter = array(),$where = false,$and = false) { |
20 | 20 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
21 | 21 | $filters = array(); |
@@ -128,11 +128,11 @@ discard block |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
131 | - * Gets all the spotter information based on the latest data entry |
|
132 | - * |
|
133 | - * @return Array the spotter information |
|
134 | - * |
|
135 | - */ |
|
131 | + * Gets all the spotter information based on the latest data entry |
|
132 | + * |
|
133 | + * @return Array the spotter information |
|
134 | + * |
|
135 | + */ |
|
136 | 136 | public function getLiveSpotterData($limit = '', $sort = '', $filter = array()) |
137 | 137 | { |
138 | 138 | global $globalDBdriver, $globalLiveInterval; |
@@ -174,11 +174,11 @@ discard block |
||
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
177 | - * Gets Minimal Live Spotter data |
|
178 | - * |
|
179 | - * @return Array the spotter information |
|
180 | - * |
|
181 | - */ |
|
177 | + * Gets Minimal Live Spotter data |
|
178 | + * |
|
179 | + * @return Array the spotter information |
|
180 | + * |
|
181 | + */ |
|
182 | 182 | public function getMinLiveSpotterData($filter = array()) |
183 | 183 | { |
184 | 184 | global $globalDBdriver, $globalLiveInterval; |
@@ -231,11 +231,11 @@ discard block |
||
231 | 231 | } |
232 | 232 | |
233 | 233 | /** |
234 | - * Gets Minimal Live Spotter data since xx seconds |
|
235 | - * |
|
236 | - * @return Array the spotter information |
|
237 | - * |
|
238 | - */ |
|
234 | + * Gets Minimal Live Spotter data since xx seconds |
|
235 | + * |
|
236 | + * @return Array the spotter information |
|
237 | + * |
|
238 | + */ |
|
239 | 239 | public function getMinLastLiveSpotterData($filter = array()) |
240 | 240 | { |
241 | 241 | global $globalDBdriver, $globalLiveInterval; |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source |
254 | 254 | FROM spotter_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= spotter_live.date AND spotter_live.latitude <> '0' AND spotter_live.longitude <> '0' |
255 | 255 | ORDER BY spotter_live.flightaware_id, spotter_live.date"; |
256 | - } else { |
|
256 | + } else { |
|
257 | 257 | /* |
258 | 258 | $query = "SELECT a.aircraft_shadow, a.engine_type, a.engine_count, a.wake_category, spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source |
259 | 259 | FROM spotter_live LEFT JOIN (SELECT aircraft_shadow,engine_type, engine_count, wake_category, icao FROM aircraft) a ON spotter_live.aircraft_icao = a.icao".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= spotter_live.date AND spotter_live.latitude <> '0' AND spotter_live.longitude <> '0' |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | // echo $query; |
266 | 266 | } |
267 | 267 | |
268 | - try { |
|
268 | + try { |
|
269 | 269 | $sth = $this->db->prepare($query); |
270 | 270 | $sth->execute(); |
271 | 271 | } catch(PDOException $e) { |
@@ -277,11 +277,11 @@ discard block |
||
277 | 277 | } |
278 | 278 | |
279 | 279 | /** |
280 | - * Gets number of latest data entry |
|
281 | - * |
|
282 | - * @return String number of entry |
|
283 | - * |
|
284 | - */ |
|
280 | + * Gets number of latest data entry |
|
281 | + * |
|
282 | + * @return String number of entry |
|
283 | + * |
|
284 | + */ |
|
285 | 285 | public function getLiveSpotterCount($filter = array()) |
286 | 286 | { |
287 | 287 | global $globalDBdriver, $globalLiveInterval; |
@@ -308,11 +308,11 @@ discard block |
||
308 | 308 | } |
309 | 309 | |
310 | 310 | /** |
311 | - * Gets all the spotter information based on the latest data entry and coord |
|
312 | - * |
|
313 | - * @return Array the spotter information |
|
314 | - * |
|
315 | - */ |
|
311 | + * Gets all the spotter information based on the latest data entry and coord |
|
312 | + * |
|
313 | + * @return Array the spotter information |
|
314 | + * |
|
315 | + */ |
|
316 | 316 | public function getLiveSpotterDatabyCoord($coord, $filter = array()) |
317 | 317 | { |
318 | 318 | global $globalDBdriver, $globalLiveInterval; |
@@ -337,11 +337,11 @@ discard block |
||
337 | 337 | } |
338 | 338 | |
339 | 339 | /** |
340 | - * Gets all the spotter information based on the latest data entry and coord |
|
341 | - * |
|
342 | - * @return Array the spotter information |
|
343 | - * |
|
344 | - */ |
|
340 | + * Gets all the spotter information based on the latest data entry and coord |
|
341 | + * |
|
342 | + * @return Array the spotter information |
|
343 | + * |
|
344 | + */ |
|
345 | 345 | public function getMinLiveSpotterDatabyCoord($coord, $filter = array()) |
346 | 346 | { |
347 | 347 | global $globalDBdriver, $globalLiveInterval; |
@@ -382,11 +382,11 @@ discard block |
||
382 | 382 | } |
383 | 383 | |
384 | 384 | /** |
385 | - * Gets all the spotter information based on a user's latitude and longitude |
|
386 | - * |
|
387 | - * @return Array the spotter information |
|
388 | - * |
|
389 | - */ |
|
385 | + * Gets all the spotter information based on a user's latitude and longitude |
|
386 | + * |
|
387 | + * @return Array the spotter information |
|
388 | + * |
|
389 | + */ |
|
390 | 390 | public function getLatestSpotterForLayar($lat, $lng, $radius, $interval) |
391 | 391 | { |
392 | 392 | $Spotter = new Spotter($this->db); |
@@ -396,145 +396,145 @@ discard block |
||
396 | 396 | return false; |
397 | 397 | } |
398 | 398 | } |
399 | - if ($lng != '') |
|
400 | - { |
|
401 | - if (!is_numeric($lng)) |
|
402 | - { |
|
403 | - return false; |
|
404 | - } |
|
405 | - } |
|
406 | - |
|
407 | - if ($radius != '') |
|
408 | - { |
|
409 | - if (!is_numeric($radius)) |
|
410 | - { |
|
411 | - return false; |
|
412 | - } |
|
413 | - } |
|
399 | + if ($lng != '') |
|
400 | + { |
|
401 | + if (!is_numeric($lng)) |
|
402 | + { |
|
403 | + return false; |
|
404 | + } |
|
405 | + } |
|
406 | + |
|
407 | + if ($radius != '') |
|
408 | + { |
|
409 | + if (!is_numeric($radius)) |
|
410 | + { |
|
411 | + return false; |
|
412 | + } |
|
413 | + } |
|
414 | 414 | $additional_query = ''; |
415 | - if ($interval != '') |
|
416 | - { |
|
417 | - if (!is_string($interval)) |
|
418 | - { |
|
419 | - //$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date '; |
|
420 | - return false; |
|
421 | - } else { |
|
422 | - if ($interval == '1m') |
|
423 | - { |
|
424 | - $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date '; |
|
425 | - } else if ($interval == '15m'){ |
|
426 | - $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 MINUTE) <= spotter_live.date '; |
|
427 | - } |
|
428 | - } |
|
429 | - } else { |
|
430 | - $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date '; |
|
431 | - } |
|
432 | - |
|
433 | - $query = "SELECT spotter_live.*, ( 6371 * acos( cos( radians(:lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(:lng) ) + sin( radians(:lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_live |
|
415 | + if ($interval != '') |
|
416 | + { |
|
417 | + if (!is_string($interval)) |
|
418 | + { |
|
419 | + //$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date '; |
|
420 | + return false; |
|
421 | + } else { |
|
422 | + if ($interval == '1m') |
|
423 | + { |
|
424 | + $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date '; |
|
425 | + } else if ($interval == '15m'){ |
|
426 | + $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 MINUTE) <= spotter_live.date '; |
|
427 | + } |
|
428 | + } |
|
429 | + } else { |
|
430 | + $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date '; |
|
431 | + } |
|
432 | + |
|
433 | + $query = "SELECT spotter_live.*, ( 6371 * acos( cos( radians(:lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(:lng) ) + sin( radians(:lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_live |
|
434 | 434 | WHERE spotter_live.latitude <> '' |
435 | 435 | AND spotter_live.longitude <> '' |
436 | 436 | ".$additional_query." |
437 | 437 | HAVING distance < :radius |
438 | 438 | ORDER BY distance"; |
439 | 439 | |
440 | - $spotter_array = $Spotter->getDataFromDB($query, array(':lat' => $lat, ':lng' => $lng,':radius' => $radius)); |
|
440 | + $spotter_array = $Spotter->getDataFromDB($query, array(':lat' => $lat, ':lng' => $lng,':radius' => $radius)); |
|
441 | 441 | |
442 | - return $spotter_array; |
|
443 | - } |
|
442 | + return $spotter_array; |
|
443 | + } |
|
444 | 444 | |
445 | 445 | |
446 | - /** |
|
447 | - * Gets all the spotter information based on a particular callsign |
|
448 | - * |
|
449 | - * @return Array the spotter information |
|
450 | - * |
|
451 | - */ |
|
446 | + /** |
|
447 | + * Gets all the spotter information based on a particular callsign |
|
448 | + * |
|
449 | + * @return Array the spotter information |
|
450 | + * |
|
451 | + */ |
|
452 | 452 | public function getLastLiveSpotterDataByIdent($ident) |
453 | 453 | { |
454 | 454 | $Spotter = new Spotter($this->db); |
455 | 455 | date_default_timezone_set('UTC'); |
456 | 456 | |
457 | 457 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
458 | - $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
458 | + $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
459 | 459 | |
460 | 460 | $spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident),'',true); |
461 | 461 | |
462 | 462 | return $spotter_array; |
463 | 463 | } |
464 | 464 | |
465 | - /** |
|
466 | - * Gets all the spotter information based on a particular callsign |
|
467 | - * |
|
468 | - * @return Array the spotter information |
|
469 | - * |
|
470 | - */ |
|
465 | + /** |
|
466 | + * Gets all the spotter information based on a particular callsign |
|
467 | + * |
|
468 | + * @return Array the spotter information |
|
469 | + * |
|
470 | + */ |
|
471 | 471 | public function getDateLiveSpotterDataByIdent($ident,$date) |
472 | 472 | { |
473 | 473 | $Spotter = new Spotter($this->db); |
474 | 474 | date_default_timezone_set('UTC'); |
475 | 475 | |
476 | 476 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
477 | - $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
477 | + $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
478 | 478 | |
479 | - $date = date('c',$date); |
|
479 | + $date = date('c',$date); |
|
480 | 480 | $spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident,':date' => $date)); |
481 | 481 | |
482 | 482 | return $spotter_array; |
483 | 483 | } |
484 | 484 | |
485 | - /** |
|
486 | - * Gets last spotter information based on a particular callsign |
|
487 | - * |
|
488 | - * @return Array the spotter information |
|
489 | - * |
|
490 | - */ |
|
485 | + /** |
|
486 | + * Gets last spotter information based on a particular callsign |
|
487 | + * |
|
488 | + * @return Array the spotter information |
|
489 | + * |
|
490 | + */ |
|
491 | 491 | public function getLastLiveSpotterDataById($id) |
492 | 492 | { |
493 | 493 | $Spotter = new Spotter($this->db); |
494 | 494 | date_default_timezone_set('UTC'); |
495 | 495 | |
496 | 496 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
497 | - $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
497 | + $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
498 | 498 | |
499 | 499 | $spotter_array = $Spotter->getDataFromDB($query,array(':id' => $id),'',true); |
500 | 500 | |
501 | 501 | return $spotter_array; |
502 | 502 | } |
503 | 503 | |
504 | - /** |
|
505 | - * Gets last spotter information based on a particular callsign |
|
506 | - * |
|
507 | - * @return Array the spotter information |
|
508 | - * |
|
509 | - */ |
|
504 | + /** |
|
505 | + * Gets last spotter information based on a particular callsign |
|
506 | + * |
|
507 | + * @return Array the spotter information |
|
508 | + * |
|
509 | + */ |
|
510 | 510 | public function getDateLiveSpotterDataById($id,$date) |
511 | 511 | { |
512 | 512 | $Spotter = new Spotter($this->db); |
513 | 513 | date_default_timezone_set('UTC'); |
514 | 514 | |
515 | 515 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
516 | - $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
517 | - $date = date('c',$date); |
|
516 | + $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
517 | + $date = date('c',$date); |
|
518 | 518 | $spotter_array = $Spotter->getDataFromDB($query,array(':id' => $id,':date' => $date),'',true); |
519 | 519 | |
520 | 520 | return $spotter_array; |
521 | 521 | } |
522 | 522 | |
523 | - /** |
|
524 | - * Gets altitude information based on a particular callsign |
|
525 | - * |
|
526 | - * @return Array the spotter information |
|
527 | - * |
|
528 | - */ |
|
523 | + /** |
|
524 | + * Gets altitude information based on a particular callsign |
|
525 | + * |
|
526 | + * @return Array the spotter information |
|
527 | + * |
|
528 | + */ |
|
529 | 529 | public function getAltitudeLiveSpotterDataByIdent($ident) |
530 | 530 | { |
531 | 531 | |
532 | 532 | date_default_timezone_set('UTC'); |
533 | 533 | |
534 | 534 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
535 | - $query = 'SELECT spotter_live.altitude, spotter_live.date FROM spotter_live WHERE spotter_live.ident = :ident'; |
|
535 | + $query = 'SELECT spotter_live.altitude, spotter_live.date FROM spotter_live WHERE spotter_live.ident = :ident'; |
|
536 | 536 | |
537 | - try { |
|
537 | + try { |
|
538 | 538 | |
539 | 539 | $sth = $this->db->prepare($query); |
540 | 540 | $sth->execute(array(':ident' => $ident)); |
@@ -547,12 +547,12 @@ discard block |
||
547 | 547 | return $spotter_array; |
548 | 548 | } |
549 | 549 | |
550 | - /** |
|
551 | - * Gets all the spotter information based on a particular id |
|
552 | - * |
|
553 | - * @return Array the spotter information |
|
554 | - * |
|
555 | - */ |
|
550 | + /** |
|
551 | + * Gets all the spotter information based on a particular id |
|
552 | + * |
|
553 | + * @return Array the spotter information |
|
554 | + * |
|
555 | + */ |
|
556 | 556 | public function getAllLiveSpotterDataById($id,$liveinterval = false) |
557 | 557 | { |
558 | 558 | global $globalDBdriver, $globalLiveInterval; |
@@ -580,18 +580,18 @@ discard block |
||
580 | 580 | return $spotter_array; |
581 | 581 | } |
582 | 582 | |
583 | - /** |
|
584 | - * Gets all the spotter information based on a particular ident |
|
585 | - * |
|
586 | - * @return Array the spotter information |
|
587 | - * |
|
588 | - */ |
|
583 | + /** |
|
584 | + * Gets all the spotter information based on a particular ident |
|
585 | + * |
|
586 | + * @return Array the spotter information |
|
587 | + * |
|
588 | + */ |
|
589 | 589 | public function getAllLiveSpotterDataByIdent($ident) |
590 | 590 | { |
591 | 591 | date_default_timezone_set('UTC'); |
592 | 592 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
593 | 593 | $query = self::$global_query.' WHERE spotter_live.ident = :ident'; |
594 | - try { |
|
594 | + try { |
|
595 | 595 | |
596 | 596 | $sth = $this->db->prepare($query); |
597 | 597 | $sth->execute(array(':ident' => $ident)); |
@@ -605,23 +605,23 @@ discard block |
||
605 | 605 | |
606 | 606 | |
607 | 607 | /** |
608 | - * Deletes all info in the table |
|
609 | - * |
|
610 | - * @return String success or false |
|
611 | - * |
|
612 | - */ |
|
608 | + * Deletes all info in the table |
|
609 | + * |
|
610 | + * @return String success or false |
|
611 | + * |
|
612 | + */ |
|
613 | 613 | public function deleteLiveSpotterData() |
614 | 614 | { |
615 | 615 | global $globalDBdriver; |
616 | 616 | if ($globalDBdriver == 'mysql') { |
617 | 617 | //$query = "DELETE FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 MINUTE) >= spotter_live.date"; |
618 | 618 | $query = 'DELETE FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 9 HOUR) >= spotter_live.date'; |
619 | - //$query = "DELETE FROM spotter_live WHERE spotter_live.id IN (SELECT spotter_live.id FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) >= spotter_live.date)"; |
|
619 | + //$query = "DELETE FROM spotter_live WHERE spotter_live.id IN (SELECT spotter_live.id FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) >= spotter_live.date)"; |
|
620 | 620 | } else { |
621 | 621 | $query = "DELETE FROM spotter_live WHERE NOW() AT TIME ZONE 'UTC' - INTERVAL '9 HOURS' >= spotter_live.date"; |
622 | 622 | } |
623 | 623 | |
624 | - try { |
|
624 | + try { |
|
625 | 625 | |
626 | 626 | $sth = $this->db->prepare($query); |
627 | 627 | $sth->execute(); |
@@ -633,18 +633,18 @@ discard block |
||
633 | 633 | } |
634 | 634 | |
635 | 635 | /** |
636 | - * Deletes all info in the table for aircraft not seen since 2 HOUR |
|
637 | - * |
|
638 | - * @return String success or false |
|
639 | - * |
|
640 | - */ |
|
636 | + * Deletes all info in the table for aircraft not seen since 2 HOUR |
|
637 | + * |
|
638 | + * @return String success or false |
|
639 | + * |
|
640 | + */ |
|
641 | 641 | public function deleteLiveSpotterDataNotUpdated() |
642 | 642 | { |
643 | 643 | global $globalDBdriver, $globalDebug; |
644 | 644 | if ($globalDBdriver == 'mysql') { |
645 | 645 | //$query = 'SELECT flightaware_id FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(), INTERVAL 1 HOUR) >= spotter_live.date AND spotter_live.flightaware_id NOT IN (SELECT flightaware_id FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(), INTERVAL 1 HOUR) < spotter_live.date) LIMIT 800 OFFSET 0'; |
646 | - $query = "SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND DATE_SUB(UTC_TIMESTAMP(), INTERVAL 2 HOUR) >= s.max_date LIMIT 1200 OFFSET 0"; |
|
647 | - try { |
|
646 | + $query = "SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND DATE_SUB(UTC_TIMESTAMP(), INTERVAL 2 HOUR) >= s.max_date LIMIT 1200 OFFSET 0"; |
|
647 | + try { |
|
648 | 648 | |
649 | 649 | $sth = $this->db->prepare($query); |
650 | 650 | $sth->execute(); |
@@ -652,8 +652,8 @@ discard block |
||
652 | 652 | return "error"; |
653 | 653 | } |
654 | 654 | $query_delete = 'DELETE FROM spotter_live WHERE flightaware_id IN ('; |
655 | - $i = 0; |
|
656 | - $j =0; |
|
655 | + $i = 0; |
|
656 | + $j =0; |
|
657 | 657 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
658 | 658 | foreach($all as $row) |
659 | 659 | { |
@@ -661,20 +661,20 @@ discard block |
||
661 | 661 | $j++; |
662 | 662 | if ($j == 30) { |
663 | 663 | if ($globalDebug) echo "."; |
664 | - try { |
|
664 | + try { |
|
665 | 665 | |
666 | 666 | $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
667 | 667 | $sth->execute(); |
668 | 668 | } catch(PDOException $e) { |
669 | 669 | return "error"; |
670 | 670 | } |
671 | - $query_delete = 'DELETE FROM spotter_live WHERE flightaware_id IN ('; |
|
672 | - $j = 0; |
|
671 | + $query_delete = 'DELETE FROM spotter_live WHERE flightaware_id IN ('; |
|
672 | + $j = 0; |
|
673 | 673 | } |
674 | 674 | $query_delete .= "'".$row['flightaware_id']."',"; |
675 | 675 | } |
676 | 676 | if ($i > 0) { |
677 | - try { |
|
677 | + try { |
|
678 | 678 | |
679 | 679 | $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
680 | 680 | $sth->execute(); |
@@ -685,9 +685,9 @@ discard block |
||
685 | 685 | return "success"; |
686 | 686 | } elseif ($globalDBdriver == 'pgsql') { |
687 | 687 | //$query = "SELECT flightaware_id FROM spotter_live WHERE NOW() AT TIME ZONE 'UTC' - INTERVAL '9 HOURS' >= spotter_live.date AND spotter_live.flightaware_id NOT IN (SELECT flightaware_id FROM spotter_live WHERE NOW() AT TIME ZONE 'UTC' - INTERVAL '9 HOURS' < spotter_live.date) LIMIT 800 OFFSET 0"; |
688 | - //$query = "SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND NOW() AT TIME ZONE 'UTC' - INTERVAL '2 HOURS' >= s.max_date LIMIT 800 OFFSET 0"; |
|
689 | - $query = "DELETE FROM spotter_live WHERE flightaware_id IN (SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND NOW() AT TIME ZONE 'UTC' - INTERVAL '2 HOURS' >= s.max_date LIMIT 800 OFFSET 0)"; |
|
690 | - try { |
|
688 | + //$query = "SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND NOW() AT TIME ZONE 'UTC' - INTERVAL '2 HOURS' >= s.max_date LIMIT 800 OFFSET 0"; |
|
689 | + $query = "DELETE FROM spotter_live WHERE flightaware_id IN (SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND NOW() AT TIME ZONE 'UTC' - INTERVAL '2 HOURS' >= s.max_date LIMIT 800 OFFSET 0)"; |
|
690 | + try { |
|
691 | 691 | |
692 | 692 | $sth = $this->db->prepare($query); |
693 | 693 | $sth->execute(); |
@@ -731,17 +731,17 @@ discard block |
||
731 | 731 | } |
732 | 732 | |
733 | 733 | /** |
734 | - * Deletes all info in the table for an ident |
|
735 | - * |
|
736 | - * @return String success or false |
|
737 | - * |
|
738 | - */ |
|
734 | + * Deletes all info in the table for an ident |
|
735 | + * |
|
736 | + * @return String success or false |
|
737 | + * |
|
738 | + */ |
|
739 | 739 | public function deleteLiveSpotterDataByIdent($ident) |
740 | 740 | { |
741 | 741 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
742 | 742 | $query = 'DELETE FROM spotter_live WHERE ident = :ident'; |
743 | 743 | |
744 | - try { |
|
744 | + try { |
|
745 | 745 | |
746 | 746 | $sth = $this->db->prepare($query); |
747 | 747 | $sth->execute(array(':ident' => $ident)); |
@@ -753,17 +753,17 @@ discard block |
||
753 | 753 | } |
754 | 754 | |
755 | 755 | /** |
756 | - * Deletes all info in the table for an id |
|
757 | - * |
|
758 | - * @return String success or false |
|
759 | - * |
|
760 | - */ |
|
756 | + * Deletes all info in the table for an id |
|
757 | + * |
|
758 | + * @return String success or false |
|
759 | + * |
|
760 | + */ |
|
761 | 761 | public function deleteLiveSpotterDataById($id) |
762 | 762 | { |
763 | 763 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
764 | 764 | $query = 'DELETE FROM spotter_live WHERE flightaware_id = :id'; |
765 | 765 | |
766 | - try { |
|
766 | + try { |
|
767 | 767 | |
768 | 768 | $sth = $this->db->prepare($query); |
769 | 769 | $sth->execute(array(':id' => $id)); |
@@ -776,11 +776,11 @@ discard block |
||
776 | 776 | |
777 | 777 | |
778 | 778 | /** |
779 | - * Gets the aircraft ident within the last hour |
|
780 | - * |
|
781 | - * @return String the ident |
|
782 | - * |
|
783 | - */ |
|
779 | + * Gets the aircraft ident within the last hour |
|
780 | + * |
|
781 | + * @return String the ident |
|
782 | + * |
|
783 | + */ |
|
784 | 784 | public function getIdentFromLastHour($ident) |
785 | 785 | { |
786 | 786 | global $globalDBdriver, $globalTimezone; |
@@ -806,14 +806,14 @@ discard block |
||
806 | 806 | $ident_result = $row['ident']; |
807 | 807 | } |
808 | 808 | return $ident_result; |
809 | - } |
|
809 | + } |
|
810 | 810 | |
811 | 811 | /** |
812 | - * Check recent aircraft |
|
813 | - * |
|
814 | - * @return String the ident |
|
815 | - * |
|
816 | - */ |
|
812 | + * Check recent aircraft |
|
813 | + * |
|
814 | + * @return String the ident |
|
815 | + * |
|
816 | + */ |
|
817 | 817 | public function checkIdentRecent($ident) |
818 | 818 | { |
819 | 819 | global $globalDBdriver, $globalTimezone; |
@@ -839,14 +839,14 @@ discard block |
||
839 | 839 | $ident_result = $row['flightaware_id']; |
840 | 840 | } |
841 | 841 | return $ident_result; |
842 | - } |
|
842 | + } |
|
843 | 843 | |
844 | 844 | /** |
845 | - * Check recent aircraft by id |
|
846 | - * |
|
847 | - * @return String the ident |
|
848 | - * |
|
849 | - */ |
|
845 | + * Check recent aircraft by id |
|
846 | + * |
|
847 | + * @return String the ident |
|
848 | + * |
|
849 | + */ |
|
850 | 850 | public function checkIdRecent($id) |
851 | 851 | { |
852 | 852 | global $globalDBdriver, $globalTimezone; |
@@ -872,14 +872,14 @@ discard block |
||
872 | 872 | $ident_result = $row['flightaware_id']; |
873 | 873 | } |
874 | 874 | return $ident_result; |
875 | - } |
|
875 | + } |
|
876 | 876 | |
877 | 877 | /** |
878 | - * Check recent aircraft by ModeS |
|
879 | - * |
|
880 | - * @return String the ModeS |
|
881 | - * |
|
882 | - */ |
|
878 | + * Check recent aircraft by ModeS |
|
879 | + * |
|
880 | + * @return String the ModeS |
|
881 | + * |
|
882 | + */ |
|
883 | 883 | public function checkModeSRecent($modes) |
884 | 884 | { |
885 | 885 | global $globalDBdriver, $globalTimezone; |
@@ -906,19 +906,19 @@ discard block |
||
906 | 906 | $ident_result = $row['flightaware_id']; |
907 | 907 | } |
908 | 908 | return $ident_result; |
909 | - } |
|
909 | + } |
|
910 | 910 | |
911 | 911 | /** |
912 | - * Adds a new spotter data |
|
913 | - * |
|
914 | - * @param String $flightaware_id the ID from flightaware |
|
915 | - * @param String $ident the flight ident |
|
916 | - * @param String $aircraft_icao the aircraft type |
|
917 | - * @param String $departure_airport_icao the departure airport |
|
918 | - * @param String $arrival_airport_icao the arrival airport |
|
919 | - * @return String success or false |
|
920 | - * |
|
921 | - */ |
|
912 | + * Adds a new spotter data |
|
913 | + * |
|
914 | + * @param String $flightaware_id the ID from flightaware |
|
915 | + * @param String $ident the flight ident |
|
916 | + * @param String $aircraft_icao the aircraft type |
|
917 | + * @param String $departure_airport_icao the departure airport |
|
918 | + * @param String $arrival_airport_icao the arrival airport |
|
919 | + * @return String success or false |
|
920 | + * |
|
921 | + */ |
|
922 | 922 | public function addLiveSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $altitude_real = '',$heading = '', $groundspeed = '', $date = '',$departure_airport_time = '', $arrival_airport_time = '', $squawk = '', $route_stop = '', $ModeS = '', $putinarchive = false,$registration = '',$pilot_id = '', $pilot_name = '', $verticalrate = '', $noarchive = false, $ground = false,$format_source = '', $source_name = '', $over_country = '') |
923 | 923 | { |
924 | 924 | global $globalURL, $globalArchive, $globalDebug; |
@@ -1053,10 +1053,10 @@ discard block |
||
1053 | 1053 | $arrival_airport_country = ''; |
1054 | 1054 | |
1055 | 1055 | |
1056 | - if ($squawk == '' || $Common->isInteger($squawk) === false ) $squawk = NULL; |
|
1057 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) $verticalrate = NULL; |
|
1058 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0; |
|
1059 | - if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0; |
|
1056 | + if ($squawk == '' || $Common->isInteger($squawk) === false ) $squawk = NULL; |
|
1057 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) $verticalrate = NULL; |
|
1058 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0; |
|
1059 | + if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0; |
|
1060 | 1060 | |
1061 | 1061 | $query = 'INSERT INTO spotter_live (flightaware_id, ident, registration, airline_name, airline_icao, airline_country, airline_type, aircraft_icao, aircraft_shadow, aircraft_name, aircraft_manufacturer, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, latitude, longitude, waypoints, altitude, heading, ground_speed, date, departure_airport_time, arrival_airport_time, squawk, route_stop, ModeS, pilot_id, pilot_name, verticalrate, ground, format_source, source_name, over_country) |
1062 | 1062 | VALUES (:flightaware_id,:ident,:registration,:airline_name,:airline_icao,:airline_country,:airline_type,:aircraft_icao,:aircraft_shadow,:aircraft_type,:aircraft_manufacturer,:departure_airport_icao,:departure_airport_name, :departure_airport_city, :departure_airport_country, :arrival_airport_icao, :arrival_airport_name, :arrival_airport_city, :arrival_airport_country, :latitude,:longitude,:waypoints,:altitude,:heading,:groundspeed,:date,:departure_airport_time,:arrival_airport_time,:squawk,:route_stop,:ModeS, :pilot_id, :pilot_name, :verticalrate, :ground, :format_source, :source_name, :over_country)'; |
@@ -1066,14 +1066,14 @@ discard block |
||
1066 | 1066 | |
1067 | 1067 | $sth = $this->db->prepare($query); |
1068 | 1068 | $sth->execute($query_values); |
1069 | - } catch(PDOException $e) { |
|
1070 | - return "error : ".$e->getMessage(); |
|
1071 | - } |
|
1069 | + } catch(PDOException $e) { |
|
1070 | + return "error : ".$e->getMessage(); |
|
1071 | + } |
|
1072 | 1072 | if (isset($globalArchive) && $globalArchive && $putinarchive && $noarchive !== true) { |
1073 | - if ($globalDebug) echo '(Add to SBS archive : '; |
|
1074 | - $SpotterArchive = new SpotterArchive($this->db); |
|
1075 | - $result = $SpotterArchive->addSpotterArchiveData($flightaware_id, $ident, $registration, $airline_name, $airline_icao, $airline_country, $airline_type, $aircraft_icao, $aircraft_shadow, $aircraft_name, $aircraft_manufacturer, $departure_airport_icao, $departure_airport_name, $departure_airport_city, $departure_airport_country, $departure_airport_time,$arrival_airport_icao, $arrival_airport_name, $arrival_airport_city, $arrival_airport_country, $arrival_airport_time, $route_stop, $date,$latitude, $longitude, $waypoints, $altitude, $heading, $groundspeed, $squawk, $ModeS, $pilot_id, $pilot_name,$verticalrate,$format_source,$source_name, $over_country); |
|
1076 | - if ($globalDebug) echo $result.')'; |
|
1073 | + if ($globalDebug) echo '(Add to SBS archive : '; |
|
1074 | + $SpotterArchive = new SpotterArchive($this->db); |
|
1075 | + $result = $SpotterArchive->addSpotterArchiveData($flightaware_id, $ident, $registration, $airline_name, $airline_icao, $airline_country, $airline_type, $aircraft_icao, $aircraft_shadow, $aircraft_name, $aircraft_manufacturer, $departure_airport_icao, $departure_airport_name, $departure_airport_city, $departure_airport_country, $departure_airport_time,$arrival_airport_icao, $arrival_airport_name, $arrival_airport_city, $arrival_airport_country, $arrival_airport_time, $route_stop, $date,$latitude, $longitude, $waypoints, $altitude, $heading, $groundspeed, $squawk, $ModeS, $pilot_id, $pilot_name,$verticalrate,$format_source,$source_name, $over_country); |
|
1076 | + if ($globalDebug) echo $result.')'; |
|
1077 | 1077 | } |
1078 | 1078 | return "success"; |
1079 | 1079 |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | date_default_timezone_set('UTC'); |
28 | 28 | //waypoint plotting |
29 | 29 | $output .= '{"type": "Feature",'; |
30 | - $output .= '"properties": {'; |
|
30 | + $output .= '"properties": {'; |
|
31 | 31 | $output .= '"name": "'.str_replace('"',"'",$spotter_item['name']).'",'; |
32 | 32 | $output .= '"city": "'.str_replace('"',"'",$spotter_item['city']).'",'; |
33 | 33 | $output .= '"country": "'.$spotter_item['country'].'",'; |
@@ -50,13 +50,13 @@ discard block |
||
50 | 50 | $output .= '"homepage": "'.$spotter_item['home_link'].'",'; |
51 | 51 | $output .= '"image_thumb": "'.$spotter_item['image_thumb'].'"'; |
52 | 52 | // $output .= '"photo": "'.$spotter_item['image_thumbnail'].'",'; |
53 | - $output .= '},'; |
|
54 | - $output .= '"geometry": {'; |
|
53 | + $output .= '},'; |
|
54 | + $output .= '"geometry": {'; |
|
55 | 55 | $output .= '"type": "Point",'; |
56 | 56 | $output .= '"coordinates": ['; |
57 | - $output .= $spotter_item['longitude'].', '.$spotter_item['latitude']; |
|
57 | + $output .= $spotter_item['longitude'].', '.$spotter_item['latitude']; |
|
58 | 58 | $output .= ']'; |
59 | - $output .= '}'; |
|
59 | + $output .= '}'; |
|
60 | 60 | $output .= '},'; |
61 | 61 | } |
62 | 62 | $output = substr($output, 0, -1); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
52 | 52 | print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
53 | 53 | } |
54 | - ?> |
|
54 | + ?> |
|
55 | 55 | </div> |
56 | 56 | <?php include('statistics-sub-menu.php'); ?> |
57 | 57 | <p class="global-stats"> |
@@ -60,23 +60,23 @@ discard block |
||
60 | 60 | <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Arrivals seen"); ?></span> |
61 | 61 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
62 | 62 | <?php |
63 | - if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
63 | + if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
64 | 64 | ?> |
65 | 65 | <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Pilots"); ?></span> |
66 | 66 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
67 | 67 | <?php |
68 | - } else { |
|
69 | - ?> |
|
68 | + } else { |
|
69 | + ?> |
|
70 | 70 | <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Owners"); ?></span> |
71 | 71 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
72 | 72 | <?php |
73 | - } |
|
74 | - ?> |
|
73 | + } |
|
74 | + ?> |
|
75 | 75 | <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Aircrafts types"); ?></span> |
76 | 76 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
77 | 77 | <?php |
78 | - if ($airline_icao == '') { |
|
79 | - ?> |
|
78 | + if ($airline_icao == '') { |
|
79 | + ?> |
|
80 | 80 | <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name,$year,$month)); ?></span> <?php echo _("Airlines"); ?></span> |
81 | 81 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
82 | 82 | <?php |
@@ -99,88 +99,88 @@ discard block |
||
99 | 99 | <div class="col-md-6"> |
100 | 100 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
101 | 101 | <?php |
102 | - $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month); |
|
103 | - if (count($aircraft_array) == 0) print _("No data available"); |
|
104 | - else { |
|
105 | - print '<div id="chart1" class="chart" width="100%"></div><script>'; |
|
106 | - $aircraft_data = ''; |
|
107 | - foreach($aircraft_array as $aircraft_item) |
|
108 | - { |
|
109 | - $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
110 | - } |
|
111 | - $aircraft_data = substr($aircraft_data, 0, -1); |
|
112 | - print 'var series = ['.$aircraft_data.'];'; |
|
113 | - print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
|
114 | - print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#e6e6f6","#1a3151"]);'; |
|
115 | - print 'series.forEach(function(item){var lab = item[0], value = item[1]; dataset.push({"label":lab,"value":value,"color":paletteScale(value)});});'; |
|
116 | - print 'var aircraftype = new d3pie("chart1",{"header":{"title":{"fontSize":24,"font":"open sans"},"subtitle":{"color":"#999999","fontSize":12,"font":"open sans"},"titleSubtitlePadding":9},"footer":{"color":"#999999","fontSize":10,"font":"open sans","location":"bottom-left"},"size":{"canvasWidth":700,"pieOuterRadius":"60%"},"data":{"sortOrder":"value-desc","content":'; |
|
117 | - print 'dataset'; |
|
118 | - print '},"labels":{"outer":{"pieDistance":32},"inner":{"hideWhenLessThanPercentage":3},"mainLabel":{"fontSize":11},"percentage":{"color":"#ffffff","decimalPlaces":0},"value":{"color":"#adadad","fontSize":11},"lines":{"enabled":true},"truncation":{"enabled":true}},"effects":{"pullOutSegmentOnClick":{"effect":"linear","speed":400,"size":8}},"misc":{"gradient":{"enabled":true,"percentage":100}}});'; |
|
119 | - print '</script>'; |
|
120 | - } |
|
121 | - ?> |
|
102 | + $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month); |
|
103 | + if (count($aircraft_array) == 0) print _("No data available"); |
|
104 | + else { |
|
105 | + print '<div id="chart1" class="chart" width="100%"></div><script>'; |
|
106 | + $aircraft_data = ''; |
|
107 | + foreach($aircraft_array as $aircraft_item) |
|
108 | + { |
|
109 | + $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
110 | + } |
|
111 | + $aircraft_data = substr($aircraft_data, 0, -1); |
|
112 | + print 'var series = ['.$aircraft_data.'];'; |
|
113 | + print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
|
114 | + print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#e6e6f6","#1a3151"]);'; |
|
115 | + print 'series.forEach(function(item){var lab = item[0], value = item[1]; dataset.push({"label":lab,"value":value,"color":paletteScale(value)});});'; |
|
116 | + print 'var aircraftype = new d3pie("chart1",{"header":{"title":{"fontSize":24,"font":"open sans"},"subtitle":{"color":"#999999","fontSize":12,"font":"open sans"},"titleSubtitlePadding":9},"footer":{"color":"#999999","fontSize":10,"font":"open sans","location":"bottom-left"},"size":{"canvasWidth":700,"pieOuterRadius":"60%"},"data":{"sortOrder":"value-desc","content":'; |
|
117 | + print 'dataset'; |
|
118 | + print '},"labels":{"outer":{"pieDistance":32},"inner":{"hideWhenLessThanPercentage":3},"mainLabel":{"fontSize":11},"percentage":{"color":"#ffffff","decimalPlaces":0},"value":{"color":"#adadad","fontSize":11},"lines":{"enabled":true},"truncation":{"enabled":true}},"effects":{"pullOutSegmentOnClick":{"effect":"linear","speed":400,"size":8}},"misc":{"gradient":{"enabled":true,"percentage":100}}});'; |
|
119 | + print '</script>'; |
|
120 | + } |
|
121 | + ?> |
|
122 | 122 | <div class="more"> |
123 | 123 | <?php |
124 | - if ($year != '' && $month != '') { |
|
125 | - ?> |
|
124 | + if ($year != '' && $month != '') { |
|
125 | + ?> |
|
126 | 126 | <a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year; ?>/<?php echo $month ?>/" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
127 | 127 | <?php |
128 | - } else { |
|
129 | - ?> |
|
128 | + } else { |
|
129 | + ?> |
|
130 | 130 | <a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
131 | 131 | <?php |
132 | - } |
|
133 | - ?> |
|
132 | + } |
|
133 | + ?> |
|
134 | 134 | </div> |
135 | 135 | </div> |
136 | 136 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
137 | 137 | <?php |
138 | 138 | // echo $airline_icao; |
139 | - if ($airline_icao == '' || $airline_icao == 'all') { |
|
139 | + if ($airline_icao == '' || $airline_icao == 'all') { |
|
140 | 140 | $airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month); |
141 | 141 | if (count($airline_array) > 0) { |
142 | - print '<div class="col-md-6">'; |
|
143 | - print '<h2>'._("Top 10 Most Common Airline").'</h2>'; |
|
144 | - print '<div id="chart2" class="chart" width="100%"></div><script>'; |
|
145 | - $airline_data = ''; |
|
146 | - foreach($airline_array as $airline_item) |
|
147 | - { |
|
142 | + print '<div class="col-md-6">'; |
|
143 | + print '<h2>'._("Top 10 Most Common Airline").'</h2>'; |
|
144 | + print '<div id="chart2" class="chart" width="100%"></div><script>'; |
|
145 | + $airline_data = ''; |
|
146 | + foreach($airline_array as $airline_item) |
|
147 | + { |
|
148 | 148 | $airline_data .= '["'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
149 | - } |
|
150 | - $airline_data = substr($airline_data, 0, -1); |
|
151 | - print 'var series = ['.$airline_data.'];'; |
|
152 | - print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
|
153 | - print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);'; |
|
154 | - print 'series.forEach(function(item){var lab = item[0], value = item[1]; dataset.push({"label":lab,"value":value,"color":paletteScale(value)});});'; |
|
155 | - print 'var airlinescnt = new d3pie("chart2",{"header":{"title":{"fontSize":24,"font":"open sans"},"subtitle":{"color":"#999999","fontSize":12,"font":"open sans"},"titleSubtitlePadding":9},"footer":{"color":"#999999","fontSize":10,"font":"open sans","location":"bottom-left"},"size":{"canvasWidth":700,"pieOuterRadius":"60%"},"data":{"sortOrder":"value-desc","content":'; |
|
156 | - print 'dataset'; |
|
157 | - print '},"labels":{"outer":{"pieDistance":32},"inner":{"hideWhenLessThanPercentage":3},"mainLabel":{"fontSize":11},"percentage":{"color":"#ffffff","decimalPlaces":0},"value":{"color":"#adadad","fontSize":11},"lines":{"enabled":true},"truncation":{"enabled":true}},"effects":{"pullOutSegmentOnClick":{"effect":"linear","speed":400,"size":8}},"misc":{"gradient":{"enabled":true,"percentage":100}}});'; |
|
158 | - print '</script>'; |
|
159 | - if ($year != '' && $month != '') { |
|
149 | + } |
|
150 | + $airline_data = substr($airline_data, 0, -1); |
|
151 | + print 'var series = ['.$airline_data.'];'; |
|
152 | + print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
|
153 | + print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);'; |
|
154 | + print 'series.forEach(function(item){var lab = item[0], value = item[1]; dataset.push({"label":lab,"value":value,"color":paletteScale(value)});});'; |
|
155 | + print 'var airlinescnt = new d3pie("chart2",{"header":{"title":{"fontSize":24,"font":"open sans"},"subtitle":{"color":"#999999","fontSize":12,"font":"open sans"},"titleSubtitlePadding":9},"footer":{"color":"#999999","fontSize":10,"font":"open sans","location":"bottom-left"},"size":{"canvasWidth":700,"pieOuterRadius":"60%"},"data":{"sortOrder":"value-desc","content":'; |
|
156 | + print 'dataset'; |
|
157 | + print '},"labels":{"outer":{"pieDistance":32},"inner":{"hideWhenLessThanPercentage":3},"mainLabel":{"fontSize":11},"percentage":{"color":"#ffffff","decimalPlaces":0},"value":{"color":"#adadad","fontSize":11},"lines":{"enabled":true},"truncation":{"enabled":true}},"effects":{"pullOutSegmentOnClick":{"effect":"linear","speed":400,"size":8}},"misc":{"gradient":{"enabled":true,"percentage":100}}});'; |
|
158 | + print '</script>'; |
|
159 | + if ($year != '' && $month != '') { |
|
160 | 160 | print '<div class="more"><a href="'.$globalURL.'/statistics/airline'; |
161 | 161 | if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; |
162 | 162 | print '/'.$year.'/'.$month.'/" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
163 | - } else { |
|
163 | + } else { |
|
164 | 164 | print '<div class="more"><a href="'.$globalURL.'/statistics/airline'; |
165 | 165 | if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; |
166 | 166 | print '" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
167 | - } |
|
168 | - print '</div>'; |
|
167 | + } |
|
168 | + print '</div>'; |
|
169 | 169 | } |
170 | 170 | ?> |
171 | 171 | </div> |
172 | 172 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
173 | 173 | <?php |
174 | - } |
|
174 | + } |
|
175 | 175 | ?> |
176 | 176 | <div class="row column"> |
177 | 177 | <?php |
178 | - $flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month); |
|
179 | - if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
178 | + $flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month); |
|
179 | + if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
180 | 180 | if (empty($flightover_array)) { |
181 | - print '<div class="col-md-12">'; |
|
181 | + print '<div class="col-md-12">'; |
|
182 | 182 | } else { |
183 | - print '<div class="col-md-6">'; |
|
183 | + print '<div class="col-md-6">'; |
|
184 | 184 | } |
185 | 185 | ?> |
186 | 186 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
@@ -188,23 +188,23 @@ discard block |
||
188 | 188 | $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month); |
189 | 189 | if (count($pilot_array) == 0) print _("No data available"); |
190 | 190 | else { |
191 | - print '<div id="chart7" class="chart" width="100%"></div><script>'; |
|
192 | - $pilot_data = ''; |
|
193 | - foreach($pilot_array as $pilot_item) |
|
194 | - { |
|
191 | + print '<div id="chart7" class="chart" width="100%"></div><script>'; |
|
192 | + $pilot_data = ''; |
|
193 | + foreach($pilot_array as $pilot_item) |
|
194 | + { |
|
195 | 195 | $pilot_data .= '["'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
196 | - } |
|
197 | - $pilot_data = substr($pilot_data, 0, -1); |
|
198 | - print 'var series = ['.$pilot_data.'];'; |
|
199 | - print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
|
200 | - print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);'; |
|
201 | - print 'series.forEach(function(item){var lab = item[0], value = item[1]; dataset.push({"label":lab,"value":value,"color":paletteScale(value)});});'; |
|
202 | - print 'var pilotcnt = new d3pie("chart7",{"header":{"title":{"fontSize":24,"font":"open sans"},"subtitle":{"color":"#999999","fontSize":12,"font":"open sans"},"titleSubtitlePadding":9},"footer":{"color":"#999999","fontSize":10,"font":"open sans","location":"bottom-left"},"size":{"canvasWidth":700,"pieOuterRadius":"60%"},"data":{"sortOrder":"value-desc","content":'; |
|
203 | - print 'dataset'; |
|
204 | - print '},"labels":{"outer":{"pieDistance":32},"inner":{"hideWhenLessThanPercentage":3},"mainLabel":{"fontSize":11},"percentage":{"color":"#ffffff","decimalPlaces":0},"value":{"color":"#adadad","fontSize":11},"lines":{"enabled":true},"truncation":{"enabled":true}},"effects":{"pullOutSegmentOnClick":{"effect":"linear","speed":400,"size":8}},"misc":{"gradient":{"enabled":true,"percentage":100}}});'; |
|
205 | - print '</script>'; |
|
206 | - } |
|
207 | - print '<div class="more">'; |
|
196 | + } |
|
197 | + $pilot_data = substr($pilot_data, 0, -1); |
|
198 | + print 'var series = ['.$pilot_data.'];'; |
|
199 | + print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
|
200 | + print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);'; |
|
201 | + print 'series.forEach(function(item){var lab = item[0], value = item[1]; dataset.push({"label":lab,"value":value,"color":paletteScale(value)});});'; |
|
202 | + print 'var pilotcnt = new d3pie("chart7",{"header":{"title":{"fontSize":24,"font":"open sans"},"subtitle":{"color":"#999999","fontSize":12,"font":"open sans"},"titleSubtitlePadding":9},"footer":{"color":"#999999","fontSize":10,"font":"open sans","location":"bottom-left"},"size":{"canvasWidth":700,"pieOuterRadius":"60%"},"data":{"sortOrder":"value-desc","content":'; |
|
203 | + print 'dataset'; |
|
204 | + print '},"labels":{"outer":{"pieDistance":32},"inner":{"hideWhenLessThanPercentage":3},"mainLabel":{"fontSize":11},"percentage":{"color":"#ffffff","decimalPlaces":0},"value":{"color":"#adadad","fontSize":11},"lines":{"enabled":true},"truncation":{"enabled":true}},"effects":{"pullOutSegmentOnClick":{"effect":"linear","speed":400,"size":8}},"misc":{"gradient":{"enabled":true,"percentage":100}}});'; |
|
205 | + print '</script>'; |
|
206 | + } |
|
207 | + print '<div class="more">'; |
|
208 | 208 | print '<a href="'.$globalURL.'/statistics/pilot'; |
209 | 209 | if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; |
210 | 210 | print'" class="btn btn-default btn" role="button">'._("See full statistic").'»</a>'; |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
216 | 216 | <?php |
217 | - } else { |
|
217 | + } else { |
|
218 | 218 | ?> |
219 | 219 | <div class="col-md-6"> |
220 | 220 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
@@ -222,21 +222,21 @@ discard block |
||
222 | 222 | $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month); |
223 | 223 | if (count($owner_array) == 0) print _("No data available"); |
224 | 224 | else { |
225 | - print '<div id="chart7" class="chart" width="100%"></div><script>'; |
|
226 | - $owner_data = ''; |
|
227 | - foreach($owner_array as $owner_item) |
|
228 | - { |
|
225 | + print '<div id="chart7" class="chart" width="100%"></div><script>'; |
|
226 | + $owner_data = ''; |
|
227 | + foreach($owner_array as $owner_item) |
|
228 | + { |
|
229 | 229 | $owner_data .= '["'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
230 | - } |
|
231 | - $owner_data = substr($owner_data, 0, -1); |
|
232 | - print 'var series = ['.$owner_data.'];'; |
|
233 | - print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
|
234 | - print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);'; |
|
235 | - print 'series.forEach(function(item){var lab = item[0], value = item[1]; dataset.push({"label":lab,"value":value,"color":paletteScale(value)});});'; |
|
236 | - print 'var ownercnt = new d3pie("chart7",{"header":{"title":{"fontSize":24,"font":"open sans"},"subtitle":{"color":"#999999","fontSize":12,"font":"open sans"},"titleSubtitlePadding":9},"footer":{"color":"#999999","fontSize":10,"font":"open sans","location":"bottom-left"},"size":{"canvasWidth":700,"pieOuterRadius":"60%"},"data":{"sortOrder":"value-desc","content":'; |
|
237 | - print 'dataset'; |
|
238 | - print '},"labels":{"outer":{"pieDistance":32},"inner":{"hideWhenLessThanPercentage":3},"mainLabel":{"fontSize":11},"percentage":{"color":"#ffffff","decimalPlaces":0},"value":{"color":"#adadad","fontSize":11},"lines":{"enabled":true},"truncation":{"enabled":true}},"effects":{"pullOutSegmentOnClick":{"effect":"linear","speed":400,"size":8}},"misc":{"gradient":{"enabled":true,"percentage":100}}});'; |
|
239 | - print '</script>'; |
|
230 | + } |
|
231 | + $owner_data = substr($owner_data, 0, -1); |
|
232 | + print 'var series = ['.$owner_data.'];'; |
|
233 | + print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
|
234 | + print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);'; |
|
235 | + print 'series.forEach(function(item){var lab = item[0], value = item[1]; dataset.push({"label":lab,"value":value,"color":paletteScale(value)});});'; |
|
236 | + print 'var ownercnt = new d3pie("chart7",{"header":{"title":{"fontSize":24,"font":"open sans"},"subtitle":{"color":"#999999","fontSize":12,"font":"open sans"},"titleSubtitlePadding":9},"footer":{"color":"#999999","fontSize":10,"font":"open sans","location":"bottom-left"},"size":{"canvasWidth":700,"pieOuterRadius":"60%"},"data":{"sortOrder":"value-desc","content":'; |
|
237 | + print 'dataset'; |
|
238 | + print '},"labels":{"outer":{"pieDistance":32},"inner":{"hideWhenLessThanPercentage":3},"mainLabel":{"fontSize":11},"percentage":{"color":"#ffffff","decimalPlaces":0},"value":{"color":"#adadad","fontSize":11},"lines":{"enabled":true},"truncation":{"enabled":true}},"effects":{"pullOutSegmentOnClick":{"effect":"linear","speed":400,"size":8}},"misc":{"gradient":{"enabled":true,"percentage":100}}});'; |
|
239 | + print '</script>'; |
|
240 | 240 | } |
241 | 241 | ?> |
242 | 242 | <div class="more"> |
@@ -246,8 +246,8 @@ discard block |
||
246 | 246 | |
247 | 247 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
248 | 248 | <?php |
249 | - } |
|
250 | - if (!empty($flightover_array)) { |
|
249 | + } |
|
250 | + if (!empty($flightover_array)) { |
|
251 | 251 | ?> |
252 | 252 | <div class="col-md-6"> |
253 | 253 | <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2> |
@@ -255,20 +255,20 @@ discard block |
||
255 | 255 | //$flightover_array = $Stats->countAllFlightOverCountries(); |
256 | 256 | if (count($flightover_array) == 0) print _("No data available"); |
257 | 257 | else { |
258 | - print '<div id="chart10" class="chart" width="100%"></div><script>'; |
|
259 | - print 'var series = ['; |
|
260 | - $flightover_data = ''; |
|
261 | - foreach($flightover_array as $flightover_item) |
|
262 | - { |
|
258 | + print '<div id="chart10" class="chart" width="100%"></div><script>'; |
|
259 | + print 'var series = ['; |
|
260 | + $flightover_data = ''; |
|
261 | + foreach($flightover_array as $flightover_item) |
|
262 | + { |
|
263 | 263 | $flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],'; |
264 | - } |
|
265 | - $flightover_data = substr($flightover_data, 0, -1); |
|
266 | - print $flightover_data; |
|
267 | - print '];'; |
|
268 | - print 'var dataset = {};var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
|
269 | - print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);'; |
|
270 | - print 'series.forEach(function(item){var iso = item[0], value = item[1]; dataset[iso] = { numberOfThings: value, fillColor: paletteScale(value) };});'; |
|
271 | - print 'new Datamap({ |
|
264 | + } |
|
265 | + $flightover_data = substr($flightover_data, 0, -1); |
|
266 | + print $flightover_data; |
|
267 | + print '];'; |
|
268 | + print 'var dataset = {};var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
|
269 | + print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);'; |
|
270 | + print 'series.forEach(function(item){var iso = item[0], value = item[1]; dataset[iso] = { numberOfThings: value, fillColor: paletteScale(value) };});'; |
|
271 | + print 'new Datamap({ |
|
272 | 272 | element: document.getElementById("chart10"), |
273 | 273 | projection: "mercator", // big world map |
274 | 274 | fills: { defaultFill: "#F5F5F5" }, |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | } |
294 | 294 | } |
295 | 295 | });"; |
296 | - print '</script>'; |
|
296 | + print '</script>'; |
|
297 | 297 | } |
298 | 298 | ?> |
299 | 299 | <div class="more"> |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | </div> |
302 | 302 | </div> |
303 | 303 | <?php |
304 | - } |
|
304 | + } |
|
305 | 305 | ?> |
306 | 306 | </div> |
307 | 307 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
@@ -311,13 +311,13 @@ discard block |
||
311 | 311 | <div class="row column"> |
312 | 312 | <div class="col-md-6"> |
313 | 313 | <?php |
314 | - $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month); |
|
315 | - if (count($airport_airport_array) > 0) { |
|
314 | + $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month); |
|
315 | + if (count($airport_airport_array) > 0) { |
|
316 | 316 | print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>'; |
317 | 317 | print '<div id="chart3" class="chart" width="100%"></div><script>'; |
318 | - print "\n"; |
|
319 | - print 'var series = ['; |
|
320 | - $airport_data = ''; |
|
318 | + print "\n"; |
|
319 | + print 'var series = ['; |
|
320 | + $airport_data = ''; |
|
321 | 321 | foreach($airport_airport_array as $airport_item) |
322 | 322 | { |
323 | 323 | $airport_data .= '[ "'.$airport_item['airport_departure_icao_count'].'", "'.$airport_item['airport_departure_icao'].'",'.$airport_item['airport_departure_latitude'].','.$airport_item['airport_departure_longitude'].'],'; |
@@ -366,20 +366,20 @@ discard block |
||
366 | 366 | print '<div class="more"><a href="'.$globalURL.'/statistics/airport-departure'; |
367 | 367 | if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; |
368 | 368 | print '" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
369 | - } |
|
369 | + } |
|
370 | 370 | ?> |
371 | 371 | </div> |
372 | 372 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
373 | 373 | |
374 | 374 | <div class="col-md-6"> |
375 | 375 | <?php |
376 | - $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month); |
|
377 | - if (count($airport_airport_array2) > 0) { |
|
376 | + $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month); |
|
377 | + if (count($airport_airport_array2) > 0) { |
|
378 | 378 | print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>'; |
379 | 379 | print '<div id="chart4" class="chart" width="100%"></div><script>'; |
380 | - print "\n"; |
|
381 | - print 'var series = ['; |
|
382 | - $airport_data = ''; |
|
380 | + print "\n"; |
|
381 | + print 'var series = ['; |
|
382 | + $airport_data = ''; |
|
383 | 383 | foreach($airport_airport_array2 as $airport_item) |
384 | 384 | { |
385 | 385 | $airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],'; |
@@ -429,28 +429,28 @@ discard block |
||
429 | 429 | print '<div class="more"><a href="'.$globalURL.'/statistics/airport-arrival'; |
430 | 430 | if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; |
431 | 431 | print '" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
432 | - } |
|
432 | + } |
|
433 | 433 | ?> |
434 | 434 | </div> |
435 | 435 | </div> |
436 | 436 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
437 | 437 | <?php |
438 | - if ($year == '' && $month == '') { |
|
438 | + if ($year == '' && $month == '') { |
|
439 | 439 | ?> |
440 | 440 | <div class="row column"> |
441 | 441 | <div class="col-md-6"> |
442 | 442 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
443 | 443 | <?php |
444 | - $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
445 | - if (count($year_array) == 0) print _("No data available"); |
|
446 | - else { |
|
444 | + $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
445 | + if (count($year_array) == 0) print _("No data available"); |
|
446 | + else { |
|
447 | 447 | print '<div id="chart8" class="chart" width="100%"></div><script>'; |
448 | 448 | $year_data = ''; |
449 | 449 | $year_cnt = ''; |
450 | 450 | foreach($year_array as $year_item) |
451 | 451 | { |
452 | - $year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",'; |
|
453 | - $year_cnt .= $year_item['date_count'].','; |
|
452 | + $year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",'; |
|
453 | + $year_cnt .= $year_item['date_count'].','; |
|
454 | 454 | } |
455 | 455 | $year_data = "['x',".substr($year_data, 0, -1)."]"; |
456 | 456 | $year_cnt = "['flights',".substr($year_cnt,0,-1)."]"; |
@@ -460,8 +460,8 @@ discard block |
||
460 | 460 | columns: ['.$year_data.','.$year_cnt.'], types: { flights: "area"}, colors: { flights: "#1a3151"}}, |
461 | 461 | axis: { x: { type: "timeseries", localtime: false,tick: { format: "%Y-%m"}}, y: { label: "# of Flights"}},legend: { show: false }});'; |
462 | 462 | print '</script>'; |
463 | - } |
|
464 | - ?> |
|
463 | + } |
|
464 | + ?> |
|
465 | 465 | <div class="more"> |
466 | 466 | <a href="<?php print $globalURL; ?>/statistics/year<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
467 | 467 | </div> |
@@ -470,16 +470,16 @@ discard block |
||
470 | 470 | <div class="col-md-6"> |
471 | 471 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
472 | 472 | <?php |
473 | - $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
474 | - if (count($month_array) == 0) print _("No data available"); |
|
475 | - else { |
|
476 | - print '<div id="chart9" class="chart" width="100%"></div><script>'; |
|
477 | - $month_data = ''; |
|
473 | + $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
474 | + if (count($month_array) == 0) print _("No data available"); |
|
475 | + else { |
|
476 | + print '<div id="chart9" class="chart" width="100%"></div><script>'; |
|
477 | + $month_data = ''; |
|
478 | 478 | $month_cnt = ''; |
479 | 479 | foreach($month_array as $month_item) |
480 | 480 | { |
481 | - $month_data .= '"'.$month_item['date_name'].'",'; |
|
482 | - $month_cnt .= $month_item['date_count'].','; |
|
481 | + $month_data .= '"'.$month_item['date_name'].'",'; |
|
482 | + $month_cnt .= $month_item['date_count'].','; |
|
483 | 483 | } |
484 | 484 | $month_data = "['x',".substr($month_data, 0, -1)."]"; |
485 | 485 | $month_cnt = "['flights',".substr($month_cnt,0,-1)."]"; |
@@ -489,9 +489,9 @@ discard block |
||
489 | 489 | columns: ['.$month_data.','.$month_cnt.'], types: { flights: "area"}, colors: { flights: "#1a3151"}}, |
490 | 490 | axis: { x: { type: "timeseries", localtime: false,tick: { format: "%Y-%m-%d"}}, y: { label: "# of Flights"}},legend: { show: false }});'; |
491 | 491 | |
492 | - print '</script>'; |
|
493 | - } |
|
494 | - ?> |
|
492 | + print '</script>'; |
|
493 | + } |
|
494 | + ?> |
|
495 | 495 | <div class="more"> |
496 | 496 | <a href="<?php print $globalURL; ?>/statistics/month<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
497 | 497 | </div> |
@@ -501,16 +501,16 @@ discard block |
||
501 | 501 | <div class="col-md-6"> |
502 | 502 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
503 | 503 | <?php |
504 | - $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
505 | - if (empty($date_array)) print _("No data available"); |
|
506 | - else { |
|
507 | - print '<div id="chart5" class="chart" width="100%"></div><script>'; |
|
508 | - $date_data = ''; |
|
504 | + $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
505 | + if (empty($date_array)) print _("No data available"); |
|
506 | + else { |
|
507 | + print '<div id="chart5" class="chart" width="100%"></div><script>'; |
|
508 | + $date_data = ''; |
|
509 | 509 | $date_cnt = ''; |
510 | 510 | foreach($date_array as $date_item) |
511 | 511 | { |
512 | - $date_data .= '"'.$date_item['date_name'].'",'; |
|
513 | - $date_cnt .= $date_item['date_count'].','; |
|
512 | + $date_data .= '"'.$date_item['date_name'].'",'; |
|
513 | + $date_cnt .= $date_item['date_count'].','; |
|
514 | 514 | } |
515 | 515 | $date_data = "['x',".substr($date_data, 0, -1)."]"; |
516 | 516 | $date_cnt = "['flights',".substr($date_cnt,0,-1)."]"; |
@@ -520,9 +520,9 @@ discard block |
||
520 | 520 | columns: ['.$date_data.','.$date_cnt.'], types: { flights: "area"}, colors: { flights: "#1a3151"}}, |
521 | 521 | axis: { x: { type: "timeseries",tick: { format: "%Y-%m-%d"}}, y: { label: "# of Flights"}},legend: { show: false }});'; |
522 | 522 | |
523 | - print '</script>'; |
|
524 | - } |
|
525 | - ?> |
|
523 | + print '</script>'; |
|
524 | + } |
|
525 | + ?> |
|
526 | 526 | <div class="more"> |
527 | 527 | <a href="<?php print $globalURL; ?>/statistics/date<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
528 | 528 | </div> |
@@ -531,16 +531,16 @@ discard block |
||
531 | 531 | <div class="col-md-6"> |
532 | 532 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
533 | 533 | <?php |
534 | - $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
535 | - if (empty($hour_array)) print _("No data available"); |
|
536 | - else { |
|
537 | - print '<div id="chart6" class="chart" width="100%"></div><script>'; |
|
538 | - $hour_data = ''; |
|
534 | + $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
535 | + if (empty($hour_array)) print _("No data available"); |
|
536 | + else { |
|
537 | + print '<div id="chart6" class="chart" width="100%"></div><script>'; |
|
538 | + $hour_data = ''; |
|
539 | 539 | $hour_cnt = ''; |
540 | 540 | foreach($hour_array as $hour_item) |
541 | 541 | { |
542 | - $hour_data .= '"'.$hour_item['hour_name'].':00",'; |
|
543 | - $hour_cnt .= $hour_item['hour_count'].','; |
|
542 | + $hour_data .= '"'.$hour_item['hour_name'].':00",'; |
|
543 | + $hour_cnt .= $hour_item['hour_count'].','; |
|
544 | 544 | } |
545 | 545 | $hour_data = "[".substr($hour_data, 0, -1)."]"; |
546 | 546 | $hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]"; |
@@ -550,9 +550,9 @@ discard block |
||
550 | 550 | columns: ['.$hour_cnt.'], types: { flights: "area"}, colors: { flights: "#1a3151"}}, |
551 | 551 | axis: { x: { type: "category", categories: '.$hour_data.'},y: { label: "# of Flights"}},legend: { show: false }});'; |
552 | 552 | |
553 | - print '</script>'; |
|
554 | - } |
|
555 | - ?> |
|
553 | + print '</script>'; |
|
554 | + } |
|
555 | + ?> |
|
556 | 556 | <div class="more"> |
557 | 557 | <a href="<?php print $globalURL; ?>/statistics/time<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
558 | 558 | </div> |
@@ -560,26 +560,26 @@ discard block |
||
560 | 560 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
561 | 561 | </div> |
562 | 562 | <?php |
563 | - } |
|
563 | + } |
|
564 | 564 | ?> |
565 | 565 | |
566 | 566 | <?php |
567 | - if (($airline_icao == '' || $airline_icao == 'all') && $year == '' && $month == '' && isset($globalAccidents) && $globalAccidents) { |
|
567 | + if (($airline_icao == '' || $airline_icao == 'all') && $year == '' && $month == '' && isset($globalAccidents) && $globalAccidents) { |
|
568 | 568 | ?> |
569 | 569 | <div class="row column"> |
570 | 570 | <div class="col-md-6"> |
571 | 571 | <h2><?php echo _("Fatalities by Years"); ?></h2> |
572 | 572 | <?php |
573 | - $year_array = $Stats->countFatalitiesByYear(); |
|
574 | - if (count($year_array) == 0) print _("No data available"); |
|
575 | - else { |
|
573 | + $year_array = $Stats->countFatalitiesByYear(); |
|
574 | + if (count($year_array) == 0) print _("No data available"); |
|
575 | + else { |
|
576 | 576 | print '<div id="chart32" class="chart" width="100%"></div><script>'; |
577 | - $year_data = ''; |
|
577 | + $year_data = ''; |
|
578 | 578 | $year_cnt = ''; |
579 | 579 | foreach($year_array as $year_item) |
580 | 580 | { |
581 | - $year_data .= '"'.$year_item['year'].'-01-01",'; |
|
582 | - $year_cnt .= $year_item['count'].','; |
|
581 | + $year_data .= '"'.$year_item['year'].'-01-01",'; |
|
582 | + $year_cnt .= $year_item['count'].','; |
|
583 | 583 | } |
584 | 584 | $year_data = "['x',".substr($year_data, 0, -1)."]"; |
585 | 585 | $year_cnt = "['flights',".substr($year_cnt,0,-1)."]"; |
@@ -590,8 +590,8 @@ discard block |
||
590 | 590 | axis: { x: { type: "timeseries",tick: { format: "%Y"}}, y: { label: "# of Fatalities"}},legend: { show: false }});'; |
591 | 591 | |
592 | 592 | print '</script>'; |
593 | - } |
|
594 | - ?> |
|
593 | + } |
|
594 | + ?> |
|
595 | 595 | <div class="more"> |
596 | 596 | <a href="<?php print $globalURL; ?>/statistics/fatalities/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
597 | 597 | </div> |
@@ -602,16 +602,16 @@ discard block |
||
602 | 602 | <div class="col-md-6"> |
603 | 603 | <h2><?php echo _("Fatalities last 12 Months"); ?></h2> |
604 | 604 | <?php |
605 | - $year_array = $Stats->countFatalitiesLast12Months(); |
|
606 | - if (count($year_array) == 0) print _("No data available"); |
|
607 | - else { |
|
605 | + $year_array = $Stats->countFatalitiesLast12Months(); |
|
606 | + if (count($year_array) == 0) print _("No data available"); |
|
607 | + else { |
|
608 | 608 | print '<div id="chart33" class="chart" width="100%"></div><script>'; |
609 | - $year_data = ''; |
|
609 | + $year_data = ''; |
|
610 | 610 | $year_cnt = ''; |
611 | 611 | foreach($year_array as $year_item) |
612 | 612 | { |
613 | - $year_data .= '"'.$year_item['year'].'-'.$year_item['month'].'-01",'; |
|
614 | - $year_cnt .= $year_item['count'].','; |
|
613 | + $year_data .= '"'.$year_item['year'].'-'.$year_item['month'].'-01",'; |
|
614 | + $year_cnt .= $year_item['count'].','; |
|
615 | 615 | } |
616 | 616 | $year_data = "['x',".substr($year_data, 0, -1)."]"; |
617 | 617 | $year_cnt = "['flights',".substr($year_cnt,0,-1)."]"; |
@@ -621,8 +621,8 @@ discard block |
||
621 | 621 | columns: ['.$year_data.','.$year_cnt.'], types: { flights: "area"}, colors: { flights: "#1a3151"}}, |
622 | 622 | axis: { x: { type: "timeseries",tick: { format: "%Y-%m"}}, y: { label: "# of Fatalities"}},legend: { show: false }});'; |
623 | 623 | print '</script>'; |
624 | - } |
|
625 | - ?> |
|
624 | + } |
|
625 | + ?> |
|
626 | 626 | <div class="more"> |
627 | 627 | <a href="<?php print $globalURL; ?>/statistics/fatalities/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
628 | 628 | </div> |
@@ -630,30 +630,30 @@ discard block |
||
630 | 630 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
631 | 631 | <br/> |
632 | 632 | <?php |
633 | - } |
|
633 | + } |
|
634 | 634 | ?> |
635 | 635 | |
636 | 636 | <?php |
637 | - if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '' && $year == '' && $month == '') { |
|
637 | + if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '' && $year == '' && $month == '') { |
|
638 | 638 | ?> |
639 | 639 | <div class="row column"> |
640 | 640 | <?php |
641 | - //$polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
642 | - if ($year == '' && $month == '') { |
|
643 | - $polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d')); |
|
644 | - } else { |
|
645 | - $polar = $Stats->getStatsSource('polar',$year,$month); |
|
646 | - } |
|
647 | - if (!empty($polar)) { |
|
648 | - print '<h2>'._("Coverage pattern").'</h2>'; |
|
649 | - foreach ($polar as $eachpolar) { |
|
650 | - unset($polar_data); |
|
651 | - $Spotter = new Spotter(); |
|
652 | - $data = json_decode($eachpolar['source_data']); |
|
653 | - foreach($data as $value => $key) { |
|
654 | - $direction = $Spotter->parseDirection(($value*22.5)); |
|
655 | - $distance = $key; |
|
656 | - $unit = 'km'; |
|
641 | + //$polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
642 | + if ($year == '' && $month == '') { |
|
643 | + $polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d')); |
|
644 | + } else { |
|
645 | + $polar = $Stats->getStatsSource('polar',$year,$month); |
|
646 | + } |
|
647 | + if (!empty($polar)) { |
|
648 | + print '<h2>'._("Coverage pattern").'</h2>'; |
|
649 | + foreach ($polar as $eachpolar) { |
|
650 | + unset($polar_data); |
|
651 | + $Spotter = new Spotter(); |
|
652 | + $data = json_decode($eachpolar['source_data']); |
|
653 | + foreach($data as $value => $key) { |
|
654 | + $direction = $Spotter->parseDirection(($value*22.5)); |
|
655 | + $distance = $key; |
|
656 | + $unit = 'km'; |
|
657 | 657 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
658 | 658 | $distance = round($distance*0.539957); |
659 | 659 | $unit = 'nm'; |
@@ -664,10 +664,10 @@ discard block |
||
664 | 664 | $distance = $distance; |
665 | 665 | $unit = 'km'; |
666 | 666 | } |
667 | - if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
668 | - else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
669 | - } |
|
670 | - ?> |
|
667 | + if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
668 | + else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
669 | + } |
|
670 | + ?> |
|
671 | 671 | <div class="col-md-6"> |
672 | 672 | <h4><?php print $eachpolar['source_name']; ?></h4> |
673 | 673 | <div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
@@ -699,27 +699,27 @@ discard block |
||
699 | 699 | </script> |
700 | 700 | </div> |
701 | 701 | <?php |
702 | - } |
|
703 | - } |
|
704 | - ?> |
|
702 | + } |
|
703 | + } |
|
704 | + ?> |
|
705 | 705 | </div> |
706 | 706 | <div class="row column"> |
707 | 707 | <div class="col-md-6"> |
708 | 708 | <?php |
709 | - //$msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
710 | - if ($year == '' && $month == '') { |
|
711 | - $msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d')); |
|
712 | - } else { |
|
713 | - $msg = $Stats->getStatsSource('msg',$year,$month); |
|
714 | - } |
|
715 | - if (!empty($msg)) { |
|
716 | - print '<h2>'._("Messages received").'</h2>'; |
|
717 | - foreach ($msg as $eachmsg) { |
|
718 | - //$eachmsg = $msg[0]; |
|
719 | - $data = $eachmsg['source_data']; |
|
720 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
721 | - else $max = 500; |
|
722 | - ?> |
|
709 | + //$msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
710 | + if ($year == '' && $month == '') { |
|
711 | + $msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d')); |
|
712 | + } else { |
|
713 | + $msg = $Stats->getStatsSource('msg',$year,$month); |
|
714 | + } |
|
715 | + if (!empty($msg)) { |
|
716 | + print '<h2>'._("Messages received").'</h2>'; |
|
717 | + foreach ($msg as $eachmsg) { |
|
718 | + //$eachmsg = $msg[0]; |
|
719 | + $data = $eachmsg['source_data']; |
|
720 | + if ($data > 500) $max = (round(($data+100)/100))*100; |
|
721 | + else $max = 500; |
|
722 | + ?> |
|
723 | 723 | <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
724 | 724 | <script> |
725 | 725 | var g = new JustGage({ |
@@ -735,9 +735,9 @@ discard block |
||
735 | 735 | }); |
736 | 736 | </script> |
737 | 737 | <?php |
738 | - } |
|
739 | - } |
|
740 | - ?> |
|
738 | + } |
|
739 | + } |
|
740 | + ?> |
|
741 | 741 | </div> |
742 | 742 | </div> |
743 | 743 | <div class="row column"> |
@@ -775,26 +775,26 @@ discard block |
||
775 | 775 | //$hist_data = substr($hist_data, 0, -1); |
776 | 776 | $distance_data = "['x',".substr($distance_data, 0, -1)."]"; |
777 | 777 | $nb_data = "['flights',".substr($nb_data, 0, -1)."]"; |
778 | - ?> |
|
778 | + ?> |
|
779 | 779 | <div class="col-md-6"> |
780 | 780 | <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2> |
781 | 781 | <?php |
782 | - print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div><script>'; |
|
783 | - print 'c3.generate({ |
|
782 | + print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div><script>'; |
|
783 | + print 'c3.generate({ |
|
784 | 784 | bindto: "#charthist-'.str_replace(' ','_',strtolower($source)).'", |
785 | 785 | data: { x: "x", |
786 | 786 | columns: ['.$distance_data.','.$nb_data.'], types: { flights: "area"}, colors: { flights: "#1a3151"}}, |
787 | 787 | axis: { x: {label : { text: "Distance in '.$unit.'", position: "outer-right"}}, y: { label: "# of Flights"}},legend: { show: false }});'; |
788 | - print '</script>'; |
|
789 | - ?> |
|
788 | + print '</script>'; |
|
789 | + ?> |
|
790 | 790 | </div> |
791 | 791 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
792 | 792 | <?php |
793 | - } |
|
794 | - ?> |
|
793 | + } |
|
794 | + ?> |
|
795 | 795 | </div> |
796 | 796 | <?php |
797 | - } |
|
797 | + } |
|
798 | 798 | ?> |
799 | 799 | </div> |
800 | 800 | </div> |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | require_once('require/class.Stats.php'); |
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | if (!isset($_GET['airline'])) { |
7 | - header('Location: '.$globalURL.'/airline'); |
|
8 | - die(); |
|
7 | + header('Location: '.$globalURL.'/airline'); |
|
8 | + die(); |
|
9 | 9 | } |
10 | 10 | $airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
11 | 11 | $Spotter = new Spotter(); |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | } |
77 | 77 | $country_data = substr($country_data, 0, -1); |
78 | 78 | print $country_data; |
79 | - print '];'; |
|
80 | - print 'var dataset = {};var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
|
81 | - print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);'; |
|
82 | - print 'series.forEach(function(item){var iso = item[0], value = item[1]; dataset[iso] = { numberOfThings: value, fillColor: paletteScale(value) };});'; |
|
83 | - print 'new Datamap({ |
|
79 | + print '];'; |
|
80 | + print 'var dataset = {};var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
|
81 | + print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);'; |
|
82 | + print 'series.forEach(function(item){var iso = item[0], value = item[1]; dataset[iso] = { numberOfThings: value, fillColor: paletteScale(value) };});'; |
|
83 | + print 'new Datamap({ |
|
84 | 84 | element: document.getElementById("chartCountry"), |
85 | 85 | projection: "mercator", // big world map |
86 | 86 | fills: { defaultFill: "#F5F5F5" }, |