From 79de2357fec06405f3389686c6924e349f25bc29 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Wed, 31 Oct 2012 17:07:27 +0000 Subject: [PATCH] Serial number correctly stored from ADIF, displayed editable --- application/controllers/adif.php | 2 +- application/controllers/contest.php | 2 -- application/models/logbook_model.php | 32 ++++++++++++++++++++++----- application/views/dashboard/index.php | 4 ++-- application/views/qso/edit.php | 14 ++++++++++++ application/views/view_log/index.php | 4 ++-- application/views/view_log/qso.php | 4 ++-- 7 files changed, 47 insertions(+), 15 deletions(-) diff --git a/application/controllers/adif.php b/application/controllers/adif.php index dfa4085d..c3471cc1 100644 --- a/application/controllers/adif.php +++ b/application/controllers/adif.php @@ -91,7 +91,7 @@ class adif extends CI_Controller { $this->logbook_model->import($record); //echo $record["call"]."
"; - //print_r($record); + print_r($record); }; unlink('./uploads/'.$data['upload_data']['file_name']); diff --git a/application/controllers/contest.php b/application/controllers/contest.php index 359ed8f9..9888825f 100644 --- a/application/controllers/contest.php +++ b/application/controllers/contest.php @@ -35,8 +35,6 @@ class Contest extends CI_Controller { $data['log'] = $this->contests->contest_log_view($data['info']->start, $data['info']->end, $data['info']); $data['summary'] = $this->contests->contest_summary_bands($data['info']->start, $data['info']->end, $data['info']); - - // Run validation checks on QSO submission $this->load->library('form_validation'); diff --git a/application/models/logbook_model.php b/application/models/logbook_model.php index cbeb44fa..8e23da37 100644 --- a/application/models/logbook_model.php +++ b/application/models/logbook_model.php @@ -188,7 +188,8 @@ class Logbook_model extends CI_Model { 'COL_IOTA' => $this->input->post('iota_ref'), 'COL_QTH' => $this->input->post('qth'), 'COL_FREQ_RX' => '0', - 'COL_COUNTRY' => $this->input->post('country'), + 'COL_STX_STRING' => $this->input->post('stx_string'), + 'COL_SRX_STRING' => $this->input->post('srx_string') ); $this->db->where('COL_PRIMARY_KEY', $this->input->post('id')); @@ -271,7 +272,7 @@ class Logbook_model extends CI_Model { 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_QSL_SENT'); + $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_QSL_SENT, COL_STX_STRING, COL_SRX_STRING'); $this->db->order_by("COL_TIME_ON", "desc"); $query = $this->db->get($this->config->item('table_name'), $num, $offset); @@ -280,7 +281,7 @@ class Logbook_model extends CI_Model { } function get_last_qsos($num) { - $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'); + $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_STX_STRING, COL_SRX_STRING'); $this->db->order_by("COL_TIME_ON", "desc"); $this->db->limit($num); $query = $this->db->get($this->config->item('table_name')); @@ -556,42 +557,50 @@ class Logbook_model extends CI_Model { $time_off = date('Y-m-d', strtotime($record['qso_date'])) ." ".date('H:i', strtotime($record['time_on'])); } - + // Store Freq if(isset($record['freq'])) { $cleansedstring = preg_replace('#\W#', '', $record['freq']); $freq = $cleansedstring."000"; } else { $freq = "0"; } + + // Store Name if(isset($record['name'])) { $name = $record['name']; } else { $name = ""; } + + // Store Notes if(isset($record['NOTES'])) { $comment = $record['NOTES']; } else { $comment = ""; } + // Store Sat Name if(isset($record['sat_name'])) { $sat_name = $record['sat_name']; } else { $sat_name = ""; } + // Store Satellite Mode if(isset($record['sat_mode'])) { $sat_mode = $record['sat_mode']; } else { $sat_mode = ""; } + // Store Gridsquare if(isset($record['gridsquare'])) { $gridsquare = $record['gridsquare']; } else { $gridsquare = ""; } + // Store or find country name if(isset($record['country'])) { $country = $record['country']; } else { @@ -610,31 +619,40 @@ class Logbook_model extends CI_Model { } } + // Store QTH if(isset($record['qth'])) { $qth = $record['qth']; } else { $qth = ""; } + // Store Propagation Mode if(isset($record['prop_mode'])) { $prop_mode = $record['prop_mode']; } else { $prop_mode = ""; } - + // RST recevied if(isset($record['rst_rcvd'])) { $rst_rx = $record['rst_rcvd']; } else { $rst_rx = "59" ; } - if(isset($record['rst_sent'])) { + // RST Sent + if(isset($record['rst_sent'])) { $rst_tx = $record['rst_sent']; } else { $rst_tx = "59" ; } + if(isset($record['band'])) { + $band = $record['band']; + } else { + $band = null; + } + $this->db->where('COL_CALL', $record['call']); $this->db->where('COL_TIME_ON', $time_on); @@ -665,6 +683,8 @@ class Logbook_model extends CI_Model { 'COL_BAND_RX' => 0, 'COL_ANT_AZ' => 0, 'COL_ANT_EL' => 0, + 'COL_STX_STRING' => $record['stx'], + 'COL_SRX_STRING' => $record['srx'] ); $this->add_qso($data); diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index 24326e4c..885d817e 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -95,8 +95,8 @@ COL_TIME_ON); echo date('H:i', $timestamp); ?> COL_PRIMARY_KEY; ?>">COL_CALL); ?> COL_MODE; ?> - COL_RST_SENT; ?> - COL_RST_RCVD; ?> + COL_RST_SENT; ?> COL_STX_STRING) { ?>(COL_STX_STRING;?>) + COL_RST_RCVD; ?> COL_SRX_STRING) { ?>(COL_SRX_STRING;?>) COL_SAT_NAME != null) { ?> COL_SAT_NAME; ?> diff --git a/application/views/qso/edit.php b/application/views/qso/edit.php index ebff6bb7..92fcc576 100644 --- a/application/views/qso/edit.php +++ b/application/views/qso/edit.php @@ -49,6 +49,20 @@ + + + TX Serial + + + + + + + RX Serial + + + + Locator diff --git a/application/views/view_log/index.php b/application/views/view_log/index.php index 12fdfac2..d4be7525 100644 --- a/application/views/view_log/index.php +++ b/application/views/view_log/index.php @@ -103,8 +103,8 @@ COL_TIME_ON); echo date('H:i', $timestamp); ?> COL_PRIMARY_KEY; ?>">COL_CALL); ?> COL_MODE; ?> - COL_RST_SENT; ?> - COL_RST_RCVD; ?> + COL_RST_SENT; ?> COL_STX_STRING) { ?>(COL_STX_STRING;?>) + COL_RST_RCVD; ?> COL_SRX_STRING) { ?>(COL_SRX_STRING;?>) COL_SAT_NAME != null) { ?> COL_SAT_NAME; ?> diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index b3f591f0..b3761ece 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -77,12 +77,12 @@ margin: 10px 0; RST Sent - COL_RST_SENT; ?> + COL_RST_SENT; ?> COL_STX_STRING) { ?>(COL_STX_STRING;?>) RST Recv - COL_RST_RCVD; ?> + COL_RST_RCVD; ?> COL_SRX_STRING) { ?>(COL_SRX_STRING;?>) COL_GRIDSQUARE != null) { ?>