From bc103249a8211a32527dae3468853240e79dd995 Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 16 Jun 2023 12:17:56 +0200 Subject: [PATCH] Update distance on editing QSO --- application/models/Logbook_model.php | 1 + application/views/qso/edit_ajax.php | 3 +++ assets/js/sections/common.js | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 20e5b3a2..177a5bd2 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -890,6 +890,7 @@ class Logbook_model extends CI_Model { 'COL_RST_SENT' => $this->input->post('rst_sent'), 'COL_GRIDSQUARE' => strtoupper(trim($this->input->post('locator'))), 'COL_VUCC_GRIDS' => strtoupper(trim($this->input->post('vucc_grids'))), + 'COL_DISTANCE' => $this->input->post('distance'), 'COL_COMMENT' => $this->input->post('comment'), 'COL_NAME' => $this->input->post('name'), 'COL_COUNTRY' => $country, diff --git a/application/views/qso/edit_ajax.php b/application/views/qso/edit_ajax.php index 618eade8..ba5a2cea 100644 --- a/application/views/qso/edit_ajax.php +++ b/application/views/qso/edit_ajax.php @@ -161,8 +161,11 @@
+
+ +
diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js index 1f9e764d..c2385bef 100644 --- a/assets/js/sections/common.js +++ b/assets/js/sections/common.js @@ -138,6 +138,13 @@ function qso_edit(id) { } }); + $('#locator').change(function(){ + $('#locator_info').load("logbook/searchbearing/" + $(this).val() + "/" + $('#stationProfile').val()).fadeIn("slow"); + $.get('logbook/searchdistance/' + $(this).val() + "/" + $('#stationProfile').val(), function(result) { + document.getElementById("distance").value = result; + }); + }); + $('#sota_ref_edit').selectize({ maxItems: 1, closeAfterSelect: true,