@@ -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); |
@@ -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);"; |
@@ -1368,6 +1372,10 @@ discard block |
||
| 1368 | 1372 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 1369 | 1373 | return $all; |
| 1370 | 1374 | } |
| 1375 | + |
|
| 1376 | + /** |
|
| 1377 | + * @param string $type |
|
| 1378 | + */ |
|
| 1371 | 1379 | public function deleteStatsByType($type,$stats_airline = '', $filter_name = '') { |
| 1372 | 1380 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 1373 | 1381 | $query = "DELETE FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
@@ -1379,6 +1387,11 @@ discard block |
||
| 1379 | 1387 | echo "error : ".$e->getMessage(); |
| 1380 | 1388 | } |
| 1381 | 1389 | } |
| 1390 | + |
|
| 1391 | + /** |
|
| 1392 | + * @param string $type |
|
| 1393 | + * @param string $year |
|
| 1394 | + */ |
|
| 1382 | 1395 | public function getSumStats($type,$year,$stats_airline = '',$filter_name = '',$month = '') { |
| 1383 | 1396 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 1384 | 1397 | global $globalArchiveMonths, $globalDBdriver; |
@@ -1578,6 +1591,10 @@ discard block |
||
| 1578 | 1591 | else return 0; |
| 1579 | 1592 | } |
| 1580 | 1593 | |
| 1594 | + /** |
|
| 1595 | + * @param string $type |
|
| 1596 | + * @param string $stats_date |
|
| 1597 | + */ |
|
| 1581 | 1598 | public function addStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') { |
| 1582 | 1599 | global $globalDBdriver; |
| 1583 | 1600 | if ($filter_name == '') $filter_name = $this->filter_name; |
@@ -1631,6 +1648,9 @@ discard block |
||
| 1631 | 1648 | } |
| 1632 | 1649 | */ |
| 1633 | 1650 | |
| 1651 | + /** |
|
| 1652 | + * @param string $stats_type |
|
| 1653 | + */ |
|
| 1634 | 1654 | public function getStatsSource($stats_type,$year = '',$month = '',$day = '') { |
| 1635 | 1655 | global $globalDBdriver; |
| 1636 | 1656 | $query = "SELECT * FROM stats_source WHERE stats_type = :stats_type"; |
@@ -1674,6 +1694,9 @@ discard block |
||
| 1674 | 1694 | return $all; |
| 1675 | 1695 | } |
| 1676 | 1696 | |
| 1697 | + /** |
|
| 1698 | + * @param string $stats_type |
|
| 1699 | + */ |
|
| 1677 | 1700 | public function addStatSource($data,$source_name,$stats_type,$date) { |
| 1678 | 1701 | global $globalDBdriver; |
| 1679 | 1702 | if ($globalDBdriver == 'mysql') { |
@@ -1689,6 +1712,10 @@ discard block |
||
| 1689 | 1712 | return "error : ".$e->getMessage(); |
| 1690 | 1713 | } |
| 1691 | 1714 | } |
| 1715 | + |
|
| 1716 | + /** |
|
| 1717 | + * @param string $type |
|
| 1718 | + */ |
|
| 1692 | 1719 | public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') { |
| 1693 | 1720 | $query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)"; |
| 1694 | 1721 | $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
@@ -1955,6 +1982,10 @@ discard block |
||
| 1955 | 1982 | return "error : ".$e->getMessage(); |
| 1956 | 1983 | } |
| 1957 | 1984 | } |
| 1985 | + |
|
| 1986 | + /** |
|
| 1987 | + * @param string $type |
|
| 1988 | + */ |
|
| 1958 | 1989 | public function deleteStatFlight($type) { |
| 1959 | 1990 | $query = "DELETE FROM stats_flight WHERE stats_type = :type"; |
| 1960 | 1991 | $query_values = array(':type' => $type); |
@@ -1965,6 +1996,10 @@ discard block |
||
| 1965 | 1996 | return "error : ".$e->getMessage(); |
| 1966 | 1997 | } |
| 1967 | 1998 | } |
| 1999 | + |
|
| 2000 | + /** |
|
| 2001 | + * @param string $type |
|
| 2002 | + */ |
|
| 1968 | 2003 | public function deleteStatAirport($type) { |
| 1969 | 2004 | $query = "DELETE FROM stats_airport WHERE stats_type = :type"; |
| 1970 | 2005 | $query_values = array(':type' => $type); |
@@ -6,6 +6,9 @@ discard block |
||
| 6 | 6 | public $dbs = array(); |
| 7 | 7 | public $latest_schema = 45; |
| 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) { |
@@ -141,6 +144,9 @@ discard block |
||
| 141 | 144 | return true; |
| 142 | 145 | } |
| 143 | 146 | |
| 147 | + /** |
|
| 148 | + * @param string $table |
|
| 149 | + */ |
|
| 144 | 150 | public function tableExists($table) |
| 145 | 151 | { |
| 146 | 152 | global $globalDBdriver, $globalDBname; |
@@ -190,6 +196,11 @@ discard block |
||
| 190 | 196 | /* |
| 191 | 197 | * Check if index exist |
| 192 | 198 | */ |
| 199 | + |
|
| 200 | + /** |
|
| 201 | + * @param string $table |
|
| 202 | + * @param string $index |
|
| 203 | + */ |
|
| 193 | 204 | public function indexExists($table,$index) |
| 194 | 205 | { |
| 195 | 206 | global $globalDBdriver, $globalDBname; |
@@ -232,6 +243,10 @@ discard block |
||
| 232 | 243 | return $columns; |
| 233 | 244 | } |
| 234 | 245 | |
| 246 | + /** |
|
| 247 | + * @param string $table |
|
| 248 | + * @param string $column |
|
| 249 | + */ |
|
| 235 | 250 | public function getColumnType($table,$column) { |
| 236 | 251 | $select = $this->db->query('SELECT '.$column.' FROM '.$table); |
| 237 | 252 | $tomet = $select->getColumnMeta(0); |
@@ -242,6 +257,11 @@ discard block |
||
| 242 | 257 | * Check if a column name exist in a table |
| 243 | 258 | * @return Boolean column exist or not |
| 244 | 259 | */ |
| 260 | + |
|
| 261 | + /** |
|
| 262 | + * @param string $table |
|
| 263 | + * @param string $name |
|
| 264 | + */ |
|
| 245 | 265 | public function checkColumnName($table,$name) |
| 246 | 266 | { |
| 247 | 267 | global $globalDBdriver, $globalDBname; |