@@ -14,7 +14,7 @@ |
||
14 | 14 | /** |
15 | 15 | * Get SQL query part for filter used |
16 | 16 | * @param Array $filter the filter |
17 | - * @return Array the SQL part |
|
17 | + * @return string the SQL part |
|
18 | 18 | */ |
19 | 19 | public function getFilter($filter = array(),$where = false,$and = false) { |
20 | 20 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
@@ -11,7 +11,7 @@ |
||
11 | 11 | /** |
12 | 12 | * Get SQL query part for filter used |
13 | 13 | * @param Array $filter the filter |
14 | - * @return Array the SQL part |
|
14 | + * @return string the SQL part |
|
15 | 15 | */ |
16 | 16 | public function getFilter($filter = array(),$where = false,$and = false) { |
17 | 17 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
@@ -18,6 +18,10 @@ discard block |
||
18 | 18 | $this->db = $Connection->db(); |
19 | 19 | } |
20 | 20 | |
21 | + /** |
|
22 | + * @param string $type |
|
23 | + * @param string $stats_date |
|
24 | + */ |
|
21 | 25 | public function addLastStatsUpdate($type,$stats_date) { |
22 | 26 | $query = "DELETE FROM config WHERE name = :type; |
23 | 27 | INSERT INTO config (name,value) VALUES (:type,:stats_date);"; |
@@ -961,6 +965,10 @@ discard block |
||
961 | 965 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
962 | 966 | return $all; |
963 | 967 | } |
968 | + |
|
969 | + /** |
|
970 | + * @param string $type |
|
971 | + */ |
|
964 | 972 | public function deleteStatsByType($type,$stats_airline = '', $filter_name = '') { |
965 | 973 | if ($filter_name == '') $filter_name = $this->filter_name; |
966 | 974 | $query = "DELETE FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
@@ -972,6 +980,11 @@ discard block |
||
972 | 980 | echo "error : ".$e->getMessage(); |
973 | 981 | } |
974 | 982 | } |
983 | + |
|
984 | + /** |
|
985 | + * @param string $type |
|
986 | + * @param string $year |
|
987 | + */ |
|
975 | 988 | public function getSumStats($type,$year,$stats_airline = '',$filter_name = '',$month = '') { |
976 | 989 | if ($filter_name == '') $filter_name = $this->filter_name; |
977 | 990 | global $globalArchiveMonths, $globalDBdriver; |
@@ -1116,6 +1129,10 @@ discard block |
||
1116 | 1129 | else return 0; |
1117 | 1130 | } |
1118 | 1131 | |
1132 | + /** |
|
1133 | + * @param string $type |
|
1134 | + * @param string $stats_date |
|
1135 | + */ |
|
1119 | 1136 | public function addStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') { |
1120 | 1137 | global $globalDBdriver; |
1121 | 1138 | if ($filter_name == '') $filter_name = $this->filter_name; |
@@ -1169,6 +1186,9 @@ discard block |
||
1169 | 1186 | } |
1170 | 1187 | */ |
1171 | 1188 | |
1189 | + /** |
|
1190 | + * @param string $stats_type |
|
1191 | + */ |
|
1172 | 1192 | public function getStatsSource($stats_type,$year = '',$month = '',$day = '') { |
1173 | 1193 | global $globalDBdriver; |
1174 | 1194 | $query = "SELECT * FROM stats_source WHERE stats_type = :stats_type"; |
@@ -1212,6 +1232,9 @@ discard block |
||
1212 | 1232 | return $all; |
1213 | 1233 | } |
1214 | 1234 | |
1235 | + /** |
|
1236 | + * @param string $stats_type |
|
1237 | + */ |
|
1215 | 1238 | public function addStatSource($data,$source_name,$stats_type,$date) { |
1216 | 1239 | global $globalDBdriver; |
1217 | 1240 | if ($globalDBdriver == 'mysql') { |
@@ -1227,6 +1250,10 @@ discard block |
||
1227 | 1250 | return "error : ".$e->getMessage(); |
1228 | 1251 | } |
1229 | 1252 | } |
1253 | + |
|
1254 | + /** |
|
1255 | + * @param string $type |
|
1256 | + */ |
|
1230 | 1257 | public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') { |
1231 | 1258 | $query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)"; |
1232 | 1259 | $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
@@ -1493,6 +1520,10 @@ discard block |
||
1493 | 1520 | return "error : ".$e->getMessage(); |
1494 | 1521 | } |
1495 | 1522 | } |
1523 | + |
|
1524 | + /** |
|
1525 | + * @param string $type |
|
1526 | + */ |
|
1496 | 1527 | public function deleteStatFlight($type) { |
1497 | 1528 | $query = "DELETE FROM stats_flight WHERE stats_type = :type"; |
1498 | 1529 | $query_values = array(':type' => $type); |
@@ -1503,6 +1534,10 @@ discard block |
||
1503 | 1534 | return "error : ".$e->getMessage(); |
1504 | 1535 | } |
1505 | 1536 | } |
1537 | + |
|
1538 | + /** |
|
1539 | + * @param string $type |
|
1540 | + */ |
|
1506 | 1541 | public function deleteStatAirport($type) { |
1507 | 1542 | $query = "DELETE FROM stats_airport WHERE stats_type = :type"; |
1508 | 1543 | $query_values = array(':type' => $type); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | /** |
16 | 16 | * Get SQL query part for filter used |
17 | 17 | * @param Array $filter the filter |
18 | - * @return Array the SQL part |
|
18 | + * @return string the SQL part |
|
19 | 19 | */ |
20 | 20 | |
21 | 21 | public function getFilter($filter = array(),$where = false,$and = false) { |
@@ -486,9 +486,6 @@ discard block |
||
486 | 486 | /** |
487 | 487 | * Update ident spotter data |
488 | 488 | * |
489 | - * @param String $flightaware_id the ID from flightaware |
|
490 | - * @param String $ident the flight ident |
|
491 | - * @return String success or false |
|
492 | 489 | * |
493 | 490 | */ |
494 | 491 | public function updateIdentTrackerData($famtrackid = '', $ident = '',$fromsource = NULL) |
@@ -510,10 +507,6 @@ discard block |
||
510 | 507 | /** |
511 | 508 | * Update latest spotter data |
512 | 509 | * |
513 | - * @param String $flightaware_id the ID from flightaware |
|
514 | - * @param String $ident the flight ident |
|
515 | - * @param String $arrival_airport_icao the arrival airport |
|
516 | - * @return String success or false |
|
517 | 510 | * |
518 | 511 | */ |
519 | 512 | public function updateLatestTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $groundspeed = NULL, $date = '') |
@@ -535,29 +528,6 @@ discard block |
||
535 | 528 | /** |
536 | 529 | * Adds a new spotter data |
537 | 530 | * |
538 | - * @param String $flightaware_id the ID from flightaware |
|
539 | - * @param String $ident the flight ident |
|
540 | - * @param String $aircraft_icao the aircraft type |
|
541 | - * @param String $departure_airport_icao the departure airport |
|
542 | - * @param String $arrival_airport_icao the arrival airport |
|
543 | - * @param String $latitude latitude of flight |
|
544 | - * @param String $longitude latitude of flight |
|
545 | - * @param String $waypoints waypoints of flight |
|
546 | - * @param String $altitude altitude of flight |
|
547 | - * @param String $heading heading of flight |
|
548 | - * @param String $groundspeed speed of flight |
|
549 | - * @param String $date date of flight |
|
550 | - * @param String $departure_airport_time departure time of flight |
|
551 | - * @param String $arrival_airport_time arrival time of flight |
|
552 | - * @param String $squawk squawk code of flight |
|
553 | - * @param String $route_stop route stop of flight |
|
554 | - * @param String $highlight highlight or not |
|
555 | - * @param String $ModeS ModesS code of flight |
|
556 | - * @param String $registration registration code of flight |
|
557 | - * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
558 | - * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
559 | - * @param String $verticalrate vertival rate of flight |
|
560 | - * @return String success or false |
|
561 | 531 | */ |
562 | 532 | public function addTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $comment = '', $type = '',$format_source = '', $source_name = '') |
563 | 533 | { |
@@ -1428,7 +1398,7 @@ discard block |
||
1428 | 1398 | /** |
1429 | 1399 | * Parses the direction degrees to working |
1430 | 1400 | * |
1431 | - * @param Float $direction the direction in degrees |
|
1401 | + * @param integer $direction the direction in degrees |
|
1432 | 1402 | * @return Array the direction information |
1433 | 1403 | * |
1434 | 1404 | */ |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * Get SQL query part for filter used |
16 | 16 | * @param Array $filter the filter |
17 | - * @return Array the SQL part |
|
17 | + * @return string the SQL part |
|
18 | 18 | */ |
19 | 19 | public function getFilter($filter = array(),$where = false,$and = false) { |
20 | 20 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
@@ -759,10 +759,6 @@ discard block |
||
759 | 759 | * |
760 | 760 | * @param String $famtrackid the ID from flightaware |
761 | 761 | * @param String $ident the flight ident |
762 | - * @param String $aircraft_icao the aircraft type |
|
763 | - * @param String $departure_airport_icao the departure airport |
|
764 | - * @param String $arrival_airport_icao the arrival airport |
|
765 | - * @return String success or false |
|
766 | 762 | * |
767 | 763 | */ |
768 | 764 | public function addLiveTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $putinarchive = false, $comment = '', $type = '',$noarchive = false,$format_source = '', $source_name = '', $over_country = '') |
@@ -68,6 +68,10 @@ discard block |
||
68 | 68 | 't', 'u', 'v', 'w' // 119 |
69 | 69 | ); // char 64 |
70 | 70 | */ |
71 | + |
|
72 | + /** |
|
73 | + * @param integer $ascii |
|
74 | + */ |
|
71 | 75 | private function asciidec_2_8bit($ascii) { |
72 | 76 | //only process in the following range: 48-87, 96-119 |
73 | 77 | if ($ascii < 48) { } |
@@ -93,6 +97,10 @@ discard block |
||
93 | 97 | return(substr($bin, -6)); |
94 | 98 | } |
95 | 99 | |
100 | + /** |
|
101 | + * @param integer $_start |
|
102 | + * @param integer $_size |
|
103 | + */ |
|
96 | 104 | private function binchar($_str, $_start, $_size) { |
97 | 105 | // ' ' --- '?', // 0x20 - 0x3F |
98 | 106 | // '@' --- '_', // 0x40 - 0x5F |
@@ -118,6 +126,10 @@ discard block |
||
118 | 126 | } |
119 | 127 | |
120 | 128 | // function for decoding the AIS Message ITU Payload |
129 | + |
|
130 | + /** |
|
131 | + * @param string $_aisdata |
|
132 | + */ |
|
121 | 133 | private function decode_ais($_aisdata) { |
122 | 134 | $ro = new stdClass(); // return object |
123 | 135 | $ro->cls = 0; // AIS class undefined, also indicate unparsed msg |
@@ -351,6 +363,12 @@ discard block |
||
351 | 363 | elseif ($code == 99) return 'Other Type, no additional information'; |
352 | 364 | } |
353 | 365 | |
366 | + /** |
|
367 | + * @param string $_itu |
|
368 | + * @param integer $_len |
|
369 | + * @param integer $_filler |
|
370 | + * @param string $aux |
|
371 | + */ |
|
354 | 372 | public function process_ais_itu($_itu, $_len, $_filler, $aux /*, $ais_ch*/) { |
355 | 373 | global $port; // tcpip port... |
356 | 374 | |
@@ -371,6 +389,10 @@ discard block |
||
371 | 389 | |
372 | 390 | // char* - AIS \r terminated string |
373 | 391 | // TCP based streams which send messages in full can use this instead of calling process_ais_buf |
392 | + |
|
393 | + /** |
|
394 | + * @param string $rawdata |
|
395 | + */ |
|
374 | 396 | public function process_ais_raw($rawdata, $aux = '') { // return int |
375 | 397 | static $num_seq; // 1 to 9 |
376 | 398 | static $seq; // 1 to 9 |
@@ -589,6 +611,9 @@ discard block |
||
589 | 611 | return $result; |
590 | 612 | } |
591 | 613 | |
614 | + /** |
|
615 | + * @param string $mmsi |
|
616 | + */ |
|
592 | 617 | public function mmsitype($mmsi) { |
593 | 618 | if (strlen($mmsi) == 9) { |
594 | 619 | if (substr($mmsi,0,3) == '974') return 'EPIRB (Emergency Position Indicating Radio Beacon) AIS'; |
@@ -90,6 +90,10 @@ discard block |
||
90 | 90 | return strlen($headerLine); // Needed by curl |
91 | 91 | } |
92 | 92 | |
93 | + /** |
|
94 | + * @param string $url |
|
95 | + * @param string $file |
|
96 | + */ |
|
93 | 97 | public static function download($url, $file, $referer = '') { |
94 | 98 | global $globalDebug; |
95 | 99 | $fp = fopen($file, 'w'); |
@@ -190,7 +194,7 @@ discard block |
||
190 | 194 | * Check is distance realistic |
191 | 195 | * @param int $timeDifference the time between the reception of both messages |
192 | 196 | * @param float $distance distance covered |
193 | - * @return whether distance is realistic |
|
197 | + * @return boolean distance is realistic |
|
194 | 198 | */ |
195 | 199 | public function withinThreshold ($timeDifference, $distance) { |
196 | 200 | $x = abs($timeDifference); |
@@ -213,6 +217,9 @@ discard block |
||
213 | 217 | } |
214 | 218 | |
215 | 219 | |
220 | + /** |
|
221 | + * @param string $latlong |
|
222 | + */ |
|
216 | 223 | public function convertDec($dms,$latlong) { |
217 | 224 | if ($latlong == 'latitude') { |
218 | 225 | $deg = substr($dms, 0, 2); |
@@ -224,6 +231,9 @@ discard block |
||
224 | 231 | return $deg+(($min*60)/3600); |
225 | 232 | } |
226 | 233 | |
234 | + /** |
|
235 | + * @param string $latlong |
|
236 | + */ |
|
227 | 237 | public function convertDM($coord,$latlong) { |
228 | 238 | if ($latlong == 'latitude') { |
229 | 239 | if ($coord < 0) $NSEW = 'S'; |
@@ -352,7 +362,7 @@ discard block |
||
352 | 362 | /** |
353 | 363 | * Returns list of available locales |
354 | 364 | * |
355 | - * @return array |
|
365 | + * @return string[] |
|
356 | 366 | */ |
357 | 367 | public function listLocaleDir() |
358 | 368 | { |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | /** |
16 | 16 | * Get SQL query part for filter used |
17 | 17 | * @param Array $filter the filter |
18 | - * @return Array the SQL part |
|
18 | + * @return string the SQL part |
|
19 | 19 | */ |
20 | 20 | |
21 | 21 | public function getFilter($filter = array(),$where = false,$and = false) { |
@@ -552,25 +552,6 @@ discard block |
||
552 | 552 | * |
553 | 553 | * @param String $fammarine_id the ID |
554 | 554 | * @param String $ident the marine ident |
555 | - * @param String $departure_airport_icao the departure airport |
|
556 | - * @param String $arrival_airport_icao the arrival airport |
|
557 | - * @param String $latitude latitude of flight |
|
558 | - * @param String $longitude latitude of flight |
|
559 | - * @param String $waypoints waypoints of flight |
|
560 | - * @param String $heading heading of flight |
|
561 | - * @param String $groundspeed speed of flight |
|
562 | - * @param String $date date of flight |
|
563 | - * @param String $departure_airport_time departure time of flight |
|
564 | - * @param String $arrival_airport_time arrival time of flight |
|
565 | - * @param String $squawk squawk code of flight |
|
566 | - * @param String $route_stop route stop of flight |
|
567 | - * @param String $highlight highlight or not |
|
568 | - * @param String $ModeS ModesS code of flight |
|
569 | - * @param String $registration registration code of flight |
|
570 | - * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
571 | - * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
572 | - * @param String $verticalrate vertival rate of flight |
|
573 | - * @return String success or false |
|
574 | 555 | */ |
575 | 556 | public function addMarineData($fammarine_id = '', $ident = '', $latitude = '', $longitude = '', $heading = '', $groundspeed = '', $date = '', $mmsi = '',$type = '',$typeid = '',$imo = '',$callsign = '',$arrival_code = '',$arrival_date = '',$status = '',$format_source = '', $source_name = '') |
576 | 557 | { |
@@ -1444,7 +1425,7 @@ discard block |
||
1444 | 1425 | /** |
1445 | 1426 | * Parses the direction degrees to working |
1446 | 1427 | * |
1447 | - * @param Float $direction the direction in degrees |
|
1428 | + * @param integer $direction the direction in degrees |
|
1448 | 1429 | * @return Array the direction information |
1449 | 1430 | * |
1450 | 1431 | */ |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * Get SQL query part for filter used |
16 | 16 | * @param Array $filter the filter |
17 | - * @return Array the SQL part |
|
17 | + * @return string the SQL part |
|
18 | 18 | */ |
19 | 19 | public function getFilter($filter = array(),$where = false,$and = false) { |
20 | 20 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
@@ -762,10 +762,6 @@ discard block |
||
762 | 762 | * |
763 | 763 | * @param String $fammarine_id the ID from flightaware |
764 | 764 | * @param String $ident the flight ident |
765 | - * @param String $aircraft_icao the aircraft type |
|
766 | - * @param String $departure_airport_icao the departure airport |
|
767 | - * @param String $arrival_airport_icao the arrival airport |
|
768 | - * @return String success or false |
|
769 | 765 | * |
770 | 766 | */ |
771 | 767 | public function addLiveMarineData($fammarine_id = '', $ident = '', $latitude = '', $longitude = '', $heading = '', $groundspeed = '', $date = '', $putinarchive = false, $mmsi = '',$type = '',$typeid = '',$imo = '', $callsign = '',$arrival_code = '',$arrival_date = '',$status = '',$noarchive = false,$format_source = '', $source_name = '', $over_country = '') |