Added mode in the result table

This commit is contained in:
Andreas Kristiansen
2025-05-27 07:54:42 +02:00
parent 6e56f30588
commit 8ef96a5318
2 changed files with 37 additions and 3 deletions

View File

@@ -929,6 +929,40 @@
return null;
}
$sql = "select thcv.col_call, thcv.col_time_on, thcv.col_band, thcv.col_mode, thcv.col_submode, thcv.col_primary_key FROM ". $this->config->item('table_name') . " thcv";
$sql .= " join (SELECT col_call, min(col_time_on) firstworked, col_band, min(col_primary_key) qsoid FROM ".$this->config->item('table_name');
$sql .= " where station_id in (" . implode(',',$logbooks_locations_array) . ") and col_prop_mode ='EME'";
if ($mode != 'All') {
$sql .= " and (col_mode = ? or col_submode = ?)";
$binding[] = $mode;
$binding[] = $mode;
}
if ($band != 'All') {
$sql .= " and col_band = ?";
$binding[] = $band;
}
$sql .= " group by col_call, col_band order by firstworked) x on thcv.col_primary_key = x.qsoid";
$result = $this->db->query($sql, $binding);
return $result->result();
}
public function getInitialsFromDb2($band, $mode) {
$binding = [];
$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;
}
$sql = "SELECT col_call, min(col_time_on) firstworked, col_band, min(col_primary_key) qsoid FROM ".$this->config->item('table_name');
$sql .= " where station_id in (" . implode(',',$logbooks_locations_array) . ") and col_prop_mode ='EME'";

View File

@@ -22,14 +22,14 @@ if ($intials_array) {
<tbody>';
$i = 1;
foreach ($intials_array as $line) {
$date_as_timestamp = strtotime($line->firstworked ?? '1970-01-01 00:00:00');
$date_as_timestamp = strtotime($line->col_time_on ?? '1970-01-01 00:00:00');
echo '<tr>
<td>' . $i++ . '</td>
<td>' . date($custom_date_format, $date_as_timestamp) . '</td>
<td>' . $line->col_call . '</td>
<td>' . $line->col_band . '</td>
<td></td>
<td><a href=javascript:displayQso(' . $line->qsoid . ')>' . __("Show") . '</a></td>
<td>' . ($line->col_submode ?? $line->col_mode) . '</td>
<td><a href=javascript:displayQso(' . $line->col_primary_key . ')>' . __("Show") . '</a></td>
</tr>';
}