[SimpleFLE] Saving QSO partially works

pull/2624/head
Andreas 2023-10-26 20:46:13 +02:00
rodzic 8ab156297f
commit 33fb946256
2 zmienionych plików z 44 dodań i 12 usunięć

Wyświetl plik

@ -119,7 +119,7 @@ var Bands = <?php echo json_encode($bands);?>;
<button class="btn btn-primary js-reload-qso">Reload QSO list</button>
</div>
<div class="col-3 col-sm-3">
<button class="btn btn-warning js-download-adif">Save in Cloudlog</button>
<button class="btn btn-warning js-save-to-log">Save in Cloudlog</button>
</div>
<div class="col-3 col-sm-3">
<button class="btn btn-danger js-empty-qso">Clear logging session</button>

Wyświetl plik

@ -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) {
}
});
});
});