diff --git a/application/models/Contesting_model.php b/application/models/Contesting_model.php index 1b6d60d8..a3832258 100644 --- a/application/models/Contesting_model.php +++ b/application/models/Contesting_model.php @@ -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 . "'" . diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index d6715837..886f7633 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -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'); diff --git a/application/views/contesting/index.php b/application/views/contesting/index.php index 81255f89..f9f76c66 100644 --- a/application/views/contesting/index.php +++ b/application/views/contesting/index.php @@ -120,9 +120,9 @@ -
+ diff --git a/assets/js/sections/contesting.js b/assets/js/sections/contesting.js index 29fc5d87..68c7d559 100644 --- a/assets/js/sections/contesting.js +++ b/assets/js/sections/contesting.js @@ -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('