diff --git a/Apollo/api/application/models/Studentview_model.php b/Apollo/api/application/models/Studentview_model.php index dca06a32..aa0546a4 100755 --- a/Apollo/api/application/models/Studentview_model.php +++ b/Apollo/api/application/models/Studentview_model.php @@ -18,7 +18,7 @@ class Studentview_model extends CI_Model // get student list based on login user public function getStudentInfo($requestedBy=null,$requestFrom=null) { - if($requestFrom !='1'){ + if($requestFrom =='2'){ $this->db->select('ST.*'); $this->db->from( LOGIN . ' as LO'); $this->db->join( STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID'); @@ -35,7 +35,7 @@ class Studentview_model extends CI_Model $result['studentInfo'] = ""; } } - else{ + else if($requestFrom =='1'){ $this->db->select('ST.*'); $this->db->from( LOGIN . ' as LO'); $this->db->join( STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID'); @@ -52,6 +52,23 @@ class Studentview_model extends CI_Model $result['studentInfo'] = ""; } } + else if ($requestFrom =='3'){ + $this->db->select('ST.*'); + $this->db->from( LOGIN . ' as LO'); + $this->db->join( STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID'); + $this->db->where('ST.MobileNumber', $requestedBy); + $studentDetails = $this->db->get()->first_row(); + if($studentDetails){ + $result['studentStatus'] = true; + $result['studentDetails'] = $studentDetails; + // get student course details + $result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID); + } + else{ + $result['studentStatus'] = false; + $result['studentInfo'] = ""; + } + } return $result;