mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-27 01:24:16 +00:00
Lookup CQ zones in qrz/hamqth
This commit is contained in:
@@ -115,6 +115,7 @@ class Logbook extends CI_Controller {
|
||||
"callsign_state" => "",
|
||||
"callsign_us_county" => "",
|
||||
"callsign_ituz" => "",
|
||||
"callsign_cqz" => "",
|
||||
"qsl_manager" => "",
|
||||
"bearing" => "",
|
||||
"workedBefore" => false,
|
||||
@@ -147,6 +148,7 @@ class Logbook extends CI_Controller {
|
||||
$return['callsign_state'] = $this->nval($callbook['state'] ?? '', $this->logbook_model->call_state($callsign));
|
||||
$return['callsign_us_county'] = $this->nval($callbook['us_county'] ?? '', $this->logbook_model->call_us_county($callsign));
|
||||
$return['callsign_ituz'] = $this->nval($callbook['ituz'] ?? '', $this->logbook_model->call_ituzone($callsign));
|
||||
$return['callsign_cqz'] = $this->nval($callbook['cqz'] ?? '', $this->logbook_model->call_cqzone($callsign));
|
||||
$return['workedBefore'] = $this->worked_grid_before($return['callsign_qra'], $band, $mode);
|
||||
$return['confirmed'] = $this->confirmed_grid_before($return['callsign_qra'], $band, $mode);
|
||||
$return['timesWorked'] = $this->logbook_model->times_worked($lookupcall);
|
||||
|
||||
@@ -95,6 +95,7 @@ class Hamqth {
|
||||
$data['state'] = (string)$xml->search->us_state;
|
||||
$data['error'] = (string)$xml->session->error;
|
||||
$data['ituz'] = (string)$xml->search->itu;
|
||||
$data['cqz'] = (string)$xml->search->cq;
|
||||
|
||||
if ($xml->search->country == "United States") {
|
||||
$data['us_county'] = (string)$xml->search->us_county;
|
||||
@@ -114,6 +115,7 @@ class Hamqth {
|
||||
$data['state'] = '';
|
||||
$data['error'] = (string)$xml->session->error;
|
||||
$data['ituz'] = '';
|
||||
$data['cqz'] = '';
|
||||
|
||||
$data['us_county'] = '';
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ class Qrz {
|
||||
$data['qslmgr'] = (string)$xml->Callsign->qslmgr;
|
||||
$data['image'] = (string)$xml->Callsign->image;
|
||||
$data['ituz'] = (string)$xml->Callsign->ituzone;
|
||||
$data['cqz'] = (string)$xml->Callsign->cqzone;
|
||||
|
||||
if ($xml->Callsign->country == "United States") {
|
||||
$data['us_county'] = (string)$xml->Callsign->county;
|
||||
@@ -130,6 +131,7 @@ class Qrz {
|
||||
$data['image'] = (string)$xml->Callsign->image;
|
||||
$data['us_county'] = '';
|
||||
$data['ituz'] = '';
|
||||
$data['cqz'] = '';
|
||||
|
||||
}
|
||||
} finally {
|
||||
|
||||
@@ -1608,6 +1608,28 @@ class Logbook_model extends CI_Model {
|
||||
}
|
||||
}
|
||||
|
||||
function call_cqzone($callsign) {
|
||||
$this->db->select('COL_CALL, COL_CQZ');
|
||||
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
|
||||
$this->db->where('COL_CALL', $callsign);
|
||||
$this->db->where('station_profile.user_id', $this->session->userdata('user_id'));
|
||||
$where = "COL_CQZ != \"\"";
|
||||
|
||||
$this->db->where($where);
|
||||
|
||||
$this->db->order_by("COL_TIME_ON", "desc");
|
||||
$this->db->limit(1);
|
||||
$query = $this->db->get($this->config->item('table_name'));
|
||||
if ($query->num_rows() > 0)
|
||||
{
|
||||
$data = $query->row();
|
||||
$qsl_cqz = $data->COL_CQZ;
|
||||
return $qsl_cqz;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
function call_qth($callsign) {
|
||||
$this->db->select('COL_CALL, COL_QTH, COL_TIME_ON');
|
||||
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
|
||||
|
||||
@@ -895,7 +895,11 @@ $( document ).ready(function() {
|
||||
|
||||
$('#dxcc_id').val(result.dxcc.adif).multiselect('refresh');
|
||||
await updateStateDropdown('#dxcc_id', '#stateInputLabel', '#location_us_county', '#stationCntyInputEdit');
|
||||
$('#cqz').val(result.dxcc.cqz);
|
||||
if (result.callsign_cqz != '') {
|
||||
$('#cqz').val(result.callsign_cqz);
|
||||
} else {
|
||||
$('#cqz').val(result.dxcc.cqz);
|
||||
}
|
||||
|
||||
if (result.callsign_ituz != '') {
|
||||
$('#ituz').val(result.callsign_ituz);
|
||||
|
||||
Reference in New Issue
Block a user