[Update][Distance] used HTMX to load the results and handled errors in qra.php

pull/2216/head
Peter Goodhall 2023-06-20 15:26:00 +01:00
rodzic a5c11fe1a1
commit 944ab40e5e
2 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -55,7 +55,14 @@ class Qra {
$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;

Wyświetl plik

@ -54,7 +54,8 @@
</div>
<div class="tab-pane fade" id="distance" role="tabpanel" aria-labelledby="distance-tab">
<p class="card-text">Here you can update QSOs with missing distance information.</p>
<p><a class="btn btn-primary" href="<?php echo site_url('update/update_distances');?>">Update distance data</a></p>
<p><a class="btn btn-primary" hx-get="<?php echo site_url('update/update_distances');?>" hx-target="#distance_results" href="<?php echo site_url('update/update_distances');?>">Update distance data</a></p>
<div id="distance_results"></div>
</div>
</div>
</div>