From 839b124c92357685f629c9df93a1eaecf08561fa Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 27 Oct 2023 13:28:53 +0200 Subject: [PATCH] Show list of unassigned QSOs --- application/controllers/Maintenance.php | 4 +-- application/models/Logbook_model.php | 4 ++- application/views/maintenance/main.php | 35 +++++++++++++++++++++++-- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/application/controllers/Maintenance.php b/application/controllers/Maintenance.php index 0e0deb2f..f6dd25c2 100644 --- a/application/controllers/Maintenance.php +++ b/application/controllers/Maintenance.php @@ -14,8 +14,8 @@ class Maintenance extends CI_Controller { $this->load->model('Stations'); $data['stations']=$this->Stations->all(); $data['page_title'] = "Maintenance"; - $data['is_there_qsos_with_no_station_id'] = $this->Logbook_model->check_for_station_id(); - if ($data['is_there_qsos_with_no_station_id']) { + $data['qsos_with_no_station_id'] = $this->Logbook_model->check_for_station_id(); + if ($data['qsos_with_no_station_id']) { $data['calls_wo_sid']=$this->Logbook_model->calls_without_station_id(); } $this->load->view('interface_assets/header', $data); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 6a48fbcc..643d4b97 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -4109,10 +4109,12 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = } public function check_for_station_id() { + $this->db->select('COL_TIME_ON, COL_CALL, COL_MODE, COL_BAND'); $this->db->where('station_id =', NULL); $query = $this->db->get($this->config->item('table_name')); + log_message('debug','SQL: '.$this->db->last_query()); if($query->num_rows() >= 1) { - return $query->num_rows(); + return $query->result(); } else { return 0; } diff --git a/application/views/maintenance/main.php b/application/views/maintenance/main.php index 1cc03355..c1c6432e 100644 --- a/application/views/maintenance/main.php +++ b/application/views/maintenance/main.php @@ -13,11 +13,42 @@
QSO-DB Maintenance
- = 1) { ?> +
+
+ + + + + + + + + + session->userdata('user_date_format')) { + $custom_date_format = $this->session->userdata('user_date_format'); + } else { + $custom_date_format = 'd.m.Y'; + } + foreach ($qsos_with_no_station_id as $qso) { + echo ''; + $timestamp = strtotime($qso->COL_TIME_ON); + echo ''; + $timestamp = strtotime($qso->COL_TIME_ON); + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } ?> + + + +
DateTimeCallModeBand
'.date($custom_date_format, $timestamp).''.date('H:i', $timestamp).''.$qso->COL_CALL.''.$qso->COL_MODE.''.$qso->COL_BAND.'
+

Please reassign those QSOs to an existing station location: