summaryrefslogtreecommitdiff
path: root/includes/pages/user_shifts.php
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2011-12-29 00:35:23 +0100
committerPhilip Häusler <msquare@notrademark.de>2011-12-29 00:35:23 +0100
commitcf3960aeba86e785a1c473641c3ac7da220e1c3e (patch)
tree2b3884925e41985f4b2b108b7c806bfb6ed5e9aa /includes/pages/user_shifts.php
parent1633d6277298377c23e83117648412bac8d1ffd5 (diff)
shiftplan ical export
Diffstat (limited to 'includes/pages/user_shifts.php')
-rw-r--r--includes/pages/user_shifts.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php
index a8dda7f3..fe86175d 100644
--- a/includes/pages/user_shifts.php
+++ b/includes/pages/user_shifts.php
@@ -219,6 +219,7 @@ function view_user_shifts() {
global $user, $privileges;
global $ical_shifts;
+ $ical_shifts = array ();
$days = sql_select("SELECT DISTINCT DATE(FROM_UNIXTIME(`start`)) AS `id`, DATE(FROM_UNIXTIME(`start`)) AS `name` FROM `Shifts`");
$rooms = sql_select("SELECT `RID` AS `id`, `Name` AS `name` FROM `Room` WHERE `show`='Y' ORDER BY `Name`");
$types = sql_select("SELECT `id`, `name` FROM `AngelTypes`");
@@ -269,10 +270,9 @@ function view_user_shifts() {
);
$shifts = sql_select("SELECT * FROM `Shifts`
- WHERE `RID` IN (" . implode(',', $_SESSION['user_shifts']['rooms']) . ")
- AND DATE(FROM_UNIXTIME(`start`)) IN ('" . implode("','", $_SESSION['user_shifts']['days']) . "')
- ORDER BY `start`
- ");
+ WHERE `RID` IN (" . implode(',', $_SESSION['user_shifts']['rooms']) . ")
+ AND DATE(FROM_UNIXTIME(`start`)) IN ('" . implode("','", $_SESSION['user_shifts']['days']) . "')
+ ORDER BY `start`");
$shifts_table = "";
$row_count = 0;
@@ -284,17 +284,17 @@ function view_user_shifts() {
$is_free = false;
$shift_has_special_needs = 0 < sql_num_query("SELECT `id` FROM `NeededAngelTypes` WHERE `shift_id` = " . $shift['SID']);
$query = "SELECT *
- FROM `NeededAngelTypes`
- JOIN `AngelTypes`
- ON (`NeededAngelTypes`.`angel_type_id` = `AngelTypes`.`id`)
- WHERE ";
+ FROM `NeededAngelTypes`
+ JOIN `AngelTypes`
+ ON (`NeededAngelTypes`.`angel_type_id` = `AngelTypes`.`id`)
+ WHERE ";
if ($shift_has_special_needs)
$query .= "`shift_id` = " . sql_escape($shift['SID']);
else
$query .= "`room_id` = " . sql_escape($shift['RID']);
$query .= " AND `count` > 0
- AND `angel_type_id` IN (" . implode(',', $_SESSION['user_shifts']['types']) . ")
- ORDER BY `AngelTypes`.`name`";
+ AND `angel_type_id` IN (" . implode(',', $_SESSION['user_shifts']['types']) . ")
+ ORDER BY `AngelTypes`.`name`";
$angeltypes = sql_select($query);
if (count($angeltypes) > 0) {