From 4b2bb08f8ffa2131d33e95f35a239422852cbd6c Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 26 Sep 2019 20:31:16 +0100 Subject: [PATCH] Only return whether a gridsquares been worked for the active station profile. --- application/controllers/Logbook.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index b1bf28c0..f69b1484 100755 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -162,6 +162,12 @@ class Logbook extends CI_Controller { } + + $CI =& get_instance(); + $CI->load->model('Stations'); + $station_id = $CI->Stations->find_active(); + + $this->db->where('station_id', $station_id); $this->db->like('SUBSTRING(COL_GRIDSQUARE, 1, 4)', substr($gridsquare, 0, 4)); $query = $this->db->get($this->config->item('table_name'), 1, 0); foreach ($query->result() as $workedBeforeRow) @@ -191,7 +197,12 @@ class Logbook extends CI_Controller { $this->db->where('COL_PROP_MODE !=','SAT'); } + $CI =& get_instance(); + $CI->load->model('Stations'); + $station_id = $CI->Stations->find_active(); + $this->db->where('station_id', $station_id); + $this->db->like('SUBSTRING(COL_GRIDSQUARE, 1, 4)', substr($gridsquare, 0, 4)); $query = $this->db->get($this->config->item('table_name'), 1, 0); foreach ($query->result() as $workedBeforeRow)