From 803b0d06bdfcf1c1659aaeadc1e64561f68c4c8b Mon Sep 17 00:00:00 2001 From: HB9HIL <80885850+HB9HIL@users.noreply.github.com> Date: Wed, 4 Oct 2023 10:40:18 +0200 Subject: [PATCH] Add new Filter --- application/controllers/Logbookadvanced.php | 2 +- application/models/Logbookadvanced_model.php | 10 +++++++++- application/views/logbookadvanced/index.php | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index 617b8bbc..b099ab13 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -454,4 +454,4 @@ class Logbookadvanced extends CI_Controller { $this->load->model('user_options_model'); $this->user_options_model->set_option('LogbookAdvanced', 'LogbookAdvanced', $obj); } -} +} \ No newline at end of file diff --git a/application/models/Logbookadvanced_model.php b/application/models/Logbookadvanced_model.php index 1b892e77..8c46f95a 100644 --- a/application/models/Logbookadvanced_model.php +++ b/application/models/Logbookadvanced_model.php @@ -64,11 +64,19 @@ class Logbookadvanced_model extends CI_Model { } if ($searchCriteria['qslSentMethod'] !== '') { $condition = "COL_QSL_SENT_VIA = ?"; + if ($searchCriteria['qslSentMethod'] == 'N') { + $condition = '('.$condition; + $condition .= " OR COL_QSL_SENT_VIA OR COL_QSL_SENT_VIA = '')"; + } $conditions[] = $condition; $binding[] = $searchCriteria['qslSentMethod']; } if ($searchCriteria['qslReceivedMethod'] !== '') { $condition = "COL_QSL_RECV_VIA = ?"; + if ($searchCriteria['qslReceivedMethod'] == 'N') { + $condition = '('.$condition; + $condition .= " OR COL_QSL_RECV_VIA OR COL_QSL_RECV_VIA = '')"; + } $conditions[] = $condition; $binding[] = $searchCriteria['qslReceivedMethod']; } @@ -438,4 +446,4 @@ class Logbookadvanced_model extends CI_Model { return $this->db->get()->result(); } -} +} \ No newline at end of file diff --git a/application/views/logbookadvanced/index.php b/application/views/logbookadvanced/index.php index 8b68b98e..fdc32c01 100644 --- a/application/views/logbookadvanced/index.php +++ b/application/views/logbookadvanced/index.php @@ -471,4 +471,4 @@ $options = json_decode($options);
- + \ No newline at end of file