course details changes done

This commit is contained in:
gandhimathi 2017-12-22 13:48:36 +05:30
parent 211a05f0e3
commit ddea4b3b20

View File

@ -83,12 +83,13 @@ class Employee_model extends CI_Model
// get single employee details
public function get_emp_detail($empLoginID = null)
{
$this->db->select('StaffID');
$this->db->select('StaffID,ListCode');
$this->db->from(LOGIN);
$this->db->where('ID', $empLoginID);
$loginEmpDetail = $this->db->get()->first_row();
if ($loginEmpDetail) {
$EmpId = $loginEmpDetail->StaffID;
if($loginEmpDetail->ListCode != STUDENT){
$this->db->select('t1.*');
$this->db->from('' . STAFF . ' as t1');
$this->db->where('t1.StaffID', $EmpId);
@ -133,6 +134,19 @@ class Employee_model extends CI_Model
$result['branchStatus'] = true;
$result['branch_details'] = $branchDetails->result();
}
}
elseif ($loginEmpDetail->ListCode == STUDENT){
$this->db->select('ST.*');
$this->db->from('' . STUDENTS . ' as ST');
$this->db->where('ST.StudentID', $EmpId);
// $this->db->join('T_StaffDetails as t2', 't1.StaffID = t2.StaffID', 'LEFT');
$responseDetails = $this->db->get()->first_row();
$result['empStatus'] = true;
$result['details'] = $responseDetails;
$result['branch_details'] = "";
}
} else {
$result['empStatus'] = false;
$result['message'] = "Something Went Wrong, Please try Again !!";