#29 list of currently unemployed angels
This commit is contained in:
parent
61d61848a4
commit
10b4f94e5b
|
@ -10,3 +10,6 @@ INSERT INTO `Privileges` (
|
|||
VALUES (
|
||||
NULL , 'ical', 'iCal shift export'
|
||||
);
|
||||
|
||||
/* 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;
|
|
@ -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') . '&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') . '&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')
|
||||
));
|
||||
}
|
||||
?>
|
|
@ -39,6 +39,7 @@ function make_navigation() {
|
|||
"admin_arrive",
|
||||
"admin_active",
|
||||
"admin_user",
|
||||
"admin_free",
|
||||
"admin_usershifts",
|
||||
"admin_questions",
|
||||
"admin_angel_types",
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
*outdated*
|
||||
|
||||
1. Create file
|
||||
2. Create DB entry in table UserCVS (admin/userDefaultSetting.php9
|
||||
3. update file DB/UserCVS.sql
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<form action="%link%" method="post">
|
||||
<p>
|
||||
Search Angel: <input type="text" name="search" value="%search%" /><input type="submit" name="submit" value="Search" />
|
||||
</p>
|
||||
</form>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Nickname
|
||||
</th>
|
||||
<th>
|
||||
DECT
|
||||
</th>
|
||||
<th>
|
||||
Jabber
|
||||
</th>
|
||||
<th>
|
||||
Edit
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
%table%
|
||||
</tbody>
|
||||
</table>
|
Loading…
Reference in New Issue