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); }
function update() { $medical = new Medical(); $id = $this->input->post('id'); $medical->where('medic_id', $id)->update(array('medic_date' => $this->input->post('medic_date'), 'medic_description' => $this->input->post('medic_description'))); $this->session->set_flashdata('message', 'Medical Update successfuly.'); redirect('staffs/' . $this->staff_id . '/medical_histories/index'); }