From 0ecc5de833b388e50a5b0cefe975d49d56cd6d1c Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 18 Feb 2023 09:58:54 +0100 Subject: [PATCH] [DXCC summary] Fix for bands that are not active --- application/controllers/Lookup.php | 2 +- application/models/Lookup_model.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/application/controllers/Lookup.php b/application/controllers/Lookup.php index f2e0dfa8..fe6597cd 100644 --- a/application/controllers/Lookup.php +++ b/application/controllers/Lookup.php @@ -36,7 +36,7 @@ class Lookup extends CI_Controller { $this->load->model('lookup_model'); $this->load->model('bands'); - $data['bands'] = $this->bands->get_worked_bands(); + $data['bands'] = $this->bands->get_worked_bands('dxcc'); $data['type'] = xss_clean($this->input->post('type')); $data['dxcc'] = xss_clean($this->input->post('dxcc')); diff --git a/application/models/Lookup_model.php b/application/models/Lookup_model.php index d87747a8..0f3f5cea 100644 --- a/application/models/Lookup_model.php +++ b/application/models/Lookup_model.php @@ -19,13 +19,17 @@ class Lookup_model extends CI_Model{ // Populating array with worked band/mode combinations $worked = $this->getQueryData($queryinfo, 'worked'); foreach ($worked as $w) { - $resultArray[$w->col_mode][$w->col_band] = 'W'; + if(in_array($w->col_band, $queryinfo['bands'])) { + $resultArray[$w->col_mode][$w->col_band] = 'W'; + } } // Populating array with confirmed band/mode combinations $confirmed = $this->getQueryData($queryinfo, 'confirmed'); foreach ($confirmed as $c) { - $resultArray[$c->col_mode][$c->col_band] = 'C'; + if(in_array($c->col_band, $queryinfo['bands'])) { + $resultArray[$c->col_mode][$c->col_band] = 'C'; + } } return $resultArray;