case $crudConfig['create']: $c = ""; $dt['company_code'] = $this->input->post('company_code'); $sec_exist = $this->Sec_users_db->getDetails($dt); if ($sec_exist) { $c .= 'Company ID already exists.'; $data['action'] = 'exist'; } else { $fields = array( "company_code" ,"company_name" ); foreach ($fields as $field) {if (isset($_POST[$field])) $dt[$field] = $this->input->post($field);} $item = $this->input->post("item"); $data['item'] = $this->Sec_users_db->save($dt,$item); } break;