summaryrefslogtreecommitdiff
path: root/includes/pages/user_shifts.php
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2011-09-12 14:57:52 +0200
committerPhilip Häusler <msquare@notrademark.de>2011-09-12 14:57:52 +0200
commitd63e7e9aad407f59364d20eb2d9f123ad1985f82 (patch)
treea13a9f4d739488e611793ba173e921f0840357e7 /includes/pages/user_shifts.php
parentb39922795608dea3c96fea8c60c17c6f44a4d3c5 (diff)
#5 fixed user_shifts needed angel types calculation
Diffstat (limited to 'includes/pages/user_shifts.php')
-rw-r--r--includes/pages/user_shifts.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php
index d5367073..081a2280 100644
--- a/includes/pages/user_shifts.php
+++ b/includes/pages/user_shifts.php
@@ -98,7 +98,9 @@ function user_shifts() {
foreach ($shifts as $shift) {
$shift_row = '<tr><td>' . date(($id == 0 ? "Y-m-d " : "") . "H:i", $shift['start']) . ' - ' . date("H:i", $shift['end']) . ($id == 0 ? "<br />" . $shift['Name'] : "") . '</td><td>' . $shift['name'] . '<br />';
$show_shift = false;
- $angeltypes = sql_select("SELECT * FROM `NeededAngelTypes` JOIN `AngelTypes` ON (`NeededAngelTypes`.`angel_type_id` = `AngelTypes`.`TID`) WHERE `room_id`=" . sql_escape($shift['RID']) . " AND `count` > 0 ORDER BY `AngelTypes`.`Name`");
+ $angeltypes = sql_select("SELECT * FROM `NeededAngelTypes` JOIN `AngelTypes` ON (`NeededAngelTypes`.`angel_type_id` = `AngelTypes`.`TID`) WHERE `shift_id`=" . sql_escape($shift['SID']) . " AND `count` > 0 ORDER BY `AngelTypes`.`Name`");
+ if (count($angeltypes) == 0)
+ $angeltypes = sql_select("SELECT * FROM `NeededAngelTypes` JOIN `AngelTypes` ON (`NeededAngelTypes`.`angel_type_id` = `AngelTypes`.`TID`) WHERE `room_id`=" . sql_escape($shift['RID']) . " AND `count` > 0 ORDER BY `AngelTypes`.`Name`");
if (count($angeltypes) > 0) {
$my_shift = sql_num_query("SELECT * FROM `ShiftEntry` WHERE `SID`=" . sql_escape($shift['SID']) . " AND `UID`=" . sql_escape($user['UID']) . " LIMIT 1") > 0;