add function to list users subscribed to a shift

This commit is contained in:
Philip Häusler 2014-12-07 16:54:00 +01:00
parent 9176261762
commit 514d2aca64
1 changed files with 10 additions and 1 deletions

View File

@ -7,6 +7,15 @@ function ShiftEntries_freeleaded_count() {
return sql_select_single_cell("SELECT COUNT(*) FROM `ShiftEntry` WHERE `freeloaded` = 1"); 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. * Create a new shift entry.
* *