From 33fb946256e4d7ecfadc14132f25673e4f30d192 Mon Sep 17 00:00:00 2001
From: Andreas <6977712+AndreasK79@users.noreply.github.com>
Date: Thu, 26 Oct 2023 20:46:13 +0200
Subject: [PATCH] [SimpleFLE] Saving QSO partially works
---
application/views/simplefle/index.php | 2 +-
assets/js/sections/simplefle.js | 54 +++++++++++++++++++++------
2 files changed, 44 insertions(+), 12 deletions(-)
diff --git a/application/views/simplefle/index.php b/application/views/simplefle/index.php
index 89442a83..ea714baa 100644
--- a/application/views/simplefle/index.php
+++ b/application/views/simplefle/index.php
@@ -119,7 +119,7 @@ var Bands = ;
-
+
diff --git a/assets/js/sections/simplefle.js b/assets/js/sections/simplefle.js
index 865c2142..c486b91d 100644
--- a/assets/js/sections/simplefle.js
+++ b/assets/js/sections/simplefle.js
@@ -478,17 +478,6 @@ $(".js-download-adif").click(function () {
download(filename, adif);
});
-
-
-
-
-
-
-
-
-
-
-
function isBandModeEntered() {
let isBandModeOK = true;
qsoList.forEach((item) => {
@@ -607,3 +596,46 @@ $(document).ready(function () {
handleInput();
}
});
+
+$(".js-save-to-log").click(function () {
+ if (false === isBandModeEntered()) {
+ alert("Some QSO do not have band and/or mode defined!");
+
+ return false;
+ }
+
+ var operator = $("#operator").val();
+ operator = operator.toUpperCase();
+ var ownCallsign = $("#station-call").val().toUpperCase();
+ ownCallsign = ownCallsign.toUpperCase();
+ var mySotaWwff = $("#my-sota-wwff").val().toUpperCase();
+
+ var myPower = $("#my-power").val();
+ var myGrid = $("#my-grid").val().toUpperCase();
+
+ qsoList.forEach((item) => {
+ var callsign = item[2];
+ var rst_rcvd = item[7];
+ var rst_sent = item[6];
+ var start_date = (item[0].replace("-", "").replace("-", "")) + " " + (item[1].replace(":", ""));
+ var band = item[4];
+ var mode = item[5];
+ var freq_display = item[3];
+
+ $.ajax({
+ url: base_url + 'index.php/qso/saveqso',
+ type: 'post',
+ data: { callsign: callsign,
+ rst_rcvd: rst_rcvd,
+ rst_sent: rst_sent,
+ start_date: start_date,
+ band: band,
+ mode: mode,
+ freq_display: freq_display,
+ },
+ success: function (result) {
+ }
+ });
+ });
+
+});