More improvements e.g. flags and provision target

This commit is contained in:
2026-08-11 07:48:46 +02:00
parent a3d4825cbd
commit 41556cfe73
22 changed files with 961 additions and 484 deletions
+45
View File
@@ -171,6 +171,11 @@ $box = $sth->fetch(PDO::FETCH_OBJ);
echo '<h2>', $box->label, "</h2>\n";
// Bootstrap grid
echo '<div class="container">';
echo '<div class="row">';
echo '<div class="col">';
echo '<table class="table">', "\n";
echo '<tr><th style="width:20%">', _('Box type'),"</th><td>", ($opt_boxtype[$box->boxtype] ?? ''), "</td></tr>\n";
echo '<tr><th>', _('Content'),"</th><td>", $box->content, "</td></tr>\n";
@@ -184,6 +189,46 @@ echo "</table>\n";
form_view_buttons($g_scriptname, $id);
echo '</div>'; // Column break
echo '<div class="col">', "\n";
echo '<div class="card mb-2">', "\n";
echo '<div class="card-header">', _('Images'), "</div>\n";
echo '<div class="card-body d-flex flex-wrap gap-3">', "\n";
$sql = "SELECT d.docid, d.title "
. "FROM docref AS r INNER JOIN document AS d using (docid) "
. "WHERE d.doctype='picture' AND r.reftype='box' AND r.refid=? "
. "ORDER BY d.title";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
$res = $sth->fetchAll();
// TODO hübsche Darstellung
$doccount = 0;
foreach ($res as $row) {
$doccount += 1;
echo '<div class="border rounded p-2 d-flex flex-column" style="width: 150px;">';
echo '<a href="dl.php?id=', $row['docid'], '">';
// echo '<img width="120" src="doc/pic-', $row['hash'], '.', $row['extension'],'">';
echo '<img class="img-fluid rounded mb-2" width="120" src="dl.php?id=', $row['docid'], '" alt="', $row['title'], '">';
echo "</a>\n";
// additionally direct download and go to document details page
echo '<div class="d-flex justify-content-between mt-auto">';
echo '<a href="documents.php?f=view&id=', $row['docid'], '" title="', _('View image details'), '"> <i class="bi bi-eye"></i></a>';
echo '<a href="dl.php?id=', $row['docid'], '" title="', _('Download image'), '"><i class="bi bi-download"></i></a>';
echo "</div>\n";
echo "</div\n";
}
if ($doccount == 0) {
echo _('No referenced images'), "\n";
}
echo "</div>\n"; // card-body
echo "</div>\n"; // card
echo '</div>'; // col
echo '</div>'; // row
echo '</div>'; // container
// Inventory in box
// WIP
$sql = "SELECT invid, invname, weight, number FROM inventory WHERE conttype='box' AND boxid=?";