function update() { $family = new Family(); $fam_id = $this->input->post('id'); $staff_id = $this->uri->segment(2); $family->where('staff_fam_id', $fam_id)->update(array('staff_fam_order' => $this->input->post('staff_fam_order'), 'staff_fam_name' => $this->input->post('staff_fam_name'), 'staff_fam_birthdate' => $this->input->post('staff_fam_birthdate'), 'staff_fam_birthplace' => $this->input->post('staff_fam_birthplace'), 'staff_fam_sex' => $this->input->post('staff_fam_sex'), 'staff_fam_relation' => $this->input->post('staff_fam_relation'))); $this->session->set_flashdata('message', 'Family Update successfuly.'); redirect('staffs/' . $staff_id . '/families/index'); }
public function show($id) { $this->breadcrumb->append_crumb('Home', base_url()); $this->breadcrumb->append_crumb('Staff Detail', base_url() . ''); $staff = new Staff(); $data['staff'] = $staff->where('staff_id', $id)->get(); $family = new Family(); $data['families'] = $family->where('staff_fam_staff_id', $data['staff']->staff_id)->get(); $work = new Work(); $data['works'] = $work->where('staff_id', $data['staff']->staff_id)->get(); $education = new Education(); $data['educations'] = $education->where('staff_id', $data['staff']->staff_id)->get(); $medical = new Medical(); $data['medicals'] = $medical->where('staff_id', $data['staff']->staff_id)->get(); $asset_detail = new Asset_Detail(); $data['asset_details'] = $asset_detail->where('staff_id', $data['staff']->staff_id)->get(); $data['btn_back'] = anchor('staffs/', 'Back'); $data['btn_edit'] = anchor('staffs/edit/' . $data['staff']->staff_id, 'Edit'); $this->load->view('staffs/show', $data); }