diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index d11f7b86..663518e4 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -221,7 +221,8 @@ class Awards extends CI_Controller { $mode = str_replace('"', "", $this->security->xss_clean($this->input->post("Mode"))); $type = $this->security->xss_clean($this->input->post('Type')); $qsl = $this->input->post('QSL') == null ? '' : $this->security->xss_clean($this->input->post('QSL')); - $data['results'] = $this->logbook_model->qso_details($searchphrase, $band, $mode, $type, $qsl); + $searchmode = $this->input->post('searchmode') == null ? '' : $this->security->xss_clean($this->input->post('searchmode')); + $data['results'] = $this->logbook_model->qso_details($searchphrase, $band, $mode, $type, $qsl, $searchmode); // This is done because we have two different ways to get dxcc info in Cloudlog. Once is using the name (in awards), and the other one is using the ADIF DXCC. // We replace the values to make it look a bit nicer diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index e2ef9073..394e484d 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -328,7 +328,7 @@ class Logbook_model extends CI_Model { /* * Used to fetch QSOs from the logbook in the awards */ - public function qso_details($searchphrase, $band, $mode, $type, $qsl){ + public function qso_details($searchphrase, $band, $mode, $type, $qsl, $searchmode = null){ $CI =& get_instance(); $CI->load->model('logbooks_model'); $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); @@ -347,7 +347,11 @@ class Logbook_model extends CI_Model { $this->db->where('COL_IOTA', $searchphrase); break; case 'VUCC': - $this->db->where("(COL_GRIDSQUARE like '%" . $searchphrase . "%' OR COL_VUCC_GRIDS like'%" . $searchphrase ."%')"); + if ($searchmode == 'activated') { + $this->db->where("station_gridsquare like '%" . $searchphrase . "%'"); + } else { + $this->db->where("(COL_GRIDSQUARE like '%" . $searchphrase . "%' OR COL_VUCC_GRIDS like'%" . $searchphrase ."%')"); + } break; case 'CQZone': $this->db->where('COL_CQZ', $searchphrase); diff --git a/assets/js/sections/gridmap.js b/assets/js/sections/gridmap.js index 6db46237..6ff91e5d 100644 --- a/assets/js/sections/gridmap.js +++ b/assets/js/sections/gridmap.js @@ -108,15 +108,19 @@ function gridPlot(form) { } function spawnGridsquareModal(loc_4char) { + var ajax_data = ({ + 'Searchphrase': loc_4char, + 'Band': $("#band").val(), + 'Mode': $("#mode").val(), + 'Type': 'VUCC' + }) + if (type == 'activated') { + ajax_data.searchmode = 'activated'; + } $.ajax({ url: base_url + 'index.php/awards/qso_details_ajax', type: 'post', - data: { - 'Searchphrase': loc_4char, - 'Band': $("#band").val(), - 'Mode': $("#mode").val(), - 'Type': 'VUCC' - }, + data: ajax_data, success: function (html) { BootstrapDialog.show({ title: 'QSO Data',