summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2014-12-07 16:54:00 +0100
committerPhilip Häusler <msquare@notrademark.de>2014-12-07 16:54:13 +0100
commit514d2aca641f2c6fd9262e575153824e2cf977f1 (patch)
treec68bdf0e2c7b34c9c9c273714b0fd2092b0ffb27
parent9176261762648668b14778c5e8480a93909936b9 (diff)
add function to list users subscribed to a shift
-rw-r--r--includes/model/ShiftEntry_model.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/includes/model/ShiftEntry_model.php b/includes/model/ShiftEntry_model.php
index 72c1d6d2..20d0946f 100644
--- a/includes/model/ShiftEntry_model.php
+++ b/includes/model/ShiftEntry_model.php
@@ -7,9 +7,18 @@ function ShiftEntries_freeleaded_count() {
return sql_select_single_cell("SELECT COUNT(*) FROM `ShiftEntry` WHERE `freeloaded` = 1");
}
+function ShiftEntries_by_shift($shift_id) {
+ return sql_select("
+ SELECT `User`.`email`, `User`.`email_shiftinfo`, `User`.`Sprache`, `ShiftEntry`.`UID`, `ShiftEntry`.`TID`, `ShiftEntry`.`SID`, `AngelTypes`.`name` as `angel_type_name`, `ShiftEntry`.`Comment`, `ShiftEntry`.`freeloaded`
+ FROM `ShiftEntry`
+ JOIN `User` ON `ShiftEntry`.`UID`=`User`.`UID`
+ JOIN `AngelTypes` ON `ShiftEntry`.`TID`=`AngelTypes`.`id`
+ WHERE `ShiftEntry`.`SID`=" . sql_escape($shift_id));
+}
+
/**
* Create a new shift entry.
- *
+ *
* @param ShiftEntry $shift_entry
*/
function ShiftEntry_create($shift_entry) {