diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index 58cb8482..984d5620 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -26,7 +26,7 @@ function updateRow(qso) { let c = 1; cells.eq(c++).text(qso.qsoDateTime); cells.eq(c++).text(qso.de); - cells.eq(c++).html(''+qso.dx+'' + (qso.callsign == '' ? '' : ' L')); + cells.eq(c++).html(''+qso.dx+'' + (qso.callsign == '' ? '' : ' L')); cells.eq(c++).text(qso.mode); cells.eq(c++).text(qso.rstS); cells.eq(c++).text(qso.rstR); @@ -81,7 +81,7 @@ function loadQSOTable(rows) { data.push('
'); data.push(qso.qsoDateTime); data.push(qso.de); - data.push(''+qso.dx+'' + (qso.callsign == '' ? '' : ' L')); + data.push(''+qso.dx+'' + (qso.callsign == '' ? '' : ' L')); data.push(qso.mode); data.push(qso.rstS); data.push(qso.rstR); diff --git a/src/QSLManager/QSO.php b/src/QSLManager/QSO.php index a64bd402..22033afe 100644 --- a/src/QSLManager/QSO.php +++ b/src/QSLManager/QSO.php @@ -62,6 +62,7 @@ class QSO /** Lotw callsign info **/ private string $callsign; private string $lastupload; + private string $lotw_hint; /** * @param array $data Does no validation, it's assumed to be a row from the database in array format @@ -195,6 +196,19 @@ class QSO } $this->callsign = ($data['callsign'] === null) ? '' :$data['callsign']; $this->lastupload = ($data['lastupload'] === null) ? '' : date($custom_date_format . " H:i", strtotime($data['lastupload'])); + $lotw_hint = ''; + if ($data['lastupload'] !== null) { + $diff = time(); + $diff = (time() - strtotime($data['lastupload'])) / 86400; + if ($diff > 365) { + $lotw_hint = ' lotw_info_red'; + } elseif ($diff > 30) { + $lotw_hint = ' lotw_info_orange'; + } elseif ($diff > 7) { + $lotw_hint = ' lotw_info_yellow'; + } + } + $this->lotw_hint = $lotw_hint; } @@ -776,6 +790,7 @@ class QSO 'end' => $this->end === null ? null : $this->end->format("Y-m-d"), 'callsign' => $this->callsign, 'lastupload' => $this->lastupload, + 'lotw_hint' => $this->lotw_hint, ]; }