From 5afdbda357d79a83eecd837433faf024e5762710 Mon Sep 17 00:00:00 2001 From: phl0 Date: Sun, 6 Feb 2022 16:17:21 +0100 Subject: [PATCH] Implement table results view for activated grids --- application/models/Activated_grids_model.php | 19 +++++++++---------- application/models/Logbook_model.php | 3 +++ application/views/activated_grids/index.php | 2 +- application/views/interface_assets/footer.php | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/application/models/Activated_grids_model.php b/application/models/Activated_grids_model.php index 570ffbcb8..811fd9f39 100644 --- a/application/models/Activated_grids_model.php +++ b/application/models/Activated_grids_model.php @@ -12,7 +12,7 @@ class Activated_grids_model extends CI_Model { } $this->db->select('distinct substring(COL_MY_GRIDSQUARE,1,6) as SAT_SQUARE, COL_SAT_NAME', FALSE); -// $this->db->where_in('station_id', $logbooks_locations_array); + $this->db->where_in('station_id', $logbooks_locations_array); $this->db->where('COL_MY_GRIDSQUARE !=', ''); $this->db->where('COL_SAT_NAME !=', ''); @@ -32,8 +32,7 @@ class Activated_grids_model extends CI_Model { $sql = 'SELECT distinct substring(COL_MY_GRIDSQUARE,1,6) as SAT_SQUARE, COL_SAT_NAME FROM ' . $this->config->item('table_name') - . ' WHERE COL_MY_GRIDSQUARE != "" AND COL_SAT_NAME != "" AND (COL_LOTW_QSL_SENT = "Y" OR COL_QSL_SENT = "Y")'; - // . ' WHERE station_id in (' . $location_list . ') AND COL_MY_GRIDSQUARE != "" AND COL_SAT_NAME != "" AND (COL_LOTW_QSL_SENT = "Y" OR COL_QSL_SENT = "Y")'; + . ' WHERE station_id in (' . $location_list . ') AND COL_MY_GRIDSQUARE != "" AND COL_SAT_NAME != "" AND (COL_LOTW_QSL_SENT = "Y" OR COL_QSL_SENT = "Y")'; return $this->db->query($sql); } @@ -82,9 +81,9 @@ class Activated_grids_model extends CI_Model { return null; } - $this->db->select('distinct substring(COL_GRIDSQUARE,1,6) as GRID_SQUARES, COL_BAND', FALSE); + $this->db->select('distinct substring(COL_MY_GRIDSQUARE,1,6) as GRID_SQUARES, COL_BAND', FALSE); $this->db->where_in('station_id', $logbooks_locations_array); - $this->db->where('COL_GRIDSQUARE !=', ''); + $this->db->where('COL_MY_GRIDSQUARE !=', ''); if ($band != 'All') { $this->db->where('COL_BAND', $band); @@ -109,10 +108,10 @@ class Activated_grids_model extends CI_Model { $location_list = "'".implode("','",$logbooks_locations_array)."'"; - $sql = 'SELECT distinct substring(COL_GRIDSQUARE,1,6) as GRID_SQUARES, COL_BAND FROM ' + $sql = 'SELECT distinct substring(COL_MY_GRIDSQUARE,1,6) as GRID_SQUARES, COL_BAND FROM ' .$this->config->item('table_name') .' WHERE station_id in (' - .$location_list.') AND COL_GRIDSQUARE != ""'; + .$location_list.') AND COL_MY_GRIDSQUARE != ""'; if ($band != 'All') { $sql .= ' AND COL_BAND = "' . $band .'" @@ -123,7 +122,7 @@ class Activated_grids_model extends CI_Model { AND COL_SAT_NAME = ""'; } - $sql .= ' AND (COL_LOTW_QSL_RCVD = "Y" OR COL_QSL_RCVD = "Y")'; + $sql .= ' AND (COL_LOTW_QSL_SENT = "Y" OR COL_QSL_SENT = "Y")'; return $this->db->query($sql); } @@ -138,7 +137,7 @@ class Activated_grids_model extends CI_Model { $sql = 'SELECT COL_CALL, COL_TIME_ON, COL_BAND, COL_MODE, COL_GRIDSQUARE, COL_VUCC_GRIDS FROM ' .$this->config->item('table_name') .' WHERE station_id IN (' . $location_list . ') ' - . ' AND (COL_GRIDSQUARE LIKE "%'.$gridsquare.'%" or COL_VUCC_GRIDS LIKE "%'.$gridsquare.'%")'; + . ' AND (COL_MY_GRIDSQUARE LIKE "%'.$gridsquare.'%")'; if ($band != 'All') { $sql .= ' AND COL_BAND = "' . $band @@ -166,7 +165,7 @@ class Activated_grids_model extends CI_Model { $sql = 'SELECT COL_CALL, COL_TIME_ON, COL_BAND, COL_MODE, COL_SAT_NAME, COL_GRIDSQUARE, COL_VUCC_GRIDS FROM ' . $this->config->item('table_name'). ' WHERE station_id IN ('.$location_list. ')' . - ' AND (COL_GRIDSQUARE LIKE "%'.$gridsquare.'%" or COL_VUCC_GRIDS LIKE "%'.$gridsquare.'%")'. + ' AND (COL_MY_GRIDSQUARE LIKE "%'.$gridsquare.'%")'. ' AND COL_PROP_MODE = "SAT"'; $result = $this->db->query($sql); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index b6a5a454c..f5d53b231 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -270,6 +270,9 @@ class Logbook_model extends CI_Model { case 'VUCC': $this->db->where("(COL_GRIDSQUARE like '%" . $searchphrase . "%' OR COL_VUCC_GRIDS like'%" . $searchphrase ."%')"); break; + case 'GridActivator': + $this->db->where("(COL_MY_GRIDSQUARE like '%" . $searchphrase . "%')"); + break; case 'CQZone': $this->db->where('COL_CQZ', $searchphrase); break; diff --git a/application/views/activated_grids/index.php b/application/views/activated_grids/index.php index 5f344cb8e..a48105ac3 100644 --- a/application/views/activated_grids/index.php +++ b/application/views/activated_grids/index.php @@ -41,7 +41,7 @@