public function addPersonnel() { $this->form_validation->set_rules('txtProjectID', 'Project ID', 'trim|required'); $this->form_validation->set_rules('txtEmployee', 'Employee Name', 'trim|required'); $this->form_validation->set_rules('txtDateIssued', 'Assign Date', 'trim|required'); $data = array("project_id" => $this->input->post('txtProjectID'), "employee_id" => $this->input->post('txtEmployee'), "assigned_date" => $this->input->post('txtDateIssued')); if ($this->form_validation->run()) { if (Project_worker_model::create($data)) { $this->session->set_userdata('added', 1); Audit_trail_model::auditProjectPersonnel($data); redirect('ems/view_projects'); } } }
public function add_personnel() { Project_worker_model::addPersonnel(); $data['project'] = Projects_model::all(); $data['employee'] = Emp_info_model::all(); $data['pageTitle'] = 'Project Personnel- MSInc.'; $data['content'] = 'employee/add_personnel'; $this->load->view($this->master_layout, $data); }