Prepare combo list reload with revisions and fix box/storage in webgui
This commit is contained in:
1 parent
ee947b772f
commit
aee50ecb4f
17 files changed
+128
-43
No files matched your search
+10
-4
@@ -50,6 +50,7 @@ switch ($submit = form_get_action()) {
|
||||
$p[':content'] = gpc_get_string($_POST, 'content');
|
||||
$p[':remarks'] = gpc_get_string($_POST, 'remarks');
|
||||
$id = db_exec_insert('box', $p);
|
||||
db_set_revision('table', TBL_BOXES);
|
||||
$action = ACT_VIEW;
|
||||
break;
|
||||
|
||||
@@ -88,10 +89,12 @@ if ($action == ACT_DEFAULT):
|
||||
|
||||
echo "<h1>$pagetitle</h1>\n";
|
||||
|
||||
$sql = "SELECT boxid, boxtype, sid, label, color, content, weight, remarks "
|
||||
. "FROM box "
|
||||
. "ORDER BY label";
|
||||
$sth = $pdo->query($sql);
|
||||
$sql = "SELECT b.boxid, b.boxtype, b.sid, b.label, b.color, b.content, b.weight, b.remarks "
|
||||
. "FROM box AS b JOIN storage AS s USING (sid) "
|
||||
. "WHERE s.vid=? "
|
||||
. "ORDER BY b.label";
|
||||
$sth = $pdo->prepare($sql);
|
||||
$sth->execute([$user->vid]);
|
||||
$res = $sth->fetchAll();
|
||||
echo '<table class="table table-striped">', "\n";
|
||||
echo "<thead>\n";
|
||||
@@ -122,6 +125,9 @@ foreach ($res as $row) {
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
// Table summary
|
||||
$numrows = count($res);
|
||||
table_rec_summary($i, $numrows, $numrows, 6);
|
||||
echo "</table>\n";
|
||||
|
||||
form_add_button('box.php');
|
||||
|
||||
Reference in new issue
Block a user