function create() { if (isset($_POST['save'])) { $data = array('district_name' => trim($this->input->post('district_name')), 'state' => $this->input->post('state')); $dataIn = $this->district_model->create($data); if ($dataIn) { $this->admintemp->write('message', 'Saved Successfully'); redirect('district'); } else { $this->admintemp->write('error', 'An error occured while inserting the tee color set.'); District::index(); } } else { District::_create(); } }