diff --git a/application/controllers/Distances.php b/application/controllers/Distances.php index 5c65831fa..af4957501 100644 --- a/application/controllers/Distances.php +++ b/application/controllers/Distances.php @@ -74,12 +74,13 @@ class Distances extends CI_Controller { $distance = $this->security->xss_clean($this->input->post('distance')); $band = $this->security->xss_clean($this->input->post('band')); $sat = $this->security->xss_clean($this->input->post('sat')); + $propagation = $this->security->xss_clean($this->input->post('propagation')); - $data['results'] = $this->distances_model->qso_details($distance, $band, $sat); + $data['results'] = $this->distances_model->qso_details($distance, $band, $sat, $propagation); // Render Page $data['page_title'] = "Log View - " . $distance; - $data['filter'] = __("QSOs with") . " " . $distance . " " . __("and band"). " " . $band; + $data['filter'] = __("QSOs with") . " " . $distance . " " . __("and band"). " " . $band. __("and propagation"). " " . $propagation; $this->load->view('awards/details', $data); } } diff --git a/application/models/Distances_model.php b/application/models/Distances_model.php index be96e7f04..68e920987 100644 --- a/application/models/Distances_model.php +++ b/application/models/Distances_model.php @@ -46,6 +46,19 @@ class Distances_model extends CI_Model $this->db->where('satellite.orbit', $clean_postdata['orbit']); } + if ( $clean_postdata['propagation'] == 'NoSAT' ) { // All without SAT + $this->db->where('col_prop_mode !=', 'SAT'); + } elseif ($clean_postdata['propagation'] == 'None') { // Empty Propmode + $this->db->group_start(); + $this->db->where('trim(col_prop_mode)', ''); + $this->db->or_where('col_prop_mode is null'); + $this->db->group_end(); + } elseif ($clean_postdata['propagation'] == 'All') { // Dont care for propmode + ; // No Prop-Filter + } else { // Propmode set, take care of it + $this->db->where('col_prop_mode', $clean_postdata['propagation']); + } + $this->db->where('station_id', $station_id); $queryresult = $this->db->get($this->config->item('table_name')); @@ -231,7 +244,7 @@ class Distances_model extends CI_Model /* * Used to fetch QSOs from the logbook in the awards */ - public function qso_details($distance, $band, $sat){ + public function qso_details($distance, $band, $sat, $propagation){ $distarray = $this->getdistparams($distance); $this->load->model('logbooks_model'); $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); @@ -256,6 +269,19 @@ class Distances_model extends CI_Model } } } + + if ($propagation == 'NoSAT' ) { // All without SAT + $this->db->where('col_prop_mode !=', 'SAT'); + } elseif ($propagation == 'None') { // Empty Propmode + $this->db->group_start(); + $this->db->where('trim(col_prop_mode)', ''); + $this->db->or_where('col_prop_mode is null'); + $this->db->group_end(); + } elseif ($propagation == 'All') { // Dont care for propmode + ; // No Prop-Filter + } else { // Propmode set, take care of it + $this->db->where('col_prop_mode', $propagation); + } $this->db->order_by("COL_TIME_ON", "desc"); return $this->db->get($this->config->item('table_name')); diff --git a/application/views/distances/index.php b/application/views/distances/index.php index a02f379ff..25ea5f01b 100644 --- a/application/views/distances/index.php +++ b/application/views/distances/index.php @@ -50,6 +50,32 @@ } ?> + +
+ +
diff --git a/assets/js/sections/distances.js b/assets/js/sections/distances.js index f85549b54..43e46598f 100644 --- a/assets/js/sections/distances.js +++ b/assets/js/sections/distances.js @@ -26,7 +26,8 @@ function distPlot(form) { type: 'post', data: {'band': form.distplot_bands.value, 'sat': form.distplot_sats.value, - 'orbit': form.orbits.value + 'orbit': form.orbits.value, + 'propagation': form.propmode.value }, success: function(tmp) { if (tmp.ok == 'OK') { @@ -157,6 +158,7 @@ function getDistanceQsos(distance) { 'band': $("#distplot_bands").val(), 'sat' : $("#distplot_sats").val(), 'orbit': $("#orbits").val(), + 'propagation': $("#propmode").val() }, success: function (html) { BootstrapDialog.show({