summaryrefslogtreecommitdiff
path: root/includes/pages/admin_free.php
diff options
context:
space:
mode:
authorFelix Favre <gnomus@gnomus.de>2014-08-24 15:52:25 +0200
committerFelix Favre <gnomus@gnomus.de>2014-08-24 15:52:25 +0200
commit4faca9864f80dfd90cba248855602ab7680cab53 (patch)
tree9f2d5d76adc7d14e89d51c0073103e9d7ad717f4 /includes/pages/admin_free.php
parentefe853246f99c59e48ac66955b40fb7e09da0a5b (diff)
parentf9e577352dd31f2846c3a340a1de82dd73961568 (diff)
Merge branch 'master' of github.com:planetcyborg/engelsystem
Conflicts: themes/theme1.scss
Diffstat (limited to 'includes/pages/admin_free.php')
-rw-r--r--includes/pages/admin_free.php51
1 files changed, 34 insertions, 17 deletions
diff --git a/includes/pages/admin_free.php b/includes/pages/admin_free.php
index 19a4c99f..836197db 100644
--- a/includes/pages/admin_free.php
+++ b/includes/pages/admin_free.php
@@ -29,7 +29,7 @@ function admin_free() {
$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 = "";
+ $free_users_table = array();
if ($search == "")
$tokens = array();
else
@@ -46,24 +46,41 @@ function admin_free() {
if (! $match)
continue;
}
- $table .= '<tr>';
- $table .= '<td>' . User_Nick_render($usr) . '</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>' . User_Nick_render($usr) . '</td>';
- $table .= '</tr>';
+ $free_users_table[] = array(
+ 'name' => User_Nick_render($usr),
+ 'shift_state' => User_shift_mode_render(User_shift_state($usr)),
+ 'dect' => $usr['DECT'],
+ 'jabber' => $usr['jabber'],
+ 'email' => $usr['email'],
+ 'actions' => in_array('admin_user', $privileges) ? button(page_link_to('admin_user') . '&amp;id=' . $usr['UID'], _("edit"), 'btn-xs') : ''
+ );
}
- 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')
+ return page_with_title(admin_free_title(), array(
+ form(array(
+ div('row', array(
+ div('col-md-4', array(
+ form_text('search', _("Search"), $search)
+ )),
+ div('col-md-4', array(
+ form_select('angeltype', _("Angeltype"), $angel_types, $_REQUEST['angeltype'])
+ )),
+ div('col-md-2', array(
+ form_checkbox('confirmed_only', _("Only confirmed"), isset($_REQUEST['confirmed_only']))
+ )),
+ div('col-md-2', array(
+ form_submit('submit', _("Search"))
+ ))
+ ))
+ )),
+ table(array(
+ 'name' => _("Nick"),
+ 'shift_state' => '',
+ 'dect' => _("DECT"),
+ 'jabber' => _("Jabber"),
+ 'email' => _("E-Mail"),
+ 'actions' => ''
+ ), $free_users_table)
));
}
?>