More webgui development
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user