diff --git a/Apollo/api/application/models/Studentview_model.php b/Apollo/api/application/models/Studentview_model.php index 216d1fd2..dca06a32 100755 --- a/Apollo/api/application/models/Studentview_model.php +++ b/Apollo/api/application/models/Studentview_model.php @@ -16,23 +16,43 @@ class Studentview_model extends CI_Model * */ // get student list based on login user - public function getStudentInfo($requestedBy=null) + public function getStudentInfo($requestedBy=null,$requestFrom=null) { - $this->db->select('ST.*'); - $this->db->from( LOGIN . ' as LO'); - $this->db->join( STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID'); - $this->db->where('LO.ID', $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); + if($requestFrom !='1'){ + $this->db->select('ST.*'); + $this->db->from( LOGIN . ' as LO'); + $this->db->join( STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID'); + $this->db->where('LO.ID', $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'] = ""; + } } else{ - $result['studentStatus'] = false; - $result['studentInfo'] = ""; + $this->db->select('ST.*'); + $this->db->from( LOGIN . ' as LO'); + $this->db->join( STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID'); + $this->db->where('ST.StudentID', $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; } @@ -273,7 +293,7 @@ class Studentview_model extends CI_Model * get student application details * created by kms*/ public function getStudentApplicationDetails($studentID=null,$courseID=null){ - $this->db->select('AS.CourseID,AS.CertificationType,AS.AppDate,AS.Comments,CF.Sem_Year,PLD.ListName'); + $this->db->select('AS.CourseID,AS.AppDate,AS.Comments,CF.Sem_Year,PLD.ListName'); $this->db->from(APPLICATION_STATUS.' as AS'); $this->db->join(COURSE_FEES.' as CF','CF.ID = AS.CourseID'); $this->db->join(COURSE.' as CU', 'CU.CourseID = CF.CourseID');