diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index fdf8a3326..ce7b0007b 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -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)")); diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index 3c6585e41..c415d5ec6 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -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') { diff --git a/application/models/Iota.php b/application/models/Iota.php index c62b06adc..899b05eb2 100644 --- a/application/models/Iota.php +++ b/application/models/Iota.php @@ -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'"; diff --git a/application/views/awards/dxcc/index.php b/application/views/awards/dxcc/index.php index a27fbd2a4..ebb752eae 100644 --- a/application/views/awards/dxcc/index.php +++ b/application/views/awards/dxcc/index.php @@ -117,7 +117,7 @@