Merge branch 'dev' into dxcc_award_optimized

This commit is contained in:
Andreas Kristiansen
2026-02-26 19:14:15 +01:00
86 changed files with 7016 additions and 4619 deletions

View File

@@ -668,37 +668,43 @@ class Awards extends CI_Controller {
$data['bands'] = $bands; // Used for displaying selected band(s) in the table in the view
if($this->input->method() === 'post') {
$postdata['qsl'] = $this->security->xss_clean($this->input->post('qsl'));
$postdata['lotw'] = $this->security->xss_clean($this->input->post('lotw'));
$postdata['eqsl'] = $this->security->xss_clean($this->input->post('eqsl'));
$postdata['qrz'] = $this->security->xss_clean($this->input->post('qrz'));
$postdata['worked'] = $this->security->xss_clean($this->input->post('worked'));
$postdata['confirmed'] = $this->security->xss_clean($this->input->post('confirmed'));
$postdata['notworked'] = $this->security->xss_clean($this->input->post('notworked'));
$postdata['band'] = $this->security->xss_clean($this->input->post('band'));
if($this->input->method() === 'post') {
$postdata['qsl'] = ($this->input->post('qsl',true) ?? 0) == 0 ? NULL: 1;
$postdata['lotw'] = ($this->input->post('lotw',true) ?? 0) == 0 ? NULL: 1;
$postdata['eqsl'] = ($this->input->post('eqsl',true) ?? 0) == 0 ? NULL: 1;
$postdata['qrz'] = ($this->input->post('qrz',true) ?? 0) == 0 ? NULL: 1;
$postdata['clublog'] = ($this->input->post('clublog',true) ?? 0) == 0 ? NULL: 1;
$postdata['worked'] = ($this->input->post('worked',true) ?? 0) == 0 ? NULL: 1;
$postdata['confirmed'] = ($this->input->post('confirmed',true) ?? 0) == 0 ? NULL: 1;
$postdata['notworked'] = ($this->input->post('notworked',true) ?? 0) == 0 ? NULL: 1;
$postdata['band'] = $this->security->xss_clean($this->input->post('band'));
$postdata['mode'] = $this->security->xss_clean($this->input->post('mode'));
$postdata['datefrom'] = $this->security->xss_clean($this->input->post('dateFrom'));
$postdata['dateto'] = $this->security->xss_clean($this->input->post('dateTo'));
}
else { // Setting default values at first load of page
$postdata['qsl'] = 1;
$postdata['lotw'] = 1;
$postdata['eqsl'] = 0;
$postdata['qrz'] = 0;
$postdata['worked'] = 1;
$postdata['confirmed'] = 1;
$postdata['notworked'] = 1;
$postdata['band'] = 'All';
}
else { // Setting default values at first load of page
$postdata['qsl'] = 1;
$postdata['lotw'] = 1;
$postdata['eqsl'] = NULL;
$postdata['qrz'] = NULL;
$postdata['clublog'] = NULL;
$postdata['worked'] = 1;
$postdata['confirmed'] = 1;
$postdata['notworked'] = 1;
$postdata['band'] = 'All';
$postdata['mode'] = 'All';
$postdata['datefrom'] = null;
$postdata['dateto'] = null;
}
}
$data['posted_band'] = $postdata['band'];
if ($logbooks_locations_array) {
$location_list = "'".implode("','",$logbooks_locations_array)."'";
$data['cq_array'] = $this->cq->get_cq_array($bands, $postdata, $location_list);
$data['cq_summary'] = $this->cq->get_cq_summary($bands, $postdata, $location_list);
$cq_result = $this->cq->get_cq_array($bands, $postdata, $location_list);
// Extract bands data and summary from the result
$data['cq_array'] = ($cq_result && isset($cq_result['bands'])) ? $cq_result['bands'] : null;
$data['cq_summary'] = ($cq_result && isset($cq_result['summary'])) ? $cq_result['summary'] : null;
} else {
$location_list = null;
$data['cq_array'] = null;
@@ -1602,8 +1608,16 @@ class Awards extends CI_Controller {
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$this->load->model('cq');
$this->load->model('bands');
$bands[] = $this->input->post('band');
$data['worked_bands'] = $this->bands->get_worked_bands('cq');
if ($this->input->post('band') == 'All') {
$bands = $data['worked_bands'];
}
else {
$bands[] = $this->input->post('band');
}
$postdata['qsl'] = $this->input->post('qsl') == 0 ? NULL: 1;
$postdata['lotw'] = $this->input->post('lotw') == 0 ? NULL: 1;
@@ -1615,36 +1629,15 @@ class Awards extends CI_Controller {
$postdata['notworked'] = $this->input->post('notworked') == 0 ? NULL: 1;
$postdata['band'] = $this->security->xss_clean($this->input->post('band'));
$postdata['mode'] = $this->security->xss_clean($this->input->post('mode'));
$postdata['datefrom'] = $this->security->xss_clean($this->input->post('datefrom'));
$postdata['dateto'] = $this->security->xss_clean($this->input->post('dateto'));
$postdata['datefrom'] = $this->security->xss_clean($this->input->post('dateFrom'));
$postdata['dateto'] = $this->security->xss_clean($this->input->post('dateTo'));
if ($logbooks_locations_array) {
$location_list = "'".implode("','",$logbooks_locations_array)."'";
$cq_array = $this->cq->get_cq_array($bands, $postdata, $location_list, $this->user_map_color_qso, $this->user_map_color_qsoconfirm);
$zones = $this->cq->get_cq_array($bands, $postdata, $location_list, true);
} else {
$location_list = null;
$cq_array = null;
}
$zones = array();
foreach ($cq_array as $cq => $value) {
foreach ($value as $key) {
if($key != "") {
if (strpos($key, '>W<') !== false) {
$zones[] = 'W';
break;
}
if (strpos($key, '>C<') !== false) {
$zones[] = 'C';
break;
}
if (strpos($key, '-') !== false) {
$zones[] = '-';
break;
}
}
}
$zones = array();
}
header('Content-Type: application/json');
@@ -1987,9 +1980,9 @@ class Awards extends CI_Controller {
$this->load->model('itu');
$this->load->model('modes');
$this->load->model('bands');
$data['user_map_custom'] = $this->optionslib->get_map_custom();
$data['worked_bands'] = $this->bands->get_worked_bands('cq');
$data['user_map_custom'] = $this->optionslib->get_map_custom();
$data['modes'] = $this->modes->active(); // Used in the view for mode select
if ($this->input->post('band') != NULL) { // Band is not set when page first loads.
@@ -2006,35 +1999,43 @@ class Awards extends CI_Controller {
$data['bands'] = $bands; // Used for displaying selected band(s) in the table in the view
if($this->input->method() === 'post') {
$postdata['qsl'] = $this->security->xss_clean($this->input->post('qsl'));
$postdata['lotw'] = $this->security->xss_clean($this->input->post('lotw'));
$postdata['eqsl'] = $this->security->xss_clean($this->input->post('eqsl'));
$postdata['qrz'] = $this->security->xss_clean($this->input->post('qrz'));
$postdata['clublog'] = $this->security->xss_clean($this->input->post('clublog'));
$postdata['worked'] = $this->security->xss_clean($this->input->post('worked'));
$postdata['confirmed'] = $this->security->xss_clean($this->input->post('confirmed'));
$postdata['notworked'] = $this->security->xss_clean($this->input->post('notworked'));
$postdata['band'] = $this->security->xss_clean($this->input->post('band'));
$postdata['mode'] = $this->security->xss_clean($this->input->post('mode'));
}
else { // Setting default values at first load of page
$postdata['qsl'] = 1;
$postdata['lotw'] = 1;
$postdata['eqsl'] = 0;
$postdata['qrz'] = 0;
$postdata['clublog'] = 0;
$postdata['worked'] = 1;
$postdata['confirmed'] = 1;
$postdata['notworked'] = 1;
$postdata['band'] = 'All';
if($this->input->method() === 'post') {
$postdata['qsl'] = ($this->input->post('qsl',true) ?? 0) == 0 ? NULL: 1;
$postdata['lotw'] = ($this->input->post('lotw',true) ?? 0) == 0 ? NULL: 1;
$postdata['eqsl'] = ($this->input->post('eqsl',true) ?? 0) == 0 ? NULL: 1;
$postdata['qrz'] = ($this->input->post('qrz',true) ?? 0) == 0 ? NULL: 1;
$postdata['clublog'] = ($this->input->post('clublog',true) ?? 0) == 0 ? NULL: 1;
$postdata['worked'] = ($this->input->post('worked',true) ?? 0) == 0 ? NULL: 1;
$postdata['confirmed'] = ($this->input->post('confirmed',true) ?? 0) == 0 ? NULL: 1;
$postdata['notworked'] = ($this->input->post('notworked',true) ?? 0) == 0 ? NULL: 1;
$postdata['band'] = $this->security->xss_clean($this->input->post('band'));
$postdata['mode'] = $this->security->xss_clean($this->input->post('mode'));
$postdata['datefrom'] = $this->security->xss_clean($this->input->post('dateFrom'));
$postdata['dateto'] = $this->security->xss_clean($this->input->post('dateTo'));
}
else { // Setting default values at first load of page
$postdata['qsl'] = 1;
$postdata['lotw'] = 1;
$postdata['eqsl'] = NULL;
$postdata['qrz'] = NULL;
$postdata['clublog'] = NULL;
$postdata['worked'] = 1;
$postdata['confirmed'] = 1;
$postdata['notworked'] = 1;
$postdata['band'] = 'All';
$postdata['mode'] = 'All';
}
$postdata['datefrom'] = null;
$postdata['dateto'] = null;
}
$data['posted_band'] = $postdata['band'];
if ($logbooks_locations_array) {
$location_list = "'".implode("','",$logbooks_locations_array)."'";
$data['itu_array'] = $this->itu->get_itu_array($bands, $postdata, $location_list);
$data['itu_summary'] = $this->itu->get_itu_summary($bands, $postdata, $location_list);
$itu_result = $this->itu->get_itu_array($bands, $postdata, $location_list);
// Extract bands data and summary from the result
$data['itu_array'] = ($itu_result && isset($itu_result['bands'])) ? $itu_result['bands'] : null;
$data['itu_summary'] = ($itu_result && isset($itu_result['summary'])) ? $itu_result['summary'] : null;
} else {
$location_list = null;
$data['itu_array'] = null;
@@ -2057,8 +2058,16 @@ class Awards extends CI_Controller {
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$this->load->model('itu');
$this->load->model('bands');
$bands[] = $this->input->post('band');
$data['worked_bands'] = $this->bands->get_worked_bands('cq');
if ($this->input->post('band') == 'All') {
$bands = $data['worked_bands'];
}
else {
$bands[] = $this->input->post('band');
}
$postdata['qsl'] = $this->input->post('qsl') == 0 ? NULL: 1;
$postdata['lotw'] = $this->input->post('lotw') == 0 ? NULL: 1;
@@ -2070,34 +2079,15 @@ class Awards extends CI_Controller {
$postdata['notworked'] = $this->input->post('notworked') == 0 ? NULL: 1;
$postdata['band'] = $this->security->xss_clean($this->input->post('band'));
$postdata['mode'] = $this->security->xss_clean($this->input->post('mode'));
$postdata['datefrom'] = $this->security->xss_clean($this->input->post('dateFrom'));
$postdata['dateto'] = $this->security->xss_clean($this->input->post('dateTo'));
if ($logbooks_locations_array) {
$location_list = "'".implode("','",$logbooks_locations_array)."'";
$itu_array = $this->itu->get_itu_array($bands, $postdata, $location_list);
$zones = $this->itu->get_itu_array($bands, $postdata, $location_list, true);
} else {
$location_list = null;
$itu_array = null;
}
$zones = array();
foreach ($itu_array as $itu => $value) {
foreach ($value as $key) {
if($key != "") {
if (strpos($key, '>W<') !== false) {
$zones[] = 'W';
break;
}
if (strpos($key, '>C<') !== false) {
$zones[] = 'C';
break;
}
if (strpos($key, '-') !== false) {
$zones[] = '-';
break;
}
}
}
$zones = array();
}
header('Content-Type: application/json');