From 4b1b5c4d62d14ee3bf86728fa7f1f58a5b9f027c Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sun, 5 May 2024 23:10:02 +0200 Subject: [PATCH 1/4] prop mode --- application/controllers/Activated_gridmap.php | 9 +- application/controllers/Awards.php | 6 +- application/controllers/Gridmap.php | 9 +- .../models/Activated_gridmap_model.php | 158 +++++----- application/models/Gridmap_model.php | 158 +++++----- application/models/Logbook_model.php | 5 +- application/views/gridmap/index.php | 269 ++++++++++-------- assets/js/sections/gridmap.js | 4 + 8 files changed, 353 insertions(+), 265 deletions(-) diff --git a/application/controllers/Activated_gridmap.php b/application/controllers/Activated_gridmap.php index 8b8c2d4b0..34945a730 100644 --- a/application/controllers/Activated_gridmap.php +++ b/application/controllers/Activated_gridmap.php @@ -54,6 +54,7 @@ class Activated_gridmap extends CI_Controller { $qrz = $this->security->xss_clean($this->input->post('qrz')); $sat = $this->security->xss_clean($this->input->post('sat')); $orbit = $this->security->xss_clean($this->input->post('orbit')); + $propagation = $this->security->xss_clean($this->input->post('propagation')); $this->load->model('activated_gridmap_model'); $array_grid_2char = array(); @@ -72,7 +73,7 @@ class Activated_gridmap extends CI_Controller { $grid_4char_confirmed = ""; $grid_6char_confirmed = ""; - $query = $this->activated_gridmap_model->get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit); + $query = $this->activated_gridmap_model->get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation); if ($query && $query->num_rows() > 0) { foreach ($query->result() as $row) { @@ -102,7 +103,7 @@ class Activated_gridmap extends CI_Controller { } } - $query = $this->activated_gridmap_model->get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit); + $query = $this->activated_gridmap_model->get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation); if ($query && $query->num_rows() > 0) { foreach ($query->result() as $row) { @@ -132,7 +133,7 @@ class Activated_gridmap extends CI_Controller { } } } - $query_vucc = $this->activated_gridmap_model->get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit); + $query_vucc = $this->activated_gridmap_model->get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation); if ($query_vucc && $query_vucc->num_rows() > 0) { foreach ($query_vucc->result() as $row) { @@ -157,7 +158,7 @@ class Activated_gridmap extends CI_Controller { } // // Confirmed Squares - $query_vucc = $this->activated_gridmap_model->get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit); + $query_vucc = $this->activated_gridmap_model->get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation); if ($query_vucc && $query_vucc->num_rows() > 0) { foreach ($query_vucc->result() as $row) { diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 52f4815e9..8a73292cb 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -419,10 +419,11 @@ class Awards extends CI_Controller { $mode = str_replace('"', "", $this->security->xss_clean($this->input->post("Mode"))); $sat = str_replace('"', "", $this->security->xss_clean($this->input->post("Sat"))); $orbit = str_replace('"', "", $this->security->xss_clean($this->input->post("Orbit"))); + $propagation = str_replace('"', "", $this->security->xss_clean($this->input->post("Propagation")) ?? ''); $type = $this->security->xss_clean($this->input->post('Type')); $qsl = $this->input->post('QSL') == null ? '' : $this->security->xss_clean($this->input->post('QSL')); $searchmode = $this->input->post('searchmode') == null ? '' : $this->security->xss_clean($this->input->post('searchmode')); - $data['results'] = $this->logbook_model->qso_details($searchphrase, $band, $mode, $type, $qsl, $sat, $orbit, $searchmode); + $data['results'] = $this->logbook_model->qso_details($searchphrase, $band, $mode, $type, $qsl, $sat, $orbit, $searchmode, $propagation); // This is done because we have two different ways to get dxcc info in Wavelog. Once is using the name (in awards), and the other one is using the ADIF DXCC. // We replace the values to make it look a bit nicer @@ -457,6 +458,9 @@ class Awards extends CI_Controller { $data['filter'] .= " and orbit type ".$orbit; } } + if ($propagation != '' && $propagation != null) { + $data['filter'] .= " and propagation ".$propagation; + } if ($mode != null && strtolower($mode) != 'all') { $data['filter'] .= " and mode ".$mode; } diff --git a/application/controllers/Gridmap.php b/application/controllers/Gridmap.php index c32155fb2..9d41c360f 100644 --- a/application/controllers/Gridmap.php +++ b/application/controllers/Gridmap.php @@ -54,6 +54,7 @@ class Gridmap extends CI_Controller { $qrz = $this->security->xss_clean($this->input->post('qrz')); $sat = $this->security->xss_clean($this->input->post('sat')); $orbit = $this->security->xss_clean($this->input->post('orbit')); + $propagation = $this->security->xss_clean($this->input->post('propagation')); $this->load->model('gridmap_model'); $array_grid_2char = array(); @@ -72,7 +73,7 @@ class Gridmap extends CI_Controller { $grid_4char_confirmed = ""; $grid_6char_confirmed = ""; - $query = $this->gridmap_model->get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit); + $query = $this->gridmap_model->get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation); if ($query && $query->num_rows() > 0) { foreach ($query->result() as $row) { @@ -99,7 +100,7 @@ class Gridmap extends CI_Controller { } } - $query = $this->gridmap_model->get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit); + $query = $this->gridmap_model->get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation); if ($query && $query->num_rows() > 0) { foreach ($query->result() as $row) { @@ -126,7 +127,7 @@ class Gridmap extends CI_Controller { } } } - $query_vucc = $this->gridmap_model->get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit); + $query_vucc = $this->gridmap_model->get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation); if ($query_vucc && $query_vucc->num_rows() > 0) { foreach ($query_vucc->result() as $row) { @@ -151,7 +152,7 @@ class Gridmap extends CI_Controller { } // // Confirmed Squares - $query_vucc = $this->gridmap_model->get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit); + $query_vucc = $this->gridmap_model->get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation); if ($query_vucc && $query_vucc->num_rows() > 0) { foreach ($query_vucc->result() as $row) { diff --git a/application/models/Activated_gridmap_model.php b/application/models/Activated_gridmap_model.php index c24c788df..53f2cfc34 100644 --- a/application/models/Activated_gridmap_model.php +++ b/application/models/Activated_gridmap_model.php @@ -2,10 +2,10 @@ class Activated_gridmap_model extends CI_Model { - function get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit) { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + function get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation) { + + $this->load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); if (!$logbooks_locations_array) { return null; @@ -20,20 +20,24 @@ class Activated_gridmap_model extends CI_Model { . 'AND station_profile.station_id in ('.$location_list.')'; if ($band != 'All') { - if ($band == 'SAT') { - $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { - $sql .= " and col_sat_name ='" . $sat . "'"; - } - } else { - $sql .= " and col_prop_mode !='SAT'"; - $sql .= " and col_band ='" . $band . "'"; - } - } + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + if ($sat != 'All') { + $sql .= " and col_sat_name ='" . $sat . "'"; + } + } else { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + $sql .= " and col_band ='" . $band . "'"; + } + } else { + if ($propagation != '') { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + } + } - if ($mode != 'All') { - $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; - } + if ($mode != 'All') { + $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; + } $sql .= $this->addOrbitToQuery($orbit); @@ -41,10 +45,10 @@ class Activated_gridmap_model extends CI_Model { return $this->db->query($sql); } - function get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit) { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + function get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation) { + + $this->load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); if (!$logbooks_locations_array) { return null; @@ -59,30 +63,34 @@ class Activated_gridmap_model extends CI_Model { . 'AND station_profile.station_id in ('.$location_list.')'; if ($band != 'All') { - if ($band == 'SAT') { - $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { - $sql .= " and col_sat_name ='" . $sat . "'"; - } - } else { - $sql .= " and col_prop_mode !='SAT'"; - $sql .= " and col_band ='" . $band . "'"; - } - } + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + if ($sat != 'All') { + $sql .= " and col_sat_name ='" . $sat . "'"; + } + } else { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + $sql .= " and col_band ='" . $band . "'"; + } + } else { + if ($propagation != '') { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + } + } - if ($mode != 'All') { - $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; - } + if ($mode != 'All') { + $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; + } $sql .= $this->addOrbitToQuery($orbit); return $this->db->query($sql); } - function get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit) { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + function get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation) { + + $this->load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); if (!$logbooks_locations_array) { return null; @@ -97,20 +105,24 @@ class Activated_gridmap_model extends CI_Model { .$location_list.') AND COL_VUCC_GRIDS != ""'; if ($band != 'All') { - if ($band == 'SAT') { - $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { - $sql .= " and col_sat_name ='" . $sat . "'"; - } - } else { - $sql .= " and col_prop_mode !='SAT'"; - $sql .= " and col_band ='" . $band . "'"; - } - } + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + if ($sat != 'All') { + $sql .= " and col_sat_name ='" . $sat . "'"; + } + } else { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + $sql .= " and col_band ='" . $band . "'"; + } + } else { + if ($propagation != '') { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + } + } - if ($mode != 'All') { - $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; - } + if ($mode != 'All') { + $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; + } $sql .= $this->addOrbitToQuery($orbit); @@ -118,10 +130,10 @@ class Activated_gridmap_model extends CI_Model { return $this->db->query($sql); } - function get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit) { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + function get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation) { + + $this->load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); if (!$logbooks_locations_array) { return null; @@ -136,20 +148,24 @@ class Activated_gridmap_model extends CI_Model { .$location_list.') AND COL_VUCC_GRIDS != ""'; if ($band != 'All') { - if ($band == 'SAT') { - $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { - $sql .= " and col_sat_name ='" . $sat . "'"; - } - } else { - $sql .= " and col_prop_mode !='SAT'"; - $sql .= " and col_band ='" . $band . "'"; - } - } + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + if ($sat != 'All') { + $sql .= " and col_sat_name ='" . $sat . "'"; + } + } else { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + $sql .= " and col_band ='" . $band . "'"; + } + } else { + if ($propagation != '') { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + } + } - if ($mode != 'All') { - $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; - } + if ($mode != 'All') { + $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; + } $sql .= $this->addOrbitToQuery($orbit); @@ -197,9 +213,9 @@ class Activated_gridmap_model extends CI_Model { * Get's the worked modes from the log */ function get_worked_modes() { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + $this->load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); if (!$logbooks_locations_array) { return null; diff --git a/application/models/Gridmap_model.php b/application/models/Gridmap_model.php index 310754f83..ee5a5a1df 100644 --- a/application/models/Gridmap_model.php +++ b/application/models/Gridmap_model.php @@ -2,11 +2,11 @@ class Gridmap_model extends CI_Model { - function get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $logbooks_locations_array = NULL) { + function get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $logbooks_locations_array = NULL) { if ($logbooks_locations_array == NULL) { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + $this->load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); } if (!$logbooks_locations_array) { @@ -22,20 +22,24 @@ class Gridmap_model extends CI_Model { .$location_list.') AND COL_GRIDSQUARE != ""'; if ($band != 'All') { - if ($band == 'SAT') { - $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { - $sql .= " and col_sat_name ='" . $sat . "'"; - } - } else { - $sql .= " and col_prop_mode !='SAT'"; - $sql .= " and col_band ='" . $band . "'"; - } - } + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + if ($sat != 'All') { + $sql .= " and col_sat_name ='" . $sat . "'"; + } + } else { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + $sql .= " and col_band ='" . $band . "'"; + } + } else { + if ($propagation != '') { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + } + } - if ($mode != 'All') { - $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; - } + if ($mode != 'All') { + $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; + } $sql .= $this->addOrbitToQuery($orbit); @@ -44,11 +48,11 @@ class Gridmap_model extends CI_Model { return $this->db->query($sql); } - function get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $logbooks_locations_array = NULL) { + function get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $logbooks_locations_array = NULL) { if ($logbooks_locations_array == NULL) { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + $this->load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); } if (!$logbooks_locations_array) { @@ -64,31 +68,35 @@ class Gridmap_model extends CI_Model { .$location_list.') AND COL_GRIDSQUARE != ""'; if ($band != 'All') { - if ($band == 'SAT') { - $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { - $sql .= " and col_sat_name ='" . $sat . "'"; - } - } else { - $sql .= " and col_prop_mode !='SAT'"; - $sql .= " and col_band ='" . $band . "'"; - } - } + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + if ($sat != 'All') { + $sql .= " and col_sat_name ='" . $sat . "'"; + } + } else { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + $sql .= " and col_band ='" . $band . "'"; + } + } else { + if ($propagation != '') { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + } + } - if ($mode != 'All') { - $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; - } + if ($mode != 'All') { + $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; + } $sql .= $this->addOrbitToQuery($orbit); return $this->db->query($sql); } - function get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $logbooks_locations_array = NULL) { + function get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $logbooks_locations_array = NULL) { if ($logbooks_locations_array == NULL) { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + $this->load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); } if (!$logbooks_locations_array) { @@ -104,31 +112,35 @@ class Gridmap_model extends CI_Model { .$location_list.') AND COL_VUCC_GRIDS != ""'; if ($band != 'All') { - if ($band == 'SAT') { - $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { - $sql .= " and col_sat_name ='" . $sat . "'"; - } - } else { - $sql .= " and col_prop_mode !='SAT'"; - $sql .= " and col_band ='" . $band . "'"; - } - } + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + if ($sat != 'All') { + $sql .= " and col_sat_name ='" . $sat . "'"; + } + } else { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + $sql .= " and col_band ='" . $band . "'"; + } + } else { + if ($propagation != '') { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + } + } - if ($mode != 'All') { - $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; - } + if ($mode != 'All') { + $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; + } $sql .= $this->addOrbitToQuery($orbit); return $this->db->query($sql); } - function get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $logbooks_locations_array = NULL) { + function get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $logbooks_locations_array = NULL) { if ($logbooks_locations_array == NULL) { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + $this->load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); } if (!$logbooks_locations_array) { @@ -145,20 +157,24 @@ class Gridmap_model extends CI_Model { .$location_list.') AND COL_VUCC_GRIDS != ""'; if ($band != 'All') { - if ($band == 'SAT') { - $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { - $sql .= " and col_sat_name ='" . $sat . "'"; - } - } else { - $sql .= " and col_prop_mode !='SAT'"; - $sql .= " and col_band ='" . $band . "'"; - } - } + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + if ($sat != 'All') { + $sql .= " and col_sat_name ='" . $sat . "'"; + } + } else { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + $sql .= " and col_band ='" . $band . "'"; + } + } else { + if ($propagation != '') { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + } + } - if ($mode != 'All') { - $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; - } + if ($mode != 'All') { + $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; + } $sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $qrz); @@ -211,9 +227,9 @@ class Gridmap_model extends CI_Model { * Get's the worked modes from the log */ function get_worked_modes() { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + $this->load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); if (!$logbooks_locations_array) { return null; diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 958a5b2f0..c71df2b99 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -389,7 +389,7 @@ class Logbook_model extends CI_Model { /* * Used to fetch QSOs from the logbook in the awards */ - public function qso_details($searchphrase, $band, $mode, $type, $qsl, $sat = null, $orbit = null, $searchmode = null){ + public function qso_details($searchphrase, $band, $mode, $type, $qsl, $sat = null, $orbit = null, $searchmode = null, $propagation = null){ $this->load->model('logbooks_model'); $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); @@ -446,6 +446,9 @@ class Logbook_model extends CI_Model { $this->db->where("satellite.orbit = '$orbit'"); } } + if ($propagation != '' && $propagation != null) { + $this->db->where("COL_PROP_MODE = '$propagation'"); + } } break; case 'CQZone': diff --git a/application/views/gridmap/index.php b/application/views/gridmap/index.php index 532c9a8d0..a5be24728 100644 --- a/application/views/gridmap/index.php +++ b/application/views/gridmap/index.php @@ -1,135 +1,178 @@
-
+
-

+

- -
- - - - - - - - - - - - - -
-
- '; ?> - -
-
- '; ?> - -
-
- '; ?> - -
-
- '; ?> - -
+ + +
+ +
+
- - - - + + +
style="display: none;" > + +
+ + + - session->flashdata('message')) { ?> - -
-

session->flashdata('message'); ?>

-
- + +
+ +
+ +
+
+ +
+ +
+ +
+ +
+
+ +
+ +
+
+
+ '; ?> + +
+
+ '; ?> + +
+
+ '; ?> + +
+
+ '; ?> + +
+
+
+
+ + + + + + session->flashdata('message')) { ?> + +
+

session->flashdata('message'); ?>

+
+
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ ?> + \ No newline at end of file diff --git a/assets/js/sections/gridmap.js b/assets/js/sections/gridmap.js index 521c6da0d..78b3b8cc2 100644 --- a/assets/js/sections/gridmap.js +++ b/assets/js/sections/gridmap.js @@ -9,11 +9,13 @@ $('#band').change(function(){ $("#orbits").hide(); $("#satslabel").hide(); $("#orbitslabel").hide(); + $('#propagation').val('').prop('disabled', false); } else { $("#sats").show(); $("#orbits").show(); $("#orbitslabel").show(); $("#satslabel").show(); + $('#propagation').val('SAT').prop('disabled', true); } }); @@ -62,6 +64,7 @@ function gridPlot(form, visitor=true) { qrz: $("#qrz").is(":checked"), sat: $("#sats").val(), orbit: $("#orbits").val(), + propagation: $('#propagation').val() }, success: function (data) { $('.cohidden').show(); @@ -142,6 +145,7 @@ function spawnGridsquareModal(loc_4char) { 'Mode': $("#mode").val(), 'Sat': $("#sats").val(), 'Orbit': $("#orbits").val(), + 'Propagation': $('#propagation').val(), 'Type': 'VUCC' }) if (type == 'activated') { From 3eb099646a21c5dc54a3f13ca8276d0593d55cd7 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Mon, 6 May 2024 19:42:24 +0200 Subject: [PATCH 2/4] bugfix --- application/models/Activated_gridmap_model.php | 8 ++++---- application/models/Gridmap_model.php | 8 ++++---- application/views/gridmap/index.php | 4 ++-- assets/js/sections/gridmap.js | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/application/models/Activated_gridmap_model.php b/application/models/Activated_gridmap_model.php index 53f2cfc34..89ad55257 100644 --- a/application/models/Activated_gridmap_model.php +++ b/application/models/Activated_gridmap_model.php @@ -22,7 +22,7 @@ class Activated_gridmap_model extends CI_Model { if ($band != 'All') { if ($band == 'SAT') { $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { + if ($sat != 'All' && $sat != '') { $sql .= " and col_sat_name ='" . $sat . "'"; } } else { @@ -65,7 +65,7 @@ class Activated_gridmap_model extends CI_Model { if ($band != 'All') { if ($band == 'SAT') { $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { + if ($sat != 'All' && $sat != '') { $sql .= " and col_sat_name ='" . $sat . "'"; } } else { @@ -107,7 +107,7 @@ class Activated_gridmap_model extends CI_Model { if ($band != 'All') { if ($band == 'SAT') { $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { + if ($sat != 'All' && $sat != '') { $sql .= " and col_sat_name ='" . $sat . "'"; } } else { @@ -150,7 +150,7 @@ class Activated_gridmap_model extends CI_Model { if ($band != 'All') { if ($band == 'SAT') { $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { + if ($sat != 'All' && $sat != '') { $sql .= " and col_sat_name ='" . $sat . "'"; } } else { diff --git a/application/models/Gridmap_model.php b/application/models/Gridmap_model.php index ee5a5a1df..cb50f1dc4 100644 --- a/application/models/Gridmap_model.php +++ b/application/models/Gridmap_model.php @@ -24,7 +24,7 @@ class Gridmap_model extends CI_Model { if ($band != 'All') { if ($band == 'SAT') { $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { + if ($sat != 'All' && $sat != '') { $sql .= " and col_sat_name ='" . $sat . "'"; } } else { @@ -70,7 +70,7 @@ class Gridmap_model extends CI_Model { if ($band != 'All') { if ($band == 'SAT') { $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { + if ($sat != 'All' && $sat != '') { $sql .= " and col_sat_name ='" . $sat . "'"; } } else { @@ -114,7 +114,7 @@ class Gridmap_model extends CI_Model { if ($band != 'All') { if ($band == 'SAT') { $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { + if ($sat != 'All' && $sat != '') { $sql .= " and col_sat_name ='" . $sat . "'"; } } else { @@ -159,7 +159,7 @@ class Gridmap_model extends CI_Model { if ($band != 'All') { if ($band == 'SAT') { $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { + if ($sat != 'All' && $sat != '') { $sql .= " and col_sat_name ='" . $sat . "'"; } } else { diff --git a/application/views/gridmap/index.php b/application/views/gridmap/index.php index a5be24728..655d7e095 100644 --- a/application/views/gridmap/index.php +++ b/application/views/gridmap/index.php @@ -23,8 +23,8 @@ -
style="display: none;" > - ' . $sat . '' . "\n"; diff --git a/assets/js/sections/gridmap.js b/assets/js/sections/gridmap.js index 78b3b8cc2..a7e4b883f 100644 --- a/assets/js/sections/gridmap.js +++ b/assets/js/sections/gridmap.js @@ -3,15 +3,15 @@ var modalloading=false; $('#band').change(function(){ var band = $("#band option:selected").text(); if (band != "SAT") { - $("#sats").val('All'); + $("#sat").val('All'); $("#orbits").val('All'); - $("#sats").hide(); + $("#sats_div").hide(); $("#orbits").hide(); $("#satslabel").hide(); $("#orbitslabel").hide(); $('#propagation').val('').prop('disabled', false); } else { - $("#sats").show(); + $("#sats_div").show(); $("#orbits").show(); $("#orbitslabel").show(); $("#satslabel").show(); @@ -62,7 +62,7 @@ function gridPlot(form, visitor=true) { lotw: $("#lotw").is(":checked"), eqsl: $("#eqsl").is(":checked"), qrz: $("#qrz").is(":checked"), - sat: $("#sats").val(), + sat: $("#sat").val(), orbit: $("#orbits").val(), propagation: $('#propagation').val() }, @@ -143,7 +143,7 @@ function spawnGridsquareModal(loc_4char) { 'Searchphrase': loc_4char, 'Band': $("#band").val(), 'Mode': $("#mode").val(), - 'Sat': $("#sats").val(), + 'Sat': $("#sat").val(), 'Orbit': $("#orbits").val(), 'Propagation': $('#propagation').val(), 'Type': 'VUCC' From 42472850e825e81f0f6155cd03988b422b8f4923 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Mon, 6 May 2024 20:46:00 +0200 Subject: [PATCH 3/4] catch case if $proagation is set to all --- application/models/Activated_gridmap_model.php | 16 ++++++++++++---- application/models/Gridmap_model.php | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/application/models/Activated_gridmap_model.php b/application/models/Activated_gridmap_model.php index 89ad55257..c669c5488 100644 --- a/application/models/Activated_gridmap_model.php +++ b/application/models/Activated_gridmap_model.php @@ -26,7 +26,9 @@ class Activated_gridmap_model extends CI_Model { $sql .= " and col_sat_name ='" . $sat . "'"; } } else { - $sql .= " and col_prop_mode ='" . $propagation . "'"; + if ($propagation != '') { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + } $sql .= " and col_band ='" . $band . "'"; } } else { @@ -69,7 +71,9 @@ class Activated_gridmap_model extends CI_Model { $sql .= " and col_sat_name ='" . $sat . "'"; } } else { - $sql .= " and col_prop_mode ='" . $propagation . "'"; + if ($propagation != '') { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + } $sql .= " and col_band ='" . $band . "'"; } } else { @@ -111,7 +115,9 @@ class Activated_gridmap_model extends CI_Model { $sql .= " and col_sat_name ='" . $sat . "'"; } } else { - $sql .= " and col_prop_mode ='" . $propagation . "'"; + if ($propagation != '') { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + } $sql .= " and col_band ='" . $band . "'"; } } else { @@ -154,7 +160,9 @@ class Activated_gridmap_model extends CI_Model { $sql .= " and col_sat_name ='" . $sat . "'"; } } else { - $sql .= " and col_prop_mode ='" . $propagation . "'"; + if ($propagation != '') { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + } $sql .= " and col_band ='" . $band . "'"; } } else { diff --git a/application/models/Gridmap_model.php b/application/models/Gridmap_model.php index cb50f1dc4..be4cf55a5 100644 --- a/application/models/Gridmap_model.php +++ b/application/models/Gridmap_model.php @@ -28,7 +28,9 @@ class Gridmap_model extends CI_Model { $sql .= " and col_sat_name ='" . $sat . "'"; } } else { - $sql .= " and col_prop_mode ='" . $propagation . "'"; + if ($propagation != '') { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + } $sql .= " and col_band ='" . $band . "'"; } } else { @@ -74,7 +76,9 @@ class Gridmap_model extends CI_Model { $sql .= " and col_sat_name ='" . $sat . "'"; } } else { - $sql .= " and col_prop_mode ='" . $propagation . "'"; + if ($propagation != '') { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + } $sql .= " and col_band ='" . $band . "'"; } } else { @@ -118,7 +122,9 @@ class Gridmap_model extends CI_Model { $sql .= " and col_sat_name ='" . $sat . "'"; } } else { - $sql .= " and col_prop_mode ='" . $propagation . "'"; + if ($propagation != '') { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + } $sql .= " and col_band ='" . $band . "'"; } } else { @@ -163,7 +169,9 @@ class Gridmap_model extends CI_Model { $sql .= " and col_sat_name ='" . $sat . "'"; } } else { - $sql .= " and col_prop_mode ='" . $propagation . "'"; + if ($propagation != '') { + $sql .= " and col_prop_mode ='" . $propagation . "'"; + } $sql .= " and col_band ='" . $band . "'"; } } else { From d04a86519c2687a397db0146aa6011e5c1be80a3 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Mon, 6 May 2024 21:08:36 +0200 Subject: [PATCH 4/4] more compact design --- application/views/gridmap/index.php | 25 ++++++++++++------------- assets/js/sections/gridmap.js | 4 ++-- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/application/views/gridmap/index.php b/application/views/gridmap/index.php index 655d7e095..f688debde 100644 --- a/application/views/gridmap/index.php +++ b/application/views/gridmap/index.php @@ -6,7 +6,7 @@
-
+
+
+
- +
-
+
-
-
-
-
- -
+ +
- - + + + diff --git a/assets/js/sections/gridmap.js b/assets/js/sections/gridmap.js index a7e4b883f..807002bb7 100644 --- a/assets/js/sections/gridmap.js +++ b/assets/js/sections/gridmap.js @@ -6,13 +6,13 @@ $('#band').change(function(){ $("#sat").val('All'); $("#orbits").val('All'); $("#sats_div").hide(); - $("#orbits").hide(); + $("#orbits_div").hide(); $("#satslabel").hide(); $("#orbitslabel").hide(); $('#propagation').val('').prop('disabled', false); } else { $("#sats_div").show(); - $("#orbits").show(); + $("#orbits_div").show(); $("#orbitslabel").show(); $("#satslabel").show(); $('#propagation').val('SAT').prop('disabled', true);