fixed some lotw php errors

pull/2707/head
HB9HIL 2023-11-25 22:07:51 +01:00
rodzic 081db1ade4
commit 349f2eecf5
2 zmienionych plików z 25 dodań i 19 usunięć

Wyświetl plik

@ -41,23 +41,29 @@ class Qra {
*
*/
function distance($tx, $rx, $unit = 'M') {
// Calc LatLongs
$my = qra2latlong($tx);
$stn = qra2latlong($rx);
// Feed in Lat Longs plus the unit type
try
{
$total_distance = distance($my[0], $my[1], $stn[0], $stn[1], $unit);
}
catch (Exception $e)
{
$total_distance = 0;
}
// Return the distance
return $total_distance;
}
// Calc LatLongs
$my = qra2latlong($tx);
$stn = qra2latlong($rx);
// Check if qra2latlong returned valid values
if ($my && $stn) {
// Feed in Lat Longs plus the unit type
try
{
$total_distance = distance($my[0], $my[1], $stn[0], $stn[1], $unit);
}
catch (Exception $e)
{
$total_distance = 0;
}
// Return the distance
return $total_distance;
} else {
// Handle the case where qra2latlong did not return valid values
return 0;
}
}
/*
* Function returns just the bearing

Wyświetl plik

@ -2808,10 +2808,10 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray =
$qsql = "select COL_CLUBLOG_QSO_UPLOAD_STATUS as CL_STATE, COL_QRZCOM_QSO_UPLOAD_STATUS as QRZ_STATE from ".$this->config->item('table_name')." where COL_BAND=? and COL_CALL=? and COL_STATION_CALLSIGN=? and date_format(COL_TIME_ON, '%Y-%m-%d %H:%i') = ?";
$query = $this->db->query($qsql, array($band, $callsign,$station_callsign,$datetime));
$row = $query->row();
if ($row->QRZ_STATE == 'Y') {
if (($row->QRZ_STATE ?? '') == 'Y') {
$data['COL_QRZCOM_QSO_UPLOAD_STATUS'] = 'M';
}
if ($row->CL_STATE == 'Y') {
if (($row->CL_STATE ?? '') == 'Y') {
$data['COL_CLUBLOG_QSO_UPLOAD_STATUS'] = 'M';
}