function page()
{
    global $db, $session;
    //lets get a user
    $db->select('users.id,firstname,lastname,email,department_name');
    $db->from('users');
    $db->join('user_departments', 'users.department_id=user_departments.id');
    $db->order_by('lastname');
    $users = $db->fetch();
    $searchFields[] = array('type' => 'text', 'label' => 'Last Name', 'value' => '', 'field' => 'lastname');
    $db->select('id,department_name');
    $db->from('user_departments');
    $db->order_by('department_name');
    $departments = $db->fetch();
    $searchFields[] = array('type' => 'select', 'value' => 0, 'label' => 'Department', 'field' => 'department_id', 'options' => $departments, 'option_field' => 'department_name');
    // this is the bare minimum implementation;
    $table = new Table();
    $table->setRecordActionBase('/pages/user/user.php');
    $table->setData($users);
    $table->setSearch($searchFields);
    $table->setNewButton('New User', '/pages/user/user.php');
    $actions[] = array('action' => 'list', 'label' => "Permissions", 'url' => '/pages/user/permissions.php');
    $actions[] = array('action' => 'list', 'label' => "Groups", 'url' => '/pages/user/groups.php');
    $table->setFormActions($actions);
    $table->generate();
    $GLOBALS['scripts'] = array_merge($GLOBALS['scripts'], $table->tableScripts);
}
function page()
{
    global $db, $session;
    //lets get a user
    $db->select('id,displayname');
    $db->from('core_permission_list');
    $db->order_by('displayname');
    $permissions = $db->fetch();
    $searchFields[] = array('type' => 'text', 'label' => 'Display Name', 'value' => '', 'field' => 'displayname');
    // this is the bare minimum implementation;
    $table = new Table();
    $table->setRecordActionBase('/pages/permissions/permissionEdit.php');
    $table->setData($permissions);
    $table->setSearch($searchFields);
    $table->setNewButton('New Permission', '/pages/permissions/permissionEdit.php');
    $table->generate();
    $GLOBALS['scripts'] = array_merge($GLOBALS['scripts'], $table->tableScripts);
}
function page()
{
    global $db, $session;
    //lets get a user
    $db->select('id,group_name');
    $db->from('core_permission_groups');
    $db->order_by('group_name');
    $groups = $db->fetch();
    $searchFields[] = array('type' => 'text', 'label' => 'Group Name', 'value' => '', 'field' => 'group_name');
    // this is the bare minimum implementation;
    $table = new Table();
    $table->setRecordActionBase('permissions/groupEdit.php');
    $actions[] = array('action' => 'selectpermissions', 'label' => "Permissions", 'url' => 'permissions/groupPermissions.php');
    $table->setRecordActions($actions);
    $table->setData($groups);
    $table->setSearch($searchFields);
    $table->setNewButton('New Group', 'permissions/groupEdit.php');
    $table->generate();
    $GLOBALS['scripts'] = array_merge($GLOBALS['scripts'], $table->tableScripts);
}
function page()
{
    global $db, $session;
    //lets get a user
    $db->select('users.id,firstname,lastname,email,department_name');
    $db->from('users');
    $db->join('user_departments', 'users.department_id=user_departments.id');
    $db->order_by('lastname');
    $users = $db->fetch();
    $searchFields[] = array('type' => 'text', 'label' => 'Last Name', 'value' => '', 'field' => 'lastname');
    $searchFields[] = array('type' => 'date', 'label' => 'Start Date', 'value' => '', 'field' => 'last_login');
    $db->select('id,department_name');
    $db->from('user_departments');
    $db->order_by('department_name');
    $departments = $db->fetch();
    $searchFields[] = array('type' => 'select', 'value' => 0, 'label' => 'Department', 'field' => 'department_id', 'options' => $departments, 'option_field' => 'department_name');
    // this is the bare minimum implementation;
    $table = new Table();
    $table->setData($users);
    $table->setSearch($searchFields);
    $table->generate();
    $GLOBALS['scripts'] = array_merge($GLOBALS['scripts'], $table->tableScripts);
}