diff --git a/application/controllers/eqsl.php b/application/controllers/eqsl.php index cd596abe9..89cf80f21 100644 --- a/application/controllers/eqsl.php +++ b/application/controllers/eqsl.php @@ -100,7 +100,7 @@ class eqsl extends CI_Controller { { $file = $config['upload_path'] . 'eqslreport_download.adi'; - // Get credentials for LoTW + // Get credentials for eQSL $query = $this->user_model->get_by_id($this->session->userdata('user_id')); $q = $query->row(); $data['user_eqsl_name'] = $q->user_eqsl_name; @@ -182,23 +182,63 @@ class eqsl extends CI_Controller { } // end function public function export() { - $data['page_title'] = "eQSL Report Upload"; - - $config['upload_path'] = './uploads/'; - $config['allowed_types'] = 'tq8|TQ8'; - - $this->load->library('upload', $config); - - if ( ! $this->upload->do_upload()) + $this->load->model('logbook_model'); + + $data['page_title'] = "eQSL QSO Upload"; + + if ($this->input->post('eqslexport') == "export") { - $data['error'] = $this->upload->display_errors(); - - $this->load->view('layout/header', $data); - $this->load->view('eqsl/export'); - $this->load->view('layout/footer'); + // Check for credentials + + // Grab the list of QSOs to send information about + // perform an HTTP get on each one, and grab the status back + $qslsnotsent = $this->logbook_model->eqsl_not_yet_sent(); + + // Build out the ADIF info string + $adif = ""; + foreach ($qslsnotsent->result_array() as $qsl) + { + + } + // Perform a big HTTP POST with the ADIF information at the back + // http://www.eqsl.cc/qslcard/ImportADIF.txt + + // Dump out a table with the results } else - { + { + $qslsnotsent = $this->logbook_model->eqsl_not_yet_sent(); + + if ($qslsnotsent->num_rows() > 0) + { + $table = "
| Date | "; + $table .= "Call | "; + $table .= "Mode | "; + $table .= "Band | "; + $table .= "
| ".$qsl['COL_TIME_ON']." | "; + $table .= "".strtoupper($qsl['COL_CALL'])." | "; + $table .= "".$qsl['COL_MODE']." | "; + $table .= "".$qsl['COL_BAND']." | "; + $table .= "
Clicking \"Upload QSOs\" will send QSO information to eQSL.cc.
"; + echo form_open('eqsl/export'); + echo ""; + echo ""; + } + else + { + echo "There are no QSOs that need to be sent to eQSL.cc at this time. Go log some more QSOs!
"; + } +?> +