diff --git a/Controller/NotesController.php b/Controller/NotesController.php new file mode 100644 index 0000000..cdb8a6c --- /dev/null +++ b/Controller/NotesController.php @@ -0,0 +1,27 @@ +notesModel = new NotesModel(); + $this->view = $view; + } + + public function showNotes() + { + $this->view->setVars([ + "notes" => $this->notesModel->selectNotes() + ]); + + } + +} \ No newline at end of file diff --git a/Model/NotesModel.php b/Model/NotesModel.php new file mode 100644 index 0000000..35253c8 --- /dev/null +++ b/Model/NotesModel.php @@ -0,0 +1,29 @@ +linkDB(); + + try { + $res = $pdo->query($sql); + } catch (\PDOException $e) { + new \ppa\Library\ErrorMsg("Ihre Anfrage konnte nicht verarbeitet werden", $e); + die; + } + + return $res->fetchAll(\PDO::FETCH_ASSOC); + } +} \ No newline at end of file diff --git a/Views/Notes/showNotes.phtml b/Views/Notes/showNotes.phtml new file mode 100644 index 0000000..a152acf --- /dev/null +++ b/Views/Notes/showNotes.phtml @@ -0,0 +1,17 @@ + + +
' . $n["content"] . '
'; + echo '