Merge pull request #2505 from phl0/hamsAtMultiGrids

Handle multigrids in hams.at display
这个提交包含在:
Peter Goodhall 2023-09-20 13:22:11 +01:00 提交者 GitHub
当前提交 490024cb98
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23

查看文件

@ -5,10 +5,11 @@
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
<thead> <thead>
<tr> <tr>
<th>Date / Time</th> <th>Date</th>
<th>Time</th>
<th>Callsign</th> <th>Callsign</th>
<th>Satellite</th> <th>Satellite</th>
<th>Gridsquare</th> <th>Gridsquare(s)</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -30,11 +31,12 @@
?> ?>
<?php $timestamp = strtotime($rove['date']); <?php $timestamp = strtotime($rove['date']);
echo date($custom_date_format, $timestamp); ?> echo date($custom_date_format, $timestamp); ?>
- <?php echo $rove['start_time']; ?> - <?php echo $rove['end_time']; ?>
</td> </td>
<td>
<?php echo $rove['start_time']." - ".$rove['end_time']; ?>
</td>
<td> <td>
<?php <?php
$CI = &get_instance(); $CI = &get_instance();
@ -58,11 +60,23 @@
<?php <?php
// Load the logbook model and call check_if_grid_worked_in_logbook // Load the logbook model and call check_if_grid_worked_in_logbook
$worked = $CI->logbook_model->check_if_grid_worked_in_logbook($rove['gridsquare'], null, "SAT"); if (strpos($rove['gridsquare'], '/') !== false) {
if ($worked != 0) { $grids = explode('/', $rove['gridsquare']);
echo " <span data-toggle=\"tooltip\" title=\"Worked\" class=\"badge badge-success\">" . $rove['gridsquare'] . "</span>"; foreach ($grids as $grid) {
$worked = $CI->logbook_model->check_if_grid_worked_in_logbook($grid, null, "SAT");
if ($worked != 0) {
echo " <span data-toggle=\"tooltip\" title=\"Worked\" class=\"badge badge-success\">" . $grid . "</span>";
} else {
echo " <span data-toggle=\"tooltip\" title=\"Not Worked\" class=\"badge badge-danger\">" . $grid . "</span>";
}
}
} else { } else {
echo " <span data-toggle=\"tooltip\" title=\"Not Worked\" class=\"badge badge-danger\">" . $rove['gridsquare'] . "</span>"; $worked = $CI->logbook_model->check_if_grid_worked_in_logbook($rove['gridsquare'], null, "SAT");
if ($worked != 0) {
echo " <span data-toggle=\"tooltip\" title=\"Worked\" class=\"badge badge-success\">" . $rove['gridsquare'] . "</span>";
} else {
echo " <span data-toggle=\"tooltip\" title=\"Not Worked\" class=\"badge badge-danger\">" . $rove['gridsquare'] . "</span>";
}
} }
?> ?>