diff --git a/application/models/Employeedetails_model.php b/application/models/Employeedetails_model.php index 09b149e3..ee5898c5 100644 --- a/application/models/Employeedetails_model.php +++ b/application/models/Employeedetails_model.php @@ -135,29 +135,33 @@ function addNewemployee($Employee) $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('isDeleted', 0); - //$this->db->where('roleId !=', 1); + $this->db->where('EmpID', $EmpID); $query = $this->db->get(); return $query->result(); } - function editemployee($Emp, $EmpID) + function UpdateEmployee($Emp, $EmpID) { echo $EmpID; $this->db->where('EmpID', $EmpID); - $this->db->update('T_EmpDetails', $Emp); - + $this->db->update('T_Employee_Details', $Emp); return TRUE; } - function viewemployee($Emp, $EmpID) + + function viewemployee( $EmpID) { - echo $EmpID; - $this->db->where('EmpID', $EmpID); - $this->db->update('T_EmpDetails', $Emp); + $this->db->select('Emp.*,Dep.DepartmentName as DepartmentName'); + $this->db->from('T_Employee_Details AS Emp'); + $this->db->join('T_DepartmentDetails Dep', 'Emp.Departmentcode = Dep.DEPCode','left'); + $this->db->where('Emp.EmpID', $EmpID); + $query = $this->db->get(); + + $result = $query->result(); - return TRUE; + // print_r($this->db->last_query()); + return $result; } /* This function to get the Employee department on respective Employee */ @@ -182,5 +186,18 @@ function addNewemployee($Employee) return $query->result_array(); } } + + function checkPhotoExists($Pic) + { + $this->db->select('ProfilePic'); + $this->db->from('T_Employee_Details'); + $this->db->where($Pic); + + $query = $this->db->get(); + // print_r($this->db->last_query()); + if ($query->num_rows > 0) { + return $query->result_array(); + } + } } ?> \ No newline at end of file