Esempio n. 1
0
 public function action_index()
 {
     try {
         $page = Input::get('page') ? Input::get('page') : 1;
         $data['employers'] = Model_Employer::get_employers($page);
         $data['page'] = $page;
         $data['total_page'] = ceil($data['employers']['total'] / 30);
         $config = array('pagination_url' => "", 'total_items' => $data['employers']['total'], 'per_page' => 30, '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('current_menu', "Employers");
         $this->theme->get_template()->set('current_menu_desc', "จัดการผู้ใช้งานที่เป็นผู้ว่าจ้างทั้งหมดในระบบ");
         $this->theme->get_template()->set('breadcrumb', array(array('title' => "Home", 'icon' => "fa-home", 'link' => Uri::create('home'), 'active' => false), array('title' => "Employers", 'icon' => "fa-building-o", 'link' => "", 'active' => true)));
         // $this->theme->get_template()->set_global('query',$query,false);
         $this->theme->set_partial('sidebar', 'common/sidebar');
         $this->theme->set_partial('content', 'employer/index')->set($data);
     } catch (Exception $e) {
         die($e->getMessage());
     }
 }