diff --git a/application/controllers/user.php b/application/controllers/user.php index 53cbabd7..b4e4d8bb 100755 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -1091,7 +1091,7 @@ function attendanceyear($empID ='') // { $this->form_validation->set_rules('EmpList','EmpList','trim|callback_Employee_validateS'); - $this->form_validation->set_rules('role','role','trim|callback_Role_validate'); + // $this->form_validation->set_rules('role','role','trim|callback_Role_validate'); $this->form_validation->set_rules('password','Password','required|max_length[20]'); $this->form_validation->set_rules('cpassword','Confirm Password','trim|required|matches[password]|max_length[20]'); @@ -1103,7 +1103,7 @@ function attendanceyear($empID ='') else { $EmpID = $this->input->post('EmpList'); - $roleId = $this->input->post('role'); + $roleId = '2'; $password = $this->input->post('password'); $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $Createddt = $dt->format('Y-m-d H:i:s'); @@ -1117,9 +1117,15 @@ function attendanceyear($empID ='') $userInfo = array('email'=>$email,'EmpID'=>$EmpID,'password'=>getHashedPassword($password),'roleId'=>$roleId,'createdBy'=>$this->vendorId,'createdDtm'=>$Createddt); + + + + //die(); $result = $this->user_model->addNewUser($userInfo); + + for ($j = 0; $j < count($comma_separated); $j++) { $DeptCode = $comma_separated[$j]; @@ -1134,8 +1140,9 @@ function attendanceyear($empID ='') if($result > 0) { - redirect('userListing','refresh'); + echo ""; + redirect('userListing','refresh'); } diff --git a/application/models/user_model.php b/application/models/user_model.php index c5044284..11b42096 100755 --- a/application/models/user_model.php +++ b/application/models/user_model.php @@ -81,6 +81,7 @@ class User_model extends CI_Model */ function addNewUser($userInfo) { + $this->db->trans_start(); $this->db->insert('tbl_users', $userInfo); diff --git a/application/views/addNew.php b/application/views/addNew.php index 770af29b..3de18369 100755 --- a/application/views/addNew.php +++ b/application/views/addNew.php @@ -109,8 +109,24 @@ -