From e656b8ce7fd2347111d7d970347ba76c77e904fa Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Mon, 12 Jun 2023 13:57:01 +0200 Subject: [PATCH 1/6] [OQRS] Fixed broken OQRS --- application/views/oqrs/index.php | 57 +++++++++++++++++--------------- assets/js/sections/oqrs.js | 23 +++++++------ 2 files changed, 43 insertions(+), 37 deletions(-) diff --git a/application/views/oqrs/index.php b/application/views/oqrs/index.php index 90a9ef8a..36bb4e80 100644 --- a/application/views/oqrs/index.php +++ b/application/views/oqrs/index.php @@ -10,9 +10,9 @@
-
+
-
'; @@ -24,37 +24,41 @@ '; echo '
'; ?> - - +
+ '; if ($stations->result() != NULL) { ?> -
- - + result() as $station) { echo ''."\n"; } ?> - - -
-
+ + + +
+ -
- + - - + \ No newline at end of file diff --git a/assets/js/sections/oqrs.js b/assets/js/sections/oqrs.js index e8b5b867..2f310439 100644 --- a/assets/js/sections/oqrs.js +++ b/assets/js/sections/oqrs.js @@ -1,10 +1,13 @@ +let station_id; + function loadStationInfo() { - $(".stationinfo").empty(); + station_id = $("#station").val(); + // $(".stationinfo").empty(); $(".searchinfo").empty(); $.ajax({ url: base_url+'index.php/oqrs/get_station_info', type: 'post', - data: {'station_id': $("#station").val()}, + data: {'station_id': station_id}, success: function (data) { if (data.count > 0) { $(".stationinfo").append('
' + data.count + ' Qsos logged between ' + data.mindate + ' and ' + data.maxdate + '.

'); @@ -34,7 +37,7 @@ function searchOqrs() { $.ajax({ url: base_url+'index.php/oqrs/get_qsos', type: 'post', - data: {'station_id': $("#station").val(), 'callsign': $("#oqrssearch").val().toUpperCase()}, + data: {'station_id': station_id, 'callsign': $("#oqrssearch").val().toUpperCase()}, success: function (data) { $(".searchinfo").append(data); } @@ -76,7 +79,7 @@ function notInLog() { $.ajax({ url: base_url + 'index.php/oqrs/not_in_log', type: 'post', - data: {'station_id': $("#station").val(), 'callsign': $("#oqrssearch").val().toUpperCase()}, + data: {'station_id': station_id, 'callsign': $("#oqrssearch").val().toUpperCase()}, success: function(html) { $(".searchinfo").html(html); $('.qsotime').change(function() { @@ -94,11 +97,11 @@ function notInLog() { } function saveNotInLogRequest() { + const qsos = []; $(".alertinfo").remove(); if ($("#emailInput").val() == '') { $(".searchinfo").prepend('

×You need to fill out an email address!
'); } else { - const qsos = []; $(".notinlog-table tbody tr").each(function(i) { var data = []; var datecell = $("#date", this).val(); @@ -119,7 +122,7 @@ function saveNotInLogRequest() { $.ajax({ url: base_url+'index.php/oqrs/save_not_in_log', type: 'post', - data: { 'station_id': $("#station").val(), + data: { 'station_id': station_id, 'callsign': $("#oqrssearch").val().toUpperCase(), 'email': $("#emailInput").val(), 'message': $("#messageInput").val(), @@ -166,7 +169,7 @@ function requestOqrs() { $.ajax({ url: base_url + 'index.php/oqrs/request_form', type: 'post', - data: {'station_id': $("#station").val(), 'callsign': $("#oqrssearch").val().toUpperCase()}, + data: {'station_id': station_id, 'callsign': $("#oqrssearch").val().toUpperCase()}, success: function(html) { $(".searchinfo").html(html); /* time input shortcut */ @@ -194,11 +197,11 @@ function requestOqrs() { } function submitOqrsRequest() { + const qsos = []; $(".alertinfo").remove(); if ($("#emailInput").val() == '') { $(".searchinfo").prepend('

×You need to fill out an email address!
'); } else { - const qsos = []; $(".result-table tbody tr").each(function(i) { var data = []; var datecell = $("#date", this).val(); @@ -220,7 +223,7 @@ function submitOqrsRequest() { $.ajax({ url: base_url+'index.php/oqrs/save_oqrs_request', type: 'post', - data: { 'station_id': $("#station").val(), + data: { 'station_id': station_id, 'callsign': $("#oqrssearch").val().toUpperCase(), 'email': $("#emailInput").val(), 'message': $("#messageInput").val(), @@ -238,11 +241,11 @@ function submitOqrsRequest() { } function submitOqrsRequestGrouped() { + const qsos = []; $(".alertinfo").remove(); if ($("#emailInput").val() == '') { $(".searchinfo").prepend('

×You need to fill out an email address!
'); } else { - const qsos = []; $(".result-table tbody tr").each(function(i) { var data = []; var stationid = this.getAttribute('stationid');; From 3858c589fea9349865bb48f3baa3e6613ab427ce Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Mon, 12 Jun 2023 18:41:03 +0200 Subject: [PATCH 2/6] [OQRS] Fix success message on grouped OQRS request --- assets/js/sections/oqrs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/sections/oqrs.js b/assets/js/sections/oqrs.js index 2f310439..069cd22e 100644 --- a/assets/js/sections/oqrs.js +++ b/assets/js/sections/oqrs.js @@ -279,7 +279,7 @@ function submitOqrsRequestGrouped() { success: function (data) { $(".stationinfo").empty(); $(".searchinfo").empty(); - $(".searchinfo").append('
×Your QSL request has been saved!
'); + $(".stationinfo").append('
×Your QSL request has been saved!
'); } }); } From 724399725c44fc94770cfd6c80d49580cd73eeee Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Mon, 12 Jun 2023 20:27:18 +0200 Subject: [PATCH 3/6] [OQRS] Fixed double search input when clicking proceed multiple times --- application/views/oqrs/index.php | 6 +++--- assets/js/sections/oqrs.js | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/application/views/oqrs/index.php b/application/views/oqrs/index.php index 36bb4e80..f087f83d 100644 --- a/application/views/oqrs/index.php +++ b/application/views/oqrs/index.php @@ -42,7 +42,6 @@ '; if ($stations->result() != NULL) { ?>
@@ -55,7 +54,7 @@
- +
- \ No newline at end of file + + \ No newline at end of file diff --git a/assets/js/sections/oqrs.js b/assets/js/sections/oqrs.js index 069cd22e..770f6283 100644 --- a/assets/js/sections/oqrs.js +++ b/assets/js/sections/oqrs.js @@ -2,7 +2,7 @@ let station_id; function loadStationInfo() { station_id = $("#station").val(); - // $(".stationinfo").empty(); + $(".resulttable").empty(); $(".searchinfo").empty(); $.ajax({ url: base_url+'index.php/oqrs/get_station_info', @@ -10,8 +10,8 @@ function loadStationInfo() { data: {'station_id': station_id}, success: function (data) { if (data.count > 0) { - $(".stationinfo").append('
' + data.count + ' Qsos logged between ' + data.mindate + ' and ' + data.maxdate + '.

'); - $(".stationinfo").append('
'); + $(".resulttable").append('
' + data.count + ' Qsos logged between ' + data.mindate + ' and ' + data.maxdate + '.

'); + $(".resulttable").append('
'); // Get the input field var input = document.getElementById("oqrssearch"); @@ -231,6 +231,7 @@ function submitOqrsRequest() { 'qslroute': $('input[name="qslroute"]:checked').val() }, success: function (data) { + $(".resulttable").empty(); $(".stationinfo").empty(); $(".searchinfo").empty(); $(".stationinfo").append('
×Your QSL request has been saved!
'); From 7204d958d85c8dbfd4e9a0c260a87a61b4c55083 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 13 Jun 2023 14:39:32 +0200 Subject: [PATCH 4/6] Set qsoid also for not found QSOs --- application/models/Oqrs_model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/models/Oqrs_model.php b/application/models/Oqrs_model.php index 06e38581..ccc12ef9 100644 --- a/application/models/Oqrs_model.php +++ b/application/models/Oqrs_model.php @@ -144,8 +144,8 @@ class Oqrs_model extends CI_Model { if ($qsoid > 0) { $data['status'] = '2'; - $data['qsoid'] = $qsoid; } + $data['qsoid'] = $qsoid; $this->db->insert('oqrs', $data); if(!in_array(xss_clean($postdata['station_id']), $station_ids)){ @@ -177,8 +177,8 @@ class Oqrs_model extends CI_Model { if ($qsoid > 0) { $data['status'] = '2'; - $data['qsoid'] = $qsoid; } + $data['qsoid'] = $qsoid; $this->db->insert('oqrs', $data); From fa07eb1961e9ed512a4ce38b29a7eee750b65911 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 13 Jun 2023 15:04:35 +0200 Subject: [PATCH 5/6] callsign input upper case for both OQRS search modes --- assets/css/general.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/css/general.css b/assets/css/general.css index 344c7a04..985cf3bf 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -135,7 +135,7 @@ thead > tr > td { text-transform: uppercase; } -.stationinfo #oqrssearch:valid { +#oqrssearch:valid { text-transform: uppercase; } @@ -440,4 +440,4 @@ div#station_logbooks_linked_table_paginate { #lotw_manual_results { padding-top: 10px; -} \ No newline at end of file +} From b80980b42db4b67d6be60cf0b3c01a355fb9a427 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Tue, 13 Jun 2023 20:38:29 +0200 Subject: [PATCH 6/6] [OQRS] Added so that enter works for submit in email input --- application/views/oqrs/request.php | 2 +- application/views/oqrs/request_grouped.php | 2 +- assets/js/sections/oqrs.js | 27 ++++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/application/views/oqrs/request.php b/application/views/oqrs/request.php index f028d731..7ed817a6 100644 --- a/application/views/oqrs/request.php +++ b/application/views/oqrs/request.php @@ -62,6 +62,6 @@ The following QSO(s) were found. Please fill out the date and time and submit yo Your e-mail address where we can contact you - diff --git a/application/views/oqrs/request_grouped.php b/application/views/oqrs/request_grouped.php index 7171f3f8..0cf56afc 100644 --- a/application/views/oqrs/request_grouped.php +++ b/application/views/oqrs/request_grouped.php @@ -59,7 +59,7 @@ The following QSO(s) were found. Please fill out the date and time and submit yo Your e-mail address where we can contact you -