@@ -91,28 +91,28 @@ |
||
91 | 91 | $limit_previous_2 = $limit_end - $absolute_difference; |
92 | 92 | |
93 | 93 | if ( |
94 | - (isset($_GET['q']) && $_GET['q'] != '') || |
|
95 | - (isset($_GET['registration']) && $_GET['registration'] != '') || |
|
96 | - (isset($_GET['aircraft']) && $_GET['aircraft'] != '') || |
|
97 | - (isset($_GET['manufacturer']) && $_GET['manufacturer'] != '') || |
|
98 | - (isset($_GET['highlights']) && $_GET['highlights'] != '') || |
|
99 | - (isset($_GET['airline']) && $_GET['airline'] != '') || |
|
100 | - (isset($_GET['airline_country']) && $_GET['airline_country'] != '') || |
|
101 | - (isset($_GET['airline_type']) && $_GET['airline_type'] != '') || |
|
102 | - (isset($_GET['airport']) && $_GET['airport'] != '') || |
|
103 | - (isset($_GET['airport_country']) && $_GET['airport_country'] != '') || |
|
104 | - (isset($_GET['callsign']) && $_GET['callsign'] != '') || |
|
105 | - (isset($_GET['owner']) && $_GET['owner'] != '') || |
|
106 | - (isset($_GET['pilot_name']) && $_GET['pilot_name'] != '') || |
|
107 | - (isset($_GET['pilot_id']) && $_GET['pilot_id'] != '') || |
|
108 | - (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != '') || |
|
109 | - (isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != '') || |
|
110 | - (isset($_GET['mmsi']) && $_GET['mmsi'] != '') || |
|
111 | - (isset($_GET['imo']) && $_GET['imo'] != '') || |
|
112 | - ((isset($_GET['origlat']) && $_GET['origlat'] != '') && |
|
113 | - (isset($_GET['origlon']) && $_GET['origlon'] != '') && |
|
114 | - (isset($_GET['dist']) && $_GET['dist'] != '')) |
|
115 | - ){ |
|
94 | + (isset($_GET['q']) && $_GET['q'] != '') || |
|
95 | + (isset($_GET['registration']) && $_GET['registration'] != '') || |
|
96 | + (isset($_GET['aircraft']) && $_GET['aircraft'] != '') || |
|
97 | + (isset($_GET['manufacturer']) && $_GET['manufacturer'] != '') || |
|
98 | + (isset($_GET['highlights']) && $_GET['highlights'] != '') || |
|
99 | + (isset($_GET['airline']) && $_GET['airline'] != '') || |
|
100 | + (isset($_GET['airline_country']) && $_GET['airline_country'] != '') || |
|
101 | + (isset($_GET['airline_type']) && $_GET['airline_type'] != '') || |
|
102 | + (isset($_GET['airport']) && $_GET['airport'] != '') || |
|
103 | + (isset($_GET['airport_country']) && $_GET['airport_country'] != '') || |
|
104 | + (isset($_GET['callsign']) && $_GET['callsign'] != '') || |
|
105 | + (isset($_GET['owner']) && $_GET['owner'] != '') || |
|
106 | + (isset($_GET['pilot_name']) && $_GET['pilot_name'] != '') || |
|
107 | + (isset($_GET['pilot_id']) && $_GET['pilot_id'] != '') || |
|
108 | + (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != '') || |
|
109 | + (isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != '') || |
|
110 | + (isset($_GET['mmsi']) && $_GET['mmsi'] != '') || |
|
111 | + (isset($_GET['imo']) && $_GET['imo'] != '') || |
|
112 | + ((isset($_GET['origlat']) && $_GET['origlat'] != '') && |
|
113 | + (isset($_GET['origlon']) && $_GET['origlon'] != '') && |
|
114 | + (isset($_GET['dist']) && $_GET['dist'] != '')) |
|
115 | + ){ |
|
116 | 116 | $q = filter_input(INPUT_GET, 'q',FILTER_SANITIZE_STRING); |
117 | 117 | $registration = filter_input(INPUT_GET, 'registration',FILTER_SANITIZE_STRING); |
118 | 118 | $aircraft = filter_input(INPUT_GET, 'aircraft',FILTER_SANITIZE_STRING); |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
59 | - * Creates the database connection |
|
60 | - * |
|
61 | - * @return Boolean of the database connection |
|
62 | - * |
|
63 | - */ |
|
59 | + * Creates the database connection |
|
60 | + * |
|
61 | + * @return Boolean of the database connection |
|
62 | + * |
|
63 | + */ |
|
64 | 64 | public function createDBConnection($DBname = null, $user = null, $pass = null) |
65 | 65 | { |
66 | 66 | global $globalDBdriver, $globalDBhost, $globalDBuser, $globalDBpass, $globalDBname, $globalDebug, $globalDB, $globalDBport, $globalDBTimeOut, $globalDBretry, $globalDBPersistent; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | return false; |
159 | 159 | } |
160 | 160 | if($results->rowCount()>0) { |
161 | - return true; |
|
161 | + return true; |
|
162 | 162 | } |
163 | 163 | else return false; |
164 | 164 | } |
@@ -176,14 +176,14 @@ discard block |
||
176 | 176 | $sum = $sum->fetchColumn(0); |
177 | 177 | } else $sum = 0; |
178 | 178 | if (intval($sum) !== 2) { |
179 | - return false; |
|
179 | + return false; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | } catch(PDOException $e) { |
183 | 183 | if($e->getCode() != 'HY000' || !stristr($e->getMessage(), 'server has gone away')) { |
184 | - throw $e; |
|
185 | - } |
|
186 | - //echo 'error ! '.$e->getMessage(); |
|
184 | + throw $e; |
|
185 | + } |
|
186 | + //echo 'error ! '.$e->getMessage(); |
|
187 | 187 | return false; |
188 | 188 | } |
189 | 189 | return true; |
@@ -287,8 +287,8 @@ discard block |
||
287 | 287 | $version = 0; |
288 | 288 | if ($this->tableExists('aircraft')) { |
289 | 289 | if (!$this->tableExists('config')) { |
290 | - $version = '1'; |
|
291 | - return $version; |
|
290 | + $version = '1'; |
|
291 | + return $version; |
|
292 | 292 | } else { |
293 | 293 | $query = "SELECT value FROM config WHERE name = 'schema_version' LIMIT 1"; |
294 | 294 | try { |
@@ -309,10 +309,10 @@ discard block |
||
309 | 309 | * @return Boolean if latest version or not |
310 | 310 | */ |
311 | 311 | public function latest() { |
312 | - global $globalNoDB; |
|
313 | - if (isset($globalNoDB) && $globalNoDB === TRUE) return true; |
|
314 | - if ($this->check_schema_version() == $this->latest_schema) return true; |
|
315 | - else return false; |
|
312 | + global $globalNoDB; |
|
313 | + if (isset($globalNoDB) && $globalNoDB === TRUE) return true; |
|
314 | + if ($this->check_schema_version() == $this->latest_schema) return true; |
|
315 | + else return false; |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | } |
@@ -12,10 +12,10 @@ discard block |
||
12 | 12 | } |
13 | 13 | |
14 | 14 | /** |
15 | - * Get SQL query part for filter used |
|
16 | - * @param Array $filter the filter |
|
17 | - * @return Array the SQL part |
|
18 | - */ |
|
15 | + * Get SQL query part for filter used |
|
16 | + * @param Array $filter the filter |
|
17 | + * @return Array the SQL part |
|
18 | + */ |
|
19 | 19 | |
20 | 20 | public function getFilter($filter = array(),$where = false,$and = false) { |
21 | 21 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
@@ -79,14 +79,14 @@ discard block |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
82 | - * Executes the SQL statements to get the spotter information |
|
83 | - * |
|
84 | - * @param String $query the SQL query |
|
85 | - * @param Array $params parameter of the query |
|
86 | - * @param String $limitQuery the limit query |
|
87 | - * @return Array the spotter information |
|
88 | - * |
|
89 | - */ |
|
82 | + * Executes the SQL statements to get the spotter information |
|
83 | + * |
|
84 | + * @param String $query the SQL query |
|
85 | + * @param Array $params parameter of the query |
|
86 | + * @param String $limitQuery the limit query |
|
87 | + * @return Array the spotter information |
|
88 | + * |
|
89 | + */ |
|
90 | 90 | public function getDataFromDB($query, $params = array(), $limitQuery = '',$schedules = false) |
91 | 91 | { |
92 | 92 | date_default_timezone_set('UTC'); |
@@ -214,11 +214,11 @@ discard block |
||
214 | 214 | |
215 | 215 | |
216 | 216 | /** |
217 | - * Gets all the spotter information based on the latest data entry |
|
218 | - * |
|
219 | - * @return Array the spotter information |
|
220 | - * |
|
221 | - */ |
|
217 | + * Gets all the spotter information based on the latest data entry |
|
218 | + * |
|
219 | + * @return Array the spotter information |
|
220 | + * |
|
221 | + */ |
|
222 | 222 | public function getLatestMarineData($limit = '', $sort = '', $filter = array()) |
223 | 223 | { |
224 | 224 | global $global_query; |
@@ -267,11 +267,11 @@ discard block |
||
267 | 267 | } |
268 | 268 | |
269 | 269 | /** |
270 | - * Gets all the spotter information based on the callsign |
|
271 | - * |
|
272 | - * @return Array the spotter information |
|
273 | - * |
|
274 | - */ |
|
270 | + * Gets all the spotter information based on the callsign |
|
271 | + * |
|
272 | + * @return Array the spotter information |
|
273 | + * |
|
274 | + */ |
|
275 | 275 | public function getMarineDataByIdent($ident = '', $limit = '', $sort = '', $filter = array()) |
276 | 276 | { |
277 | 277 | global $global_query; |
@@ -382,12 +382,12 @@ discard block |
||
382 | 382 | |
383 | 383 | |
384 | 384 | /** |
385 | - * Gets all source name |
|
386 | - * |
|
387 | - * @param String type format of source |
|
388 | - * @return Array list of source name |
|
389 | - * |
|
390 | - */ |
|
385 | + * Gets all source name |
|
386 | + * |
|
387 | + * @param String type format of source |
|
388 | + * @return Array list of source name |
|
389 | + * |
|
390 | + */ |
|
391 | 391 | public function getAllSourceName($type = '',$filters = array()) |
392 | 392 | { |
393 | 393 | $filter_query = $this->getFilter($filters,true,true); |
@@ -417,11 +417,11 @@ discard block |
||
417 | 417 | |
418 | 418 | |
419 | 419 | /** |
420 | - * Gets a list of all idents/callsigns |
|
421 | - * |
|
422 | - * @return Array list of ident/callsign names |
|
423 | - * |
|
424 | - */ |
|
420 | + * Gets a list of all idents/callsigns |
|
421 | + * |
|
422 | + * @return Array list of ident/callsign names |
|
423 | + * |
|
424 | + */ |
|
425 | 425 | public function getAllIdents($filters = array()) |
426 | 426 | { |
427 | 427 | $filter_query = $this->getFilter($filters,true,true); |
@@ -445,11 +445,11 @@ discard block |
||
445 | 445 | } |
446 | 446 | |
447 | 447 | /** |
448 | - * Gets all info from a mmsi |
|
449 | - * |
|
450 | - * @return Array list of mmsi info |
|
451 | - * |
|
452 | - */ |
|
448 | + * Gets all info from a mmsi |
|
449 | + * |
|
450 | + * @return Array list of mmsi info |
|
451 | + * |
|
452 | + */ |
|
453 | 453 | public function getIdentity($mmsi) |
454 | 454 | { |
455 | 455 | $mmsi = filter_var($mmsi,FILTER_SANITIZE_NUMBER_INT); |
@@ -506,18 +506,18 @@ discard block |
||
506 | 506 | |
507 | 507 | |
508 | 508 | /** |
509 | - * Update ident tracker data |
|
510 | - * |
|
511 | - * @param String $fammarine_id the ID |
|
512 | - * @param String $ident the marine ident |
|
513 | - * @return String success or false |
|
514 | - * |
|
515 | - */ |
|
509 | + * Update ident tracker data |
|
510 | + * |
|
511 | + * @param String $fammarine_id the ID |
|
512 | + * @param String $ident the marine ident |
|
513 | + * @return String success or false |
|
514 | + * |
|
515 | + */ |
|
516 | 516 | public function updateIdentMarineData($fammarine_id = '', $ident = '',$fromsource = NULL) |
517 | 517 | { |
518 | 518 | |
519 | 519 | $query = 'UPDATE marine_output SET ident = :ident WHERE fammarine_id = :fammarine_id'; |
520 | - $query_values = array(':fammarine_id' => $fammarine_id,':ident' => $ident); |
|
520 | + $query_values = array(':fammarine_id' => $fammarine_id,':ident' => $ident); |
|
521 | 521 | |
522 | 522 | try { |
523 | 523 | $sth = $this->db->prepare($query); |
@@ -531,19 +531,19 @@ discard block |
||
531 | 531 | } |
532 | 532 | |
533 | 533 | /** |
534 | - * Update Status data |
|
535 | - * |
|
536 | - * @param String $fammarine_id the ID |
|
537 | - * @param String $status_id the marine status id |
|
538 | - * @param String $status the marine status |
|
539 | - * @return String success or false |
|
540 | - * |
|
541 | - */ |
|
534 | + * Update Status data |
|
535 | + * |
|
536 | + * @param String $fammarine_id the ID |
|
537 | + * @param String $status_id the marine status id |
|
538 | + * @param String $status the marine status |
|
539 | + * @return String success or false |
|
540 | + * |
|
541 | + */ |
|
542 | 542 | public function updateStatusMarineData($fammarine_id = '', $status_id = '',$status = '') |
543 | 543 | { |
544 | 544 | |
545 | 545 | $query = 'UPDATE marine_output SET status = :status, status_id = :status_id WHERE fammarine_id = :fammarine_id'; |
546 | - $query_values = array(':fammarine_id' => $fammarine_id,':status' => $status,':status_id' => $status_id); |
|
546 | + $query_values = array(':fammarine_id' => $fammarine_id,':status' => $status,':status_id' => $status_id); |
|
547 | 547 | |
548 | 548 | try { |
549 | 549 | $sth = $this->db->prepare($query); |
@@ -556,17 +556,17 @@ discard block |
||
556 | 556 | |
557 | 557 | } |
558 | 558 | /** |
559 | - * Update latest marine data |
|
560 | - * |
|
561 | - * @param String $fammarine_id the ID |
|
562 | - * @param String $ident the marine ident |
|
563 | - * @return String success or false |
|
564 | - * |
|
565 | - */ |
|
559 | + * Update latest marine data |
|
560 | + * |
|
561 | + * @param String $fammarine_id the ID |
|
562 | + * @param String $ident the marine ident |
|
563 | + * @return String success or false |
|
564 | + * |
|
565 | + */ |
|
566 | 566 | public function updateLatestMarineData($fammarine_id = '', $ident = '', $latitude = '', $longitude = '', $groundspeed = NULL, $date = '') |
567 | 567 | { |
568 | 568 | $query = 'UPDATE marine_output SET ident = :ident, last_latitude = :last_latitude, last_longitude = :last_longitude, last_seen = :last_seen, last_ground_speed = :last_ground_speed WHERE fammarine_id = :fammarine_id'; |
569 | - $query_values = array(':fammarine_id' => $fammarine_id,':last_latitude' => $latitude,':last_longitude' => $longitude, ':last_ground_speed' => $groundspeed,':last_seen' => $date,':ident' => $ident); |
|
569 | + $query_values = array(':fammarine_id' => $fammarine_id,':last_latitude' => $latitude,':last_longitude' => $longitude, ':last_ground_speed' => $groundspeed,':last_seen' => $date,':ident' => $ident); |
|
570 | 570 | |
571 | 571 | try { |
572 | 572 | $sth = $this->db->prepare($query); |
@@ -580,30 +580,30 @@ discard block |
||
580 | 580 | } |
581 | 581 | |
582 | 582 | /** |
583 | - * Adds a new spotter data |
|
584 | - * |
|
585 | - * @param String $fammarine_id the ID |
|
586 | - * @param String $ident the marine ident |
|
587 | - * @param String $departure_airport_icao the departure airport |
|
588 | - * @param String $arrival_airport_icao the arrival airport |
|
589 | - * @param String $latitude latitude of flight |
|
590 | - * @param String $longitude latitude of flight |
|
591 | - * @param String $waypoints waypoints of flight |
|
592 | - * @param String $heading heading of flight |
|
593 | - * @param String $groundspeed speed of flight |
|
594 | - * @param String $date date of flight |
|
595 | - * @param String $departure_airport_time departure time of flight |
|
596 | - * @param String $arrival_airport_time arrival time of flight |
|
597 | - * @param String $squawk squawk code of flight |
|
598 | - * @param String $route_stop route stop of flight |
|
599 | - * @param String $highlight highlight or not |
|
600 | - * @param String $ModeS ModesS code of flight |
|
601 | - * @param String $registration registration code of flight |
|
602 | - * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
603 | - * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
604 | - * @param String $verticalrate vertival rate of flight |
|
605 | - * @return String success or false |
|
606 | - */ |
|
583 | + * Adds a new spotter data |
|
584 | + * |
|
585 | + * @param String $fammarine_id the ID |
|
586 | + * @param String $ident the marine ident |
|
587 | + * @param String $departure_airport_icao the departure airport |
|
588 | + * @param String $arrival_airport_icao the arrival airport |
|
589 | + * @param String $latitude latitude of flight |
|
590 | + * @param String $longitude latitude of flight |
|
591 | + * @param String $waypoints waypoints of flight |
|
592 | + * @param String $heading heading of flight |
|
593 | + * @param String $groundspeed speed of flight |
|
594 | + * @param String $date date of flight |
|
595 | + * @param String $departure_airport_time departure time of flight |
|
596 | + * @param String $arrival_airport_time arrival time of flight |
|
597 | + * @param String $squawk squawk code of flight |
|
598 | + * @param String $route_stop route stop of flight |
|
599 | + * @param String $highlight highlight or not |
|
600 | + * @param String $ModeS ModesS code of flight |
|
601 | + * @param String $registration registration code of flight |
|
602 | + * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
603 | + * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
604 | + * @param String $verticalrate vertival rate of flight |
|
605 | + * @return String success or false |
|
606 | + */ |
|
607 | 607 | public function addMarineData($fammarine_id = '', $ident = '', $latitude = '', $longitude = '', $heading = '', $groundspeed = '', $date = '', $mmsi = '',$type = '',$typeid = '',$imo = '',$callsign = '',$arrival_code = '',$arrival_date = '',$status = '',$statusid = '',$format_source = '', $source_name = '') |
608 | 608 | { |
609 | 609 | global $globalURL, $globalMarineImageFetch; |
@@ -700,13 +700,13 @@ discard block |
||
700 | 700 | unset($Image); |
701 | 701 | } |
702 | 702 | |
703 | - if ($latitude == '' && $longitude == '') { |
|
704 | - $latitude = 0; |
|
705 | - $longitude = 0; |
|
706 | - } |
|
707 | - if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
708 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
709 | - if ($arrival_date == '') $arrival_date = NULL; |
|
703 | + if ($latitude == '' && $longitude == '') { |
|
704 | + $latitude = 0; |
|
705 | + $longitude = 0; |
|
706 | + } |
|
707 | + if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
708 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
709 | + if ($arrival_date == '') $arrival_date = NULL; |
|
710 | 710 | $query = "INSERT INTO marine_output (fammarine_id, ident, latitude, longitude, heading, ground_speed, date, format_source, source_name, mmsi, type, status,imo,arrival_port_name,arrival_port_date) |
711 | 711 | VALUES (:fammarine_id,:ident,:latitude,:longitude,:heading,:speed,:date,:format_source, :source_name,:mmsi,:type,:status,:imo,:arrival_port_name,:arrival_port_date)"; |
712 | 712 | |
@@ -717,7 +717,7 @@ discard block |
||
717 | 717 | $sth->execute($query_values); |
718 | 718 | $this->db = null; |
719 | 719 | } catch (PDOException $e) { |
720 | - return "error : ".$e->getMessage(); |
|
720 | + return "error : ".$e->getMessage(); |
|
721 | 721 | } |
722 | 722 | |
723 | 723 | return "success"; |
@@ -726,11 +726,11 @@ discard block |
||
726 | 726 | |
727 | 727 | |
728 | 728 | /** |
729 | - * Gets the aircraft ident within the last hour |
|
730 | - * |
|
731 | - * @return String the ident |
|
732 | - * |
|
733 | - */ |
|
729 | + * Gets the aircraft ident within the last hour |
|
730 | + * |
|
731 | + * @return String the ident |
|
732 | + * |
|
733 | + */ |
|
734 | 734 | public function getIdentFromLastHour($ident) |
735 | 735 | { |
736 | 736 | global $globalDBdriver, $globalTimezone; |
@@ -746,11 +746,11 @@ discard block |
||
746 | 746 | AND marine_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
747 | 747 | AND marine_output.date < now() AT TIME ZONE 'UTC'"; |
748 | 748 | $query_data = array(':ident' => $ident); |
749 | - } |
|
749 | + } |
|
750 | 750 | |
751 | 751 | $sth = $this->db->prepare($query); |
752 | 752 | $sth->execute($query_data); |
753 | - $ident_result=''; |
|
753 | + $ident_result=''; |
|
754 | 754 | while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
755 | 755 | { |
756 | 756 | $ident_result = $row['ident']; |
@@ -761,11 +761,11 @@ discard block |
||
761 | 761 | |
762 | 762 | |
763 | 763 | /** |
764 | - * Gets the aircraft data from the last 20 seconds |
|
765 | - * |
|
766 | - * @return Array the spotter data |
|
767 | - * |
|
768 | - */ |
|
764 | + * Gets the aircraft data from the last 20 seconds |
|
765 | + * |
|
766 | + * @return Array the spotter data |
|
767 | + * |
|
768 | + */ |
|
769 | 769 | public function getRealTimeData($q = '') |
770 | 770 | { |
771 | 771 | global $globalDBdriver; |
@@ -803,11 +803,11 @@ discard block |
||
803 | 803 | |
804 | 804 | |
805 | 805 | /** |
806 | - * Gets all number of flight over countries |
|
807 | - * |
|
808 | - * @return Array the airline country list |
|
809 | - * |
|
810 | - */ |
|
806 | + * Gets all number of flight over countries |
|
807 | + * |
|
808 | + * @return Array the airline country list |
|
809 | + * |
|
810 | + */ |
|
811 | 811 | |
812 | 812 | public function countAllMarineOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
813 | 813 | { |
@@ -880,11 +880,11 @@ discard block |
||
880 | 880 | |
881 | 881 | |
882 | 882 | /** |
883 | - * Gets all callsigns that have flown over |
|
884 | - * |
|
885 | - * @return Array the callsign list |
|
886 | - * |
|
887 | - */ |
|
883 | + * Gets all callsigns that have flown over |
|
884 | + * |
|
885 | + * @return Array the callsign list |
|
886 | + * |
|
887 | + */ |
|
888 | 888 | public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '', $day = '') |
889 | 889 | { |
890 | 890 | global $globalDBdriver; |
@@ -951,11 +951,11 @@ discard block |
||
951 | 951 | |
952 | 952 | |
953 | 953 | /** |
954 | - * Counts all dates |
|
955 | - * |
|
956 | - * @return Array the date list |
|
957 | - * |
|
958 | - */ |
|
954 | + * Counts all dates |
|
955 | + * |
|
956 | + * @return Array the date list |
|
957 | + * |
|
958 | + */ |
|
959 | 959 | public function countAllDates($filters = array()) |
960 | 960 | { |
961 | 961 | global $globalTimezone, $globalDBdriver; |
@@ -1001,11 +1001,11 @@ discard block |
||
1001 | 1001 | |
1002 | 1002 | |
1003 | 1003 | /** |
1004 | - * Counts all dates during the last 7 days |
|
1005 | - * |
|
1006 | - * @return Array the date list |
|
1007 | - * |
|
1008 | - */ |
|
1004 | + * Counts all dates during the last 7 days |
|
1005 | + * |
|
1006 | + * @return Array the date list |
|
1007 | + * |
|
1008 | + */ |
|
1009 | 1009 | public function countAllDatesLast7Days($filters = array()) |
1010 | 1010 | { |
1011 | 1011 | global $globalTimezone, $globalDBdriver; |
@@ -1027,7 +1027,7 @@ discard block |
||
1027 | 1027 | $query .= " GROUP BY date_name |
1028 | 1028 | ORDER BY date_name ASC"; |
1029 | 1029 | $query_data = array(':offset' => $offset); |
1030 | - } |
|
1030 | + } |
|
1031 | 1031 | |
1032 | 1032 | $sth = $this->db->prepare($query); |
1033 | 1033 | $sth->execute($query_data); |
@@ -1047,11 +1047,11 @@ discard block |
||
1047 | 1047 | } |
1048 | 1048 | |
1049 | 1049 | /** |
1050 | - * Counts all dates during the last month |
|
1051 | - * |
|
1052 | - * @return Array the date list |
|
1053 | - * |
|
1054 | - */ |
|
1050 | + * Counts all dates during the last month |
|
1051 | + * |
|
1052 | + * @return Array the date list |
|
1053 | + * |
|
1054 | + */ |
|
1055 | 1055 | public function countAllDatesLastMonth($filters = array()) |
1056 | 1056 | { |
1057 | 1057 | global $globalTimezone, $globalDBdriver; |
@@ -1073,7 +1073,7 @@ discard block |
||
1073 | 1073 | $query .= " GROUP BY date_name |
1074 | 1074 | ORDER BY date_name ASC"; |
1075 | 1075 | $query_data = array(':offset' => $offset); |
1076 | - } |
|
1076 | + } |
|
1077 | 1077 | |
1078 | 1078 | $sth = $this->db->prepare($query); |
1079 | 1079 | $sth->execute($query_data); |
@@ -1095,11 +1095,11 @@ discard block |
||
1095 | 1095 | |
1096 | 1096 | |
1097 | 1097 | /** |
1098 | - * Counts all month |
|
1099 | - * |
|
1100 | - * @return Array the month list |
|
1101 | - * |
|
1102 | - */ |
|
1098 | + * Counts all month |
|
1099 | + * |
|
1100 | + * @return Array the month list |
|
1101 | + * |
|
1102 | + */ |
|
1103 | 1103 | public function countAllMonths($filters = array()) |
1104 | 1104 | { |
1105 | 1105 | global $globalTimezone, $globalDBdriver; |
@@ -1144,11 +1144,11 @@ discard block |
||
1144 | 1144 | |
1145 | 1145 | |
1146 | 1146 | /** |
1147 | - * Counts all dates during the last year |
|
1148 | - * |
|
1149 | - * @return Array the date list |
|
1150 | - * |
|
1151 | - */ |
|
1147 | + * Counts all dates during the last year |
|
1148 | + * |
|
1149 | + * @return Array the date list |
|
1150 | + * |
|
1151 | + */ |
|
1152 | 1152 | public function countAllMonthsLastYear($filters) |
1153 | 1153 | { |
1154 | 1154 | global $globalTimezone, $globalDBdriver; |
@@ -1170,7 +1170,7 @@ discard block |
||
1170 | 1170 | $query .= " GROUP BY year_name, month_name |
1171 | 1171 | ORDER BY year_name, month_name ASC"; |
1172 | 1172 | $query_data = array(':offset' => $offset); |
1173 | - } |
|
1173 | + } |
|
1174 | 1174 | |
1175 | 1175 | $sth = $this->db->prepare($query); |
1176 | 1176 | $sth->execute($query_data); |
@@ -1193,11 +1193,11 @@ discard block |
||
1193 | 1193 | |
1194 | 1194 | |
1195 | 1195 | /** |
1196 | - * Counts all hours |
|
1197 | - * |
|
1198 | - * @return Array the hour list |
|
1199 | - * |
|
1200 | - */ |
|
1196 | + * Counts all hours |
|
1197 | + * |
|
1198 | + * @return Array the hour list |
|
1199 | + * |
|
1200 | + */ |
|
1201 | 1201 | public function countAllHours($orderby,$filters = array()) |
1202 | 1202 | { |
1203 | 1203 | global $globalTimezone, $globalDBdriver; |
@@ -1260,11 +1260,11 @@ discard block |
||
1260 | 1260 | |
1261 | 1261 | |
1262 | 1262 | /** |
1263 | - * Counts all hours by date |
|
1264 | - * |
|
1265 | - * @return Array the hour list |
|
1266 | - * |
|
1267 | - */ |
|
1263 | + * Counts all hours by date |
|
1264 | + * |
|
1265 | + * @return Array the hour list |
|
1266 | + * |
|
1267 | + */ |
|
1268 | 1268 | public function countAllHoursByDate($date, $filters = array()) |
1269 | 1269 | { |
1270 | 1270 | global $globalTimezone, $globalDBdriver; |
@@ -1308,11 +1308,11 @@ discard block |
||
1308 | 1308 | |
1309 | 1309 | |
1310 | 1310 | /** |
1311 | - * Counts all hours by a ident/callsign |
|
1312 | - * |
|
1313 | - * @return Array the hour list |
|
1314 | - * |
|
1315 | - */ |
|
1311 | + * Counts all hours by a ident/callsign |
|
1312 | + * |
|
1313 | + * @return Array the hour list |
|
1314 | + * |
|
1315 | + */ |
|
1316 | 1316 | public function countAllHoursByIdent($ident, $filters = array()) |
1317 | 1317 | { |
1318 | 1318 | global $globalTimezone, $globalDBdriver; |
@@ -1357,11 +1357,11 @@ discard block |
||
1357 | 1357 | |
1358 | 1358 | |
1359 | 1359 | /** |
1360 | - * Counts all vessels |
|
1361 | - * |
|
1362 | - * @return Integer the number of vessels |
|
1363 | - * |
|
1364 | - */ |
|
1360 | + * Counts all vessels |
|
1361 | + * |
|
1362 | + * @return Integer the number of vessels |
|
1363 | + * |
|
1364 | + */ |
|
1365 | 1365 | public function countOverallMarine($filters = array(),$year = '',$month = '') |
1366 | 1366 | { |
1367 | 1367 | global $globalDBdriver; |
@@ -1396,11 +1396,11 @@ discard block |
||
1396 | 1396 | } |
1397 | 1397 | |
1398 | 1398 | /** |
1399 | - * Counts all vessel type |
|
1400 | - * |
|
1401 | - * @return Integer the number of vessels |
|
1402 | - * |
|
1403 | - */ |
|
1399 | + * Counts all vessel type |
|
1400 | + * |
|
1401 | + * @return Integer the number of vessels |
|
1402 | + * |
|
1403 | + */ |
|
1404 | 1404 | public function countOverallMarineTypes($filters = array(),$year = '',$month = '') |
1405 | 1405 | { |
1406 | 1406 | global $globalDBdriver; |
@@ -1435,11 +1435,11 @@ discard block |
||
1435 | 1435 | |
1436 | 1436 | |
1437 | 1437 | /** |
1438 | - * Counts all hours of today |
|
1439 | - * |
|
1440 | - * @return Array the hour list |
|
1441 | - * |
|
1442 | - */ |
|
1438 | + * Counts all hours of today |
|
1439 | + * |
|
1440 | + * @return Array the hour list |
|
1441 | + * |
|
1442 | + */ |
|
1443 | 1443 | public function countAllHoursFromToday($filters = array()) |
1444 | 1444 | { |
1445 | 1445 | global $globalTimezone, $globalDBdriver; |
@@ -1479,12 +1479,12 @@ discard block |
||
1479 | 1479 | } |
1480 | 1480 | |
1481 | 1481 | |
1482 | - /** |
|
1483 | - * Gets the Barrie Spotter ID based on the FlightAware ID |
|
1484 | - * |
|
1485 | - * @return Integer the Barrie Spotter ID |
|
1482 | + /** |
|
1483 | + * Gets the Barrie Spotter ID based on the FlightAware ID |
|
1484 | + * |
|
1485 | + * @return Integer the Barrie Spotter ID |
|
1486 | 1486 | q * |
1487 | - */ |
|
1487 | + */ |
|
1488 | 1488 | public function getMarineIDBasedOnFamMarineID($fammarine_id) |
1489 | 1489 | { |
1490 | 1490 | $fammarine_id = filter_var($fammarine_id,FILTER_SANITIZE_STRING); |
@@ -1505,13 +1505,13 @@ discard block |
||
1505 | 1505 | |
1506 | 1506 | |
1507 | 1507 | /** |
1508 | - * Parses a date string |
|
1509 | - * |
|
1510 | - * @param String $dateString the date string |
|
1511 | - * @param String $timezone the timezone of a user |
|
1512 | - * @return Array the time information |
|
1513 | - * |
|
1514 | - */ |
|
1508 | + * Parses a date string |
|
1509 | + * |
|
1510 | + * @param String $dateString the date string |
|
1511 | + * @param String $timezone the timezone of a user |
|
1512 | + * @return Array the time information |
|
1513 | + * |
|
1514 | + */ |
|
1515 | 1515 | public function parseDateString($dateString, $timezone = '') |
1516 | 1516 | { |
1517 | 1517 | $time_array = array(); |
@@ -1544,12 +1544,12 @@ discard block |
||
1544 | 1544 | } |
1545 | 1545 | |
1546 | 1546 | /** |
1547 | - * Parses the direction degrees to working |
|
1548 | - * |
|
1549 | - * @param Float $direction the direction in degrees |
|
1550 | - * @return Array the direction information |
|
1551 | - * |
|
1552 | - */ |
|
1547 | + * Parses the direction degrees to working |
|
1548 | + * |
|
1549 | + * @param Float $direction the direction in degrees |
|
1550 | + * @return Array the direction information |
|
1551 | + * |
|
1552 | + */ |
|
1553 | 1553 | public function parseDirection($direction = 0) |
1554 | 1554 | { |
1555 | 1555 | if ($direction == '') $direction = 0; |
@@ -1628,12 +1628,12 @@ discard block |
||
1628 | 1628 | |
1629 | 1629 | |
1630 | 1630 | /** |
1631 | - * Gets Country from latitude/longitude |
|
1632 | - * |
|
1633 | - * @param Float $latitude latitute of the flight |
|
1634 | - * @param Float $longitude longitute of the flight |
|
1635 | - * @return String the countrie |
|
1636 | - */ |
|
1631 | + * Gets Country from latitude/longitude |
|
1632 | + * |
|
1633 | + * @param Float $latitude latitute of the flight |
|
1634 | + * @param Float $longitude longitute of the flight |
|
1635 | + * @return String the countrie |
|
1636 | + */ |
|
1637 | 1637 | public function getCountryFromLatitudeLongitude($latitude,$longitude) |
1638 | 1638 | { |
1639 | 1639 | global $globalDBdriver, $globalDebug; |
@@ -1670,11 +1670,11 @@ discard block |
||
1670 | 1670 | } |
1671 | 1671 | |
1672 | 1672 | /** |
1673 | - * Gets Country from iso2 |
|
1674 | - * |
|
1675 | - * @param String $iso2 ISO2 country code |
|
1676 | - * @return String the countrie |
|
1677 | - */ |
|
1673 | + * Gets Country from iso2 |
|
1674 | + * |
|
1675 | + * @param String $iso2 ISO2 country code |
|
1676 | + * @return String the countrie |
|
1677 | + */ |
|
1678 | 1678 | public function getCountryFromISO2($iso2) |
1679 | 1679 | { |
1680 | 1680 | global $globalDBdriver, $globalDebug; |
@@ -1703,12 +1703,12 @@ discard block |
||
1703 | 1703 | |
1704 | 1704 | |
1705 | 1705 | /** |
1706 | - * Gets the short url from bit.ly |
|
1707 | - * |
|
1708 | - * @param String $url the full url |
|
1709 | - * @return String the bit.ly url |
|
1710 | - * |
|
1711 | - */ |
|
1706 | + * Gets the short url from bit.ly |
|
1707 | + * |
|
1708 | + * @param String $url the full url |
|
1709 | + * @return String the bit.ly url |
|
1710 | + * |
|
1711 | + */ |
|
1712 | 1712 | public function getBitlyURL($url) |
1713 | 1713 | { |
1714 | 1714 | global $globalBitlyAccessToken; |
@@ -1735,11 +1735,11 @@ discard block |
||
1735 | 1735 | |
1736 | 1736 | |
1737 | 1737 | /** |
1738 | - * Gets all vessels types that have flown over |
|
1739 | - * |
|
1740 | - * @return Array the vessel type list |
|
1741 | - * |
|
1742 | - */ |
|
1738 | + * Gets all vessels types that have flown over |
|
1739 | + * |
|
1740 | + * @return Array the vessel type list |
|
1741 | + * |
|
1742 | + */ |
|
1743 | 1743 | public function countAllMarineTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
1744 | 1744 | { |
1745 | 1745 | global $globalDBdriver; |
@@ -1804,11 +1804,11 @@ discard block |
||
1804 | 1804 | } |
1805 | 1805 | |
1806 | 1806 | /** |
1807 | - * Gets all the tracker information |
|
1808 | - * |
|
1809 | - * @return Array the tracker information |
|
1810 | - * |
|
1811 | - */ |
|
1807 | + * Gets all the tracker information |
|
1808 | + * |
|
1809 | + * @return Array the tracker information |
|
1810 | + * |
|
1811 | + */ |
|
1812 | 1812 | public function searchMarineData($q = '', $callsign = '',$mmsi = '', $imo = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '',$filters = array()) |
1813 | 1813 | { |
1814 | 1814 | global $globalTimezone, $globalDBdriver; |
@@ -14,10 +14,10 @@ discard block |
||
14 | 14 | } |
15 | 15 | |
16 | 16 | /** |
17 | - * Get SQL query part for filter used |
|
18 | - * @param Array $filter the filter |
|
19 | - * @return Array the SQL part |
|
20 | - */ |
|
17 | + * Get SQL query part for filter used |
|
18 | + * @param Array $filter the filter |
|
19 | + * @return Array the SQL part |
|
20 | + */ |
|
21 | 21 | |
22 | 22 | public function getFilter($filter = array(),$where = false,$and = false) { |
23 | 23 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
@@ -81,14 +81,14 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
84 | - * Executes the SQL statements to get the tracker information |
|
85 | - * |
|
86 | - * @param String $query the SQL query |
|
87 | - * @param Array $params parameter of the query |
|
88 | - * @param String $limitQuery the limit query |
|
89 | - * @return Array the tracker information |
|
90 | - * |
|
91 | - */ |
|
84 | + * Executes the SQL statements to get the tracker information |
|
85 | + * |
|
86 | + * @param String $query the SQL query |
|
87 | + * @param Array $params parameter of the query |
|
88 | + * @param String $limitQuery the limit query |
|
89 | + * @return Array the tracker information |
|
90 | + * |
|
91 | + */ |
|
92 | 92 | public function getDataFromDB($query, $params = array(), $limitQuery = '',$schedules = false) |
93 | 93 | { |
94 | 94 | date_default_timezone_set('UTC'); |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | |
202 | 202 | |
203 | 203 | /** |
204 | - * Gets all the tracker information based on the latest data entry |
|
205 | - * |
|
206 | - * @return Array the tracker information |
|
207 | - * |
|
208 | - */ |
|
204 | + * Gets all the tracker information based on the latest data entry |
|
205 | + * |
|
206 | + * @return Array the tracker information |
|
207 | + * |
|
208 | + */ |
|
209 | 209 | public function getLatestTrackerData($limit = '', $sort = '', $filter = array()) |
210 | 210 | { |
211 | 211 | global $global_query; |
@@ -263,11 +263,11 @@ discard block |
||
263 | 263 | } |
264 | 264 | |
265 | 265 | /** |
266 | - * Gets all the tracker information based on the callsign |
|
267 | - * |
|
268 | - * @return Array the tracker information |
|
269 | - * |
|
270 | - */ |
|
266 | + * Gets all the tracker information based on the callsign |
|
267 | + * |
|
268 | + * @return Array the tracker information |
|
269 | + * |
|
270 | + */ |
|
271 | 271 | public function getTrackerDataByIdent($ident = '', $limit = '', $sort = '', $filter = array()) |
272 | 272 | { |
273 | 273 | global $global_query; |
@@ -378,12 +378,12 @@ discard block |
||
378 | 378 | |
379 | 379 | |
380 | 380 | /** |
381 | - * Gets all source name |
|
382 | - * |
|
383 | - * @param String type format of source |
|
384 | - * @return Array list of source name |
|
385 | - * |
|
386 | - */ |
|
381 | + * Gets all source name |
|
382 | + * |
|
383 | + * @param String type format of source |
|
384 | + * @return Array list of source name |
|
385 | + * |
|
386 | + */ |
|
387 | 387 | public function getAllSourceName($type = '',$filters = array()) |
388 | 388 | { |
389 | 389 | $filter_query = $this->getFilter($filters,true,true); |
@@ -413,11 +413,11 @@ discard block |
||
413 | 413 | |
414 | 414 | |
415 | 415 | /** |
416 | - * Gets a list of all idents/callsigns |
|
417 | - * |
|
418 | - * @return Array list of ident/callsign names |
|
419 | - * |
|
420 | - */ |
|
416 | + * Gets a list of all idents/callsigns |
|
417 | + * |
|
418 | + * @return Array list of ident/callsign names |
|
419 | + * |
|
420 | + */ |
|
421 | 421 | public function getAllIdents($filters = array()) |
422 | 422 | { |
423 | 423 | $filter_query = $this->getFilter($filters,true,true); |
@@ -485,18 +485,18 @@ discard block |
||
485 | 485 | |
486 | 486 | |
487 | 487 | /** |
488 | - * Update ident tracker data |
|
489 | - * |
|
490 | - * @param String $flightaware_id the ID from flightaware |
|
491 | - * @param String $ident the flight ident |
|
492 | - * @return String success or false |
|
493 | - * |
|
494 | - */ |
|
488 | + * Update ident tracker data |
|
489 | + * |
|
490 | + * @param String $flightaware_id the ID from flightaware |
|
491 | + * @param String $ident the flight ident |
|
492 | + * @return String success or false |
|
493 | + * |
|
494 | + */ |
|
495 | 495 | public function updateIdentTrackerData($famtrackid = '', $ident = '',$fromsource = NULL) |
496 | 496 | { |
497 | 497 | |
498 | 498 | $query = 'UPDATE tracker_output SET ident = :ident WHERE famtrackid = :famtrackid'; |
499 | - $query_values = array(':famtrackid' => $famtrackid,':ident' => $ident); |
|
499 | + $query_values = array(':famtrackid' => $famtrackid,':ident' => $ident); |
|
500 | 500 | |
501 | 501 | try { |
502 | 502 | $sth = $this->db->prepare($query); |
@@ -509,18 +509,18 @@ discard block |
||
509 | 509 | |
510 | 510 | } |
511 | 511 | /** |
512 | - * Update latest tracker data |
|
513 | - * |
|
514 | - * @param String $flightaware_id the ID from flightaware |
|
515 | - * @param String $ident the flight ident |
|
516 | - * @param String $arrival_airport_icao the arrival airport |
|
517 | - * @return String success or false |
|
518 | - * |
|
519 | - */ |
|
512 | + * Update latest tracker data |
|
513 | + * |
|
514 | + * @param String $flightaware_id the ID from flightaware |
|
515 | + * @param String $ident the flight ident |
|
516 | + * @param String $arrival_airport_icao the arrival airport |
|
517 | + * @return String success or false |
|
518 | + * |
|
519 | + */ |
|
520 | 520 | public function updateLatestTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $groundspeed = NULL, $date = '') |
521 | 521 | { |
522 | 522 | $query = 'UPDATE tracker_output SET ident = :ident, last_latitude = :last_latitude, last_longitude = :last_longitude, last_altitude = :last_altitude, last_seen = :last_seen, last_ground_speed = :last_ground_speed WHERE famtrackid = :famtrackid'; |
523 | - $query_values = array(':famtrackid' => $famtrackid,':last_latitude' => $latitude,':last_longitude' => $longitude, ':last_altitude' => $altitude,':last_ground_speed' => $groundspeed,':last_seen' => $date,':ident' => $ident); |
|
523 | + $query_values = array(':famtrackid' => $famtrackid,':last_latitude' => $latitude,':last_longitude' => $longitude, ':last_altitude' => $altitude,':last_ground_speed' => $groundspeed,':last_seen' => $date,':ident' => $ident); |
|
524 | 524 | |
525 | 525 | try { |
526 | 526 | $sth = $this->db->prepare($query); |
@@ -534,32 +534,32 @@ discard block |
||
534 | 534 | } |
535 | 535 | |
536 | 536 | /** |
537 | - * Adds a new tracker data |
|
538 | - * |
|
539 | - * @param String $flightaware_id the ID from flightaware |
|
540 | - * @param String $ident the flight ident |
|
541 | - * @param String $aircraft_icao the aircraft type |
|
542 | - * @param String $departure_airport_icao the departure airport |
|
543 | - * @param String $arrival_airport_icao the arrival airport |
|
544 | - * @param String $latitude latitude of flight |
|
545 | - * @param String $longitude latitude of flight |
|
546 | - * @param String $waypoints waypoints of flight |
|
547 | - * @param String $altitude altitude of flight |
|
548 | - * @param String $heading heading of flight |
|
549 | - * @param String $groundspeed speed of flight |
|
550 | - * @param String $date date of flight |
|
551 | - * @param String $departure_airport_time departure time of flight |
|
552 | - * @param String $arrival_airport_time arrival time of flight |
|
553 | - * @param String $squawk squawk code of flight |
|
554 | - * @param String $route_stop route stop of flight |
|
555 | - * @param String $highlight highlight or not |
|
556 | - * @param String $ModeS ModesS code of flight |
|
557 | - * @param String $registration registration code of flight |
|
558 | - * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
559 | - * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
560 | - * @param String $verticalrate vertival rate of flight |
|
561 | - * @return String success or false |
|
562 | - */ |
|
537 | + * Adds a new tracker data |
|
538 | + * |
|
539 | + * @param String $flightaware_id the ID from flightaware |
|
540 | + * @param String $ident the flight ident |
|
541 | + * @param String $aircraft_icao the aircraft type |
|
542 | + * @param String $departure_airport_icao the departure airport |
|
543 | + * @param String $arrival_airport_icao the arrival airport |
|
544 | + * @param String $latitude latitude of flight |
|
545 | + * @param String $longitude latitude of flight |
|
546 | + * @param String $waypoints waypoints of flight |
|
547 | + * @param String $altitude altitude of flight |
|
548 | + * @param String $heading heading of flight |
|
549 | + * @param String $groundspeed speed of flight |
|
550 | + * @param String $date date of flight |
|
551 | + * @param String $departure_airport_time departure time of flight |
|
552 | + * @param String $arrival_airport_time arrival time of flight |
|
553 | + * @param String $squawk squawk code of flight |
|
554 | + * @param String $route_stop route stop of flight |
|
555 | + * @param String $highlight highlight or not |
|
556 | + * @param String $ModeS ModesS code of flight |
|
557 | + * @param String $registration registration code of flight |
|
558 | + * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
559 | + * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
560 | + * @param String $verticalrate vertival rate of flight |
|
561 | + * @return String success or false |
|
562 | + */ |
|
563 | 563 | public function addTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $comment = '', $type = '',$format_source = '', $source_name = '') |
564 | 564 | { |
565 | 565 | global $globalURL; |
@@ -644,16 +644,16 @@ discard block |
||
644 | 644 | $comment = filter_var($comment,FILTER_SANITIZE_STRING); |
645 | 645 | $type = filter_var($type,FILTER_SANITIZE_STRING); |
646 | 646 | |
647 | - if ($latitude == '' && $longitude == '') { |
|
648 | - $latitude = 0; |
|
649 | - $longitude = 0; |
|
650 | - } |
|
651 | - if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
652 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
653 | - $query = "INSERT INTO tracker_output (famtrackid, ident, latitude, longitude, altitude, heading, ground_speed, date, format_source, source_name, comment, type) |
|
647 | + if ($latitude == '' && $longitude == '') { |
|
648 | + $latitude = 0; |
|
649 | + $longitude = 0; |
|
650 | + } |
|
651 | + if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
652 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
653 | + $query = "INSERT INTO tracker_output (famtrackid, ident, latitude, longitude, altitude, heading, ground_speed, date, format_source, source_name, comment, type) |
|
654 | 654 | VALUES (:famtrackid,:ident,:latitude,:longitude,:altitude,:heading,:speed,:date,:format_source, :source_name,:comment,:type)"; |
655 | 655 | |
656 | - $query_values = array(':famtrackid' => $famtrackid,':ident' => $ident,':latitude' => $latitude,':longitude' => $longitude,':altitude' => $altitude,':heading' => $heading,':speed' => $groundspeed,':date' => $date,':format_source' => $format_source, ':source_name' => $source_name,':comment' => $comment,':type' => $type); |
|
656 | + $query_values = array(':famtrackid' => $famtrackid,':ident' => $ident,':latitude' => $latitude,':longitude' => $longitude,':altitude' => $altitude,':heading' => $heading,':speed' => $groundspeed,':date' => $date,':format_source' => $format_source, ':source_name' => $source_name,':comment' => $comment,':type' => $type); |
|
657 | 657 | |
658 | 658 | try { |
659 | 659 | |
@@ -661,7 +661,7 @@ discard block |
||
661 | 661 | $sth->execute($query_values); |
662 | 662 | $this->db = null; |
663 | 663 | } catch (PDOException $e) { |
664 | - return "error : ".$e->getMessage(); |
|
664 | + return "error : ".$e->getMessage(); |
|
665 | 665 | } |
666 | 666 | |
667 | 667 | return "success"; |
@@ -670,11 +670,11 @@ discard block |
||
670 | 670 | |
671 | 671 | |
672 | 672 | /** |
673 | - * Gets the aircraft ident within the last hour |
|
674 | - * |
|
675 | - * @return String the ident |
|
676 | - * |
|
677 | - */ |
|
673 | + * Gets the aircraft ident within the last hour |
|
674 | + * |
|
675 | + * @return String the ident |
|
676 | + * |
|
677 | + */ |
|
678 | 678 | public function getIdentFromLastHour($ident) |
679 | 679 | { |
680 | 680 | global $globalDBdriver, $globalTimezone; |
@@ -690,11 +690,11 @@ discard block |
||
690 | 690 | AND tracker_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
691 | 691 | AND tracker_output.date < now() AT TIME ZONE 'UTC'"; |
692 | 692 | $query_data = array(':ident' => $ident); |
693 | - } |
|
693 | + } |
|
694 | 694 | |
695 | 695 | $sth = $this->db->prepare($query); |
696 | 696 | $sth->execute($query_data); |
697 | - $ident_result=''; |
|
697 | + $ident_result=''; |
|
698 | 698 | while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
699 | 699 | { |
700 | 700 | $ident_result = $row['ident']; |
@@ -705,11 +705,11 @@ discard block |
||
705 | 705 | |
706 | 706 | |
707 | 707 | /** |
708 | - * Gets the aircraft data from the last 20 seconds |
|
709 | - * |
|
710 | - * @return Array the tracker data |
|
711 | - * |
|
712 | - */ |
|
708 | + * Gets the aircraft data from the last 20 seconds |
|
709 | + * |
|
710 | + * @return Array the tracker data |
|
711 | + * |
|
712 | + */ |
|
713 | 713 | public function getRealTimeData($q = '') |
714 | 714 | { |
715 | 715 | global $globalDBdriver; |
@@ -743,11 +743,11 @@ discard block |
||
743 | 743 | } |
744 | 744 | |
745 | 745 | /** |
746 | - * Gets all number of flight over countries |
|
747 | - * |
|
748 | - * @return Array the airline country list |
|
749 | - * |
|
750 | - */ |
|
746 | + * Gets all number of flight over countries |
|
747 | + * |
|
748 | + * @return Array the airline country list |
|
749 | + * |
|
750 | + */ |
|
751 | 751 | public function countAllTrackerOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
752 | 752 | { |
753 | 753 | global $globalDBdriver, $globalArchive; |
@@ -817,11 +817,11 @@ discard block |
||
817 | 817 | } |
818 | 818 | |
819 | 819 | /** |
820 | - * Gets all callsigns that have flown over |
|
821 | - * |
|
822 | - * @return Array the callsign list |
|
823 | - * |
|
824 | - */ |
|
820 | + * Gets all callsigns that have flown over |
|
821 | + * |
|
822 | + * @return Array the callsign list |
|
823 | + * |
|
824 | + */ |
|
825 | 825 | public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '', $day = '') |
826 | 826 | { |
827 | 827 | global $globalDBdriver; |
@@ -888,11 +888,11 @@ discard block |
||
888 | 888 | |
889 | 889 | |
890 | 890 | /** |
891 | - * Counts all dates |
|
892 | - * |
|
893 | - * @return Array the date list |
|
894 | - * |
|
895 | - */ |
|
891 | + * Counts all dates |
|
892 | + * |
|
893 | + * @return Array the date list |
|
894 | + * |
|
895 | + */ |
|
896 | 896 | public function countAllDates($filters = array()) |
897 | 897 | { |
898 | 898 | global $globalTimezone, $globalDBdriver; |
@@ -938,11 +938,11 @@ discard block |
||
938 | 938 | |
939 | 939 | |
940 | 940 | /** |
941 | - * Counts all dates during the last 7 days |
|
942 | - * |
|
943 | - * @return Array the date list |
|
944 | - * |
|
945 | - */ |
|
941 | + * Counts all dates during the last 7 days |
|
942 | + * |
|
943 | + * @return Array the date list |
|
944 | + * |
|
945 | + */ |
|
946 | 946 | public function countAllDatesLast7Days($filters = array()) |
947 | 947 | { |
948 | 948 | global $globalTimezone, $globalDBdriver; |
@@ -964,7 +964,7 @@ discard block |
||
964 | 964 | $query .= " GROUP BY date_name |
965 | 965 | ORDER BY date_name ASC"; |
966 | 966 | $query_data = array(':offset' => $offset); |
967 | - } |
|
967 | + } |
|
968 | 968 | |
969 | 969 | $sth = $this->db->prepare($query); |
970 | 970 | $sth->execute($query_data); |
@@ -984,11 +984,11 @@ discard block |
||
984 | 984 | } |
985 | 985 | |
986 | 986 | /** |
987 | - * Counts all dates during the last month |
|
988 | - * |
|
989 | - * @return Array the date list |
|
990 | - * |
|
991 | - */ |
|
987 | + * Counts all dates during the last month |
|
988 | + * |
|
989 | + * @return Array the date list |
|
990 | + * |
|
991 | + */ |
|
992 | 992 | public function countAllDatesLastMonth($filters = array()) |
993 | 993 | { |
994 | 994 | global $globalTimezone, $globalDBdriver; |
@@ -1010,7 +1010,7 @@ discard block |
||
1010 | 1010 | $query .= " GROUP BY date_name |
1011 | 1011 | ORDER BY date_name ASC"; |
1012 | 1012 | $query_data = array(':offset' => $offset); |
1013 | - } |
|
1013 | + } |
|
1014 | 1014 | |
1015 | 1015 | $sth = $this->db->prepare($query); |
1016 | 1016 | $sth->execute($query_data); |
@@ -1032,11 +1032,11 @@ discard block |
||
1032 | 1032 | |
1033 | 1033 | |
1034 | 1034 | /** |
1035 | - * Counts all month |
|
1036 | - * |
|
1037 | - * @return Array the month list |
|
1038 | - * |
|
1039 | - */ |
|
1035 | + * Counts all month |
|
1036 | + * |
|
1037 | + * @return Array the month list |
|
1038 | + * |
|
1039 | + */ |
|
1040 | 1040 | public function countAllMonths($filters = array()) |
1041 | 1041 | { |
1042 | 1042 | global $globalTimezone, $globalDBdriver; |
@@ -1081,11 +1081,11 @@ discard block |
||
1081 | 1081 | |
1082 | 1082 | |
1083 | 1083 | /** |
1084 | - * Counts all dates during the last year |
|
1085 | - * |
|
1086 | - * @return Array the date list |
|
1087 | - * |
|
1088 | - */ |
|
1084 | + * Counts all dates during the last year |
|
1085 | + * |
|
1086 | + * @return Array the date list |
|
1087 | + * |
|
1088 | + */ |
|
1089 | 1089 | public function countAllMonthsLastYear($filters) |
1090 | 1090 | { |
1091 | 1091 | global $globalTimezone, $globalDBdriver; |
@@ -1107,7 +1107,7 @@ discard block |
||
1107 | 1107 | $query .= " GROUP BY year_name, month_name |
1108 | 1108 | ORDER BY year_name, month_name ASC"; |
1109 | 1109 | $query_data = array(':offset' => $offset); |
1110 | - } |
|
1110 | + } |
|
1111 | 1111 | |
1112 | 1112 | $sth = $this->db->prepare($query); |
1113 | 1113 | $sth->execute($query_data); |
@@ -1130,11 +1130,11 @@ discard block |
||
1130 | 1130 | |
1131 | 1131 | |
1132 | 1132 | /** |
1133 | - * Counts all hours |
|
1134 | - * |
|
1135 | - * @return Array the hour list |
|
1136 | - * |
|
1137 | - */ |
|
1133 | + * Counts all hours |
|
1134 | + * |
|
1135 | + * @return Array the hour list |
|
1136 | + * |
|
1137 | + */ |
|
1138 | 1138 | public function countAllHours($orderby,$filters = array()) |
1139 | 1139 | { |
1140 | 1140 | global $globalTimezone, $globalDBdriver; |
@@ -1197,11 +1197,11 @@ discard block |
||
1197 | 1197 | |
1198 | 1198 | |
1199 | 1199 | /** |
1200 | - * Counts all hours by date |
|
1201 | - * |
|
1202 | - * @return Array the hour list |
|
1203 | - * |
|
1204 | - */ |
|
1200 | + * Counts all hours by date |
|
1201 | + * |
|
1202 | + * @return Array the hour list |
|
1203 | + * |
|
1204 | + */ |
|
1205 | 1205 | public function countAllHoursByDate($date, $filters = array()) |
1206 | 1206 | { |
1207 | 1207 | global $globalTimezone, $globalDBdriver; |
@@ -1245,11 +1245,11 @@ discard block |
||
1245 | 1245 | |
1246 | 1246 | |
1247 | 1247 | /** |
1248 | - * Counts all hours by a ident/callsign |
|
1249 | - * |
|
1250 | - * @return Array the hour list |
|
1251 | - * |
|
1252 | - */ |
|
1248 | + * Counts all hours by a ident/callsign |
|
1249 | + * |
|
1250 | + * @return Array the hour list |
|
1251 | + * |
|
1252 | + */ |
|
1253 | 1253 | public function countAllHoursByIdent($ident, $filters = array()) |
1254 | 1254 | { |
1255 | 1255 | global $globalTimezone, $globalDBdriver; |
@@ -1294,11 +1294,11 @@ discard block |
||
1294 | 1294 | |
1295 | 1295 | |
1296 | 1296 | /** |
1297 | - * Counts all trackers that have flown over |
|
1298 | - * |
|
1299 | - * @return Integer the number of trackers |
|
1300 | - * |
|
1301 | - */ |
|
1297 | + * Counts all trackers that have flown over |
|
1298 | + * |
|
1299 | + * @return Integer the number of trackers |
|
1300 | + * |
|
1301 | + */ |
|
1302 | 1302 | public function countOverallTracker($filters = array(),$year = '',$month = '') |
1303 | 1303 | { |
1304 | 1304 | global $globalDBdriver; |
@@ -1333,11 +1333,11 @@ discard block |
||
1333 | 1333 | } |
1334 | 1334 | |
1335 | 1335 | /** |
1336 | - * Counts all trackers type that have flown over |
|
1337 | - * |
|
1338 | - * @return Integer the number of flights |
|
1339 | - * |
|
1340 | - */ |
|
1336 | + * Counts all trackers type that have flown over |
|
1337 | + * |
|
1338 | + * @return Integer the number of flights |
|
1339 | + * |
|
1340 | + */ |
|
1341 | 1341 | public function countOverallTrackerTypes($filters = array(),$year = '',$month = '') |
1342 | 1342 | { |
1343 | 1343 | global $globalDBdriver; |
@@ -1372,11 +1372,11 @@ discard block |
||
1372 | 1372 | |
1373 | 1373 | |
1374 | 1374 | /** |
1375 | - * Counts all hours of today |
|
1376 | - * |
|
1377 | - * @return Array the hour list |
|
1378 | - * |
|
1379 | - */ |
|
1375 | + * Counts all hours of today |
|
1376 | + * |
|
1377 | + * @return Array the hour list |
|
1378 | + * |
|
1379 | + */ |
|
1380 | 1380 | public function countAllHoursFromToday($filters = array()) |
1381 | 1381 | { |
1382 | 1382 | global $globalTimezone, $globalDBdriver; |
@@ -1416,12 +1416,12 @@ discard block |
||
1416 | 1416 | } |
1417 | 1417 | |
1418 | 1418 | |
1419 | - /** |
|
1420 | - * Gets the Barrie Spotter ID based on the FlightAware ID |
|
1421 | - * |
|
1422 | - * @return Integer the Barrie Spotter ID |
|
1419 | + /** |
|
1420 | + * Gets the Barrie Spotter ID based on the FlightAware ID |
|
1421 | + * |
|
1422 | + * @return Integer the Barrie Spotter ID |
|
1423 | 1423 | q * |
1424 | - */ |
|
1424 | + */ |
|
1425 | 1425 | public function getTrackerIDBasedOnFamTrackID($famtrackid) |
1426 | 1426 | { |
1427 | 1427 | $famtrackid = filter_var($famtrackid,FILTER_SANITIZE_STRING); |
@@ -1442,13 +1442,13 @@ discard block |
||
1442 | 1442 | |
1443 | 1443 | |
1444 | 1444 | /** |
1445 | - * Parses a date string |
|
1446 | - * |
|
1447 | - * @param String $dateString the date string |
|
1448 | - * @param String $timezone the timezone of a user |
|
1449 | - * @return Array the time information |
|
1450 | - * |
|
1451 | - */ |
|
1445 | + * Parses a date string |
|
1446 | + * |
|
1447 | + * @param String $dateString the date string |
|
1448 | + * @param String $timezone the timezone of a user |
|
1449 | + * @return Array the time information |
|
1450 | + * |
|
1451 | + */ |
|
1452 | 1452 | public function parseDateString($dateString, $timezone = '') |
1453 | 1453 | { |
1454 | 1454 | $time_array = array(); |
@@ -1481,12 +1481,12 @@ discard block |
||
1481 | 1481 | } |
1482 | 1482 | |
1483 | 1483 | /** |
1484 | - * Parses the direction degrees to working |
|
1485 | - * |
|
1486 | - * @param Float $direction the direction in degrees |
|
1487 | - * @return Array the direction information |
|
1488 | - * |
|
1489 | - */ |
|
1484 | + * Parses the direction degrees to working |
|
1485 | + * |
|
1486 | + * @param Float $direction the direction in degrees |
|
1487 | + * @return Array the direction information |
|
1488 | + * |
|
1489 | + */ |
|
1490 | 1490 | public function parseDirection($direction = 0) |
1491 | 1491 | { |
1492 | 1492 | if ($direction == '') $direction = 0; |
@@ -1565,12 +1565,12 @@ discard block |
||
1565 | 1565 | |
1566 | 1566 | |
1567 | 1567 | /** |
1568 | - * Gets Country from latitude/longitude |
|
1569 | - * |
|
1570 | - * @param Float $latitude latitute of the flight |
|
1571 | - * @param Float $longitude longitute of the flight |
|
1572 | - * @return String the countrie |
|
1573 | - */ |
|
1568 | + * Gets Country from latitude/longitude |
|
1569 | + * |
|
1570 | + * @param Float $latitude latitute of the flight |
|
1571 | + * @param Float $longitude longitute of the flight |
|
1572 | + * @return String the countrie |
|
1573 | + */ |
|
1574 | 1574 | public function getCountryFromLatitudeLongitude($latitude,$longitude) |
1575 | 1575 | { |
1576 | 1576 | global $globalDBdriver, $globalDebug; |
@@ -1607,11 +1607,11 @@ discard block |
||
1607 | 1607 | } |
1608 | 1608 | |
1609 | 1609 | /** |
1610 | - * Gets Country from iso2 |
|
1611 | - * |
|
1612 | - * @param String $iso2 ISO2 country code |
|
1613 | - * @return String the countrie |
|
1614 | - */ |
|
1610 | + * Gets Country from iso2 |
|
1611 | + * |
|
1612 | + * @param String $iso2 ISO2 country code |
|
1613 | + * @return String the countrie |
|
1614 | + */ |
|
1615 | 1615 | public function getCountryFromISO2($iso2) |
1616 | 1616 | { |
1617 | 1617 | global $globalDBdriver, $globalDebug; |
@@ -1639,11 +1639,11 @@ discard block |
||
1639 | 1639 | } |
1640 | 1640 | |
1641 | 1641 | /** |
1642 | - * Gets all vessels types that have flown over |
|
1643 | - * |
|
1644 | - * @return Array the vessel type list |
|
1645 | - * |
|
1646 | - */ |
|
1642 | + * Gets all vessels types that have flown over |
|
1643 | + * |
|
1644 | + * @return Array the vessel type list |
|
1645 | + * |
|
1646 | + */ |
|
1647 | 1647 | public function countAllTrackerTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
1648 | 1648 | { |
1649 | 1649 | global $globalDBdriver; |
@@ -1708,11 +1708,11 @@ discard block |
||
1708 | 1708 | } |
1709 | 1709 | |
1710 | 1710 | /** |
1711 | - * Gets all the tracker information |
|
1712 | - * |
|
1713 | - * @return Array the tracker information |
|
1714 | - * |
|
1715 | - */ |
|
1711 | + * Gets all the tracker information |
|
1712 | + * |
|
1713 | + * @return Array the tracker information |
|
1714 | + * |
|
1715 | + */ |
|
1716 | 1716 | public function searchTrackerData($q = '', $callsign = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '',$filters = array()) |
1717 | 1717 | { |
1718 | 1718 | global $globalTimezone, $globalDBdriver; |
@@ -1817,12 +1817,12 @@ discard block |
||
1817 | 1817 | } |
1818 | 1818 | |
1819 | 1819 | /** |
1820 | - * Gets the short url from bit.ly |
|
1821 | - * |
|
1822 | - * @param String $url the full url |
|
1823 | - * @return String the bit.ly url |
|
1824 | - * |
|
1825 | - */ |
|
1820 | + * Gets the short url from bit.ly |
|
1821 | + * |
|
1822 | + * @param String $url the full url |
|
1823 | + * @return String the bit.ly url |
|
1824 | + * |
|
1825 | + */ |
|
1826 | 1826 | public function getBitlyURL($url) |
1827 | 1827 | { |
1828 | 1828 | global $globalBitlyAccessToken; |