setSafeMode(true); $this->notesModel = new \ppa\Model\NotesModel(); $note = null; $noteId = $_GET['id'] ?? 0; $note = $this->notesModel->getNoteById($noteId, $_SESSION['user_id']); if (!$note) { echo "
Note not found or you don't have permission to edit it.
"; echo "Back to Dashboard"; } function isLoggedIn() { return isset($_SESSION['user_id']); } function isAdmin() { return isLoggedIn() && isset($_SESSION['role']) && $_SESSION['role'] === 'admin'; } function sanitize($data, $flags = ENT_QUOTES, $encoding = 'UTF-8') { return htmlspecialchars((string)$data, $flags, $encoding); } ?>
Drag & drop a .txt or .md file here, or fill manually.
text(sanitize($note['content'])); else echo "Start typing or drop a file to see preview..."; ?>