Webgui: More mobile friendly touch and much more improvements
This commit is contained in:
+13
-8
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/******************************************************************************
|
||||
* YMS - Yacht Management Software
|
||||
* Copyright (C) 2024 Thomas Hooge
|
||||
* Copyright (C) 2024-2026 Thomas Hooge
|
||||
*
|
||||
* SPDX-License-Identifier: WTFPL
|
||||
******************************************************************************/
|
||||
@@ -142,7 +142,7 @@ $vessel = $sth->fetch(PDO::FETCH_OBJ);
|
||||
// Show remarks first
|
||||
if (strlen($vessel->remarks) > 0) {
|
||||
echo "<p>";
|
||||
echo $vessel->remarks;
|
||||
echo nl2br($vessel->remarks);
|
||||
echo "</p>\n";
|
||||
}
|
||||
|
||||
@@ -321,24 +321,28 @@ $sth->execute([$user->vid]);
|
||||
echo '<tr><td> </td><td>', _('Boxes'), '</td><td>', $sth->fetchColumn(), "</td></tr>\n";
|
||||
|
||||
// Equipment
|
||||
$sth = $pdo->prepare("SELECT COUNT(*) FROM equipment WHERE vid=?");
|
||||
$sth = $pdo->prepare("SELECT COUNT(*), SUM(weight) FROM equipment WHERE vid=?");
|
||||
$sth->execute([$user->vid]);
|
||||
$row = $sth->fetch(PDO::FETCH_NUM);
|
||||
echo '<tr><td colspan="3">', _('Equipment') , "</td>";
|
||||
echo '<tr><td> </td><td>', _('Count'), '</td><td>', $sth->fetchColumn(), "</td></tr>\n";
|
||||
echo '<tr><td> </td><td>', _('Count'), '</td><td>', $row[0], "</td></tr>\n";
|
||||
echo '<tr><td> </td><td>', _('Weight'), '</td><td>', format_float($row[1], 1, 'kg'), "</td></tr>\n";
|
||||
|
||||
// Inventory
|
||||
// All items from vessel storage and all items from boxes in vessel storage
|
||||
$sql = "SELECT SUM(n) FROM ("
|
||||
. "SELECT COUNT(*) AS n FROM inventory JOIN storage USING (sid) WHERE conttype='storage' AND vid=:vid "
|
||||
$sql = "SELECT SUM(n), SUM(w) FROM ("
|
||||
. "SELECT COUNT(*) AS n, SUM(i.weight * i.number) as w FROM inventory AS i JOIN storage USING (sid) WHERE conttype='storage' AND vid=:vid "
|
||||
. "UNION "
|
||||
. "SELECT COUNT(*) AS n FROM inventory JOIN box USING (boxid) JOIN storage ON (box.sid=storage.sid) WHERE conttype='box' AND vid=:vid"
|
||||
. "SELECT COUNT(*) AS n, SUM(i.weight * i.number) as w FROM inventory AS i JOIN box USING (boxid) JOIN storage ON (box.sid=storage.sid) WHERE conttype='box' AND vid=:vid"
|
||||
. ") AS x";
|
||||
$sth = $pdo->prepare($sql);
|
||||
$sth->bindValue(':vid', $user->vid, PDO::PARAM_INT);
|
||||
$sth->execute();
|
||||
$row = $sth->fetch(PDO::FETCH_NUM);
|
||||
|
||||
echo '<tr><td colspan="3">', _('Inventory') , "</td>";
|
||||
echo '<tr><td> </td><td>', _('Count'), '</td><td>', $sth->fetchColumn(), "</td></tr>\n";
|
||||
echo '<tr><td> </td><td>', _('Count'), '</td><td>', $row[0], "</td></tr>\n";
|
||||
echo '<tr><td> </td><td>', _('Weight'), '</td><td>', format_float($row[1], 1, 'kg'), "</td></tr>\n";
|
||||
|
||||
// Documents
|
||||
$sth = $pdo->query("SELECT COUNT(*) FROM document");
|
||||
@@ -368,6 +372,7 @@ echo "</table>\n";
|
||||
<hr>
|
||||
<h5 class="card-title"><?=_('Additional modules')?></h5>
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item"><a href="settings.php"><?=_('Settings')?></a></li>
|
||||
<li class="list-group-item"><a href="task.php"><?=_('Tasks')?></a></li>
|
||||
<li class="list-group-item"><a href="measurement.php"><?=_('Measurements')?></a></li>
|
||||
<li class="list-group-item"><a href="checklist.php"><?=_('Checklists')?></a></li>
|
||||
|
||||
Reference in New Issue
Block a user