[LotW] Import IOTA info

This commit is contained in:
phl0 2022-05-09 14:44:32 +02:00
parent 98dd08a6f8
commit 828824e45d
No known key found for this signature in database
GPG Key ID: 48EA1E640798CA9A
2 changed files with 16 additions and 12 deletions

View File

@ -467,6 +467,7 @@ class Lotw extends CI_Controller {
$tableheaders .= "<td>Date LoTW Confirmed</td>";
$tableheaders .= "<td>State</td>";
$tableheaders .= "<td>Gridsquare</td>";
$tableheaders .= "<td>IOTA</td>";
$tableheaders .= "<td>Log Status</td>";
$tableheaders .= "<td>LoTW Status</td>";
$tableheaders .= "</tr>";
@ -520,8 +521,13 @@ class Lotw extends CI_Controller {
$qsl_gridsquare = "";
}
if (isset($record['iota'])) {
$iota = $record['iota'];
} else {
$iota = "";
}
$lotw_status = $this->logbook_model->lotw_update($time_on, $record['call'], $record['band'], $qsl_date, $record['qsl_rcvd'], $state, $qsl_gridsquare);
$lotw_status = $this->logbook_model->lotw_update($time_on, $record['call'], $record['band'], $qsl_date, $record['qsl_rcvd'], $state, $qsl_gridsquare, $iota);
}
@ -534,6 +540,7 @@ class Lotw extends CI_Controller {
$table .= "<td>".$qsl_date."</td>";
$table .= "<td>".$state."</td>";
$table .= "<td>".$qsl_gridsquare."</td>";
$table .= "<td>".$iota."</td>";
$table .= "<td>QSO Record: ".$status."</td>";
$table .= "<td>LoTW Record: ".$lotw_status."</td>";
$table .= "</tr>";
@ -609,9 +616,6 @@ class Lotw extends CI_Controller {
$lotw_url .= "&password=" . $data['user_lotw_password'];
$lotw_url .= "&qso_query=1&qso_qsl='yes'&qso_qsldetail='yes'&qso_mydetail='yes'";
//TODO: Option to specifiy whether we download location data from LoTW or not
//$lotw_url .= "&qso_qsldetail=\"yes\";
$lotw_url .= "&qso_qslsince=";
$lotw_url .= "$lotw_last_qsl_date";
@ -680,9 +684,6 @@ class Lotw extends CI_Controller {
$lotw_url .= "&password=" . $data['user_lotw_password'];
$lotw_url .= "&qso_query=1&qso_qsl='yes'&qso_qsldetail='yes'&qso_mydetail='yes'";
//TODO: Option to specifiy whether we download location data from LoTW or not
//$lotw_url .= "&qso_qsldetail=\"yes\";
$lotw_url .= "&qso_qslsince=";
$lotw_url .= "$lotw_last_qsl_date";

View File

@ -1982,7 +1982,7 @@ class Logbook_model extends CI_Model {
}
}
function lotw_update($datetime, $callsign, $band, $qsl_date, $qsl_status, $state, $qsl_gridsquare) {
function lotw_update($datetime, $callsign, $band, $qsl_date, $qsl_status, $state, $qsl_gridsquare, $iota) {
$data = array(
'COL_LOTW_QSLRDATE' => $qsl_date,
@ -1992,6 +1992,9 @@ class Logbook_model extends CI_Model {
if($state != "") {
$data['COL_STATE'] = $state;
}
if($iota != "") {
$data['COL_IOTA'] = $iota;
}
$this->db->where('date_format(COL_TIME_ON, \'%Y-%m-%d %H:%i\') = "'.$datetime.'"');
$this->db->where('COL_CALL', $callsign);