From 3f7c7ef7dd77966d7df1d3c72cc1c1260a9bf1e0 Mon Sep 17 00:00:00 2001 From: Patryk Hegenberg Date: Fri, 16 Dec 2022 10:37:54 +0100 Subject: [PATCH] Part on rendering notes finished --- controllers/note.php | 11 +++++++++++ controllers/notes.php | 11 +++++++++++ index.php | 4 ++-- router.php | 4 +++- views/note.view.php | 12 ++++++++++++ views/notes.view.php | 15 +++++++++++++++ views/partials/nav.php | 5 ++++- 7 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 controllers/note.php create mode 100644 controllers/notes.php create mode 100644 views/note.view.php create mode 100644 views/notes.view.php diff --git a/controllers/note.php b/controllers/note.php new file mode 100644 index 0000000..b237951 --- /dev/null +++ b/controllers/note.php @@ -0,0 +1,11 @@ +query('select * from notes where id = :id', ['id' => $_GET['id']] )->fetch(); + //dd($notes); + require "views/note.view.php"; \ No newline at end of file diff --git a/controllers/notes.php b/controllers/notes.php new file mode 100644 index 0000000..4e4ac23 --- /dev/null +++ b/controllers/notes.php @@ -0,0 +1,11 @@ +query('select * from notes where user_id = 1')->fetchAll(); + //dd($notes); + require "views/notes.view.php"; \ No newline at end of file diff --git a/index.php b/index.php index 4203a55..7f6b31a 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,7 @@ query($query, [$id])->fetchAll(PDO::FETCH_ASSOC); // Beide Varianten machen inhaltlich das Gleiche. // freie Wahl, welche der beiden Varianten bevorzugt wird. -dd($posts); \ No newline at end of file +//dd($posts); \ No newline at end of file diff --git a/router.php b/router.php index fa62ee7..e945627 100644 --- a/router.php +++ b/router.php @@ -6,7 +6,9 @@ $routes = [ '/about' => 'controllers/about.php', '/contact' => 'controllers/contact.php', '/mission' => 'controllers/mission.php', - '/mathe' => 'controllers/mathe.php' + '/mathe' => 'controllers/mathe.php', + '/note' => 'controllers/note.php', + '/notes' => 'controllers/notes.php' ]; function routeToController($uri, $routes) { diff --git a/views/note.view.php b/views/note.view.php new file mode 100644 index 0000000..7837a47 --- /dev/null +++ b/views/note.view.php @@ -0,0 +1,12 @@ + + + +
+
+

+ go back +

+

+
+
+ \ No newline at end of file diff --git a/views/notes.view.php b/views/notes.view.php new file mode 100644 index 0000000..42cce6e --- /dev/null +++ b/views/notes.view.php @@ -0,0 +1,15 @@ + + + +
+
+ +
  • + + + +
  • + +
    +
    + \ No newline at end of file diff --git a/views/partials/nav.php b/views/partials/nav.php index d90aa3b..71bbc7b 100644 --- a/views/partials/nav.php +++ b/views/partials/nav.php @@ -18,6 +18,7 @@ Mathe + Notes @@ -50,14 +51,16 @@ From: "transform opacity-100 scale-100" To: "transform opacity-0 scale-95" --> + + Active: "bg-gray-100", Not Active: "" Your Profile Settings Sign out + -->