diff options
author | Philip Häusler <msquare@notrademark.de> | 2011-09-12 14:57:52 +0200 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2011-09-12 14:57:52 +0200 |
commit | d63e7e9aad407f59364d20eb2d9f123ad1985f82 (patch) | |
tree | a13a9f4d739488e611793ba173e921f0840357e7 /includes/pages/admin_shifts.php | |
parent | b39922795608dea3c96fea8c60c17c6f44a4d3c5 (diff) |
#5 fixed user_shifts needed angel types calculation
Diffstat (limited to 'includes/pages/admin_shifts.php')
-rw-r--r-- | includes/pages/admin_shifts.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/includes/pages/admin_shifts.php b/includes/pages/admin_shifts.php index af88b2d2..bcb0a809 100644 --- a/includes/pages/admin_shifts.php +++ b/includes/pages/admin_shifts.php @@ -217,12 +217,16 @@ function admin_shifts() { header("Location: ?p=admin_shifts"); die(); } - + foreach ($_SESSION['admin_shifts_shifts'] as $shift) { - foreach ($_SESSION['admin_shifts_types'] as $type) { - + sql_query("INSERT INTO `Shifts` SET `start`=" . sql_escape($shift['start']) . ", `end`=" . sql_escape($shift['end']) . ", `RID`=" . sql_escape($shift['RID']) . ", `name`='" . sql_escape($shift['name']) . "'"); + $shift_id = sql_id(); + foreach ($_SESSION['admin_shifts_types'] as $type_id => $count) { + sql_query("INSERT INTO `NeededAngelTypes` SET `shift_id`=" . sql_escape($shift_id) . ", `angel_type_id`=" . sql_escape($type_id) . ", `count`=" . sql_escape($count)); } } + + $msg = success("Schichten angelegt."); } else { unset ($_SESSION['admin_shifts_shifts']); unset ($_SESSION['admin_shifts_types']); |