Show LoTW state on sat page

This commit is contained in:
phl0
2024-11-11 16:54:34 +01:00
parent a3d2b0eff6
commit 44c1f0cae2
2 changed files with 17 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
class Satellite_model extends CI_Model {
function get_all_satellites() {
$sql = "select satellite.id, satellite.name as satname, group_concat(distinct satellitemode.name separator ', ') as modename, satellite.exportname, satellite.orbit
$sql = "select satellite.id, satellite.name as satname, group_concat(distinct satellitemode.name separator ', ') as modename, satellite.exportname, satellite.orbit, satellite.lotw as lotw
from satellite
left outer join satellitemode on satellite.id = satellitemode.satelliteid
group by satellite.name, satellite.exportname, satellite.orbit, satellite.id";

View File

@@ -22,6 +22,7 @@
<th><?= __("Export Name"); ?></th>
<th><?= __("Orbit"); ?></th>
<th><?= __("Mode"); ?></th>
<th><?= __("LoTW"); ?></th>
<th><?= __("Edit"); ?></th>
<th><?= __("Delete"); ?></th>
</tr>
@@ -46,9 +47,23 @@
echo 'bg-light';
break;
}
echo '">'.$sat->orbit.'</span></td>';
echo '">'.$sat->orbit.'</span></td>';
?>
<td style="text-align: center; vertical-align: middle;"><?php echo htmlentities($sat->modename ?? '') ?></td>
<?php echo '<td style="text-align: center; vertical-align: middle;">';
switch ($sat->lotw) {
case 'Y':
echo '<span class="badge bg-success">'.__("Yes").'</span>';
break;
case 'N':
echo '<span class="badge bg-danger">'.__("No").'</span>';
break;
default:
echo '<span class="badge bg-warning">'.__("Unknown").'</span>';
break;
}
echo '</td>';
?>
<td style="text-align: center; vertical-align: middle;"><button onclick="editSatelliteDialog(<?php echo $sat->id ?>)" class="btn btn-sm btn-success"><i class="fas fa-edit"></i></i></button></td>
<td style="text-align: center; vertical-align: middle;"><button onclick="deleteSatellite('<?php echo $sat->id . '\',\'' . xss_clean(htmlentities(str_replace('\'',"\\'",str_replace('"','\"',str_replace('\\',' ',$sat->satname))))) ?>')" class="btn btn-sm btn-danger"><i class="fas fa-trash-alt"></i></button></td>
</tr>