diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index 4a6d417b2..1b781c3e8 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -920,4 +920,18 @@ class Logbookadvanced extends CI_Controller { header("Content-Type: application/json"); echo json_encode($result); } + + public function openStateList() { + if(!clubaccess_check(9)) return; + + $this->load->model('logbook_model'); + $this->load->model('logbookadvanced_model'); + + $data['dxcc'] = $this->input->post('dxcc', true); + + // Process for batch QSO state fix + $data['qsos'] = $this->logbookadvanced_model->getStateListQsos($data['dxcc']); + + $this->load->view('logbookadvanced/showStateQsos', $data); + } } diff --git a/application/models/Logbookadvanced_model.php b/application/models/Logbookadvanced_model.php index 3dfe433bf..af5781d44 100644 --- a/application/models/Logbookadvanced_model.php +++ b/application/models/Logbookadvanced_model.php @@ -1578,4 +1578,17 @@ class Logbookadvanced_model extends CI_Model { return $results; } + + function getStateListQsos($dxcc) { + $sql = "SELECT col_call, col_time_on, col_mode, col_submode, col_band, col_state, col_gridsquare FROM " . $this->config->item('table_name') . " qsos + JOIN station_profile ON qsos.station_id = station_profile.station_id + WHERE qsos.COL_DXCC = ? AND station_profile.user_id = ? + AND (qsos.COL_STATE IS NULL OR qsos.COL_STATE = '') + AND LENGTH(COALESCE(qsos.COL_GRIDSQUARE, '')) >= 6 + ORDER BY COL_TIME_ON DESC"; + + $query = $this->db->query($sql, [$dxcc, $this->session->userdata('user_id')]); + + return $query->result(); + } } diff --git a/application/views/logbookadvanced/checkresult.php b/application/views/logbookadvanced/checkresult.php index 10dc34aa1..512bcfb4f 100644 --- a/application/views/logbookadvanced/checkresult.php +++ b/application/views/logbookadvanced/checkresult.php @@ -26,9 +26,10 @@ - + diff --git a/application/views/logbookadvanced/showStateQsos.php b/application/views/logbookadvanced/showStateQsos.php new file mode 100644 index 000000000..040692c43 --- /dev/null +++ b/application/views/logbookadvanced/showStateQsos.php @@ -0,0 +1,38 @@ +

QSOs Missing State Information

+ 0): ?> + + + + + + + + + + + + + + + + + + + + + + + + + +
CallDate/TimeModeSubmodeBandStateGridsquare
col_call; ?>col_time_on)); ?>col_mode; ?>col_submode ?? ''; ?>col_band; ?>col_state; ?>col_gridsquare; ?>
+
+

+ Found QSO(s) missing state information for DXCC . +

+
+ +
+

No Issues Found

+
+ diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index c6c38f4d8..7420131d2 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -2250,7 +2250,7 @@ function saveOptions() { } function fixState(dxcc) { - $('#fixStateButton').prop("disabled", true).addClass("running"); + $('#fixStateBtn_' + dxcc).prop("disabled", true).addClass("running"); $.ajax({ url: base_url + 'index.php/logbookadvanced/fixStateBatch', @@ -2259,13 +2259,34 @@ function saveOptions() { 'dxcc': dxcc }, success: function (response) { - $('#fixStateButton').prop("disabled", false).removeClass("running"); + $('#fixStateBtn_' + dxcc).prop("disabled", false).removeClass("running"); }, error: function () { - $('#fixStateButton').prop("disabled", false).removeClass("running"); + $('#fixStateBtn_' + dxcc).prop("disabled", false).removeClass("running"); } }); } + function openStateList(dxcc) { + $('#openStateListBtn_' + dxcc).prop("disabled", true).addClass("running"); - + $.ajax({ + url: base_url + 'index.php/logbookadvanced/OpenStateList', + type: 'post', + data: { + 'dxcc': dxcc + }, + success: function (response) { + $('#openStateListBtn_' + dxcc).prop("disabled", false).removeClass("running"); + BootstrapDialog.show({ + title: 'QSO List', + message: response, + size: BootstrapDialog.SIZE_WIDE, + type: BootstrapDialog.TYPE_INFO + }); + }, + error: function () { + $('#openStateListBtn_' + dxcc).prop("disabled", false).removeClass("running"); + } + }); + }