Add function for looking up DOK from previous QSO

这个提交包含在:
phl0 2022-04-14 23:24:37 +02:00
父节点 b9e2885aa1
当前提交 826f30309a
找不到此签名对应的密钥
GPG 密钥 ID: 48EA1E640798CA9A
共有 3 个文件被更改,包括 32 次插入2 次删除

查看文件

@ -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;
}
}
}

查看文件

@ -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"){

查看文件

@ -383,8 +383,12 @@ $("#callsign").focusout(function() {
var $select = $('#darc_dok').selectize();
var selectize = $select[0].selectize;
if (result.dxcc.adif == '230') {
selectize.addOption({name:'N18'});
selectize.setValue('N18', false);
$.get('lookup/dok/' + $('#callsign').val().toUpperCase(), function(result) {
if (result) {
selectize.addOption({name: result});
selectize.setValue(result, false);
}
});
} else {
selectize.clear();
}