Webgui: More mobile friendly touch and much more improvements
This commit is contained in:
+32
-7
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/******************************************************************************
|
||||
* YMS - Yacht Management Software
|
||||
* Copyright (C) 2024 Thomas Hooge
|
||||
* Copyright (C) 2024-2026 Thomas Hooge
|
||||
*
|
||||
* SPDX-License-Identifier: WTFPL
|
||||
******************************************************************************/
|
||||
@@ -95,7 +95,7 @@ page_caption_search($pagetitle);
|
||||
|
||||
// Storage
|
||||
// stype from dropdown
|
||||
$sql = "SELECT sid, sname, x, y, z, remarks "
|
||||
$sql = "SELECT sid, sname, x, y, z, angle, remarks "
|
||||
. "FROM storage "
|
||||
. "WHERE vid=? "
|
||||
. "ORDER BY sid";
|
||||
@@ -105,22 +105,36 @@ $res = $sth->fetchAll();
|
||||
echo '<table class="table table-striped">', "\n";
|
||||
echo "<thead>\n";
|
||||
echo "<tr>";
|
||||
echo '<th>#</th>';
|
||||
echo "<th>", _('Name'), "</th>";
|
||||
echo "<th>", _('Position'), "</th>";
|
||||
echo "<th>", _('Remarks'), "</th>";
|
||||
echo "<th> </th>";
|
||||
echo "</tr>\n";
|
||||
echo "</thead>\n";
|
||||
$i = 0;
|
||||
foreach ($res as $row) {
|
||||
$i++; // record number
|
||||
echo "<tr>\n";
|
||||
echo '<td>', $i;
|
||||
echo '<a class="text-nowrap" title="', _('View'), '" href="', $g_scriptname, '?f=view&id=', $row['sid'], '"><i class="bi bi-eye ms-2"></i></a>', "\n";
|
||||
echo "</td>\n";
|
||||
echo "<td>", $row['sname'], "</td>\n";
|
||||
echo "<td>", join(',', array($row['x'] ?? '?', $row['y'] ?? '?', $row['z'])), "</td>\n";
|
||||
if ($row['angle'] != 0) {
|
||||
$angle = " (" . $row['angle'] . "°)";
|
||||
} else {
|
||||
$angle = "";
|
||||
}
|
||||
echo "<td>", join(',', array($row['x'] ?? '?', $row['y'] ?? '?', $row['z'])), $angle, "</td>\n";
|
||||
echo "<td>", $row['remarks'], "</td>\n";
|
||||
form_action_buttons($g_scriptname, $row['sid']);
|
||||
// Edit current record button
|
||||
echo "<td>";
|
||||
echo '<a title="', _('Edit'), '" href="', $g_scriptname, '?f=edit&id=', $row['sid'], '"><i class="bi-pencil"></i></a>', "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo "<tfoot>\n";
|
||||
echo '<tr><td colspan="3">', sprintf(_('%d records'), count($res)), '</td></tr>', "\n";
|
||||
echo '<tr><td colspan="5">', sprintf(_('%d records'), count($res)), '</td></tr>', "\n";
|
||||
echo "</tfoot>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
@@ -136,17 +150,26 @@ $res = $sth->fetchAll();
|
||||
echo '<table class="table table-striped">', "\n";
|
||||
echo "<thead>\n";
|
||||
echo "<tr>";
|
||||
echo '<th>#</th>';
|
||||
echo "<th>" . _('Label') . "</th>";
|
||||
echo "<th>" . _('Color') . "</th>";
|
||||
echo "<th>" . _('Content') . "</th>";
|
||||
echo "<td></td>";
|
||||
echo "</tr>\n";
|
||||
$i = 0;
|
||||
foreach ($res as $row) {
|
||||
$i++; // record number
|
||||
echo "<tr>\n";
|
||||
echo '<td>', $i;
|
||||
echo '<a class="text-nowrap" title="', _('View'), '" href="box.php?f=view&id=', $row['boxid'], '"><i class="bi bi-eye ms-2"></i></a>', "\n";
|
||||
echo "</td>\n";
|
||||
echo "<td>". $row['label'] ."</td>\n";
|
||||
echo '<td>', format_color($row['color']), "</td>\n";
|
||||
echo "<td>". $row['content'] ."</td>\n";
|
||||
form_action_buttons('box.php', $row['boxid']);
|
||||
// Edit current record button
|
||||
echo "<td>";
|
||||
echo '<a title="', _('Edit'), '" href="box.php?f=edit&id=', $row['boxid'], '"><i class="bi-pencil"></i></a>', "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
// Table summary
|
||||
@@ -189,7 +212,7 @@ elseif ($action == ACT_VIEW):
|
||||
// ========== VARIANT: view single record =====================================
|
||||
|
||||
$opt_unit = db_get_options(6);
|
||||
$sql = "SELECT sid, sname, stype, capacity, capaunit, x, y, z, wx, wy, wz, remarks "
|
||||
$sql = "SELECT sid, sname, stype, capacity, capaunit, x, y, z, wx, wy, wz, angle, color, remarks "
|
||||
. "FROM storage "
|
||||
. "WHERE sid=?";
|
||||
$sth = $pdo->prepare($sql);
|
||||
@@ -202,6 +225,8 @@ echo '<tr><th style="width:33%">', _('Typ'),"</th><td>", $stype[$storage->stype]
|
||||
echo '<tr><th>', _('Capacity'),"</th><td>", $storage->capacity, ' ', $storage->capaunit, "</td></tr>\n";
|
||||
echo '<tr><th>', _('Location (x, y, z)'),"</th><td>(", $storage->x, ', ', $storage->y, ', ', $storage->z, ")</td></tr>\n";
|
||||
echo '<tr><th>', _('Width (wx, wy, wz)'),"</th><td>(", $storage->wx, ', ', $storage->wy, ', ', $storage->wz, ")</td></tr>\n";
|
||||
echo '<tr><th>', _('Angle'),"</th><td>", $storage->angle, "°</td></tr>\n";
|
||||
echo '<tr><th>', _('Color'),"</th><td>", $storage->color, "</td></tr>\n";
|
||||
echo '<tr><th>', _('Remarks'),"</th><td>", $storage->remarks, "</td></tr>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user