Webgui: More mobile friendly touch and much more improvements
This commit is contained in:
+24
-8
@@ -1,11 +1,18 @@
|
||||
<?php
|
||||
/******************************************************************************
|
||||
* YMS - Yacht Management Software
|
||||
* Copyright (C) 2024 Thomas Hooge
|
||||
* Copyright (C) 2024-2026 Thomas Hooge
|
||||
*
|
||||
* SPDX-License-Identifier: WTFPL
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
Box weight can be entered directly and is meant as weight of box itself plus
|
||||
weights of contained items.
|
||||
The weight of the contained items can be displayed separately
|
||||
There can be a difference because not all items have a weight entered
|
||||
*/
|
||||
|
||||
require 'globals.inc';
|
||||
$pagetitle = _('Boxes');
|
||||
|
||||
@@ -79,21 +86,30 @@ $res = $sth->fetchAll();
|
||||
echo '<table class="table table-striped">', "\n";
|
||||
echo "<thead>\n";
|
||||
echo "<tr>";
|
||||
echo "<th>" . _('Label') . "</th>";
|
||||
echo "<th>" . _('Type') . "</th>";
|
||||
echo "<th>" . _('Color') . "</th>";
|
||||
echo "<th>" . _('Content') . "</th>";
|
||||
echo '<th>#</th>';
|
||||
echo "<th>", _('Label'), "</th>";
|
||||
echo "<th>", _('Type'), "</th>";
|
||||
echo "<th>", _('Color'), "</th>";
|
||||
echo "<th>", _('Content'), "</th>";
|
||||
echo '<th class="text-end">', _('Weight'), "</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="', $g_scriptname, '?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>', ($opt_boxtype[$row['boxtype']] ?? ''), "</td>\n";
|
||||
echo '<td>', format_color(strtoupper($row['color'])), "</td>\n";
|
||||
echo '<td>', $row['content'], "</td>\n";
|
||||
echo '<td class="text-end">', format_float($row['weight'], 2), "</td>\n";
|
||||
form_action_buttons($g_scriptname, $row['boxid']);
|
||||
// Edit current record button
|
||||
echo "<td>";
|
||||
echo '<a title="', _('Edit'), '" href="', $g_scriptname, '?f=edit&id=', $row['boxid'], '"><i class="bi-pencil"></i></a>', "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
// Table summary
|
||||
@@ -110,7 +126,7 @@ elseif ($action == ACT_ADD):
|
||||
|
||||
echo '<h2>', _('Add Box'), "</h2>\n";
|
||||
?>
|
||||
<form method="post" action="<?=$g_Scriptname?>">
|
||||
<form method="post" action="<?=$g_scriptname?>">
|
||||
<div class="mb-3">
|
||||
<label for="label" class="form-label"><?=_('Label')?></label>
|
||||
<input type="text" maxlength="20" class="form-control" id="label" name="label" autofocus>
|
||||
@@ -143,7 +159,7 @@ foreach ($opt_storage as $k => $v) {
|
||||
elseif ($action == ACT_VIEW):
|
||||
// ========== VARIANT: view single record =====================================
|
||||
|
||||
$sql = "SELECT boxtype, label, content, color, weight, box.remarks, box.sid, sname "
|
||||
$sql = "SELECT boxtype, label, content, box.color, weight, box.remarks, box.sid, sname "
|
||||
. "FROM box LEFT JOIN storage USING (sid) "
|
||||
. "WHERE boxid=?";
|
||||
$sth = $pdo->prepare($sql);
|
||||
|
||||
Reference in New Issue
Block a user