diff --git a/application/controllers/Adif.php b/application/controllers/Adif.php index ca3b4fff..cbf2f52c 100644 --- a/application/controllers/Adif.php +++ b/application/controllers/Adif.php @@ -82,7 +82,14 @@ class adif extends CI_Controller { $this->load->model('adif_data'); - $data['qsos'] = $this->adif_data->export_custom($this->input->post('from'), $this->input->post('to')); + // Used for exporting QSOs not previously exported to LoTW + if ($this->input->post('exportLotw') == 1) { + $exportLotw = true; + } else { + $exportLotw = false; + } + + $data['qsos'] = $this->adif_data->export_custom($this->input->post('from'), $this->input->post('to'), $exportLotw); $this->load->view('adif/data/exportall', $data); diff --git a/application/models/Adif_data.php b/application/models/Adif_data.php index 008af8a0..8b15e9f2 100644 --- a/application/models/Adif_data.php +++ b/application/models/Adif_data.php @@ -67,10 +67,9 @@ class adif_data extends CI_Model { return $this->db->get(); } - function export_custom($from, $to) { + function export_custom($from, $to, $exportLotw = false) { $this->load->model('stations'); $active_station_id = $this->stations->find_active(); - $this->db->select(''.$this->config->item('table_name').'.*, station_profile.*'); $this->db->from($this->config->item('table_name')); @@ -87,6 +86,10 @@ class adif_data extends CI_Model { $to = $to->format('Y-m-d'); $this->db->where("date(".$this->config->item('table_name').".COL_TIME_ON) <= '".$to."'"); } + if ($exportLotw) { + $this->db->where($this->config->item('table_name').".COL_LOTW_QSL_SENT != 'Y'"); + } + $this->db->order_by($this->config->item('table_name').".COL_TIME_ON", "ASC"); $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); diff --git a/application/views/adif/import.php b/application/views/adif/import.php index 66e0aa80..f84cd2f2 100644 --- a/application/views/adif/import.php +++ b/application/views/adif/import.php @@ -106,6 +106,14 @@ +
+
+
+ + +
+
+