Merge pull request #1746 from int2001/dxcc_diff_sat_hf

Proposal for splitting SAT/HF at DXCC
This commit is contained in:
Joerg (DJ7NT)
2025-03-09 11:14:50 +01:00
committed by GitHub
7 changed files with 224 additions and 74 deletions

View File

@@ -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');
@@ -857,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)"));

View File

@@ -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;
@@ -137,10 +140,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 +183,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 +242,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,13 +282,16 @@ 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'];
}
$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 = ?)";
@@ -287,12 +302,16 @@ 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'];
}
$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 = ?)";
@@ -311,7 +330,6 @@ class DXCC extends CI_Model {
}
$sql .= $this->addContinentsToQuery($postdata);
$query = $this->db->query($sql,$bindings);
return $query->result();
}
@@ -328,10 +346,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') {

View File

@@ -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;
@@ -71,6 +74,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 +107,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 +155,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 +180,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 +218,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'";

View File

@@ -117,7 +117,7 @@
<label class="col-md-2 control-label" for="band2"><?= __("Band"); ?></label>
<div class="col-md-2">
<select id="band2" name="band" class="form-select form-select-sm">
<option value="All" <?php if ($this->input->post('band') == "All" || $this->input->method() !== 'post') echo ' selected'; ?> ><?= __("Every band"); ?></option>
<option value="All" <?php if ($this->input->post('band') == "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') == $band) echo ' selected';
@@ -217,67 +217,112 @@
<?php
$i = 1;
if ($dxcc_array) {
echo '
<table style="width:100%" class="table-sm table tabledxcc table-bordered table-hover table-striped table-condensed text-center">
<thead>
<tr>
<td>#</td>
<td>' . __("DXCC Name") . '</td>
<td>' . __("Prefix") . '</td>';
foreach($bands as $band) {
echo '<td>' . $band . '</td>';
}
echo '</tr>
</thead>
<tbody>';
foreach ($dxcc_array as $dxcc => $value) { // Fills the table with the data
echo '<tr>
<td>'. $i++ .'</td>';
foreach ($value as $name => $key) {
if (isset($value['Deleted']) && $value['Deleted'] == 1 && $name == "name") {
echo '<td style="text-align: center">' . $key . ' <span class="badge text-bg-danger">'.__("Deleted DXCC").'</span></td>';
} else if ($name == "Deleted") {
continue;
} else {
echo '<td style="text-align: center">' . $key . '</td>';
}
}
echo '</tr>';
}
echo '</table>
<h2>' . __("Summary") . '</h2>
echo '
<table style="width:100%" class="table-sm table tabledxcc table-bordered table-hover table-striped table-condensed text-center">
<thead>
<tr>
<td>#</td>
<td>' . __("DXCC Name") . '</td>
<td>' . __("Prefix") . '</td>';
foreach($bands as $band) {
if (($posted_band != 'SAT') && ($band == 'SAT')) {
continue;
}
echo '<td>' . $band . '</td>';
}
echo '</tr>
</thead>
<tbody>';
foreach ($dxcc_array as $dxcc => $value) { // Fills the table with the data
echo '<tr>
<td>'. $i++ .'</td>';
foreach ($value as $name => $key) {
if (isset($value['Deleted']) && $value['Deleted'] == 1 && $name == "name") {
echo '<td style="text-align: center">' . $key . ' <span class="badge text-bg-danger">'.__("Deleted DXCC").'</span></td>';
} else if ($name == "Deleted") {
continue;
} else {
echo '<td style="text-align: center">' . $key . '</td>';
}
}
echo '</tr>';
}
echo '</table>
<h2>' . __("Summary") . '</h2>
<table class="table-sm tablesummary table table-bordered table-hover table-striped table-condensed text-center">
<thead>
<tr><td></td>';
<table class="table-sm tablesummary table table-bordered table-hover table-striped table-condensed text-center">
<thead>
<tr><td></td>';
foreach($bands as $band) {
echo '<td>' . $band . '</td>';
}
echo '<td>' . __("Total") . '</td>
</tr>
</thead>
<tbody>
$addsat='';
foreach($bands as $band) {
if ($band != 'SAT') {
echo '<td>' . $band . '</td>';
} else {
$addsat='<td>' . $band . '</td>';
}
}
echo '<td><b>' . __("Total") . '</b></td>';
if (count($bands) > 1) {
echo '<td class="spacingcell"></td>';
}
echo $addsat;
echo '
</tr>
</thead>
<tbody>
<tr><td>' . __("Total worked") . '</td>';
<tr><td>' . __("Total worked") . '</td>';
$addsat='';
foreach ($dxcc_summary['worked'] as $band => $dxcc) { // Fills the table with the data
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 ($addsat != '' && count($dxcc_summary['worked']) > 1) {
if (count($bands) > 1) {
echo '<td class="spacingcell"></td>';
}
echo $addsat;
}
foreach ($dxcc_summary['worked'] as $dxcc) { // Fills the table with the data
echo '<td style="text-align: center">' . $dxcc . '</td>';
}
echo '</tr><tr>
<td>' . __("Total confirmed") . '</td>';
$addsat='';
foreach ($dxcc_summary['confirmed'] as $band => $dxcc) { // Fills the table with the data
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 ($addsat != '' && count($dxcc_summary['confirmed']) > 1) {
if (count($bands) > 1) {
echo '<td class="spacingcell"></td>';
}
echo $addsat;
}
echo '</tr><tr>
<td>' . __("Total confirmed") . '</td>';
foreach ($dxcc_summary['confirmed'] as $dxcc) { // Fills the table with the data
echo '<td style="text-align: center">' . $dxcc . '</td>';
}
echo '</tr>
</table>
</div>';
echo '</tr>
</table>
</div>';
}
else {
echo '<div class="alert alert-danger" role="alert">' . __("Nothing found!") . '</div>';
} else {
echo '<div class="alert alert-danger" role="alert">' . __("Nothing found!") . '</div>';
}
?>
</div>

View File

@@ -117,7 +117,7 @@
<label class="col-md-2 control-label" for="band2"><?= __("Band"); ?></label>
<div class="col-md-2">
<select id="band2" name="band" class="form-select form-select-sm">
<option value="All" <?php if ($this->input->post('band') == "All" || $this->input->method() !== 'post') echo ' selected'; ?> ><?= __("Every band"); ?></option>
<option value="All" <?php if ($this->input->post('band') == "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') == $band) echo ' selected';
@@ -199,6 +199,9 @@
echo ' <td>' . __("Deleted") . '</td>';
foreach($bands as $band) {
if (($posted_band != 'SAT') && ($band == 'SAT')) {
continue;
}
echo '<td>' . $band . '</td>';
}
echo '</tr>
@@ -220,26 +223,68 @@
<table class="table-sm tablesummary table table-bordered table-hover table-striped table-condensed text-center">
<thead>
<tr><td></td>';
foreach($bands as $band) {
echo '<td>' . $band . '</td>';
}
echo '<td>' . __("Total") . '</td></tr>';
$addsat='';
foreach($bands as $band) {
if ($band != 'SAT') {
echo '<td>' . $band . '</td>';
} else {
$addsat='<td>' . $band . '</td>';
}
}
echo '<td><b>' . __("Total") . '</b></td>';
if (count($bands) > 1) {
echo '<td class="spacingcell"></td>';
}
echo $addsat;
echo '</thead>
<tbody>
<tr><td>' . __("Total worked") . '</td>';
foreach ($iota_summary['worked'] as $dxcc) { // Fills the table with the data
echo '<td style="text-align: center">' . $dxcc . '</td>';
}
$addsat='';
foreach ($iota_summary['worked'] as $band => $iota) { // Fills the table with the data
if ($band != 'SAT') {
echo '<td style="text-align: center">';
if ($band == 'Total') {
echo '<b>'.$iota.'</b>';
} else {
echo $iota;
}
echo '</td>';
} else {
$addsat='<td style="text-align: center">' . $iota . '</td>';
}
}
if ($addsat != '' && count($iota_summary['worked']) > 1) {
if (count($bands) > 1) {
echo '<td class="spacingcell"></td>';
}
echo $addsat;
}
echo '</tr><tr>
<td>' . __("Total confirmed") . '</td>';
foreach ($iota_summary['confirmed'] as $dxcc) { // Fills the table with the data
echo '<td style="text-align: center">' . $dxcc . '</td>';
}
echo '</tr><tr>
<td>' . __("Total confirmed") . '</td>';
$addsat='';
foreach ($iota_summary['confirmed'] as $band => $iota) { // Fills the table with the data
if ($band != 'SAT') {
echo '<td style="text-align: center">';
if ($band == 'Total') {
echo '<b>'.$iota.'</b>';
} else {
echo $iota;
}
echo '</td>';
} else {
$addsat='<td style="text-align: center">' . $iota . '</td>';
}
}
if ($addsat != '' && count($iota_summary['confirmed']) > 1) {
if (count($bands) > 1) {
echo '<td class="spacingcell"></td>';
}
echo $addsat;
}
echo '</tr>
</table>

View File

@@ -1222,3 +1222,12 @@ svg text.month { fill: #AAA; }
opacity: 0;
}
}
.spacingcell {
background-color: transparent !important;
border-top-style: none !important;
border-bottom-style: none !important;
border-right-style: none !important;
--dt-row-hover: transparent !important;
--dt-row-stripe: transparent !important;
}

View File

@@ -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');