Fixes Bug where Modes are not shown correct

This commit is contained in:
int2001
2024-12-03 09:38:03 +00:00
parent e937c6a9f4
commit 318f94f007
2 changed files with 24 additions and 0 deletions

View File

@@ -122,6 +122,8 @@ class Statistics extends CI_Controller {
$modestats[$i++]['total'] = $this->logbook_model->total_cw($yr);
$modestats[$i]['mode'] = 'fm';
$modestats[$i++]['total'] = $this->logbook_model->total_fm($yr);
$modestats[$i]['mode'] = 'others';
$modestats[$i++]['total'] = $this->logbook_model->total_others($yr);
$modestats[$i]['mode'] = 'digi';
$modestats[$i]['total'] = $this->logbook_model->total_digi($yr);
usort($modestats, fn($a, $b) => $b['total'] <=> $a['total']);

View File

@@ -3002,6 +3002,28 @@ class Logbook_model extends CI_Model {
}
/* Return total number of FM QSOs */
function total_others($yr = 'All') {
$this->load->model('logbooks_model');
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
if (!$logbooks_locations_array) {
return null;
}
$this->db->select('COUNT( * ) as count', FALSE);
$this->db->where_in('station_id', $logbooks_locations_array);
$this->db->where_not_in('COL_MODE', array('FM','CW','DIGI','SSB','LSB','USB'));
$this->where_year($yr);
$query = $this->db->get($this->config->item('table_name'));
if ($query->num_rows() > 0) {
foreach ($query->result() as $row) {
return $row->count;
}
}
}
function total_fm($yr = 'All') {
$this->load->model('logbooks_model');