mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 02:14:13 +00:00
[ITU Award] Split bands and sat
This commit is contained in:
@@ -17,6 +17,9 @@ class ITU extends CI_Model{
|
||||
|
||||
// Initialize all bands to dash
|
||||
foreach ($bands as $band) {
|
||||
if (($postdata['band'] != 'SAT') && ($band == 'SAT')) {
|
||||
continue;
|
||||
}
|
||||
for ($i = 1; $i <= 90; $i++) {
|
||||
$bandItu[$i][$band] = '-'; // Sets all to dash to indicate no result
|
||||
}
|
||||
@@ -24,6 +27,9 @@ class ITU 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;
|
||||
}
|
||||
@@ -80,7 +86,9 @@ class ITU extends CI_Model{
|
||||
$summary['confirmed'][$itu->col_band]++;
|
||||
}
|
||||
} else {
|
||||
$bandItu[$itu->col_ituz][$itu->col_band] = '<div class="bg-danger awardsBgWarning"><a href=\'javascript:displayContacts("' . str_replace("&", "%26", $itu->col_ituz) . '","' . $itu->col_band . '","All", "All","'. $postdata['mode'] . '","ITUZone","")\'>W</a></div>';
|
||||
if ($postdata['worked'] != NULL) {
|
||||
$bandItu[$itu->col_ituz][$itu->col_band] = '<div class="bg-danger awardsBgWarning"><a href=\'javascript:displayContacts("' . str_replace("&", "%26", $itu->col_ituz) . '","' . $itu->col_band . '","All", "All","'. $postdata['mode'] . '","ITUZone","")\'>W</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
// Track worked zones for summary
|
||||
@@ -90,53 +98,60 @@ class ITU extends CI_Model{
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($itudata_sat as $itu) {
|
||||
// Skip if this band is not in our requested bands list
|
||||
if (!isset($validBands[$itu->col_band])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ituZ[$itu->col_ituz]['count']++; // Count each itu zone
|
||||
|
||||
// Check if confirmed based on the confirmation types selected in postdata
|
||||
$isConfirmed = false;
|
||||
$confirmationLetters = '';
|
||||
if (isset($postdata['qsl']) && $postdata['qsl'] == 1 && $itu->qsl == 1) {
|
||||
$isConfirmed = true;
|
||||
$confirmationLetters .= 'Q';
|
||||
}
|
||||
if (isset($postdata['lotw']) && $postdata['lotw'] == 1 && $itu->lotw == 1) {
|
||||
$isConfirmed = true;
|
||||
$confirmationLetters .= 'L';
|
||||
}
|
||||
if (isset($postdata['eqsl']) && $postdata['eqsl'] == 1 && $itu->eqsl == 1) {
|
||||
$isConfirmed = true;
|
||||
$confirmationLetters .= 'E';
|
||||
}
|
||||
if (isset($postdata['qrz']) && $postdata['qrz'] == 1 && $itu->qrz == 1) {
|
||||
$isConfirmed = true;
|
||||
$confirmationLetters .= 'Z';
|
||||
}
|
||||
if (isset($postdata['clublog']) && $postdata['clublog'] == 1 && $itu->clublog == 1) {
|
||||
$isConfirmed = true;
|
||||
$confirmationLetters .= 'C';
|
||||
}
|
||||
|
||||
if ($isConfirmed) {
|
||||
$bandItu[$itu->col_ituz][$itu->col_band] = '<div class="bg-success awardsBgSuccess"><a href=\'javascript:displayContacts("' . str_replace("&", "%26", $itu->col_ituz) . '","' . $itu->col_band . '","All", "All","'. $postdata['mode'] . '","ITUZone","'.$qsl.'")\'>' . $confirmationLetters . '</a></div>';
|
||||
// Track confirmed zones for summary
|
||||
if (!isset($confirmedZones[$itu->col_band][$itu->col_ituz])) {
|
||||
$confirmedZones[$itu->col_band][$itu->col_ituz] = true;
|
||||
$summary['confirmed'][$itu->col_band]++;
|
||||
if ($postdata['band'] == 'SAT') {
|
||||
foreach ($itudata_sat as $itu) {
|
||||
if (($postdata['band'] != 'SAT') && ($band == 'SAT')) {
|
||||
continue;
|
||||
}
|
||||
// Skip if this band is not in our requested bands list
|
||||
if (!isset($validBands[$itu->col_band])) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
$bandItu[$itu->col_ituz][$itu->col_band] = '<div class="bg-danger awardsBgWarning"><a href=\'javascript:displayContacts("' . str_replace("&", "%26", $itu->col_ituz) . '","' . $itu->col_band . '","All", "All","'. $postdata['mode'] . '","ITUZone","")\'>W</a></div>';
|
||||
}
|
||||
|
||||
// Track worked zones for summary
|
||||
if (!isset($workedZones[$itu->col_band][$itu->col_ituz])) {
|
||||
$workedZones[$itu->col_band][$itu->col_ituz] = true;
|
||||
$summary['worked'][$itu->col_band]++;
|
||||
$ituZ[$itu->col_ituz]['count']++; // Count each itu zone
|
||||
|
||||
// Check if confirmed based on the confirmation types selected in postdata
|
||||
$isConfirmed = false;
|
||||
$confirmationLetters = '';
|
||||
if (isset($postdata['qsl']) && $postdata['qsl'] == 1 && $itu->qsl == 1) {
|
||||
$isConfirmed = true;
|
||||
$confirmationLetters .= 'Q';
|
||||
}
|
||||
if (isset($postdata['lotw']) && $postdata['lotw'] == 1 && $itu->lotw == 1) {
|
||||
$isConfirmed = true;
|
||||
$confirmationLetters .= 'L';
|
||||
}
|
||||
if (isset($postdata['eqsl']) && $postdata['eqsl'] == 1 && $itu->eqsl == 1) {
|
||||
$isConfirmed = true;
|
||||
$confirmationLetters .= 'E';
|
||||
}
|
||||
if (isset($postdata['qrz']) && $postdata['qrz'] == 1 && $itu->qrz == 1) {
|
||||
$isConfirmed = true;
|
||||
$confirmationLetters .= 'Z';
|
||||
}
|
||||
if (isset($postdata['clublog']) && $postdata['clublog'] == 1 && $itu->clublog == 1) {
|
||||
$isConfirmed = true;
|
||||
$confirmationLetters .= 'C';
|
||||
}
|
||||
|
||||
if ($isConfirmed) {
|
||||
$bandItu[$itu->col_ituz][$itu->col_band] = '<div class="bg-success awardsBgSuccess"><a href=\'javascript:displayContacts("' . str_replace("&", "%26", $itu->col_ituz) . '","' . $itu->col_band . '","All", "All","'. $postdata['mode'] . '","ITUZone","'.$qsl.'")\'>' . $confirmationLetters . '</a></div>';
|
||||
// Track confirmed zones for summary
|
||||
if (!isset($confirmedZones[$itu->col_band][$itu->col_ituz])) {
|
||||
$confirmedZones[$itu->col_band][$itu->col_ituz] = true;
|
||||
$summary['confirmed'][$itu->col_band]++;
|
||||
}
|
||||
} else {
|
||||
if ($postdata['worked'] != NULL) {
|
||||
$bandItu[$itu->col_ituz][$itu->col_band] = '<div class="bg-danger awardsBgWarning"><a href=\'javascript:displayContacts("' . str_replace("&", "%26", $itu->col_ituz) . '","' . $itu->col_band . '","All", "All","'. $postdata['mode'] . '","ITUZone","")\'>W</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
// Track worked zones for summary
|
||||
if (!isset($workedZones[$itu->col_band][$itu->col_ituz])) {
|
||||
$workedZones[$itu->col_band][$itu->col_ituz] = true;
|
||||
$summary['worked'][$itu->col_band]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,25 +159,25 @@ class ITU extends CI_Model{
|
||||
$totalWorkedZones = [];
|
||||
$totalConfirmedZones = [];
|
||||
foreach ($workedZones as $band => $zones) {
|
||||
// Skip SAT for totals
|
||||
if ($band === 'SAT') {
|
||||
continue;
|
||||
}
|
||||
foreach ($zones as $zone => $true) {
|
||||
if (!isset($totalWorkedZones[$zone])) {
|
||||
$totalWorkedZones[$zone] = true;
|
||||
if ($band === 'SAT') {
|
||||
continue;
|
||||
}
|
||||
$totalWorkedZonesExSat[$zone] = true; // For calculating total worked excluding SAT
|
||||
$summary['worked']['Total']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($confirmedZones as $band => $zones) {
|
||||
// Skip SAT for totals
|
||||
if ($band === 'SAT') {
|
||||
continue;
|
||||
}
|
||||
foreach ($zones as $zone => $true) {
|
||||
if (!isset($totalConfirmedZones[$zone])) {
|
||||
$totalConfirmedZones[$zone] = true;
|
||||
if ($band === 'SAT') {
|
||||
continue;
|
||||
}
|
||||
$totalConfirmedZonesExSat[$zone] = true; // For calculating total worked excluding SAT
|
||||
$summary['confirmed']['Total']++;
|
||||
}
|
||||
}
|
||||
@@ -204,9 +219,9 @@ class ITU extends CI_Model{
|
||||
}
|
||||
} else {
|
||||
for ($i = 1; $i <= 90; $i++) {
|
||||
if (isset($totalConfirmedZones[$i])) {
|
||||
if (isset($totalConfirmedZonesExSat[$i])) {
|
||||
$mapZones[$i-1] = 'C'; // Confirmed
|
||||
} else if (isset($totalWorkedZones[$i])) {
|
||||
} else if (isset($totalWorkedZonesExSat[$i])) {
|
||||
$mapZones[$i-1] = 'W'; // Worked but not confirmed
|
||||
} else {
|
||||
$mapZones[$i-1] = '-'; // Not worked
|
||||
|
||||
@@ -11,6 +11,17 @@
|
||||
height: calc(100vh - 480px) !important;
|
||||
max-height: 900px !important;
|
||||
}
|
||||
|
||||
.dropdown-filters-responsive {
|
||||
width: 800px;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.dropdown-filters-responsive {
|
||||
width: 90vw;
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="container">
|
||||
@@ -123,7 +134,7 @@
|
||||
<label class="col-md-2 control-label" for="band2"><?= __("Band"); ?></label>
|
||||
<div class="col-md-3">
|
||||
<select id="band2" name="band" class="form-select form-select-sm">
|
||||
<option value="All" <?php if ($this->input->post('band', TRUE) == "All" || $this->input->method() !== 'post') echo ' selected'; ?> ><?= __("All"); ?></option>
|
||||
<option value="All" <?php if ($this->input->post('band', TRUE) == "All" || $this->input->method() !== 'post') echo ' selected'; ?> ><?= __("Every band (w/o SAT)"); ?></option>
|
||||
<?php foreach($worked_bands as $band) {
|
||||
echo '<option value="' . $band . '"';
|
||||
if ($this->input->post('band', TRUE) == $band) echo ' selected';
|
||||
@@ -194,6 +205,9 @@
|
||||
<td>#</td>
|
||||
<td>" . __("ITU Zone") . "</td>";
|
||||
foreach($bands as $band) {
|
||||
if (($posted_band != 'SAT') && ($band == 'SAT')) {
|
||||
continue;
|
||||
}
|
||||
echo '<td>' . $band . '</td>';
|
||||
}
|
||||
echo '</tr>
|
||||
@@ -215,26 +229,19 @@
|
||||
<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;
|
||||
}
|
||||
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 "</thead>
|
||||
<tbody>
|
||||
|
||||
<tr><td>" . __("Total worked") . "</td>";
|
||||
$sat_value = '';
|
||||
foreach ($itu_summary['worked'] as $ituz => $value) {
|
||||
if ($posted_band == 'SAT' && $ituz == 'Total') {
|
||||
continue;
|
||||
@@ -245,14 +252,9 @@
|
||||
echo '<td style="text-align: center"' . ($ituz === 'Total' ? " class='fw-bold'" : '') . '>' . $value . '</td>';
|
||||
}
|
||||
}
|
||||
if (count($bands) > 1) {
|
||||
echo '<td class="spacingcell"></td>';
|
||||
}
|
||||
echo $sat_value;
|
||||
|
||||
echo "</tr><tr>
|
||||
<td>" . __("Total confirmed") . "</td>";
|
||||
$sat_value = '';
|
||||
foreach ($itu_summary['confirmed'] as $ituz => $value) {
|
||||
if ($posted_band == 'SAT' && $ituz == 'Total') {
|
||||
continue;
|
||||
@@ -263,11 +265,6 @@
|
||||
echo '<td style="text-align: center"' . ($ituz === 'Total' ? " class='fw-bold'" : '') . '>' . $value . '</td>';
|
||||
}
|
||||
}
|
||||
if (count($bands) > 1) {
|
||||
echo '<td class="spacingcell"></td>';
|
||||
}
|
||||
echo $sat_value;
|
||||
|
||||
echo '</tr>
|
||||
</table>
|
||||
</div>';
|
||||
|
||||
Reference in New Issue
Block a user