From cbc20d51ce2db57837d47faf320396c75281c91f Mon Sep 17 00:00:00 2001 From: Horus3 Date: Fri, 2 Dec 2016 19:48:41 +0100 Subject: Fügt jetzt auch das Backend für das Editieren der Chorbeschreibungen hinzu. --- intern.gospeladlershof.de/code/chor/insert.php | 24 +++++++++++++++++++++++ intern.gospeladlershof.de/code/chor/update.php | 27 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 intern.gospeladlershof.de/code/chor/insert.php create mode 100644 intern.gospeladlershof.de/code/chor/update.php diff --git a/intern.gospeladlershof.de/code/chor/insert.php b/intern.gospeladlershof.de/code/chor/insert.php new file mode 100644 index 0000000..f1ec3d0 --- /dev/null +++ b/intern.gospeladlershof.de/code/chor/insert.php @@ -0,0 +1,24 @@ +prepare("INSERT INTO chor (id, nachricht) VALUES(NULL, :nachricht);"); + $stmt->bindValue(":nachricht", $nachricht); + $stmt->execute(); + +} catch ( Exception $e ) { + $_SESSION["error"] = $e->getMessage(); + error_log($e->getMessage()); +} + +if ( empty($_SESSION) || is_null($_SESSON["error"]) ) { + $_SESSION["success"] = "Erfolgreich eingetragen!"; +} +header($_SERVER["SERVER_PROTOCOL"] . " 302 Redirect"); +header("Location: /"); diff --git a/intern.gospeladlershof.de/code/chor/update.php b/intern.gospeladlershof.de/code/chor/update.php new file mode 100644 index 0000000..a781835 --- /dev/null +++ b/intern.gospeladlershof.de/code/chor/update.php @@ -0,0 +1,27 @@ +prepare("UPDATE chor set nachricht =:nachricht WHERE id=:id;"); + + $stmt->bindValue(":id", $id); + $stmt->bindValue(":nachricht", $nachricht); + $stmt->execute(); + +} catch ( Exception $e ) { + $_SESSION["error"] = $e->getMessage(); + error_log($e->getMessage()); +} + +if ( empty($_SESSION) || is_null($_SESSON["error"]) ) { + $_SESSION["success"] = "Erfolgreich aktualisiert!"; +} +header($_SERVER["SERVER_PROTOCOL"] . " 302 Redirect"); +header("Location: /"); -- cgit v1.2.3