@@ -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; |
@@ -70,7 +70,7 @@ |
||
70 | 70 | /** |
71 | 71 | * Returns list of available locales |
72 | 72 | * |
73 | - * @return array |
|
73 | + * @return string[] |
|
74 | 74 | */ |
75 | 75 | public function listLocaleDir() |
76 | 76 | { |
@@ -58,6 +58,10 @@ discard block |
||
58 | 58 | } else return $ident; |
59 | 59 | } |
60 | 60 | |
61 | + /** |
|
62 | + * @param string $correct_ident |
|
63 | + * @param string $source |
|
64 | + */ |
|
61 | 65 | public function addOperator($ident,$correct_ident,$source) { |
62 | 66 | $query = "INSERT INTO translation (Operator,Operator_correct,Source) VALUES (:ident,:correct_ident,:source)"; |
63 | 67 | $query_values = array(':ident' => $ident,':correct_ident' => $correct_ident, ':source' => $source); |
@@ -69,6 +73,10 @@ discard block |
||
69 | 73 | } |
70 | 74 | } |
71 | 75 | |
76 | + /** |
|
77 | + * @param string $correct_ident |
|
78 | + * @param string $source |
|
79 | + */ |
|
72 | 80 | public function updateOperator($ident,$correct_ident,$source) { |
73 | 81 | $query = "UPDATE translation SET Operator_correct = :correct_ident,Source = :source WHERE Operator = :ident"; |
74 | 82 | $query_values = array(':ident' => $ident,':correct_ident' => $correct_ident, ':source' => $source); |
@@ -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; |
@@ -10,6 +10,9 @@ discard block |
||
10 | 10 | class update_db { |
11 | 11 | public static $db_sqlite; |
12 | 12 | |
13 | + /** |
|
14 | + * @param string $file |
|
15 | + */ |
|
13 | 16 | public static function download($url, $file, $referer = '') { |
14 | 17 | global $globalProxy, $globalForceIPv4; |
15 | 18 | $fp = fopen($file, 'w'); |
@@ -34,6 +37,9 @@ discard block |
||
34 | 37 | fclose($fp); |
35 | 38 | } |
36 | 39 | |
40 | + /** |
|
41 | + * @param string $in_file |
|
42 | + */ |
|
37 | 43 | public static function gunzip($in_file,$out_file_name = '') { |
38 | 44 | //echo $in_file.' -> '.$out_file_name."\n"; |
39 | 45 | $buffer_size = 4096; // read 4kb at a time |
@@ -55,6 +61,9 @@ discard block |
||
55 | 61 | } |
56 | 62 | } |
57 | 63 | |
64 | + /** |
|
65 | + * @param string $in_file |
|
66 | + */ |
|
58 | 67 | public static function unzip($in_file) { |
59 | 68 | if ($in_file != '' && file_exists($in_file)) { |
60 | 69 | $path = pathinfo(realpath($in_file), PATHINFO_DIRNAME); |
@@ -76,6 +85,9 @@ discard block |
||
76 | 85 | } |
77 | 86 | } |
78 | 87 | |
88 | + /** |
|
89 | + * @param string $database_file |
|
90 | + */ |
|
79 | 91 | public static function retrieve_route_sqlite_to_dest($database_file) { |
80 | 92 | global $globalDebug, $globalTransaction; |
81 | 93 | //$query = 'TRUNCATE TABLE routes'; |
@@ -118,6 +130,10 @@ discard block |
||
118 | 130 | } |
119 | 131 | return ''; |
120 | 132 | } |
133 | + |
|
134 | + /** |
|
135 | + * @param string $database_file |
|
136 | + */ |
|
121 | 137 | public static function retrieve_route_oneworld($database_file) { |
122 | 138 | global $globalDebug, $globalTransaction; |
123 | 139 | //$query = 'TRUNCATE TABLE routes'; |
@@ -159,6 +175,9 @@ discard block |
||
159 | 175 | return ''; |
160 | 176 | } |
161 | 177 | |
178 | + /** |
|
179 | + * @param string $database_file |
|
180 | + */ |
|
162 | 181 | public static function retrieve_route_skyteam($database_file) { |
163 | 182 | global $globalDebug, $globalTransaction; |
164 | 183 | //$query = 'TRUNCATE TABLE routes'; |
@@ -201,6 +220,10 @@ discard block |
||
201 | 220 | } |
202 | 221 | return ''; |
203 | 222 | } |
223 | + |
|
224 | + /** |
|
225 | + * @param string $database_file |
|
226 | + */ |
|
204 | 227 | public static function retrieve_modes_sqlite_to_dest($database_file) { |
205 | 228 | global $globalTransaction; |
206 | 229 | //$query = 'TRUNCATE TABLE aircraft_modes'; |
@@ -267,6 +290,9 @@ discard block |
||
267 | 290 | return ''; |
268 | 291 | } |
269 | 292 | |
293 | + /** |
|
294 | + * @param string $database_file |
|
295 | + */ |
|
270 | 296 | public static function retrieve_modes_flarmnet($database_file) { |
271 | 297 | global $globalTransaction; |
272 | 298 | $Common = new Common(); |
@@ -337,6 +363,9 @@ discard block |
||
337 | 363 | return ''; |
338 | 364 | } |
339 | 365 | |
366 | + /** |
|
367 | + * @param string $database_file |
|
368 | + */ |
|
340 | 369 | public static function retrieve_modes_ogn($database_file) { |
341 | 370 | global $globalTransaction; |
342 | 371 | //$query = 'TRUNCATE TABLE aircraft_modes'; |
@@ -406,6 +435,9 @@ discard block |
||
406 | 435 | return ''; |
407 | 436 | } |
408 | 437 | |
438 | + /** |
|
439 | + * @param string $database_file |
|
440 | + */ |
|
409 | 441 | public static function retrieve_owner($database_file,$country = 'F') { |
410 | 442 | global $globalTransaction, $globalMasterSource; |
411 | 443 | //$query = 'TRUNCATE TABLE aircraft_modes'; |
@@ -1393,6 +1425,10 @@ discard block |
||
1393 | 1425 | return ''; |
1394 | 1426 | } |
1395 | 1427 | |
1428 | + /** |
|
1429 | + * @param string $filename |
|
1430 | + * @param string $tletype |
|
1431 | + */ |
|
1396 | 1432 | public static function tle($filename,$tletype) { |
1397 | 1433 | require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
1398 | 1434 | global $tmp_dir, $globalTransaction; |
@@ -1442,6 +1478,9 @@ discard block |
||
1442 | 1478 | return ''; |
1443 | 1479 | } |
1444 | 1480 | |
1481 | + /** |
|
1482 | + * @param string $filename |
|
1483 | + */ |
|
1445 | 1484 | public static function satellite_ucsdb($filename) { |
1446 | 1485 | global $tmp_dir, $globalTransaction; |
1447 | 1486 | $query = "DELETE FROM satellite"; |
@@ -1488,6 +1527,9 @@ discard block |
||
1488 | 1527 | return ''; |
1489 | 1528 | } |
1490 | 1529 | |
1530 | + /** |
|
1531 | + * @param string $filename |
|
1532 | + */ |
|
1491 | 1533 | public static function satellite_celestrak($filename) { |
1492 | 1534 | global $tmp_dir, $globalTransaction; |
1493 | 1535 | $satcat_sources = array( |
@@ -1815,6 +1857,9 @@ discard block |
||
1815 | 1857 | |
1816 | 1858 | } |
1817 | 1859 | */ |
1860 | + /** |
|
1861 | + * @param string $filename |
|
1862 | + */ |
|
1818 | 1863 | public static function waypoints($filename) { |
1819 | 1864 | //require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
1820 | 1865 | global $tmp_dir, $globalTransaction; |
@@ -1883,6 +1928,9 @@ discard block |
||
1883 | 1928 | } |
1884 | 1929 | } |
1885 | 1930 | |
1931 | + /** |
|
1932 | + * @param string $filename |
|
1933 | + */ |
|
1886 | 1934 | public static function ivao_airlines($filename) { |
1887 | 1935 | //require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
1888 | 1936 | global $tmp_dir, $globalTransaction; |
@@ -110,6 +110,12 @@ discard block |
||
110 | 110 | return $all; |
111 | 111 | } |
112 | 112 | |
113 | + /** |
|
114 | + * @param string $name |
|
115 | + * @param string $city |
|
116 | + * @param string $country |
|
117 | + * @param string $source |
|
118 | + */ |
|
113 | 119 | public function addLocation($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0,$location_id = 0,$last_seen = '', $description = '') { |
114 | 120 | if ($last_seen == '') $last_seen = date('Y-m-d H:i:s'); |
115 | 121 | $query = "INSERT INTO source_location (name,latitude,longitude,altitude,country,city,logo,source,type,source_id,last_seen,location_id,description) VALUES (:name,:latitude,:longitude,:altitude,:country,:city,:logo,:source,:type,:source_id,:last_seen,:location_id,:description)"; |
@@ -168,6 +174,9 @@ discard block |
||
168 | 174 | } |
169 | 175 | } |
170 | 176 | |
177 | + /** |
|
178 | + * @param string $type |
|
179 | + */ |
|
171 | 180 | public function deleteLocationByType($type) { |
172 | 181 | $query = "DELETE FROM source_location WHERE type = :type"; |
173 | 182 | $query_values = array(':type' => $type); |
@@ -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) { |
@@ -584,25 +584,6 @@ discard block |
||
584 | 584 | * |
585 | 585 | * @param String $fammarine_id the ID |
586 | 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 | 587 | */ |
607 | 588 | 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 | 589 | { |
@@ -1195,6 +1176,7 @@ discard block |
||
1195 | 1176 | /** |
1196 | 1177 | * Counts all hours |
1197 | 1178 | * |
1179 | + * @param string $orderby |
|
1198 | 1180 | * @return Array the hour list |
1199 | 1181 | * |
1200 | 1182 | */ |
@@ -1546,7 +1528,7 @@ discard block |
||
1546 | 1528 | /** |
1547 | 1529 | * Parses the direction degrees to working |
1548 | 1530 | * |
1549 | - * @param Float $direction the direction in degrees |
|
1531 | + * @param integer $direction the direction in degrees |
|
1550 | 1532 | * @return Array the direction information |
1551 | 1533 | * |
1552 | 1534 | */ |
@@ -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 | */ |