Some database improvements and associated changes in webgui

This commit is contained in:
2026-09-14 10:12:32 +02:00
parent 2250fb9743
commit 57c42d1398
23 changed files with 203 additions and 39 deletions
+11
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
$pagetitle = _('Settings');
@@ -22,6 +23,11 @@ switch ($submit = form_get_action()) {
// global settings
if ($user->role == 'captain') {
$p[':userid'] = 0;
$p[':sno'] = 4;
$p[':valstr'] = gpc_get_string($_POST, 'currsym', 3, '€');
db_exec_update('settings', $p, $pk);
$p[':valstr'] = NULL;
// image dimensions
$p[':sno'] = 20;
$p[':valint'] = gpc_get_int($_POST, 'maximgx');
db_exec_update('settings', $p, $pk);
@@ -101,6 +107,7 @@ if ($res = $sth->fetch(PDO::FETCH_NUM)) {
$sth->execute([$user->id, $rowspp]);
}
$currsym = $pdo->query("SELECT valstr FROM settings WHERE userid=0 AND sno=4")->fetchColumn();
$maximgx = $pdo->query("SELECT valint FROM settings WHERE userid=0 AND sno=20")->fetchColumn();
$maximgy = $pdo->query("SELECT valint FROM settings WHERE userid=0 AND sno=21")->fetchColumn();
@@ -131,6 +138,10 @@ form_create_select('datefmt', _('Date format'), $opt_datefmt, $datefmt);
if ($user->role == 'captain'):
?>
<h2><?=_('global for all users')?></h2>
<div class="mb-3">
<label for="currsym" class="form-label"><?=_('Currency symbol')?></label>
<input type="text" class="form-control" id="currsym" name="currsym" maxlength="3" value=<?=$currsym?>>
</div>
<div class="mb-3">
<label for="maximgx" class="form-label"><?=_('Maximal image width')?></label>
<input type="text" class="form-control" id="maximgx" name="maximgx" maxlength="4" value=<?=$maximgx?>>