@@ -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(); |
@@ -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; |
@@ -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); |
@@ -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" }, |
@@ -75,38 +75,38 @@ discard block |
||
75 | 75 | try { |
76 | 76 | //$Connection = new Connection(); |
77 | 77 | $sth = $Connection->db->prepare($query); |
78 | - $sth->execute(array(':source' => $database_file)); |
|
79 | - } catch(PDOException $e) { |
|
80 | - return "error : ".$e->getMessage(); |
|
81 | - } |
|
78 | + $sth->execute(array(':source' => $database_file)); |
|
79 | + } catch(PDOException $e) { |
|
80 | + return "error : ".$e->getMessage(); |
|
81 | + } |
|
82 | 82 | |
83 | - if ($globalDebug) echo " - Add routes to DB -"; |
|
84 | - update_db::connect_sqlite($database_file); |
|
83 | + if ($globalDebug) echo " - Add routes to DB -"; |
|
84 | + update_db::connect_sqlite($database_file); |
|
85 | 85 | //$query = 'select Route.RouteID, Route.callsign, operator.Icao AS operator_icao, FromAir.Icao AS FromAirportIcao, ToAir.Icao AS ToAirportIcao from Route inner join operator ON Route.operatorId = operator.operatorId LEFT JOIN Airport AS FromAir ON route.FromAirportId = FromAir.AirportId LEFT JOIN Airport AS ToAir ON ToAir.AirportID = route.ToAirportID'; |
86 | 86 | $query = "select Route.RouteID, Route.callsign, operator.Icao AS operator_icao, FromAir.Icao AS FromAirportIcao, ToAir.Icao AS ToAirportIcao, rstp.allstop AS AllStop from Route inner join operator ON Route.operatorId = operator.operatorId LEFT JOIN Airport AS FromAir ON route.FromAirportId = FromAir.AirportId LEFT JOIN Airport AS ToAir ON ToAir.AirportID = route.ToAirportID LEFT JOIN (select RouteId,GROUP_CONCAT(icao,' ') as allstop from routestop left join Airport as air ON routestop.AirportId = air.AirportID group by RouteID) AS rstp ON Route.RouteID = rstp.RouteID"; |
87 | 87 | try { |
88 | - $sth = update_db::$db_sqlite->prepare($query); |
|
89 | - $sth->execute(); |
|
90 | - } catch(PDOException $e) { |
|
91 | - return "error : ".$e->getMessage(); |
|
92 | - } |
|
88 | + $sth = update_db::$db_sqlite->prepare($query); |
|
89 | + $sth->execute(); |
|
90 | + } catch(PDOException $e) { |
|
91 | + return "error : ".$e->getMessage(); |
|
92 | + } |
|
93 | 93 | //$query_dest = 'INSERT INTO routes (`RouteID`,`CallSign`,`Operator_ICAO`,`FromAirport_ICAO`,`ToAirport_ICAO`,`RouteStop`,`Source`) VALUES (:RouteID, :CallSign, :Operator_ICAO, :FromAirport_ICAO, :ToAirport_ICAO, :routestop, :source)'; |
94 | 94 | $query_dest = 'INSERT INTO routes (CallSign,Operator_ICAO,FromAirport_ICAO,ToAirport_ICAO,RouteStop,Source) VALUES (:CallSign, :Operator_ICAO, :FromAirport_ICAO, :ToAirport_ICAO, :routestop, :source)'; |
95 | 95 | $Connection = new Connection(); |
96 | 96 | $sth_dest = $Connection->db->prepare($query_dest); |
97 | 97 | try { |
98 | 98 | if ($globalTransaction) $Connection->db->beginTransaction(); |
99 | - while ($values = $sth->fetch(PDO::FETCH_ASSOC)) { |
|
99 | + while ($values = $sth->fetch(PDO::FETCH_ASSOC)) { |
|
100 | 100 | //$query_dest_values = array(':RouteID' => $values['RouteId'],':CallSign' => $values['Callsign'],':Operator_ICAO' => $values['operator_icao'],':FromAirport_ICAO' => $values['FromAirportIcao'],':ToAirport_ICAO' => $values['ToAirportIcao'],':routestop' => $values['AllStop'],':source' => $database_file); |
101 | 101 | $query_dest_values = array(':CallSign' => $values['Callsign'],':Operator_ICAO' => $values['operator_icao'],':FromAirport_ICAO' => $values['FromAirportIcao'],':ToAirport_ICAO' => $values['ToAirportIcao'],':routestop' => $values['AllStop'],':source' => $database_file); |
102 | 102 | $sth_dest->execute($query_dest_values); |
103 | - } |
|
103 | + } |
|
104 | 104 | if ($globalTransaction) $Connection->db->commit(); |
105 | 105 | } catch(PDOException $e) { |
106 | 106 | if ($globalTransaction) $Connection->db->rollBack(); |
107 | 107 | return "error : ".$e->getMessage(); |
108 | 108 | } |
109 | - return ''; |
|
109 | + return ''; |
|
110 | 110 | } |
111 | 111 | public static function retrieve_route_oneworld($database_file) { |
112 | 112 | global $globalDebug, $globalTransaction; |
@@ -117,12 +117,12 @@ discard block |
||
117 | 117 | try { |
118 | 118 | //$Connection = new Connection(); |
119 | 119 | $sth = $Connection->db->prepare($query); |
120 | - $sth->execute(array(':source' => 'oneworld')); |
|
121 | - } catch(PDOException $e) { |
|
122 | - return "error : ".$e->getMessage(); |
|
123 | - } |
|
120 | + $sth->execute(array(':source' => 'oneworld')); |
|
121 | + } catch(PDOException $e) { |
|
122 | + return "error : ".$e->getMessage(); |
|
123 | + } |
|
124 | 124 | |
125 | - if ($globalDebug) echo " - Add routes to DB -"; |
|
125 | + if ($globalDebug) echo " - Add routes to DB -"; |
|
126 | 126 | require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
127 | 127 | $Spotter = new Spotter(); |
128 | 128 | if ($fh = fopen($database_file,"r")) { |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | } |
147 | 147 | if ($globalTransaction) $Connection->db->commit(); |
148 | 148 | } |
149 | - return ''; |
|
149 | + return ''; |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | public static function retrieve_route_skyteam($database_file) { |
@@ -158,12 +158,12 @@ discard block |
||
158 | 158 | try { |
159 | 159 | //$Connection = new Connection(); |
160 | 160 | $sth = $Connection->db->prepare($query); |
161 | - $sth->execute(array(':source' => 'skyteam')); |
|
162 | - } catch(PDOException $e) { |
|
163 | - return "error : ".$e->getMessage(); |
|
164 | - } |
|
161 | + $sth->execute(array(':source' => 'skyteam')); |
|
162 | + } catch(PDOException $e) { |
|
163 | + return "error : ".$e->getMessage(); |
|
164 | + } |
|
165 | 165 | |
166 | - if ($globalDebug) echo " - Add routes to DB -"; |
|
166 | + if ($globalDebug) echo " - Add routes to DB -"; |
|
167 | 167 | |
168 | 168 | require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
169 | 169 | $Spotter = new Spotter(); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | return "error : ".$e->getMessage(); |
190 | 190 | } |
191 | 191 | } |
192 | - return ''; |
|
192 | + return ''; |
|
193 | 193 | } |
194 | 194 | public static function retrieve_modes_sqlite_to_dest($database_file) { |
195 | 195 | global $globalTransaction; |
@@ -198,27 +198,27 @@ discard block |
||
198 | 198 | try { |
199 | 199 | $Connection = new Connection(); |
200 | 200 | $sth = $Connection->db->prepare($query); |
201 | - $sth->execute(array(':source' => $database_file)); |
|
202 | - } catch(PDOException $e) { |
|
203 | - return "error : ".$e->getMessage(); |
|
204 | - } |
|
201 | + $sth->execute(array(':source' => $database_file)); |
|
202 | + } catch(PDOException $e) { |
|
203 | + return "error : ".$e->getMessage(); |
|
204 | + } |
|
205 | 205 | $query = "DELETE FROM aircraft_owner WHERE Source = '' OR Source IS NULL OR Source = :source"; |
206 | 206 | try { |
207 | 207 | $Connection = new Connection(); |
208 | 208 | $sth = $Connection->db->prepare($query); |
209 | - $sth->execute(array(':source' => $database_file)); |
|
210 | - } catch(PDOException $e) { |
|
211 | - return "error : ".$e->getMessage(); |
|
212 | - } |
|
209 | + $sth->execute(array(':source' => $database_file)); |
|
210 | + } catch(PDOException $e) { |
|
211 | + return "error : ".$e->getMessage(); |
|
212 | + } |
|
213 | 213 | |
214 | - update_db::connect_sqlite($database_file); |
|
214 | + update_db::connect_sqlite($database_file); |
|
215 | 215 | $query = 'select * from Aircraft'; |
216 | 216 | try { |
217 | - $sth = update_db::$db_sqlite->prepare($query); |
|
218 | - $sth->execute(); |
|
219 | - } catch(PDOException $e) { |
|
220 | - return "error : ".$e->getMessage(); |
|
221 | - } |
|
217 | + $sth = update_db::$db_sqlite->prepare($query); |
|
218 | + $sth->execute(); |
|
219 | + } catch(PDOException $e) { |
|
220 | + return "error : ".$e->getMessage(); |
|
221 | + } |
|
222 | 222 | //$query_dest = 'INSERT INTO aircraft_modes (`AircraftID`,`FirstCreated`,`LastModified`, `ModeS`,`ModeSCountry`,`Registration`,`ICAOTypeCode`,`SerialNo`, `OperatorFlagCode`, `Manufacturer`, `Type`, `FirstRegDate`, `CurrentRegDate`, `Country`, `PreviousID`, `DeRegDate`, `Status`, `PopularName`,`GenericName`,`AircraftClass`, `Engines`, `OwnershipStatus`,`RegisteredOwners`,`MTOW`, `TotalHours`, `YearBuilt`, `CofACategory`, `CofAExpiry`, `UserNotes`, `Interested`, `UserTag`, `InfoUrl`, `PictureUrl1`, `PictureUrl2`, `PictureUrl3`, `UserBool1`, `UserBool2`, `UserBool3`, `UserBool4`, `UserBool5`, `UserString1`, `UserString2`, `UserString3`, `UserString4`, `UserString5`, `UserInt1`, `UserInt2`, `UserInt3`, `UserInt4`, `UserInt5`) VALUES (:AircraftID,:FirstCreated,:LastModified,:ModeS,:ModeSCountry,:Registration,:ICAOTypeCode,:SerialNo, :OperatorFlagCode, :Manufacturer, :Type, :FirstRegDate, :CurrentRegDate, :Country, :PreviousID, :DeRegDate, :Status, :PopularName,:GenericName,:AircraftClass, :Engines, :OwnershipStatus,:RegisteredOwners,:MTOW, :TotalHours,:YearBuilt, :CofACategory, :CofAExpiry, :UserNotes, :Interested, :UserTag, :InfoUrl, :PictureUrl1, :PictureUrl2, :PictureUrl3, :UserBool1, :UserBool2, :UserBool3, :UserBool4, :UserBool5, :UserString1, :UserString2, :UserString3, :UserString4, :UserString5, :UserInt1, :UserInt2, :UserInt3, :UserInt4, :UserInt5)'; |
223 | 223 | $query_dest = 'INSERT INTO aircraft_modes (LastModified, ModeS,ModeSCountry,Registration,ICAOTypeCode,type_flight,Source) VALUES (:LastModified,:ModeS,:ModeSCountry,:Registration,:ICAOTypeCode,:type,:source)'; |
224 | 224 | |
@@ -229,17 +229,17 @@ discard block |
||
229 | 229 | $sth_dest_owner = $Connection->db->prepare($query_dest_owner); |
230 | 230 | try { |
231 | 231 | if ($globalTransaction) $Connection->db->beginTransaction(); |
232 | - while ($values = $sth->fetch(PDO::FETCH_ASSOC)) { |
|
232 | + while ($values = $sth->fetch(PDO::FETCH_ASSOC)) { |
|
233 | 233 | //$query_dest_values = array(':AircraftID' => $values['AircraftID'],':FirstCreated' => $values['FirstCreated'],':LastModified' => $values['LastModified'],':ModeS' => $values['ModeS'],':ModeSCountry' => $values['ModeSCountry'],':Registration' => $values['Registration'],':ICAOTypeCode' => $values['ICAOTypeCode'],':SerialNo' => $values['SerialNo'], ':OperatorFlagCode' => $values['OperatorFlagCode'], ':Manufacturer' => $values['Manufacturer'], ':Type' => $values['Type'], ':FirstRegDate' => $values['FirstRegDate'], ':CurrentRegDate' => $values['CurrentRegDate'], ':Country' => $values['Country'], ':PreviousID' => $values['PreviousID'], ':DeRegDate' => $values['DeRegDate'], ':Status' => $values['Status'], ':PopularName' => $values['PopularName'],':GenericName' => $values['GenericName'],':AircraftClass' => $values['AircraftClass'], ':Engines' => $values['Engines'], ':OwnershipStatus' => $values['OwnershipStatus'],':RegisteredOwners' => $values['RegisteredOwners'],':MTOW' => $values['MTOW'], ':TotalHours' => $values['TotalHours'],':YearBuilt' => $values['YearBuilt'], ':CofACategory' => $values['CofACategory'], ':CofAExpiry' => $values['CofAExpiry'], ':UserNotes' => $values['UserNotes'], ':Interested' => $values['Interested'], ':UserTag' => $values['UserTag'], ':InfoUrl' => $values['InfoURL'], ':PictureUrl1' => $values['PictureURL1'], ':PictureUrl2' => $values['PictureURL2'], ':PictureUrl3' => $values['PictureURL3'], ':UserBool1' => $values['UserBool1'], ':UserBool2' => $values['UserBool2'], ':UserBool3' => $values['UserBool3'], ':UserBool4' => $values['UserBool4'], ':UserBool5' => $values['UserBool5'], ':UserString1' => $values['UserString1'], ':UserString2' => $values['UserString2'], ':UserString3' => $values['UserString3'], ':UserString4' => $values['UserString4'], ':UserString5' => $values['UserString5'], ':UserInt1' => $values['UserInt1'], ':UserInt2' => $values['UserInt2'], ':UserInt3' => $values['UserInt3'], ':UserInt4' => $values['UserInt4'], ':UserInt5' => $values['UserInt5']); |
234 | 234 | if ($values['UserString4'] == 'M') $type = 'military'; |
235 | 235 | else $type = null; |
236 | 236 | $query_dest_values = array(':LastModified' => $values['LastModified'],':ModeS' => $values['ModeS'],':ModeSCountry' => $values['ModeSCountry'],':Registration' => $values['Registration'],':ICAOTypeCode' => $values['ICAOTypeCode'],':source' => $database_file,':type' => $type); |
237 | 237 | $sth_dest->execute($query_dest_values); |
238 | 238 | if ($values['RegisteredOwners'] != '' && $values['RegisteredOwners'] != NULL && $values['RegisteredOwners'] != 'Private') { |
239 | - $query_dest_owner_values = array(':registration' => $values['Registration'],':source' => $database_file,':owner' => $values['RegisteredOwners']); |
|
240 | - $sth_dest_owner->execute($query_dest_owner_values); |
|
239 | + $query_dest_owner_values = array(':registration' => $values['Registration'],':source' => $database_file,':owner' => $values['RegisteredOwners']); |
|
240 | + $sth_dest_owner->execute($query_dest_owner_values); |
|
241 | 241 | } |
242 | - } |
|
242 | + } |
|
243 | 243 | if ($globalTransaction) $Connection->db->commit(); |
244 | 244 | } catch(PDOException $e) { |
245 | 245 | return "error : ".$e->getMessage(); |
@@ -250,10 +250,10 @@ discard block |
||
250 | 250 | try { |
251 | 251 | $Connection = new Connection(); |
252 | 252 | $sth = $Connection->db->prepare($query); |
253 | - $sth->execute(array(':source' => $database_file)); |
|
254 | - } catch(PDOException $e) { |
|
255 | - return "error : ".$e->getMessage(); |
|
256 | - } |
|
253 | + $sth->execute(array(':source' => $database_file)); |
|
254 | + } catch(PDOException $e) { |
|
255 | + return "error : ".$e->getMessage(); |
|
256 | + } |
|
257 | 257 | return ''; |
258 | 258 | } |
259 | 259 | |
@@ -265,10 +265,10 @@ discard block |
||
265 | 265 | try { |
266 | 266 | $Connection = new Connection(); |
267 | 267 | $sth = $Connection->db->prepare($query); |
268 | - $sth->execute(array(':source' => $database_file)); |
|
269 | - } catch(PDOException $e) { |
|
270 | - return "error : ".$e->getMessage(); |
|
271 | - } |
|
268 | + $sth->execute(array(':source' => $database_file)); |
|
269 | + } catch(PDOException $e) { |
|
270 | + return "error : ".$e->getMessage(); |
|
271 | + } |
|
272 | 272 | |
273 | 273 | if ($fh = fopen($database_file,"r")) { |
274 | 274 | //$query_dest = 'INSERT INTO aircraft_modes (`AircraftID`,`FirstCreated`,`LastModified`, `ModeS`,`ModeSCountry`,`Registration`,`ICAOTypeCode`,`SerialNo`, `OperatorFlagCode`, `Manufacturer`, `Type`, `FirstRegDate`, `CurrentRegDate`, `Country`, `PreviousID`, `DeRegDate`, `Status`, `PopularName`,`GenericName`,`AircraftClass`, `Engines`, `OwnershipStatus`,`RegisteredOwners`,`MTOW`, `TotalHours`, `YearBuilt`, `CofACategory`, `CofAExpiry`, `UserNotes`, `Interested`, `UserTag`, `InfoUrl`, `PictureUrl1`, `PictureUrl2`, `PictureUrl3`, `UserBool1`, `UserBool2`, `UserBool3`, `UserBool4`, `UserBool5`, `UserString1`, `UserString2`, `UserString3`, `UserString4`, `UserString5`, `UserInt1`, `UserInt2`, `UserInt3`, `UserInt4`, `UserInt5`) VALUES (:AircraftID,:FirstCreated,:LastModified,:ModeS,:ModeSCountry,:Registration,:ICAOTypeCode,:SerialNo, :OperatorFlagCode, :Manufacturer, :Type, :FirstRegDate, :CurrentRegDate, :Country, :PreviousID, :DeRegDate, :Status, :PopularName,:GenericName,:AircraftClass, :Engines, :OwnershipStatus,:RegisteredOwners,:MTOW, :TotalHours,:YearBuilt, :CofACategory, :CofAExpiry, :UserNotes, :Interested, :UserTag, :InfoUrl, :PictureUrl1, :PictureUrl2, :PictureUrl3, :UserBool1, :UserBool2, :UserBool3, :UserBool4, :UserBool5, :UserString1, :UserString2, :UserString3, :UserString4, :UserString5, :UserInt1, :UserInt2, :UserInt3, :UserInt4, :UserInt5)'; |
@@ -278,26 +278,26 @@ discard block |
||
278 | 278 | $sth_dest = $Connection->db->prepare($query_dest); |
279 | 279 | try { |
280 | 280 | if ($globalTransaction) $Connection->db->beginTransaction(); |
281 | - while (!feof($fh)) { |
|
282 | - $values = array(); |
|
283 | - $line = $Common->hex2str(fgets($fh,9999)); |
|
281 | + while (!feof($fh)) { |
|
282 | + $values = array(); |
|
283 | + $line = $Common->hex2str(fgets($fh,9999)); |
|
284 | 284 | //FFFFFF RIDEAU VALLEY SOARINGASW-20 C-FBKN MZ 123.400 |
285 | - $values['ModeS'] = substr($line,0,6); |
|
286 | - $values['Registration'] = trim(substr($line,69,6)); |
|
287 | - $aircraft_name = trim(substr($line,48,6)); |
|
288 | - // Check if we can find ICAO, else set it to GLID |
|
289 | - $aircraft_name_split = explode(' ',$aircraft_name); |
|
290 | - $search_more = ''; |
|
291 | - if (count($aircraft_name) > 1 && strlen($aircraft_name_split[1]) > 3) $search_more .= " AND LIKE '%".$aircraft_name_split[0]."%'"; |
|
292 | - $query_search = "SELECT * FROM aircraft WHERE type LIKE '%".$aircraft_name."%'".$search_more; |
|
293 | - $sth_search = $Connection->db->prepare($query_search); |
|
285 | + $values['ModeS'] = substr($line,0,6); |
|
286 | + $values['Registration'] = trim(substr($line,69,6)); |
|
287 | + $aircraft_name = trim(substr($line,48,6)); |
|
288 | + // Check if we can find ICAO, else set it to GLID |
|
289 | + $aircraft_name_split = explode(' ',$aircraft_name); |
|
290 | + $search_more = ''; |
|
291 | + if (count($aircraft_name) > 1 && strlen($aircraft_name_split[1]) > 3) $search_more .= " AND LIKE '%".$aircraft_name_split[0]."%'"; |
|
292 | + $query_search = "SELECT * FROM aircraft WHERE type LIKE '%".$aircraft_name."%'".$search_more; |
|
293 | + $sth_search = $Connection->db->prepare($query_search); |
|
294 | 294 | try { |
295 | - $sth_search->execute(); |
|
296 | - $result = $sth_search->fetch(PDO::FETCH_ASSOC); |
|
297 | - //if (count($result) > 0) { |
|
298 | - if (isset($result['icao']) && $result['icao'] != '') { |
|
299 | - $values['ICAOTypeCode'] = $result['icao']; |
|
300 | - } |
|
295 | + $sth_search->execute(); |
|
296 | + $result = $sth_search->fetch(PDO::FETCH_ASSOC); |
|
297 | + //if (count($result) > 0) { |
|
298 | + if (isset($result['icao']) && $result['icao'] != '') { |
|
299 | + $values['ICAOTypeCode'] = $result['icao']; |
|
300 | + } |
|
301 | 301 | } catch(PDOException $e) { |
302 | 302 | return "error : ".$e->getMessage(); |
303 | 303 | } |
@@ -320,10 +320,10 @@ discard block |
||
320 | 320 | try { |
321 | 321 | $Connection = new Connection(); |
322 | 322 | $sth = $Connection->db->prepare($query); |
323 | - $sth->execute(array(':source' => $database_file)); |
|
324 | - } catch(PDOException $e) { |
|
325 | - return "error : ".$e->getMessage(); |
|
326 | - } |
|
323 | + $sth->execute(array(':source' => $database_file)); |
|
324 | + } catch(PDOException $e) { |
|
325 | + return "error : ".$e->getMessage(); |
|
326 | + } |
|
327 | 327 | return ''; |
328 | 328 | } |
329 | 329 | |
@@ -334,10 +334,10 @@ discard block |
||
334 | 334 | try { |
335 | 335 | $Connection = new Connection(); |
336 | 336 | $sth = $Connection->db->prepare($query); |
337 | - $sth->execute(array(':source' => $database_file)); |
|
338 | - } catch(PDOException $e) { |
|
339 | - return "error : ".$e->getMessage(); |
|
340 | - } |
|
337 | + $sth->execute(array(':source' => $database_file)); |
|
338 | + } catch(PDOException $e) { |
|
339 | + return "error : ".$e->getMessage(); |
|
340 | + } |
|
341 | 341 | |
342 | 342 | if ($fh = fopen($database_file,"r")) { |
343 | 343 | //$query_dest = 'INSERT INTO aircraft_modes (`AircraftID`,`FirstCreated`,`LastModified`, `ModeS`,`ModeSCountry`,`Registration`,`ICAOTypeCode`,`SerialNo`, `OperatorFlagCode`, `Manufacturer`, `Type`, `FirstRegDate`, `CurrentRegDate`, `Country`, `PreviousID`, `DeRegDate`, `Status`, `PopularName`,`GenericName`,`AircraftClass`, `Engines`, `OwnershipStatus`,`RegisteredOwners`,`MTOW`, `TotalHours`, `YearBuilt`, `CofACategory`, `CofAExpiry`, `UserNotes`, `Interested`, `UserTag`, `InfoUrl`, `PictureUrl1`, `PictureUrl2`, `PictureUrl3`, `UserBool1`, `UserBool2`, `UserBool3`, `UserBool4`, `UserBool5`, `UserString1`, `UserString2`, `UserString3`, `UserString4`, `UserString5`, `UserInt1`, `UserInt2`, `UserInt3`, `UserInt4`, `UserInt5`) VALUES (:AircraftID,:FirstCreated,:LastModified,:ModeS,:ModeSCountry,:Registration,:ICAOTypeCode,:SerialNo, :OperatorFlagCode, :Manufacturer, :Type, :FirstRegDate, :CurrentRegDate, :Country, :PreviousID, :DeRegDate, :Status, :PopularName,:GenericName,:AircraftClass, :Engines, :OwnershipStatus,:RegisteredOwners,:MTOW, :TotalHours,:YearBuilt, :CofACategory, :CofAExpiry, :UserNotes, :Interested, :UserTag, :InfoUrl, :PictureUrl1, :PictureUrl2, :PictureUrl3, :UserBool1, :UserBool2, :UserBool3, :UserBool4, :UserBool5, :UserString1, :UserString2, :UserString3, :UserString4, :UserString5, :UserInt1, :UserInt2, :UserInt3, :UserInt4, :UserInt5)'; |
@@ -348,24 +348,24 @@ discard block |
||
348 | 348 | try { |
349 | 349 | if ($globalTransaction) $Connection->db->beginTransaction(); |
350 | 350 | $tmp = fgetcsv($fh,9999,',',"'"); |
351 | - while (!feof($fh)) { |
|
352 | - $line = fgetcsv($fh,9999,',',"'"); |
|
351 | + while (!feof($fh)) { |
|
352 | + $line = fgetcsv($fh,9999,',',"'"); |
|
353 | 353 | |
354 | 354 | //FFFFFF RIDEAU VALLEY SOARINGASW-20 C-FBKN MZ 123.400 |
355 | 355 | //print_r($line); |
356 | - $values['ModeS'] = $line[1]; |
|
357 | - $values['Registration'] = $line[3]; |
|
358 | - $aircraft_name = $line[2]; |
|
359 | - // Check if we can find ICAO, else set it to GLID |
|
360 | - $aircraft_name_split = explode(' ',$aircraft_name); |
|
361 | - $search_more = ''; |
|
362 | - if (count($aircraft_name) > 1 && strlen($aircraft_name_split[1]) > 3) $search_more .= " AND LIKE '%".$aircraft_name_split[0]."%'"; |
|
363 | - $query_search = "SELECT * FROM aircraft WHERE type LIKE '%".$aircraft_name."%'".$search_more; |
|
364 | - $sth_search = $Connection->db->prepare($query_search); |
|
356 | + $values['ModeS'] = $line[1]; |
|
357 | + $values['Registration'] = $line[3]; |
|
358 | + $aircraft_name = $line[2]; |
|
359 | + // Check if we can find ICAO, else set it to GLID |
|
360 | + $aircraft_name_split = explode(' ',$aircraft_name); |
|
361 | + $search_more = ''; |
|
362 | + if (count($aircraft_name) > 1 && strlen($aircraft_name_split[1]) > 3) $search_more .= " AND LIKE '%".$aircraft_name_split[0]."%'"; |
|
363 | + $query_search = "SELECT * FROM aircraft WHERE type LIKE '%".$aircraft_name."%'".$search_more; |
|
364 | + $sth_search = $Connection->db->prepare($query_search); |
|
365 | 365 | try { |
366 | - $sth_search->execute(); |
|
367 | - $result = $sth_search->fetch(PDO::FETCH_ASSOC); |
|
368 | - if (isset($result['icao']) && $result['icao'] != '') $values['ICAOTypeCode'] = $result['icao']; |
|
366 | + $sth_search->execute(); |
|
367 | + $result = $sth_search->fetch(PDO::FETCH_ASSOC); |
|
368 | + if (isset($result['icao']) && $result['icao'] != '') $values['ICAOTypeCode'] = $result['icao']; |
|
369 | 369 | } catch(PDOException $e) { |
370 | 370 | return "error : ".$e->getMessage(); |
371 | 371 | } |
@@ -388,10 +388,10 @@ discard block |
||
388 | 388 | try { |
389 | 389 | $Connection = new Connection(); |
390 | 390 | $sth = $Connection->db->prepare($query); |
391 | - $sth->execute(array(':source' => $database_file)); |
|
392 | - } catch(PDOException $e) { |
|
393 | - return "error : ".$e->getMessage(); |
|
394 | - } |
|
391 | + $sth->execute(array(':source' => $database_file)); |
|
392 | + } catch(PDOException $e) { |
|
393 | + return "error : ".$e->getMessage(); |
|
394 | + } |
|
395 | 395 | return ''; |
396 | 396 | } |
397 | 397 | |
@@ -402,16 +402,16 @@ discard block |
||
402 | 402 | try { |
403 | 403 | $Connection = new Connection(); |
404 | 404 | $sth = $Connection->db->prepare($query); |
405 | - $sth->execute(array(':source' => $database_file)); |
|
406 | - } catch(PDOException $e) { |
|
407 | - return "error : ".$e->getMessage(); |
|
408 | - } |
|
405 | + $sth->execute(array(':source' => $database_file)); |
|
406 | + } catch(PDOException $e) { |
|
407 | + return "error : ".$e->getMessage(); |
|
408 | + } |
|
409 | 409 | require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
410 | 410 | $Spotter = new Spotter(); |
411 | 411 | if ($fh = fopen($database_file,"r")) { |
412 | 412 | //$query_dest = 'INSERT INTO aircraft_modes (`AircraftID`,`FirstCreated`,`LastModified`, `ModeS`,`ModeSCountry`,`Registration`,`ICAOTypeCode`,`SerialNo`, `OperatorFlagCode`, `Manufacturer`, `Type`, `FirstRegDate`, `CurrentRegDate`, `Country`, `PreviousID`, `DeRegDate`, `Status`, `PopularName`,`GenericName`,`AircraftClass`, `Engines`, `OwnershipStatus`,`RegisteredOwners`,`MTOW`, `TotalHours`, `YearBuilt`, `CofACategory`, `CofAExpiry`, `UserNotes`, `Interested`, `UserTag`, `InfoUrl`, `PictureUrl1`, `PictureUrl2`, `PictureUrl3`, `UserBool1`, `UserBool2`, `UserBool3`, `UserBool4`, `UserBool5`, `UserString1`, `UserString2`, `UserString3`, `UserString4`, `UserString5`, `UserInt1`, `UserInt2`, `UserInt3`, `UserInt4`, `UserInt5`) VALUES (:AircraftID,:FirstCreated,:LastModified,:ModeS,:ModeSCountry,:Registration,:ICAOTypeCode,:SerialNo, :OperatorFlagCode, :Manufacturer, :Type, :FirstRegDate, :CurrentRegDate, :Country, :PreviousID, :DeRegDate, :Status, :PopularName,:GenericName,:AircraftClass, :Engines, :OwnershipStatus,:RegisteredOwners,:MTOW, :TotalHours,:YearBuilt, :CofACategory, :CofAExpiry, :UserNotes, :Interested, :UserTag, :InfoUrl, :PictureUrl1, :PictureUrl2, :PictureUrl3, :UserBool1, :UserBool2, :UserBool3, :UserBool4, :UserBool5, :UserString1, :UserString2, :UserString3, :UserString4, :UserString5, :UserInt1, :UserInt2, :UserInt3, :UserInt4, :UserInt5)'; |
413 | 413 | $query_dest = 'INSERT INTO aircraft_owner (registration,base,owner,date_first_reg,Source) VALUES (:registration,:base,:owner,:date_first_reg,:source)'; |
414 | - $query_modes = 'INSERT INTO aircraft_modes (ModeS,ModeSCountry,Registration,ICAOTypeCode,Source) VALUES (:modes,:modescountry,:registration,:icaotypecode,:source)'; |
|
414 | + $query_modes = 'INSERT INTO aircraft_modes (ModeS,ModeSCountry,Registration,ICAOTypeCode,Source) VALUES (:modes,:modescountry,:registration,:icaotypecode,:source)'; |
|
415 | 415 | |
416 | 416 | $Connection = new Connection(); |
417 | 417 | $sth_dest = $Connection->db->prepare($query_dest); |
@@ -419,126 +419,126 @@ discard block |
||
419 | 419 | try { |
420 | 420 | if ($globalTransaction) $Connection->db->beginTransaction(); |
421 | 421 | $tmp = fgetcsv($fh,9999,',','"'); |
422 | - while (!feof($fh)) { |
|
423 | - $line = fgetcsv($fh,9999,',','"'); |
|
424 | - $values = array(); |
|
425 | - //print_r($line); |
|
426 | - if ($country == 'F') { |
|
427 | - $values['registration'] = $line[0]; |
|
428 | - $values['base'] = $line[4]; |
|
429 | - $values['owner'] = $line[5]; |
|
430 | - if ($line[6] == '') $values['date_first_reg'] = null; |
|
431 | - else $values['date_first_reg'] = date("Y-m-d",strtotime($line[6])); |
|
432 | - $values['cancel'] = $line[7]; |
|
422 | + while (!feof($fh)) { |
|
423 | + $line = fgetcsv($fh,9999,',','"'); |
|
424 | + $values = array(); |
|
425 | + //print_r($line); |
|
426 | + if ($country == 'F') { |
|
427 | + $values['registration'] = $line[0]; |
|
428 | + $values['base'] = $line[4]; |
|
429 | + $values['owner'] = $line[5]; |
|
430 | + if ($line[6] == '') $values['date_first_reg'] = null; |
|
431 | + else $values['date_first_reg'] = date("Y-m-d",strtotime($line[6])); |
|
432 | + $values['cancel'] = $line[7]; |
|
433 | 433 | } elseif ($country == 'EI') { |
434 | - // TODO : add modeS & reg to aircraft_modes |
|
435 | - $values['registration'] = $line[0]; |
|
436 | - $values['base'] = $line[3]; |
|
437 | - $values['owner'] = $line[2]; |
|
438 | - if ($line[1] == '') $values['date_first_reg'] = null; |
|
439 | - else $values['date_first_reg'] = date("Y-m-d",strtotime($line[1])); |
|
440 | - $values['cancel'] = ''; |
|
441 | - $values['modes'] = $line[7]; |
|
442 | - $values['icao'] = $line[8]; |
|
434 | + // TODO : add modeS & reg to aircraft_modes |
|
435 | + $values['registration'] = $line[0]; |
|
436 | + $values['base'] = $line[3]; |
|
437 | + $values['owner'] = $line[2]; |
|
438 | + if ($line[1] == '') $values['date_first_reg'] = null; |
|
439 | + else $values['date_first_reg'] = date("Y-m-d",strtotime($line[1])); |
|
440 | + $values['cancel'] = ''; |
|
441 | + $values['modes'] = $line[7]; |
|
442 | + $values['icao'] = $line[8]; |
|
443 | 443 | |
444 | 444 | } elseif ($country == 'HB') { |
445 | - // TODO : add modeS & reg to aircraft_modes |
|
446 | - $values['registration'] = $line[0]; |
|
447 | - $values['base'] = null; |
|
448 | - $values['owner'] = $line[5]; |
|
449 | - $values['date_first_reg'] = null; |
|
450 | - $values['cancel'] = ''; |
|
451 | - $values['modes'] = $line[4]; |
|
452 | - $values['icao'] = $line[7]; |
|
445 | + // TODO : add modeS & reg to aircraft_modes |
|
446 | + $values['registration'] = $line[0]; |
|
447 | + $values['base'] = null; |
|
448 | + $values['owner'] = $line[5]; |
|
449 | + $values['date_first_reg'] = null; |
|
450 | + $values['cancel'] = ''; |
|
451 | + $values['modes'] = $line[4]; |
|
452 | + $values['icao'] = $line[7]; |
|
453 | 453 | } elseif ($country == 'OK') { |
454 | - // TODO : add modeS & reg to aircraft_modes |
|
455 | - $values['registration'] = $line[3]; |
|
456 | - $values['base'] = null; |
|
457 | - $values['owner'] = $line[5]; |
|
458 | - if ($line[18] == '') $values['date_first_reg'] = null; |
|
459 | - else $values['date_first_reg'] = date("Y-m-d",strtotime($line[18])); |
|
460 | - $values['cancel'] = ''; |
|
454 | + // TODO : add modeS & reg to aircraft_modes |
|
455 | + $values['registration'] = $line[3]; |
|
456 | + $values['base'] = null; |
|
457 | + $values['owner'] = $line[5]; |
|
458 | + if ($line[18] == '') $values['date_first_reg'] = null; |
|
459 | + else $values['date_first_reg'] = date("Y-m-d",strtotime($line[18])); |
|
460 | + $values['cancel'] = ''; |
|
461 | 461 | } elseif ($country == 'VH') { |
462 | - // TODO : add modeS & reg to aircraft_modes |
|
463 | - $values['registration'] = $line[0]; |
|
464 | - $values['base'] = null; |
|
465 | - $values['owner'] = $line[12]; |
|
466 | - if ($line[28] == '') $values['date_first_reg'] = null; |
|
467 | - else $values['date_first_reg'] = date("Y-m-d",strtotime($line[28])); |
|
468 | - |
|
469 | - $values['cancel'] = $line[39]; |
|
462 | + // TODO : add modeS & reg to aircraft_modes |
|
463 | + $values['registration'] = $line[0]; |
|
464 | + $values['base'] = null; |
|
465 | + $values['owner'] = $line[12]; |
|
466 | + if ($line[28] == '') $values['date_first_reg'] = null; |
|
467 | + else $values['date_first_reg'] = date("Y-m-d",strtotime($line[28])); |
|
468 | + |
|
469 | + $values['cancel'] = $line[39]; |
|
470 | 470 | } elseif ($country == 'OE' || $country == '9A' || $country == 'VP' || $country == 'LX' || $country == 'P2' || $country == 'HC') { |
471 | - $values['registration'] = $line[0]; |
|
472 | - $values['base'] = null; |
|
473 | - $values['owner'] = $line[4]; |
|
474 | - $values['date_first_reg'] = null; |
|
475 | - $values['cancel'] = ''; |
|
471 | + $values['registration'] = $line[0]; |
|
472 | + $values['base'] = null; |
|
473 | + $values['owner'] = $line[4]; |
|
474 | + $values['date_first_reg'] = null; |
|
475 | + $values['cancel'] = ''; |
|
476 | 476 | } elseif ($country == 'CC') { |
477 | - $values['registration'] = $line[0]; |
|
478 | - $values['base'] = null; |
|
479 | - $values['owner'] = $line[6]; |
|
480 | - $values['date_first_reg'] = null; |
|
481 | - $values['cancel'] = ''; |
|
477 | + $values['registration'] = $line[0]; |
|
478 | + $values['base'] = null; |
|
479 | + $values['owner'] = $line[6]; |
|
480 | + $values['date_first_reg'] = null; |
|
481 | + $values['cancel'] = ''; |
|
482 | 482 | } elseif ($country == 'HJ') { |
483 | - $values['registration'] = $line[0]; |
|
484 | - $values['base'] = null; |
|
485 | - $values['owner'] = $line[8]; |
|
486 | - if ($line[7] == '') $values['date_first_reg'] = null; |
|
487 | - else $values['date_first_reg'] = date("Y-m-d",strtotime($line[7])); |
|
488 | - $values['cancel'] = ''; |
|
483 | + $values['registration'] = $line[0]; |
|
484 | + $values['base'] = null; |
|
485 | + $values['owner'] = $line[8]; |
|
486 | + if ($line[7] == '') $values['date_first_reg'] = null; |
|
487 | + else $values['date_first_reg'] = date("Y-m-d",strtotime($line[7])); |
|
488 | + $values['cancel'] = ''; |
|
489 | 489 | } elseif ($country == 'PP') { |
490 | - $values['registration'] = $line[0]; |
|
491 | - $values['base'] = null; |
|
492 | - $values['owner'] = $line[4]; |
|
493 | - if ($line[6] == '') $values['date_first_reg'] = null; |
|
494 | - else $values['date_first_reg'] = date("Y-m-d",strtotime($line[6])); |
|
495 | - $values['cancel'] = $line[7]; |
|
490 | + $values['registration'] = $line[0]; |
|
491 | + $values['base'] = null; |
|
492 | + $values['owner'] = $line[4]; |
|
493 | + if ($line[6] == '') $values['date_first_reg'] = null; |
|
494 | + else $values['date_first_reg'] = date("Y-m-d",strtotime($line[6])); |
|
495 | + $values['cancel'] = $line[7]; |
|
496 | 496 | } elseif ($country == 'E7') { |
497 | - $values['registration'] = $line[0]; |
|
498 | - $values['base'] = null; |
|
499 | - $values['owner'] = $line[4]; |
|
500 | - if ($line[5] == '') $values['date_first_reg'] = null; |
|
501 | - else $values['date_first_reg'] = date("Y-m-d",strtotime($line[5])); |
|
502 | - $values['cancel'] = ''; |
|
497 | + $values['registration'] = $line[0]; |
|
498 | + $values['base'] = null; |
|
499 | + $values['owner'] = $line[4]; |
|
500 | + if ($line[5] == '') $values['date_first_reg'] = null; |
|
501 | + else $values['date_first_reg'] = date("Y-m-d",strtotime($line[5])); |
|
502 | + $values['cancel'] = ''; |
|
503 | 503 | } elseif ($country == '8Q') { |
504 | - $values['registration'] = $line[0]; |
|
505 | - $values['base'] = null; |
|
506 | - $values['owner'] = $line[3]; |
|
507 | - if ($line[7] == '') $values['date_first_reg'] = null; |
|
508 | - else $values['date_first_reg'] = date("Y-m-d",strtotime($line[7])); |
|
509 | - $values['cancel'] = ''; |
|
504 | + $values['registration'] = $line[0]; |
|
505 | + $values['base'] = null; |
|
506 | + $values['owner'] = $line[3]; |
|
507 | + if ($line[7] == '') $values['date_first_reg'] = null; |
|
508 | + else $values['date_first_reg'] = date("Y-m-d",strtotime($line[7])); |
|
509 | + $values['cancel'] = ''; |
|
510 | 510 | } elseif ($country == 'ZK') { |
511 | - $values['registration'] = $line[0]; |
|
512 | - $values['base'] = null; |
|
513 | - $values['owner'] = $line[3]; |
|
514 | - $values['date_first_reg'] = null; |
|
515 | - $values['cancel'] = ''; |
|
516 | - $values['modes'] = $line[5]; |
|
517 | - $values['icao'] = $line[9]; |
|
511 | + $values['registration'] = $line[0]; |
|
512 | + $values['base'] = null; |
|
513 | + $values['owner'] = $line[3]; |
|
514 | + $values['date_first_reg'] = null; |
|
515 | + $values['cancel'] = ''; |
|
516 | + $values['modes'] = $line[5]; |
|
517 | + $values['icao'] = $line[9]; |
|
518 | 518 | } elseif ($country == 'M') { |
519 | - $values['registration'] = $line[0]; |
|
520 | - $values['base'] = null; |
|
521 | - $values['owner'] = $line[6]; |
|
522 | - $values['date_first_reg'] = date("Y-m-d",strtotime($line[5])); |
|
523 | - $values['cancel'] = date("Y-m-d",strtotime($line[8])); |
|
524 | - $values['modes'] = $line[4]; |
|
525 | - $values['icao'] = $line[10]; |
|
519 | + $values['registration'] = $line[0]; |
|
520 | + $values['base'] = null; |
|
521 | + $values['owner'] = $line[6]; |
|
522 | + $values['date_first_reg'] = date("Y-m-d",strtotime($line[5])); |
|
523 | + $values['cancel'] = date("Y-m-d",strtotime($line[8])); |
|
524 | + $values['modes'] = $line[4]; |
|
525 | + $values['icao'] = $line[10]; |
|
526 | 526 | } elseif ($country == 'OY') { |
527 | - $values['registration'] = $line[0]; |
|
528 | - $values['date_first_reg'] = date("Y-m-d",strtotime($line[4])); |
|
529 | - $values['modes'] = $line[5]; |
|
530 | - $values['icao'] = $line[6]; |
|
527 | + $values['registration'] = $line[0]; |
|
528 | + $values['date_first_reg'] = date("Y-m-d",strtotime($line[4])); |
|
529 | + $values['modes'] = $line[5]; |
|
530 | + $values['icao'] = $line[6]; |
|
531 | 531 | } elseif ($country == 'PH') { |
532 | - $values['registration'] = $line[0]; |
|
533 | - $values['date_first_reg'] = date("Y-m-d",strtotime($line[3])); |
|
534 | - $values['modes'] = $line[4]; |
|
535 | - $values['icao'] = $line[5]; |
|
532 | + $values['registration'] = $line[0]; |
|
533 | + $values['date_first_reg'] = date("Y-m-d",strtotime($line[3])); |
|
534 | + $values['modes'] = $line[4]; |
|
535 | + $values['icao'] = $line[5]; |
|
536 | 536 | } elseif ($country == 'OM' || $country == 'TF') { |
537 | - $values['registration'] = $line[0]; |
|
538 | - $values['base'] = null; |
|
539 | - $values['owner'] = $line[3]; |
|
540 | - $values['date_first_reg'] = null; |
|
541 | - $values['cancel'] = ''; |
|
537 | + $values['registration'] = $line[0]; |
|
538 | + $values['base'] = null; |
|
539 | + $values['owner'] = $line[3]; |
|
540 | + $values['date_first_reg'] = null; |
|
541 | + $values['cancel'] = ''; |
|
542 | 542 | } |
543 | 543 | if (isset($values['cancel']) && $values['cancel'] == '' && $values['registration'] != null && isset($values['owner'])) { |
544 | 544 | $query_dest_values = array(':registration' => $values['registration'],':base' => $values['base'],':date_first_reg' => $values['date_first_reg'],':owner' => $values['owner'],':source' => $database_file); |
@@ -665,20 +665,20 @@ discard block |
||
665 | 665 | try { |
666 | 666 | $Connection = new Connection(); |
667 | 667 | $sth = $Connection->db->prepare($query); |
668 | - $sth->execute(); |
|
669 | - } catch(PDOException $e) { |
|
670 | - return "error : ".$e->getMessage(); |
|
671 | - } |
|
668 | + $sth->execute(); |
|
669 | + } catch(PDOException $e) { |
|
670 | + return "error : ".$e->getMessage(); |
|
671 | + } |
|
672 | 672 | |
673 | 673 | |
674 | 674 | $query = 'ALTER TABLE airport DROP INDEX icaoidx'; |
675 | 675 | try { |
676 | 676 | $Connection = new Connection(); |
677 | 677 | $sth = $Connection->db->prepare($query); |
678 | - $sth->execute(); |
|
679 | - } catch(PDOException $e) { |
|
680 | - return "error : ".$e->getMessage(); |
|
681 | - } |
|
678 | + $sth->execute(); |
|
679 | + } catch(PDOException $e) { |
|
680 | + return "error : ".$e->getMessage(); |
|
681 | + } |
|
682 | 682 | |
683 | 683 | $query_dest = "INSERT INTO airport (`airport_id`,`name`,`city`,`country`,`iata`,`icao`,`latitude`,`longitude`,`altitude`,`type`,`home_link`,`wikipedia_link`,`image_thumb`,`image`) |
684 | 684 | VALUES (:airport_id, :name, :city, :country, :iata, :icao, :latitude, :longitude, :altitude, :type, :home_link, :wikipedia_link, :image_thumb, :image)"; |
@@ -744,10 +744,10 @@ discard block |
||
744 | 744 | try { |
745 | 745 | $Connection = new Connection(); |
746 | 746 | $sth = $Connection->db->prepare($query); |
747 | - $sth->execute(); |
|
748 | - } catch(PDOException $e) { |
|
749 | - return "error : ".$e->getMessage(); |
|
750 | - } |
|
747 | + $sth->execute(); |
|
748 | + } catch(PDOException $e) { |
|
749 | + return "error : ".$e->getMessage(); |
|
750 | + } |
|
751 | 751 | |
752 | 752 | |
753 | 753 | if ($globalDebug) echo "Insert Not available Airport...\n"; |
@@ -757,10 +757,10 @@ discard block |
||
757 | 757 | try { |
758 | 758 | $Connection = new Connection(); |
759 | 759 | $sth = $Connection->db->prepare($query); |
760 | - $sth->execute($query_values); |
|
761 | - } catch(PDOException $e) { |
|
762 | - return "error : ".$e->getMessage(); |
|
763 | - } |
|
760 | + $sth->execute($query_values); |
|
761 | + } catch(PDOException $e) { |
|
762 | + return "error : ".$e->getMessage(); |
|
763 | + } |
|
764 | 764 | $i++; |
765 | 765 | /* |
766 | 766 | $query = 'DELETE FROM airport WHERE airport_id IN (SELECT * FROM (SELECT min(a.airport_id) FROM airport a GROUP BY a.icao) x)'; |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | |
875 | 875 | |
876 | 876 | |
877 | - return "success"; |
|
877 | + return "success"; |
|
878 | 878 | } |
879 | 879 | |
880 | 880 | public static function translation() { |
@@ -890,10 +890,10 @@ discard block |
||
890 | 890 | try { |
891 | 891 | $Connection = new Connection(); |
892 | 892 | $sth = $Connection->db->prepare($query); |
893 | - $sth->execute(array(':source' => 'translation.csv')); |
|
894 | - } catch(PDOException $e) { |
|
895 | - return "error : ".$e->getMessage(); |
|
896 | - } |
|
893 | + $sth->execute(array(':source' => 'translation.csv')); |
|
894 | + } catch(PDOException $e) { |
|
895 | + return "error : ".$e->getMessage(); |
|
896 | + } |
|
897 | 897 | |
898 | 898 | |
899 | 899 | //update_db::unzip($out_file); |
@@ -912,21 +912,21 @@ discard block |
||
912 | 912 | $data = $row; |
913 | 913 | $operator = $data[2]; |
914 | 914 | if ($operator != '' && is_numeric(substr(substr($operator, 0, 3), -1, 1))) { |
915 | - $airline_array = $Spotter->getAllAirlineInfo(substr($operator, 0, 2)); |
|
916 | - //echo substr($operator, 0, 2)."\n";; |
|
917 | - if (count($airline_array) > 0) { |
|
915 | + $airline_array = $Spotter->getAllAirlineInfo(substr($operator, 0, 2)); |
|
916 | + //echo substr($operator, 0, 2)."\n";; |
|
917 | + if (count($airline_array) > 0) { |
|
918 | 918 | //print_r($airline_array); |
919 | 919 | $operator = $airline_array[0]['icao'].substr($operator,2); |
920 | - } |
|
921 | - } |
|
920 | + } |
|
921 | + } |
|
922 | 922 | |
923 | 923 | $operator_correct = $data[3]; |
924 | 924 | if ($operator_correct != '' && is_numeric(substr(substr($operator_correct, 0, 3), -1, 1))) { |
925 | - $airline_array = $Spotter->getAllAirlineInfo(substr($operator_correct, 0, 2)); |
|
926 | - if (count($airline_array) > 0) { |
|
927 | - $operator_correct = $airline_array[0]['icao'].substr($operator_correct,2); |
|
928 | - } |
|
929 | - } |
|
925 | + $airline_array = $Spotter->getAllAirlineInfo(substr($operator_correct, 0, 2)); |
|
926 | + if (count($airline_array) > 0) { |
|
927 | + $operator_correct = $airline_array[0]['icao'].substr($operator_correct,2); |
|
928 | + } |
|
929 | + } |
|
930 | 930 | $query = 'INSERT INTO translation (Reg,Reg_correct,Operator,Operator_correct,Source) VALUES (:Reg, :Reg_correct, :Operator, :Operator_correct, :source)'; |
931 | 931 | try { |
932 | 932 | $sth = $Connection->db->prepare($query); |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | //$Connection->db->commit(); |
941 | 941 | } |
942 | 942 | return ''; |
943 | - } |
|
943 | + } |
|
944 | 944 | |
945 | 945 | public static function translation_fam() { |
946 | 946 | require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
@@ -950,10 +950,10 @@ discard block |
||
950 | 950 | try { |
951 | 951 | $Connection = new Connection(); |
952 | 952 | $sth = $Connection->db->prepare($query); |
953 | - $sth->execute(array(':source' => 'website_fam')); |
|
954 | - } catch(PDOException $e) { |
|
955 | - return "error : ".$e->getMessage(); |
|
956 | - } |
|
953 | + $sth->execute(array(':source' => 'website_fam')); |
|
954 | + } catch(PDOException $e) { |
|
955 | + return "error : ".$e->getMessage(); |
|
956 | + } |
|
957 | 957 | |
958 | 958 | |
959 | 959 | //update_db::unzip($out_file); |
@@ -982,7 +982,7 @@ discard block |
||
982 | 982 | //$Connection->db->commit(); |
983 | 983 | } |
984 | 984 | return ''; |
985 | - } |
|
985 | + } |
|
986 | 986 | |
987 | 987 | /* |
988 | 988 | * This function use FAA public data. |
@@ -994,19 +994,19 @@ discard block |
||
994 | 994 | try { |
995 | 995 | $Connection = new Connection(); |
996 | 996 | $sth = $Connection->db->prepare($query); |
997 | - $sth->execute(array(':source' => 'website_faa')); |
|
998 | - } catch(PDOException $e) { |
|
999 | - return "error : ".$e->getMessage(); |
|
1000 | - } |
|
997 | + $sth->execute(array(':source' => 'website_faa')); |
|
998 | + } catch(PDOException $e) { |
|
999 | + return "error : ".$e->getMessage(); |
|
1000 | + } |
|
1001 | 1001 | |
1002 | 1002 | $query = "DELETE FROM aircraft_owner WHERE Source = '' OR Source = :source"; |
1003 | 1003 | try { |
1004 | 1004 | $Connection = new Connection(); |
1005 | 1005 | $sth = $Connection->db->prepare($query); |
1006 | - $sth->execute(array(':source' => 'website_faa')); |
|
1007 | - } catch(PDOException $e) { |
|
1008 | - return "error : ".$e->getMessage(); |
|
1009 | - } |
|
1006 | + $sth->execute(array(':source' => 'website_faa')); |
|
1007 | + } catch(PDOException $e) { |
|
1008 | + return "error : ".$e->getMessage(); |
|
1009 | + } |
|
1010 | 1010 | |
1011 | 1011 | $delimiter = ","; |
1012 | 1012 | $mfr = array(); |
@@ -1082,17 +1082,17 @@ discard block |
||
1082 | 1082 | } |
1083 | 1083 | print_r($mfr); |
1084 | 1084 | return ''; |
1085 | - } |
|
1085 | + } |
|
1086 | 1086 | public static function modes_fam() { |
1087 | 1087 | global $tmp_dir, $globalTransaction; |
1088 | 1088 | $query = "DELETE FROM aircraft_modes WHERE Source = '' OR Source = :source"; |
1089 | 1089 | try { |
1090 | 1090 | $Connection = new Connection(); |
1091 | 1091 | $sth = $Connection->db->prepare($query); |
1092 | - $sth->execute(array(':source' => 'website_fam')); |
|
1093 | - } catch(PDOException $e) { |
|
1094 | - return "error : ".$e->getMessage(); |
|
1095 | - } |
|
1092 | + $sth->execute(array(':source' => 'website_fam')); |
|
1093 | + } catch(PDOException $e) { |
|
1094 | + return "error : ".$e->getMessage(); |
|
1095 | + } |
|
1096 | 1096 | |
1097 | 1097 | |
1098 | 1098 | //update_db::unzip($out_file); |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | if ($globalTransaction) $Connection->db->commit(); |
1123 | 1123 | } |
1124 | 1124 | return ''; |
1125 | - } |
|
1125 | + } |
|
1126 | 1126 | |
1127 | 1127 | public static function owner_fam() { |
1128 | 1128 | global $tmp_dir, $globalTransaction; |
@@ -1130,10 +1130,10 @@ discard block |
||
1130 | 1130 | try { |
1131 | 1131 | $Connection = new Connection(); |
1132 | 1132 | $sth = $Connection->db->prepare($query); |
1133 | - $sth->execute(array(':source' => 'website_fam')); |
|
1134 | - } catch(PDOException $e) { |
|
1135 | - return "error : ".$e->getMessage(); |
|
1136 | - } |
|
1133 | + $sth->execute(array(':source' => 'website_fam')); |
|
1134 | + } catch(PDOException $e) { |
|
1135 | + return "error : ".$e->getMessage(); |
|
1136 | + } |
|
1137 | 1137 | |
1138 | 1138 | $delimiter = "\t"; |
1139 | 1139 | $Connection = new Connection(); |
@@ -1159,7 +1159,7 @@ discard block |
||
1159 | 1159 | if ($globalTransaction) $Connection->db->commit(); |
1160 | 1160 | } |
1161 | 1161 | return ''; |
1162 | - } |
|
1162 | + } |
|
1163 | 1163 | |
1164 | 1164 | public static function routes_fam() { |
1165 | 1165 | global $tmp_dir, $globalTransaction; |
@@ -1167,10 +1167,10 @@ discard block |
||
1167 | 1167 | try { |
1168 | 1168 | $Connection = new Connection(); |
1169 | 1169 | $sth = $Connection->db->prepare($query); |
1170 | - $sth->execute(array(':source' => 'website_fam')); |
|
1171 | - } catch(PDOException $e) { |
|
1172 | - return "error : ".$e->getMessage(); |
|
1173 | - } |
|
1170 | + $sth->execute(array(':source' => 'website_fam')); |
|
1171 | + } catch(PDOException $e) { |
|
1172 | + return "error : ".$e->getMessage(); |
|
1173 | + } |
|
1174 | 1174 | |
1175 | 1175 | |
1176 | 1176 | //update_db::unzip($out_file); |
@@ -1199,7 +1199,7 @@ discard block |
||
1199 | 1199 | if ($globalTransaction) $Connection->db->commit(); |
1200 | 1200 | } |
1201 | 1201 | return ''; |
1202 | - } |
|
1202 | + } |
|
1203 | 1203 | |
1204 | 1204 | public static function marine_identity_fam() { |
1205 | 1205 | global $tmp_dir, $globalTransaction; |
@@ -1207,10 +1207,10 @@ discard block |
||
1207 | 1207 | try { |
1208 | 1208 | $Connection = new Connection(); |
1209 | 1209 | $sth = $Connection->db->prepare($query); |
1210 | - $sth->execute(); |
|
1211 | - } catch(PDOException $e) { |
|
1212 | - return "error : ".$e->getMessage(); |
|
1213 | - } |
|
1210 | + $sth->execute(); |
|
1211 | + } catch(PDOException $e) { |
|
1212 | + return "error : ".$e->getMessage(); |
|
1213 | + } |
|
1214 | 1214 | |
1215 | 1215 | |
1216 | 1216 | //update_db::unzip($out_file); |
@@ -1239,7 +1239,7 @@ discard block |
||
1239 | 1239 | if ($globalTransaction) $Connection->db->commit(); |
1240 | 1240 | } |
1241 | 1241 | return ''; |
1242 | - } |
|
1242 | + } |
|
1243 | 1243 | |
1244 | 1244 | public static function banned_fam() { |
1245 | 1245 | global $tmp_dir, $globalTransaction; |
@@ -1273,7 +1273,7 @@ discard block |
||
1273 | 1273 | if ($globalTransaction) $Connection->db->commit(); |
1274 | 1274 | } |
1275 | 1275 | return ''; |
1276 | - } |
|
1276 | + } |
|
1277 | 1277 | |
1278 | 1278 | public static function tle($filename,$tletype) { |
1279 | 1279 | require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
@@ -1284,10 +1284,10 @@ discard block |
||
1284 | 1284 | try { |
1285 | 1285 | $Connection = new Connection(); |
1286 | 1286 | $sth = $Connection->db->prepare($query); |
1287 | - $sth->execute(array(':source' => $filename)); |
|
1288 | - } catch(PDOException $e) { |
|
1289 | - return "error : ".$e->getMessage(); |
|
1290 | - } |
|
1287 | + $sth->execute(array(':source' => $filename)); |
|
1288 | + } catch(PDOException $e) { |
|
1289 | + return "error : ".$e->getMessage(); |
|
1290 | + } |
|
1291 | 1291 | |
1292 | 1292 | $Connection = new Connection(); |
1293 | 1293 | if (($handle = fopen($filename, 'r')) !== FALSE) |
@@ -1322,54 +1322,54 @@ discard block |
||
1322 | 1322 | //$Connection->db->commit(); |
1323 | 1323 | } |
1324 | 1324 | return ''; |
1325 | - } |
|
1325 | + } |
|
1326 | 1326 | |
1327 | 1327 | /** |
1328 | - * Convert a HTML table to an array |
|
1329 | - * @param String $data HTML page |
|
1330 | - * @return Array array of the tables in HTML page |
|
1331 | - */ |
|
1332 | - private static function table2array($data) { |
|
1333 | - $html = str_get_html($data); |
|
1334 | - $tabledata=array(); |
|
1335 | - foreach($html->find('tr') as $element) |
|
1336 | - { |
|
1337 | - $td = array(); |
|
1338 | - foreach( $element->find('th') as $row) |
|
1339 | - { |
|
1340 | - $td [] = trim($row->plaintext); |
|
1341 | - } |
|
1342 | - $td=array_filter($td); |
|
1343 | - $tabledata[] = $td; |
|
1344 | - |
|
1345 | - $td = array(); |
|
1346 | - $tdi = array(); |
|
1347 | - foreach( $element->find('td') as $row) |
|
1348 | - { |
|
1349 | - $td [] = trim($row->plaintext); |
|
1350 | - $tdi [] = trim($row->innertext); |
|
1351 | - } |
|
1352 | - $td=array_filter($td); |
|
1353 | - $tdi=array_filter($tdi); |
|
1354 | - // $tabledata[]=array_merge($td,$tdi); |
|
1355 | - $tabledata[]=$td; |
|
1356 | - } |
|
1357 | - return(array_filter($tabledata)); |
|
1358 | - } |
|
1359 | - |
|
1360 | - /** |
|
1361 | - * Get data from form result |
|
1362 | - * @param String $url form URL |
|
1363 | - * @return String the result |
|
1364 | - */ |
|
1365 | - private static function getData($url) { |
|
1366 | - $ch = curl_init(); |
|
1367 | - curl_setopt($ch, CURLOPT_URL, $url); |
|
1368 | - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
1369 | - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
|
1370 | - curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5'); |
|
1371 | - return curl_exec($ch); |
|
1372 | - } |
|
1328 | + * Convert a HTML table to an array |
|
1329 | + * @param String $data HTML page |
|
1330 | + * @return Array array of the tables in HTML page |
|
1331 | + */ |
|
1332 | + private static function table2array($data) { |
|
1333 | + $html = str_get_html($data); |
|
1334 | + $tabledata=array(); |
|
1335 | + foreach($html->find('tr') as $element) |
|
1336 | + { |
|
1337 | + $td = array(); |
|
1338 | + foreach( $element->find('th') as $row) |
|
1339 | + { |
|
1340 | + $td [] = trim($row->plaintext); |
|
1341 | + } |
|
1342 | + $td=array_filter($td); |
|
1343 | + $tabledata[] = $td; |
|
1344 | + |
|
1345 | + $td = array(); |
|
1346 | + $tdi = array(); |
|
1347 | + foreach( $element->find('td') as $row) |
|
1348 | + { |
|
1349 | + $td [] = trim($row->plaintext); |
|
1350 | + $tdi [] = trim($row->innertext); |
|
1351 | + } |
|
1352 | + $td=array_filter($td); |
|
1353 | + $tdi=array_filter($tdi); |
|
1354 | + // $tabledata[]=array_merge($td,$tdi); |
|
1355 | + $tabledata[]=$td; |
|
1356 | + } |
|
1357 | + return(array_filter($tabledata)); |
|
1358 | + } |
|
1359 | + |
|
1360 | + /** |
|
1361 | + * Get data from form result |
|
1362 | + * @param String $url form URL |
|
1363 | + * @return String the result |
|
1364 | + */ |
|
1365 | + private static function getData($url) { |
|
1366 | + $ch = curl_init(); |
|
1367 | + curl_setopt($ch, CURLOPT_URL, $url); |
|
1368 | + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
1369 | + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
|
1370 | + curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5'); |
|
1371 | + return curl_exec($ch); |
|
1372 | + } |
|
1373 | 1373 | /* |
1374 | 1374 | public static function waypoints() { |
1375 | 1375 | $data = update_db::getData('http://www.fallingrain.com/world/FR/waypoints.html'); |
@@ -1452,7 +1452,7 @@ discard block |
||
1452 | 1452 | if ($globalTransaction) $Connection->db->commit(); |
1453 | 1453 | } |
1454 | 1454 | return ''; |
1455 | - } |
|
1455 | + } |
|
1456 | 1456 | |
1457 | 1457 | public static function ivao_airlines($filename) { |
1458 | 1458 | //require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
@@ -1462,10 +1462,10 @@ discard block |
||
1462 | 1462 | try { |
1463 | 1463 | $Connection = new Connection(); |
1464 | 1464 | $sth = $Connection->db->prepare($query); |
1465 | - $sth->execute(); |
|
1466 | - } catch(PDOException $e) { |
|
1467 | - return "error : ".$e->getMessage(); |
|
1468 | - } |
|
1465 | + $sth->execute(); |
|
1466 | + } catch(PDOException $e) { |
|
1467 | + return "error : ".$e->getMessage(); |
|
1468 | + } |
|
1469 | 1469 | |
1470 | 1470 | $header = NULL; |
1471 | 1471 | $delimiter = ':'; |
@@ -1489,7 +1489,7 @@ discard block |
||
1489 | 1489 | if ($globalTransaction) $Connection->db->commit(); |
1490 | 1490 | } |
1491 | 1491 | return ''; |
1492 | - } |
|
1492 | + } |
|
1493 | 1493 | |
1494 | 1494 | public static function update_airspace() { |
1495 | 1495 | global $tmp_dir, $globalDBdriver; |
@@ -1499,11 +1499,11 @@ discard block |
||
1499 | 1499 | $query = 'DROP TABLE airspace'; |
1500 | 1500 | try { |
1501 | 1501 | $sth = $Connection->db->prepare($query); |
1502 | - $sth->execute(); |
|
1503 | - } catch(PDOException $e) { |
|
1502 | + $sth->execute(); |
|
1503 | + } catch(PDOException $e) { |
|
1504 | 1504 | return "error : ".$e->getMessage(); |
1505 | - } |
|
1506 | - } |
|
1505 | + } |
|
1506 | + } |
|
1507 | 1507 | |
1508 | 1508 | |
1509 | 1509 | if ($globalDBdriver == 'mysql') update_db::gunzip('../db/airspace.sql.gz',$tmp_dir.'airspace.sql'); |
@@ -1558,10 +1558,10 @@ discard block |
||
1558 | 1558 | $query = 'DROP TABLE countries'; |
1559 | 1559 | try { |
1560 | 1560 | $sth = $Connection->db->prepare($query); |
1561 | - $sth->execute(); |
|
1562 | - } catch(PDOException $e) { |
|
1563 | - echo "error : ".$e->getMessage(); |
|
1564 | - } |
|
1561 | + $sth->execute(); |
|
1562 | + } catch(PDOException $e) { |
|
1563 | + echo "error : ".$e->getMessage(); |
|
1564 | + } |
|
1565 | 1565 | } |
1566 | 1566 | if ($globalDBdriver == 'mysql') { |
1567 | 1567 | update_db::gunzip('../db/countries.sql.gz',$tmp_dir.'countries.sql'); |
@@ -2090,11 +2090,11 @@ discard block |
||
2090 | 2090 | $query = 'DROP TABLE airspace'; |
2091 | 2091 | try { |
2092 | 2092 | $sth = $Connection->db->prepare($query); |
2093 | - $sth->execute(); |
|
2094 | - } catch(PDOException $e) { |
|
2093 | + $sth->execute(); |
|
2094 | + } catch(PDOException $e) { |
|
2095 | 2095 | return "error : ".$e->getMessage(); |
2096 | - } |
|
2097 | - } |
|
2096 | + } |
|
2097 | + } |
|
2098 | 2098 | $error = create_db::import_file($tmp_dir.'airspace.sql'); |
2099 | 2099 | update_db::insert_airspace_version($airspace_md5); |
2100 | 2100 | } else $error = "File ".$tmp_dir.'airpsace.sql.gz'." doesn't exist. Download failed."; |
@@ -2251,12 +2251,12 @@ discard block |
||
2251 | 2251 | echo $data; |
2252 | 2252 | */ |
2253 | 2253 | if (file_exists($tmp_dir.'aircrafts.html')) { |
2254 | - //var_dump(file_get_html($tmp_dir.'aircrafts.html')); |
|
2255 | - $fh = fopen($tmp_dir.'aircrafts.html',"r"); |
|
2256 | - $result = fread($fh,100000000); |
|
2257 | - //echo $result; |
|
2258 | - //var_dump(str_get_html($result)); |
|
2259 | - //print_r(self::table2array($result)); |
|
2254 | + //var_dump(file_get_html($tmp_dir.'aircrafts.html')); |
|
2255 | + $fh = fopen($tmp_dir.'aircrafts.html',"r"); |
|
2256 | + $result = fread($fh,100000000); |
|
2257 | + //echo $result; |
|
2258 | + //var_dump(str_get_html($result)); |
|
2259 | + //print_r(self::table2array($result)); |
|
2260 | 2260 | } |
2261 | 2261 | |
2262 | 2262 | } |
@@ -2270,10 +2270,10 @@ discard block |
||
2270 | 2270 | try { |
2271 | 2271 | $Connection = new Connection(); |
2272 | 2272 | $sth = $Connection->db->prepare($query); |
2273 | - $sth->execute(); |
|
2274 | - } catch(PDOException $e) { |
|
2275 | - return "error : ".$e->getMessage(); |
|
2276 | - } |
|
2273 | + $sth->execute(); |
|
2274 | + } catch(PDOException $e) { |
|
2275 | + return "error : ".$e->getMessage(); |
|
2276 | + } |
|
2277 | 2277 | |
2278 | 2278 | $error = ''; |
2279 | 2279 | if ($globalDebug) echo "Notam : Download..."; |
@@ -2329,8 +2329,8 @@ discard block |
||
2329 | 2329 | $data['date_end'] = date("Y-m-d H:i:s",strtotime($to)); |
2330 | 2330 | $data['permanent'] = 0; |
2331 | 2331 | } else { |
2332 | - $data['date_end'] = NULL; |
|
2333 | - $data['permanent'] = 1; |
|
2332 | + $data['date_end'] = NULL; |
|
2333 | + $data['permanent'] = 1; |
|
2334 | 2334 | } |
2335 | 2335 | $data['full_notam'] = $notam['title'].'<br>'.$notam['description']; |
2336 | 2336 | $NOTAM = new NOTAM(); |
@@ -2404,13 +2404,13 @@ discard block |
||
2404 | 2404 | try { |
2405 | 2405 | $Connection = new Connection(); |
2406 | 2406 | $sth = $Connection->db->prepare($query); |
2407 | - $sth->execute(); |
|
2408 | - } catch(PDOException $e) { |
|
2409 | - return "error : ".$e->getMessage(); |
|
2410 | - } |
|
2411 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2412 | - if ($row['nb'] > 0) return false; |
|
2413 | - else return true; |
|
2407 | + $sth->execute(); |
|
2408 | + } catch(PDOException $e) { |
|
2409 | + return "error : ".$e->getMessage(); |
|
2410 | + } |
|
2411 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2412 | + if ($row['nb'] > 0) return false; |
|
2413 | + else return true; |
|
2414 | 2414 | } |
2415 | 2415 | |
2416 | 2416 | public static function insert_last_update() { |
@@ -2419,10 +2419,10 @@ discard block |
||
2419 | 2419 | try { |
2420 | 2420 | $Connection = new Connection(); |
2421 | 2421 | $sth = $Connection->db->prepare($query); |
2422 | - $sth->execute(); |
|
2423 | - } catch(PDOException $e) { |
|
2424 | - return "error : ".$e->getMessage(); |
|
2425 | - } |
|
2422 | + $sth->execute(); |
|
2423 | + } catch(PDOException $e) { |
|
2424 | + return "error : ".$e->getMessage(); |
|
2425 | + } |
|
2426 | 2426 | } |
2427 | 2427 | |
2428 | 2428 | public static function check_airspace_version($version) { |
@@ -2430,13 +2430,13 @@ discard block |
||
2430 | 2430 | try { |
2431 | 2431 | $Connection = new Connection(); |
2432 | 2432 | $sth = $Connection->db->prepare($query); |
2433 | - $sth->execute(array(':version' => $version)); |
|
2434 | - } catch(PDOException $e) { |
|
2435 | - return "error : ".$e->getMessage(); |
|
2436 | - } |
|
2437 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2438 | - if ($row['nb'] > 0) return true; |
|
2439 | - else return false; |
|
2433 | + $sth->execute(array(':version' => $version)); |
|
2434 | + } catch(PDOException $e) { |
|
2435 | + return "error : ".$e->getMessage(); |
|
2436 | + } |
|
2437 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2438 | + if ($row['nb'] > 0) return true; |
|
2439 | + else return false; |
|
2440 | 2440 | } |
2441 | 2441 | |
2442 | 2442 | public static function check_marine_identity_version($version) { |
@@ -2444,13 +2444,13 @@ discard block |
||
2444 | 2444 | try { |
2445 | 2445 | $Connection = new Connection(); |
2446 | 2446 | $sth = $Connection->db->prepare($query); |
2447 | - $sth->execute(array(':version' => $version)); |
|
2448 | - } catch(PDOException $e) { |
|
2449 | - return "error : ".$e->getMessage(); |
|
2450 | - } |
|
2451 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2452 | - if ($row['nb'] > 0) return true; |
|
2453 | - else return false; |
|
2447 | + $sth->execute(array(':version' => $version)); |
|
2448 | + } catch(PDOException $e) { |
|
2449 | + return "error : ".$e->getMessage(); |
|
2450 | + } |
|
2451 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2452 | + if ($row['nb'] > 0) return true; |
|
2453 | + else return false; |
|
2454 | 2454 | } |
2455 | 2455 | |
2456 | 2456 | |
@@ -2460,10 +2460,10 @@ discard block |
||
2460 | 2460 | try { |
2461 | 2461 | $Connection = new Connection(); |
2462 | 2462 | $sth = $Connection->db->prepare($query); |
2463 | - $sth->execute(array(':version' => $version)); |
|
2464 | - } catch(PDOException $e) { |
|
2465 | - return "error : ".$e->getMessage(); |
|
2466 | - } |
|
2463 | + $sth->execute(array(':version' => $version)); |
|
2464 | + } catch(PDOException $e) { |
|
2465 | + return "error : ".$e->getMessage(); |
|
2466 | + } |
|
2467 | 2467 | } |
2468 | 2468 | |
2469 | 2469 | public static function insert_marine_identity_version($version) { |
@@ -2472,10 +2472,10 @@ discard block |
||
2472 | 2472 | try { |
2473 | 2473 | $Connection = new Connection(); |
2474 | 2474 | $sth = $Connection->db->prepare($query); |
2475 | - $sth->execute(array(':version' => $version)); |
|
2476 | - } catch(PDOException $e) { |
|
2477 | - return "error : ".$e->getMessage(); |
|
2478 | - } |
|
2475 | + $sth->execute(array(':version' => $version)); |
|
2476 | + } catch(PDOException $e) { |
|
2477 | + return "error : ".$e->getMessage(); |
|
2478 | + } |
|
2479 | 2479 | } |
2480 | 2480 | |
2481 | 2481 | public static function check_last_notam_update() { |
@@ -2488,13 +2488,13 @@ discard block |
||
2488 | 2488 | try { |
2489 | 2489 | $Connection = new Connection(); |
2490 | 2490 | $sth = $Connection->db->prepare($query); |
2491 | - $sth->execute(); |
|
2492 | - } catch(PDOException $e) { |
|
2493 | - return "error : ".$e->getMessage(); |
|
2494 | - } |
|
2495 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2496 | - if ($row['nb'] > 0) return false; |
|
2497 | - else return true; |
|
2491 | + $sth->execute(); |
|
2492 | + } catch(PDOException $e) { |
|
2493 | + return "error : ".$e->getMessage(); |
|
2494 | + } |
|
2495 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2496 | + if ($row['nb'] > 0) return false; |
|
2497 | + else return true; |
|
2498 | 2498 | } |
2499 | 2499 | |
2500 | 2500 | public static function insert_last_notam_update() { |
@@ -2503,10 +2503,10 @@ discard block |
||
2503 | 2503 | try { |
2504 | 2504 | $Connection = new Connection(); |
2505 | 2505 | $sth = $Connection->db->prepare($query); |
2506 | - $sth->execute(); |
|
2507 | - } catch(PDOException $e) { |
|
2508 | - return "error : ".$e->getMessage(); |
|
2509 | - } |
|
2506 | + $sth->execute(); |
|
2507 | + } catch(PDOException $e) { |
|
2508 | + return "error : ".$e->getMessage(); |
|
2509 | + } |
|
2510 | 2510 | } |
2511 | 2511 | public static function check_last_airspace_update() { |
2512 | 2512 | global $globalDBdriver; |
@@ -2518,13 +2518,13 @@ discard block |
||
2518 | 2518 | try { |
2519 | 2519 | $Connection = new Connection(); |
2520 | 2520 | $sth = $Connection->db->prepare($query); |
2521 | - $sth->execute(); |
|
2522 | - } catch(PDOException $e) { |
|
2523 | - return "error : ".$e->getMessage(); |
|
2524 | - } |
|
2525 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2526 | - if ($row['nb'] > 0) return false; |
|
2527 | - else return true; |
|
2521 | + $sth->execute(); |
|
2522 | + } catch(PDOException $e) { |
|
2523 | + return "error : ".$e->getMessage(); |
|
2524 | + } |
|
2525 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2526 | + if ($row['nb'] > 0) return false; |
|
2527 | + else return true; |
|
2528 | 2528 | } |
2529 | 2529 | |
2530 | 2530 | public static function insert_last_airspace_update() { |
@@ -2533,10 +2533,10 @@ discard block |
||
2533 | 2533 | try { |
2534 | 2534 | $Connection = new Connection(); |
2535 | 2535 | $sth = $Connection->db->prepare($query); |
2536 | - $sth->execute(); |
|
2537 | - } catch(PDOException $e) { |
|
2538 | - return "error : ".$e->getMessage(); |
|
2539 | - } |
|
2536 | + $sth->execute(); |
|
2537 | + } catch(PDOException $e) { |
|
2538 | + return "error : ".$e->getMessage(); |
|
2539 | + } |
|
2540 | 2540 | } |
2541 | 2541 | |
2542 | 2542 | public static function check_last_owner_update() { |
@@ -2549,13 +2549,13 @@ discard block |
||
2549 | 2549 | try { |
2550 | 2550 | $Connection = new Connection(); |
2551 | 2551 | $sth = $Connection->db->prepare($query); |
2552 | - $sth->execute(); |
|
2553 | - } catch(PDOException $e) { |
|
2554 | - return "error : ".$e->getMessage(); |
|
2555 | - } |
|
2556 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2557 | - if ($row['nb'] > 0) return false; |
|
2558 | - else return true; |
|
2552 | + $sth->execute(); |
|
2553 | + } catch(PDOException $e) { |
|
2554 | + return "error : ".$e->getMessage(); |
|
2555 | + } |
|
2556 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2557 | + if ($row['nb'] > 0) return false; |
|
2558 | + else return true; |
|
2559 | 2559 | } |
2560 | 2560 | |
2561 | 2561 | public static function insert_last_owner_update() { |
@@ -2564,10 +2564,10 @@ discard block |
||
2564 | 2564 | try { |
2565 | 2565 | $Connection = new Connection(); |
2566 | 2566 | $sth = $Connection->db->prepare($query); |
2567 | - $sth->execute(); |
|
2568 | - } catch(PDOException $e) { |
|
2569 | - return "error : ".$e->getMessage(); |
|
2570 | - } |
|
2567 | + $sth->execute(); |
|
2568 | + } catch(PDOException $e) { |
|
2569 | + return "error : ".$e->getMessage(); |
|
2570 | + } |
|
2571 | 2571 | } |
2572 | 2572 | public static function check_last_schedules_update() { |
2573 | 2573 | global $globalDBdriver; |
@@ -2579,13 +2579,13 @@ discard block |
||
2579 | 2579 | try { |
2580 | 2580 | $Connection = new Connection(); |
2581 | 2581 | $sth = $Connection->db->prepare($query); |
2582 | - $sth->execute(); |
|
2583 | - } catch(PDOException $e) { |
|
2584 | - return "error : ".$e->getMessage(); |
|
2585 | - } |
|
2586 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2587 | - if ($row['nb'] > 0) return false; |
|
2588 | - else return true; |
|
2582 | + $sth->execute(); |
|
2583 | + } catch(PDOException $e) { |
|
2584 | + return "error : ".$e->getMessage(); |
|
2585 | + } |
|
2586 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2587 | + if ($row['nb'] > 0) return false; |
|
2588 | + else return true; |
|
2589 | 2589 | } |
2590 | 2590 | |
2591 | 2591 | public static function insert_last_schedules_update() { |
@@ -2594,10 +2594,10 @@ discard block |
||
2594 | 2594 | try { |
2595 | 2595 | $Connection = new Connection(); |
2596 | 2596 | $sth = $Connection->db->prepare($query); |
2597 | - $sth->execute(); |
|
2598 | - } catch(PDOException $e) { |
|
2599 | - return "error : ".$e->getMessage(); |
|
2600 | - } |
|
2597 | + $sth->execute(); |
|
2598 | + } catch(PDOException $e) { |
|
2599 | + return "error : ".$e->getMessage(); |
|
2600 | + } |
|
2601 | 2601 | } |
2602 | 2602 | public static function check_last_tle_update() { |
2603 | 2603 | global $globalDBdriver; |
@@ -2609,13 +2609,13 @@ discard block |
||
2609 | 2609 | try { |
2610 | 2610 | $Connection = new Connection(); |
2611 | 2611 | $sth = $Connection->db->prepare($query); |
2612 | - $sth->execute(); |
|
2613 | - } catch(PDOException $e) { |
|
2614 | - return "error : ".$e->getMessage(); |
|
2615 | - } |
|
2616 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2617 | - if ($row['nb'] > 0) return false; |
|
2618 | - else return true; |
|
2612 | + $sth->execute(); |
|
2613 | + } catch(PDOException $e) { |
|
2614 | + return "error : ".$e->getMessage(); |
|
2615 | + } |
|
2616 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2617 | + if ($row['nb'] > 0) return false; |
|
2618 | + else return true; |
|
2619 | 2619 | } |
2620 | 2620 | |
2621 | 2621 | public static function insert_last_tle_update() { |
@@ -2624,10 +2624,10 @@ discard block |
||
2624 | 2624 | try { |
2625 | 2625 | $Connection = new Connection(); |
2626 | 2626 | $sth = $Connection->db->prepare($query); |
2627 | - $sth->execute(); |
|
2628 | - } catch(PDOException $e) { |
|
2629 | - return "error : ".$e->getMessage(); |
|
2630 | - } |
|
2627 | + $sth->execute(); |
|
2628 | + } catch(PDOException $e) { |
|
2629 | + return "error : ".$e->getMessage(); |
|
2630 | + } |
|
2631 | 2631 | } |
2632 | 2632 | public static function check_last_marine_identity_update() { |
2633 | 2633 | global $globalDBdriver; |
@@ -2639,13 +2639,13 @@ discard block |
||
2639 | 2639 | try { |
2640 | 2640 | $Connection = new Connection(); |
2641 | 2641 | $sth = $Connection->db->prepare($query); |
2642 | - $sth->execute(); |
|
2643 | - } catch(PDOException $e) { |
|
2644 | - return "error : ".$e->getMessage(); |
|
2645 | - } |
|
2646 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2647 | - if ($row['nb'] > 0) return false; |
|
2648 | - else return true; |
|
2642 | + $sth->execute(); |
|
2643 | + } catch(PDOException $e) { |
|
2644 | + return "error : ".$e->getMessage(); |
|
2645 | + } |
|
2646 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2647 | + if ($row['nb'] > 0) return false; |
|
2648 | + else return true; |
|
2649 | 2649 | } |
2650 | 2650 | |
2651 | 2651 | public static function insert_last_marine_identity_update() { |
@@ -2654,10 +2654,10 @@ discard block |
||
2654 | 2654 | try { |
2655 | 2655 | $Connection = new Connection(); |
2656 | 2656 | $sth = $Connection->db->prepare($query); |
2657 | - $sth->execute(); |
|
2658 | - } catch(PDOException $e) { |
|
2659 | - return "error : ".$e->getMessage(); |
|
2660 | - } |
|
2657 | + $sth->execute(); |
|
2658 | + } catch(PDOException $e) { |
|
2659 | + return "error : ".$e->getMessage(); |
|
2660 | + } |
|
2661 | 2661 | } |
2662 | 2662 | public static function delete_duplicatemodes() { |
2663 | 2663 | global $globalDBdriver; |
@@ -2669,10 +2669,10 @@ discard block |
||
2669 | 2669 | try { |
2670 | 2670 | $Connection = new Connection(); |
2671 | 2671 | $sth = $Connection->db->prepare($query); |
2672 | - $sth->execute(); |
|
2673 | - } catch(PDOException $e) { |
|
2674 | - return "error : ".$e->getMessage(); |
|
2675 | - } |
|
2672 | + $sth->execute(); |
|
2673 | + } catch(PDOException $e) { |
|
2674 | + return "error : ".$e->getMessage(); |
|
2675 | + } |
|
2676 | 2676 | } |
2677 | 2677 | public static function delete_duplicateowner() { |
2678 | 2678 | global $globalDBdriver; |
@@ -2684,10 +2684,10 @@ discard block |
||
2684 | 2684 | try { |
2685 | 2685 | $Connection = new Connection(); |
2686 | 2686 | $sth = $Connection->db->prepare($query); |
2687 | - $sth->execute(); |
|
2688 | - } catch(PDOException $e) { |
|
2689 | - return "error : ".$e->getMessage(); |
|
2690 | - } |
|
2687 | + $sth->execute(); |
|
2688 | + } catch(PDOException $e) { |
|
2689 | + return "error : ".$e->getMessage(); |
|
2690 | + } |
|
2691 | 2691 | } |
2692 | 2692 | |
2693 | 2693 | public static function update_all() { |