From 74647e16d37fac9425a4561b49618b52cdc3e75c Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Fri, 22 Aug 2014 22:34:13 +0200 Subject: add basic bootstrap theme --- includes/pages/admin_free.php | 45 +++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'includes/pages/admin_free.php') diff --git a/includes/pages/admin_free.php b/includes/pages/admin_free.php index 86bd38a1..19a4c99f 100644 --- a/includes/pages/admin_free.php +++ b/includes/pages/admin_free.php @@ -5,31 +5,33 @@ function admin_free_title() { function admin_free() { global $privileges; - + $search = ""; - if (isset ($_REQUEST['search'])) + if (isset($_REQUEST['search'])) $search = strip_request_item('search'); - + $angeltypesearch = ""; - if (empty ($_REQUEST['angeltype'])) + if (empty($_REQUEST['angeltype'])) $_REQUEST['angeltype'] = ''; else { $angeltypesearch = " INNER JOIN `UserAngelTypes` ON (`UserAngelTypes`.`angeltype_id` = '" . sql_escape($_REQUEST['angeltype']) . "' AND `UserAngelTypes`.`user_id` = `User`.`UID`"; - if (isset ($_REQUEST['confirmed_only'])) + if (isset($_REQUEST['confirmed_only'])) $angeltypesearch .= " AND `UserAngelTypes`.`confirm_user_id`"; $angeltypesearch .= ") "; } - + $angel_types_source = sql_select("SELECT `id`, `name` FROM `AngelTypes` ORDER BY `name`"); - $angel_types = array('' => 'alle Typen'); + $angel_types = array( + '' => 'alle Typen' + ); foreach ($angel_types_source as $angel_type) $angel_types[$angel_type['id']] = $angel_type['name']; - + $users = sql_select("SELECT `User`.* FROM `User` ${angeltypesearch} LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID` LEFT JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID` AND `Shifts`.`start` < " . sql_escape(time()) . " AND `Shifts`.`end` > " . sql_escape(time()) . ") WHERE `User`.`Gekommen` = 1 AND `Shifts`.`SID` IS NULL GROUP BY `User`.`UID` ORDER BY `Nick`"); - + $table = ""; if ($search == "") - $tokens = array (); + $tokens = array(); else $tokens = explode(" ", $search); foreach ($users as $usr) { @@ -38,10 +40,10 @@ function admin_free() { $index = join("", $usr); foreach ($tokens as $t) if (stristr($index, trim($t))) { - $match = true; - break; - } - if (!$match) + $match = true; + break; + } + if (! $match) continue; } $table .= ''; @@ -52,15 +54,16 @@ function admin_free() { $table .= 'edit'; else $table .= '' . User_Nick_render($usr) . ''; - + $table .= ''; } - return template_render('../templates/admin_free.html', array ( - 'search' => $search, - 'angeltypes' => html_select_key('angeltype', 'angeltype', $angel_types, $_REQUEST['angeltype']), - 'confirmed_only' => isset($_REQUEST['confirmed_only'])? 'checked' : '', - 'table' => $table, - 'link' => page_link_to('admin_free') + return template_render('../templates/admin_free.html', array( + 'title' => admin_free_title(), + 'search' => $search, + 'angeltypes' => html_select_key('angeltype', 'angeltype', $angel_types, $_REQUEST['angeltype']), + 'confirmed_only' => isset($_REQUEST['confirmed_only']) ? 'checked' : '', + 'table' => $table, + 'link' => page_link_to('admin_free') )); } ?> -- cgit v1.2.3-54-g00ecf