summaryrefslogtreecommitdiff
path: root/includes/model/Shifts_model.php
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2014-01-05 19:33:52 +0100
committerPhilip Häusler <msquare@notrademark.de>2014-01-05 19:33:52 +0100
commit9dc5dbe3b6eacae5ea8dc335304edf7007d2ab57 (patch)
tree89c55ca146593db853957e0de3dc12efdc7852f8 /includes/model/Shifts_model.php
parent316c18f9129451bd30484293cadc5e9e8c62f604 (diff)
cookie-0005-API-add-getApiKey.patch
Diffstat (limited to 'includes/model/Shifts_model.php')
-rw-r--r--includes/model/Shifts_model.php25
1 files changed, 21 insertions, 4 deletions
diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php
index 224bfc0b..df47b967 100644
--- a/includes/model/Shifts_model.php
+++ b/includes/model/Shifts_model.php
@@ -41,7 +41,7 @@ function mShiftList() {
if (count($shifts_source) > 0) {
return $shifts_source;
}
-return null;
+ return null;
}
/**
@@ -51,10 +51,27 @@ return null;
*/
function mShift($id) {
$shifts_source = sql_select("SELECT * FROM `Shifts` WHERE `SID`=" . sql_escape($id) . " LIMIT 1");
+ $shiftsEntry_source = sql_select("SELECT `TID` , `UID` , `freeloaded` FROM `ShiftEntry` WHERE `SID`=" . sql_escape($id) );
+
if ($shifts_source === false)
return false;
- if (count($shifts_source) > 0)
- return $shifts_source[0];
+ if (count($shifts_source) > 0) {
+ $result = $shifts_source[0];
+
+ $result['ShiftEntry'] = $shiftsEntry_source;
+
+ $temp = NeededAngelTypes_by_shift($id);
+ foreach( $temp as $e)
+ {
+ $result['NeedAngels'][] = array (
+ 'TID' => $e['angel_type_id'],
+ 'count' => $e['count'],
+ 'restricted' => $e['restricted'],
+ 'taken' => $e['taken'] );
+ }
+
+ return $result;
+ }
return null;
}
@@ -71,7 +88,7 @@ function Shifts() {
return false;
foreach ($shifts_source as &$shift) {
- $needed_angeltypes = NeededAngelTypes_by_shift($shift);
+ $needed_angeltypes = NeededAngelTypes_by_shift($shift['SID']);
if ($needed_angeltypes === false)
return false;