Ejemplo n.º 1
0
 public function action_index()
 {
     $page = Input::get('page') ? Input::get('page') : 1;
     $query = Input::get('query') ? Input::get('query') : "";
     $data['employees'] = Model_Employee::get_employees($page);
     $data['page'] = $page;
     $data['total_page'] = ceil($data['employees']['total'] / 20);
     $config = array('pagination_url' => "", 'total_items' => $data['employees']['total'], 'per_page' => 20, 'uri_segment' => 2, 'current_page' => $page);
     $pagination = Pagination::forge('pagenav', $config);
     $data['pagination'] = $pagination->render();
     $this->theme->set_template('index');
     $this->theme->get_template()->set_global('current_menu', "Employees");
     $this->theme->get_template()->set_global('current_menu_desc', "จัดการผู้ใช้งานที่เป็นผู้หางานทั้งหมดในระบบ");
     $this->theme->get_template()->set('breadcrumb', array(array('title' => "Home", 'icon' => "fa-home", 'link' => Uri::create('home'), 'active' => false), array('title' => "Employees", 'icon' => "fa-users", 'link' => "", 'active' => true)));
     $this->theme->get_template()->set_global('query', $query, false);
     $this->theme->set_partial('sidebar', 'common/sidebar');
     $this->theme->set_partial('content', 'employee/index')->set($data);
 }