diff options
| author | Benjamin Southall <applemansigloo@gmail.com> | 2017-09-11 07:29:05 +0900 |
|---|---|---|
| committer | Benjamin Southall <applemansigloo@gmail.com> | 2017-09-11 07:29:05 +0900 |
| commit | 7b9bad73825f549aeed35b53a5f81137cc357cf4 (patch) | |
| tree | 592989c2ded3a8c8eabd2e298c2948b68cfba0bd /templates/themes/calendar/calendarpost.php | |
| parent | e461bd77982b7d2de3cb72c4860a3836fc1f5e2c (diff) | |
Fixing deletion of events from calendar theme
Diffstat (limited to 'templates/themes/calendar/calendarpost.php')
| -rw-r--r-- | templates/themes/calendar/calendarpost.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/templates/themes/calendar/calendarpost.php b/templates/themes/calendar/calendarpost.php index a36e080c..5293a881 100644 --- a/templates/themes/calendar/calendarpost.php +++ b/templates/themes/calendar/calendarpost.php @@ -24,7 +24,9 @@ $method = $_SERVER['REQUEST_METHOD']; break; case "delete": $id = $_POST['id']; - $query = query("DELETE from calendar_events WHERE id = :id") or error(db_error()); + $query = prepare("DELETE from calendar_events WHERE id = :id"); + $query->bindValue(':id', $id); + $query->execute() or error(db_error($query)); break; case "update": $id = $_POST['id']; @@ -32,6 +34,8 @@ $method = $_SERVER['REQUEST_METHOD']; $description = $_POST['description']; $start = $_POST['start']; $end = $_POST['end']; + $color = $_POST['color']; + $url = $_POST['url']; $query = prepare(" UPDATE calendar_events SET title = :title, description = :description, start = :start, end = :end, url = :url, color =:color WHERE id = :id"); $query->bindValue(':id', $id); $query->bindValue(':title', $title); |
