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
+25
View File
@@ -0,0 +1,25 @@
<?php
/******************************************************************************
* YMS - Yacht Management Software
* Copyright (C) 2024 Thomas Hooge
*
* SPDX-License-Identifier: WTFPL
******************************************************************************
*/
// ========== FILE FUNCTIONS ==================================================
function file_fix_filesize($docid, $filepath) {
// set filesize in database to current size in filesystem
global $pdo;
$newsize = filesize($filepath);
$sth = $pdo->prepare("UPDATE document SET docsize=? WHERE docid=?");
$sth->execute([$docid, $newsize]);
return $newsize;
}
function file_get_docname($docid, $doctype, $extension) {
global $g_doc_typemap;
return sprintf('%s-%06d.%s', $g_doc_typemap[$doctype], $docid, $extension);
}