public function deleteEmployee() { $id = $this->input->get('emp_id'); $emp = Emp_info_model::find($id); $info = Emp_info_model::find($id); //Tab 1a - Personal Tab $gov_id = Gov_id_model::find($id); //Tab 1b - Gov ID Tab $address = Emp_address_model::find($id); //Tab 2a - Contact Tab $contact = Emp_contact_model::find($id); //Tab 2b - Contact Tab $contactP = Emp_contact_person::find($id); //Tab 2c - Contact Tab $school = Emp_school_model::find($id); //Tab 3 - School Tab $emp_hist = Emp_history_model::find($id); //Tab 5 - Employment Tab $account = Users::find_by_employee_id($id); //Tab 9 - Users Tab $emp->delete(); $info->delete(); $gov_id->delete(); $address->delete(); $contact->delete(); $contactP->delete(); $school->delete(); $emp_hist->delete(); $account->delete(); $this->session->set_userdata('deleted', 1); Audit_trail_model::auditDeleteEmp($id); redirect('ems/employees'); }
public function view_details() { $id = $this->input->get('emp_id'); $data['departments'] = Departments_model::all(); $data['job_titles'] = Job_titles_model::all(); $data['employment_type'] = Employment_type_model::all(); $data['countryy'] = Countries::all(); $data['user_level'] = View_user_level::all(); $data['record'] = Dependent_model::find('all', array('conditions' => "employee_id='{$id}'")); //get dependents by id $data['info'] = Emp_info_model::find($id); //Tab 1a - Personal Tab $data['gov_id'] = Gov_id_model::find($id); //Tab 1b - Gov ID Tab $data['address'] = View_emp_address::find($id); //Tab 2a - Contact Tab $data['contact'] = Emp_contact_model::find($id); //Tab 2b - Contact Tab $data['contactP'] = Emp_contact_person::find($id); //Tab 2c - Contact Tab $data['school'] = Emp_school_model::find($id); //Tab 3 - School Tab $data['job_hist'] = Job_history_model::find('all', array('conditions' => "employee_id ='{$id}'")); //Tab 4 - Job History Tab $data['emp'] = View_job_history::find($id); //Tab 5 - Employment Tab $data['leaves'] = View_leaves_left::find('all', array('conditions' => "employee_id ='{$id}'")); //Tab 6 - Leaves Tab $data['asset'] = View_assigned_assets_model::find('all', array('conditions' => "emp_id ='{$id}'")); //Tab 7 - Asset Tab $data['project'] = View_project_workers::find('all', array('conditions' => "emp_id ='{$id}'")); //Tab 8 - Project Tab $data['account'] = View_users_model::find_by_employee_id($id); //Tab 9 - Users Tab $data['pageTitle'] = 'Employee Details - MSInc.'; $data['content'] = 'employee/employee_details'; $this->load->view($this->master_layout, $data); $this->display_notif(); }