@@ -19,6 +19,10 @@ discard block |
||
| 19 | 19 | if ($this->db === null) die('Error: No DB connection.'); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | + /** |
|
| 23 | + * @param string $type |
|
| 24 | + * @param string $stats_date |
|
| 25 | + */ |
|
| 22 | 26 | public function addLastStatsUpdate($type,$stats_date) { |
| 23 | 27 | $query = "DELETE FROM config WHERE name = :type; |
| 24 | 28 | INSERT INTO config (name,value) VALUES (:type,:stats_date);"; |
@@ -1369,6 +1373,10 @@ discard block |
||
| 1369 | 1373 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 1370 | 1374 | return $all; |
| 1371 | 1375 | } |
| 1376 | + |
|
| 1377 | + /** |
|
| 1378 | + * @param string $type |
|
| 1379 | + */ |
|
| 1372 | 1380 | public function deleteStatsByType($type,$stats_airline = '', $filter_name = '') { |
| 1373 | 1381 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 1374 | 1382 | $query = "DELETE FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
@@ -1380,6 +1388,11 @@ discard block |
||
| 1380 | 1388 | echo "error : ".$e->getMessage(); |
| 1381 | 1389 | } |
| 1382 | 1390 | } |
| 1391 | + |
|
| 1392 | + /** |
|
| 1393 | + * @param string $type |
|
| 1394 | + * @param string $year |
|
| 1395 | + */ |
|
| 1383 | 1396 | public function getSumStats($type,$year,$stats_airline = '',$filter_name = '',$month = '') { |
| 1384 | 1397 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 1385 | 1398 | global $globalArchiveMonths, $globalDBdriver; |
@@ -1579,6 +1592,10 @@ discard block |
||
| 1579 | 1592 | else return 0; |
| 1580 | 1593 | } |
| 1581 | 1594 | |
| 1595 | + /** |
|
| 1596 | + * @param string $type |
|
| 1597 | + * @param string $stats_date |
|
| 1598 | + */ |
|
| 1582 | 1599 | public function addStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') { |
| 1583 | 1600 | global $globalDBdriver; |
| 1584 | 1601 | if ($filter_name == '') $filter_name = $this->filter_name; |
@@ -1632,6 +1649,9 @@ discard block |
||
| 1632 | 1649 | } |
| 1633 | 1650 | */ |
| 1634 | 1651 | |
| 1652 | + /** |
|
| 1653 | + * @param string $stats_type |
|
| 1654 | + */ |
|
| 1635 | 1655 | public function getStatsSource($stats_type,$year = '',$month = '',$day = '') { |
| 1636 | 1656 | global $globalDBdriver; |
| 1637 | 1657 | $query = "SELECT * FROM stats_source WHERE stats_type = :stats_type"; |
@@ -1675,6 +1695,9 @@ discard block |
||
| 1675 | 1695 | return $all; |
| 1676 | 1696 | } |
| 1677 | 1697 | |
| 1698 | + /** |
|
| 1699 | + * @param string $stats_type |
|
| 1700 | + */ |
|
| 1678 | 1701 | public function addStatSource($data,$source_name,$stats_type,$date) { |
| 1679 | 1702 | global $globalDBdriver; |
| 1680 | 1703 | if ($globalDBdriver == 'mysql') { |
@@ -1690,6 +1713,10 @@ discard block |
||
| 1690 | 1713 | return "error : ".$e->getMessage(); |
| 1691 | 1714 | } |
| 1692 | 1715 | } |
| 1716 | + |
|
| 1717 | + /** |
|
| 1718 | + * @param string $type |
|
| 1719 | + */ |
|
| 1693 | 1720 | public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') { |
| 1694 | 1721 | $query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)"; |
| 1695 | 1722 | $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
@@ -1956,6 +1983,10 @@ discard block |
||
| 1956 | 1983 | return "error : ".$e->getMessage(); |
| 1957 | 1984 | } |
| 1958 | 1985 | } |
| 1986 | + |
|
| 1987 | + /** |
|
| 1988 | + * @param string $type |
|
| 1989 | + */ |
|
| 1959 | 1990 | public function deleteStatFlight($type) { |
| 1960 | 1991 | $query = "DELETE FROM stats_flight WHERE stats_type = :type"; |
| 1961 | 1992 | $query_values = array(':type' => $type); |
@@ -1966,6 +1997,10 @@ discard block |
||
| 1966 | 1997 | return "error : ".$e->getMessage(); |
| 1967 | 1998 | } |
| 1968 | 1999 | } |
| 2000 | + |
|
| 2001 | + /** |
|
| 2002 | + * @param string $type |
|
| 2003 | + */ |
|
| 1969 | 2004 | public function deleteStatAirport($type) { |
| 1970 | 2005 | $query = "DELETE FROM stats_airport WHERE stats_type = :type"; |
| 1971 | 2006 | $query_values = array(':type' => $type); |