diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 24e79894..bebc7e72 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -467,6 +467,7 @@ class Lotw extends CI_Controller { $tableheaders .= "Date LoTW Confirmed"; $tableheaders .= "State"; $tableheaders .= "Gridsquare"; + $tableheaders .= "IOTA"; $tableheaders .= "Log Status"; $tableheaders .= "LoTW Status"; $tableheaders .= ""; @@ -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 .= "".$qsl_date.""; $table .= "".$state.""; $table .= "".$qsl_gridsquare.""; + $table .= "".$iota.""; $table .= "QSO Record: ".$status.""; $table .= "LoTW Record: ".$lotw_status.""; $table .= ""; @@ -609,11 +616,8 @@ 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"; + $lotw_url .= "&qso_qslsince="; + $lotw_url .= "$lotw_last_qsl_date"; file_put_contents($file, file_get_contents($lotw_url)); @@ -680,11 +684,8 @@ 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"; + $lotw_url .= "&qso_qslsince="; + $lotw_url .= "$lotw_last_qsl_date"; // Only pull back entries that belong to this callsign $lotw_call = $this->session->userdata('user_callsign'); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 5d639eb4..2a252731 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -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);