diff --git a/application/controllers/Eqsl.php b/application/controllers/Eqsl.php index f9004658..3e2dd369 100644 --- a/application/controllers/Eqsl.php +++ b/application/controllers/Eqsl.php @@ -558,6 +558,7 @@ class eqsl extends CI_Controller { if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } $data['page_title'] = "eQSL Card Image Download"; + $custom_date_format = $this->session->userdata('user_date_format'); $this->load->model('eqslmethods_model'); $rows = ''; @@ -569,9 +570,10 @@ class eqsl extends CI_Controller { // i.e. when operating /P it must be callsign/p // the password, however, is always the same as the main account $data['user_eqsl_name'] = $qsl['station_callsign']; - $adif = $this->generateAdif($qsl, $data); + //$adif = $this->generateAdif($qsl, $data); - $status = $this->uploadQso($adif, $qsl); + //$status = $this->uploadQso($adif, $qsl); + $status = "none"; $timestamp = strtotime($qsl['COL_TIME_ON']); $rows .= "".date($custom_date_format, $timestamp).""; diff --git a/application/models/Eqslmethods_model.php b/application/models/Eqslmethods_model.php index d676bcc0..49f49dee 100644 --- a/application/models/Eqslmethods_model.php +++ b/application/models/Eqslmethods_model.php @@ -81,21 +81,20 @@ class Eqslmethods_model extends CI_Model { } } - $this->db->select('station_profile.*, '.$this->config->item('table_name').'.COL_PRIMARY_KEY, '.$this->config->item('table_name').'.COL_TIME_ON, '.$this->config->item('table_name').'.COL_CALL, '.$this->config->item('table_name').'.COL_MODE, '.$this->config->item('table_name').'.COL_SUBMODE, '.$this->config->item('table_name').'.COL_BAND, '.$this->config->item('table_name').'.COL_COMMENT, '.$this->config->item('table_name').'.COL_RST_SENT, '.$this->config->item('table_name').'.COL_PROP_MODE, '.$this->config->item('table_name').'.COL_SAT_NAME, '.$this->config->item('table_name').'.COL_SAT_MODE, '.$this->config->item('table_name').'.COL_QSLMSG'); + $this->db->select('station_profile.*, '.$this->config->item('table_name').'.COL_PRIMARY_KEY, '.$this->config->item('table_name').'.COL_TIME_ON, '.$this->config->item('table_name').'.COL_CALL, '.$this->config->item('table_name').'.COL_MODE, '.$this->config->item('table_name').'.COL_SUBMODE, '.$this->config->item('table_name').'.COL_BAND, '.$this->config->item('table_name').'.COL_COMMENT, '.$this->config->item('table_name').'.COL_RST_SENT, '.$this->config->item('table_name').'.COL_PROP_MODE, '.$this->config->item('table_name').'.COL_SAT_NAME, '.$this->config->item('table_name').'.COL_SAT_MODE, '.$this->config->item('table_name').'.COL_QSLMSG, eQSL_images.*'); $this->db->from('station_profile'); $this->db->join($this->config->item('table_name'),'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); - $this->db->where("coalesce(station_profile.eqslqthnickname, '') <> ''"); + $this->db->join('eQSL_images','eQSL_images.qso_id = '.$this->config->item('table_name').'.COL_PRIMARY_KEY','left outer'); + //$this->db->where("coalesce(station_profile.eqslqthnickname, '') <> ''"); $this->db->where($this->config->item('table_name').'.COL_CALL !=', ''); - $this->db->group_start(); - $this->db->where($this->config->item('table_name').'.COL_EQSL_QSL_SENT is null'); - $this->db->or_where($this->config->item('table_name').'.COL_EQSL_QSL_SENT', ''); - $this->db->or_where($this->config->item('table_name').'.COL_EQSL_QSL_SENT', 'R'); - $this->db->or_where($this->config->item('table_name').'.COL_EQSL_QSL_SENT', 'Q'); - $this->db->or_where($this->config->item('table_name').'.COL_EQSL_QSL_SENT', 'N'); - $this->db->group_end(); + $this->db->where($this->config->item('table_name').'.COL_EQSL_QSL_RCVD', 'Y'); + $this->db->where('qso_id', NULL); $this->db->where_in('station_profile.station_id', $logbooks_locations_array); - return $this->db->get(); + $result = $this->db->get(); + log_message('info','SQL: '.$this->db->last_query()); + return $result; + //return $this->db->get(); } // Mark the QSO as sent to eQSL diff --git a/application/views/eqsl/download.php b/application/views/eqsl/download.php new file mode 100644 index 00000000..c8dd5dd4 --- /dev/null +++ b/application/views/eqsl/download.php @@ -0,0 +1,57 @@ + +
+

+
+
+
eQSL Card Image Download
+ +
+ +
+ load->view('layout/messages'); ?> + + +

Below is a table of QSOs that have been confirmed on eQSL but QSL images have not been downloaded yet.

+ + + Clicking \"Upload QSOs\" will send QSO information to eQSL.cc.

"; + echo form_open('eqsl/export'); + echo ""; + echo ""; + } + else + { + if (isset($eqsl_results_table)) + { + echo "

The following QSOs were sent to eQSL.

"; + echo $eqsl_results_table; + } + else + { + echo "

There are no QSOs whose eQSL card images have not yet been downloaded. Go log some more QSOs!

"; + } + } +?> +
+ +
+