From c70851504652267c95194a98756c6875271cdda7 Mon Sep 17 00:00:00 2001 From: Mathias Magnusson Date: Tue, 23 Sep 2025 00:07:35 +0200 Subject: Implement reviews --- public/index.php | 12 +------- public/kontakt.php | 10 ------- "public/omd\303\266men.php" | 32 --------------------- "public/omd\303\266men/edit.php" | 33 +++++++++++++++++++++ "public/omd\303\266men/index.php" | 60 +++++++++++++++++++++++++++++++++++++++ public/style.css | 6 ++-- 6 files changed, 98 insertions(+), 55 deletions(-) delete mode 100644 "public/omd\303\266men.php" create mode 100644 "public/omd\303\266men/edit.php" create mode 100644 "public/omd\303\266men/index.php" (limited to 'public') diff --git a/public/index.php b/public/index.php index 8e6f565..0dd4d48 100644 --- a/public/index.php +++ b/public/index.php @@ -1,16 +1,6 @@ -
-
-

Trädgårdstomten ✂️

-
- -
-
+

Jag heter Lucas Magnusson, är 26 år gammal och har flera års yrkeserfarenhet och är även utbildad inom trädgård. Jag har alltid varit intresserad av allt som diff --git a/public/kontakt.php b/public/kontakt.php index a23e0c6..ed60c0d 100644 --- a/public/kontakt.php +++ b/public/kontakt.php @@ -1,14 +1,4 @@ -

-
-

Trädgårdstomten ✂️

-
- -

Kontakta mig gärna så hör jag av mig så fort jag kan!


diff --git "a/public/omd\303\266men.php" "b/public/omd\303\266men.php" deleted file mode 100644 index c4a912a..0000000 --- "a/public/omd\303\266men.php" +++ /dev/null @@ -1,32 +0,0 @@ - -
-
-

Trädgårdstomten ✂️

-
- -
-
-
-
- - -
- - -
- -
-
- -
diff --git "a/public/omd\303\266men/edit.php" "b/public/omd\303\266men/edit.php" new file mode 100644 index 0000000..00b2d3b --- /dev/null +++ "b/public/omd\303\266men/edit.php" @@ -0,0 +1,33 @@ +fetchArray(); + +if ($_SERVER["REQUEST_METHOD"] === "POST") { + $name = $_POST["name"]; + $content = $_POST["content"]; + + query("update reviews set name = ?, content = ? where rowid = ?", $name, $content, $rowid); + + header("HX-Redirect: /omd%c3%b6men/"); + exit; +} + +require "../../include/layout.php"; layout($_); +?> + +
+ + +
+ + +
+ +
diff --git "a/public/omd\303\266men/index.php" "b/public/omd\303\266men/index.php" new file mode 100644 index 0000000..53a9123 --- /dev/null +++ "b/public/omd\303\266men/index.php" @@ -0,0 +1,60 @@ +fetchArray()) { + $row["editable"] = isset($_SESSION["editable review"]) && $_SESSION["editable review"] === $row["rowid"]; + $row = (object) $row; + $reviews[] = $row; +} + +require "../../include/layout.php"; layout($_); +?> +
+
+
+ + +
+
+ + +
+ +

Du kommer kunna redigera ditt omdöme tills du stänger fliken

+
+
+ + + +
+

name) ?>:

+

content) ?>

+ editable) { ?> + + +
+ +
diff --git a/public/style.css b/public/style.css index 6f145db..c157f7d 100644 --- a/public/style.css +++ b/public/style.css @@ -1,3 +1,5 @@ +@import "https://www.nerdfonts.com/assets/css/webfont.css"; + * { margin: 0; box-sizing: border-box; @@ -62,7 +64,7 @@ main { margin-inline: auto; } -main article { +#about-text { padding-bottom: 4em; display: grid; gap: 2em; @@ -71,7 +73,7 @@ main article { } @media (min-width: 500px) { - main article { + #about-text { grid-template-columns: auto auto; grid-template-areas: "p1 img" "p2 p2" "p3 p3"; } -- cgit v1.2.3