A little more errorcatching and added cont to the API

This commit is contained in:
int2001
2024-01-30 09:17:18 +00:00
parent f54d7b21dd
commit b00f76f3ce
2 changed files with 19 additions and 14 deletions

View File

@@ -516,6 +516,7 @@ class API extends CI_Controller {
"dxcc_long" => "",
"dxcc_cqz" => "",
"dxcc_flag" => "",
"cont" => "",
"name" => "",
"gridsquare" => "",
"location" => "",
@@ -574,12 +575,14 @@ class API extends CI_Controller {
$return['dxcc_lat'] = $ans2['lat'];
$return['dxcc_long'] = $ans2['long'];
$return['dxcc_cqz'] = $ans2['cqz'];
$return['cont'] = $ans2['cont'];
} else {
$return['dxcc_id'] = $callsign_dxcc_lookup['adif'];
$return['dxcc'] = $callsign_dxcc_lookup['entity'];
$return['dxcc_lat'] = $callsign_dxcc_lookup['lat'];
$return['dxcc_long'] = $callsign_dxcc_lookup['long'];
$return['dxcc_cqz'] = $callsign_dxcc_lookup['cqz'];
$return['cont'] = $callsign_dxcc_lookup['cont'];
}
/*
@@ -599,6 +602,7 @@ class API extends CI_Controller {
$return['state'] = $call_lookup_results->COL_STATE;
$return['us_county'] = $call_lookup_results->COL_CNTY;
$return['dxcc_id'] = $call_lookup_results->COL_DXCC;
$return['cont'] = $call_lookup_results->COL_CONT;
if ($return['gridsquare'] != "") {
$return['latlng'] = $this->qralatlng($return['gridsquare']);

View File

@@ -1281,22 +1281,22 @@ class Logbook_model extends CI_Model {
*
*/
function call_lookup_result($callsign) {
$this->db->select('COL_CALL, COL_NAME, COL_QSL_VIA, COL_GRIDSQUARE, COL_QTH, COL_IOTA, COL_TIME_ON, COL_STATE, COL_CNTY, COL_DXCC');
$this->db->where('COL_CALL', $callsign);
$where = "COL_NAME != \"\"";
$this->db->select('COL_CALL, COL_NAME, COL_QSL_VIA, COL_GRIDSQUARE, COL_QTH, COL_IOTA, COL_TIME_ON, COL_STATE, COL_CNTY, COL_DXCC, COL_CONT');
$this->db->where('COL_CALL', $callsign);
$where = "COL_NAME != \"\"";
$this->db->where($where);
$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'));
$name = "";
if ($query->num_rows() > 0)
{
$data = $query->row();
}
$this->db->order_by("COL_TIME_ON", "desc");
$this->db->limit(1);
$query = $this->db->get($this->config->item('table_name'));
$name = "";
$data=[];
if ($query->num_rows() > 0) {
$data = $query->row();
}
return $data;
return $data;
}
/* Callsign QRA */
@@ -3939,7 +3939,7 @@ function lotw_last_qsl_date($user_id) {
$csadditions = '/^P$|^R$|^A$|^M$/';
$dxcc_exceptions = $this->db->select('`entity`, `adif`, `cqz`')
$dxcc_exceptions = $this->db->select('`entity`, `adif`, `cqz`,`cont`')
->where('call', $call)
->where('(start <= ', $date)
->or_where('start is null)', NULL, false)
@@ -3989,6 +3989,7 @@ function lotw_last_qsl_date($user_id) {
$result = $this->wpx($call, 1); # use the wpx prefix instead
if ($result == '') {
$row['adif'] = 0;
$row['cont'] = '';
$row['entity'] = '- NONE -';
$row['cqz'] = 0;
$row['long'] = '0';