@@ -4,8 +4,8 @@ |
||
4 | 4 | require_once('require/class.Stats.php'); |
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | if (!isset($_GET['airport'])) { |
7 | - header('Location: '.$globalURL.'/airport'); |
|
8 | - die(); |
|
7 | + header('Location: '.$globalURL.'/airport'); |
|
8 | + die(); |
|
9 | 9 | } |
10 | 10 | $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
11 | 11 | $Spotter = new Spotter(); |
@@ -3,8 +3,8 @@ |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['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))); |
@@ -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>'; |
@@ -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; |
@@ -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); |
@@ -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" }, |
@@ -21,18 +21,18 @@ discard block |
||
21 | 21 | print '<div class="select-item">'; |
22 | 22 | print '<form action="'.$globalURL.'/aircraft" method="post">'; |
23 | 23 | print '<select name="aircraft_type" class="selectpicker" data-live-search="true">'; |
24 | - print '<option></option>'; |
|
25 | - $Stats = new Stats(); |
|
26 | - $aircraft_types = $Stats->getAllAircraftTypes(); |
|
27 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
28 | - foreach($aircraft_types as $aircrafttype) |
|
29 | - { |
|
30 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
31 | - { |
|
32 | - print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
|
33 | - } else { |
|
34 | - print '<option value="'.$aircrafttype['aircraft_icao'].'">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
|
35 | - } |
|
24 | + print '<option></option>'; |
|
25 | + $Stats = new Stats(); |
|
26 | + $aircraft_types = $Stats->getAllAircraftTypes(); |
|
27 | + if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
28 | + foreach($aircraft_types as $aircrafttype) |
|
29 | + { |
|
30 | + if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
31 | + { |
|
32 | + print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
|
33 | + } else { |
|
34 | + print '<option value="'.$aircrafttype['aircraft_icao'].'">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
|
35 | + } |
|
36 | 36 | } |
37 | 37 | print '</select>'; |
38 | 38 | print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>'; |
@@ -61,18 +61,18 @@ discard block |
||
61 | 61 | print '<script type="text/javascript" src="'.$globalURL.'/js/datamaps.world.min.js"></script>'; |
62 | 62 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
63 | 63 | print 'var series = ['; |
64 | - $country_data = ''; |
|
64 | + $country_data = ''; |
|
65 | 65 | foreach($airline_array as $airline_item) |
66 | 66 | { |
67 | 67 | $country_data .= '[ "'.$airline_item['airline_country_iso3'].'",'.$airline_item['airline_country_count'].'],'; |
68 | 68 | } |
69 | - $country_data = substr($country_data, 0, -1); |
|
70 | - print $country_data; |
|
71 | - print '];'; |
|
72 | - 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);'; |
|
73 | - print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);'; |
|
74 | - print 'series.forEach(function(item){var iso = item[0], value = item[1]; dataset[iso] = { numberOfThings: value, fillColor: paletteScale(value) };});'; |
|
75 | - print 'new Datamap({ |
|
69 | + $country_data = substr($country_data, 0, -1); |
|
70 | + print $country_data; |
|
71 | + print '];'; |
|
72 | + 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);'; |
|
73 | + print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);'; |
|
74 | + print 'series.forEach(function(item){var iso = item[0], value = item[1]; dataset[iso] = { numberOfThings: value, fillColor: paletteScale(value) };});'; |
|
75 | + print 'new Datamap({ |
|
76 | 76 | element: document.getElementById("chartCountry"), |
77 | 77 | projection: "mercator", // big world map |
78 | 78 | fills: { defaultFill: "#F5F5F5" }, |