add uploaded files to edit, note details, welcome page
This commit is contained in:
@@ -94,6 +94,11 @@ class NotesModel extends Database
|
||||
$params = [trim($title), $content, $noteId, $userId];
|
||||
}
|
||||
$stmt->execute($params);
|
||||
|
||||
$uploadResult = $this->uploadFiles($noteId);
|
||||
if (!$uploadResult['success']) {
|
||||
return $uploadResult;
|
||||
}
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
return ['success' => true, 'message' => 'Note updated successfully.'];
|
||||
@@ -148,6 +153,19 @@ class NotesModel extends Database
|
||||
}
|
||||
}
|
||||
|
||||
function getFileCount() {
|
||||
$pdo = $this->linkDB();
|
||||
if (!$pdo) return 0;
|
||||
try {
|
||||
$stmt = $pdo->prepare("SELECT COUNT(*) FROM files");
|
||||
$stmt->execute();
|
||||
return $stmt->fetchColumn();
|
||||
} catch (PDOException $e) {
|
||||
error_log("Get Files Count Error: " . $e->getMessage());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function getNoteCount() {
|
||||
$pdo = $this->linkDB();
|
||||
if (!$pdo) return 0;
|
||||
|
Reference in New Issue
Block a user