From 944ab40e5e4018ca52c4ebe4119b83fd61cea9ec Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Tue, 20 Jun 2023 15:26:00 +0100 Subject: [PATCH] [Update][Distance] used HTMX to load the results and handled errors in qra.php --- application/libraries/Qra.php | 9 ++++++++- application/views/update/index.php | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/application/libraries/Qra.php b/application/libraries/Qra.php index d6103e3b..c661dad1 100644 --- a/application/libraries/Qra.php +++ b/application/libraries/Qra.php @@ -55,7 +55,14 @@ class Qra { $stn = qra2latlong($rx); // Feed in Lat Longs plus the unit type - $total_distance = distance($my[0], $my[1], $stn[0], $stn[1], $unit); + 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; diff --git a/application/views/update/index.php b/application/views/update/index.php index 0d31deaa..936ad51f 100644 --- a/application/views/update/index.php +++ b/application/views/update/index.php @@ -54,7 +54,8 @@

Here you can update QSOs with missing distance information.

-

Update distance data

+

Update distance data

+