From 2229a1579b5c25ba0c68b0bbf43a7b828d5f948e Mon Sep 17 00:00:00 2001 From: Andreas Date: Tue, 17 Nov 2020 09:47:57 +0100 Subject: [PATCH] Logging is working. Contest exchange is being logged. Basic contest logging is now working. --- application/controllers/Qso.php | 34 ------------ application/models/Logbook_model.php | 28 ++++++++-- application/views/contesting/index.php | 6 --- application/views/interface_assets/footer.php | 52 +++++++++++++------ 4 files changed, 60 insertions(+), 60 deletions(-) diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php index c8a38a8e..7d24e842 100755 --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -104,41 +104,7 @@ class QSO extends CI_Controller { */ public function saveqso() { $this->load->model('logbook_model'); - // Add QSO - // $this->logbook_model->add(); - //change to create_qso function as add and create_qso duplicate functionality $this->logbook_model->create_qso(); - - // Store Basic QSO Info for reuse - // Put data in an array first, then call set_userdata once. - // This solves the problem of CI dumping out the session - // cookie each time set_userdata is called. - // For more info, see http://bizhole.com/codeigniter-nginx-error-502-bad-gateway/ - $qso_data = array( - 'start_date' => $this->input->post('start_date'), - 'start_time' => $this->input->post('start_time'), - 'time_stamp' => time(), - 'band' => $this->input->post('band'), - 'freq' => $this->input->post('freq_display'), - 'freq_rx' => $this->input->post('freq_display_rx'), - 'mode' => $this->input->post('mode'), - 'sat_name' => $this->input->post('sat_name'), - 'sat_mode' => $this->input->post('sat_mode'), - 'prop_mode' => $this->input->post('prop_mode'), - 'radio' => $this->input->post('radio'), - 'station_profile_id' => $this->input->post('station_profile'), - 'transmit_power' => $this->input->post('transmit_power') - ); - - setcookie("radio", $qso_data['radio'], time()+3600*24*99); - setcookie("station_profile_id", $qso_data['station_profile_id'], time()+3600*24*99); - - $this->session->set_userdata($qso_data); - - // If SAT name is set make it session set to sat - if($this->input->post('sat_name')) { - $this->session->set_userdata('prop_mode', 'SAT'); - } } function edit() { diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index b5bd539b..4ce04b5a 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -20,7 +20,27 @@ class Logbook_model extends CI_Model { if($this->input->post('sat_name')) { $prop_mode = "SAT"; - } + } + + // Contest exchange, need to separate between serial and other type of exchange + if($this->input->post('exchangeradio')) { + if($this->input->post('exchangeradio') == "serial") { + $srx = $this->input->post('exch_recv'); + $stx = $this->input->post('exch_sent'); + $srx_string = null; + $stx_string = null; + } else { + $srx = null; + $stx = null; + $srx_string = $this->input->post('exch_recv'); + $stx_string = $this->input->post('exch_sent'); + } + } else { + $srx_string = null; + $stx_string = null; + $srx = null; + $stx = null; + } if($this->session->userdata('user_locator')){ $locator = $this->session->userdata('user_locator'); @@ -108,8 +128,10 @@ class Logbook_model extends CI_Model { 'COL_AGE' => null, 'COL_TEN_TEN' => null, 'COL_TX_PWR' => $tx_power, - 'COL_STX' => null, - 'COL_SRX' => null, + 'COL_STX' => $stx, + 'COL_SRX' => $srx, + 'COL_STX_STRING' => $stx_string, + 'COL_SRX_STRING' => $srx_string, 'COL_NR_BURSTS' => null, 'COL_NR_PINGS' => null, 'COL_MAX_BURSTS' => null, diff --git a/application/views/contesting/index.php b/application/views/contesting/index.php index 3c40c78b..0cbb5622 100644 --- a/application/views/contesting/index.php +++ b/application/views/contesting/index.php @@ -97,7 +97,6 @@
-
@@ -152,9 +151,6 @@
Logbook (for this logging session)
-
- -
@@ -172,8 +168,6 @@
-
-
diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 739b5080..9f4e0ece 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -2439,6 +2439,29 @@ function deleteQsl(id) { uri->segment(1) == "contesting") { ?>