summaryrefslogtreecommitdiff
path: root/intern.gospeladlershof.de/code/chor/update.php
diff options
context:
space:
mode:
Diffstat (limited to 'intern.gospeladlershof.de/code/chor/update.php')
-rw-r--r--intern.gospeladlershof.de/code/chor/update.php27
1 files changed, 27 insertions, 0 deletions
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 @@
+<?php
+
+require_once __DIR__ . '/../db.php';
+require_once __DIR__ . '/../session.php';
+
+$db = get_db();
+
+$id = $_REQUEST["id"];
+$nachricht = $_REQUEST["termin"];
+
+try {
+ $stmt = $db->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: /");