mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Fix band logic
This commit is contained in:
@@ -2285,8 +2285,7 @@ class Awards extends CI_Controller {
|
||||
$this->load->view('interface_assets/footer', $footerData);
|
||||
}
|
||||
|
||||
public function wpx_details()
|
||||
{
|
||||
public function wpx_details() {
|
||||
$postdata['band'] = $this->input->post('band', true);
|
||||
$postdata['status'] = $this->input->post('status', true);
|
||||
$postdata['sat'] = $this->security->xss_clean($this->input->post('sats'));
|
||||
@@ -2304,6 +2303,7 @@ class Awards extends CI_Controller {
|
||||
$postdata['SouthAmerica'] = ($this->input->post('SouthAmerica', true) ?? 0) == 0 ? NULL: 1;
|
||||
$postdata['Oceania'] = ($this->input->post('Oceania', true) ?? 0) == 0 ? NULL: 1;
|
||||
$postdata['Antarctica'] = ($this->input->post('Antarctica', true) ?? 0) == 0 ? NULL: 1;
|
||||
$postdata['summaryband'] = $this->input->post('summaryband', true);
|
||||
|
||||
$this->load->model('wpx');
|
||||
$this->load->model('modes');
|
||||
|
||||
@@ -441,7 +441,12 @@ class WPX extends CI_Model {
|
||||
$bindings[] = $postdata['mode'];
|
||||
$bindings[] = $postdata['mode'];
|
||||
}
|
||||
$sql .= $this->addBandToQuery($postdata['band'], $bindings);
|
||||
|
||||
if ($postdata['band'] == $postdata['summaryband'] || $postdata['summaryband'] != 'Total') {
|
||||
$sql .= $this->addBandToQuery($postdata['summaryband'], $bindings);
|
||||
} else {
|
||||
$sql .= $this->addBandToQuery($postdata['band'], $bindings);
|
||||
}
|
||||
|
||||
if ($postdata['status'] === 'confirmed') {
|
||||
$sql .= $this->addQslToQuery($postdata);
|
||||
@@ -509,18 +514,18 @@ class WPX extends CI_Model {
|
||||
return $sql;
|
||||
}
|
||||
|
||||
function addBandToQuery($band,&$binding) {
|
||||
function addBandToQuery($band, &$binding) {
|
||||
$sql = '';
|
||||
if ($band == 'SAT') {
|
||||
$sql .= " and col_prop_mode = ?";
|
||||
$binding[]=$band;
|
||||
$binding[] = $band;
|
||||
} else {
|
||||
if ($band == 'All' || $band == 'Total') {
|
||||
$sql .=" and (col_prop_mode!='SAT' or col_prop_mode is null)";
|
||||
} else {
|
||||
$sql .=" and (col_prop_mode!='SAT' or col_prop_mode is null)";
|
||||
$sql .= " and col_band = ?";
|
||||
$binding[]=$band;
|
||||
$binding[] = $band;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ function wpxLoadDetails(status, band) {
|
||||
url: site_url + '/awards/wpx_details',
|
||||
type: 'post',
|
||||
data: {
|
||||
band: band,
|
||||
band: $('#band2').val(),
|
||||
mode: $('#mode').val(),
|
||||
status: status,
|
||||
sats: $('#sats').val(),
|
||||
@@ -31,6 +31,7 @@ function wpxLoadDetails(status, band) {
|
||||
eqsl: $('#eqsl').is(':checked') ? 1 : 0,
|
||||
qrz: $('#qrz').is(':checked') ? 1 : 0,
|
||||
clublog: $('#clublog').is(':checked') ? 1 : 0,
|
||||
summaryband: band
|
||||
},
|
||||
type: 'post',
|
||||
success: function (html) {
|
||||
|
||||
Reference in New Issue
Block a user