summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2013-12-01 20:06:41 +0100
committerPhilip Häusler <msquare@notrademark.de>2013-12-01 20:06:41 +0100
commit33785f45a2669651299660dee207ea8cf988d291 (patch)
tree488dcec5fcae862b100bb9db9e8292901b2d5feb
parentada62a2937cd8a5eefe796690f76928eeaea3d73 (diff)
missing start and end shift in session
-rw-r--r--includes/pages/user_shifts.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php
index 19adf08e..b30b9dc5 100644
--- a/includes/pages/user_shifts.php
+++ b/includes/pages/user_shifts.php
@@ -350,10 +350,17 @@ function view_user_shifts() {
if ($_SESSION['user_shifts']['start_day'] == $_SESSION['user_shifts']['end_day'] && $_SESSION['user_shifts']['start_time'] >= $_SESSION['user_shifts']['end_time'])
$_SESSION['user_shifts']['end_time'] = '23:59';
- $starttime = DateTime::createFromFormat("Y-m-d H:i", $_SESSION['user_shifts']['start_day'] . $_SESSION['user_shifts']['start_time']);
- $starttime = $starttime->getTimestamp();
- $endtime = DateTime::createFromFormat("Y-m-d H:i", $_SESSION['user_shifts']['end_day'] . $_SESSION['user_shifts']['end_time']);
- $endtime = $endtime->getTimestamp();
+ if(isset($_SESSION['user_shifts']['start_day'])) {
+ $starttime = DateTime::createFromFormat("Y-m-d H:i", $_SESSION['user_shifts']['start_day'] . $_SESSION['user_shifts']['start_time']);
+ $starttime = $starttime->getTimestamp();
+ } else
+ $starttime = now();
+
+ if(isset($_SESSION['user_shifts']['end_day'])) {
+ $endtime = DateTime::createFromFormat("Y-m-d H:i", $_SESSION['user_shifts']['end_day'] . $_SESSION['user_shifts']['end_time']);
+ $endtime = $endtime->getTimestamp();
+ } else
+ $endtime = now() + 24*60*60;
if (! isset($_SESSION['user_shifts']['rooms']) || count($_SESSION['user_shifts']['rooms']) == 0)
$_SESSION['user_shifts']['rooms'] = array(