Merge pull request #2195 from AndreasK79/oqrs_broken_fix
这个提交包含在:
当前提交
2ae48ac0a2
共有 6 个文件被更改,包括 80 次插入 和 46 次删除
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="stationinfo">
|
||||
<div class="stationinfo">
|
||||
|
||||
<?php
|
||||
<?php
|
||||
if ($global_oqrs_text) {
|
||||
echo $global_oqrs_text;
|
||||
echo '<br /><br />';
|
||||
|
|
@ -24,37 +24,40 @@
|
|||
</form>';
|
||||
echo '<div class="searchinfo"></div>';
|
||||
?>
|
||||
<script>// Get the input field
|
||||
var input = document.getElementById("oqrssearch");
|
||||
<script>
|
||||
// Get the input field
|
||||
var input = document.getElementById("oqrssearch");
|
||||
|
||||
// Execute a function when the user presses a key on the keyboard
|
||||
input.addEventListener("keypress", function(event) {
|
||||
// If the user presses the "Enter" key on the keyboard
|
||||
if (event.key === "Enter") {
|
||||
// Cancel the default action, if needed
|
||||
event.preventDefault();
|
||||
// Trigger the button element with a click
|
||||
document.getElementById("stationbuttonsubmit").click();
|
||||
}
|
||||
});</script>
|
||||
<?php
|
||||
// Execute a function when the user presses a key on the keyboard
|
||||
input.addEventListener("keypress", function(event) {
|
||||
// If the user presses the "Enter" key on the keyboard
|
||||
if (event.key === "Enter") {
|
||||
// Cancel the default action, if needed
|
||||
event.preventDefault();
|
||||
// Trigger the button element with a click
|
||||
document.getElementById("stationbuttonsubmit").click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
echo '<div class="resulttable">';
|
||||
if ($stations->result() != NULL) { ?>
|
||||
|
||||
<form class="form-inline" enctype="multipart/form-data">
|
||||
<label class="my-1 mr-2" for="station">Select station: </label>
|
||||
<select id="station" class="custom-select my-1 mr-sm-2" name="station">
|
||||
<?php foreach($stations->result() as $station) {
|
||||
<form class="form-inline" enctype="multipart/form-data">
|
||||
<label class="my-1 mr-2" for="station">Select station: </label>
|
||||
<select id="station" class="custom-select my-1 mr-sm-2" name="station">
|
||||
<?php foreach($stations->result() as $station) {
|
||||
echo '<option value="' . $station->station_id . '">' . $station->station_profile_name . ' - ' . $station->station_callsign . '</option>'."\n";
|
||||
} ?>
|
||||
</select>
|
||||
<button id="button1id" type="button" onclick="loadStationInfo();" name="button1id" class="btn btn-sm btn-primary"> Proceed</button>
|
||||
</form>
|
||||
</div>
|
||||
</select>
|
||||
<button id="button1id" type="button" onclick="loadStationInfo();" name="button1id" class="btn btn-sm btn-primary"> Proceed</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="resulttable"></div>
|
||||
|
||||
<div class="searchinfo"></div>
|
||||
<?php
|
||||
<div class="searchinfo"></div>
|
||||
<?php
|
||||
}
|
||||
|
||||
else {
|
||||
|
|
@ -65,4 +68,4 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -62,6 +62,6 @@ The following QSO(s) were found. Please fill out the date and time and submit yo
|
|||
<small id="emailInputHelp" class="form-text text-muted">Your e-mail address where we can contact you</small>
|
||||
</div>
|
||||
|
||||
<button type="button" onclick="submitOqrsRequest(this.form);" class="btn btn-sm btn-primary"><i
|
||||
<button type="button" id="requestSubmit" onclick="submitOqrsRequest(this.form);" class="btn btn-sm btn-primary"><i
|
||||
class="fas fa-plus-square"></i> Submit request</button>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ The following QSO(s) were found. Please fill out the date and time and submit yo
|
|||
<small id="emailInputHelp" class="form-text text-muted">Your e-mail address where we can contact you</small>
|
||||
</div>
|
||||
|
||||
<button type="button" onclick="submitOqrsRequestGrouped(this.form);" class="btn btn-sm btn-primary"><i
|
||||
<button type="button" id="requestGroupedSubmit" onclick="submitOqrsRequestGrouped(this.form);" class="btn btn-sm btn-primary"><i
|
||||
class="fas fa-plus-square"></i> Submit request</button>
|
||||
</form>
|
||||
<?php } else {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,17 @@
|
|||
let station_id;
|
||||
|
||||
function loadStationInfo() {
|
||||
$(".stationinfo").empty();
|
||||
station_id = $("#station").val();
|
||||
$(".resulttable").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('<br />' + data.count + ' Qsos logged between ' + data.mindate + ' and ' + data.maxdate + '.<br /><br />');
|
||||
$(".stationinfo").append('<form class="form-inline" onsubmit="return false;"><label class="my-1 mr-2" for="oqrssearch">Enter your callsign: </label><input class="form-control mr-sm-2" id="oqrssearch" type="search" name="callsign" placeholder="Search Callsign" aria-label="Search" required="required"><button onclick="searchOqrs();" class="btn btn-sm btn-primary" id="stationbuttonsubmit" type="button"><i class="fas fa-search"></i> Search</button></form>');
|
||||
$(".resulttable").append('<br />' + data.count + ' Qsos logged between ' + data.mindate + ' and ' + data.maxdate + '.<br /><br />');
|
||||
$(".resulttable").append('<form class="form-inline" onsubmit="return false;"><label class="my-1 mr-2" for="oqrssearch">Enter your callsign: </label><input class="form-control mr-sm-2" id="oqrssearch" type="search" name="callsign" placeholder="Search Callsign" aria-label="Search" required="required"><button onclick="searchOqrs();" class="btn btn-sm btn-primary" id="stationbuttonsubmit" type="button"><i class="fas fa-search"></i> Search</button></form>');
|
||||
// Get the input field
|
||||
var input = document.getElementById("oqrssearch");
|
||||
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -68,6 +71,20 @@ function searchOqrsGrouped() {
|
|||
"paging": false,
|
||||
"scrollX": true,
|
||||
});
|
||||
|
||||
// Get the input field
|
||||
var input = document.getElementById("emailInput");
|
||||
|
||||
// Execute a function when the user presses a key on the keyboard
|
||||
input.addEventListener("keypress", function(event) {
|
||||
// If the user presses the "Enter" key on the keyboard
|
||||
if (event.key === "Enter") {
|
||||
// Cancel the default action, if needed
|
||||
event.preventDefault();
|
||||
// Trigger the button element with a click
|
||||
document.getElementById("requestGroupedSubmit").click();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -76,7 +93,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 +111,11 @@ function notInLog() {
|
|||
}
|
||||
|
||||
function saveNotInLogRequest() {
|
||||
const qsos = [];
|
||||
$(".alertinfo").remove();
|
||||
if ($("#emailInput").val() == '') {
|
||||
$(".searchinfo").prepend('<div class="alertinfo"><br /><div class="alert alert-warning"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>You need to fill out an email address!</div></div>');
|
||||
} else {
|
||||
const qsos = [];
|
||||
$(".notinlog-table tbody tr").each(function(i) {
|
||||
var data = [];
|
||||
var datecell = $("#date", this).val();
|
||||
|
|
@ -119,7 +136,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 +183,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 */
|
||||
|
|
@ -189,16 +206,29 @@ function requestOqrs() {
|
|||
"paging": false,
|
||||
"scrollX": true,
|
||||
});
|
||||
// Get the input field
|
||||
var input = document.getElementById("emailInput");
|
||||
|
||||
// Execute a function when the user presses a key on the keyboard
|
||||
input.addEventListener("keypress", function(event) {
|
||||
// If the user presses the "Enter" key on the keyboard
|
||||
if (event.key === "Enter") {
|
||||
// Cancel the default action, if needed
|
||||
event.preventDefault();
|
||||
// Trigger the button element with a click
|
||||
document.getElementById("requestSubmit").click();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function submitOqrsRequest() {
|
||||
const qsos = [];
|
||||
$(".alertinfo").remove();
|
||||
if ($("#emailInput").val() == '') {
|
||||
$(".searchinfo").prepend('<div class="alertinfo"><br /><div class="alert alert-warning"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>You need to fill out an email address!</div></div>');
|
||||
} else {
|
||||
const qsos = [];
|
||||
$(".result-table tbody tr").each(function(i) {
|
||||
var data = [];
|
||||
var datecell = $("#date", this).val();
|
||||
|
|
@ -220,7 +250,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(),
|
||||
|
|
@ -228,6 +258,7 @@ function submitOqrsRequest() {
|
|||
'qslroute': $('input[name="qslroute"]:checked').val()
|
||||
},
|
||||
success: function (data) {
|
||||
$(".resulttable").empty();
|
||||
$(".stationinfo").empty();
|
||||
$(".searchinfo").empty();
|
||||
$(".stationinfo").append('<br /><div class="alert alert-success"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>Your QSL request has been saved!</div>');
|
||||
|
|
@ -238,11 +269,11 @@ function submitOqrsRequest() {
|
|||
}
|
||||
|
||||
function submitOqrsRequestGrouped() {
|
||||
const qsos = [];
|
||||
$(".alertinfo").remove();
|
||||
if ($("#emailInput").val() == '') {
|
||||
$(".searchinfo").prepend('<div class="alertinfo"><br /><div class="alert alert-warning"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>You need to fill out an email address!</div></div>');
|
||||
} else {
|
||||
const qsos = [];
|
||||
$(".result-table tbody tr").each(function(i) {
|
||||
var data = [];
|
||||
var stationid = this.getAttribute('stationid');;
|
||||
|
|
@ -276,7 +307,7 @@ function submitOqrsRequestGrouped() {
|
|||
success: function (data) {
|
||||
$(".stationinfo").empty();
|
||||
$(".searchinfo").empty();
|
||||
$(".searchinfo").append('<br /><div class="alert alert-success"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>Your QSL request has been saved!</div>');
|
||||
$(".stationinfo").append('<br /><div class="alert alert-success"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>Your QSL request has been saved!</div>');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
正在加载…
在新工单中引用