[OQRS] Fixed broken OQRS

这个提交包含在:
Andreas 2023-06-12 13:57:01 +02:00
父节点 f87997f223
当前提交 e656b8ce7f
共有 2 个文件被更改,包括 43 次插入37 次删除

查看文件

@ -24,7 +24,8 @@
</form>'; </form>';
echo '<div class="searchinfo"></div>'; echo '<div class="searchinfo"></div>';
?> ?>
<script>// Get the input field <script>
// Get the input field
var input = document.getElementById("oqrssearch"); var input = document.getElementById("oqrssearch");
// Execute a function when the user presses a key on the keyboard // Execute a function when the user presses a key on the keyboard
@ -36,7 +37,9 @@
// Trigger the button element with a click // Trigger the button element with a click
document.getElementById("stationbuttonsubmit").click(); document.getElementById("stationbuttonsubmit").click();
} }
});</script> });
</script>
</div>
<?php <?php
} else { } else {
echo '<div class="resulttable">'; echo '<div class="resulttable">';
@ -52,6 +55,7 @@
<button id="button1id" type="button" onclick="loadStationInfo();" name="button1id" class="btn btn-sm btn-primary"> Proceed</button> <button id="button1id" type="button" onclick="loadStationInfo();" name="button1id" class="btn btn-sm btn-primary"> Proceed</button>
</form> </form>
</div> </div>
</div>
<div class="searchinfo"></div> <div class="searchinfo"></div>
<?php <?php
@ -65,4 +69,3 @@
</div> </div>
</div> </div>
</div>

查看文件

@ -1,10 +1,13 @@
let station_id;
function loadStationInfo() { function loadStationInfo() {
$(".stationinfo").empty(); station_id = $("#station").val();
// $(".stationinfo").empty();
$(".searchinfo").empty(); $(".searchinfo").empty();
$.ajax({ $.ajax({
url: base_url+'index.php/oqrs/get_station_info', url: base_url+'index.php/oqrs/get_station_info',
type: 'post', type: 'post',
data: {'station_id': $("#station").val()}, data: {'station_id': station_id},
success: function (data) { success: function (data) {
if (data.count > 0) { if (data.count > 0) {
$(".stationinfo").append('<br />' + data.count + ' Qsos logged between ' + data.mindate + ' and ' + data.maxdate + '.<br /><br />'); $(".stationinfo").append('<br />' + data.count + ' Qsos logged between ' + data.mindate + ' and ' + data.maxdate + '.<br /><br />');
@ -34,7 +37,7 @@ function searchOqrs() {
$.ajax({ $.ajax({
url: base_url+'index.php/oqrs/get_qsos', url: base_url+'index.php/oqrs/get_qsos',
type: 'post', type: 'post',
data: {'station_id': $("#station").val(), 'callsign': $("#oqrssearch").val().toUpperCase()}, data: {'station_id': station_id, 'callsign': $("#oqrssearch").val().toUpperCase()},
success: function (data) { success: function (data) {
$(".searchinfo").append(data); $(".searchinfo").append(data);
} }
@ -76,7 +79,7 @@ function notInLog() {
$.ajax({ $.ajax({
url: base_url + 'index.php/oqrs/not_in_log', url: base_url + 'index.php/oqrs/not_in_log',
type: 'post', type: 'post',
data: {'station_id': $("#station").val(), 'callsign': $("#oqrssearch").val().toUpperCase()}, data: {'station_id': station_id, 'callsign': $("#oqrssearch").val().toUpperCase()},
success: function(html) { success: function(html) {
$(".searchinfo").html(html); $(".searchinfo").html(html);
$('.qsotime').change(function() { $('.qsotime').change(function() {
@ -94,11 +97,11 @@ function notInLog() {
} }
function saveNotInLogRequest() { function saveNotInLogRequest() {
const qsos = [];
$(".alertinfo").remove(); $(".alertinfo").remove();
if ($("#emailInput").val() == '') { if ($("#emailInput").val() == '') {
$(".searchinfo").prepend('<div class="alertinfo"><br /><div class="alert alert-warning"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>You need to fill out an email address!</div></div>'); $(".searchinfo").prepend('<div class="alertinfo"><br /><div class="alert alert-warning"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>You need to fill out an email address!</div></div>');
} else { } else {
const qsos = [];
$(".notinlog-table tbody tr").each(function(i) { $(".notinlog-table tbody tr").each(function(i) {
var data = []; var data = [];
var datecell = $("#date", this).val(); var datecell = $("#date", this).val();
@ -119,7 +122,7 @@ function saveNotInLogRequest() {
$.ajax({ $.ajax({
url: base_url+'index.php/oqrs/save_not_in_log', url: base_url+'index.php/oqrs/save_not_in_log',
type: 'post', type: 'post',
data: { 'station_id': $("#station").val(), data: { 'station_id': station_id,
'callsign': $("#oqrssearch").val().toUpperCase(), 'callsign': $("#oqrssearch").val().toUpperCase(),
'email': $("#emailInput").val(), 'email': $("#emailInput").val(),
'message': $("#messageInput").val(), 'message': $("#messageInput").val(),
@ -166,7 +169,7 @@ function requestOqrs() {
$.ajax({ $.ajax({
url: base_url + 'index.php/oqrs/request_form', url: base_url + 'index.php/oqrs/request_form',
type: 'post', type: 'post',
data: {'station_id': $("#station").val(), 'callsign': $("#oqrssearch").val().toUpperCase()}, data: {'station_id': station_id, 'callsign': $("#oqrssearch").val().toUpperCase()},
success: function(html) { success: function(html) {
$(".searchinfo").html(html); $(".searchinfo").html(html);
/* time input shortcut */ /* time input shortcut */
@ -194,11 +197,11 @@ function requestOqrs() {
} }
function submitOqrsRequest() { function submitOqrsRequest() {
const qsos = [];
$(".alertinfo").remove(); $(".alertinfo").remove();
if ($("#emailInput").val() == '') { if ($("#emailInput").val() == '') {
$(".searchinfo").prepend('<div class="alertinfo"><br /><div class="alert alert-warning"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>You need to fill out an email address!</div></div>'); $(".searchinfo").prepend('<div class="alertinfo"><br /><div class="alert alert-warning"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>You need to fill out an email address!</div></div>');
} else { } else {
const qsos = [];
$(".result-table tbody tr").each(function(i) { $(".result-table tbody tr").each(function(i) {
var data = []; var data = [];
var datecell = $("#date", this).val(); var datecell = $("#date", this).val();
@ -220,7 +223,7 @@ function submitOqrsRequest() {
$.ajax({ $.ajax({
url: base_url+'index.php/oqrs/save_oqrs_request', url: base_url+'index.php/oqrs/save_oqrs_request',
type: 'post', type: 'post',
data: { 'station_id': $("#station").val(), data: { 'station_id': station_id,
'callsign': $("#oqrssearch").val().toUpperCase(), 'callsign': $("#oqrssearch").val().toUpperCase(),
'email': $("#emailInput").val(), 'email': $("#emailInput").val(),
'message': $("#messageInput").val(), 'message': $("#messageInput").val(),
@ -238,11 +241,11 @@ function submitOqrsRequest() {
} }
function submitOqrsRequestGrouped() { function submitOqrsRequestGrouped() {
const qsos = [];
$(".alertinfo").remove(); $(".alertinfo").remove();
if ($("#emailInput").val() == '') { if ($("#emailInput").val() == '') {
$(".searchinfo").prepend('<div class="alertinfo"><br /><div class="alert alert-warning"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>You need to fill out an email address!</div></div>'); $(".searchinfo").prepend('<div class="alertinfo"><br /><div class="alert alert-warning"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>You need to fill out an email address!</div></div>');
} else { } else {
const qsos = [];
$(".result-table tbody tr").each(function(i) { $(".result-table tbody tr").each(function(i) {
var data = []; var data = [];
var stationid = this.getAttribute('stationid');; var stationid = this.getAttribute('stationid');;