summaryrefslogtreecommitdiff
path: root/includes/model
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2014-12-07 16:45:09 +0100
committerPhilip Häusler <msquare@notrademark.de>2014-12-07 16:54:13 +0100
commit9176261762648668b14778c5e8480a93909936b9 (patch)
treee724de0b56d0990673feb02fbcc3ee224eb32c9e /includes/model
parent09e65d1a8435f6cbdbeaba34440fc752964d2e1f (diff)
add shift entry create model
Diffstat (limited to 'includes/model')
-rw-r--r--includes/model/ShiftEntry_model.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/includes/model/ShiftEntry_model.php b/includes/model/ShiftEntry_model.php
index c7895f17..72c1d6d2 100644
--- a/includes/model/ShiftEntry_model.php
+++ b/includes/model/ShiftEntry_model.php
@@ -8,8 +8,24 @@ function ShiftEntries_freeleaded_count() {
}
/**
+ * Create a new shift entry.
+ *
+ * @param ShiftEntry $shift_entry
+ */
+function ShiftEntry_create($shift_entry) {
+ return sql_query("INSERT INTO `ShiftEntry` SET
+ `SID`=" . sql_escape($shift_entry['SID']) . ",
+ `TID`=" . sql_escape($shift_entry['TID']) . ",
+ `UID`=" . sql_escape($shift_entry['UID']) . ",
+ `Comment`='" . sql_escape($shift_entry['Comment']) . "',
+ `freeload_comment`='" . sql_escape($shift_entry['freeload_comment']) . "',
+ `freeloaded`=" . sql_escape($shift_entry['freeloaded'] ? 'TRUE' : 'FALSE'));
+}
+
+/**
* Returns next (or current) shifts of given user.
- * @param User $user
+ *
+ * @param User $user
*/
function ShiftEntries_upcoming_for_user($user) {
return sql_select("