summaryrefslogtreecommitdiff
path: root/includes/pages/user_myshifts.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/pages/user_myshifts.php')
-rw-r--r--includes/pages/user_myshifts.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php
index a10e6f82..81f8f505 100644
--- a/includes/pages/user_myshifts.php
+++ b/includes/pages/user_myshifts.php
@@ -31,8 +31,7 @@ function user_myshifts()
$user_id = $user['UID'];
}
- $shifts_user = DB::select('SELECT * FROM `User` WHERE `UID`=? LIMIT 1', [$user_id]);
- $shifts_user = array_shift($shifts_user);
+ $shifts_user = DB::selectOne('SELECT * FROM `User` WHERE `UID`=? LIMIT 1', [$user_id]);
if ($request->has('reset')) {
if ($request->input('reset') == 'ack') {
@@ -49,7 +48,7 @@ function user_myshifts()
]);
} elseif ($request->has('edit') && preg_match('/^\d*$/', $request->input('edit'))) {
$user_id = $request->input('edit');
- $shift = DB::select('
+ $shift = DB::selectOne('
SELECT
`ShiftEntry`.`freeloaded`,
`ShiftEntry`.`freeload_comment`,
@@ -74,7 +73,6 @@ function user_myshifts()
]
);
if (count($shift) > 0) {
- $shift = array_shift($shift);
$freeloaded = $shift['freeloaded'];
$freeload_comment = $shift['freeload_comment'];
@@ -128,7 +126,7 @@ function user_myshifts()
}
} elseif ($request->has('cancel') && preg_match('/^\d*$/', $request->input('cancel'))) {
$user_id = $request->input('cancel');
- $shift = DB::select('
+ $shift = DB::selectOne('
SELECT *
FROM `Shifts`
INNER JOIN `ShiftEntry` USING (`SID`)
@@ -140,7 +138,6 @@ function user_myshifts()
]
);
if (count($shift) > 0) {
- $shift = array_shift($shift);
if (
($shift['start'] > time() + config('last_unsubscribe') * 3600)
|| in_array('user_shifts_admin', $privileges)