db->query($selectQuery); if($queryDetails->result()){ foreach ($queryDetails->result() as $formIdDetails){ $univResult['univCode'] = $formIdDetails->UniversityCode; $univResult['univName'] = $formIdDetails->UniversityName; $selectCourseQuery = "SELECT CourseCode, CourseName FROM T_Enrolment_Received_From_University WHERE UniversityCode = '$formIdDetails->UniversityCode' GROUP BY CourseCode"; $queryCourseDetails = $this->db->query($selectCourseQuery); $univResult['univCourseDetails'] = $queryCourseDetails->result(); $selectSessionQuery = "SELECT SessionName FROM T_Enrolment_Received_From_University WHERE UniversityCode = '$formIdDetails->UniversityCode' GROUP BY CourseCode"; $querySessionDetails = $this->db->query($selectSessionQuery); $univResult['univSessionDetails'] = $querySessionDetails->result(); $merge[]=$univResult; } $finalArray['status'] = true; $finalArray['message'] = "Success."; $finalArray['details'] = $merge; } else { $finalArray['status'] = false; $finalArray['message'] = "No record found."; $finalArray['details'] = []; } return $finalArray; } public function updateEnrolmentDetails($enrolment=null,$local=null) { // create array for find sem value $keyArray = array(0 => 'SEM1', 1 => 'SEM2', 2 => 'SEM3', 3 => 'SEM4',4 => 'SEM5',5 => 'SEM6',6 => 'SEM7',7 => 'SEM8',8 => 'YEAR1',9 => 'YEAR2',10 => 'YEAR3',11 => 'YEAR4'); $valueArray = array("1","2","3","4","5","6","7","8","1","2","3","4"); $errorArray=array(); $get_data=array(); // loop for fetch details foreach ($enrolment as $k => $checkRow){ // check enrolment no and form id in upload list if(array_key_exists("Enrollment_No",$checkRow) AND array_key_exists("Form Id",$checkRow)){ // start $insert['FormID']=$checkRow['Form Id']; $insert['EnrolmentNo']=$checkRow['Enrollment_No']; // check key exist in json array if(array_key_exists('Roll_No',$checkRow)){ $insert['RollNo']=$checkRow['Roll_No']; } else{ $insert['RollNo']=""; } if(array_key_exists('Centre Code',$checkRow)) { $insert['CentreCode'] = $checkRow['Centre Code']; } else{ $insert['CentreCode'] = ""; } if(array_key_exists('Centre State',$checkRow)) { $insert['CentreState'] = $checkRow['Centre State']; } else{ $insert['CentreState'] = ""; } if(array_key_exists('Student_Mob_No',$checkRow)){ $insert['MobileNumber']=$checkRow['Student_Mob_No']; } else{ $insert['MobileNumber']=""; } if(array_key_exists('Student_Name',$checkRow)) { $insert['StudentName'] = $checkRow['Student_Name']; } else{ $insert['StudentName'] = ""; } if(array_key_exists('Father_Name',$checkRow)) { $insert['FatherName'] = $checkRow['Father_Name']; } else{ $insert['FatherName'] = ""; } if(array_key_exists('Mother_Name',$checkRow)) { $insert['MotherName'] = $checkRow['Mother_Name']; } else{ $insert['MotherName'] = ""; } if(array_key_exists('Student_Email_Id',$checkRow)) { $insert['EmailID'] = $checkRow['Student_Email_Id']; } else{ $insert['EmailID'] = ""; } if(array_key_exists('ID_Proof',$checkRow)) { $insert['IDProof'] = $checkRow['ID_Proof']; } else{ $insert['IDProof'] = ""; } if(array_key_exists('Gender',$checkRow)) { $insert['Gender'] = $checkRow['Gender']; } else{ $insert['Gender'] = ""; } if(array_key_exists('Date_Of_Birth',$checkRow)) { $insert['DOB'] = $checkRow['Date_Of_Birth']; } else{ $insert['DOB'] = ""; } if(array_key_exists('Address',$checkRow)) { $insert['PresentAddress'] = $checkRow['Address']; } else{ $insert['PresentAddress'] = ""; } if(array_key_exists('Adhar_No',$checkRow)) { $insert['AadharNumber'] = $checkRow['Adhar_No']; } else{ $insert['AadharNumber'] = ""; } if(array_key_exists('Category',$checkRow)) { $insert['Category'] = $checkRow['Category']; } else{ $insert['Category'] = ""; } if(array_key_exists('Course_Code',$checkRow)) { $insert['CourseCode'] = $checkRow['Course_Code']; } else{ $insert['CourseCode'] = ""; } if(array_key_exists('Course_Name',$checkRow)) { $insert['CourseName'] = $checkRow['Course_Name']; } else{ $insert['CourseName'] = ""; } if(array_key_exists('Specialization',$checkRow)) { $insert['Specialization'] = $checkRow['Specialization']; } else{ $insert['Specialization'] = ""; } if(array_key_exists('Semester',$checkRow)) { $insert['SemesterYear'] = $checkRow['Semester']; } else{ $insert['SemesterYear'] = ""; } if(array_key_exists('Session',$checkRow)) { $insert['SessionName'] = $checkRow['Session']; } else{ $insert['SessionName'] = ""; } if(array_key_exists('Year',$checkRow)) { $insert['Year'] = $checkRow['Year']; } else{ $insert['Year'] = ""; } if(array_key_exists('Form Type',$checkRow)) { $insert['FormType'] = $checkRow['Form Type']; } else{ $insert['FormType'] = ""; } if(array_key_exists('Entry Mode',$checkRow)) { $insert['EntryMode'] = $checkRow['Entry Mode']; } else{ $insert['EntryMode'] = ""; } if(array_key_exists('Remarks',$checkRow)) { $insert['Remarks'] = $checkRow['Remarks']; } else{ $insert['Remarks'] = ""; } if(array_key_exists('Affidavit_Status',$checkRow)) { $insert['AffidavitStatus'] = $checkRow['Affidavit_Status']; } if(array_key_exists('Migration_Status',$checkRow)) { $insert['MigrationStatus'] = $checkRow['Migration_Status']; } else{ $insert['MigrationStatus'] = ""; } if(array_key_exists('Finance_Status',$checkRow)) { $insert['FinanceStatus'] = $checkRow['Finance_Status']; } else{ $insert['FinanceStatus'] = ""; } if(array_key_exists('Most Urgent DMC',$checkRow)) { $insert['MostUrgentDMC'] = $checkRow['Most Urgent DMC']; } else{ $insert['MostUrgentDMC'] = ""; } if(array_key_exists('created_By',$checkRow)) { $insert['CreatedByName'] = $checkRow['created_By']; } else{ $insert['CreatedByName'] = ""; } if(array_key_exists('Created_Date',$checkRow)) { $insert['CreatedDate'] = $checkRow['Created_Date']; } else{ $insert['CreatedDate'] = ""; } if(array_key_exists('Approved_By',$checkRow)) { $insert['ApprovedByName'] = $checkRow['Approved_By']; } else{ $insert['ApprovedByName'] = ""; } if(array_key_exists('Approved_Date',$checkRow)) { $insert['ApprovedDate'] = $checkRow['Approved_Date']; } else{ $insert['ApprovedDate'] = ""; } $insert['UniversityCode'] = $local['UniversityCode']; $insert['UniversityName'] = $local['UniversityName']; $insert['BranchCode'] = $local['BranchCode']; $insert['CreatedBy'] = $local['CreatedBy']; $insert['CreatedOn'] = $local['CreatedOn']; $get_data[count($get_data)]=array( 'FormID' => $insert['FormID'], 'EnrolmentNo' => $insert['EnrolmentNo'], 'RollNo' => $insert['RollNo'], 'CentreCode' => $insert['CentreCode'], 'CentreState' => $insert['CentreState'], 'MobileNumber' => $insert['MobileNumber'], 'StudentName' => $insert['StudentName'], 'FatherName' => $insert['FatherName'], 'MotherName' => $insert['MotherName'], 'EmailID' => $insert['EmailID'], 'IDProof' => $insert['IDProof'], 'Gender' => $insert['Gender'], 'DOB' => $insert['DOB'], 'PresentAddress' => $insert['PresentAddress'], 'AadharNumber' => $insert['AadharNumber'], 'Category' => $insert['Category'], 'UniversityCode'=>$insert['UniversityCode'], 'UniversityName'=>$insert['UniversityName'], 'CourseCode' => $insert['CourseCode'], 'CourseName' => $insert['CourseName'], 'Specialization' => $insert['Specialization'], 'SemesterYear' => $insert['SemesterYear'], 'SessionName' => $insert['SessionName'], 'Year' => $insert['Year'], 'FormType' => $insert['FormType'], 'EntryMode' => $insert['EntryMode'], 'Remarks' => $insert['Remarks'], 'AffidavitStatus' => $insert['AffidavitStatus'], 'MigrationStatus' => $insert['MigrationStatus'], 'FinanceStatus' => $insert['FinanceStatus'], 'MostUrgentDMC' => $insert['MostUrgentDMC'], 'CreatedByName' => $insert['CreatedByName'], 'CreatedDate' => $insert['CreatedDate'], 'ApprovedByName' => $insert['ApprovedByName'], 'ApprovedDate' => $insert['ApprovedDate'], 'BranchCode' => $insert['BranchCode'], 'CreatedBy' => $insert['CreatedBy'], 'CreatedOn' => $insert['CreatedOn'], ); } else{ // for capture error message $error["StudentName"]=$checkRow['Student_Name']; $error["Message"]="Enrolment number/Form id is not exist."; $errorArray[]=$error; } } if(sizeof($get_data)>0) { // check form id exit in table for insert / update $formIDData = $this->db->select('FormID')->order_by('SubmitID', 'ASC')->get(ENROLMENTRECEIVEDFROMUNIV)->result_array(); $form_ids = array(); $insertForms = array(); $updateForms = array(); foreach ($formIDData as $fkey => $fvalue): if(sizeof($get_data)>0){ $matchedKey = array_search($fvalue['FormID'], array_column($get_data, 'FormID')); if ($matchedKey!='') { // $updateForms[count($updateForms)] = $get_data[$matchedKey]; // $form_ids[]=$fvalue['FormID']; array_splice($get_data, 0, 1); } } endforeach; if (sizeof($get_data) > 0) { $this->db->insert_batch(ENROLMENTRECEIVEDFROMUNIV, $get_data); if ($this->db->affected_rows() > 0) { $finalArray['status'] = true; $finalArray['message'] = "Inserted successfully"; $finalArray['insertedRows'] = $this->db->affected_rows(); $finalArray['details'] = $errorArray; return $finalArray; } else { $finalArray['status'] = false; $finalArray['message'] = "Insert failed please check data."; $finalArray['insertedRows'] = $this->db->affected_rows(); $finalArray['details'] = $errorArray; return $finalArray; } } else { $finalArray['status'] = false; $finalArray['message'] = "Updated Successfully.";; $finalArray['details'] = $errorArray; } /* if(count($updateForms)>0){ //$this->db->where_in('FormID',$form_ids); $this->db->update_batch(ENROLMENTRECEIVEDFROMUNIV, $updateForms,'FormID'); }*/ } else{ $finalArray['status'] = false; $finalArray['message'] = "Insert failed please check data."; $finalArray['insertedRows'] = $this->db->affected_rows(); $finalArray['details'] = $errorArray; return $finalArray; } return $finalArray; } public function formIdFeeDetails($formFeeDetails=null,$local=null){ $localBranchID = $local['localBranchID']; $localUserID = $local['localUserID']; $time = date('Y-m-d H:i:s'); $CreatedOn = $time; foreach ($formFeeDetails as $formIdDetails){ if(array_key_exists('FormId',$formIdDetails) && $formIdDetails['FormId'] != '' && $formIdDetails['FormId'] != null && array_key_exists('Form Type',$formIdDetails) && array_key_exists('CentreCode',$formIdDetails) && array_key_exists('Course_Code',$formIdDetails) && array_key_exists('Actual_Course_Fee',$formIdDetails) && array_key_exists('Course_Fee',$formIdDetails) && array_key_exists('Exam_Fee',$formIdDetails) && array_key_exists('Enrollment_Fee',$formIdDetails) && array_key_exists('Prospectus_Fee',$formIdDetails) && array_key_exists('Additional_Fee',$formIdDetails) && array_key_exists('Amount',$formIdDetails) && array_key_exists('Session',$formIdDetails) && array_key_exists('Year',$formIdDetails) && array_key_exists('Semester',$formIdDetails) && array_key_exists('Student_Name',$formIdDetails) && array_key_exists('Father_Name',$formIdDetails) ){ //select query for the check the fields are entered //echo $formIdDetails['FormId']; echo '===='; $formIds = $formIdDetails['FormId']; $formType = $formIdDetails['Form Type'] ? $formIdDetails['Form Type'] : ''; $CentreCode = $formIdDetails['CentreCode'] ?: ''; $Session = $formIdDetails['Session'] ?: ''; $Year = $formIdDetails['Year'] ?: ''; $Semester = $formIdDetails['Semester'] ?: ''; $Student_Name = $formIdDetails['Student_Name'] ?: ''; $Father_Name = $formIdDetails['Father_Name'] ?: ''; $CourseCode = $formIdDetails['Course_Code'] ?: ''; $ActualCourseFee = $formIdDetails['Actual_Course_Fee'] ?: '0'; $CourseFee = $formIdDetails['Course_Fee'] ?: '0'; $ExamFee = $formIdDetails['Exam_Fee'] ?: '0'; $EnrollmentFee = $formIdDetails['Enrollment_Fee'] ?: '0'; $ProspectusFee = $formIdDetails['Prospectus_Fee'] ?: '0'; $ReRegFee = $formIdDetails['Re_Reg_Fee'] ?: '0'; $CreditTransferFee = $formIdDetails['Credit_Transfer_Fee'] ?: '0'; $LateralEntryFee = $formIdDetails['Lateral_Entry_Fee'] ?: '0'; $DualSpclFee = $formIdDetails['Dual_Spcl_Fee'] ?: '0'; $OtherFee = $formIdDetails['Other_Fee'] ?: '0'; $NRIFEE = $formIdDetails['NRI_FEE'] ?: '0'; $ProvisionalFee = $formIdDetails['Provisional_Fee'] ?: '0'; $MigrationFee = $formIdDetails['Migration_Fee'] ?: '0'; $UrgentResultDMCFee = $formIdDetails['Urgent_Result_DMC_Fee'] ?: '0'; $AdditionalFee = $formIdDetails['Additional_Fee'] ?: '0'; $Amount = $formIdDetails['Amount'] ?: '0'; $selectQuery = "SELECT * FROM T_FormId_FeeDetails_Received_From_University WHERE FormID = '$formIds' AND FormType = '$formType' AND CentreCode = '$CentreCode' AND Session = '$Session' AND Year = '$Year' AND Semester = '$Semester' AND Student_Name = '$Student_Name' AND Father_Name = '$Father_Name' AND CourseCode = '$CourseCode' AND ActualCourseFee = '$ActualCourseFee' AND CourseFee = '$CourseFee' AND ExamFee = '$ExamFee' AND EnrollmentFee = '$EnrollmentFee' AND ProspectusFee = '$ProspectusFee' AND ReRegFee = '$ReRegFee' AND CreditTransferFee = '$CreditTransferFee' AND LateralEntryFee = '$LateralEntryFee' AND DualSpclFee = '$DualSpclFee' AND OtherFee = '$OtherFee' AND NRIFEE = '$NRIFEE' AND ProvisionalFee = '$ProvisionalFee' AND MigrationFee = '$MigrationFee' AND UrgentResultDMCFee = '$UrgentResultDMCFee' AND AdditionalFee = '$AdditionalFee' AND Amount = '$Amount'"; $queryDetails = $this->db->query($selectQuery); // echo count($queryDetails->result());exit(); if(count($queryDetails->result()) == 0){ $query = "INSERT INTO T_FormId_FeeDetails_Received_From_University (FormID, FormType, CentreCode,Session,Year,Semester,Student_Name,Father_Name,CourseCode, ActualCourseFee, CourseFee, ExamFee, EnrollmentFee, ProspectusFee, ReRegFee, CreditTransferFee, LateralEntryFee, DualSpclFee, OtherFee, NRIFEE, ProvisionalFee, MigrationFee, UrgentResultDMCFee, AdditionalFee, Amount, CreatedBy, CreatedOn, BranchCode, DraftStatus) VALUES ( '$formIds', '$formType', '$CentreCode','$Session','$Year','$Semester','$Student_Name','$Father_Name', '$CourseCode', '$ActualCourseFee', '$CourseFee', '$ExamFee', '$EnrollmentFee', '$ProspectusFee', '$ReRegFee', '$CreditTransferFee', '$LateralEntryFee', '$DualSpclFee', '$OtherFee', '$NRIFEE', '$ProvisionalFee', '$MigrationFee', '$UrgentResultDMCFee', '$AdditionalFee', '$Amount', '$localUserID', '$CreatedOn', '$localBranchID' , 0)"; $queryDetails = $this->db->query($query); } else { echo 'else con'; } // -- ON DUPLICATE KEY UPDATE // -- FormType = '$formType', // -- CentreCode = '$CentreCode', // -- CourseCode = '$CourseCode', // -- ActualCourseFee = '$ActualCourseFee', // -- CourseFee = '$CourseFee', // -- ExamFee = '$ExamFee', // -- EnrollmentFee = '$EnrollmentFee', // -- ProspectusFee = '$ProspectusFee', // -- ReRegFee = '$ReRegFee', // -- CreditTransferFee = '$CreditTransferFee', // -- LateralEntryFee = '$LateralEntryFee', // -- DualSpclFee = '$DualSpclFee', // -- OtherFee = '$OtherFee', // -- NRIFEE = '$NRIFEE', // -- ProvisionalFee = '$ProvisionalFee', // -- MigrationFee = '$MigrationFee', // -- UrgentResultDMCFee = '$UrgentResultDMCFee', // -- AdditionalFee = '$AdditionalFee', // -- Amount = '$Amount'"; } continue; } $results['stuFeeList'] = true; $results['stuFeeList_details'] = "details updated successfully."; return $results; } public function getStudentUnivFeeCompareDetails($search=null){ $mergeFormDetails=array(); $this->db->distinct('ENU.FormID'); $this->db->select('ENU.FormID, ENU.FormType, ENU.SemesterYear, ENU.EnrolmentNo,ENU.RollNo, ST.*,UN.UniversityID, UN.UniversityName,CM.CourseID,CM.CourseCode,CM.CourseName'); $this->db->from(ENROLMENTRECEIVEDFROMUNIV.' as ENU'); $this->db->join(STUDENTCOURSE.' as STC', 'STC.EnrollmentID = ENU.EnrolmentNo'); $this->db->join(COURSE.' as CM', 'CM.CourseID = STC.CourseID'); $this->db->join(STUDENTS.' as ST', 'ST.StudentID = STC.StudentID'); $this->db->join(UNIVERSITY.' as UN', 'UN.UniversityID = STC.UniversityID'); if($search['University']!=''){ $this->db->where('ENU.UniversityCode',$search['University']); } if($search['Course']!=''){ $this->db->where('ENU.CourseName',$search['Course']); } if($search['Sem']!=''){ $this->db->where('ENU.SemesterYear',$search['Sem']); } $details = $this->db->get(); $detailsList = $details->result(); if($detailsList){ foreach ($detailsList as $fetchStudentRow){ // form id bases get student paid details $getStudentsetFeesDetails=$this->getStudentsetFeesDetails($fetchStudentRow->StudentID,$fetchStudentRow->CourseID,$fetchStudentRow->SemesterYear); if(isset($getStudentsetFeesDetails['status']) AND $getStudentsetFeesDetails['status']==true ){ $formResult['SessionName']=$getStudentsetFeesDetails['SessionName']; $formResult['FormID']=$fetchStudentRow->FormID; $formResult['FormType']=$fetchStudentRow->FormType; $formResult['SemesterYear']=$fetchStudentRow->SemesterYear; $formResult['EnrolmentNo']=$fetchStudentRow->EnrolmentNo; $formResult['CourseCode']=$fetchStudentRow->CourseCode; $formResult['CourseName']=$fetchStudentRow->CourseName; $formResult['RollNo']=$fetchStudentRow->RollNo; $formResult['StudentID']=$fetchStudentRow->StudentID; $formResult['MobileNumber']=$fetchStudentRow->MobileNumber; $formResult['Firstname']=$fetchStudentRow->Firstname; $formResult['Lastname']=$fetchStudentRow->Lastname; $formResult['Fathername']=$fetchStudentRow->Fathername; $formResult['MotherName']=$fetchStudentRow->MotherName; $formResult['EmailID']=$fetchStudentRow->EmailID; $formResult['AlternateNumber']=$fetchStudentRow->AlternateNumber; $formResult['Gender']=$fetchStudentRow->Gender; $formResult['DOB']=$fetchStudentRow->DOB; $formResult['PresentAddress']=$fetchStudentRow->PresentAddress; $formResult['PermanentAddress']=$fetchStudentRow->PermanentAddress; $formResult['AadharNumber']=$fetchStudentRow->AadharNumber; $formResult['OtherID']=$fetchStudentRow->OtherID; $formResult['OtherIDDetails']=$fetchStudentRow->OtherIDDetails; $formResult['Qualification']=$fetchStudentRow->Qualification; $formResult['UniversityID']=$fetchStudentRow->UniversityID; $formResult['UniversityName']=$fetchStudentRow->UniversityName; $mergeFormDetails[]=$formResult; } /* if(sizeof($getStudentPaidDetails)!=0){ $formResult['StudentPaidAmount']=$getStudentPaidDetails['StudentPaidAmount']; } else{ $formResult['StudentPaidAmount']=''; }*/ } $resultArr['studentFeeCompareDetails'] = $mergeFormDetails; $resultArr['formTypeStatus'] = true; $resultArr['message'] = "Successfully data generated"; } else { $resultArr['studentFeeCompareDetails'] = []; $resultArr['formTypeStatus'] = false; $resultArr['message'] = "No record found"; } return $resultArr; } /*form id bases get student paid details for getStudentUnivFeeCompareDetails methods*/ public function getStudentsetFeesDetails($studentID=null,$courseID=null,$sem=null){ // create array for find sem value $keyArray = array(0 => 'SEM1', 1 => 'SEM2', 2 => 'SEM3', 3 => 'SEM4',4 => 'SEM5',5 => 'SEM6',6 => 'SEM7',7 => 'SEM8',8 => 'YEAR1',9 => 'YEAR2',10 => 'YEAR3',11 => 'YEAR4',12 => "DMC CHANGE SEM1",13 => "DMC CHANGE SEM2",14 => "DMC CHANGE SEM3",15 => "DMC CHANGE SEM4",16 => "DMC CHANGE SEM5",17 => "DMC CHANGE SEM6",18 => "DMC CHANGE SEM7",19 => "DMC CHANGE SEM8",20 => "DMC CHANGE YEAR1",21 => "DMC CHANGE YEAR2",22 => "DMC CHANGE YEAR3",23 => "DMC CHANGE YEAR4"); $valueArray = array("1","2","3","4","5","6","7","8","1","2","3","4","1","2","3","4","5","6","7","8","1","2","3","4"); $feesArray=array(); $this->db->select("CF.ID,CF.ProgramType,CF.Sem_Year"); $this->db->from(COURSE_FEES . ' as CF'); $this->db->where('CF.CourseID', $courseID); $courseFeesDetails = $this->db->get(); //this is for sem year type check fees if ($courseFeesDetails->num_rows() > 1) { foreach ($courseFeesDetails->result() as $fetchRow) { $serachKey = array_search(strtoupper($fetchRow->Sem_Year), $keyArray); if ($valueArray[$serachKey] == $sem) { $this->db->select("SM.SessionName,SM.SessionID"); $this->db->from(STUDENTS_FEES_STATUS . ' as SFS'); $this->db->join(SESSIONMASTER . ' as SM' , 'SM.SessionID = SFS.SessionName'); $this->db->where('SFS.FeesType', $fetchRow->ID); $this->db->where('SFS.StudentID', $studentID); $feesDetails = $this->db->get()->last_row(); if ($feesDetails) { $feesArray['status'] = true; $feesArray['SessionName'] = $feesDetails->SessionName; $feesArray['SessionID'] = $feesDetails->SessionID; break; } else { $feesArray['status'] = false; break; } } } } else if($courseFeesDetails->num_rows()==1){ foreach ($courseFeesDetails->result() as $fetchRow){ $this->db->select("SM.SessionName,SM.SessionID"); $this->db->from(STUDENTS_FEES_STATUS.' as SFS'); $this->db->join(SESSIONMASTER . ' as SM' , 'SM.SessionID = SFS.SessionName'); $this->db->where('SFS.FeesType',$fetchRow->ID); $this->db->where('SFS.StudentID',$studentID); $feesDetails = $this->db->get()->last_row(); if ($feesDetails) { $feesArray['status'] = true; $feesArray['SessionName'] = $feesDetails->SessionName; $feesArray['SessionID'] = $feesDetails->SessionID; break; } else { $feesArray['status'] = false; break; } } } else{ $feesArray['status'] = false; } return $feesArray; } /** * Unmached file details */ public function getUnmatchedFormDetails($reqType){ $keyArray = array(0 => 'SEM1', 1 => 'SEM2', 2 => 'SEM3', 3 => 'SEM4',4 => 'SEM5',5 => 'SEM6',6 => 'SEM7',7 => 'SEM8',8 => 'YEAR1',9 => 'YEAR2',10 => 'YEAR3',11 => 'YEAR4',12 => "DMC CHANGE SEM1",13 => "DMC CHANGE SEM2",14 => "DMC CHANGE SEM3",15 => "DMC CHANGE SEM4",16 => "DMC CHANGE SEM5",17 => "DMC CHANGE SEM6",18 => "DMC CHANGE SEM7",19 => "DMC CHANGE SEM8",20 => "DMC CHANGE YEAR1",21 => "DMC CHANGE YEAR2",22 => "DMC CHANGE YEAR3",23 => "DMC CHANGE YEAR4"); $valueArray = array("1","2","3","4","5","6","7","8","1","2","3","4","1","2","3","4","5","6","7","8","1","2","3","4"); $this->db->distinct('ENU.FormID'); $this->db->select('ENU.*'); $this->db->from(ENROLMENTRECEIVEDFROMUNIV.' as ENU'); if($reqType['University']!=''){ $this->db->where('ENU.UniversityCode',$reqType['University']); } if($reqType['Course']!=''){ $this->db->where('ENU.CourseName',$reqType['Course']); } if($reqType['Sem']!=''){ $this->db->where('ENU.SemesterYear',$reqType['Sem']); } $details = $this->db->get(); $resultArr=array(); $mergeFormDetails=array(); if($details->result()){ foreach ($details->result() as $fRow){ $this->db->distinct('ENU1.FormID'); $this->db->select('SC.StudentID,SC.CourseID,SC.EnrollmentID,CF.ID,CF.ProgramType,CF.Sem_Year,ENU1.SemesterYear,ENU1.EnrolmentNo'); $this->db->from(STUDENTCOURSE.' as SC'); $this->db->join(ENROLMENTRECEIVEDFROMUNIV .' as ENU1', 'ENU1.EnrolmentNo = SC.EnrollmentID'); $this->db->join(COURSE_FEES .' as CF', 'CF.CourseID = SC.CourseID'); $this->db->where('ENU1.EnrolmentNo',$fRow->EnrolmentNo); $this->db->where('ENU1.FormID',$fRow->FormID); $getEnrolmentMatchDetails=$this->db->get(); if($getEnrolmentMatchDetails->result()){ foreach ($getEnrolmentMatchDetails->result() as $sRow){ $serachKey = array_search(strtoupper($sRow->Sem_Year), $keyArray); if ($valueArray[$serachKey] == $sRow->SemesterYear) { $this->db->select('SFS.FeesID'); $this->db->from(STUDENTS_FEES_STATUS.' as SFS'); $this->db->join(COURSE_FEES .' as CF', 'SFS.FeesType = CF.ID'); $this->db->where('SFS.FeesType',$sRow->ID); $this->db->where('SFS.CourseID',$sRow->CourseID); $this->db->where('SFS.StudentID',$sRow->StudentID); $getEnrolmentMatchDetails=$this->db->get(); if($getEnrolmentMatchDetails->num_rows()==0){ $formResult['SessionName']=$fRow->SessionName; $formResult['FormID']=$fRow->FormID; $formResult['FormType']=$fRow->FormType; $formResult['SemesterYear']=$fRow->SemesterYear; $formResult['CentreCode']=$fRow->CentreCode; $formResult['CentreState']=$fRow->CentreState; $formResult['EnrolmentNo']=$fRow->EnrolmentNo; $formResult['EnromentStatus']=true; $formResult['SemStatus']=false; $formResult['CourseCode']=$fRow->CourseCode; $formResult['CourseName']=$fRow->CourseName; $formResult['RollNo']=$fRow->RollNo; $formResult['MobileNumber']=$fRow->MobileNumber; $formResult['StudentName']=$fRow->StudentName; $formResult['FatherName']=$fRow->FatherName; $formResult['MotherName']=$fRow->MotherName; $formResult['EmailID']=$fRow->EmailID; $formResult['AlternateNumber']=$fRow->AlternateNumber; $formResult['Gender']=$fRow->Gender; $formResult['DOB']=$fRow->DOB; $formResult['PresentAddress']=$fRow->PresentAddress; $formResult['PermanentAddress']=$fRow->PermanentAddress; $formResult['AadharNumber']=$fRow->AadharNumber; $formResult['OtherID']=$fRow->IDProof; $formResult['UniversityCode']=$fRow->UniversityCode; $formResult['UniversityName']=$fRow->UniversityName; $mergeFormDetails[]=$formResult; } } } } else{ $formResult['SessionName']=$fRow->SessionName; $formResult['FormID']=$fRow->FormID; $formResult['FormType']=$fRow->FormType; $formResult['SemesterYear']=$fRow->SemesterYear; $formResult['CentreCode']=$fRow->CentreCode; $formResult['CentreState']=$fRow->CentreState; $formResult['EnrolmentNo']=$fRow->EnrolmentNo; $formResult['EnromentStatus']=false; $formResult['SemStatus']=true; $formResult['CourseCode']=$fRow->CourseCode; $formResult['CourseName']=$fRow->CourseName; $formResult['RollNo']=$fRow->RollNo; $formResult['MobileNumber']=$fRow->MobileNumber; $formResult['StudentName']=$fRow->StudentName; $formResult['FatherName']=$fRow->FatherName; $formResult['MotherName']=$fRow->MotherName; $formResult['EmailID']=$fRow->EmailID; $formResult['AlternateNumber']=$fRow->AlternateNumber; $formResult['Gender']=$fRow->Gender; $formResult['DOB']=$fRow->DOB; $formResult['PresentAddress']=$fRow->PresentAddress; $formResult['PermanentAddress']=$fRow->PermanentAddress; $formResult['AadharNumber']=$fRow->AadharNumber; $formResult['OtherID']=$fRow->IDProof; $formResult['UniversityCode']=$fRow->UniversityCode; $formResult['UniversityName']=$fRow->UniversityName; $mergeFormDetails[]=$formResult; } } // echo sizeof($mergeFormDetails);die(); if(sizeof($mergeFormDetails)>0){ $resultArr['unMatchedRecordDetails'] = $mergeFormDetails; $resultArr['unMatchedRecordStatus'] = true; $resultArr['unMatchedRecordFor'] = 'EnrolmentIDFile'; $resultArr['message'] = "Successfully data generated"; } else{ $resultArr['unMatchedRecordDetails'] = $mergeFormDetails; $resultArr['unMatchedRecordStatus'] = false; $resultArr['unMatchedRecordFor'] = 'EnrolmentIDFile'; $resultArr['message'] = "Successfully data generated"; } } else{ $resultArr['unMatchedRecordDetails'] = []; $resultArr['unMatchedRecordStatus'] = false; $resultArr['unMatchedRecordFor'] = 'EnrolmentIDFile'; $resultArr['message'] = "Successfully data generated"; } return $resultArr; } /* * get university session details for filter * created by kms * */ public function getUniversitySessionList($branchID=null){ $this->db->select('UniversityID,UniversityName'); $this->db->order_by('UniversityID','DESC'); $this->db->where('IsActive','1'); $this->db->group_by('UniversityName'); // $this->db->where('BranchCode',$branchID); $universityDetails = $this->db->get(UNIVERSITY); $universityResult=array(); if($universityDetails->result()){ $universityResult['status']=true; /* foreach ($universityDetails->result() as $row){ $this->db->select('SM.SessionID,SM.SessionName'); $this->db->order_by('SM.SessionID','DESC'); $this->db->where('SM.IsActive','1'); // $this->db->where('SM.BranchCode',$branchID); $this->db->where('SD.UniversityID',$row->UniversityID); $this->db->from(SESSIONMASTER.' as SM'); $this->db->join(SESSIONDETAILS.' as SD', 'SD.SessionID = SM.SessionID'); $sessionDetails = $this->db->get(); $fetchArray['UniversityID']=$row->UniversityID; $fetchArray['UniversityName']=$row->UniversityName; if($sessionDetails->result()){ $fetchArray['SessionDetails']=$sessionDetails->result(); } else{ $fetchArray['SessionDetails']=""; } $getResult[]=$fetchArray; }*/ $universityResult['details']=$universityDetails->result(); } else{ $universityResult['status']=false; $universityResult['details']=""; } return $universityResult; } /* * get exist student enrolment details * creted by kms * */ public function getExistStudentEnrolmentDetails($enrolment=null,$localData=null){ $keyArray = array(0 => 'SEM1', 1 => 'SEM2', 2 => 'SEM3', 3 => 'SEM4',4 => 'SEM5',5 => 'SEM6',6 => 'SEM7',7 => 'SEM8',8 => 'YEAR1',9 => 'YEAR2',10 => 'YEAR3',11 => 'YEAR4',12 => "DMC CHANGE SEM1",13 => "DMC CHANGE SEM2",14 => "DMC CHANGE SEM3",15 => "DMC CHANGE SEM4",16 => "DMC CHANGE SEM5",17 => "DMC CHANGE SEM6",18 => "DMC CHANGE SEM7",19 => "DMC CHANGE SEM8",20 => "DMC CHANGE YEAR1",21 => "DMC CHANGE YEAR2",22 => "DMC CHANGE YEAR3",23 => "DMC CHANGE YEAR4"); $valueArray = array("1","2","3","4","5","6","7","8","1","2","3","4","1","2","3","4","5","6","7","8","1","2","3","4"); $this->db->distinct('ENU.FormID'); $this->db->select('STC.EnrollmentID,ST.*,UN.UniversityID, UN.UniversityName,CM.CourseID,CM.CourseCode,CM.CourseName,CF.ID,CF.Sem_Year,CF.ProgramType,SM.SessionName,RE.RegistrationType'); $this->db->from(STUDENTCOURSE.' as STC'); $this->db->join(COURSE.' as CM', 'CM.CourseID = STC.CourseID'); $this->db->join(COURSE_FEES.' as CF', 'CF.CourseID = CM.CourseID'); $this->db->join(STUDENTS.' as ST', 'ST.StudentID = STC.StudentID'); $this->db->join(STUDENTS_FEES_STATUS.' as SFS', 'SFS.StudentID = STC.StudentID AND SFS.CourseID=STC.CourseID AND SFS.FeesType=CF.ID'); $this->db->join(SESSIONMASTER.' as SM', 'SM.SessionID = SFS.SessionName'); $this->db->join(REGISTRATIONDETAILS.' as RE', 'RE.Student_Fee_Status_Id = SFS.FeesID','left'); $this->db->join(UNIVERSITY.' as UN', 'UN.UniversityID = STC.UniversityID'); $this->db->where('STC.EnrollmentID', $enrolment); $details = $this->db->get(); $arrayResultStudent=array(); if($details->result()){ $getVAll=$details->result(); // $arrayResult['StudentID']=$getVAll[0]->StudentID; $arrayResult['StudentName']=$getVAll[0]->Firstname.' '.$getVAll[0]->Lastname; $arrayResult['MobileNumber']=$getVAll[0]->MobileNumber; $arrayResult['FatherName']=$getVAll[0]->Fathername; $arrayResult['MotherName']=$getVAll[0]->MotherName; $arrayResult['EmailID']=$getVAll[0]->EmailID; $arrayResult['AlternateNumber']=$getVAll[0]->AlternateNumber; $arrayResult['Gender']=$getVAll[0]->Gender; $arrayResult['DOB']=$getVAll[0]->DOB; $arrayResult['AadharNumber']=$getVAll[0]->AadharNumber; $arrayResult['BranchCode']=$getVAll[0]->BranchCode; $arrayResult['UniversityCode']=$getVAll[0]->UniversityID; $arrayResult['UniversityName']=$getVAll[0]->UniversityName; $arrayResult['CourseCode']=$getVAll[0]->CourseCode; $arrayResult['CourseName']=$getVAll[0]->CourseName; $arrayResult['EnrolmentNo']=$getVAll[0]->EnrollmentID; $arrayResultStudent['StudentInfo']=$arrayResult; if($getVAll[0]->ProgramType==SEMYEARFEES){ $arrayResultStudent['status']=true; $arraySem=array(); foreach ($getVAll as $row){ $serachKey = array_search(strtoupper($row->Sem_Year), $keyArray); $sem=$valueArray[$serachKey]; $this->db->select('FormID'); $this->db->from(ENROLMENTRECEIVEDFROMUNIV.' as ENU'); $this->db->where('ENU.EnrolmentNo',$enrolment); $this->db->where('ENU.SemesterYear',$sem); $notExistDetails=$this->db->get(); if(!$notExistDetails->result()){ $getSemType['sem']=$sem; $getSemType['SessionName']=$row->SessionName; $getSemType['FormType']=$row->RegistrationType; $arraySem[]=$getSemType; } } $arrayResultStudent['semDetails']=$arraySem; } else{ $arrayResultStudent['status']=false; $arrayResultStudent['message']="This is regular or lateral course so we can't do manual entry."; } } else{ $arrayResultStudent['message']="This enrolment either don't register in student course or set fees.please check to update details."; $arrayResultStudent['status']=false; } return $arrayResultStudent; } /* * add manual enrolment details * cretaed by kms * */ public function addManualEnrolmentDetails($studentInfo=null){ $this->db->select('ENU.FormID'); $this->db->from(ENROLMENTRECEIVEDFROMUNIV.' as ENU'); $this->db->where('ENU.FormID', $studentInfo['FormID']); $details = $this->db->get(); if($details->num_rows()==0){ $this->db->insert(ENROLMENTRECEIVEDFROMUNIV, $studentInfo); if ($this->db->affected_rows() > 0) { $resultArray['status']=true; $resultArray['message']="Inserted successfully"; } else { $resultArray['status']=false; $resultArray['message']="Inserted failed"; } } else { $resultArray['status']=false; $resultArray['message']="This form id is already exist."; } return $resultArray; } public function getForFormIdDraftDetails(){ $selectQuery = "SELECT * FROM T_FormId_FeeDetails_Received_From_University WHERE DraftStatus = 1"; $details = $this->db->query($selectQuery); $detailsList = $details->result(); if($detailsList) { $result['draftStatus'] = true; $result['draftDetails'] = $detailsList; $result['draftDetailsMessagae'] = "details generate successfully."; } else { $result['draftStatus'] = false; $result['draftDetails'] = ''; $result['draftDetailsMessagae'] = "No Record Found."; } return $result; } public function addForFormIdDraftDetails($details, $local){ $localBranchID = $local['localBranchID']; $localUserID = $local['localUserID']; $time = date('Y-m-d H:i:s'); $CreatedOn = $time; $formIds = $details['FormID']; $formType = $details['FormType']; $CentreCode = $details['CentreCode']; $Session = $details['Session']; $Year = $details['Year']; $Semester = $details['Semester']; $Student_Name = $details['Student_Name']; $Father_Name = $details['Father_Name']; $CourseCode = $details['CourseCode']; $ActualCourseFee = $details['ActualCourseFee']; $CourseFee = $details['CourseFee']; $ExamFee = $details['ExamFee']; $EnrollmentFee = $details['EnrollmentFee']; $ProspectusFee = $details['ProspectusFee']; $ReRegFee = $details['ReRegFee']; $CreditTransferFee = $details['CreditTransferFee']; $LateralEntryFee = $details['LateralEntryFee']; $DualSpclFee = $details['DualSpclFee']; $OtherFee = $details['OtherFee']; $NRIFEE = $details['NRIFEE']; $ProvisionalFee = $details['ProvisionalFee']; $MigrationFee = $details['MigrationFee']; $UrgentResultDMCFee = $details['UrgentResultDMCFee']; $AdditionalFee = $details['AdditionalFee']; $Amount = $details['Amount']; $selectQuery = "SELECT * FROM T_FormId_FeeDetails_Received_From_University WHERE FormID = '$formIds' AND FormType = '$formType' AND CentreCode = '$CentreCode' AND Session = '$Session' AND Year = '$Year' AND Semester = '$Semester' AND Student_Name = '$Student_Name' AND Father_Name = '$Father_Name' AND CourseCode = '$CourseCode' AND ActualCourseFee = '$ActualCourseFee' AND CourseFee = '$CourseFee' AND ExamFee = '$ExamFee' AND EnrollmentFee = '$EnrollmentFee' AND ProspectusFee = '$ProspectusFee' AND ReRegFee = '$ReRegFee' AND CreditTransferFee = '$CreditTransferFee' AND LateralEntryFee = '$LateralEntryFee' AND DualSpclFee = '$DualSpclFee' AND OtherFee = '$OtherFee' AND NRIFEE = '$NRIFEE' AND ProvisionalFee = '$ProvisionalFee' AND MigrationFee = '$MigrationFee' AND UrgentResultDMCFee = '$UrgentResultDMCFee' AND AdditionalFee = '$AdditionalFee' AND Amount = '$Amount'"; $queryDetails = $this->db->query($selectQuery); if(count($queryDetails->result()) == 0){ $query = "INSERT INTO T_FormId_FeeDetails_Received_From_University (FormID, FormType, CentreCode,Session,Year,Semester,Student_Name,Father_Name,CourseCode, ActualCourseFee, CourseFee, ExamFee, EnrollmentFee, ProspectusFee, ReRegFee, CreditTransferFee, LateralEntryFee, DualSpclFee, OtherFee, NRIFEE, ProvisionalFee, MigrationFee, UrgentResultDMCFee, AdditionalFee, Amount, CreatedBy, CreatedOn, BranchCode, DraftStatus) VALUES ( '$formIds', '$formType', '$CentreCode','$Session','$Year','$Semester','$Student_Name','$Father_Name', '$CourseCode', '$ActualCourseFee', '$CourseFee', '$ExamFee', '$EnrollmentFee', '$ProspectusFee', '$ReRegFee', '$CreditTransferFee', '$LateralEntryFee', '$DualSpclFee', '$OtherFee', '$NRIFEE', '$ProvisionalFee', '$MigrationFee', '$UrgentResultDMCFee', '$AdditionalFee', '$Amount', '$localUserID', '$CreatedOn', '$localBranchID' , 1)"; $queryDetails = $this->db->query($query); if($queryDetails){ $result['draftStatus'] = true; $result['draftDetailsMessagae'] = "Updated Successfully."; }else{ $result['draftStatus'] = false; $result['draftDetailsMessagae'] = "Something went wrong."; } } else { $result['draftStatus'] = false; $result['draftDetailsMessagae'] = "This record already exist."; } return $result; } public function draftMovetoList($detail, $local){ // print_r($details);exit(); foreach($detail as $row) { // echo $row['ID'];exit(); $data[] = array( 'ID' => $row['ID'], 'FormType'=> 'Hello' ); } // $data = array( // array( // 'ID' => 1, // 'FormType' => 'Hello' // ), // array( // 'ID' => 2, // 'FormType' => 'World' // ) // ); // print_r($data);exit(); $this->db->update_batch('T_FormId_FeeDetails_Received_From_University', $data, 'ID'); $detailsList = $details->result(); if($detailsList){ $result['draftStatus'] = true; $result['draftDetailsMessagae'] = "Updated Successfully."; } else { $result['draftStatus'] = false; $result['draftDetailsMessagae'] = "Something went wrong."; } } }