summaryrefslogtreecommitdiff
path: root/includes/pages/admin_shifts.php
diff options
context:
space:
mode:
authorBot <bot@myigel.name>2017-01-03 03:22:48 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2017-01-03 03:22:48 +0100
commit356b2582f3e6a43ecf2607acad4a7fe0b37f659a (patch)
treee02c9214b23a0b9ec33aa725db962d565bd30a82 /includes/pages/admin_shifts.php
parentd71e7bbfad2f07f82df0c515608996d250fd4182 (diff)
PPHDoc, formatting, fixes, cleanup
Diffstat (limited to 'includes/pages/admin_shifts.php')
-rw-r--r--includes/pages/admin_shifts.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/includes/pages/admin_shifts.php b/includes/pages/admin_shifts.php
index b2a67786..d3bcea53 100644
--- a/includes/pages/admin_shifts.php
+++ b/includes/pages/admin_shifts.php
@@ -1,16 +1,22 @@
<?php
+/**
+ * @return string
+ */
function admin_shifts_title()
{
return _("Create shifts");
}
-// Assistent zum Anlegen mehrerer neuer Schichten
+/**
+ * Assistent zum Anlegen mehrerer neuer Schichten
+ *
+ * @return string
+ */
function admin_shifts()
{
$valid = true;
- $rid = 0;
$start = parse_date("Y-m-d H:i", date("Y-m-d") . " 00:00");
$end = $start;
$mode = 'single';
@@ -177,9 +183,9 @@ function admin_shifts()
'shifttype_id' => $shifttype_id
];
} elseif ($mode == 'multi') {
- $shift_start = $start;
+ $shift_start = (int)$start;
do {
- $shift_end = $shift_start + $length * 60;
+ $shift_end = $shift_start + (int)$length * 60;
if ($shift_end > $end) {
$shift_end = $end;
@@ -298,6 +304,7 @@ function admin_shifts()
redirect(page_link_to('admin_shifts'));
}
+ $needed_angel_types_info = [];
foreach ($_SESSION['admin_shifts_shifts'] as $shift) {
$shift['URL'] = null;
$shift['PSID'] = null;
@@ -312,7 +319,7 @@ function admin_shifts()
. " from " . date("Y-m-d H:i", $shift['start'])
. " to " . date("Y-m-d H:i", $shift['end'])
);
- $needed_angel_types_info = [];
+
foreach ($_SESSION['admin_shifts_types'] as $type_id => $count) {
$angel_type_source = sql_select("SELECT * FROM `AngelTypes` WHERE `id`='" . sql_escape($type_id) . "' LIMIT 1");
if (count($angel_type_source) > 0) {