kopia lustrzana https://github.com/magicbug/Cloudlog
Logging is working. Contest exchange is being logged. Basic contest logging is now working.
rodzic
e557d92c47
commit
2229a1579b
|
@ -104,41 +104,7 @@ class QSO extends CI_Controller {
|
|||
*/
|
||||
public function saveqso() {
|
||||
$this->load->model('logbook_model');
|
||||
// Add QSO
|
||||
// $this->logbook_model->add();
|
||||
//change to create_qso function as add and create_qso duplicate functionality
|
||||
$this->logbook_model->create_qso();
|
||||
|
||||
// Store Basic QSO Info for reuse
|
||||
// Put data in an array first, then call set_userdata once.
|
||||
// This solves the problem of CI dumping out the session
|
||||
// cookie each time set_userdata is called.
|
||||
// For more info, see http://bizhole.com/codeigniter-nginx-error-502-bad-gateway/
|
||||
$qso_data = array(
|
||||
'start_date' => $this->input->post('start_date'),
|
||||
'start_time' => $this->input->post('start_time'),
|
||||
'time_stamp' => time(),
|
||||
'band' => $this->input->post('band'),
|
||||
'freq' => $this->input->post('freq_display'),
|
||||
'freq_rx' => $this->input->post('freq_display_rx'),
|
||||
'mode' => $this->input->post('mode'),
|
||||
'sat_name' => $this->input->post('sat_name'),
|
||||
'sat_mode' => $this->input->post('sat_mode'),
|
||||
'prop_mode' => $this->input->post('prop_mode'),
|
||||
'radio' => $this->input->post('radio'),
|
||||
'station_profile_id' => $this->input->post('station_profile'),
|
||||
'transmit_power' => $this->input->post('transmit_power')
|
||||
);
|
||||
|
||||
setcookie("radio", $qso_data['radio'], time()+3600*24*99);
|
||||
setcookie("station_profile_id", $qso_data['station_profile_id'], time()+3600*24*99);
|
||||
|
||||
$this->session->set_userdata($qso_data);
|
||||
|
||||
// If SAT name is set make it session set to sat
|
||||
if($this->input->post('sat_name')) {
|
||||
$this->session->set_userdata('prop_mode', 'SAT');
|
||||
}
|
||||
}
|
||||
|
||||
function edit() {
|
||||
|
|
|
@ -20,7 +20,27 @@ class Logbook_model extends CI_Model {
|
|||
|
||||
if($this->input->post('sat_name')) {
|
||||
$prop_mode = "SAT";
|
||||
}
|
||||
}
|
||||
|
||||
// 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');
|
||||
}
|
||||
} else {
|
||||
$srx_string = null;
|
||||
$stx_string = null;
|
||||
$srx = null;
|
||||
$stx = null;
|
||||
}
|
||||
|
||||
if($this->session->userdata('user_locator')){
|
||||
$locator = $this->session->userdata('user_locator');
|
||||
|
@ -108,8 +128,10 @@ class Logbook_model extends CI_Model {
|
|||
'COL_AGE' => null,
|
||||
'COL_TEN_TEN' => null,
|
||||
'COL_TX_PWR' => $tx_power,
|
||||
'COL_STX' => null,
|
||||
'COL_SRX' => null,
|
||||
'COL_STX' => $stx,
|
||||
'COL_SRX' => $srx,
|
||||
'COL_STX_STRING' => $stx_string,
|
||||
'COL_SRX_STRING' => $srx_string,
|
||||
'COL_NR_BURSTS' => null,
|
||||
'COL_NR_PINGS' => null,
|
||||
'COL_MAX_BURSTS' => null,
|
||||
|
|
|
@ -97,7 +97,6 @@
|
|||
<div class="form-group col-md-3">
|
||||
<label for="callsign">Callsign</label>
|
||||
<input type="text" class="form-control form-control-sm" id="callsign" name="callsign" required>
|
||||
<small id="callsign_info" class="badge badge-secondary"></small> <small id="lotw_info" class="badge badge-light"></small>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-1">
|
||||
|
@ -152,9 +151,6 @@
|
|||
<div class="card log">
|
||||
<div class="card-header"><h5 class="card-title">Logbook (for this logging session)</h5></div>
|
||||
|
||||
<div id="qso-last-table">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table-sm table qsotable table-bordered table-hover table-striped table-condensed text-center">
|
||||
<thead>
|
||||
<tr class="log_title titles">
|
||||
|
@ -172,8 +168,6 @@
|
|||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2439,6 +2439,29 @@ function deleteQsl(id) {
|
|||
<?php if ($this->uri->segment(1) == "contesting") { ?>
|
||||
<script>
|
||||
|
||||
// Callsign always has focus on load
|
||||
$("#callsign").focus();
|
||||
|
||||
// Init serial sent as 1 when lading page
|
||||
$("#exch_sent").val(1);
|
||||
|
||||
// realtime clock
|
||||
$(function($) {
|
||||
var options = {
|
||||
utc: true,
|
||||
format: '%H:%M:%S'
|
||||
}
|
||||
$('.input_time').jclock(options);
|
||||
});
|
||||
|
||||
$(function($) {
|
||||
var options = {
|
||||
utc: true,
|
||||
format: '%d-%m-%Y'
|
||||
}
|
||||
$('.input_date').jclock(options);
|
||||
});
|
||||
|
||||
// We don't want spaces to be written in callsign
|
||||
$(function() {
|
||||
$('#callsign').on('keypress', function(e) {
|
||||
|
@ -2466,10 +2489,8 @@ function deleteQsl(id) {
|
|||
reset_log_fields();
|
||||
} else if ((e.keyCode == 10 || e.keyCode == 13) && (e.ctrlKey || e.metaKey)) {
|
||||
logQso();
|
||||
} else if (e.ctrlKey && e.altKey && e.which == 89) {
|
||||
alert("Ctrl + Alt + Y shortcut combination was pressed");
|
||||
} else if (e.ctrlKey && e.altKey && e.shiftKey && e.which == 85) {
|
||||
alert("Ctrl + Alt + Shift + U shortcut combination was pressed");
|
||||
} else if (e.which == 27) {
|
||||
reset_log_fields();
|
||||
// Space to jump to either callsign or sent exchange
|
||||
} else if (e.which == 32) {
|
||||
if ($(document.activeElement).attr("id") == "callsign") {
|
||||
|
@ -2483,7 +2504,6 @@ function deleteQsl(id) {
|
|||
|
||||
};
|
||||
|
||||
|
||||
// On Key up check and suggest callsigns
|
||||
$("#callsign").keyup(function() {
|
||||
var call = $(this).val();
|
||||
|
@ -2513,7 +2533,7 @@ function deleteQsl(id) {
|
|||
$('.callsign-suggestions').text("");
|
||||
$(".qsotable tbody").prepend('<tr>' +
|
||||
'<td>'+$("#start_date").val()+ ' ' + $("#start_time").val() + '</td>' +
|
||||
'<td>'+$("#callsign").val()+'</td>' +
|
||||
'<td>'+$("#callsign").val().toUpperCase()+'</td>' +
|
||||
'<td>'+$("#band").val()+'</td>' +
|
||||
'<td>'+$("#mode").val()+'</td>' +
|
||||
'<td>'+$("#rst_sent").val()+'</td>' +
|
||||
|
@ -2522,16 +2542,6 @@ function deleteQsl(id) {
|
|||
'<td>'+$("#exch_recv").val()+'</td>' +
|
||||
'</tr>');
|
||||
|
||||
$('#name').val("");
|
||||
|
||||
$('#callsign').val("");
|
||||
$('#comment').val("");
|
||||
$('#exch_recv').val("");
|
||||
if ($('input[name=exchangeradio]:checked', '#qso_input').val() == "serial") {
|
||||
$("#exch_sent").val(+$("#exch_sent").val() + 1);
|
||||
}
|
||||
$("#callsign").focus();
|
||||
|
||||
var baseURL= "<?php echo base_url();?>";
|
||||
var formdata = new FormData(document.getElementById("qso_input"));
|
||||
$.ajax({
|
||||
|
@ -2542,7 +2552,15 @@ function deleteQsl(id) {
|
|||
contentType: false,
|
||||
enctype: 'multipart/form-data',
|
||||
success: function (html) {
|
||||
alert("logged");
|
||||
$('#name').val("");
|
||||
|
||||
$('#callsign').val("");
|
||||
$('#comment').val("");
|
||||
$('#exch_recv').val("");
|
||||
if ($('input[name=exchangeradio]:checked', '#qso_input').val() == "serial") {
|
||||
$("#exch_sent").val(+$("#exch_sent").val() + 1);
|
||||
}
|
||||
$("#callsign").focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue