From c60db090bdcab4f9ca144d193b8c33f0a3c63808 Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Wed, 4 Mar 2026 08:05:36 +0100 Subject: [PATCH] [CQ Award] Adjusted so that SAT does not show when every band is chosen --- application/models/Cq.php | 103 ++++++++++++++------------ application/views/awards/cq/index.php | 18 ++--- 2 files changed, 66 insertions(+), 55 deletions(-) diff --git a/application/models/Cq.php b/application/models/Cq.php index a7757f55b..51ac55b15 100644 --- a/application/models/Cq.php +++ b/application/models/Cq.php @@ -17,6 +17,9 @@ class CQ extends CI_Model{ // Initialize all bands to dash foreach ($bands as $band) { + if (($postdata['band'] != 'SAT') && ($band == 'SAT')) { + continue; + } for ($i = 1; $i <= 40; $i++) { $bandCq[$i][$band] = '-'; // Sets all to dash to indicate no result } @@ -24,6 +27,9 @@ class CQ extends CI_Model{ // Initialize summary counters only for the bands passed in foreach ($bands as $band) { + if (($postdata['band'] != 'SAT') && ($band == 'SAT')) { + continue; + } $summary['worked'][$band] = 0; $summary['confirmed'][$band] = 0; } @@ -92,55 +98,60 @@ class CQ extends CI_Model{ } } - foreach ($cqdata_sat as $cq) { - // Skip if this band is not in our requested bands list - if (!isset($validBands[$cq->col_band])) { - continue; - } - - $cqZ[$cq->col_cqz]['count']++; // Count each cq zone - - // Check if confirmed based on the confirmation types selected in postdata - $isConfirmed = false; - $confirmationLetters = ''; - if (isset($postdata['qsl']) && $postdata['qsl'] == 1 && $cq->qsl == 1) { - $isConfirmed = true; - $confirmationLetters .= 'Q'; - } - if (isset($postdata['lotw']) && $postdata['lotw'] == 1 && $cq->lotw == 1) { - $isConfirmed = true; - $confirmationLetters .= 'L'; - } - if (isset($postdata['eqsl']) && $postdata['eqsl'] == 1 && $cq->eqsl == 1) { - $isConfirmed = true; - $confirmationLetters .= 'E'; - } - if (isset($postdata['qrz']) && $postdata['qrz'] == 1 && $cq->qrz == 1) { - $isConfirmed = true; - $confirmationLetters .= 'Z'; - } - if (isset($postdata['clublog']) && $postdata['clublog'] == 1 && $cq->clublog == 1) { - $isConfirmed = true; - $confirmationLetters .= 'C'; - } - - if ($isConfirmed) { - $bandCq[$cq->col_cqz][$cq->col_band] = '
'; - // Track confirmed zones for summary - if (!isset($confirmedZones[$cq->col_band][$cq->col_cqz])) { - $confirmedZones[$cq->col_band][$cq->col_cqz] = true; - $summary['confirmed'][$cq->col_band]++; + if ($postdata['band'] == 'SAT') { + foreach ($cqdata_sat as $cq) { + if (($postdata['band'] != 'SAT') && ($band == 'SAT')) { + continue; } - } else { - if ($postdata['worked'] != NULL) { - $bandCq[$cq->col_cqz][$cq->col_band] = ''; + // Skip if this band is not in our requested bands list + if (!isset($validBands[$cq->col_band])) { + continue; } - } - // Track worked zones for summary - if (!isset($workedZones[$cq->col_band][$cq->col_cqz])) { - $workedZones[$cq->col_band][$cq->col_cqz] = true; - $summary['worked'][$cq->col_band]++; + $cqZ[$cq->col_cqz]['count']++; // Count each cq zone + + // Check if confirmed based on the confirmation types selected in postdata + $isConfirmed = false; + $confirmationLetters = ''; + if (isset($postdata['qsl']) && $postdata['qsl'] == 1 && $cq->qsl == 1) { + $isConfirmed = true; + $confirmationLetters .= 'Q'; + } + if (isset($postdata['lotw']) && $postdata['lotw'] == 1 && $cq->lotw == 1) { + $isConfirmed = true; + $confirmationLetters .= 'L'; + } + if (isset($postdata['eqsl']) && $postdata['eqsl'] == 1 && $cq->eqsl == 1) { + $isConfirmed = true; + $confirmationLetters .= 'E'; + } + if (isset($postdata['qrz']) && $postdata['qrz'] == 1 && $cq->qrz == 1) { + $isConfirmed = true; + $confirmationLetters .= 'Z'; + } + if (isset($postdata['clublog']) && $postdata['clublog'] == 1 && $cq->clublog == 1) { + $isConfirmed = true; + $confirmationLetters .= 'C'; + } + + if ($isConfirmed) { + $bandCq[$cq->col_cqz][$cq->col_band] = ''; + // Track confirmed zones for summary + if (!isset($confirmedZones[$cq->col_band][$cq->col_cqz])) { + $confirmedZones[$cq->col_band][$cq->col_cqz] = true; + $summary['confirmed'][$cq->col_band]++; + } + } else { + if ($postdata['worked'] != NULL) { + $bandCq[$cq->col_cqz][$cq->col_band] = ''; + } + } + + // Track worked zones for summary + if (!isset($workedZones[$cq->col_band][$cq->col_cqz])) { + $workedZones[$cq->col_band][$cq->col_cqz] = true; + $summary['worked'][$cq->col_band]++; + } } } diff --git a/application/views/awards/cq/index.php b/application/views/awards/cq/index.php index 7d06f01cf..c6e166b90 100644 --- a/application/views/awards/cq/index.php +++ b/application/views/awards/cq/index.php @@ -132,7 +132,7 @@