mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Add Monthly stats
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user