summaryrefslogtreecommitdiff
path: root/intern.gospeladlershof.de/code/proben/update.php
diff options
context:
space:
mode:
authorHorus2016-09-27 20:02:34 +0200
committerHorus2016-09-27 20:02:34 +0200
commita3ca59de099d04b849b368f5867dd79c52e0424a (patch)
treea65b18429e86437a7d0a96ab790dd26b51c8a3aa /intern.gospeladlershof.de/code/proben/update.php
parentf70f746b5951e29eef449f962d5f531ed4a5961f (diff)
downloadgospeladlershof.de-a3ca59de099d04b849b368f5867dd79c52e0424a.tar.gz
Fügt das Backend erneut hinzu.
Diffstat (limited to 'intern.gospeladlershof.de/code/proben/update.php')
-rw-r--r--intern.gospeladlershof.de/code/proben/update.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/intern.gospeladlershof.de/code/proben/update.php b/intern.gospeladlershof.de/code/proben/update.php
new file mode 100644
index 0000000..e8694d8
--- /dev/null
+++ b/intern.gospeladlershof.de/code/proben/update.php
@@ -0,0 +1,33 @@
+<?php
+
+require_once __DIR__ . '/../db.php';
+require_once __DIR__ . '/../session.php';
+
+$db = get_db();
+
+$id = $_REQUEST["id"];
+$termin = $_REQUEST["termin"];
+$uhrzeit = $_REQUEST["uhrzeit"];
+#$bemerkung = $_REQUEST["bemerkung"];
+
+try {
+ $stmt = $db->prepare("UPDATE proben set termin=:termin, uhrzeit=:uhrzeit, bemerkung=:bemerkung WHERE id=:id;");
+
+ $stmt->bindValue(":id", $id);
+ $stmt->bindValue(":termin", $termin);
+ $stmt->bindValue(":uhrzeit", $uhrzeit);
+ #$stmt->bindValue(":bemerkung", $bemerkung);
+ $stmt->bindValue(":bemerkung", null);
+
+ $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: /");