@@ -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);"; |
@@ -961,6 +965,10 @@ discard block |
||
961 | 965 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
962 | 966 | return $all; |
963 | 967 | } |
968 | + |
|
969 | + /** |
|
970 | + * @param string $type |
|
971 | + */ |
|
964 | 972 | public function deleteStatsByType($type,$stats_airline = '', $filter_name = '') { |
965 | 973 | if ($filter_name == '') $filter_name = $this->filter_name; |
966 | 974 | $query = "DELETE FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
@@ -972,6 +980,11 @@ discard block |
||
972 | 980 | echo "error : ".$e->getMessage(); |
973 | 981 | } |
974 | 982 | } |
983 | + |
|
984 | + /** |
|
985 | + * @param string $type |
|
986 | + * @param string $year |
|
987 | + */ |
|
975 | 988 | public function getSumStats($type,$year,$stats_airline = '',$filter_name = '',$month = '') { |
976 | 989 | if ($filter_name == '') $filter_name = $this->filter_name; |
977 | 990 | global $globalArchiveMonths, $globalDBdriver; |
@@ -1116,6 +1129,10 @@ discard block |
||
1116 | 1129 | else return 0; |
1117 | 1130 | } |
1118 | 1131 | |
1132 | + /** |
|
1133 | + * @param string $type |
|
1134 | + * @param string $stats_date |
|
1135 | + */ |
|
1119 | 1136 | public function addStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') { |
1120 | 1137 | global $globalDBdriver; |
1121 | 1138 | if ($filter_name == '') $filter_name = $this->filter_name; |
@@ -1169,6 +1186,9 @@ discard block |
||
1169 | 1186 | } |
1170 | 1187 | */ |
1171 | 1188 | |
1189 | + /** |
|
1190 | + * @param string $stats_type |
|
1191 | + */ |
|
1172 | 1192 | public function getStatsSource($stats_type,$year = '',$month = '',$day = '') { |
1173 | 1193 | global $globalDBdriver; |
1174 | 1194 | $query = "SELECT * FROM stats_source WHERE stats_type = :stats_type"; |
@@ -1212,6 +1232,9 @@ discard block |
||
1212 | 1232 | return $all; |
1213 | 1233 | } |
1214 | 1234 | |
1235 | + /** |
|
1236 | + * @param string $stats_type |
|
1237 | + */ |
|
1215 | 1238 | public function addStatSource($data,$source_name,$stats_type,$date) { |
1216 | 1239 | global $globalDBdriver; |
1217 | 1240 | if ($globalDBdriver == 'mysql') { |
@@ -1227,6 +1250,10 @@ discard block |
||
1227 | 1250 | return "error : ".$e->getMessage(); |
1228 | 1251 | } |
1229 | 1252 | } |
1253 | + |
|
1254 | + /** |
|
1255 | + * @param string $type |
|
1256 | + */ |
|
1230 | 1257 | public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') { |
1231 | 1258 | $query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)"; |
1232 | 1259 | $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
@@ -1493,6 +1520,10 @@ discard block |
||
1493 | 1520 | return "error : ".$e->getMessage(); |
1494 | 1521 | } |
1495 | 1522 | } |
1523 | + |
|
1524 | + /** |
|
1525 | + * @param string $type |
|
1526 | + */ |
|
1496 | 1527 | public function deleteStatFlight($type) { |
1497 | 1528 | $query = "DELETE FROM stats_flight WHERE stats_type = :type"; |
1498 | 1529 | $query_values = array(':type' => $type); |
@@ -1503,6 +1534,10 @@ discard block |
||
1503 | 1534 | return "error : ".$e->getMessage(); |
1504 | 1535 | } |
1505 | 1536 | } |
1537 | + |
|
1538 | + /** |
|
1539 | + * @param string $type |
|
1540 | + */ |
|
1506 | 1541 | public function deleteStatAirport($type) { |
1507 | 1542 | $query = "DELETE FROM stats_airport WHERE stats_type = :type"; |
1508 | 1543 | $query_values = array(':type' => $type); |