From 10b4f94e5bdd4bfe1877ad06dfdf2237e4228ab5 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Sat, 17 Dec 2011 16:25:54 +0100 Subject: #29 list of currently unemployed angels --- db/update.sql | 5 ++++- includes/pages/admin_free.php | 48 +++++++++++++++++++++++++++++++++++++++++++ includes/sys_menu.php | 1 + install/HOWTO_create_new_file | 2 ++ public/index.php | 4 ++++ templates/admin_free.html | 26 +++++++++++++++++++++++ 6 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 includes/pages/admin_free.php create mode 100644 templates/admin_free.html diff --git a/db/update.sql b/db/update.sql index 918f2005..994e285d 100644 --- a/db/update.sql +++ b/db/update.sql @@ -9,4 +9,7 @@ INSERT INTO `Privileges` ( ) VALUES ( NULL , 'ical', 'iCal shift export' -); \ No newline at end of file +); + +/* DECT Nummern können für GSM auch 5-stellig sein. */ +ALTER TABLE `User` CHANGE `DECT` `DECT` VARCHAR( 5 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL; \ No newline at end of file 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 @@ + " . 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 .= ''; + if (in_array('user_shifts_admin', $privileges)) + $table .= '' . $usr['Nick'] . ''; + else + $table .= '' . $usr['Nick'] . ''; + $table .= '' . $usr['DECT'] . ''; + $table .= '' . $usr['jabber'] . ''; + if (in_array('admin_user', $privileges)) + $table .= 'edit'; + else + $table .= '' . $usr['Nick'] . ''; + + $table .= ''; + } + 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", diff --git a/install/HOWTO_create_new_file b/install/HOWTO_create_new_file index bb6eb02b..35b17164 100644 --- a/install/HOWTO_create_new_file +++ b/install/HOWTO_create_new_file @@ -1,3 +1,5 @@ +*outdated* + 1. Create file 2. Create DB entry in table UserCVS (admin/userDefaultSetting.php9 3. update file DB/UserCVS.sql diff --git a/public/index.php b/public/index.php index d1865d4c..0e4739dc 100644 --- a/public/index.php +++ b/public/index.php @@ -102,6 +102,10 @@ elseif (in_array($p, $privileges)) { require_once ('includes/pages/admin_active.php'); $content = admin_active(); } + elseif ($p == "admin_free") { + require_once ('includes/pages/admin_free.php'); + $content = admin_free(); + } elseif ($p == "admin_news") { require_once ('includes/pages/admin_news.php'); $content = admin_news(); diff --git a/templates/admin_free.html b/templates/admin_free.html new file mode 100644 index 00000000..522de12b --- /dev/null +++ b/templates/admin_free.html @@ -0,0 +1,26 @@ +
+

+ Search Angel: +

+
+ + + + + + + + + + + %table% + +
+ Nickname + + DECT + + Jabber + + Edit +
-- cgit v1.2.3-54-g00ecf