@@ -17,6 +17,10 @@ discard block |
||
| 17 | 17 | $this->db = $Connection->db(); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | + /** |
|
| 21 | + * @param string $type |
|
| 22 | + * @param string $stats_date |
|
| 23 | + */ |
|
| 20 | 24 | public function addLastStatsUpdate($type,$stats_date) { |
| 21 | 25 | $query = "DELETE FROM config WHERE name = :type; |
| 22 | 26 | INSERT INTO config (name,value) VALUES (:type,:stats_date);"; |
@@ -827,6 +831,11 @@ discard block |
||
| 827 | 831 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 828 | 832 | return $all; |
| 829 | 833 | } |
| 834 | + |
|
| 835 | + /** |
|
| 836 | + * @param string $type |
|
| 837 | + * @param string $year |
|
| 838 | + */ |
|
| 830 | 839 | public function getSumStats($type,$year,$stats_airline = '',$filter_name = '',$month = '') { |
| 831 | 840 | if ($filter_name == '') $filter_name = $this->filter_name; |
| 832 | 841 | global $globalArchiveMonths, $globalDBdriver; |
@@ -943,6 +952,10 @@ discard block |
||
| 943 | 952 | return $all[0]['total']; |
| 944 | 953 | } |
| 945 | 954 | |
| 955 | + /** |
|
| 956 | + * @param string $type |
|
| 957 | + * @param string $stats_date |
|
| 958 | + */ |
|
| 946 | 959 | public function addStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') { |
| 947 | 960 | global $globalDBdriver; |
| 948 | 961 | if ($filter_name == '') $filter_name = $this->filter_name; |
@@ -996,6 +1009,9 @@ discard block |
||
| 996 | 1009 | } |
| 997 | 1010 | */ |
| 998 | 1011 | |
| 1012 | + /** |
|
| 1013 | + * @param string $stats_type |
|
| 1014 | + */ |
|
| 999 | 1015 | public function getStatsSource($stats_type,$year = '',$month = '',$day = '') { |
| 1000 | 1016 | global $globalDBdriver; |
| 1001 | 1017 | $query = "SELECT * FROM stats_source WHERE stats_type = :stats_type"; |
@@ -1039,6 +1055,9 @@ discard block |
||
| 1039 | 1055 | return $all; |
| 1040 | 1056 | } |
| 1041 | 1057 | |
| 1058 | + /** |
|
| 1059 | + * @param string $stats_type |
|
| 1060 | + */ |
|
| 1042 | 1061 | public function addStatSource($data,$source_name,$stats_type,$date) { |
| 1043 | 1062 | global $globalDBdriver; |
| 1044 | 1063 | if ($globalDBdriver == 'mysql') { |
@@ -1054,6 +1073,10 @@ discard block |
||
| 1054 | 1073 | return "error : ".$e->getMessage(); |
| 1055 | 1074 | } |
| 1056 | 1075 | } |
| 1076 | + |
|
| 1077 | + /** |
|
| 1078 | + * @param string $type |
|
| 1079 | + */ |
|
| 1057 | 1080 | public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') { |
| 1058 | 1081 | $query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)"; |
| 1059 | 1082 | $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
@@ -1320,6 +1343,10 @@ discard block |
||
| 1320 | 1343 | return "error : ".$e->getMessage(); |
| 1321 | 1344 | } |
| 1322 | 1345 | } |
| 1346 | + |
|
| 1347 | + /** |
|
| 1348 | + * @param string $type |
|
| 1349 | + */ |
|
| 1323 | 1350 | public function deleteStatFlight($type) { |
| 1324 | 1351 | $query = "DELETE FROM stats_flight WHERE stats_type = :type"; |
| 1325 | 1352 | $query_values = array(':type' => $type); |
@@ -1330,6 +1357,10 @@ discard block |
||
| 1330 | 1357 | return "error : ".$e->getMessage(); |
| 1331 | 1358 | } |
| 1332 | 1359 | } |
| 1360 | + |
|
| 1361 | + /** |
|
| 1362 | + * @param string $type |
|
| 1363 | + */ |
|
| 1333 | 1364 | public function deleteStatAirport($type) { |
| 1334 | 1365 | $query = "DELETE FROM stats_airport WHERE stats_type = :type"; |
| 1335 | 1366 | $query_values = array(':type' => $type); |