@@ -6,6 +6,9 @@ discard block |
||
6 | 6 | public $dbs = array(); |
7 | 7 | public $latest_schema = 47; |
8 | 8 | |
9 | + /** |
|
10 | + * @param string $dbname |
|
11 | + */ |
|
9 | 12 | public function __construct($dbc = null,$dbname = null,$user = null,$pass = null) { |
10 | 13 | global $globalNoDB; |
11 | 14 | if (isset($globalNoDB) && $globalNoDB === TRUE) { |
@@ -142,6 +145,9 @@ discard block |
||
142 | 145 | return true; |
143 | 146 | } |
144 | 147 | |
148 | + /** |
|
149 | + * @param string $table |
|
150 | + */ |
|
145 | 151 | public function tableExists($table) |
146 | 152 | { |
147 | 153 | global $globalDBdriver, $globalDBname; |
@@ -192,6 +198,11 @@ discard block |
||
192 | 198 | /* |
193 | 199 | * Check if index exist |
194 | 200 | */ |
201 | + |
|
202 | + /** |
|
203 | + * @param string $table |
|
204 | + * @param string $index |
|
205 | + */ |
|
195 | 206 | public function indexExists($table,$index) |
196 | 207 | { |
197 | 208 | global $globalDBdriver, $globalDBname; |
@@ -234,6 +245,10 @@ discard block |
||
234 | 245 | return $columns; |
235 | 246 | } |
236 | 247 | |
248 | + /** |
|
249 | + * @param string $table |
|
250 | + * @param string $column |
|
251 | + */ |
|
237 | 252 | public function getColumnType($table,$column) { |
238 | 253 | $select = $this->db->query('SELECT '.$column.' FROM '.$table); |
239 | 254 | $tomet = $select->getColumnMeta(0); |
@@ -244,6 +259,11 @@ discard block |
||
244 | 259 | * Check if a column name exist in a table |
245 | 260 | * @return Boolean column exist or not |
246 | 261 | */ |
262 | + |
|
263 | + /** |
|
264 | + * @param string $table |
|
265 | + * @param string $name |
|
266 | + */ |
|
247 | 267 | public function checkColumnName($table,$name) |
248 | 268 | { |
249 | 269 | global $globalDBdriver, $globalDBname; |
@@ -21,6 +21,10 @@ discard block |
||
21 | 21 | if ($this->db === null) die('Error: No DB connection. (Stats)'); |
22 | 22 | } |
23 | 23 | |
24 | + /** |
|
25 | + * @param string $type |
|
26 | + * @param string $stats_date |
|
27 | + */ |
|
24 | 28 | public function addLastStatsUpdate($type,$stats_date) { |
25 | 29 | $query = "DELETE FROM config WHERE name = :type; |
26 | 30 | INSERT INTO config (name,value) VALUES (:type,:stats_date);"; |
@@ -1415,6 +1419,10 @@ discard block |
||
1415 | 1419 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
1416 | 1420 | return $all; |
1417 | 1421 | } |
1422 | + |
|
1423 | + /** |
|
1424 | + * @param string $type |
|
1425 | + */ |
|
1418 | 1426 | public function deleteStatsByType($type,$stats_airline = '', $filter_name = '') { |
1419 | 1427 | if ($filter_name == '') $filter_name = $this->filter_name; |
1420 | 1428 | $query = "DELETE FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
@@ -1426,6 +1434,11 @@ discard block |
||
1426 | 1434 | echo "error : ".$e->getMessage(); |
1427 | 1435 | } |
1428 | 1436 | } |
1437 | + |
|
1438 | + /** |
|
1439 | + * @param string $type |
|
1440 | + * @param string $year |
|
1441 | + */ |
|
1429 | 1442 | public function getSumStats($type,$year,$stats_airline = '',$filter_name = '',$month = '') { |
1430 | 1443 | if ($filter_name == '') $filter_name = $this->filter_name; |
1431 | 1444 | global $globalArchiveMonths, $globalDBdriver; |
@@ -1625,6 +1638,10 @@ discard block |
||
1625 | 1638 | else return 0; |
1626 | 1639 | } |
1627 | 1640 | |
1641 | + /** |
|
1642 | + * @param string $type |
|
1643 | + * @param string $stats_date |
|
1644 | + */ |
|
1628 | 1645 | public function addStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') { |
1629 | 1646 | global $globalDBdriver; |
1630 | 1647 | if ($filter_name == '') $filter_name = $this->filter_name; |
@@ -1678,6 +1695,9 @@ discard block |
||
1678 | 1695 | } |
1679 | 1696 | */ |
1680 | 1697 | |
1698 | + /** |
|
1699 | + * @param string $stats_type |
|
1700 | + */ |
|
1681 | 1701 | public function getStatsSource($stats_type,$year = '',$month = '',$day = '') { |
1682 | 1702 | global $globalDBdriver; |
1683 | 1703 | $query = "SELECT * FROM stats_source WHERE stats_type = :stats_type"; |
@@ -1721,6 +1741,9 @@ discard block |
||
1721 | 1741 | return $all; |
1722 | 1742 | } |
1723 | 1743 | |
1744 | + /** |
|
1745 | + * @param string $stats_type |
|
1746 | + */ |
|
1724 | 1747 | public function addStatSource($data,$source_name,$stats_type,$date) { |
1725 | 1748 | global $globalDBdriver; |
1726 | 1749 | if ($globalDBdriver == 'mysql') { |
@@ -1736,6 +1759,10 @@ discard block |
||
1736 | 1759 | return "error : ".$e->getMessage(); |
1737 | 1760 | } |
1738 | 1761 | } |
1762 | + |
|
1763 | + /** |
|
1764 | + * @param string $type |
|
1765 | + */ |
|
1739 | 1766 | public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') { |
1740 | 1767 | $query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)"; |
1741 | 1768 | $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
@@ -1746,6 +1773,10 @@ discard block |
||
1746 | 1773 | return "error : ".$e->getMessage(); |
1747 | 1774 | } |
1748 | 1775 | } |
1776 | + |
|
1777 | + /** |
|
1778 | + * @param string $type |
|
1779 | + */ |
|
1749 | 1780 | public function addStatMarine($type,$date_name,$cnt,$filter_name = '') { |
1750 | 1781 | $query = "INSERT INTO stats_marine (stats_type,marine_date,cnt,filter_name) VALUES (:type,:flight_date,:cnt,:filter_name)"; |
1751 | 1782 | $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt,':filter_name' => $filter_name); |
@@ -1756,6 +1787,10 @@ discard block |
||
1756 | 1787 | return "error : ".$e->getMessage(); |
1757 | 1788 | } |
1758 | 1789 | } |
1790 | + |
|
1791 | + /** |
|
1792 | + * @param string $type |
|
1793 | + */ |
|
1759 | 1794 | public function addStatTracker($type,$date_name,$cnt,$filter_name = '') { |
1760 | 1795 | $query = "INSERT INTO stats_tracker (stats_type,tracker_date,cnt,filter_name) VALUES (:type,:flight_date,:cnt,:filter_name)"; |
1761 | 1796 | $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt,':filter_name' => $filter_name); |
@@ -2068,6 +2103,10 @@ discard block |
||
2068 | 2103 | return "error : ".$e->getMessage(); |
2069 | 2104 | } |
2070 | 2105 | } |
2106 | + |
|
2107 | + /** |
|
2108 | + * @param string $type |
|
2109 | + */ |
|
2071 | 2110 | public function deleteStatFlight($type) { |
2072 | 2111 | $query = "DELETE FROM stats_flight WHERE stats_type = :type"; |
2073 | 2112 | $query_values = array(':type' => $type); |
@@ -2078,6 +2117,10 @@ discard block |
||
2078 | 2117 | return "error : ".$e->getMessage(); |
2079 | 2118 | } |
2080 | 2119 | } |
2120 | + |
|
2121 | + /** |
|
2122 | + * @param string $type |
|
2123 | + */ |
|
2081 | 2124 | public function deleteStatMarine($type) { |
2082 | 2125 | $query = "DELETE FROM stats_marine WHERE stats_type = :type"; |
2083 | 2126 | $query_values = array(':type' => $type); |
@@ -2088,6 +2131,10 @@ discard block |
||
2088 | 2131 | return "error : ".$e->getMessage(); |
2089 | 2132 | } |
2090 | 2133 | } |
2134 | + |
|
2135 | + /** |
|
2136 | + * @param string $type |
|
2137 | + */ |
|
2091 | 2138 | public function deleteStatTracker($type) { |
2092 | 2139 | $query = "DELETE FROM stats_tracker WHERE stats_type = :type"; |
2093 | 2140 | $query_values = array(':type' => $type); |
@@ -2098,6 +2145,10 @@ discard block |
||
2098 | 2145 | return "error : ".$e->getMessage(); |
2099 | 2146 | } |
2100 | 2147 | } |
2148 | + |
|
2149 | + /** |
|
2150 | + * @param string $type |
|
2151 | + */ |
|
2101 | 2152 | public function deleteStatAirport($type) { |
2102 | 2153 | $query = "DELETE FROM stats_airport WHERE stats_type = :type"; |
2103 | 2154 | $query_values = array(':type' => $type); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | /** |
17 | 17 | * Get SQL query part for filter used |
18 | 18 | * @param Array $filter the filter |
19 | - * @return Array the SQL part |
|
19 | + * @return string the SQL part |
|
20 | 20 | */ |
21 | 21 | |
22 | 22 | public function getFilter($filter = array(),$where = false,$and = false) { |
@@ -487,9 +487,6 @@ discard block |
||
487 | 487 | /** |
488 | 488 | * Update ident tracker data |
489 | 489 | * |
490 | - * @param String $flightaware_id the ID from flightaware |
|
491 | - * @param String $ident the flight ident |
|
492 | - * @return String success or false |
|
493 | 490 | * |
494 | 491 | */ |
495 | 492 | public function updateIdentTrackerData($famtrackid = '', $ident = '',$fromsource = NULL) |
@@ -511,10 +508,6 @@ discard block |
||
511 | 508 | /** |
512 | 509 | * Update latest tracker data |
513 | 510 | * |
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 | 511 | * |
519 | 512 | */ |
520 | 513 | public function updateLatestTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $groundspeed = NULL, $date = '') |
@@ -536,29 +529,6 @@ discard block |
||
536 | 529 | /** |
537 | 530 | * Adds a new tracker data |
538 | 531 | * |
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 | 532 | */ |
563 | 533 | public function addTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $comment = '', $type = '',$format_source = '', $source_name = '') |
564 | 534 | { |
@@ -1132,6 +1102,7 @@ discard block |
||
1132 | 1102 | /** |
1133 | 1103 | * Counts all hours |
1134 | 1104 | * |
1105 | + * @param string $orderby |
|
1135 | 1106 | * @return Array the hour list |
1136 | 1107 | * |
1137 | 1108 | */ |
@@ -1483,7 +1454,7 @@ discard block |
||
1483 | 1454 | /** |
1484 | 1455 | * Parses the direction degrees to working |
1485 | 1456 | * |
1486 | - * @param Float $direction the direction in degrees |
|
1457 | + * @param integer $direction the direction in degrees |
|
1487 | 1458 | * @return Array the direction information |
1488 | 1459 | * |
1489 | 1460 | */ |
@@ -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 | |
20 | 20 | public function getFilter($filter = array(),$where = false,$and = false) { |
@@ -467,6 +467,11 @@ discard block |
||
467 | 467 | /** |
468 | 468 | * Add identity |
469 | 469 | * |
470 | + * @param string $mmsi |
|
471 | + * @param string $imo |
|
472 | + * @param string $ident |
|
473 | + * @param string $callsign |
|
474 | + * @param string $type |
|
470 | 475 | */ |
471 | 476 | public function addIdentity($mmsi,$imo,$ident,$callsign,$type) |
472 | 477 | { |
@@ -600,25 +605,6 @@ discard block |
||
600 | 605 | * |
601 | 606 | * @param String $fammarine_id the ID |
602 | 607 | * @param String $ident the marine ident |
603 | - * @param String $departure_airport_icao the departure airport |
|
604 | - * @param String $arrival_airport_icao the arrival airport |
|
605 | - * @param String $latitude latitude of flight |
|
606 | - * @param String $longitude latitude of flight |
|
607 | - * @param String $waypoints waypoints of flight |
|
608 | - * @param String $heading heading of flight |
|
609 | - * @param String $groundspeed speed of flight |
|
610 | - * @param String $date date of flight |
|
611 | - * @param String $departure_airport_time departure time of flight |
|
612 | - * @param String $arrival_airport_time arrival time of flight |
|
613 | - * @param String $squawk squawk code of flight |
|
614 | - * @param String $route_stop route stop of flight |
|
615 | - * @param String $highlight highlight or not |
|
616 | - * @param String $ModeS ModesS code of flight |
|
617 | - * @param String $registration registration code of flight |
|
618 | - * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
619 | - * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
620 | - * @param String $verticalrate vertival rate of flight |
|
621 | - * @return String success or false |
|
622 | 608 | */ |
623 | 609 | 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 = '') |
624 | 610 | { |
@@ -1211,6 +1197,7 @@ discard block |
||
1211 | 1197 | /** |
1212 | 1198 | * Counts all hours |
1213 | 1199 | * |
1200 | + * @param string $orderby |
|
1214 | 1201 | * @return Array the hour list |
1215 | 1202 | * |
1216 | 1203 | */ |
@@ -1562,7 +1549,7 @@ discard block |
||
1562 | 1549 | /** |
1563 | 1550 | * Parses the direction degrees to working |
1564 | 1551 | * |
1565 | - * @param Float $direction the direction in degrees |
|
1552 | + * @param integer $direction the direction in degrees |
|
1566 | 1553 | * @return Array the direction information |
1567 | 1554 | * |
1568 | 1555 | */ |