Also use VUCC_GRIDS from LoTW cnfm to update QSO record
这个提交包含在:
父节点
10bb0beb10
当前提交
fb7c448b58
共有 2 个文件被更改,包括 28 次插入 和 18 次删除
|
|
@ -512,6 +512,12 @@ class Lotw extends CI_Controller {
|
|||
$qsl_gridsquare = "";
|
||||
}
|
||||
|
||||
if (isset($record['vucc_grids'])) {
|
||||
$qsl_vucc_grids = $record['vucc_grids'];
|
||||
} else {
|
||||
$qsl_vucc_grids = "";
|
||||
}
|
||||
|
||||
if (isset($record['iota'])) {
|
||||
$iota = $record['iota'];
|
||||
} else {
|
||||
|
|
@ -536,7 +542,7 @@ class Lotw extends CI_Controller {
|
|||
$ituz = "";
|
||||
}
|
||||
|
||||
$lotw_status = $this->logbook_model->lotw_update($time_on, $record['call'], $record['band'], $qsl_date, $record['qsl_rcvd'], $state, $qsl_gridsquare, $iota, $cnty, $cqz, $ituz, $record['station_callsign']);
|
||||
$lotw_status = $this->logbook_model->lotw_update($time_on, $record['call'], $record['band'], $qsl_date, $record['qsl_rcvd'], $state, $qsl_gridsquare, $qsl_vucc_grids, $iota, $cnty, $cqz, $ituz, $record['station_callsign']);
|
||||
|
||||
$table .= "<tr>";
|
||||
$table .= "<td>".$record['station_callsign']."</td>";
|
||||
|
|
@ -546,7 +552,7 @@ class Lotw extends CI_Controller {
|
|||
$table .= "<td>".$record['qsl_rcvd']."</td>";
|
||||
$table .= "<td>".$qsl_date."</td>";
|
||||
$table .= "<td>".$state."</td>";
|
||||
$table .= "<td>".$qsl_gridsquare."</td>";
|
||||
$table .= "<td>".($qsl_gridsquare != '' ? $qsl_gridsquare : $qsl_vucc_grids)."</td>";
|
||||
$table .= "<td>".$iota."</td>";
|
||||
$table .= "<td>QSO Record: ".$status[0]."</td>";
|
||||
$table .= "<td>LoTW Record: ".$lotw_status."</td>";
|
||||
|
|
|
|||
|
|
@ -2636,7 +2636,7 @@ class Logbook_model extends CI_Model {
|
|||
}
|
||||
}
|
||||
|
||||
function lotw_update($datetime, $callsign, $band, $qsl_date, $qsl_status, $state, $qsl_gridsquare, $iota, $cnty, $cqz, $ituz, $station_callsign) {
|
||||
function lotw_update($datetime, $callsign, $band, $qsl_date, $qsl_status, $state, $qsl_gridsquare, $qsl_vucc_grids, $iota, $cnty, $cqz, $ituz, $station_callsign) {
|
||||
|
||||
$data = array(
|
||||
'COL_LOTW_QSLRDATE' => $qsl_date,
|
||||
|
|
@ -2670,24 +2670,28 @@ class Logbook_model extends CI_Model {
|
|||
$this->db->update($this->config->item('table_name'), $data);
|
||||
unset($data);
|
||||
|
||||
if($qsl_gridsquare != "") {
|
||||
if($qsl_gridsquare != "" || $qsl_vucc_grids != "") {
|
||||
$data = array(
|
||||
'COL_GRIDSQUARE' => $qsl_gridsquare,
|
||||
'COL_DISTANCE' => 0
|
||||
);
|
||||
$this->db->select('station_profile.station_gridsquare as station_gridsquare');
|
||||
$this->db->where('date_format(COL_TIME_ON, \'%Y-%m-%d %H:%i\') = "'.$datetime.'"');
|
||||
$this->db->where('COL_CALL', $callsign);
|
||||
$this->db->where('COL_BAND', $band);
|
||||
$this->db->join('station_profile', $this->config->item('table_name').'.station_id = station_profile.station_id', 'left outer');
|
||||
$this->db->limit(1);
|
||||
$query = $this->db->get($this->config->item('table_name'));
|
||||
$row = $query->row();
|
||||
if (isset($row)) {
|
||||
$station_gridsquare = $row->station_gridsquare;
|
||||
$this->load->library('Qra');
|
||||
|
||||
$data['COL_DISTANCE'] = $this->qra->distance($station_gridsquare, $qsl_gridsquare, 'K');
|
||||
if ($qsl_gridsquare != "") {
|
||||
$data['COL_GRIDSQUARE'] = $qsl_gridsquare;
|
||||
$this->db->select('station_profile.station_gridsquare as station_gridsquare');
|
||||
$this->db->where('date_format(COL_TIME_ON, \'%Y-%m-%d %H:%i\') = "'.$datetime.'"');
|
||||
$this->db->where('COL_CALL', $callsign);
|
||||
$this->db->where('COL_BAND', $band);
|
||||
$this->db->join('station_profile', $this->config->item('table_name').'.station_id = station_profile.station_id', 'left outer');
|
||||
$this->db->limit(1);
|
||||
$query = $this->db->get($this->config->item('table_name'));
|
||||
$row = $query->row();
|
||||
if (isset($row)) {
|
||||
$station_gridsquare = $row->station_gridsquare;
|
||||
$this->load->library('Qra');
|
||||
|
||||
$data['COL_DISTANCE'] = $this->qra->distance($station_gridsquare, $qsl_gridsquare, 'K');
|
||||
}
|
||||
} elseif ($qsl_vucc_grids != "") {
|
||||
$data['COL_VUCC_GRIDS'] = $qsl_vucc_grids;
|
||||
}
|
||||
|
||||
$this->db->where('date_format(COL_TIME_ON, \'%Y-%m-%d %H:%i\') = "'.$datetime.'"');
|
||||
|
|
|
|||
正在加载…
在新工单中引用