diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php index da15d933..5cad61ac 100755 --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -109,27 +109,18 @@ class QSO extends CI_Controller { } } - function qsl_rcvd() { - + function qsl_rcvd($id, $method) { $this->load->model('logbook_model'); $this->load->model('user_model'); if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } - $query = $this->logbook_model->qso_info($this->uri->segment(3)); - - $this->load->library('form_validation'); - $this->form_validation->set_rules('id', 'ID', 'required'); - $data = $query->row(); - if ($this->form_validation->run() == FALSE) - { - $this->load->view('qso/qsl_rcvd', $data); - } - else - { - $this->logbook_model->qsl_rcvd(); - $this->session->set_flashdata('notice', 'QSL registered'); - $this->load->view('qso/qsl_rcvd_done'); - } + // Update Logbook to Mark Paper Card Received + + $this->logbook_model->paperqsl_update($id, $method); + + $this->session->set_flashdata('notice', 'QSL Card: Marked as Received'); + + redirect('logbook'); } /* Delete QSO */ diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 7e986afc..a3e48686 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -399,6 +399,20 @@ class Logbook_model extends CI_Model { } + // Set Paper to recived + function paperqsl_update($qso_id, $method) { + $data = array( + 'COL_QSLRDATE' => date('Y-m-d'), + 'COL_QSL_RCVD' => 'Y', + 'COL_QSL_RCVD_VIA' => $method + ); + + $this->db->where('COL_PRIMARY_KEY', $qso_id); + + $this->db->update($this->config->item('table_name'), $data); + } + + function get_qsos($num, $offset) { $this->db->select('COL_CALL, COL_BAND, COL_TIME_ON, COL_RST_RCVD, COL_RST_SENT, COL_MODE, COL_NAME, COL_COUNTRY, COL_PRIMARY_KEY, COL_SAT_NAME, COL_GRIDSQUARE, COL_QSL_RCVD, COL_EQSL_QSL_RCVD, COL_EQSL_QSL_SENT, COL_QSL_SENT, COL_STX_STRING, COL_SRX_STRING, COL_OPERATOR, COL_STATION_CALLSIGN, COL_LOTW_QSL_SENT, COL_LOTW_QSL_RCVD'); $this->db->order_by("COL_TIME_ON", "desc"); diff --git a/application/views/view_log/index.php b/application/views/view_log/index.php index 06e046c3..423f8ac6 100644 --- a/application/views/view_log/index.php +++ b/application/views/view_log/index.php @@ -3,6 +3,13 @@

Logbook

+ + session->flashdata('notice')) { ?> + + +
diff --git a/application/views/view_log/partial/log.php b/application/views/view_log/partial/log.php index 124f27db..5843d6eb 100644 --- a/application/views/view_log/partial/log.php +++ b/application/views/view_log/partial/log.php @@ -18,7 +18,6 @@ LoTW - @@ -52,14 +51,29 @@ session->userdata('user_lotw_name') != "") { ?> COL_LOTW_QSL_SENT != ''){ ?> - + - Edit - QSL RCVD + + + config->item('callsign_tags') == true) { ?> COL_STATION_CALLSIGN != null) { ?> COL_STATION_CALLSIGN; ?> diff --git a/assets/css/general.css b/assets/css/general.css index f8c7f412..0b2ff551 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -84,6 +84,7 @@ TD.eqsl{ width: 33px; } + .eqsl-green{ color: #00A000; font-size: 1.1em; diff --git a/index.php b/index.php index 93c6cc50..5b5ddb8b 100644 --- a/index.php +++ b/index.php @@ -55,7 +55,7 @@ */ #define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development'); # define('ENVIRONMENT', 'development'); - define('ENVIRONMENT', 'production'); + define('ENVIRONMENT', 'development'); /* *---------------------------------------------------------------