Merge pull request #1457 from phl0/prefillDOK

Prefill DOK field from previous QSO
pull/1458/head
Peter Goodhall 2022-04-15 16:55:34 +01:00 zatwierdzone przez GitHub
commit 887340b635
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 42 dodań i 0 usunięć

Wyświetl plik

@ -112,4 +112,20 @@ class Lookup extends CI_Controller {
}
public function dok($call) {
if($call) {
$uppercase_callsign = strtoupper($call);
}
// DOK results from logbook
$this->load->model('logbook_model');
$query = $this->logbook_model->get_dok($uppercase_callsign);
if ($query->row()) {
echo $query->row()->COL_DARC_DOK;
}
}
}

Wyświetl plik

@ -429,6 +429,16 @@ class Logbook_model extends CI_Model {
}
public function get_dok($callsign){
$this->db->select('COL_DARC_DOK');
$this->db->where('COL_CALL', $callsign);
$this->db->order_by("COL_TIME_ON", "desc");
$this->db->limit(1);
return $this->db->get($this->config->item('table_name'));
}
function add_qso($data, $skipexport = false) {
if ($data['COL_DXCC'] == "Not Found"){

Wyświetl plik

@ -286,6 +286,9 @@ function reset_fields() {
$('#input_usa_state').val("");
$('#qso-last-table').show();
$('#partial_view').hide();
var $select = $('#darc_dok').selectize();
var selectize = $select[0].selectize;
selectize.clear();
mymap.setView(pos, 12);
mymap.removeLayer(markers);
@ -377,6 +380,19 @@ $("#callsign").focusout(function() {
$('#hamqth_info').html('<a target="_blank" href="https://www.hamqth.com/'+find_callsign+'"><img width="32" height="32" src="'+base_url+'images/icons/hamqth.com.png"></a>');
$('#hamqth_info').attr('title', 'Lookup '+find_callsign+' info on hamqth.com');
var $select = $('#darc_dok').selectize();
var selectize = $select[0].selectize;
if (result.dxcc.adif == '230') {
$.get('lookup/dok/' + $('#callsign').val().toUpperCase(), function(result) {
if (result) {
selectize.addOption({name: result});
selectize.setValue(result, false);
}
});
} else {
selectize.clear();
}
$('#dxcc_id').val(result.dxcc.adif);
$('#cqz').val(result.dxcc.cqz);
$('#ituz').val(result.dxcc.ituz);