fixed some lotw php errors
这个提交包含在:
父节点
081db1ade4
当前提交
349f2eecf5
共有 2 个文件被更改,包括 25 次插入 和 19 次删除
|
|
@ -41,23 +41,29 @@ class Qra {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function distance($tx, $rx, $unit = 'M') {
|
function distance($tx, $rx, $unit = 'M') {
|
||||||
// Calc LatLongs
|
// Calc LatLongs
|
||||||
$my = qra2latlong($tx);
|
$my = qra2latlong($tx);
|
||||||
$stn = qra2latlong($rx);
|
$stn = qra2latlong($rx);
|
||||||
|
|
||||||
// Feed in Lat Longs plus the unit type
|
// Check if qra2latlong returned valid values
|
||||||
try
|
if ($my && $stn) {
|
||||||
{
|
// Feed in Lat Longs plus the unit type
|
||||||
$total_distance = distance($my[0], $my[1], $stn[0], $stn[1], $unit);
|
try
|
||||||
}
|
{
|
||||||
catch (Exception $e)
|
$total_distance = distance($my[0], $my[1], $stn[0], $stn[1], $unit);
|
||||||
{
|
}
|
||||||
$total_distance = 0;
|
catch (Exception $e)
|
||||||
}
|
{
|
||||||
|
$total_distance = 0;
|
||||||
// Return the distance
|
}
|
||||||
return $total_distance;
|
|
||||||
}
|
// Return the distance
|
||||||
|
return $total_distance;
|
||||||
|
} else {
|
||||||
|
// Handle the case where qra2latlong did not return valid values
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Function returns just the bearing
|
* Function returns just the bearing
|
||||||
|
|
|
||||||
|
|
@ -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') = ?";
|
$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));
|
$query = $this->db->query($qsql, array($band, $callsign,$station_callsign,$datetime));
|
||||||
$row = $query->row();
|
$row = $query->row();
|
||||||
if ($row->QRZ_STATE == 'Y') {
|
if (($row->QRZ_STATE ?? '') == 'Y') {
|
||||||
$data['COL_QRZCOM_QSO_UPLOAD_STATUS'] = 'M';
|
$data['COL_QRZCOM_QSO_UPLOAD_STATUS'] = 'M';
|
||||||
}
|
}
|
||||||
if ($row->CL_STATE == 'Y') {
|
if (($row->CL_STATE ?? '') == 'Y') {
|
||||||
$data['COL_CLUBLOG_QSO_UPLOAD_STATUS'] = 'M';
|
$data['COL_CLUBLOG_QSO_UPLOAD_STATUS'] = 'M';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用