diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index ea710df72..57e0394d8 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -527,7 +527,9 @@ class Awards extends CI_Controller { $type = $this->security->xss_clean($this->input->post('Type')); $qsl = $this->input->post('QSL') == null ? '' : $this->security->xss_clean($this->input->post('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, $sat, $orbit, $searchmode, $propagation); + $dateFrom = $this->security->xss_clean($this->input->post('dateFrom')); + $dateTo = $this->security->xss_clean($this->input->post('dateTo')); + $data['results'] = $this->logbook_model->qso_details($searchphrase, $band, $mode, $type, $qsl, $sat, $orbit, $searchmode, $propagation, $dateFrom, $dateTo); // This is done because we have two different ways to get dxcc info in Wavelog. 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 a0779e0eb..ae8be0ddb 100644 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -531,7 +531,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, $sat = null, $orbit = null, $searchmode = null, $propagation = null) { + public function qso_details($searchphrase, $band, $mode, $type, $qsl, $sat = null, $orbit = null, $searchmode = null, $propagation = null, $datefrom = null, $dateto = null) { $this->load->model('logbooks_model'); $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); @@ -742,6 +742,13 @@ class Logbook_model extends CI_Model { $this->db->or_where("COL_SUBMODE", $mode); $this->db->group_end(); } + + if ($datefrom != null) { + $this->db->where('date(COL_TIME_ON) >=', $datefrom); + } + if ($dateto != null) { + $this->db->where('date(COL_TIME_ON) <=', $dateto); + } $this->db->order_by("COL_TIME_ON", "desc"); $this->db->order_by("COL_PRIMARY_KEY", "desc"); diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 44acf16ff..cc9b2e8c2 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -2602,7 +2602,7 @@ function viewEqsl(picture, callsign) { /* * Used to fetch QSOs from the logbook in the awards */ - function displayContacts(searchphrase, band, sat, orbit, mode, type, qsl) { + function displayContacts(searchphrase, band, sat, orbit, mode, type, qsl, datefrom, dateto) { $.ajax({ url: base_url + 'index.php/awards/qso_details_ajax', type: 'post', @@ -2613,7 +2613,9 @@ function viewEqsl(picture, callsign) { 'Orbit': orbit, 'Mode': mode, 'Type': type, - 'QSL' : qsl + 'QSL' : qsl, + 'dateFrom': datefrom, + 'dateTo': dateto }, success: function (html) { BootstrapDialog.show({