Add Monthly stats

This commit is contained in:
int2001
2025-12-30 11:22:37 +00:00
parent edf4d3ed3a
commit e8be3166ac
4 changed files with 209 additions and 0 deletions

View File

@@ -65,6 +65,28 @@ class Statistics extends CI_Controller {
echo json_encode($yearstats);
}
public function get_year_month() {
$this->load->model('logbook_model');
$yr = xss_clean($this->input->post('yr')) ?? 'All';
// get data
$totals_month = $this->logbook_model->totals_year_month($yr);
$monthstats = array();
$i = 0;
if ($totals_month) {
foreach($totals_month->result() as $qso_numbers) {
$monthstats[$i]['month'] = intval($qso_numbers->month);
$monthstats[$i++]['total'] = $qso_numbers->total;
}
}
header('Content-Type: application/json');
echo json_encode($monthstats);
}
public function get_mode() {
$this->load->model('logbook_model');
$yr = xss_clean($this->input->post('yr')) ?? 'All';