Willkommen statistik

This commit is contained in:
Felix Ivo
2025-06-30 10:26:39 +02:00
parent fc17a1a312
commit ba9ec6b430
3 changed files with 55 additions and 3 deletions

View File

@@ -130,6 +130,19 @@ class NotesModel extends Database
}
}
function getNoteCount() {
$pdo = $this->linkDB();
if (!$pdo) return 0;
try {
$stmt = $pdo->prepare("SELECT COUNT(*) FROM notes");
$stmt->execute();
return $stmt->fetchColumn();
} catch (PDOException $e) {
error_log("Get Notes Count Error: " . $e->getMessage());
return 0;
}
}
function isLoggedIn() {
return isset($_SESSION['user_id']);
}