summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2011-12-17 16:25:54 +0100
committerPhilip Häusler <msquare@notrademark.de>2011-12-17 16:25:54 +0100
commit10b4f94e5bdd4bfe1877ad06dfdf2237e4228ab5 (patch)
tree5bdbaba3066f9679c22a53dccf809a40121595e8 /includes
parent61d61848a414dd266f7765fd89b35ce7b07a4e53 (diff)
#29 list of currently unemployed angels
Diffstat (limited to 'includes')
-rw-r--r--includes/pages/admin_free.php48
-rw-r--r--includes/sys_menu.php1
2 files changed, 49 insertions, 0 deletions
diff --git a/includes/pages/admin_free.php b/includes/pages/admin_free.php
new file mode 100644
index 00000000..d5e3bd36
--- /dev/null
+++ b/includes/pages/admin_free.php
@@ -0,0 +1,48 @@
+<?php
+function admin_free() {
+ global $privileges;
+
+ $search = "";
+ if (isset ($_REQUEST['search']))
+ $search = strip_request_item('search');
+
+ $users = sql_select("SELECT `User`.* FROM `User` 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 ();
+ else
+ $tokens = explode(" ", $search);
+ foreach ($users as $usr) {
+ if (count($tokens) > 0) {
+ $match = false;
+ $index = join("", $usr);
+ foreach ($tokens as $t)
+ if (strstr($index, trim($t))) {
+ $match = true;
+ break;
+ }
+ if (!$match)
+ continue;
+ }
+ $table .= '<tr>';
+ if (in_array('user_shifts_admin', $privileges))
+ $table .= '<td><a href="' . page_link_to('user_myshifts') . '&amp;id=' . $usr['UID'] . '">' . $usr['Nick'] . '</a></td>';
+ else
+ $table .= '<td>' . $usr['Nick'] . '</td>';
+ $table .= '<td>' . $usr['DECT'] . '</td>';
+ $table .= '<td>' . $usr['jabber'] . '</td>';
+ if (in_array('admin_user', $privileges))
+ $table .= '<td><a href="' . page_link_to('admin_user') . '&amp;id=' . $usr['UID'] . '">edit</a></td>';
+ else
+ $table .= '<td>' . $usr['Nick'] . '</td>';
+
+ $table .= '</tr>';
+ }
+ return template_render('../templates/admin_free.html', array (
+ 'search' => $search,
+ 'table' => $table,
+ 'link' => page_link_to('admin_free')
+ ));
+}
+?> \ No newline at end of file
diff --git a/includes/sys_menu.php b/includes/sys_menu.php
index ef1998e1..6dd2c3aa 100644
--- a/includes/sys_menu.php
+++ b/includes/sys_menu.php
@@ -39,6 +39,7 @@ function make_navigation() {
"admin_arrive",
"admin_active",
"admin_user",
+ "admin_free",
"admin_usershifts",
"admin_questions",
"admin_angel_types",