From fd27eb50b7e5e93228085f6116685316a7f604c4 Mon Sep 17 00:00:00 2001 From: gandhimathi Bharathirajan Date: Sun, 9 Apr 2017 16:16:47 +0530 Subject: [PATCH] add and Edit screen issue fixed --- application/models/Employeedetails_model.php | 30 ++++++-------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/application/models/Employeedetails_model.php b/application/models/Employeedetails_model.php index 0a06aacd..e40e0b60 100644 --- a/application/models/Employeedetails_model.php +++ b/application/models/Employeedetails_model.php @@ -125,25 +125,10 @@ function addNewemployee($Employee) return $EmpID; } - /** - * This function used to get user information by id - * @param number $userId : This is user id - * @return array $result : This is user information - */ - function getuserInfo($EmpID) - { - $this->db->select('EmpID,FirstName,LastName,DateofBirth,ContactNumber,EmailId,DateofJoining,Role,Address1,Address2, - Place,City,State,Pin,DepartmentName,User_Comments,Created_date'); - $this->db->from('T_EmpDetails'); - - $this->db->where('EmpID', $EmpID); - $query = $this->db->get(); - - return $query->result(); - } + function UpdateEmployee($Emp, $EmpID) { - echo $EmpID; + //echo $EmpID; $this->db->where('EmpID', $EmpID); $this->db->update('T_Employee_Details', $Emp); return TRUE; @@ -169,19 +154,22 @@ function addNewemployee($Employee) { $this->db->select('DepartmentName'); $this->db->from('T_EmployeeDetails'); - $this->db->where('EmpID', $EmployeeID); + $this->db->where($EmployeeID); $query = $this->db->get(); return $query->result_array(); } - function checkMailExists($email) + function checkMailExists($email='',$Empid='') { $this->db->select('EmailId'); $this->db->from('T_Employee_Details'); $this->db->where('EmailId',$email); - + if ($Empid != '') + { + $this->db->where('EmpID !=',$Empid); + } $query = $this->db->get(); - + //print_r($this->db->last_query()); if ($query->num_rows > 0) { return $query->result_array(); }