[QSO Entry] County can now be saved and changed when editing a QSO.

这个提交包含在:
Andreas 2021-01-31 15:27:56 +01:00
父节点 7892846e8a
当前提交 44a1dd5691
共有 4 个文件被更改,包括 68 次插入1 次删除

查看文件

@ -150,6 +150,7 @@ class Logbook_model extends CI_Model {
'COL_DXCC' => $dxcc_id, 'COL_DXCC' => $dxcc_id,
'COL_CQZ' => $cqz, 'COL_CQZ' => $cqz,
'COL_STATE' => trim($this->input->post('usa_state')), 'COL_STATE' => trim($this->input->post('usa_state')),
'COL_USACA_COUNTIES' => trim($this->input->post('county')),
'COL_SOTA_REF' => trim($this->input->post('sota_ref')), 'COL_SOTA_REF' => trim($this->input->post('sota_ref')),
'COL_SIG' => trim($this->input->post('sig')), 'COL_SIG' => trim($this->input->post('sig')),
'COL_SIG_INFO' => trim($this->input->post('sig_info')), 'COL_SIG_INFO' => trim($this->input->post('sig_info')),
@ -529,7 +530,8 @@ class Logbook_model extends CI_Model {
'COL_QSL_VIA' => $this->input->post('qsl_via_callsign'), 'COL_QSL_VIA' => $this->input->post('qsl_via_callsign'),
'station_id' => $this->input->post('station_profile'), 'station_id' => $this->input->post('station_profile'),
'COL_OPERATOR' => $this->input->post('operator_callsign'), 'COL_OPERATOR' => $this->input->post('operator_callsign'),
'COL_STATE' =>$this->input->post('usa_state') 'COL_STATE' =>$this->input->post('usa_state'),
'COL_USACA_COUNTIES' =>$this->input->post('usa_county'),
); );
if ($this->exists_qrz_api_key($data['station_id'])) { if ($this->exists_qrz_api_key($data['station_id'])) {

查看文件

@ -2040,6 +2040,26 @@ $(document).ready(function(){
nl2br: false, nl2br: false,
message: html, message: html,
onshown: function(dialog) { onshown: function(dialog) {
var state = $("#input_usa_state option:selected").text();
if (state != "") {
$("#stationCntyInput").prop('disabled', false);
selectize_usa_county();
}
$('#input_usa_state').change(function(){
var state = $("#input_usa_state option:selected").text();
if (state != "") {
$("#stationCntyInput").prop('disabled', false);
selectize_usa_county();
} else {
$("#stationCntyInput").prop('disabled', true);
$('#stationCntyInput')[0].selectize.destroy();
$("#stationCntyInput").val("");
}
});
$('#sota_ref').selectize({ $('#sota_ref').selectize({
maxItems: 1, maxItems: 1,
closeAfterSelect: true, closeAfterSelect: true,
@ -2101,6 +2121,40 @@ $(document).ready(function(){
}); });
} }
function selectize_usa_county() {
var baseURL= "<?php echo base_url();?>";
$('#stationCntyInput').selectize({
maxItems: 1,
closeAfterSelect: true,
loadThrottle: 250,
valueField: 'name',
labelField: 'name',
searchField: 'name',
options: [],
create: false,
load: function(query, callback) {
var state = $("#input_usa_state option:selected").text();
if (!query || state == "") return callback();
$.ajax({
url: baseURL+'index.php/qso/get_county',
type: 'GET',
dataType: 'json',
data: {
query: query,
state: state,
},
error: function() {
callback();
},
success: function(res) {
callback(res);
}
});
}
});
}
function qso_save() { function qso_save() {
var baseURL= "<?php echo base_url();?>"; var baseURL= "<?php echo base_url();?>";
var myform = document.getElementById("qsoform"); var myform = document.getElementById("qsoform");

查看文件

@ -371,6 +371,11 @@
</select> </select>
</div> </div>
<div class="form-group">
<label for="stationCntyInput">USA County</label>
<input disabled="disabled" class="form-control" id="stationCntyInput" type="text" name="usa_county" value="<?php echo $qso->COL_USACA_COUNTIES; ?>" />
</div>
<div class="form-group"> <div class="form-group">
<label for="iota_ref">IOTA</label> <label for="iota_ref">IOTA</label>
<select class="custom-select" id="iota_ref" name="iota_ref"> <select class="custom-select" id="iota_ref" name="iota_ref">

查看文件

@ -144,6 +144,12 @@
</tr> </tr>
<?php } ?> <?php } ?>
<?php if($row->COL_USACA_COUNTIES != null) { ?>
<tr>
<td>USA County:</td>
<td><?php echo $row->COL_USACA_COUNTIES; ?></td>
</tr>
<?php } ?>
<?php if($row->COL_NAME != null) { ?> <?php if($row->COL_NAME != null) { ?>
<tr> <tr>