From d5842bbc5acd356726cf5dea8d6445b0bdd7fcf2 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Thu, 29 Dec 2022 17:14:18 +0100 Subject: [PATCH 1/9] [OQRS] Created new view for OQRS requests --- application/controllers/Oqrs.php | 18 ++ application/models/Oqrs_model.php | 51 ++++- application/views/oqrs/showrequests.php | 227 +++++++++++------------ assets/js/sections/oqrs.js | 235 +++++++++++++++++++++++- 4 files changed, 402 insertions(+), 129 deletions(-) diff --git a/application/controllers/Oqrs.php b/application/controllers/Oqrs.php index 46fde176..3500ad1d 100644 --- a/application/controllers/Oqrs.php +++ b/application/controllers/Oqrs.php @@ -91,6 +91,7 @@ class Oqrs extends CI_Controller { $this->load->model('oqrs_model'); $data['result'] = $this->oqrs_model->getOqrsRequests($location_list); + $data['stations'] = $this->oqrs_model->get_oqrs_stations(); $this->load->view('interface_assets/header', $data); $this->load->view('oqrs/showrequests'); @@ -182,4 +183,21 @@ class Oqrs extends CI_Controller { $this->oqrs_model->mark_oqrs_line_as_done($id); } + + public function search() { + $this->load->model('oqrs_model'); + + $searchCriteria = array( + 'user_id' => (int)$this->session->userdata('user_id'), + 'de' => xss_clean($this->input->post('de')), + 'dx' => xss_clean($this->input->post('dx')), + 'status' => xss_clean($this->input->post('status')), + 'oqrsResults' => xss_clean($this->input->post('oqrsResults')), + ); + + $qsos = $this->oqrs_model->searchOqrs($searchCriteria); + + header("Content-Type: application/json"); + print json_encode($qsos); + } } diff --git a/application/models/Oqrs_model.php b/application/models/Oqrs_model.php index 7736b1e5..553f026d 100644 --- a/application/models/Oqrs_model.php +++ b/application/models/Oqrs_model.php @@ -84,7 +84,7 @@ class Oqrs_model extends CI_Model { } function getOqrsRequests($location_list) { - $sql = 'select * from oqrs join station_profile on oqrs.station_id = station_profile.station_id where oqrs.station_id in (' . $location_list . ') and oqrs.status < 2'; + $sql = 'select * from oqrs join station_profile on oqrs.station_id = station_profile.station_id where oqrs.station_id in (' . $location_list . ')'; $query = $this->db->query($sql); @@ -251,15 +251,46 @@ class Oqrs_model extends CI_Model { return ''; } - function getOqrsStationsFromSlug($logbook_id) { - $sql = 'SELECT station_callsign FROM `station_logbooks_relationship` JOIN `station_profile` ON station_logbooks_relationship.station_location_id = station_profile.station_id WHERE station_profile.oqrs = 1 AND station_logbook_id = '.$logbook_id.';'; + /* + * @param array $searchCriteria + * @return array + */ + public function searchOqrs($searchCriteria) : array { + $conditions = []; + $binding = [$searchCriteria['user_id']]; - $query = $this->db->query($sql); - - if ($query->num_rows() > 0) { - return true; - } else { - return false; + if ($searchCriteria['de'] !== '') { + $conditions[] = "station_profile.STATION_CALLSIGN = ?"; + $binding[] = trim($searchCriteria['de']); } + if ($searchCriteria['dx'] !== '') { + $conditions[] = "oqrs.requestcallsign LIKE ?"; + $binding[] = '%' . trim($searchCriteria['dx']) . '%'; + } + if ($searchCriteria['status'] !== '') { + $conditions[] = "oqrs.status = ?"; + $binding[] = $searchCriteria['status']; + } + + $where = trim(implode(" AND ", $conditions)); + if ($where != "") { + $where = "AND $where"; + } + + $limit = $searchCriteria['oqrsResults']; + + $sql = " + SELECT * + FROM oqrs + INNER JOIN station_profile ON oqrs.station_id=station_profile.station_id + WHERE station_profile.user_id = ? + $where + ORDER BY oqrs.id + LIMIT $limit + "; + + $data = $this->db->query($sql, $binding); + + return $data->result('array'); } -} +} \ No newline at end of file diff --git a/application/views/oqrs/showrequests.php b/application/views/oqrs/showrequests.php index cdd18674..583ae530 100644 --- a/application/views/oqrs/showrequests.php +++ b/application/views/oqrs/showrequests.php @@ -1,126 +1,123 @@ -
-
-

- 0) { - $station_id = ''; - $tablebody = ''; - $requester = ''; - $first = true; - $second = true; - foreach ($result as $qso) { - if ($station_id != $qso->station_id) { - if (!$first) { - write_table($tablebody); - $tablebody = ''; - echo '

'; - } - insert_station_data($qso); - $first = false; - } - if ($requester != $qso->requestcallsign) { - if (!$second) { - write_table($tablebody); - } - $second = false; - insert_requester($qso); - write_table_header(); - $tablebody = ''; - } - $tablebody .= insert_qso_data($qso); - - $requester = $qso->requestcallsign; - $station_id = $qso->station_id; - } - write_table($tablebody); - echo '
'; - } else { - echo 'No OQRS requests were found at this time.'; - } - ?> - - - - -
-
- Station id: station_id; ?> - Station callsign: station_callsign; ?> - Profile Name: station_profile_name; ?> - Country: station_country; ?> - Gridsquare: station_gridsquare; ?> -
-
- -OQRS Request: - +
+

+ session->flashdata('message')) { ?> + +
+

session->flashdata('message'); ?>

+
+ +
+
" method="post"> +
+
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+
+
+ + +
+
+ +
+
+
+ With selected : + + + +
+
+
- - - - - - - - - - - - - - + + + + + + + + + + + + + + - -
RequesterTime of requestE-mailNoteQSL route
requestcallsign ?>requesttime ?>email ?>note ?>qslroute; ?>
Time of requestQSO DateQSO TimeBandModeRequest callsignStation callsignE-mailNoteQSL routeCheck logStatus
- id.'"> - ' . $qso->date . ' - ' . $qso->time . ' - ' . $qso->band . ' - ' . $qso->mode . ' - - - - - - '; - return $tablebody; -} - -function write_table_header() { - ?> - - - - - - - - - - - - + id.'" oqrsid="'.$qso->id.'">'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + }*/ + ?> -
DateTime (UTC)BandModeCheck logMark as doneDelete
'. $qso->requesttime .''. $qso->date .''. $qso->time .''. $qso->band .''. $qso->mode .''. $qso->requestcallsign .''. $qso->station_callsign .''. $qso->email .''. $qso->note .''; echo_qsl_method($qso->qslroute); echo ' + + '; echo_status($qso->status); echo '
- \ No newline at end of file diff --git a/assets/js/sections/oqrs.js b/assets/js/sections/oqrs.js index 42fc1004..cc98e80d 100644 --- a/assets/js/sections/oqrs.js +++ b/assets/js/sections/oqrs.js @@ -228,10 +228,10 @@ function searchLogTimeDate(id) { $.ajax({ url: base_url + 'index.php/oqrs/search_log_time_date', type: 'post', - data: {'time': $('.oqrsid_'+id+ ' td:nth-child(2)').text(), - 'date': $('.oqrsid_'+id+ ' td:nth-child(1)').text(), - 'band': $('.oqrsid_'+id+ ' td:nth-child(3)').text(), - 'mode': $('.oqrsid_'+id+ ' td:nth-child(4)').text() + data: {'time': $('#oqrsID_'+id+ ' td:nth-child(4)').text(), + 'date': $('#oqrsID_'+id+ ' td:nth-child(3)').text(), + 'band': $('#oqrsID_'+id+ ' td:nth-child(5)').text(), + 'mode': $('#oqrsID_'+id+ ' td:nth-child(6)').text() }, success: function(html) { BootstrapDialog.show({ @@ -265,3 +265,230 @@ function markOqrsLineAsDone(id) { } }); } +function loadOqrsTable(rows) { + var uninitialized = $('.oqrstable').filter(function() { + return !$.fn.DataTable.fnIsDataTable(this); + }); + + uninitialized.each(function() { + $(this).DataTable({ + searching: false, + responsive: false, + ordering: true, + "scrollY": window.innerHeight - $('#searchForm').innerHeight() - 250, + "scrollCollapse": true, + "paging": false, + "scrollX": true, + "order": [ 0, 'asc' ], + 'white-space': 'nowrap', + }); + }); + + var table = $('.oqrstable').DataTable(); + + table.clear(); + + for (i = 0; i < rows.length; i++) { + let qso = rows[i]; + + var data = [ + '
', + qso.requesttime, + qso.date, + qso.time, + qso.band, + qso.mode, + qso.requestcallsign, + qso.station_callsign, + qso.email, + qso.note, + echo_qsl_method(qso.qslroute), + echo_searchlog_button(qso.requestcallsign, qso.id), + echo_status(qso.status), + ]; + + let createdRow = table.row.add(data).index(); + table.rows(createdRow).nodes().to$().data('oqrsID', qso.id); + table.row(createdRow).node().id = 'oqrsID_' + qso.id; + } + table.columns.adjust().draw(); +} + +function echo_status(status) { + switch(status.toUpperCase()) { + case '0': return 'Open request'; break; + case '1': return 'Not in log request'; break; + case '2': return 'Request done'; break; + default: return ''; + } +} +function echo_qsl_method(method) { + switch(method.toUpperCase()) { + case 'B': return 'Bureau'; break; + case 'D': return 'Direct'; break; + case 'E': return 'Electronic'; break; + default: return ''; + } +} + +function echo_searchlog_button(callsign, id) { + return ' ' + + ''; +} + +$(document).ready(function () { + + $('#searchForm').submit(function (e) { + $('#searchButton').prop("disabled", true); + + $.ajax({ + url: this.action, + type: 'post', + data: { + de: this.de.value, + dx: this.dx.value, + status: this.status.value, + oqrsResults: this.oqrsResults.value + }, + dataType: 'json', + success: function (data) { + $('#searchButton').prop("disabled", false); + loadOqrsTable(data); + }, + error: function (data) { + $('#searchButton').prop("disabled", false); + BootstrapDialog.alert({ + title: 'ERROR', + message: 'An error ocurred while making the request', + type: BootstrapDialog.TYPE_DANGER, + closable: false, + draggable: false, + callback: function (result) { + } + }); + }, + }); + return false; + }); + + $('.oqrstable').on('click', 'input[type="checkbox"]', function() { + if ($(this).is(":checked")) { + $(this).closest('tr').addClass('alert-success'); + } else { + $(this).closest('tr').removeClass('alert-success'); + } + }); + + $('#deleteOqrs').click(function (event) { + var elements = $('.oqrstable tbody input:checked'); + var nElements = elements.length; + if (nElements == 0) { + return; + } + + $('#deleteOqrs').prop("disabled", true); + + var table = $('.oqrstable').DataTable(); + + BootstrapDialog.confirm({ + title: 'DANGER', + message: 'Warning! Are you sure you want to delete the marked OQRS request(s)?' , + type: BootstrapDialog.TYPE_DANGER, + closable: true, + draggable: true, + btnOKClass: 'btn-danger', + callback: function(result) { + if(result) { + elements.each(function() { + let id = $(this).first().closest('tr').data('qsoID') + $.ajax({ + url: base_url + 'index.php/oqrs/delete_ajax', + type: 'post', + data: {'id': id + }, + success: function(data) { + var row = $("#qsoID_" + id); + table.row(row).remove().draw(false); + } + }); + $('#deleteOqrs').prop("disabled", false); + }) + } + } + }); + }); + + $('#markOqrs').click(function (event) { + var elements = $('.oqrstable tbody input:checked'); + var nElements = elements.length; + if (nElements == 0) { + return; + } + + $('#markOqrs').prop("disabled", true); + + var table = $('.oqrstable').DataTable(); + + BootstrapDialog.confirm({ + title: 'DANGER', + message: 'Warning! Are you sure you want to delete the marked OQRS request(s)?' , + type: BootstrapDialog.TYPE_DANGER, + closable: true, + draggable: true, + btnOKClass: 'btn-danger', + callback: function(result) { + if(result) { + elements.each(function() { + let id = $(this).first().closest('tr').data('qsoID') + $.ajax({ + url: base_url + 'index.php/oqrs/mark_ajax', + type: 'post', + data: {'id': id + }, + success: function(data) { + var row = $("#qsoID_" + id); + table.row(row).remove().draw(false); + } + }); + $('#markOqrs').prop("disabled", false); + }) + } + } + }); + }); + + + $('#checkBoxAll').change(function (event) { + if (this.checked) { + $('.oqrstable tbody tr').each(function (i) { + selectQsoID($(this).data('oqrsID')) + }); + } else { + $('.oqrstable tbody tr').each(function (i) { + unselectQsoID($(this).data('oqrsID')) + }); + } + }); + + $('#searchForm').submit(); + + $('#searchForm').on('reset', function(e) { + setTimeout(function() { + $('#searchForm').submit(); + }); + }); +}); + +function selectQsoID(qsoID) { + var element = $("#oqrsID_" + qsoID); + element.find("input[type=checkbox]").prop("checked", true); + element.addClass('alert-success'); +} + +function unselectQsoID(qsoID) { + var element = $("#oqrsID_" + qsoID); + element.find("input[type=checkbox]").prop("checked", false); + element.removeClass('alert-success'); + $('#checkBoxAll').prop("checked", false); +} + From b31f52df7fe200f066b962e5bcb0c5ffde74fa5f Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 29 Dec 2022 17:35:15 +0100 Subject: [PATCH 2/9] Add some toUpperCases --- assets/js/sections/oqrs.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/assets/js/sections/oqrs.js b/assets/js/sections/oqrs.js index cc98e80d..068fad66 100644 --- a/assets/js/sections/oqrs.js +++ b/assets/js/sections/oqrs.js @@ -34,7 +34,7 @@ function searchOqrs() { $.ajax({ url: base_url+'index.php/oqrs/get_qsos', type: 'post', - data: {'station_id': $("#station").val(), 'callsign': $("#oqrssearch").val()}, + data: {'station_id': $("#station").val(), 'callsign': $("#oqrssearch").val().toUpperCase()}, success: function (data) { $(".searchinfo").append(data); } @@ -45,7 +45,7 @@ function notInLog() { $.ajax({ url: base_url + 'index.php/oqrs/not_in_log', type: 'post', - data: {'station_id': $("#station").val(), 'callsign': $("#oqrssearch").val()}, + data: {'station_id': $("#station").val(), 'callsign': $("#oqrssearch").val().toUpperCase()}, success: function(html) { $(".searchinfo").html(html); } @@ -79,7 +79,7 @@ function saveNotInLogRequest() { url: base_url+'index.php/oqrs/save_not_in_log', type: 'post', data: { 'station_id': $("#station").val(), - 'callsign': $("#oqrssearch").val(), + 'callsign': $("#oqrssearch").val().toUpperCase(), 'email': $("#emailInput").val(), 'message': $("#messageInput").val(), 'qsos': qsos @@ -115,7 +115,7 @@ function requestOqrs() { $.ajax({ url: base_url + 'index.php/oqrs/request_form', type: 'post', - data: {'station_id': $("#station").val(), 'callsign': $("#oqrssearch").val()}, + data: {'station_id': $("#station").val(), 'callsign': $("#oqrssearch").val().toUpperCase()}, success: function(html) { $(".searchinfo").html(html); $('.result-table').DataTable({ @@ -158,8 +158,8 @@ function submitOqrsRequest() { $.ajax({ url: base_url+'index.php/oqrs/save_oqrs_request', type: 'post', - data: { 'station_id': $("#station").val(), - 'callsign': $("#oqrssearch").val(), + data: { 'station_id': $("#station").val(), + 'callsign': $("#oqrssearch").val().toUpperCase(), 'email': $("#emailInput").val(), 'message': $("#messageInput").val(), 'qsos': qsos, From da6bcaaf6aa1343ca505876e3f966fad3e0c23f1 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Thu, 29 Dec 2022 17:59:10 +0100 Subject: [PATCH 3/9] [OQRS] Delete and mark buttons work --- assets/js/sections/oqrs.js | 48 ++++++-------------------------------- 1 file changed, 7 insertions(+), 41 deletions(-) diff --git a/assets/js/sections/oqrs.js b/assets/js/sections/oqrs.js index 068fad66..683429dd 100644 --- a/assets/js/sections/oqrs.js +++ b/assets/js/sections/oqrs.js @@ -175,28 +175,6 @@ function submitOqrsRequest() { } } -function deleteOqrsLine(id) { - BootstrapDialog.confirm({ - title: 'DANGER', - message: 'Warning! Are you sure you want to delete this OQRS request?', - type: BootstrapDialog.TYPE_DANGER, - closable: true, - draggable: true, - btnOKClass: 'btn-danger', - callback: function (result) { - $.ajax({ - url: base_url+'index.php/oqrs/delete_oqrs_line', - type: 'post', - data: { 'id': id, - }, - success: function (data) { - $(".oqrsid_"+id).remove(); - } - }); - } - }); -} - function searchLog(callsign) { $.ajax({ url: base_url + 'index.php/oqrs/search_log', @@ -254,17 +232,6 @@ function searchLogTimeDate(id) { }); } -function markOqrsLineAsDone(id) { - $.ajax({ - url: base_url+'index.php/oqrs/mark_oqrs_line_as_done', - type: 'post', - data: { 'id': id, - }, - success: function (data) { - $(".oqrsid_"+id).remove(); - } - }); -} function loadOqrsTable(rows) { var uninitialized = $('.oqrstable').filter(function() { return !$.fn.DataTable.fnIsDataTable(this); @@ -400,14 +367,14 @@ $(document).ready(function () { callback: function(result) { if(result) { elements.each(function() { - let id = $(this).first().closest('tr').data('qsoID') + let id = $(this).first().closest('tr').data('oqrsID') $.ajax({ - url: base_url + 'index.php/oqrs/delete_ajax', + url: base_url + 'index.php/oqrs/delete_oqrs_line', type: 'post', data: {'id': id }, success: function(data) { - var row = $("#qsoID_" + id); + var row = $("#oqrsID_" + id); table.row(row).remove().draw(false); } }); @@ -431,7 +398,7 @@ $(document).ready(function () { BootstrapDialog.confirm({ title: 'DANGER', - message: 'Warning! Are you sure you want to delete the marked OQRS request(s)?' , + message: 'Warning! Are you sure you want to mark OQRS request(s) as done?' , type: BootstrapDialog.TYPE_DANGER, closable: true, draggable: true, @@ -439,15 +406,14 @@ $(document).ready(function () { callback: function(result) { if(result) { elements.each(function() { - let id = $(this).first().closest('tr').data('qsoID') + let id = $(this).first().closest('tr').data('oqrsID') $.ajax({ - url: base_url + 'index.php/oqrs/mark_ajax', + url: base_url + 'index.php/oqrs/mark_oqrs_line_as_done', type: 'post', data: {'id': id }, success: function(data) { - var row = $("#qsoID_" + id); - table.row(row).remove().draw(false); + $('#searchForm').submit(); } }); $('#markOqrs').prop("disabled", false); From 8695c528910ac0b4a6d4054cda25dc87d958361a Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 29 Dec 2022 17:59:41 +0100 Subject: [PATCH 4/9] Add user message to email --- application/controllers/Oqrs.php | 1 + application/views/email/oqrs_request.php | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/application/controllers/Oqrs.php b/application/controllers/Oqrs.php index 3500ad1d..66042f60 100644 --- a/application/controllers/Oqrs.php +++ b/application/controllers/Oqrs.php @@ -160,6 +160,7 @@ class Oqrs extends CI_Controller { } $data['callsign'] = $this->security->xss_clean($postdata['callsign']); + $data['usermessage'] = $this->security->xss_clean($postdata['message']); $message = $this->load->view('email/oqrs_request', $data, TRUE); diff --git a/application/views/email/oqrs_request.php b/application/views/email/oqrs_request.php index 1518fc85..b1e55fe3 100644 --- a/application/views/email/oqrs_request.php +++ b/application/views/email/oqrs_request.php @@ -1,8 +1,12 @@ Hi, -You got an OQRS request from . +You got an OQRS request from . +The user entered the following message: + + + Please log into your Cloudlog and process it. Regards, -Cloudlog. \ No newline at end of file +Cloudlog. From 93b1f847a3b8ed82d79be63f73d46bf5f403512a Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 29 Dec 2022 18:03:48 +0100 Subject: [PATCH 5/9] Add check for empty message --- application/views/email/oqrs_request.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/views/email/oqrs_request.php b/application/views/email/oqrs_request.php index b1e55fe3..c35ec6cc 100644 --- a/application/views/email/oqrs_request.php +++ b/application/views/email/oqrs_request.php @@ -1,9 +1,11 @@ Hi, You got an OQRS request from . + The user entered the following message: + Please log into your Cloudlog and process it. From 5ba33a020aa51c2dc9d287c573f296c614da366b Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 29 Dec 2022 18:10:51 +0100 Subject: [PATCH 6/9] Add reply to header --- application/controllers/Oqrs.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/controllers/Oqrs.php b/application/controllers/Oqrs.php index 66042f60..f7830889 100644 --- a/application/controllers/Oqrs.php +++ b/application/controllers/Oqrs.php @@ -166,6 +166,7 @@ class Oqrs extends CI_Controller { $this->email->from('noreply@cloudlog.co.uk', 'Cloudlog'); $this->email->to($email); + $this->email->reply_to($this->security->xss_clean($postdata['email']), strtoupper($data['callsign'])); $this->email->subject('Cloudlog OQRS from ' . strtoupper($data['callsign'])); $this->email->message($message); From 5e5d8ec6534909cdaa3bd55a486343f089d12f4c Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 29 Dec 2022 23:17:32 +0100 Subject: [PATCH 7/9] Add badge with number of OQRS requests --- application/models/Oqrs_model.php | 13 ++++++++++++- application/views/interface_assets/header.php | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/application/models/Oqrs_model.php b/application/models/Oqrs_model.php index 553f026d..ff8b4735 100644 --- a/application/models/Oqrs_model.php +++ b/application/models/Oqrs_model.php @@ -293,4 +293,15 @@ class Oqrs_model extends CI_Model { return $data->result('array'); } -} \ No newline at end of file + + public function oqrs_requests($location_list) { + if ($location_list != "") { + $sql = 'SELECT COUNT(*) AS number FROM oqrs JOIN station_profile ON oqrs.station_id = station_profile.station_id WHERE oqrs.station_id IN ('.$location_list.')'; + $query = $this->db->query($sql); + $row = $query->row(); + return $row->number; + } else { + return 0; + } + } +} diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index 6263f796..22b125ad 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -229,7 +229,18 @@ - OQRS Requests +load->model('oqrs_model'); +$CI->load->model('logbooks_model'); +$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); +if ($logbooks_locations_array) { + $location_list = "'".implode("','",$logbooks_locations_array)."'"; +} else { + $location_list = null; +} +?> + OQRS Requests oqrs_model->oqrs_requests($location_list) > 0) { echo "".$CI->oqrs_model->oqrs_requests($location_list).""; } ?> Print Requested QSLs From 49af108202f6df2d9f6983aa1a387917e74ba00f Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 29 Dec 2022 23:32:40 +0100 Subject: [PATCH 8/9] Adjust SQL to exlude done requests --- application/models/Oqrs_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Oqrs_model.php b/application/models/Oqrs_model.php index ff8b4735..c18f15b4 100644 --- a/application/models/Oqrs_model.php +++ b/application/models/Oqrs_model.php @@ -296,7 +296,7 @@ class Oqrs_model extends CI_Model { public function oqrs_requests($location_list) { if ($location_list != "") { - $sql = 'SELECT COUNT(*) AS number FROM oqrs JOIN station_profile ON oqrs.station_id = station_profile.station_id WHERE oqrs.station_id IN ('.$location_list.')'; + $sql = 'SELECT COUNT(*) AS number FROM oqrs JOIN station_profile ON oqrs.station_id = station_profile.station_id WHERE oqrs.station_id IN ('.$location_list.') AND status < 2'; $query = $this->db->query($sql); $row = $query->row(); return $row->number; From 83ae7f3bd449d631be2bdb031c4123bf7496b0f0 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Fri, 30 Dec 2022 10:11:38 +0100 Subject: [PATCH 9/9] [OQRS] Fixed search not showing all QSOs --- application/models/Oqrs_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Oqrs_model.php b/application/models/Oqrs_model.php index c18f15b4..0cc87564 100644 --- a/application/models/Oqrs_model.php +++ b/application/models/Oqrs_model.php @@ -50,7 +50,7 @@ class Oqrs_model extends CI_Model { $callsign = $this->security->xss_clean($callsign); $sql = 'select lower(col_mode) col_mode, coalesce(col_submode, "") col_submode, col_band from ' . $this->config->item('table_name') . ' where station_id = ' . $station_id . ' and col_call ="' . $callsign . '" and col_prop_mode != "SAT"'; - $sql .= ' union select lower(col_mode) col_mode, coalesce(col_submode, "") col_submode, "SAT" col_band from ' . $this->config->item('table_name') . ' where station_id = ' . $station_id . ' and col_call ="' . $callsign . '" and col_prop_mode = "SAT"'; + $sql .= ' union all select lower(col_mode) col_mode, coalesce(col_submode, "") col_submode, "SAT" col_band from ' . $this->config->item('table_name') . ' where station_id = ' . $station_id . ' and col_call ="' . $callsign . '" and col_prop_mode = "SAT"'; $query = $this->db->query($sql);