diff options
author | Philip Häusler <msquare@notrademark.de> | 2014-12-25 22:32:18 +0100 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2014-12-25 22:32:18 +0100 |
commit | e89acc0c1d1188662da7490e3a75a4a5c3950a75 (patch) | |
tree | f646260cc23195008f6ca5152426b17641fc4f69 /includes/pages/admin_active.php | |
parent | bcd33c02c814a8d82c08c078c8fae287d1cd95a5 (diff) | |
parent | 544a51612f14c4f3cf7d1c4a6de26a99ea94b788 (diff) |
merge feature-shift-types
Diffstat (limited to 'includes/pages/admin_active.php')
-rw-r--r-- | includes/pages/admin_active.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php index 58c36f5d..08c436fc 100644 --- a/includes/pages/admin_active.php +++ b/includes/pages/admin_active.php @@ -32,7 +32,14 @@ function admin_active() { $limit = " LIMIT " . $count; if (isset($_REQUEST['ack'])) { sql_query("UPDATE `User` SET `Aktiv` = 0 WHERE `Tshirt` = 0"); - $users = sql_select("SELECT `User`.*, COUNT(`ShiftEntry`.`id`) as `shift_count`, ${shift_sum_formula} as `shift_length` FROM `User` LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID` LEFT JOIN `Shifts` ON `ShiftEntry`.`SID` = `Shifts`.`SID` WHERE `User`.`Gekommen` = 1 AND `User`.`force_active`=0 GROUP BY `User`.`UID` ORDER BY `force_active` DESC, `shift_length` DESC" . $limit); + $users = sql_select(" + SELECT `User`.*, COUNT(`ShiftEntry`.`id`) as `shift_count`, ${shift_sum_formula} as `shift_length` + FROM `User` + LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID` + LEFT JOIN `Shifts` ON `ShiftEntry`.`SID` = `Shifts`.`SID` + WHERE `User`.`Gekommen` = 1 AND `User`.`force_active`=0 + GROUP BY `User`.`UID` + ORDER BY `force_active` DESC, `shift_length` DESC" . $limit); $user_nicks = array(); foreach ($users as $usr) { sql_query("UPDATE `User` SET `Aktiv` = 1 WHERE `UID`=" . sql_escape($usr['UID'])); @@ -85,7 +92,13 @@ function admin_active() { $msg = error(_("Angel not found."), true); } - $users = sql_select("SELECT `User`.*, COUNT(`ShiftEntry`.`id`) as `shift_count`, ${shift_sum_formula} as `shift_length` FROM `User` LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID` LEFT JOIN `Shifts` ON `ShiftEntry`.`SID` = `Shifts`.`SID` WHERE `User`.`Gekommen` = 1 GROUP BY `User`.`UID` ORDER BY `force_active` DESC, `shift_length` DESC" . $limit); + $users = sql_select(" + SELECT `User`.*, COUNT(`ShiftEntry`.`id`) as `shift_count`, ${shift_sum_formula} as `shift_length` + FROM `User` LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID` + LEFT JOIN `Shifts` ON `ShiftEntry`.`SID` = `Shifts`.`SID` + WHERE `User`.`Gekommen` = 1 + GROUP BY `User`.`UID` + ORDER BY `force_active` DESC, `shift_length` DESC" . $limit); $matched_users = array(); if ($search == "") |