db->select('ST.*'); $this->db->select('LO.ID,ST.*,concat(SF.Firstname," ",SF.Lastname) as fname,STC.DOJ'); $this->db->from( LOGIN . ' as LO'); $this->db->join( STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID'); $this->db->join (STAFF .' as SF', 'SF.StaffID = ST.AdmittedBy','left'); $this->db->join( STUDENTCOURSE . ' as STC', 'STC.StudentID = 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->getStudentCourseStudentLogin($studentDetails->StudentID,$requestFrom,$requestedBranch,$accessFrom); } else{ $result['studentStatus'] = false; $result['studentInfo'] = ""; } } else if($requestFrom =='1'){ //echo '1';die(); $this->db->select('ST.*,concat(SF.Firstname," ",SF.Lastname) as fname,STC.DOJ'); $this->db->from( LOGIN . ' as LO'); $this->db->join( STUDENTS .' as ST', 'LO.StaffID = ST.StudentID'); $this->db->join (STAFF .' as SF', 'SF.StaffID = ST.AdmittedBy'); $this->db->join( STUDENTCOURSE . ' as STC', 'STC.StudentID = ST.StudentID'); $this->db->where('ST.StudentID', $requestedBy); $this->db->where('STC.BranchID', $requestedBranch); $studentDetails = $this->db->get()->first_row(); if($studentDetails){ $result['studentStatus'] = true; $result['studentDetails'] = $studentDetails; // get student course details $result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID,$requestFrom,$requestedBranch); } else{ $result['studentStatus'] = false; $result['studentInfo'] = ""; } } else if ($requestFrom =='3'){ // echo '3'; $this->db->select('ST.*'); $this->db->from( LOGIN . ' as LO'); $this->db->join( STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID'); $this->db->join( STUDENTCOURSE . ' as STC', 'STC.StudentID = ST.StudentID'); $this->db->where('ST.MobileNumber', $requestedBy); $this->db->where('STC.BranchID', $requestedBranch); $studentDetails = $this->db->get()->first_row(); if($studentDetails){ $result['studentStatus'] = true; $result['studentDetails'] = $studentDetails; // get student course details $result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID,$requestFrom,$requestedBranch); } else{ $result['studentStatus'] = false; $result['studentInfo'] = ""; } } // requestedFrom 4 for based on form get student details else if ($requestFrom =='4'){ //echo '4'; $this->db->select('ST.*'); $this->db->from( LOGIN . ' as LO'); $this->db->join( STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID'); $this->db->join( STUDENTCOURSE . ' as STC', 'STC.StudentID = 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->getFormStudentCourse($studentDetails->StudentID,$requestFrom); } else{ $result['studentStatus'] = false; $result['studentInfo'] = ""; } } return $result; } public function getStudentCourseStudentLogin($studentId=null,$requestFrom=null,$requestedBranch=null,$accessFrom=null){ // this sub query for avoid university duplicate id $this->db->select('SCU.EnrollmentID,CU.CourseID,CU.CourseName,US.UniversityID,US.UniversityName,US.UniversityShortName'); $this->db->from( STUDENTCOURSE . ' as SCU'); $this->db->join( BRANCH . ' as BR', 'BR.BranchCode = SCU.BranchID'); $this->db->join( COURSE . ' as CU', 'CU.CourseID = SCU.CourseID'); $this->db->join( UNIVERSITY . ' as US', 'US.UniversityID = SCU.UniversityID AND SCU.BranchID=US.BranchCode'); $this->db->where('SCU.StudentID',$studentId); if($accessFrom == 'Web'){ $this->db->where('BR.Is_StudentWebAccessActive', 1); } else{ $this->db->where('BR.Is_StudentMobileAccessActive', 1); } $courseDetails = $this->db->get(); if($courseDetails->result()){ $studentCourseStatus['status'] = true; foreach ($courseDetails->result() as $row){ $fetchData['CourseID']=$row->CourseID; $fetchData['CourseName']=$row->CourseName; $fetchData['UniversityID']=$row->UniversityID; $fetchData['UniversityName']=$row->UniversityName; $fetchData['UniveShortName'] = $row->UniversityShortName; // $fetchData['SessionName']=$row->SessionName; $fetchData['EnrollmentID']=$row->EnrollmentID; // get student fees details $fetchData['feesDetails']=$this->getStudentFeesDetails($studentId,$row->CourseID); // get student boollet details $fetchData['studyMaterialDetails']=$this->getStudentMaterialDetails($studentId,$row->CourseID); // get application details if($requestFrom!='2'){ $fetchData['applicationDetails']=$this->getStudentApplicationDetails($studentId,$row->CourseID); $fetchData['answerbookletDetails']=$this->getStudentAnswerbookletDetails($studentId,$row->CourseID); } $fetchData['certificateDetails']=$this->getStudentCertificateDetails($studentId,$row->CourseID); $fetchData['markCardDetails']=$this->getMarkcardDetails($studentId,$row->CourseID); $CourseArray[]=$fetchData; } $studentCourseStatus['courseStatus'] = $CourseArray; } else{ $studentCourseStatus['status'] = false; } return $studentCourseStatus; } /* * get student course details * created by kms * */ public function getStudentCourse($studentId=null,$requestFrom=null,$requestedBranch=null){ // this sub query for avoid university duplicate id /* $this->db->select('BranchID')->from(STUDENTCOURSE); $this->db->where('StudentID',$studentId); $subQuery = $this->db->get_compiled_select();*/ // subquery end $this->db->select('SCU.EnrollmentID,CU.CourseID,CU.CourseName,US.UniversityID,US.UniversityName,US.UniversityShortName'); $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 AND SCU.BranchID=US.BranchCode'); // $this->db->join( SESSIONMASTER . ' as SM', 'SM.SessionID = SCU.SessionID'); $this->db->where('SCU.StudentID',$studentId); if($requestFrom!='2'){ $this->db->where('CU.BranchCode',$requestedBranch); } // $this->db->where('US.BranchCode IN('. $subQuery.')', NULL, FALSE); $courseDetails = $this->db->get(); if($courseDetails->result()){ $studentCourseStatus['status'] = true; foreach ($courseDetails->result() as $row){ $fetchData['CourseID']=$row->CourseID; $fetchData['CourseName']=$row->CourseName; $fetchData['UniversityID']=$row->UniversityID; $fetchData['UniversityName']=$row->UniversityName; $fetchData['UniveShortName'] = $row->UniversityShortName; // $fetchData['SessionName']=$row->SessionName; $fetchData['EnrollmentID']=$row->EnrollmentID; // get student fees details $fetchData['feesDetails']=$this->getStudentFeesDetails($studentId,$row->CourseID); // get student boollet details $fetchData['studyMaterialDetails']=$this->getStudentMaterialDetails($studentId,$row->CourseID); // get application details if($requestFrom!='2'){ //$fetchData['applicationDetails']=$this->getStudentApplicationDetails($studentId,$row->CourseID); $fetchData['applicationDetails']=$this->getStudentLatestAppStatus($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); $CourseArray[]=$fetchData; } $studentCourseStatus['courseStatus'] = $CourseArray; } else{ $studentCourseStatus['status'] = false; } return $studentCourseStatus; } /* * get student course details * created by kms * */ public function getFormStudentCourse($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'); $this->db->join( COURSE . ' as CU', 'CU.CourseID = SCU.CourseID'); $this->db->join( UNIVERSITY . ' as US', 'US.UniversityID = SCU.UniversityID AND SCU.BranchID=US.BranchCode'); $this->db->where('SCU.StudentID',$studentId); $courseDetails = $this->db->get(); if($courseDetails->result()){ $studentCourseStatus['status'] = true; foreach ($courseDetails->result() as $row){ $fetchData['CourseID']=$row->CourseID; $fetchData['CourseName']=$row->CourseName; $fetchData['UniversityID']=$row->UniversityID; $fetchData['UniversityName']=$row->UniversityName; $fetchData['UniveShortName'] = $row->UniversityShortName; // $fetchData['SessionName']=$row->SessionName; $fetchData['EnrollmentID']=$row->EnrollmentID; // get student fees details $fetchData['feesDetails']=$this->getStudentFeesDetails($studentId,$row->CourseID); // get student boollet details $fetchData['studyMaterialDetails']=$this->getStudentMaterialDetails($studentId,$row->CourseID); // get application details 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); $CourseArray[]=$fetchData; } $studentCourseStatus['courseStatus'] = $CourseArray; } else{ $studentCourseStatus['status'] = false; } return $studentCourseStatus; } /* * get student fees details * created by kms * */ public function getStudentFeesDetails($studentID=null,$courseID=null){ $serachArray=[WAIVER,REFERRAL]; $this->db->distinct(); $this->db->select('SFS.FeesID,SFS.FeesType,SFS.RollNo,ifnull(SFS.CourseFees,0) as CourseFees,ifnull(SFS.STFOrWR,0) as STFOrWR,ifnull(SFS.Waiver,0) as Waiver,ifnull(SFS.Others,0) as Others,CF.Sem_Year,CF.FeesType as CourseFeesType,SM.SessionName,SM1.SessionName as ToSessionName,CF.ProgramType,BA.BatchName,BA.BatchDate,BA.BatchCode'); $this->db->from(STUDENTS_FEES_STATUS.' as SFS'); $this->db->join(SESSIONMASTER.' as SM', 'SM.SessionID = SFS.SessionName'); $this->db->join(SESSIONMASTER.' as SM1', 'SM1.SessionID = SFS.ToSessionName','left'); $this->db->join(STUDENTS_FEES_PAID.' as SFP','SFP.FeesId = SFS.FeesID','left'); $this->db->join(COURSE_FEES.' as CF', 'CF.ID = SFS.FeesType'); $this->db->join(BATCH.' as BA', 'BA.BatchCode = SFS.BatchCode AND SFS.BranchCode=BA.BranchCode'); $this->db->where('SFS.CourseID', $courseID); $this->db->where('SFS.StudentID', $studentID); // $this->db->where('SFP.IsActive', '1'); $this->db->order_by('SFS.FeesID', 'ASC'); $getFeeDetails = $this->db->get(); if($getFeeDetails->result()){ foreach ($getFeeDetails->result() as $feeRow){ $storePaidDetails['FeesID'] = $feeRow->FeesID; $storePaidDetails['FeesName'] = $feeRow->Sem_Year; $storePaidDetails['CourseFees'] = $feeRow->CourseFees; $storePaidDetails['ProgramType'] = $feeRow->ProgramType; $storePaidDetails['SessionName'] = $feeRow->SessionName; if($feeRow->ToSessionName=='' || $feeRow->ToSessionName==null){ $storePaidDetails['ToSessionName'] = "Not Applicable"; } else{ $storePaidDetails['ToSessionName'] = $feeRow->ToSessionName; } $storePaidDetails['RollNo'] = $feeRow->RollNo; $storePaidDetails['STFOrWR'] = $feeRow->STFOrWR; $storePaidDetails['Waiver'] = $feeRow->Waiver; $storePaidDetails['Others'] = $feeRow->Others; $storePaidDetails['CourseFeesType'] = $feeRow->CourseFeesType; $storePaidDetails['PayableAmount'] = $feeRow->CourseFees+$feeRow->STFOrWR+$feeRow->Others-$feeRow->Waiver; $this->db->select('ifnull(SUM((BillAmount)),0) as PaidBillAmount'); $this->db->where('FeesId',$feeRow->FeesID); $this->db->where('IsActive', '1'); $paidBillAmount = $this->db->get(STUDENTS_FEES_PAID)->result(); $storePaidDetails['PaidBillAmount']=$paidBillAmount[0]->PaidBillAmount; if($paidBillAmount[0]->PaidBillAmount > $storePaidDetails['PayableAmount']){ // $storePaidDetails['BalanceAmount']=0; $storePaidDetails['BalanceAmount']=$storePaidDetails['PayableAmount'] - $paidBillAmount[0]->PaidBillAmount; } else{ $storePaidDetails['BalanceAmount']=$storePaidDetails['PayableAmount'] - $paidBillAmount[0]->PaidBillAmount; } // sepearte for student waiver and referral bill list $this->db->select('ifnull(SUM((BillAmount)),0) as StudentWaiverRefAmount'); $this->db->where('FeesId',$feeRow->FeesID); $this->db->where_in('ModeOfPayment',$serachArray); $studentWaiverRefAmount = $this->db->get(STUDENTS_FEES_PAID)->result(); $storePaidDetails['StudentWaiverRefAmount']=$studentWaiverRefAmount[0]->StudentWaiverRefAmount; $this->db->select('ifnull(SUM((BillAmount)),0) as StudentPaidAmount'); $this->db->where('FeesId',$feeRow->FeesID); $this->db->where('ModeOfPayment !=',WAIVER); $this->db->where('ModeOfPayment !=',REFERRAL); $this->db->where('IsActive', '1'); $studentPaidAmount = $this->db->get(STUDENTS_FEES_PAID)->result(); $storePaidDetails['StudentPaidAmount']=$studentPaidAmount[0]->StudentPaidAmount; $storePaidDetails['BatchName'] = $feeRow->BatchName; $storePaidDetails['BatchDate'] = $feeRow->BatchDate; $storePaidDetails['BatchCode'] = $feeRow->BatchCode; // for get paid bill details // for get paid bill details $this->db->select('ifnull(SUM((BillAmount)),0) as BillAmount,BillNO,BillDate,ModeOfPayment,ReceiptNo,BR.BranchName,BR.Address,BR.LogoPath,STF.Firstname as ReceivedBy'); $this->db->from(STUDENTS_FEES_PAID.' as SFP'); $this->db->join(BRANCH.' as BR','BR.BranchCode = SFP.UpdatedBy','left'); $this->db->join(LOGIN.' as LO','LO.ID = SFP.CreatedBy'); $this->db->join(STAFF.' as STF','STF.StaffID = LO.StaffID'); $this->db->where('SFP.FeesId',$feeRow->FeesID); $this->db->where('SFP.IsActive', '1'); $this->db->order_by('SFP.ID',"ASC"); $this->db->group_by('SFP.BillNO'); $storePaidDetails['paidDetails']=$this->db->get()->result(); // for installment details $this->load->model('Fees_status_model'); $InstallemtResult = $this->Fees_status_model->getInstallmentDetails($feeRow->FeesID); if($InstallemtResult != false){ $storePaidDetails['InstallmentDetails']=$InstallemtResult; } else{ $storePaidDetails['InstallmentDetails']=""; } $mergeResult[]=$storePaidDetails; } $getStudentDefaultFees = $this->getDefaultCourseFees($studentID,$courseID); if($getStudentDefaultFees != false){ return array_merge($mergeResult,$getStudentDefaultFees); } else{ return$mergeResult; } } else { return false; } } /* * get default course details * created by kms * */ public function getDefaultCourseFees($studentID=null,$courseID=null){ $serachArray = ["PPC","TC","DC","MC","OTHER"]; $this->db->distinct(); $this->db->select('SFS.FeesID,SFS.FeesType,SFS.SessionName,SFS.RollNo,ifnull(SFS.CourseFees,0) as CourseFees,ifnull(SFS.STFOrWR,0) as STFOrWR,ifnull(SFS.Waiver,0) as Waiver,ifnull(SFS.Others,0) as Others'); $this->db->from(STUDENTS_FEES_STATUS.' as SFS'); $this->db->join(STUDENTS_FEES_PAID.' as SFP','SFP.FeesId = SFS.FeesID','left'); //$this->db->join(COURSE_FEES.' as CF', 'CF.ID = SFS.FeesType'); $this->db->where('SFS.CourseID', $courseID); $this->db->where('SFS.StudentID', $studentID); // $this->db->where('SFP.IsActive', '1'); $this->db->where_in('SFS.FeesType', $serachArray); $this->db->order_by('SFS.FeesID', 'ASC'); $getFeeDetails = $this->db->get(); if($getFeeDetails->result()){ foreach ($getFeeDetails->result() as $feeRow){ $storePaidDetails['FeesID'] = $feeRow->FeesID; $storePaidDetails['FeesName'] = $feeRow->FeesType; $storePaidDetails['ProgramType'] = $feeRow->FeesType; $storePaidDetails['CourseFees'] = $feeRow->CourseFees; $storePaidDetails['SessionName'] = "Not Applicable"; $storePaidDetails['ToSessionName'] = "Not Applicable"; $storePaidDetails['RollNo'] = $feeRow->RollNo; $storePaidDetails['STFOrWR'] = $feeRow->STFOrWR; $storePaidDetails['Waiver'] = $feeRow->Waiver; $storePaidDetails['Others'] = $feeRow->Others; $storePaidDetails['PayableAmount'] = $feeRow->CourseFees+$feeRow->STFOrWR+$feeRow->Others-$feeRow->Waiver; $this->db->select('ifnull(SUM((BillAmount)),0) as PaidBillAmount'); $this->db->where('FeesId',$feeRow->FeesID); $this->db->where('IsActive', '1'); $paidBillAmount = $this->db->get(STUDENTS_FEES_PAID)->result(); $storePaidDetails['PaidBillAmount']=$paidBillAmount[0]->PaidBillAmount; if($paidBillAmount[0]->PaidBillAmount > $storePaidDetails['PayableAmount']){ // $storePaidDetails['BalanceAmount']=0; $storePaidDetails['BalanceAmount']=$storePaidDetails['PayableAmount'] - $paidBillAmount[0]->PaidBillAmount; } else{ $storePaidDetails['BalanceAmount']=$storePaidDetails['PayableAmount'] - $paidBillAmount[0]->PaidBillAmount; } // sepearte for student waiver and referral bill list $this->db->select('ifnull(SUM((BillAmount)),0) as StudentWaiverRefAmount'); $this->db->where('FeesId',$feeRow->FeesID); $this->db->where_in('ModeOfPayment',$serachArray); $studentWaiverRefAmount = $this->db->get(STUDENTS_FEES_PAID)->result(); $storePaidDetails['StudentWaiverRefAmount']=$studentWaiverRefAmount[0]->StudentWaiverRefAmount; $this->db->select('ifnull(SUM((BillAmount)),0) as StudentPaidAmount'); $this->db->where('FeesId',$feeRow->FeesID); $this->db->where('ModeOfPayment !=',WAIVER); $this->db->where('ModeOfPayment !=',REFERRAL); $this->db->where('IsActive', '1'); $studentPaidAmount = $this->db->get(STUDENTS_FEES_PAID)->result(); $storePaidDetails['StudentPaidAmount']=$studentPaidAmount[0]->StudentPaidAmount; $storePaidDetails['BatchName'] = "Not Applicable"; $storePaidDetails['BatchDate'] = ""; $storePaidDetails['BatchCode'] = ""; // for get paid bill details $this->db->select('ifnull(SUM((BillAmount)),0) as BillAmount,BillNO,BillDate,ModeOfPayment,ReceiptNo,BR.BranchName,BR.Address,BR.LogoPath,STF.Firstname as ReceivedBy'); $this->db->from(STUDENTS_FEES_PAID.' as SFP'); $this->db->join(BRANCH.' as BR','BR.BranchCode = SFP.UpdatedBy','left'); $this->db->join(LOGIN.' as LO','LO.ID = SFP.CreatedBy'); $this->db->join(STAFF.' as STF','STF.StaffID = LO.StaffID'); $this->db->where('SFP.FeesId',$feeRow->FeesID); $this->db->where('SFP.IsActive', '1'); $this->db->order_by('SFP.ID',"ASC"); $this->db->group_by('SFP.BillNO'); $storePaidDetails['paidDetails']=$this->db->get()->result(); $storePaidDetails['InstallmentDetails']=""; $mergeResult[]=$storePaidDetails; } return $mergeResult; } else { return false; } } /* * get student study material details * created by kms * */ public function getStudentMaterialDetails($studentID=null,$courseID=null){ $this->db->select('SMS.CourseID,SMS.SDate,SMS.Comments,SMS.Sem,CF.Sem_Year,CF.FeesType,PLD.ListName'); $this->db->from(STUDY_MATERIAL_STATUS.' as SMS'); $this->db->join(COURSE_FEES.' as CF','CF.ID = SMS.CourseID'); $this->db->join(COURSE.' as CU', 'CU.CourseID = CF.CourseID'); $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = SMS.ListCode'); $this->db->where('CU.CourseID', $courseID); $this->db->where('SMS.StudentID', $studentID); $this->db->order_by('SMS.ID', 'DESC'); $getMaterialDetails = $this->db->get(); if ($getMaterialDetails->result()){ return $getMaterialDetails->result(); } else{ return false; } } /* * get student certificate details * created by kms * */ public function getStudentCertificateDetails($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(CERTIFICATION_MASTER.' as CM','CM.CertificateName = 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(); // print_r($this->db->last_query());die(); 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(); if($getCertDetails->result()){ return $getCertDetails->result(); } else { return false; } } /* * get mark card details * created by kms * */ public function getMarkcardDetails($studentID=null,$courseID=null){ $this->db->select('CS.CourseID,CS.CertificationNo,CS.CDate,CS.Comments,CS.CertificationType as CertificateName,CF.Sem_Year,CF.FeesType,CS.Sem,PLD.ListName,PLD2.ListName as AnsBookStatus'); $this->db->from(CERTIFICATION_STATUS.' as CS'); $this->db->join(COURSE_FEES.' as CF','CF.ID = CS.CourseID'); $this->db->join(COURSE.' as CU', 'CU.CourseID = CF.CourseID'); $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = CS.ListCode'); $this->db->join(ANSWER_BOOKLET.' as ASBK',"ASBK.Sem = CF.Sem_Year AND ASBK.StudentID = $studentID",'LEFT'); $this->db->join(PICK_LIST_DETAILS.' as PLD2', 'PLD2.ListCode = ASBK.ListCode','LEFT'); $this->db->where('CU.CourseID', $courseID); $this->db->where('CS.StudentID', $studentID); $this->db->where_in('CS.CertificationType', 'MARK CARD'); $this->db->order_by('CS.ID', 'DESC'); $getMarkDetails = $this->db->get(); if ($getMarkDetails->result()){ return $getMarkDetails->result(); } else{ return false; } } /* * 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 = ABT.ListCode'); $this->db->where('CU.CourseID', $courseID); $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; } } public function getStudentLatestAppStatus($studentid,$courseid) { // echo 'in'; // $this->db->select('T_ApplicationStatus.StudentID,AppDate,CertificateName,ListName,Firstname,Lastname,T_ApplicationStatus.Comments,CourseName,T_ApplicationStatus.CertificationNo'); // $this->db->from('T_ApplicationStatus'); // $this->db->join('T_PickListDetails','T_PickListDetails.ListCode = T_ApplicationStatus.ListCode','left'); // $this->db->join('T_CertificationMaster','T_CertificationMaster.CertificationID = T_ApplicationStatus.CertificationType','left'); // $this->db->join('T_StudentDetails','T_StudentDetails.StudentID = T_ApplicationStatus.StudentID','left'); // $this->db->join('T_CourseMaster','T_CourseMaster.CourseID = T_ApplicationStatus.CourseID','left'); // $this->db->where('T_ApplicationStatus.CourseID',$courseid); // $this->db->where('T_ApplicationStatus.StudentID',$studentid); // $this->db->group_by('CertificationType'); // $this->db->order_by('T_ApplicationStatus.CreatedOn','desc'); // $appDetails = $this->db->get(); // if ($appDetails->result()){ // return $appDetails->result(); // } // else{ // return false; // } // $subquery = 'select max(ID) from T_ApplicationFormStatus group by Registration_Details_ID'; // $this->db->select('t1.ID, t2.BatchCode, t2.FeeType as SemID, CFD.Sem_Year as Sem_Year, t2.RegistrationMode, t2.RegistrationType, t1.AppFormDate as StatusUpdateDate,t3.ListName ,t1.Comments'); // $this->db->from('T_ApplicationFormStatus as t1'); // $this->db->join('T_Registration_Details as t2', 't2.ID = t1.Registration_Details_ID'); // $this->db->join('T_Course_Fees_Details as CFD', 'CFD.ID = t2.FeeType'); // $this->db->join('' . PICK_LIST_DETAILS . ' as t3', 't3.ListCode = t1.ListCode', 'LEFT'); // $this->db->where('t2.StudentID', $studentid); // $this->db->where('t2.CourseID', $courseid); // $this->db->where('t1.ID ',$subquery); // $fromTypes = $this->db->get(); // $formTypeDetails = $fromTypes->result(); // if($formTypeDetails) // { // return $fromTypes->result(); // } // else // { // return false; // } $subquery='SELECT t1.ID, t2.BatchCode, t2.FeeType as SemID, CFD.Sem_Year as Sem_Year,t2.RegistrationMode,t2.RegistrationType,t1.AppFormDate as StatusUpdateDate, t3.ListName,t1.Comments FROM T_ApplicationFormStatus as t1 JOIN T_Registration_Details as t2 ON t2.ID = t1.Registration_Details_ID JOIN T_Course_Fees_Details as CFD ON CFD.ID = t2.FeeType LEFT JOIN T_PickListDetails as t3 ON t3.ListCode = t1.ListCode WHERE t2.StudentID =? AND t2.CourseID = ? and t1.ID in (select max(ID) from T_ApplicationFormStatus group by Registration_Details_ID)'; $query = $this->db->query($subquery,array($studentid,$courseid)); $fromTypes = $query->result(); if(count($query)>0) { return $fromTypes; } else { return false; } } }