From af9f83d3c3f0bf9a634331cd3e564700a23ba64c Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 22 Dec 2017 13:49:06 +0530 Subject: [PATCH] course details changes done --- .../application/models/Studentview_model.php | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Apollo/api/application/models/Studentview_model.php diff --git a/Apollo/api/application/models/Studentview_model.php b/Apollo/api/application/models/Studentview_model.php new file mode 100644 index 00000000..9e191f72 --- /dev/null +++ b/Apollo/api/application/models/Studentview_model.php @@ -0,0 +1,54 @@ +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'] = ""; + } + return $result; + + } + /* + * get student course details + * created by kms + * */ + public function getStudentCourse($studentId=null){ + + $this->db->select('CU.CourseID,CU.CourseName,US.UniversityID,US.UniversityName,BA.BatchName'); + $this->db->from( STUDENTCOURSE . ' as SCU'); + $this->db->join( COURSE . ' as CU', 'CU.CourseID = SCU.CourseID'); + $this->db->join( UNIVERSITY . ' as US', 'US.UniversityID = SCU.UniversityID'); + $this->db->join( BATCH . ' as BA', 'BA.BatchCode = SCU.BatchCode'); + $this->db->where('SCU.StudentID', $studentId); + $courseDetails = $this->db->get(); + return $courseDetails->result(); + } +} \ No newline at end of file