Add missing view and remove bug at Sum

This commit is contained in:
int2001
2024-01-22 19:58:57 +00:00
parent bd51761971
commit 79adf29166
2 changed files with 50 additions and 1 deletions

View File

@@ -77,7 +77,7 @@
$sats = $this->get_sats();
$modes = $this->get_sat_modes();
$satunique = $this->getUniqueSatCallsigns();
$satunique = $this->getUniqueSatCallsignsSat();
$modeunique = $this->getUniqueSatCallsignsModes();
// Generating the band/mode table
@@ -172,6 +172,27 @@
return $result;
}
function getUniqueSatCallsignsSat() {
$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;
}
$bands = array();
$this->db->select('count(distinct col_call) as calls, upper(col_sat_name) as sat', FALSE);
$this->db->where('col_prop_mode', 'SAT');
$this->db->where('coalesce(col_sat_name,"") != ""');
$this->db->where_in('station_id', $logbooks_locations_array);
$this->db->group_by('upper(col_sat_name)');
$query = $this->db->get($this->config->item('table_name'));
return $query->result();
}
function getUniqueSatCallsigns() {
$this->load->model('logbooks_model');
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));

View File

@@ -0,0 +1,28 @@
<?php
if ($qsoarray) {
echo '<br />
<table style="width:100%" class="satuniquetable table-sm table table-bordered table-hover table-striped table-condensed text-center">
<thead>';
echo '<tr><th></th>';
foreach($modes as $mode) {
echo '<th>' . $mode . '</th>';
}
echo '<th>'.lang('statistics_total').'</th>';
echo '</tr>
</thead>
<tbody>';
foreach ($qsoarray as $sat => $mode) {
echo '<tr><th>'. $sat .'</th>';
foreach ($mode as $singlemode) {
echo '<td>'.$singlemode.'</td>';
}
echo '<th>' . $satunique[$sat] . '</th>';
echo '</tr>';
}
echo '</tbody><tfoot><tr><th>'.lang('statistics_total').'</th>';
foreach($modes as $mode) {
echo '<th>' . $modeunique[$mode] . '</th>';
}
echo '<th>' . $total->calls . '</th>';
echo '</tr></tfoot></table>';
}