From 156db1eadd905c7ee4c7c37dc246c8c689ae2396 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Sun, 7 Dec 2014 17:13:14 +0100 Subject: add shift entry update model --- includes/model/ShiftEntry_model.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'includes/model/ShiftEntry_model.php') diff --git a/includes/model/ShiftEntry_model.php b/includes/model/ShiftEntry_model.php index f84b312f..903bc544 100644 --- a/includes/model/ShiftEntry_model.php +++ b/includes/model/ShiftEntry_model.php @@ -34,6 +34,17 @@ function ShiftEntry_create($shift_entry) { `freeloaded`=" . sql_escape($shift_entry['freeloaded'] ? 'TRUE' : 'FALSE')); } +/** + * Update a shift entry. + */ +function ShiftEntry_update($shift_entry) { + return sql_query("UPDATE `ShiftEntry` SET + `Comment`='" . sql_escape($shift_entry['Comment']) . "', + `freeload_comment`='" . sql_escape($shift_entry['freeload_comment']) . "', + `freeloaded`=" . sql_escape($shift_entry['freeloaded'] ? 'TRUE' : 'FALSE') . " + WHERE `id`=" . sql_escape($shift_entry['id'])); +} + /** * Delete a shift entry. */ -- cgit v1.2.3-54-g00ecf