From a0eee12275c7c9e58f88eef57ece91663ace3222 Mon Sep 17 00:00:00 2001 From: AndreasK79 Date: Fri, 17 Apr 2020 12:38:01 +0200 Subject: [PATCH] Improved the edit QSO window with dropdowns. DXCC and CQ can now be changed as well. --- application/controllers/Qso.php | 4 +- application/models/Logbook_model.php | 7 +- application/views/qso/edit.php | 358 +++++++++++++++++++-------- 3 files changed, 266 insertions(+), 103 deletions(-) diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php index c66884d8..deaf96e4 100755 --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -105,7 +105,9 @@ class QSO extends CI_Controller { $this->form_validation->set_rules('time_off', 'End Date', 'required'); $this->form_validation->set_rules('callsign', 'Callsign', 'required'); - $data = $query->row(); + $data['qso'] = $query->row(); + $data['dxcc'] = $this->logbook_model->fetchDxcc(); + $data['iota'] = $this->logbook_model->fetchIota(); if ($this->form_validation->run() == FALSE) { diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 6e6d9a53..c5002195 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -301,6 +301,9 @@ class Logbook_model extends CI_Model { /* Edit QSO */ function edit() { + $entity = $this->get_entity($this->input->post('dxcc_id')); + $country = $entity['name']; + $data = array( 'COL_TIME_ON' => $this->input->post('time_on'), 'COL_TIME_OFF' => $this->input->post('time_off'), @@ -314,7 +317,9 @@ class Logbook_model extends CI_Model { 'COL_VUCC_GRIDS' => strtoupper(trim($this->input->post('vucc_grids'))), 'COL_COMMENT' => $this->input->post('comment'), 'COL_NAME' => $this->input->post('name'), - 'COL_COUNTRY' => $this->input->post('country'), + 'COL_COUNTRY' => $country, + 'COL_DXCC'=> $this->input->post('dxcc_id'), + 'COL_CQZ' => $this->input->post('cqz'), 'COL_SAT_NAME' => $this->input->post('sat_name'), 'COL_SAT_MODE' => $this->input->post('sat_mode'), 'COL_QSLSDATE' => date('Y-m-d'), diff --git a/application/views/qso/edit.php b/application/views/qso/edit.php index 83d6680f..63606e93 100755 --- a/application/views/qso/edit.php +++ b/application/views/qso/edit.php @@ -43,100 +43,173 @@ @@ -208,11 +364,11 @@
@@ -220,7 +376,7 @@
- +
@@ -228,11 +384,11 @@
@@ -241,11 +397,11 @@
@@ -256,11 +412,11 @@
@@ -269,11 +425,11 @@
@@ -282,11 +438,11 @@
@@ -294,11 +450,11 @@
@@ -319,14 +475,14 @@
- +
@@ -338,7 +494,7 @@
- Delete QSO + Delete QSO