From c35d609df9e9d8aa86448f82d145857bebad9e05 Mon Sep 17 00:00:00 2001 From: int2001 Date: Fri, 7 Mar 2025 10:43:40 +0000 Subject: [PATCH 01/11] Proposal for splitting SAT/HF at DXCC --- application/models/Dxcc.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index 3c6585e41..131ee0a56 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -137,10 +137,13 @@ class DXCC extends CI_Model { $sql .= $this->genfunctions->addBandToQuery($band,$bindings); if ($band == 'SAT') { + $sql .= " and col_prop_mode='SAT'"; if ($postdata['sat'] != 'All') { $sql .= " and col_sat_name = ?"; $bindings[]=$postdata['sat']; } + } else { + $sql.=" and (col_prop_mode!='SAT' or col_prop_mode is null)"; } if ($postdata['mode'] != 'All') { @@ -177,11 +180,15 @@ class DXCC extends CI_Model { ") and col_dxcc > 0"; $sql .= $this->genfunctions->addBandToQuery($band,$bindings); if ($band == 'SAT') { + $sql .= " and col_prop_mode ='SAT'"; if ($postdata['sat'] != 'All') { $sql .= " and col_sat_name = ?"; $bindings[]=$postdata['sat']; } + } else { + $sql.=" and (col_prop_mode != 'SAT' or col_prop_mode is null)"; } + if ($postdata['mode'] != 'All') { $sql .= " and (col_mode = ? or col_submode = ?)"; $bindings[]=$postdata['mode']; @@ -232,6 +239,8 @@ class DXCC extends CI_Model { $sql .= " and col_band = ?"; $bindings[]=$postdata['band']; } + } else { + $sql.=" and (col_prop_mode != 'SAT' or col_prop_mode is null)"; } if ($postdata['mode'] != 'All') { @@ -270,10 +279,13 @@ class DXCC extends CI_Model { ") and col_dxcc > 0"; $sql .= $this->genfunctions->addBandToQuery($postdata['band'],$bindings); if ($postdata['band'] == 'SAT') { + $sql .= " and col_prop_mode = 'SAT'"; if ($postdata['sat'] != 'All') { $sql .= " and col_sat_name = ?"; $bindings[]=$postdata['sat']; } + } else { + $sql.=" and (col_prop_mode != 'SAT' or col_prop_mode is null)"; } $sql .= $this->addOrbitToQuery($postdata,$bindings); @@ -287,11 +299,15 @@ class DXCC extends CI_Model { $sql .= " and not exists (select 1 from ".$this->config->item('table_name')." where station_id in (". $location_list .") and col_dxcc = thcv.col_dxcc and col_dxcc > 0"; $sql .= $this->genfunctions->addBandToQuery($postdata['band'],$bindings); if ($postdata['band'] == 'SAT') { + $sql .= " and col_prop_mode = 'SAT'"; if ($postdata['sat'] != 'All') { $sql .= " and col_sat_name = ?"; $bindings[]=$postdata['sat']; } + } else { + $sql.=" and (col_prop_mode != 'SAT' or col_prop_mode is null)"; } + $sql .= $this->addOrbitToQuery($postdata,$bindings); if ($postdata['mode'] != 'All') { @@ -328,10 +344,13 @@ class DXCC extends CI_Model { $sql .= $this->genfunctions->addBandToQuery($postdata['band'],$bindings); if ($postdata['band'] == 'SAT') { + $sql .= " and col_prop_mode = 'SAT'"; if ($postdata['sat'] != 'All') { $sql .= " and col_sat_name = ?"; $bindings[]=$postdata['sat']; } + } else { + $sql.=" and (col_prop_mode != 'SAT' or col_prop_mode is null)"; } if ($postdata['mode'] != 'All') { From fb7980782d97f083144a283f39b165e76f426aa5 Mon Sep 17 00:00:00 2001 From: int2001 Date: Fri, 7 Mar 2025 10:56:36 +0000 Subject: [PATCH 02/11] Trigger the change for band on every load --- assets/js/sections/dxccmap.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/assets/js/sections/dxccmap.js b/assets/js/sections/dxccmap.js index c865b130a..a4a3b49c7 100644 --- a/assets/js/sections/dxccmap.js +++ b/assets/js/sections/dxccmap.js @@ -1,5 +1,6 @@ var osmUrl = $('#dxccmapjs').attr("tileUrl"); + $('#band2').change(function(){ var band = $("#band2 option:selected").text(); if (band != "SAT") { @@ -13,6 +14,8 @@ $('#band2').change(function(){ } }); +$('#band2').change(); // trigger the change on fresh-load to hide/show SAT-Params + $('#sats').change(function(){ var sat = $("#sats option:selected").text(); $("#band2").val('SAT'); From 4230e7ef3b9f5bea87e8f59d1acd8bdbeb1eec67 Mon Sep 17 00:00:00 2001 From: int2001 Date: Fri, 7 Mar 2025 11:47:38 +0000 Subject: [PATCH 03/11] Swapped Total/SAT at summary --- application/views/awards/dxcc/index.php | 38 +++++++++++++++++++------ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/application/views/awards/dxcc/index.php b/application/views/awards/dxcc/index.php index 66531a132..302ea4110 100644 --- a/application/views/awards/dxcc/index.php +++ b/application/views/awards/dxcc/index.php @@ -117,7 +117,7 @@
- + input->post('band') == $band) echo ' selected'; From e4b12caa2ac535bb1f181f2d876ae6a3e6d9b834 Mon Sep 17 00:00:00 2001 From: int2001 Date: Fri, 7 Mar 2025 14:36:54 +0000 Subject: [PATCH 07/11] No specific SAT or Orbit at IOTA! --- application/models/Iota.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/application/models/Iota.php b/application/models/Iota.php index c62b06adc..32822fc68 100644 --- a/application/models/Iota.php +++ b/application/models/Iota.php @@ -71,6 +71,11 @@ class IOTA extends CI_Model { $binding[] = $postdata['mode']; $binding[] = $postdata['mode']; } + if ($band == 'SAT') { + $sql .= " and col_prop_mode='SAT'"; + } else { + $sql.=" and (col_prop_mode!='SAT' or col_prop_mode is null)"; + } $sql .= $this->genfunctions->addBandToQuery($band,$binding); @@ -99,6 +104,11 @@ class IOTA extends CI_Model { $binding[] = $postdata['mode']; $binding[] = $postdata['mode']; } + if ($band == 'SAT') { + $sql .= " and col_prop_mode='SAT'"; + } else { + $sql.=" and (col_prop_mode!='SAT' or col_prop_mode is null)"; + } $sql .= $this->genfunctions->addBandToQuery($band,$binding); @@ -142,6 +152,8 @@ class IOTA extends CI_Model { $sql .= " and col_band = ?"; $binding[] = $postdata['band']; } + } else { + $sql.=" and (col_prop_mode != 'SAT' or col_prop_mode is null)"; } $sql .= ")"; } @@ -165,6 +177,11 @@ class IOTA extends CI_Model { $binding[] = $postdata['mode']; $binding[] = $postdata['mode']; } + if ($postdata['band'] == 'SAT') { + $sql .= " and col_prop_mode='SAT'"; + } else { + $sql.=" and (col_prop_mode!='SAT' or col_prop_mode is null)"; + } $sql .= $this->genfunctions->addBandToQuery($postdata['band'],$binding); @@ -198,6 +215,11 @@ class IOTA extends CI_Model { $binding[] = $postdata['mode']; $binding[] = $postdata['mode']; } + if ($postdata['band'] == 'SAT') { + $sql .= " and col_prop_mode='SAT'"; + } else { + $sql.=" and (col_prop_mode!='SAT' or col_prop_mode is null)"; + } if ($postdata['includedeleted'] == NULL) { $sql .= " and coalesce(iota.status, '') <> 'D'"; From 1d6d629c70e1e37cacb7cd9e0fc73bb660f3cbfe Mon Sep 17 00:00:00 2001 From: int2001 Date: Fri, 7 Mar 2025 16:00:29 +0000 Subject: [PATCH 08/11] Add Orbit only to query if SAT --- application/models/Dxcc.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index 131ee0a56..c1f796535 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -284,11 +284,11 @@ class DXCC extends CI_Model { $sql .= " and col_sat_name = ?"; $bindings[]=$postdata['sat']; } + $sql .= $this->addOrbitToQuery($postdata,$bindings); } else { $sql.=" and (col_prop_mode != 'SAT' or col_prop_mode is null)"; } - $sql .= $this->addOrbitToQuery($postdata,$bindings); if ($postdata['mode'] != 'All') { $sql .= " and (col_mode = ? or col_submode = ?)"; @@ -304,11 +304,11 @@ class DXCC extends CI_Model { $sql .= " and col_sat_name = ?"; $bindings[]=$postdata['sat']; } + $sql .= $this->addOrbitToQuery($postdata,$bindings); } else { $sql.=" and (col_prop_mode != 'SAT' or col_prop_mode is null)"; } - $sql .= $this->addOrbitToQuery($postdata,$bindings); if ($postdata['mode'] != 'All') { $sql .= " and (col_mode = ? or col_submode = ?)"; @@ -327,7 +327,6 @@ class DXCC extends CI_Model { } $sql .= $this->addContinentsToQuery($postdata); - $query = $this->db->query($sql,$bindings); return $query->result(); } From 0d669676d98798d6a850be04e43c9b76e6d592af Mon Sep 17 00:00:00 2001 From: int2001 Date: Fri, 7 Mar 2025 16:19:31 +0000 Subject: [PATCH 09/11] Don't fill SAT with wked/cnf if no SAT is chosen --- application/models/Dxcc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index c1f796535..254ad6282 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -81,6 +81,9 @@ class DXCC extends CI_Model { $dxccMatrix[$dxcc->adif]['Deleted'] = isset($dxcc->Enddate) ? 1 : 0; $dxccMatrix[$dxcc->adif][$band] = '-'; } + if (($postdata['band'] != 'SAT') && ($band == 'SAT')) { + continue; + } // If worked is checked, we add worked entities to the array if ($postdata['worked'] != NULL) { From 9fbdaad3e50e6fa267cc0ce4a43b8a5df8af4f75 Mon Sep 17 00:00:00 2001 From: int2001 Date: Fri, 7 Mar 2025 16:52:52 +0000 Subject: [PATCH 10/11] Don't show SAT-Col at DXCC-List if SAT wasn't choseen --- application/controllers/Awards.php | 1 + application/models/Dxcc.php | 6 +++--- application/views/awards/dxcc/index.php | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index fdf8a3326..3baafcd2a 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -174,6 +174,7 @@ class Awards extends CI_Controller { // Render Page $data['page_title'] = sprintf(__("Awards - %s"), __("DXCC")); + $data['posted_band']=$postdata['band']; $this->load->view('interface_assets/header', $data); $this->load->view('awards/dxcc/index'); $this->load->view('interface_assets/footer'); diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index 254ad6282..c415d5ec6 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -70,6 +70,9 @@ class DXCC extends CI_Model { $qsl = $this->genfunctions->gen_qsl_from_postdata($postdata); foreach ($bands as $band) { // Looping through bands and entities to generate the array needed for display + if (($postdata['band'] != 'SAT') && ($band == 'SAT')) { + continue; + } foreach ($dxccArray as $dxcc) { if ($dxcc->adif == '0') { $dxccMatrix[$dxcc->adif]['name'] = $dxcc->name; @@ -81,9 +84,6 @@ class DXCC extends CI_Model { $dxccMatrix[$dxcc->adif]['Deleted'] = isset($dxcc->Enddate) ? 1 : 0; $dxccMatrix[$dxcc->adif][$band] = '-'; } - if (($postdata['band'] != 'SAT') && ($band == 'SAT')) { - continue; - } // If worked is checked, we add worked entities to the array if ($postdata['worked'] != NULL) { diff --git a/application/views/awards/dxcc/index.php b/application/views/awards/dxcc/index.php index 70472b050..0c6126c0c 100644 --- a/application/views/awards/dxcc/index.php +++ b/application/views/awards/dxcc/index.php @@ -225,6 +225,9 @@ ' . __("DXCC Name") . ' ' . __("Prefix") . ''; foreach($bands as $band) { + if (($posted_band != 'SAT') && ($band == 'SAT')) { + continue; + } echo '' . $band . ''; } echo ' From 161638c20913c337ac758f5e2adfdc1210d2cbd0 Mon Sep 17 00:00:00 2001 From: int2001 Date: Fri, 7 Mar 2025 17:03:51 +0000 Subject: [PATCH 11/11] Don't show SAT-Col for IOTAs when SAT wasn't chosen --- application/controllers/Awards.php | 1 + application/models/Iota.php | 3 +++ application/views/awards/iota/index.php | 3 +++ 3 files changed, 7 insertions(+) diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 3baafcd2a..ce7b0007b 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -858,6 +858,7 @@ class Awards extends CI_Controller { $iotalist = $this->iota->fetchIota($postdata, $location_list); $data['iota_array'] = $this->iota->get_iota_array($iotalist, $bands, $postdata, $location_list); $data['iota_summary'] = $this->iota->get_iota_summary($bands, $postdata, $location_list); + $data['posted_band']=$postdata['band']; // Render Page $data['page_title'] = sprintf(__("Awards - %s"), __("IOTA (Island On The Air)")); diff --git a/application/models/Iota.php b/application/models/Iota.php index 32822fc68..899b05eb2 100644 --- a/application/models/Iota.php +++ b/application/models/Iota.php @@ -7,6 +7,9 @@ class IOTA extends CI_Model { function get_iota_array($iotaArray, $bands, $postdata, $location_list) { foreach ($bands as $band) { // Looping through bands and iota to generate the array needed for display + if (($postdata['band'] != 'SAT') && ($band == 'SAT')) { + continue; + } foreach ($iotaArray as $iota) { $iotaMatrix[$iota->tag]['prefix'] = $iota->prefix; $iotaMatrix[$iota->tag]['name'] = $iota->name; diff --git a/application/views/awards/iota/index.php b/application/views/awards/iota/index.php index 7d9dfd847..b1720c48f 100644 --- a/application/views/awards/iota/index.php +++ b/application/views/awards/iota/index.php @@ -199,6 +199,9 @@ echo ' ' . __("Deleted") . ''; foreach($bands as $band) { + if (($posted_band != 'SAT') && ($band == 'SAT')) { + continue; + } echo '' . $band . ''; } echo '