" . 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')
));
}
?>