Example #1
0
 function edit()
 {
     if (isset($_POST['save'])) {
         $id = $this->input->post('id');
         $data = array('fullname' => trim($this->input->post('fullname')), 'useremail' => trim($this->input->post('useremail')), 'state' => trim($this->input->post('state')), 'user_type_id' => trim($this->input->post('user_type_id')), 'changed_date' => date('Y-m-d h:m:s'));
         $dataIn = $this->crud_model->updateData('user', 'id', $id, $data);
         if ($dataIn) {
             $this->admintemp->write('message', 'Edited Successfully');
             if ($this->input->post('user_type_id') == 3) {
                 redirect('user/golfusers');
             } else {
                 redirect('user');
             }
         } else {
             $this->admintemp->write('message', 'Error occured while editing');
             User::index();
         }
     } else {
         User::_edit();
     }
 }