summaryrefslogtreecommitdiff
path: root/includes/pages/user_shifts.php
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2011-12-21 22:20:06 +0100
committerPhilip Häusler <msquare@notrademark.de>2011-12-21 22:20:06 +0100
commit5e5443fad6bcd49ee57fda70855dc1e63a52f255 (patch)
treec1b7475495ca7775dd2f975ff010b67255e34076 /includes/pages/user_shifts.php
parent23d82fecb4d1e40f2ef8fe1ebc16455fa7221f0f (diff)
#44 angeltypes recreated
Diffstat (limited to 'includes/pages/user_shifts.php')
-rw-r--r--includes/pages/user_shifts.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php
index 668fe8b7..10a96278 100644
--- a/includes/pages/user_shifts.php
+++ b/includes/pages/user_shifts.php
@@ -36,7 +36,7 @@ function user_shifts() {
$room_array[$room['RID']] = $room['Name'];
// Engeltypen laden
- $types = sql_select("SELECT * FROM `NeededAngelTypes` JOIN `AngelTypes` ON (`NeededAngelTypes`.`angel_type_id` = `AngelTypes`.`TID`) WHERE `shift_id`=" . sql_escape($shift_id) . " ORDER BY `AngelTypes`.`Name`");
+ $types = sql_select("SELECT * FROM `NeededAngelTypes` JOIN `AngelTypes` ON (`NeededAngelTypes`.`angel_type_id` = `AngelTypes`.`id`) WHERE `shift_id`=" . sql_escape($shift_id) . " ORDER BY `AngelTypes`.`name`");
$needed_angel_types = array ();
foreach ($types as $type)
$needed_angel_types[$type['TID']] = $type['count'];
@@ -162,7 +162,7 @@ function user_shifts() {
else
header("Location: " . page_link_to('user_shifts'));
- $type = sql_select("SELECT * FROM `AngelTypes` WHERE `TID`=" . sql_escape($type_id) . " LIMIT 1");
+ $type = sql_select("SELECT * FROM `AngelTypes` WHERE `id`=" . sql_escape($type_id) . " LIMIT 1");
if (count($type) == 0)
header("Location: " . page_link_to('user_shifts'));
$type = $type[0];
@@ -240,9 +240,9 @@ function user_shifts() {
$shift_row .= ' <a href="?p=user_shifts&edit_shift=' . $shift['SID'] . '">[edit]</a> <a href="?p=user_shifts&delete_shift=' . $shift['SID'] . '">[x]</a>';
$shift_row .= '<br />';
$show_shift = false;
- $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`");
+ $angeltypes = sql_select("SELECT * FROM `NeededAngelTypes` JOIN `AngelTypes` ON (`NeededAngelTypes`.`angel_type_id` = `AngelTypes`.`id`) 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`");
+ $angeltypes = sql_select("SELECT * FROM `NeededAngelTypes` JOIN `AngelTypes` ON (`NeededAngelTypes`.`angel_type_id` = `AngelTypes`.`id`) 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;