On /station/ next to each profile it gives a QSO count.

This commit is contained in:
Peter Goodhall 2019-09-24 22:19:49 +01:00
parent c6d6058043
commit ecd7f7f6ac
2 changed files with 8 additions and 1 deletions

View File

@ -9,7 +9,12 @@ class Stations extends CI_Model {
}
function all() {
return $this->db->get('station_profile');
$this->db->select('station_profile.*, count('.$this->config->item('table_name').'.station_id) as qso_total');
$this->db->from('station_profile');
$this->db->join($this->config->item('table_name'),'station_profile.station_id = '.$this->config->item('table_name').'.station_id','left');
$this->db->group_by('station_profile.station_id');
return $this->db->get();
}
function profile($id) {

View File

@ -42,6 +42,7 @@
<th scope="col">SOTA</th>
<th scope="col">CQ</th>
<th scope="col">ITU</th>
<th scope="col">QSO Count</th>
<th></th>
<th scope="col"></th>
</tr>
@ -58,6 +59,7 @@
<td><?php echo $row->station_sota;?></td>
<td><?php echo $row->station_cq;?></td>
<td><?php echo $row->station_itu;?></td>
<td><?php echo $row->qso_total;?></td>
<td>
<?php if($row->station_active != 1) { ?>
<a href="<?php echo site_url('station/set_active/').$current_active."/".$row->station_id; ?>" class="btn btn-outline-secondary btn-sm btn-sm" onclick="return confirm('Are you sure you want to make logbook <?php echo $row->station_profile_name; ?> the active logbook?');">Set Active</a>