Import the state from LoTW if its provided #561

这个提交包含在:
Peter Goodhall 2020-08-10 23:07:55 +01:00
父节点 65f7ae92cf
当前提交 89054af0ea
共有 2 个文件被更改,包括 26 次插入8 次删除

查看文件

@ -28,13 +28,14 @@ class Lotw extends CI_Controller {
$this->adif_parser->initialize();
$tableheaders = "<table>";
$tableheaders = "<table width=\"100%\">";
$tableheaders .= "<tr class=\"titles\">";
$tableheaders .= "<td>QSO Date</td>";
$tableheaders .= "<td>Call</td>";
$tableheaders .= "<td>Mode</td>";
$tableheaders .= "<td>LoTW QSL Received</td>";
$tableheaders .= "<td>Date LoTW Confirmed</td>";
$tableheaders .= "<td>State</td>";
$tableheaders .= "<td>Log Status</td>";
$tableheaders .= "<td>LoTW Status</td>";
$tableheaders .= "</tr>";
@ -76,7 +77,13 @@ class Lotw extends CI_Controller {
}
} else {
$lotw_status = $this->logbook_model->lotw_update($time_on, $record['call'], $record['band'], $qsl_date, $record['qsl_rcvd']);
if (isset($record['state'])) {
$state = $record['state'];
} else {
$state = "";
}
$lotw_status = $this->logbook_model->lotw_update($time_on, $record['call'], $record['band'], $qsl_date, $record['qsl_rcvd'], $state);
}
@ -86,6 +93,7 @@ class Lotw extends CI_Controller {
$table .= "<td>".$record['mode']."</td>";
$table .= "<td>".$record['qsl_rcvd']."</td>";
$table .= "<td>".$qsl_date."</td>";
$table .= "<td>".$state."</td>";
$table .= "<td>QSO Record: ".$status."</td>";
$table .= "<td>LoTW Record: ".$lotw_status."</td>";
$table .= "</tr>";

查看文件

@ -1291,12 +1291,22 @@ class Logbook_model extends CI_Model {
}
}
function lotw_update($datetime, $callsign, $band, $qsl_date, $qsl_status) {
$data = array(
'COL_LOTW_QSLRDATE' => $qsl_date,
'COL_LOTW_QSL_RCVD' => $qsl_status,
'COL_LOTW_QSL_SENT' => 'Y'
);
function lotw_update($datetime, $callsign, $band, $qsl_date, $qsl_status, $state) {
if($state != "") {
$data = array(
'COL_LOTW_QSLRDATE' => $qsl_date,
'COL_LOTW_QSL_RCVD' => $qsl_status,
'COL_LOTW_QSL_SENT' => 'Y',
'COL_STATE' => $state
);
} else {
$data = array(
'COL_LOTW_QSLRDATE' => $qsl_date,
'COL_LOTW_QSL_RCVD' => $qsl_status,
'COL_LOTW_QSL_SENT' => 'Y'
);
}
$this->db->where('date_format(COL_TIME_ON, \'%Y-%m-%d %H:%i\') = "'.$datetime.'"');
$this->db->where('COL_CALL', $callsign);