mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
[ITU Award] Speed increase
This commit is contained in:
@@ -1978,9 +1978,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.
|
||||
@@ -1997,35 +1997,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;
|
||||
@@ -2048,8 +2056,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;
|
||||
@@ -2061,34 +2077,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');
|
||||
|
||||
Reference in New Issue
Block a user