diff --git a/Apollo/api/application/models/Studentview_model.php b/Apollo/api/application/models/Studentview_model.php index 4dfa717f..2072dba1 100755 --- a/Apollo/api/application/models/Studentview_model.php +++ b/Apollo/api/application/models/Studentview_model.php @@ -28,7 +28,7 @@ class Studentview_model extends CI_Model $result['studentStatus'] = true; $result['studentDetails'] = $studentDetails; // get student course details - $result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID); + $result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID,$requestFrom); } else{ $result['studentStatus'] = false; @@ -45,7 +45,7 @@ class Studentview_model extends CI_Model $result['studentStatus'] = true; $result['studentDetails'] = $studentDetails; // get student course details - $result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID); + $result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID,$requestFrom); } else{ $result['studentStatus'] = false; @@ -62,7 +62,7 @@ class Studentview_model extends CI_Model $result['studentStatus'] = true; $result['studentDetails'] = $studentDetails; // get student course details - $result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID); + $result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID,$requestFrom); } else{ $result['studentStatus'] = false; @@ -77,7 +77,7 @@ class Studentview_model extends CI_Model * get student course details * created by kms * */ - public function getStudentCourse($studentId=null){ + public function getStudentCourse($studentId=null,$requestFrom=null){ $this->db->select('SCU.EnrollmentID,CU.CourseID,CU.CourseName,US.UniversityID,US.UniversityName,US.UniversityShortName'); $this->db->from( STUDENTCOURSE . ' as SCU'); @@ -101,7 +101,14 @@ class Studentview_model extends CI_Model // get student boollet details $fetchData['studyMaterialDetails']=$this->getStudentMaterialDetails($studentId,$row->CourseID); // get application details - $fetchData['applicationDetails']=$this->getStudentCertificateDetails($studentId,$row->CourseID); + if($requestFrom!='2'){ + $fetchData['applicationDetails']=$this->getStudentApplicationDetails($studentId,$row->CourseID); + $fetchData['answerbookletDetails']=$this->getStudentAnswerbookletDetails($studentId,$row->CourseID); + + + } + $fetchData['certificateDetails']=$this->getStudentCertificateDetails($studentId,$row->CourseID); + // get student Mark crad details $fetchData['markCardDetails']=$this->getMarkcardDetails($studentId,$row->CourseID); @@ -332,6 +339,33 @@ class Studentview_model extends CI_Model $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = AS.ListCode'); $this->db->where('CU.CourseID', $courseID); $this->db->where('AS.StudentID', $studentID); + $this->db->where('CM.CertificateName !=', APPLICATION_CONST); + $this->db->order_by('AS.ID', 'DESC'); + $getCertDetails = $this->db->get(); + + if($getCertDetails->result()){ + return $getCertDetails->result(); + } + + else { + return false; + } + + } + /* + * get student applications details + * created by kms + * */ + public function getStudentApplicationDetails($studentID=null,$courseID=null){ + $this->db->select('AS.CertificationNo,AS.AppDate,AS.Comments,CM.CertificateName,PLD.ListName'); + $this->db->from(APPLICATION_STATUS.' as AS'); + $this->db->join(CERTIFICATION_MASTER.' as CM','CM.CertificationID = AS.CertificationType'); + //$this->db->join(COURSE_FEES.' as CF','CF.ID = AS.CourseID'); + $this->db->join(COURSE.' as CU', 'CU.CourseID = AS.CourseID'); + $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = AS.ListCode'); + $this->db->where('CU.CourseID', $courseID); + $this->db->where('AS.StudentID', $studentID); + $this->db->where('CM.CertificateName', APPLICATION_CONST); $this->db->order_by('AS.ID', 'DESC'); $getCertDetails = $this->db->get(); @@ -368,23 +402,25 @@ 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.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'); + * get student answer booklet details + * created by kms + * */ + public function getStudentAnswerbookletDetails($studentID=null,$courseID=null){ + $this->db->select('ABT.CourseID,ABT.AnsDate,ABT.Comments,CF.Sem_Year,CF.FeesType,ABT.Sem,PLD.ListName'); + $this->db->from(ANSWER_BOOKLET.' as ABT'); + $this->db->join(COURSE_FEES.' as CF','CF.ID = ABT.CourseID'); $this->db->join(COURSE.' as CU', 'CU.CourseID = CF.CourseID'); - $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = AS.ListCode'); + $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = ABT.ListCode'); $this->db->where('CU.CourseID', $courseID); - $this->db->where('AS.StudentID', $studentID); - $this->db->order_by('AS.ID', 'DESC'); - $getAppDetails = $this->db->get(); - if ($getAppDetails->result()){ - return $getAppDetails->result(); + $this->db->where('ABT.StudentID', $studentID); + $this->db->order_by('ABT.ID', 'DESC'); + $getBookletDetails = $this->db->get(); + if ($getBookletDetails->result()){ + return $getBookletDetails->result(); } else{ return false; } } + } \ No newline at end of file