function membersa($page = 1) { if ($this->tank_auth->is_admin() || $this->tank_auth->is_group('mod')) $can_edit = true; else $can_edit = false; $this->viewdata["function_title"] = "Members list"; $users = new User(); if ($this->input->post()) { $users->ilike('username', $this->input->post('search')); $this->viewdata['extra_title'][] = _('Searching') . " : " . $this->input->post('search'); } $users->get_paged($page, 20); $users_arr = array(); foreach ($users->all as $key => $item) { $form[$key][] = '<a href="' . site_url('/admin/members/member/' . $item->id) . '">' . $item->username . '</a>'; if ($can_edit) $form[$key][] = $item->email; $form[$key][] = $item->last_login; } $data['table'] = tabler($form, TRUE, FALSE); $this->viewdata["main_content_view"] = $this->load->view('auth/member_list', $data, TRUE); $this->load->view("admin/default", $this->viewdata); }
function membersa($page = 1) { // prepare a variable to decide who can edit if ($this->tank_auth->is_admin() || $this->tank_auth->is_group('mod')) { $can_edit = true; } else { $can_edit = false; } // set the subtitle $this->viewdata["function_title"] = _('Members'); $users = new User(); // support filtering via search if ($this->input->post()) { $users->ilike('username', $this->input->post('search')); $this->viewdata['extra_title'][] = _('Searching') . " : " . $this->input->post('search'); } // page results $users->get_paged($page, 20); $form = array(); // prepare the array to print out as a form foreach ($users->all as $key => $item) { $form[$key][] = '<a href="' . site_url('/admin/members/member/' . $item->id) . '">' . $item->username . '</a>'; // if true allow seeing the email if ($can_edit) { $form[$key][] = $item->email; } $form[$key][] = $item->last_login; } // create the form off the array $data['form_title'] = _('Members'); $data['table'] = tabler($form, TRUE, FALSE); // print out $this->viewdata["main_content_view"] = $this->load->view('admin/members/users', $data, TRUE); $this->load->view("admin/default", $this->viewdata); }