Bands without sat

This commit is contained in:
Andreas Kristiansen
2026-03-03 15:14:40 +01:00
parent 44623cd664
commit 7370504a02
2 changed files with 93 additions and 101 deletions

View File

@@ -79,6 +79,9 @@ class WAE extends CI_Model {
// Initialize all bands to dash
foreach ($bands as $band) {
if (($postdata['band'] != 'SAT') && ($band == 'SAT')) {
continue;
}
$dxccMatrix[$adif][$band] = '-';
}
}
@@ -88,6 +91,9 @@ class WAE extends CI_Model {
$dxccMatrix[$region]['name'] = $info['name'];
$dxccMatrix[$region]['Dxccprefix'] = $info['prefix'];
foreach ($bands as $band) {
if (($postdata['band'] != 'SAT') && ($band == 'SAT')) {
continue;
}
$dxccMatrix[$region][$band] = '-';
}
}
@@ -171,60 +177,63 @@ class WAE extends CI_Model {
}
}
foreach ($waeDataSat as $wae) {
// Skip if this band is not in our requested bands list
if (!isset($validBands['SAT'])) {
continue;
}
if ($postdata['band'] == 'SAT') {
// Use region only if it's a valid WAE region, otherwise use DXCC
$entityKey = (!empty($wae->col_region) && in_array($wae->col_region, $this->validWaeRegions)) ? $wae->col_region : (string)$wae->dxcc;
// Track worked status for this entity
if (!isset($entityWorkedStatus[$entityKey])) {
$entityWorkedStatus[$entityKey] = 0;
}
$entityWorkedStatus[$entityKey]++;
// Check if confirmed based on the confirmation types selected in postdata
$isConfirmed = false;
$confirmationLetters = '';
if (isset($postdata['qsl']) && $postdata['qsl'] == 1 && $wae->qsl > 0) {
$isConfirmed = true;
$confirmationLetters .= 'Q';
}
if (isset($postdata['lotw']) && $postdata['lotw'] == 1 && $wae->lotw > 0) {
$isConfirmed = true;
$confirmationLetters .= 'L';
}
if (isset($postdata['eqsl']) && $postdata['eqsl'] == 1 && $wae->eqsl > 0) {
$isConfirmed = true;
$confirmationLetters .= 'E';
}
if (isset($postdata['qrz']) && $postdata['qrz'] == 1 && $wae->qrz > 0) {
$isConfirmed = true;
$confirmationLetters .= 'Z';
}
if (isset($postdata['clublog']) && $postdata['clublog'] == 1 && $wae->clublog > 0) {
$isConfirmed = true;
$confirmationLetters .= 'C';
}
if ($isConfirmed) {
$dxccMatrix[$entityKey]['SAT'] = '<div class="bg-success awardsBgSuccess" additional_successinfo=">C<"><a href=\'javascript:displayContacts("'.$entityKey.'","SAT","'. $postdata['sat'] . '","'. $postdata['orbit'] . '","'. $postdata['mode'] . '","WAE","'.$qsl.'","'.$postdata['dateFrom'].'","'.$postdata['dateTo'].'")\'>'.$confirmationLetters.'</a></div>';
// Track confirmed entities for summary
if (!isset($confirmedEntities['SAT'][$entityKey])) {
$confirmedEntities['SAT'][$entityKey] = true;
$summary['confirmed']['SAT']++;
foreach ($waeDataSat as $wae) {
// Skip if this band is not in our requested bands list
if (!isset($validBands['SAT'])) {
continue;
}
} else {
$dxccMatrix[$entityKey]['SAT'] = '<div class="bg-danger awardsBgWarning" ><a href=\'javascript:displayContacts("'.$entityKey.'","SAT","'. $postdata['sat'] . '","'. $postdata['orbit'] . '","'. $postdata['mode'] . '","WAE", "", "'.$postdata['dateFrom'].'", "'.$postdata['dateTo'].'")\'>W</a></div>';
}
// Track worked entities for summary
if (!isset($workedEntities['SAT'][$entityKey])) {
$workedEntities['SAT'][$entityKey] = true;
$summary['worked']['SAT']++;
// Use region only if it's a valid WAE region, otherwise use DXCC
$entityKey = (!empty($wae->col_region) && in_array($wae->col_region, $this->validWaeRegions)) ? $wae->col_region : (string)$wae->dxcc;
// Track worked status for this entity
if (!isset($entityWorkedStatus[$entityKey])) {
$entityWorkedStatus[$entityKey] = 0;
}
$entityWorkedStatus[$entityKey]++;
// Check if confirmed based on the confirmation types selected in postdata
$isConfirmed = false;
$confirmationLetters = '';
if (isset($postdata['qsl']) && $postdata['qsl'] == 1 && $wae->qsl > 0) {
$isConfirmed = true;
$confirmationLetters .= 'Q';
}
if (isset($postdata['lotw']) && $postdata['lotw'] == 1 && $wae->lotw > 0) {
$isConfirmed = true;
$confirmationLetters .= 'L';
}
if (isset($postdata['eqsl']) && $postdata['eqsl'] == 1 && $wae->eqsl > 0) {
$isConfirmed = true;
$confirmationLetters .= 'E';
}
if (isset($postdata['qrz']) && $postdata['qrz'] == 1 && $wae->qrz > 0) {
$isConfirmed = true;
$confirmationLetters .= 'Z';
}
if (isset($postdata['clublog']) && $postdata['clublog'] == 1 && $wae->clublog > 0) {
$isConfirmed = true;
$confirmationLetters .= 'C';
}
if ($isConfirmed) {
$dxccMatrix[$entityKey]['SAT'] = '<div class="bg-success awardsBgSuccess" additional_successinfo=">C<"><a href=\'javascript:displayContacts("'.$entityKey.'","SAT","'. $postdata['sat'] . '","'. $postdata['orbit'] . '","'. $postdata['mode'] . '","WAE","'.$qsl.'","'.$postdata['dateFrom'].'","'.$postdata['dateTo'].'")\'>'.$confirmationLetters.'</a></div>';
// Track confirmed entities for summary
if (!isset($confirmedEntities['SAT'][$entityKey])) {
$confirmedEntities['SAT'][$entityKey] = true;
$summary['confirmed']['SAT']++;
}
} else {
$dxccMatrix[$entityKey]['SAT'] = '<div class="bg-danger awardsBgWarning" ><a href=\'javascript:displayContacts("'.$entityKey.'","SAT","'. $postdata['sat'] . '","'. $postdata['orbit'] . '","'. $postdata['mode'] . '","WAE", "", "'.$postdata['dateFrom'].'", "'.$postdata['dateTo'].'")\'>W</a></div>';
}
// Track worked entities for summary
if (!isset($workedEntities['SAT'][$entityKey])) {
$workedEntities['SAT'][$entityKey] = true;
$summary['worked']['SAT']++;
}
}
}

View File

@@ -162,7 +162,7 @@ document.addEventListener("DOMContentLoaded", function() {
<label class="col-md-2 control-label" for="mode"><?= __("Mode"); ?></label>
<div class="col-md-3">
<select id="mode" name="mode" class="form-select form-select-sm">
<option value="All" <?php if ($this->input->post('mode') == "All" || $this->input->method() !== 'mode') echo ' selected'; ?>><?= __("All"); ?></option>
<option value="All" <?php if ($this->input->post('mode') == "All" || $this->input->method() !== 'mode') echo ' selected'; ?>><?= __("Every band (w/o SAT)"); ?></option>
<?php
foreach($modes->result() as $mode){
if ($mode->submode == null) {
@@ -201,6 +201,9 @@ document.addEventListener("DOMContentLoaded", function() {
<td>' . __("WAE Name") . '</td>
<td>' . __("Prefix") . '</td>';
foreach($bands as $band) {
if (($posted_band != 'SAT') && ($band == 'SAT')) {
continue;
}
echo '<td>' . $band . '</td>';
}
echo '</tr>
@@ -227,21 +230,15 @@ document.addEventListener("DOMContentLoaded", function() {
<thead>
<tr><td></td>';
$addsat='';
foreach($bands as $band) {
if ($band != 'SAT') {
echo '<td>' . $band . '</td>';
} else {
$addsat='<td>' . $band . '</td>';
if (($posted_band != 'SAT') && ($band == 'SAT')) {
continue;
}
}
if ($posted_band != 'SAT') {
echo '<td>' . $band . '</td>';
}
if ($posted_band != 'SAT') {
echo '<td><b>' . __("Total (ex SAT)") . '</b></td>';
}
if (count($bands) > 1) {
echo '<td class="spacingcell"></td>';
}
echo $addsat;
echo '
</tr>
</thead>
@@ -251,59 +248,45 @@ document.addEventListener("DOMContentLoaded", function() {
$addsat='';
foreach ($wae_summary['worked'] as $band => $dxcc) { // Fills the table with the data
if ($posted_band == 'SAT' && $band == 'Total') {
if (($posted_band != 'SAT') && ($band == 'SAT')) {
continue;
}
if ($band != 'SAT') {
echo '<td style="text-align: center">';
if ($band == 'Total') {
echo '<b>'.$dxcc.'</b>';
} else {
echo $dxcc;
}
echo '</td>';
} else {
$addsat='<td style="text-align: center">' . $dxcc . '</td>';
if (($posted_band == 'SAT') && ($band == 'Total')) {
continue;
}
echo '<td style="text-align: center">';
if ($band == 'Total' && $posted_band != 'SAT') {
echo '<b>'.$dxcc.'</b>';
} else {
echo $dxcc;
}
echo '</td>';
}
if (count($bands) > 1) {
echo '<td class="spacingcell"></td>';
}
if ($addsat != '' && count($wae_summary['worked']) > 1) {
echo $addsat;
}
echo '</tr><tr>
<td>' . __("Total confirmed") . '</td>';
$addsat='';
foreach ($wae_summary['confirmed'] as $band => $dxcc) { // Fills the table with the data
if ($posted_band == 'SAT' && $band == 'Total') {
if (($posted_band != 'SAT') && ($band == 'SAT')) {
continue;
}
if ($band != 'SAT') {
echo '<td style="text-align: center">';
if ($band == 'Total') {
echo '<b>'.$dxcc.'</b>';
} else {
echo $dxcc;
}
echo '</td>';
} else {
$addsat='<td style="text-align: center">' . $dxcc . '</td>';
if (($posted_band == 'SAT') && ($band == 'Total')) {
continue;
}
echo '<td style="text-align: center">';
if (($posted_band != 'SAT') && ($band == 'Total')) {
echo '<b>'.$dxcc.'</b>';
} else {
echo $dxcc;
}
echo '</td>';
}
if (count($bands) > 1) {
echo '<td class="spacingcell"></td>';
}
if ($addsat != '' && count($wae_summary['confirmed']) > 1) {
echo $addsat;
}
echo '</tr>
</table>
</div>';