[Update][Distance] used HTMX to load the results and handled errors in qra.php
这个提交包含在:
父节点
a5c11fe1a1
当前提交
944ab40e5e
共有 2 个文件被更改,包括 10 次插入 和 2 次删除
|
|
@ -55,7 +55,14 @@ class Qra {
|
||||||
$stn = qra2latlong($rx);
|
$stn = qra2latlong($rx);
|
||||||
|
|
||||||
// Feed in Lat Longs plus the unit type
|
// 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 the distance
|
||||||
return $total_distance;
|
return $total_distance;
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade" id="distance" role="tabpanel" aria-labelledby="distance-tab">
|
<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 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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用