Example #1
0
 function do_index()
 {
     $users = new User();
     $users->order_by('name');
     $users->get();
     $this->render(null, array('users' => $users));
 }
Example #2
0
 public function roster()
 {
     // Check for POST data on request
     $data['users'] = array();
     $data['group_size'] = 1;
     $postData = $this->input->post(NULL, TRUE);
     if ($postData) {
         $users = new User();
         if ($this->input->post('freshmen')) {
             $users->where('year', '2017');
         }
         if ($this->input->post('sophomores')) {
             $users->where('year', '2016');
         }
         if ($this->input->post('staff')) {
             $users->where('role', 'staff');
         }
         $users->order_by('id', 'random');
         $users->get();
         if ($this->input->post('size')) {
             $data['group_size'] = (int) $this->input->post('size');
         }
         $data['users'] = $users;
     }
     $this->template->title = 'Roster Generator';
     $this->template->content->view('nexus/roster', $data);
     $this->template->publish();
 }
Example #3
0
 /**
  * Main route for users page
  *
  * Route: /users
  */
 public function index()
 {
     if (!$this->authorized()) {
         header('Location: /auth/login');
     }
     $users = new User();
     $users->where('role = "resident" OR role = "staff"');
     $users->order_by("last_name", "asc");
     $users->order_by("first_name", "asc");
     $users->get();
     $data['users'] = $users;
     $this->template->title = 'Users';
     $this->template->javascript->add('assets/js/isotope.min.js');
     $this->template->content->view('users/index', $data);
     $this->template->publish();
 }
Example #4
0
 public static function select_html($selected = 0, $name = "user_id", $userrole = null, $class = "select", $template = '%name% (%userrole%)')
 {
     $users = new User();
     if (empty($userrole)) {
         $users->order_by('name')->get_iterated();
     } else {
         $users->where_related_userrole('name', $userrole)->order_by('access_level desc')->get_iterated();
     }
     echo "<select name='{$name}' class='{$class}'>";
     foreach ($users as $usr) {
         if ($selected == $usr->id) {
             $selstr = " selected='selected'";
         } else {
             $selstr = "";
         }
         $format = parse_template($template, $usr->to_array());
         echo "<option value='{$usr->id}' class='user_select'{$selstr}>" . $format . "</option>\n";
     }
     echo "</select>";
 }
Example #5
0
 function index()
 {
     $user = new User();
     $data['title'] = "Users";
     $data['btn_add'] = anchor('users/sign_up', 'Add New', "class='btn btn-primary'");
     $data['btn_home'] = anchor(base_url(), 'Home', "class='btn btn-home'");
     $uri_segment = 3;
     $offset = $this->uri->segment($uri_segment);
     if ($this->input->get('search_by')) {
         $total_rows = $user->like($_GET['search_by'], $_GET['q'])->count();
         $user->like($_GET['search_by'], $_GET['q'])->order_by('username', 'ASC');
     } else {
         $total_rows = $user->count();
         $user->order_by('username', 'ASC');
     }
     $data['user_list'] = $user->get($this->limit, $offset)->all;
     $config['base_url'] = site_url("users/index");
     $config['total_rows'] = $total_rows;
     $config['per_page'] = $this->limit;
     $config['uri_segment'] = $uri_segment;
     $this->pagination->initialize($config);
     $data['pagination'] = $this->pagination->create_links();
     $this->load->view('users/index', $data);
 }
Example #6
0
 /**
  * Staff information
  *
  * URL: /home/staff
  */
 public function staff()
 {
     $staff_members = new User();
     $staff_members->where('role = "staff"');
     foreach ($staff_members as $staff) {
         echo $staff->first_name;
     }
     $staff_members->order_by("last_name", "asc");
     $staff_members->order_by("first_name", "asc");
     $staff_members->get();
     $data['staff_members'] = $staff_members;
     $this->template->title = 'Student Staff';
     $this->template->content->view('static/staff', $data);
     $this->template->publish();
 }
 public function get_index()
 {
     $this->data[$this->views] = User::order_by('id', 'asc')->get();
     return View::make('admin.' . $this->views . '.index', $this->data);
 }
Example #8
0
 public function get_index()
 {
     //    	$this->data[$this->views] = User::order_by('id','asc')->get();
     $this->data[$this->views] = User::order_by('id', 'asc')->paginate(PER_PAGE_MEDIUM);
     return View::make('admin.' . $this->views . '.index', $this->data);
 }
Example #9
0
<?php 
}
?>

<form id="entry_form" class="basic_form" enctype="multipart/form-data" method="POST" action="<?php 
echo $entry->id ? site_url("/entries/update/{$entry->id}") : site_url("/entries/create");
?>
">
  <p class="required"> = required</p>
  <?php 
if ($currentUser->is_admin) {
    // The current owner (defaults to current user if not specified)
    $owner_id = $entry->user->id;
    // Render drop down of current users
    $users = new User();
    $users->order_by('name');
    $users->get();
    ?>
    <div class="label">Entry Owner</div>
    <select name="owner_id">
    <option>Choose an owner ...</option>
    <?php 
    foreach ($users as $user) {
        ?>
    <option value="<?php 
        echo $user->id;
        ?>
" <?php 
        echo $user->id == $owner_id ? "selected" : "";
        ?>
>
Example #10
0
<?
require('../../inc/admin/config.php');
$session->auth_or_redirect('admin', '/', true);

$admin_title = 'Manage Users';

include(ROOT.'/inc/admin/header.php');

$user = new User;
$users = $user->order_by('username')->find(array("`username` NOT IN ('admin', 'su')"));
?>

<p><a href="/admin">Back to Admin Home</a></p>

<p><a href="new.php"><img src="/images/admin/button_add.jpg" alt="Add User" id="button_add" /></a></p>

  <table>
    <tr>
      <th>Username</th>
    </tr>
	<?php 
foreach ($users as $user) {
    ?>
    <tr>
      <td>
        <a href="edit.php?id=<?php 
    echo $user->id;
    ?>
">
          <?php 
    echo $user->username;
Example #11
0
 public function get_list()
 {
     return View::make('page.admin.users.list')->with('users', User::order_by('email', 'ASC')->paginate(100));
 }
Example #12
0
 public function all_get($token)
 {
     $token_entry = new Token();
     $token_entry->get_by_valid_token($token)->get();
     if ($token_entry->exists() && $token_entry->user->get()->is_admin) {
         $response = array();
         $users = new User();
         $users->order_by('username', 'DESC')->get();
         foreach ($users as $user) {
             $u = new stdClass();
             $u->id = $user->id;
             $u->username = $user->username;
             $u->firstname = $user->firstname;
             $u->lastname = $user->lastname;
             $u->is_admin = $user->is_admin;
             array_push($response, $u);
         }
         $this->response($response);
     }
 }
Example #13
0
 /**
  * Shows users list
  *
  * @return str
  */
 public function get_index()
 {
     $users = User::order_by('id', 'asc')->get();
     return View::make('gotin::users', array('users' => $users, 'flash' => $this->flash, 'active' => 'users', 'active' => 'users', 'b_links' => array('Users')));
 }
Example #14
0
 function index()
 {
     $users = new User();
     $data['users'] = $users->order_by('id', 'desc')->get_page();
     $this->template->build('index', $data);
 }
Example #15
0
 function get_view()
 {
     $users = User::order_by('ID', 'asc')->get();
     return View::make("admin.UserMgt.list", array("users" => $users));
 }