[Contesting] Spacebar jumping is now working. Filling of QSO table is working. Logging the QSO and exchanges correct is working.
这个提交包含在:
父节点
6f448e056a
当前提交
e6387c92a5
共有 4 个文件被更改,包括 108 次插入 和 54 次删除
|
|
@ -21,7 +21,10 @@ class Contesting_model extends CI_Model {
|
|||
$date = DateTime::createFromFormat('d-m-Y H:i:s', $qsoarray[0]);
|
||||
$date = $date->format('Y-m-d H:i:s');
|
||||
|
||||
$sql = "SELECT date_format(col_time_on, '%d-%m-%Y %H:%i:%s') as col_time_on, col_call, col_band, col_mode, col_submode, col_rst_sent, col_rst_rcvd, col_srx, col_srx_string, col_stx, col_stx_string FROM " .
|
||||
$sql = "SELECT date_format(col_time_on, '%d-%m-%Y %H:%i:%s') as col_time_on, col_call, col_band, col_mode,
|
||||
col_submode, col_rst_sent, col_rst_rcvd, coalesce(col_srx, '') col_srx, coalesce(col_srx_string, '') col_srx_string,
|
||||
coalesce(col_stx, '') col_stx, coalesce(col_stx_string, '') col_stx_string, coalesce(col_gridsquare, '') col_gridsquare,
|
||||
coalesce(col_vucc_grids, '') col_vucc_grids FROM " .
|
||||
$this->config->item('table_name') .
|
||||
" WHERE station_id = " . $station_id .
|
||||
" AND COL_TIME_ON >= '" . $date . "'" .
|
||||
|
|
|
|||
|
|
@ -23,18 +23,11 @@ class Logbook_model extends CI_Model {
|
|||
}
|
||||
|
||||
// Contest exchange, need to separate between serial and other type of exchange
|
||||
if($this->input->post('exchangeradio')) {
|
||||
if($this->input->post('exchangeradio') == "serial") {
|
||||
$srx = $this->input->post('exch_recv');
|
||||
$stx = $this->input->post('exch_sent');
|
||||
$srx_string = null;
|
||||
$stx_string = null;
|
||||
} else {
|
||||
$srx = null;
|
||||
$stx = null;
|
||||
$srx_string = $this->input->post('exch_recv');
|
||||
$stx_string = $this->input->post('exch_sent');
|
||||
}
|
||||
if($this->input->post('exchangetype')) {
|
||||
$srx_string = $this->input->post('exch_recv');
|
||||
$stx_string = $this->input->post('exch_sent');
|
||||
$srx = $this->input->post('exch_serial_r');
|
||||
$stx = $this->input->post('exch_serial_s');
|
||||
} else {
|
||||
$srx_string = null;
|
||||
$stx_string = null;
|
||||
|
|
@ -162,7 +155,7 @@ class Logbook_model extends CI_Model {
|
|||
'COL_SIG' => trim($this->input->post('sig')),
|
||||
'COL_SIG_INFO' => trim($this->input->post('sig_info')),
|
||||
'COL_DARC_DOK' => trim($this->input->post('darc_dok')),
|
||||
'COL_NOTES' => $this->input->post('notes'),
|
||||
'COL_NOTES' => $this->input->post('notes'),
|
||||
);
|
||||
|
||||
$station_id = $this->input->post('station_profile');
|
||||
|
|
|
|||
|
|
@ -120,9 +120,9 @@
|
|||
<input type="text" class="form-control form-control-sm" name="rst_sent" id="rst_sent" value="59">
|
||||
</div>
|
||||
|
||||
<div style="display:none" class="form-group col-md-1 serialr">
|
||||
<label for="exch_serial_r">Serial (R)</label>
|
||||
<input type="number" class="form-control form-control-sm" name="exch_serial_r" id="exch_serial_r" value="">
|
||||
<div style="display:none" class="form-group col-md-1 serials">
|
||||
<label for="exch_serial_s">Serial (S)</label>
|
||||
<input type="number" class="form-control form-control-sm" name="exch_serial_s" id="exch_serial_s" value="">
|
||||
</div>
|
||||
|
||||
<div style="display:none" class="form-group col-md-1 exchanges">
|
||||
|
|
@ -130,9 +130,9 @@
|
|||
<input type="text" class="form-control form-control-sm" name="exch_sent" id="exch_sent" value="">
|
||||
</div>
|
||||
|
||||
<div style="display:none" class="form-group col-md-2 gridsquarer">
|
||||
<label for="exch_gridsquare_r">Gridsquare (S)</label>
|
||||
<input type="text" class="form-control form-control-sm" name="exch_gridsquare_r" id="exch_gridsquare_r" value="">
|
||||
<div style="display:none" class="form-group col-md-2 gridsquares">
|
||||
<label for="exch_gridsquare_s">Gridsquare (S)</label>
|
||||
<input disabled type="text" class="form-control form-control-sm" name="exch_gridsquare_s" id="exch_gridsquare_s" value="<?php echo strtoupper($_SESSION['user_locator']) ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-1">
|
||||
|
|
@ -140,21 +140,20 @@
|
|||
<input type="text" class="form-control form-control-sm" name="rst_recv" id="rst_recv" value="59">
|
||||
</div>
|
||||
|
||||
<div style="display:none" class="form-group col-md-1 serials">
|
||||
<label for="exch_serial_s">Serial (S)</label>
|
||||
<input type="number" class="form-control form-control-sm" name="exch_serial_s" id="exch_serial_s" value="">
|
||||
</div>
|
||||
<div style="display:none" class="form-group col-md-1 serialr">
|
||||
<label for="exch_serial_r">Serial (R)</label>
|
||||
<input type="number" class="form-control form-control-sm" name="exch_serial_r" id="exch_serial_r" value="">
|
||||
</div>
|
||||
|
||||
<div style="display:none" class="form-group col-md-1 exchanger">
|
||||
<label for="exch_recv"><?php echo $this->lang->line('gen_hamradio_exchange_recv_short'); ?></label>
|
||||
<input type="text" class="form-control form-control-sm" name="exch_recv" id="exch_recv" value="">
|
||||
</div>
|
||||
|
||||
<div style="display:none" class="form-group col-md-2 gridsquares">
|
||||
<label for="exch_gridsquare_s">Gridsquare (S)</label>
|
||||
<input type="text" class="form-control form-control-sm" name="exch_gridsquare_s" id="exch_gridsquare_s" value="">
|
||||
<div style="display:none" class="form-group col-md-2 gridsquarer">
|
||||
<label for="exch_gridsquare_r">Gridsquare (R)</label>
|
||||
<input type="text" class="form-control form-control-sm" name="locator" id="exch_gridsquare_r" value="">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
|
|
@ -199,6 +198,10 @@
|
|||
<th><?php echo $this->lang->line('gen_hamradio_rstr'); ?></th>
|
||||
<th><?php echo $this->lang->line('gen_hamradio_exchange_sent_short'); ?></th>
|
||||
<th><?php echo $this->lang->line('gen_hamradio_exchange_recv_short'); ?></th>
|
||||
<th>Serial (R)</th>
|
||||
<th>Serial (S)</th>
|
||||
<th>Gridsquare</th>
|
||||
<th>Vucc Gridsquare</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
|
@ -209,3 +212,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
//var_dump($_SESSION);
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -98,15 +98,61 @@ document.onkeyup = function(e) {
|
|||
logQso();
|
||||
} else if (e.which == 27) {
|
||||
reset_log_fields();
|
||||
// Space to jump to either callsign or sent exchange
|
||||
// Space to jump to either callsign or the various exchanges
|
||||
} else if (e.which == 32) {
|
||||
if ($(document.activeElement).attr("id") == "callsign") {
|
||||
$("#exch_recv").focus();
|
||||
return false;
|
||||
} else if ($(document.activeElement).attr("id") == "exch_recv") {
|
||||
$("#callsign").focus();
|
||||
return false;
|
||||
}
|
||||
var exchangetype = $("#exchangetype").val();
|
||||
if (exchangetype == 'Exchange') {
|
||||
if ($(document.activeElement).attr("id") == "callsign") {
|
||||
$("#exch_recv").focus();
|
||||
return false;
|
||||
} else if ($(document.activeElement).attr("id") == "exch_recv") {
|
||||
$("#callsign").focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (exchangetype == 'Serial') {
|
||||
if ($(document.activeElement).attr("id") == "callsign") {
|
||||
$("#exch_serial_r").focus();
|
||||
return false;
|
||||
} else if ($(document.activeElement).attr("id") == "exch_serial_r") {
|
||||
$("#callsign").focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (exchangetype == 'Serialexchange') {
|
||||
if ($(document.activeElement).attr("id") == "callsign") {
|
||||
$("#exch_serial_r").focus();
|
||||
return false;
|
||||
} else if ($(document.activeElement).attr("id") == "exch_serial_r") {
|
||||
$("#exch_recv").focus();
|
||||
return false;
|
||||
} else if ($(document.activeElement).attr("id") == "exch_recv") {
|
||||
$("#callsign").focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (exchangetype == 'Serialgridsquare') {
|
||||
if ($(document.activeElement).attr("id") == "callsign") {
|
||||
$("#exch_serial_r").focus();
|
||||
return false;
|
||||
} else if ($(document.activeElement).attr("id") == "exch_serial_r") {
|
||||
$("#exch_gridsquare_r").focus();
|
||||
return false;
|
||||
} else if ($(document.activeElement).attr("id") == "exch_gridsquare_r") {
|
||||
$("#callsign").focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (exchangetype == 'Gridsquare') {
|
||||
if ($(document.activeElement).attr("id") == "callsign") {
|
||||
$("#exch_gridsquare_r").focus();
|
||||
return false;
|
||||
} else if ($(document.activeElement).attr("id") == "exch_gridsquare_r") {
|
||||
$("#callsign").focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -250,15 +296,28 @@ function logQso() {
|
|||
$('.callsign-suggestions').text("");
|
||||
|
||||
var table = $('.qsotable').DataTable();
|
||||
var gridsquare = $("#exch_gridsquare_r").val();
|
||||
var vucc = '';
|
||||
|
||||
var data = [[$("#start_date").val()+ ' ' + $("#start_time").val(),
|
||||
if (gridsquare.indexOf(',') != -1) {
|
||||
vucc = gridsquare;
|
||||
gridsquare = '';
|
||||
}
|
||||
|
||||
var data = [[
|
||||
$("#start_date").val()+ ' ' + $("#start_time").val(),
|
||||
$("#callsign").val().toUpperCase(),
|
||||
$("#band").val(),
|
||||
$("#mode").val(),
|
||||
$("#rst_sent").val(),
|
||||
$("#rst_recv").val(),
|
||||
$("#exch_sent").val(),
|
||||
$("#exch_recv").val()]];
|
||||
$("#exch_recv").val(),
|
||||
$("#exch_serial_s").val(),
|
||||
$("#exch_serial_r").val(),
|
||||
gridsquare,
|
||||
vucc,
|
||||
]];
|
||||
|
||||
table.rows.add(data).draw();
|
||||
|
||||
|
|
@ -280,6 +339,8 @@ function logQso() {
|
|||
$('#callsign').val("");
|
||||
$('#comment').val("");
|
||||
$('#exch_recv').val("");
|
||||
$('#exch_gridsquare_r').val("");
|
||||
$('#exch_serial_r').val("");
|
||||
var exchangetype = $("#exchangetype").val();
|
||||
if (exchangetype == "Serial" || exchangetype == 'Serialexchange' || exchangetype == 'Serialgridsquare') {
|
||||
$("#exch_serial_s").val(+$("#exch_serial_s").val() + 1);
|
||||
|
|
@ -353,8 +414,7 @@ function restoreContestSession() {
|
|||
data: {'qso': qsodata,},
|
||||
success: function (html) {
|
||||
var mode = '';
|
||||
var sentexchange = '';
|
||||
var receivedexchange = '';
|
||||
|
||||
$.each(html, function(){
|
||||
if (this.col_submode == null || this.col_submode == '') {
|
||||
mode = this.col_mode;
|
||||
|
|
@ -362,18 +422,6 @@ function restoreContestSession() {
|
|||
mode = this.col_submode;
|
||||
}
|
||||
|
||||
if (this.col_srx == null || this.col_srx == '') {
|
||||
receivedexchange = this.col_srx_string;
|
||||
} else {
|
||||
receivedexchange = this.col_srx;
|
||||
}
|
||||
|
||||
if (this.col_stx == null || this.col_stx == '') {
|
||||
sentexchange = this.col_stx_string;
|
||||
} else {
|
||||
sentexchange = this.col_stx;
|
||||
}
|
||||
|
||||
$(".qsotable tbody").prepend('<tr>' +
|
||||
'<td>'+ this.col_time_on + '</td>' +
|
||||
'<td>'+ this.col_call + '</td>' +
|
||||
|
|
@ -381,8 +429,12 @@ function restoreContestSession() {
|
|||
'<td>'+ mode + '</td>' +
|
||||
'<td>'+ this.col_rst_sent + '</td>' +
|
||||
'<td>'+ this.col_rst_rcvd + '</td>' +
|
||||
'<td>'+ sentexchange + '</td>' +
|
||||
'<td>'+ receivedexchange + '</td>' +
|
||||
'<td>'+ this.col_stx_string + '</td>' +
|
||||
'<td>'+ this.col_srx_string + '</td>' +
|
||||
'<td>'+ this.col_stx + '</td>' +
|
||||
'<td>'+ this.col_srx + '</td>' +
|
||||
'<td>'+ this.col_gridsquare + '</td>' +
|
||||
'<td>'+ this.col_vucc_grids + '</td>' +
|
||||
'</tr>');
|
||||
});
|
||||
if (!$.fn.DataTable.isDataTable('.qsotable')) {
|
||||
|
|
|
|||
正在加载…
在新工单中引用