public function index($offset = 0) { $this->breadcrumb->append_crumb('Home', base_url()); $this->breadcrumb->append_crumb('Staff Detail', base_url() . 'index.php/staffs/show/' . $this->staff_id); $this->breadcrumb->append_crumb('Educations', base_url() . ''); $education = new Education(); $data['staff_id'] = $this->staff_id; $education->where('staff_id', $this->staff_id)->order_by('edu_year', 'ASC'); $total_rows = $education->count(); $data['title'] = "Family"; $data['btn_add'] = anchor('staffs/' . $this->staff_id . '/educations/add', 'Add New', array('class' => 'btn btn-primary')); $data['btn_home'] = anchor('staffs', 'Home'); $offset = $this->uri->segment($this->uri_segment); $data['educations'] = $education->where('staff_id', $this->staff_id)->get($this->limit, $offset)->all; $config['base_url'] = site_url('staffs/' . $this->staff_id . '/educations/index'); $config['total_rows'] = $total_rows; $config['per_page'] = $this->limit; $config['uri_segment'] = $this->uri_segment; $this->pagination->initialize($config); $data['pagination'] = $this->pagination->create_links(); $data['breadcrumb'] = $this->breadcrumb->output(); $this->load->view('staff_education/index', $data); }