From 12127b8d855d6b238bbfb0fe0a56be75a38b64dd Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Mon, 11 Aug 2025 15:12:14 +0100 Subject: [PATCH] Fix DXCC country matching case sensitivity Updated SQL queries in Workabledxcc controller and model to use case-insensitive matching for DXCC country names by comparing UPPER(COL_COUNTRY) to UPPER(?). This resolves issues where country names with different cases were not matched correctly. --- application/controllers/Workabledxcc.php | 6 ++++-- application/models/Workabledxcc_model.php | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/application/controllers/Workabledxcc.php b/application/controllers/Workabledxcc.php index 3654004c..8f580221 100644 --- a/application/controllers/Workabledxcc.php +++ b/application/controllers/Workabledxcc.php @@ -104,7 +104,8 @@ class Workabledxcc extends CI_Controller $this->db->where('COL_PROP_MODE !=', 'SAT'); $this->db->where_in('station_id', $logbooks_locations_array); - $this->db->where('COL_COUNTRY', urldecode($country)); + // Fix case sensitivity issue for DXCC country matching + $this->db->where('UPPER(COL_COUNTRY) = UPPER(?)', urldecode($country)); $query = $this->db->get($this->config->item('table_name'), 1, 0); foreach ($query->result() as $workedBeforeRow) { @@ -146,7 +147,8 @@ class Workabledxcc extends CI_Controller $this->db->where_in('station_id', $logbooks_locations_array); - $this->db->where('COL_COUNTRY', urldecode($country)); + // Fix case sensitivity issue for DXCC country matching + $this->db->where('UPPER(COL_COUNTRY) = UPPER(?)', urldecode($country)); $query = $this->db->get($this->config->item('table_name'), 1, 0); foreach ($query->result() as $workedBeforeRow) { diff --git a/application/models/Workabledxcc_model.php b/application/models/Workabledxcc_model.php index b7fb8359..dd2601a5 100644 --- a/application/models/Workabledxcc_model.php +++ b/application/models/Workabledxcc_model.php @@ -271,7 +271,8 @@ class Workabledxcc_model extends CI_Model $this->db->where('COL_PROP_MODE !=', 'SAT'); $this->db->where_in('station_id', $logbooks_locations_array); - $this->db->where('COL_COUNTRY', urldecode($country)); + // Fix case sensitivity issue for DXCC country matching + $this->db->where('UPPER(COL_COUNTRY) = UPPER(?)', urldecode($country)); $query = $this->db->get($this->config->item('table_name'), 1, 0); foreach ($query->result() as $workedBeforeRow) { @@ -313,7 +314,8 @@ class Workabledxcc_model extends CI_Model $this->db->where_in('station_id', $logbooks_locations_array); - $this->db->where('COL_COUNTRY', urldecode($country)); + // Fix case sensitivity issue for DXCC country matching + $this->db->where('UPPER(COL_COUNTRY) = UPPER(?)', urldecode($country)); $query = $this->db->get($this->config->item('table_name'), 1, 0); foreach ($query->result() as $workedBeforeRow) {