Webgui: improve box, maintenance and date handling

This commit is contained in:
2026-09-16 06:12:50 +02:00
parent a76848e1da
commit 9b45fd3700
10 changed files with 116 additions and 31 deletions
+14
View File
@@ -8,6 +8,20 @@
*/
function db_get_setting($sno, $default=NULL) {
// TODO WIP
global $pdo;
$sql = "SELECT valint, valstr FROM settings WHERE userid=0 AND sno=?";
$sth = $pdo->prepare($sql);
try {
$sth->execute([$sno]);
} catch (Exception $e) {
return $default;
}
$row = $sth->fetchOne();
return $row;
}
function db_lock_acquire($table, $key, $userid) {
global $pdo;
$token = bin2hex(random_bytes(8));