More webgui development

This commit is contained in:
2024-04-30 19:38:28 +02:00
parent c3b5ef95a9
commit 0c09ce2916
21 changed files with 1056 additions and 155 deletions
+4 -5
View File
@@ -28,8 +28,8 @@ switch ($submit = form_get_action()) {
} catch (PDOException $e) {
$g_error->Add('SQL-Error: '. $e->getMessage());
}
$g_message->Add(sprintf(_('Selected vessel %d'), $vid));
$user->load_vessel();
$g_message->Add(sprintf(_('Selected vessel %d: %s'), $vid, $user->vessel));
break;
case 'insert':
@@ -310,19 +310,17 @@ echo '<tr><td>', _('Count'), '</td><td>', $sth->fetchColumn(), "</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 boxtype='storage' AND vid=:vid "
. "SELECT COUNT(*) AS n FROM inventory 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 boxtype='box' AND vid=:vid"
. "SELECT COUNT(*) AS n FROM inventory 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();
// Tasks
echo '<tr><td colspan="2">', _('Inventory') , "</td>";
echo '<tr><td>', _('Count'), '</td><td>', $sth->fetchColumn(), "</td></tr>\n";
echo "</table>\n";
?>
@@ -344,6 +342,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="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>
<li class="list-group-item"><a href="search.php"><?=_('Search')?></a></li>