function save() { $this->filter_access('Tax_Employee', 'roled_add', 'taxes_employees/index'); $te = new Tax_Employee(); $te->sp_status = $this->input->post('sp_status'); $te->sp_ptkp = $this->replace_currency($this->input->post('sp_ptkp')); $te->sp_note = $this->input->post("sp_note"); if ($te->save()) { $this->session->set_flashdata('message', 'Taxes Employee successfully created!'); redirect('taxes_employees/'); } else { // Failed $te->error_message('custom', 'Field required'); $msg = $te->error->custom; $this->session->set_flashdata('message', $msg); redirect('taxes_employees/add'); } }