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/omd\303\266men/edit.php" | 33 +++++++++++++++++++++ "public/omd\303\266men/index.php" | 60 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 "public/omd\303\266men/edit.php" create mode 100644 "public/omd\303\266men/index.php" (limited to 'public/omdömen') 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) { ?> + + +
+ +
-- cgit v1.2.3