Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 182 |
CRAP | |
0.00% |
0 / 4103 |
AdmissionService | |
0.00% |
0 / 1 |
|
0.00% |
0 / 182 |
533630.00 | |
0.00% |
0 / 4103 |
__construct | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 3 |
|||
__clone | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 2 |
|||
getInstance | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 5 |
|||
getAdmissionCoursePatterns | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 17 |
|||
getAdmissionFormTypeById | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 15 |
|||
getUGStudentAdmissionDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 21 |
|||
getBtechStudentAdmissionDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 20 |
|||
initiatePayment | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 46 |
|||
initiatePaymentEnquiry | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 53 |
|||
initiatePaymentB_TECH | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 43 |
|||
createUGStudentAdmissionDetails | |
0.00% |
0 / 1 |
1190.00 | |
0.00% |
0 / 130 |
|||
updateUGStudentAdmissionDetails | |
0.00% |
0 / 1 |
42.00 | |
0.00% |
0 / 209 |
|||
createBranchPrefOfUG | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 16 |
|||
createBranchPrefOfPG | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 16 |
|||
getBranchPrefOfPG | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
getBranchPrefOfUG | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
deleteBranchPrefOfUGByStudentId | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 8 |
|||
deleteBranchPrefOfPGByStudentId | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 8 |
|||
getAdmissionReligion | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getStudentReservation | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getStudentReservationById | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getAdmissionCommunity | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
checkAdmissionLoginEmailUG | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 17 |
|||
checkAdmissionLoginEmailBTECH | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 13 |
|||
checkAdmissionLoginEmailPG | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 13 |
|||
getAdmissionBoardExamType | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getApplicationStartNo | |
0.00% |
0 / 1 |
420.00 | |
0.00% |
0 / 69 |
|||
getLastGeneratedApplicationNo | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getApplicationFormByFormType | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 13 |
|||
getApplicationFormByStudentId | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 21 |
|||
checkStudentMarkEntered | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 13 |
|||
getStudentMarkEntered | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getApplicationNoByStudentId | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
getApplicationNoByPgStudentId | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
checkApplicationFee | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
hasApplicationFee | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
createPGStudentAdmissionDetails | |
0.00% |
0 / 1 |
756.00 | |
0.00% |
0 / 116 |
|||
updatePGStudentAdmissionDetails | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 186 |
|||
getPGApplicationNoByStudentId | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
getPGLastGeneratedApplicationNo | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getAdmissionPaymentModuleCategoryByCourseType | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
initiatePaymentPG | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 45 |
|||
getPGStudentAdmissionDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 22 |
|||
updatePaymentStatus | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 20 |
|||
updatePaymentStatusB_TECH | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
updatePaymentStatusPG | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 20 |
|||
addAdmissionStudentOfflinePaymentPG | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 48 |
|||
updateAdmissionStudentOfflinePaymentPG | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 24 |
|||
verifyPGStudent | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
verifyUGStudent | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
admitStudents | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 19 |
|||
searchAdmittedStudents | |
0.00% |
0 / 1 |
156.00 | |
0.00% |
0 / 53 |
|||
transferAdmittStudentsToAMS | |
0.00% |
0 / 1 |
380.00 | |
0.00% |
0 / 169 |
|||
transferStudentImageToAMS | |
0.00% |
0 / 1 |
42.00 | |
0.00% |
0 / 23 |
|||
getAdmissionFormTypes | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 22 |
|||
getAdmissionFormTypesByCourseType | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 19 |
|||
createAdmissionFormType | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 45 |
|||
updateAdmissionFormType | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 22 |
|||
deleteAdmissionFormType | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
createAdmissionFeeDetails | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 39 |
|||
updateApplicationFeeDetails | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 22 |
|||
updateApplicationFeeDetailsByStudentId | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 22 |
|||
getApplicationFeeDetailseByStudentId | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 12 |
|||
getApplicationForms | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 17 |
|||
getApplicationFormsByCourseType | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 21 |
|||
getApplicationFormById | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 17 |
|||
createSeatReservationUG | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 18 |
|||
deleteSeatReservationUG | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getDepartmentReservationForUG | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 20 |
|||
getDepartmentReservationQuotas | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 16 |
|||
getReligionById | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
studentLogin | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 15 |
|||
resetPassword | |
0.00% |
0 / 1 |
342.00 | |
0.00% |
0 / 50 |
|||
getPaidStudentCount | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 33 |
|||
getVerifiedStudentCount | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 16 |
|||
searchBtechAdmissionStudentDetails | |
0.00% |
0 / 1 |
90.00 | |
0.00% |
0 / 34 |
|||
getAdmissionStudentPreferences | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 19 |
|||
getAdmissionStudentPaymentDetails | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 16 |
|||
getAdmissionExamSubjectDetailsByType | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
addStudentMarksUg | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 14 |
|||
deleteStudentMarksUg | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
addAdmissionAdvanceFee | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 13 |
|||
updateAdmissionAdvanceFee | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 9 |
|||
getAdmissionAdvanceFee | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getTotalAdmissionAdvanceFee | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getAdmissionAdvanceFeeById | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getCommunityByReligion | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
addAdmissionStudentOfflinePayment | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 45 |
|||
updateAdmissionStudentOfflinePayment | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 20 |
|||
getApplicationFeePaymentDetailsUg | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 12 |
|||
getApplicationFeePaymentDetailsPg | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 12 |
|||
getAdmissionQuotaByName | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getAdmissionQuota | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getVerifiedStudents | |
0.00% |
0 / 1 |
272.00 | |
0.00% |
0 / 58 |
|||
cancelVerification | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 16 |
|||
cancelAdmission | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 16 |
|||
getOldAdmissionStudentPaymentReqInfoUG | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 15 |
|||
initiatePaymentOldAdmissionUG | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 43 |
|||
updatePaymentStatusOldAdmission | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getStudentIdOldAdmissionByStudentAccount | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
rejectApplication | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 16 |
|||
cancelRejectApplication | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 16 |
|||
getRejectedStudents | |
0.00% |
0 / 1 |
56.00 | |
0.00% |
0 / 35 |
|||
updateCareOf | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 17 |
|||
updateRemarks | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 17 |
|||
getAdmissionQuotaById | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getAdmissionSeatFilledStatus | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 15 |
|||
updateRefund | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 15 |
|||
addFeeStructure | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
updateFeeStructure | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
deleteFeeStructure | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getFeeStructure | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 8 |
|||
getFeeStructureById | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
addFeeStructureFeeHead | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 14 |
|||
deleteFeeStructureFeeHeadByFeeStructureId | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getFeeStructureFeeHeadByFeeStructureId | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 11 |
|||
asignFeeStructureToStudent | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
asignFeeHeadToStudent | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 14 |
|||
getFeeHeadByFeeStructureId | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 11 |
|||
getAdmissionSeatFilledStatusByDept | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 16 |
|||
deleteFeeStructureByStudentId | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getFeeStructureByStudentId | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 12 |
|||
getFeeStructureIdByStudentId | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 12 |
|||
getStudentDetailsByIds | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 18 |
|||
getAdmissionExamSubjects | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 13 |
|||
getStudentExamMarks | |
0.00% |
0 / 1 |
132.00 | |
0.00% |
0 / 45 |
|||
getCertificates | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 8 |
|||
getStudentCertificateDetails | |
0.00% |
0 / 1 |
132.00 | |
0.00% |
0 / 49 |
|||
getAdvanceFeeReport | |
0.00% |
0 / 1 |
240.00 | |
0.00% |
0 / 61 |
|||
addAdmissionUgSemMarks | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 16 |
|||
removeAdmissionUgSemMarksByStudentId | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getAdmissionUgSemMarksByStudentId | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
updateAdmittedPaidDetails | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 17 |
|||
getStudentPaymentType | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getStudentIsBankPayment | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
addApplicationFormTypeNotificationContent | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
updateApplicationFormTypeNotificationContent | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getApplicationFormTypeNotificationContent | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 13 |
|||
addAdmissionStudentUgMarkDetails | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 14 |
|||
deleteAdmissionStudentUgMarkDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getAdmissionStudentUgMarkDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
updateStudentEditByFormType | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 16 |
|||
updateStudentEditByStudentId | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 14 |
|||
isEditDisabledByFormTypeId | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 14 |
|||
editDisableOfStudentByStudentId | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 14 |
|||
generateRankList | |
0.00% |
0 / 1 |
72.00 | |
0.00% |
0 / 47 |
|||
createAdmissionStatisticsDetails | |
0.00% |
0 / 1 |
56.00 | |
0.00% |
0 / 27 |
|||
deleteAdmissionStatisticsDetails | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 12 |
|||
updateAdmissionStatisticsDetails | |
0.00% |
0 / 1 |
72.00 | |
0.00% |
0 / 30 |
|||
getAdmissionStatistics | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 16 |
|||
getDepartmentWiseAdmissionStatistics | |
0.00% |
0 / 1 |
72.00 | |
0.00% |
0 / 21 |
|||
getAdmissionBatchByDeptId | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 12 |
|||
getstudentAmsIdByStudentId | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 16 |
|||
updateAdmittedStudentDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
checkAdmissionNo | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 26 |
|||
getLastGeneratedAdmissionNoByDeptId | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 20 |
|||
checkPreviousStudentEmailExists | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 32 |
|||
addEnquiryStudentDetailsUG | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 17 |
|||
addEnquiryStudentDetailsPG | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 18 |
|||
getStudentListUg | |
0.00% |
0 / 1 |
870.00 | |
0.00% |
0 / 123 |
|||
transferStudentSignImageToAMS | |
0.00% |
0 / 1 |
42.00 | |
0.00% |
0 / 23 |
|||
resetPasswordByStudentID | |
0.00% |
0 / 1 |
380.00 | |
0.00% |
0 / 65 |
|||
updateEntranceDetailsByStudentIdPG | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getEntranceDetailsByStudentIdPG | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
updateUgSemMarksPG | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getUgSemMarksPG | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
updatePgSemMarksPG | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getpgSemMarksPG | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
getPatternCourses | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 22 |
|||
getApplicationFeeCategory | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 8 |
|||
getApplicationFeePg | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 8 |
|||
updateFeesForPatternCourses | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 13 |
|||
getStudentHseMarkListUg | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 28 |
|||
getUGStudentScholershipDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 8 |
|||
saveUGStudentScholershipDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 8 |
|||
updateAdmittedPaidDetailsV1 | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 25 |
|||
getTransactionIdByStudentIdOfUG | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
updateAdmittedPaidDetailsV3 | |
0.00% |
0 / 1 |
42.00 | |
0.00% |
0 / 30 |
|||
getAdmittedOtherDetailsV3 | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 8 |
|||
updateAcadamicProgramStatus | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 45 |
|||
updateStudentJoiningDateAsFirstPaymentDate | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 12 |
|||
getStudentFirstFeePaidDate | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
<?php | |
namespace com\linways\core\ams\professional\service; | |
use com\linways\base\util\StringUtil; | |
use com\linways\base\util\RequestUtil; | |
use com\linways\core\ams\professional\dto\CourseType; | |
use com\linways\core\ams\professional\logging\Events; | |
use com\linways\core\ams\professional\logging\AMSLogger; | |
use com\linways\core\ams\professional\queue\AMSTaskQueue; | |
use com\linways\core\ams\professional\dto\AdmissionStatus; | |
use com\linways\core\ams\professional\service\CommonService; | |
use com\linways\core\ams\professional\dto\AdmissionConstants; | |
use com\linways\core\ams\professional\dto\AdmissionStatistics; | |
use com\linways\core\ams\professional\dto\AdmissionPaymentMode; | |
use com\linways\core\ams\professional\constant\SettingsConstants; | |
use com\linways\core\ams\professional\dto\AdmissionPaymentStatus; | |
use com\linways\core\ams\professional\mapper\AdmissionServiceMapper; | |
use com\linways\core\ams\professional\request\ExecutePaymentRequest; | |
use com\linways\core\ams\professional\dto\AdmissionPaymentCredential; | |
use com\linways\core\ams\professional\exception\ProfessionalException; | |
use com\linways\core\ams\professional\dto\AdmissionStudentUgMarkDetails; | |
use com\linways\core\ams\professional\response\AdmissionStudentResponse; | |
use com\linways\core\ams\professional\request\CreateAdmissionStatisticsRequest; | |
use com\linways\core\ams\professional\request\UpdateAdmissionStatisticsRequest; | |
use com\linways\core\ams\professional\dto\ApplicationFormTypeNotificationContent; | |
use com\linways\core\ams\professional\dto\PaymentGateway; | |
use com\linways\core\ams\professional\constant\StatusConstants; | |
use com\linways\core\ams\professional\constant\academic\GroupTypeConstant; | |
class AdmissionService extends BaseService | |
{ | |
private $mapper = []; | |
// /Condition 1 - Presence of a static member variable | |
private static $_instance = null; | |
// /Condition 2 - Locked down the constructor | |
private function __construct() | |
{ | |
$this->mapper = AdmissionServiceMapper::getInstance()->getMapper(); | |
} | |
// Prevent any oustide instantiation of this class | |
// /Condition 3 - Prevent any object or instance of that class to be cloned | |
private function __clone() | |
{ | |
} | |
// Prevent any copy of this object | |
// /Condition 4 - Have a single globally accessible static method | |
public static function getInstance() | |
{ | |
if (!is_object(self::$_instance)) // or if( is_null(self::$_instance) ) or if( self::$_instance == null ) | |
self::$_instance = new self(); | |
return self::$_instance; | |
} | |
/** | |
* Get Admission course patterns | |
* | |
* @param string $sortBy | |
* @param string $sortOrder | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getAdmissionCoursePatterns($sortBy = "patternName", $sortOrder = "ASC") | |
{ | |
$coursePatterns = []; | |
// Validate sort order and sort by | |
RequestUtil::validateSortOrder($sortBy, $sortOrder); | |
$sql = "SELECT patternID, | |
patternName, | |
patternDesc, | |
applicationPrefix, | |
admissionConfirmed, | |
admissionYear | |
FROM admission_course_pattern ORDER BY $sortBy $sortOrder"; | |
try { | |
$coursePatterns = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $coursePatterns; | |
} | |
/** | |
* method get AdmissionFormType by id | |
* | |
* @param int $admissionFormTypeId | |
* @return NULL | |
* @throws ProfessionalException | |
*/ | |
public function getAdmissionFormTypeById($admissionFormTypeId) | |
{ | |
$admissionFormType = NULL; | |
$sql = "SELECT aft.*, | |
bct.type_code as courseTypeCode, | |
bct.type_name as courseTypeName | |
FROM applicationFormType aft | |
inner join batch_course_type bct | |
on bct.id = aft.courseTypeId WHERE aft.id = $admissionFormTypeId"; | |
try { | |
$admissionFormType = $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $admissionFormType; | |
} | |
/** | |
* getUGStudentAdmissionDetails | |
* | |
* @param int $courseTypeId | |
* @param int $studentId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getUGStudentAdmissionDetails($courseTypeId, $studentId) | |
{ | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$studentId = $this->realEscapeString($studentId); | |
$admissionStudentDetailsUG = NULL; | |
$sql = "SELECT distinct asd.myimage,asd.studentName,asd.studentInitial,asd.dateofbirth,asd.gender,asd.age,asd.aadharNo,asd.nationality,asd.motherTongue,asd.religion,asd.caste,asd.reservID,asd.permahouse,asd.permaplace,asd.permastate,asd.permacity,asd.permataluk,asd.permapin,asd.commuhouse,asd.commuplace,asd.commustate,asd.commucity,asd.commutaluk,asd.commupin,asd.mobilePhone,asd.studentResPhone,asd.email,asd.fatherName,asd.fatherEmail,asd.fatherQualification,asd.fatherOccupation,asd.fatherMobile,asd.motherName,asd.motherEmail,asd.motherOccupation,asd.motherQualification,asd.motherMobile,asd.annualIncome,asd.tenthSchool,asd.tenthExam,asd.tenthCombination,asd.tenthYear,asd.tenthBoard,asd.tenthPercent,asd.tenthMarksObtained,asd.tenthMaxMarks,asd.twelthSchool,asd.twelthExam,asd.twelthCombination,asd.twelthYear,asd.twelthBoard,asd.twelthPercent,asd.twelthMarksObtained,asd.twelthMaxMarks,asd.hostel_facility,asd.otherAchievements,asd.secondLanguage,asd.createdBy,DATE_FORMAT(CONVERT_TZ(asd.createdDate,'+00:00',@@global.time_zone),'%Y-%m-%d %h:%i %p') as createdDate,asd.updatedBy,asd.updatedDate,asd.admissionYear,asd.courseTypeId,asd.applicationFormTypeId,CONCAT(aft.applicationPrefix,'',asd.applicationNo) as applicationNo,IF(sr.other_reserv=1,asd.otherCategoryName,sr.reservName) AS reservName,IF(twelthabt.unknown,asd.twelthBoardOther,twelthabt.typeName) as twelthBoardName,twelthabt.typeDesc as twelthBoardDesc, asd.paymentStatus as paymentStatus, asd.paymentMethod as paymentMethod, asd.isVerified as isVerified, asd.tenthRegNo, asd.twelthRegNo, asd.gamesProficiency, asd.boardingPoint, asd.bus_facility, asd.recommendation, asd.placeOfBirth, asd.entranceRegno, asd.entranceScore, asd.entranceRank, asd.entranceName, asd.entranceYear, asd.entranceapplnno, asd.entranceMark, asd.entranceMark_phyche, asd.entranceMark_maths, asd.entrance_status, asd.state2, asd.parentName, asd.twelthAttempts, asd.employeeCode, asd.bloodGroup, asd.height, asd.idMarks, asd.entranceMaxMark, asd.maritalStatus, asd.entranceMonth, asd.twelthMonth, asd.parentRelationship, asd.parentEmail, asd.parishName, asd.panchayath, asd.bankAccountNo, asd.bankName as studentBankName, asd.bankBranch as studentBankBranch, asd.ifscNo, asd.wardNo, asd.diplomaExam, asd.diplomaRegNo, asd.diplomaMonth, asd.diplomaYear, asd.diplomaInst, asd.diplomaMarksObtained, asd.diplomaMaxMarks, asd.diplomaPercent, asd.isLateral, asd.jurisdiction, asd.nriName, asd.nriRelationship, asd.tcNo, asd.tcDate, asd.tcInstitution, asd.isAtchivement, asd.scholarship, asd.isPhysicallyChallenged, asd.diplomaBrach, asd.otherEntranceName, asd.otherEntranceRegno, asd.otherEntranceApplicationNo, asd.otherEntranceMarks, asd.otherEntranceRank, asd.parentMobile, asd.specialCategory, off_payment.ddNumber, off_payment.ddDate, off_payment.bankName, off_payment.bankBranch, aq.quotaID, aq.quotaName, aq.quotaDesc, IF(asd.paymentMethod='ONLINE',aop.dateOfTrasaction,off_payment.paymentDate) as dateOfTrasaction, aft.applicationYear, asd.admittedDeptId, asd.admittedDate, asd.seatReservationQuotaId, asd.priestName, asd.careOf, asd.parentPhone, asd.parenthouse, asd.parentplace, asd.parentstate, asd.parentcity, asd.parenttaluk, asd.parentpin, asd.sportsName, asd.sportsPartLevel, asd.sportsPrizeWin, asd.tenthMonth, asd.tenthGrade, asd.twelthGrade, asd.married, asd.parentOccupation, asd.ktuStudentId, asd.currentCollegeName, asd.currentBranchId, asd.currentSemId, asd.admitSemId, asd.admissionNo, asd.entranceExamCenter, asd.remarks, asd.jeeEntranceRegno, asd.jeeEntranceApplicationNo, asd.jeeEntranceMarks, asd.jeeEntranceRank, asd.keeEntranceRegno, asd.keeEntranceApplicationNo, asd.keeEntranceMarks, keeEntranceRank, asd.keeEntranceMark_maths, asd.keeEntranceMark_phyche, asd.diocese, asd.isBPL, asd.twelthBoardOther, asd.studentEmail, asd.studentExtras, asd.disableEdit, asd.indexMark, asd.indexMarkRank, aft.feeEnabled, asd.taluk, asd.country, asd.appliedDate, asd.appliedPlace, asd.twelfthAdditionalSubject, asd.signImage,asd.parentSignature, asd.arrears, asd.nriSponsor, asd.passportNo, asd.passportValidity, asd.visaDetails, asd.referralSource, asd.otherReferral, asd.capId, asd.tenthMarkDetails, asd.tenthMarkList, asd.reasonForNoDiplomaCertificate, asd.isDiplomaCertificateObtained, asd.icseUid, asd.icseIndexNo, asd.cbseSchoolNo, asd.cbseCentreNo, asd.cbseAdmitCardId,asd.transactionId_or_referenceNo | |
FROM admission_student_details_ug asd | |
LEFT JOIN applicationFormType aft ON asd.applicationFormTypeId = aft.id | |
LEFT JOIN student_reservation sr ON sr.reservID = asd.reservID | |
LEFT JOIN admission_boardexam_type twelthabt ON twelthabt.typeID = asd.twelthBoard | |
LEFT JOIN admission_student_offline_payment_ug off_payment ON asd.studentID = off_payment.studentID | |
LEFT JOIN admission_student_online_payment_ug aop ON aop.studentId = asd.studentID | |
LEFT JOIN admission_quotas aq ON aq.quotaID = asd.quotaID | |
WHERE asd.studentID = $studentId AND asd.courseTypeId = $courseTypeId"; | |
try { | |
$admissionStudentDetailsUG = $this->executeQueryForObject($sql); | |
$admissionStudentDetailsUG->admissionStudentBranchPreference = $this->getBranchPrefOfUG($studentId); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $admissionStudentDetailsUG; | |
} | |
/** | |
* getBtechStudentAdmissionDetails | |
* | |
* @param int $courseTypeId | |
* @param int $studentId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getBtechStudentAdmissionDetails($courseTypeId, $studentId) | |
{ | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$studentId = $this->realEscapeString($studentId); | |
$admissionStudentDetails = NULL; | |
$sql = "SELECT asd.myimage,asd.studentName,asd.studentInitial,asd.dateofbirth,asd.gender,asd.age,asd.aadharNo,asd.nationality,asd.motherTongue,asd.religion,asd.caste,asd.reservID,asd.permahouse,asd.permaplace,asd.permastate,asd.permacity,asd.permataluk,asd.permapin,asd.commuhouse,asd.commuplace,asd.commustate,asd.commucity,asd.commutaluk,asd.commupin,asd.mobilePhone,asd.studentResPhone,asd.email,asd.fatherName,asd.fatherEmail,asd.fatherQualification,asd.fatherOccupation,asd.fatherMobile,asd.motherName,asd.motherEmail,asd.motherOccupation,asd.motherQualification,asd.motherMobile,asd.annualIncome,asd.tenthSchool,asd.tenthExam,asd.tenthCombination,asd.tenthYear,asd.tenthBoard,asd.tenthPercent,asd.tenthMarksObtained,asd.tenthMaxMarks,asd.twelthSchool,asd.twelthExam,asd.twelthCombination,asd.twelthYear,asd.twelthBoard,asd.twelthPercent,asd.twelthTotal,asd.twelthMax,asd.hostel_facility,asd.admissionYear,asd.courseTypeId,asd.applicationFormTypeId,CONCAT(aft.applicationPrefix,'',asd.applicationNo) as applicationNo,sr.reservName,twelthabt.typeName as twelthBoardName, asd.paymentStatus as paymentStatus, asd.paymentMethod as paymentMethod, asd.isVerified as isVerified, asd.tenthRegNo, asd.twelthRegNo, asd.gamesProficiency, | |
off_payment.ddNumber, off_payment.ddDate, off_payment.bankName, off_payment.bankBranch | |
FROM admission_student_details asd | |
LEFT JOIN applicationFormType aft ON asd.applicationFormTypeId = aft.id | |
LEFT JOIN student_reservation sr ON sr.reservID = asd.reservID | |
LEFT JOIN admission_boardexam_type twelthabt ON twelthabt.typeID = asd.twelthBoard | |
LEFT JOIN admission_student_offline_payment_btech off_payment ON asd.studentID = off_payment.studentID | |
WHERE asd.studentID = $studentId AND asd.courseTypeId = $courseTypeId;"; | |
try { | |
$admissionStudentDetails = $this->executeQueryForObject($sql); | |
$admissionStudentDetails->admissionStudentBranchPreference = $this->getAdmissionStudentPreferences($studentId); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $admissionStudentDetails; | |
} | |
/** | |
* Make admission payment for a student | |
* | |
* @param StudentOnlinePaymentRequest $studentOnlinePaymentRequest | |
*/ | |
public function initiatePayment($studentOnlinePaymentRequest, $module = 'ADMISSION', $category = 'ALL') | |
{ | |
$studentOnlinePaymentRequest = $this->realEscapeObject($studentOnlinePaymentRequest); | |
$module = $this->realEscapeString($module); | |
$category = $this->realEscapeString($category); | |
$clnt_txn_ref = mt_rand(); | |
// Checking whether this student has alredy tried to make payment | |
$sql = "SELECT clnt_txn_ref FROM admission_student_online_payment_ug WHERE studentId = '$studentOnlinePaymentRequest->studentId'"; | |
$studentPayment = $this->executeQueryForObject($sql); | |
$amount = $studentOnlinePaymentRequest->amount; | |
$isEditFromParam = $studentOnlinePaymentRequest->isEdit ? '{from:stdEdit}' : ''; | |
if (empty($studentPayment)) { | |
$sql = "INSERT INTO admission_student_online_payment_ug (studentId, clnt_txn_ref, numberOfAttempts, status, applicationNo, admissionYear, dateOfTrasaction) VALUES('$studentOnlinePaymentRequest->studentId','$clnt_txn_ref', 1, '" . AdmissionPaymentStatus::PENDING . "', '" . $studentOnlinePaymentRequest->applicationNo . "', '" . $studentOnlinePaymentRequest->admissionYear . "','" . date("d-m-Y") . "')"; | |
} else { | |
$sql = "UPDATE admission_student_online_payment_ug SET clnt_txn_ref='$clnt_txn_ref', status = '" . AdmissionPaymentStatus::PENDING . "', dateOfTrasaction = \"" . date("d-m-Y") . "\" WHERE studentID = '$studentOnlinePaymentRequest->studentId'"; | |
} | |
$this->executeQuery($sql); | |
$sql = "UPDATE admission_student_details_ug SET paymentStatus = '" . AdmissionPaymentStatus::PENDING . "', paymentMethod = '" . AdmissionPaymentMode::ONLINE . "' WHERE studentID = $studentOnlinePaymentRequest->studentId "; | |
$this->executeQuery($sql); | |
$admissionStudentDetails = $this->getUGStudentAdmissionDetails($studentOnlinePaymentRequest->courseTypeId, $studentOnlinePaymentRequest->studentId); | |
if (!empty($admissionStudentDetails)) { | |
$exePaymentReq = new ExecutePaymentRequest(); | |
$exePaymentReq->module = $module; | |
$exePaymentReq->category = $category; | |
$exePaymentReq->amount = $amount; | |
$exePaymentReq->currency = 'INR'; | |
// $exePaymentReq->reqMetaData = "{studentID:" . $studentOnlinePaymentRequest->studentId . "}$isEditFromParam{courseTypeID:" . $studentOnlinePaymentRequest->courseTypeId . "}"; | |
$exePaymentReq->returnURL = $studentOnlinePaymentRequest->returnURL; | |
$exePaymentReq->timeStamp = date("d-m-Y"); | |
$exePaymentReq->txnId = $clnt_txn_ref; | |
$exePaymentReq->productInfo = 'Admission Application Fee'; | |
$exePaymentReq->email = $admissionStudentDetails->email; | |
$exePaymentReq->phone = $admissionStudentDetails->mobilePhone; | |
$exePaymentReq->userName = $admissionStudentDetails->studentName; | |
$exePaymentReq->userId = $studentOnlinePaymentRequest->studentId; | |
$userDfParams = []; | |
$userDfParams['studentId'] = $studentOnlinePaymentRequest->studentId; | |
$userDfParams['courseTypeId'] = $studentOnlinePaymentRequest->courseTypeId; | |
$userDfParams['isEdit'] = $studentOnlinePaymentRequest->isEdit; | |
$userDfParams['linwaysTxnId'] = $clnt_txn_ref; | |
$userDfParams['email'] = $admissionStudentDetails->email; | |
$userDfParams['phone'] = $admissionStudentDetails->mobilePhone; | |
$userDfParams['userName'] = $admissionStudentDetails->studentName; | |
$exePaymentReq->userdfParams = $userDfParams; | |
PaymentGatewayService::getInstance()->executePayment($exePaymentReq); | |
} else { | |
throw new ProfessionalException(ProfessionalException::ADMISSION_INVALID_STUDENTDETAILS, "Student Details are null for studentId=$studentOnlinePaymentRequest->studentId and coursetypeId = $studentOnlinePaymentRequest->courseTypeId"); | |
} | |
} | |
/** | |
* Make admission payment enquiry for a student | |
* | |
* @param StudentOnlinePaymentRequest $studentOnlinePaymentRequest | |
*/ | |
public function initiatePaymentEnquiry($studentOnlinePaymentRequest, $module = 'ADMISSION', $category = 'ALL') | |
{ | |
$studentOnlinePaymentRequest = $this->realEscapeObject($studentOnlinePaymentRequest); | |
$module = $this->realEscapeString($module); | |
$category = $this->realEscapeString($category); | |
$clnt_txn_ref = mt_rand(); | |
/* // Checking whether this student has alredy tried to make payment | |
$sql = "SELECT clnt_txn_ref FROM admission_student_online_payment WHERE studentID = '$studentOnlinePaymentRequest->studentId'"; | |
$studentPayment = $this->executeQueryForObject($sql); */ | |
$amount = $studentOnlinePaymentRequest->amount; | |
$isPg = BatchService::getInstance()->getCourseTypeById($studentOnlinePaymentRequest->courseTypeId)->isPG; | |
if($isPg) | |
{ | |
$admissionStudentDetails = $this->getPGStudentAdmissionDetails($studentOnlinePaymentRequest->courseTypeId, $studentOnlinePaymentRequest->studentId); | |
} | |
else | |
{ | |
$admissionStudentDetails = $this->getUGStudentAdmissionDetails($studentOnlinePaymentRequest->courseTypeId, $studentOnlinePaymentRequest->studentId); | |
} | |
if (! empty($admissionStudentDetails)) { | |
$exePaymentReq = new ExecutePaymentRequest(); | |
$exePaymentReq->module = $module; | |
$exePaymentReq->category = $category; | |
$exePaymentReq->amount = $amount; | |
$exePaymentReq->currency = 'INR'; | |
// $exePaymentReq->reqMetaData = "{studentID:" . $studentOnlinePaymentRequest->studentId . "}$isEditFromParam{courseTypeID:" . $studentOnlinePaymentRequest->courseTypeId . "}"; | |
$exePaymentReq->returnURL = $studentOnlinePaymentRequest->returnURL; | |
$exePaymentReq->timeStamp = date("d-m-Y"); | |
$exePaymentReq->txnId = $clnt_txn_ref; | |
$exePaymentReq->paymentTransactionMode=PaymentGateway::PAYMENT_MODE_INQUIRY; | |
$exePaymentReq->linwaysTxnId=$studentOnlinePaymentRequest->linwaysTransactionId; | |
$exePaymentReq->productInfo = 'Admission Application Fee'; | |
$exePaymentReq->email = $admissionStudentDetails->email; | |
$exePaymentReq->phone = $admissionStudentDetails->mobilePhone; | |
$exePaymentReq->paymentGatewayTxnId= $studentOnlinePaymentRequest->paymentGatewayTxnId; | |
$exePaymentReq->userName = $admissionStudentDetails->studentName; | |
$exePaymentReq->userId = $studentOnlinePaymentRequest->studentId; | |
$userDfParams = []; | |
$userDfParams['studentId'] = $studentOnlinePaymentRequest->studentId; | |
$userDfParams['courseTypeId'] = $studentOnlinePaymentRequest->courseTypeId; | |
$userDfParams['amount'] = $amount; | |
$userDfParams['isEdit'] = $studentOnlinePaymentRequest->isEdit; | |
$userDfParams['linwaysTxnId'] = $clnt_txn_ref; | |
$userDfParams['enquiryLinwaysTxnId'] = $studentOnlinePaymentRequest->linwaysTransactionId; | |
$userDfParams['email'] = $admissionStudentDetails->email; | |
$userDfParams['phone'] = $admissionStudentDetails->mobilePhone; | |
$userDfParams['userName'] = $admissionStudentDetails->studentName; | |
$exePaymentReq->userdfParams = $userDfParams; | |
try{ | |
PaymentGatewayService::getInstance()->executePayment($exePaymentReq); | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, "Student Details are null for studentId=$studentOnlinePaymentRequest->studentId and coursetypeId = $studentOnlinePaymentRequest->courseTypeId"); | |
//error fetching data from PaymentReqInfo | |
} | |
} else { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, "Student Details are null for studentId=$studentOnlinePaymentRequest->studentId and coursetypeId = $studentOnlinePaymentRequest->courseTypeId"); | |
} | |
} | |
/** | |
* Make admission payment for a student | |
* | |
* @param StudentOnlinePaymentRequest $studentOnlinePaymentRequest | |
*/ | |
public function initiatePaymentB_TECH($studentOnlinePaymentRequest, $module = 'ADMISSION', $category = 'ALL') | |
{ | |
$studentOnlinePaymentRequest = $this->realEscapeObject($studentOnlinePaymentRequest); | |
$module = $this->realEscapeString($module); | |
$category = $this->realEscapeString($category); | |
$clnt_txn_ref = mt_rand(); | |
// Checking whether this student has alredy tried to make payment | |
$sql = "SELECT clnt_txn_ref FROM admission_student_online_payment_btech WHERE studentId = '$studentOnlinePaymentRequest->studentId'"; | |
$studentPayment = $this->executeQueryForObject($sql); | |
$amount = $studentOnlinePaymentRequest->amount; | |
$isEditFromParam = $studentOnlinePaymentRequest->isEdit ? '{from:stdEdit}' : ''; | |
if (empty($studentPayment)) { | |
$sql = "INSERT INTO admission_student_online_payment_btech (studentId, clnt_txn_ref, numberOfAttempts, status, applicationNo, admissionYear, dateOfTrasaction) VALUES('$studentOnlinePaymentRequest->studentId','$clnt_txn_ref', 1, '" . AdmissionPaymentStatus::PENDING . "', '" . $studentOnlinePaymentRequest->applicationNo . "', '" . $studentOnlinePaymentRequest->admissionYear . "','" . date("d-m-Y") . "')"; | |
} else { | |
$sql = "UPDATE admission_student_online_payment_btech SET clnt_txn_ref='$clnt_txn_ref', status = '" . AdmissionPaymentStatus::PENDING . "', dateOfTrasaction = \"" . date("d-m-Y") . "\" WHERE studentID = '$studentOnlinePaymentRequest->studentId'"; | |
} | |
// constructing payload | |
$payload = "rqst_type=T|tpsl_clnt_cd=" . AdmissionPaymentCredential::MERCHANT_ID . "|clnt_txn_ref=" . $clnt_txn_ref . "|clnt_rqst_meta={studentID:" . $studentOnlinePaymentRequest->studentId . "}$isEditFromParam{courseTypeID:" . $studentOnlinePaymentRequest->courseTypeId . "}|rqst_amnt=" . $amount . "|rqst_crncy=INR|rtrn_url=" . $studentOnlinePaymentRequest->returnURL . "|clnt_dt_tm=" . date("d-m-Y") . "|rqst_rqst_dtls=SCMS_" . $amount . "_0.00|tpsl_bank_cd=470"; | |
$this->executeQuery($sql); | |
$sql = "UPDATE admission_student_details SET paymentStatus = '" . AdmissionPaymentStatus::PENDING . "', paymentMethod = '" . AdmissionPaymentMode::ONLINE . "' WHERE studentID = $studentOnlinePaymentRequest->studentId "; | |
$this->executeQuery($sql); | |
$admissionStudentDetails = $this->getBtechStudentAdmissionDetails($studentOnlinePaymentRequest->courseTypeId, $studentOnlinePaymentRequest->studentId); | |
if (!empty($admissionStudentDetails)) { | |
$exePaymentReq = new ExecutePaymentRequest(); | |
$exePaymentReq->module = $module; | |
$exePaymentReq->category = $category; | |
$exePaymentReq->amount = $amount; | |
$exePaymentReq->currency = 'INR'; | |
// $exePaymentReq->reqMetaData = "{studentID:" . $studentOnlinePaymentRequest->studentId . "}$isEditFromParam{courseTypeID:" . $studentOnlinePaymentRequest->courseTypeId . "}"; | |
$exePaymentReq->returnURL = $studentOnlinePaymentRequest->returnURL; | |
$exePaymentReq->timeStamp = date("d-m-Y"); | |
$exePaymentReq->txnId = $clnt_txn_ref; | |
$exePaymentReq->productInfo = 'Admission Application Fee'; | |
$exePaymentReq->email = $admissionStudentDetails->email; | |
$exePaymentReq->phone = $admissionStudentDetails->mobilePhone; | |
$exePaymentReq->userName = $admissionStudentDetails->studentName;; | |
// $exePaymentReq->failureURL = $studentOnlinePaymentRequest->returnURL; | |
// $exePaymentReq->successURL = $studentOnlinePaymentRequest->returnURL; | |
// $exePaymentReq->address1 = $admissionStudentDetails->address1; | |
// $exePaymentReq->address2 = $admissionStudentDetails->address2; | |
// $exePaymentReq->city = $admissionStudentDetails->city; | |
// $exePaymentReq->country = $admissionStudentDetails->country; | |
// $exePaymentReq->zipcode = $admissionStudentDetails->zipcode; | |
$exePaymentReq->userId = $studentOnlinePaymentRequest->studentId; | |
$userDfParams = []; | |
$userDfParams['studentId'] = $studentOnlinePaymentRequest->studentId; | |
$userDfParams['courseTypeId'] = $studentOnlinePaymentRequest->courseTypeId; | |
$userDfParams['isEdit'] = $studentOnlinePaymentRequest->isEdit; | |
$exePaymentReq->userdfParams = $userDfParams; | |
PaymentGatewayService::getInstance()->executePayment($exePaymentReq); | |
} else { | |
throw new ProfessionalException(ProfessionalException::ADMISSION_INVALID_STUDENTDETAILS, "Student Details are null for studentId=$studentOnlinePaymentRequest->studentId and coursetypeId = $studentOnlinePaymentRequest->courseTypeId"); | |
} | |
} | |
/** | |
* Add ug student admission details | |
* | |
* @param AdmissionStudentDetailsUG $admissionStudentDetailsUG | |
* @return number | |
*/ | |
public function createUGStudentAdmissionDetails($courseTypeCode, $admissionStudentDetailsUG) | |
{ | |
$studentId = 0; | |
$configuresApplicationStartNo = 0; | |
$lastGeneratedApplicationNo = 0; | |
$applicationNo = 0; | |
$sql = ""; | |
$courseTypeCode = $this->realEscapeString($courseTypeCode); | |
$tenthMarkList = $admissionStudentDetailsUG->tenthMarkList; | |
$tenthMarkList = $tenthMarkList?$tenthMarkList:"[]"; | |
$admissionStudentDetailsUG = $this->realEscapeObject($admissionStudentDetailsUG); | |
if ($admissionStudentDetailsUG != NULL) { | |
// Generate application no corresponding to course type | |
// if no application created against coursetype and year then set application no as configured start application no | |
// else lastgeneratedapplicationno +1 | |
switch ($courseTypeCode) { | |
case CourseType::BCOM: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getLastGeneratedApplicationNo($admissionStudentDetailsUG->courseTypeId, $admissionStudentDetailsUG->admissionYear); | |
if ($lastGeneratedApplicationNo == NULL || $lastGeneratedApplicationNo == 0) { | |
$applicationNo = $configuresApplicationStartNo; | |
} else { | |
$applicationNo = ($lastGeneratedApplicationNo + 1); | |
} | |
break; | |
case CourseType::BA: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getLastGeneratedApplicationNo($admissionStudentDetailsUG->courseTypeId, $admissionStudentDetailsUG->admissionYear); | |
if ($lastGeneratedApplicationNo == NULL || $lastGeneratedApplicationNo == 0) { | |
$applicationNo = $configuresApplicationStartNo; | |
} else { | |
$applicationNo = ($lastGeneratedApplicationNo + 1); | |
} | |
break; | |
case CourseType::BCA: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getLastGeneratedApplicationNo($admissionStudentDetailsUG->courseTypeId, $admissionStudentDetailsUG->admissionYear); | |
if ($lastGeneratedApplicationNo == NULL || $lastGeneratedApplicationNo == 0) { | |
$applicationNo = $configuresApplicationStartNo; | |
} else { | |
$applicationNo = ($lastGeneratedApplicationNo + 1); | |
} | |
break; | |
case CourseType::BSC: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getLastGeneratedApplicationNo($admissionStudentDetailsUG->courseTypeId, $admissionStudentDetailsUG->admissionYear); | |
if ($lastGeneratedApplicationNo == NULL || $lastGeneratedApplicationNo == 0) { | |
$applicationNo = $configuresApplicationStartNo; | |
} else { | |
$applicationNo = ($lastGeneratedApplicationNo + 1); | |
} | |
break; | |
case CourseType::IMCA: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getLastGeneratedApplicationNo($admissionStudentDetailsUG->courseTypeId, $admissionStudentDetailsUG->admissionYear); | |
if ($lastGeneratedApplicationNo == NULL || $lastGeneratedApplicationNo == 0) { | |
$applicationNo = $configuresApplicationStartNo; | |
} else { | |
$applicationNo = ($lastGeneratedApplicationNo + 1); | |
} | |
break; | |
case CourseType::BTECH: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getLastGeneratedApplicationNo($admissionStudentDetailsUG->courseTypeId, $admissionStudentDetailsUG->admissionYear); | |
if ($lastGeneratedApplicationNo == NULL || $lastGeneratedApplicationNo == 0) { | |
$applicationNo = $configuresApplicationStartNo; | |
} else { | |
$applicationNo = ($lastGeneratedApplicationNo + 1); | |
} | |
break; | |
case CourseType::OTHER_UG: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getLastGeneratedApplicationNo($admissionStudentDetailsUG->courseTypeId, $admissionStudentDetailsUG->admissionYear); | |
if ($lastGeneratedApplicationNo == NULL || $lastGeneratedApplicationNo == 0) { | |
$applicationNo = $configuresApplicationStartNo; | |
} else { | |
$applicationNo = ($lastGeneratedApplicationNo + 1); | |
} | |
break; | |
case CourseType::BARCH: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getLastGeneratedApplicationNo($admissionStudentDetailsUG->courseTypeId, $admissionStudentDetailsUG->admissionYear); | |
if ($lastGeneratedApplicationNo == NULL || $lastGeneratedApplicationNo == 0) { | |
$applicationNo = $configuresApplicationStartNo; | |
} else { | |
$applicationNo = ($lastGeneratedApplicationNo + 1); | |
} | |
break; | |
case CourseType::BBA: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getLastGeneratedApplicationNo($admissionStudentDetailsUG->courseTypeId, $admissionStudentDetailsUG->admissionYear); | |
if ($lastGeneratedApplicationNo == NULL || $lastGeneratedApplicationNo == 0) { | |
$applicationNo = $configuresApplicationStartNo; | |
} else { | |
$applicationNo = ($lastGeneratedApplicationNo + 1); | |
} | |
break; | |
default: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getLastGeneratedApplicationNo($admissionStudentDetailsUG->courseTypeId, $admissionStudentDetailsUG->admissionYear); | |
break; | |
} | |
// Create application | |
// By default, payment status will be not paid | |
if (empty($admissionStudentDetailsUG->paymentStatus)) { | |
$paymentStatus = AdmissionPaymentStatus::NOT_PAID; | |
} else { | |
$paymentStatus = $admissionStudentDetailsUG->paymentStatus; | |
} | |
// | |
// if(empty($admissionStudentDetailsUG->paymentMode)) | |
// { | |
// $paymentMode = AdmissionPaymentMode::ONLINE; | |
// } | |
// else | |
// { | |
// $paymentMode = $admissionStudentDetailsUG->paymentMode; | |
// } | |
$sql = "INSERT INTO admission_student_details_ug(myimage, studentName, studentInitial, dateofbirth, gender, aadharNo, nationality, motherTongue, religion, caste, reservID, permahouse, permaplace, permastate, permacity, permataluk, permapin, commuhouse, commuplace, commustate, commucity, commutaluk, commupin, mobilePhone, studentResPhone, email, fatherName, fatherEmail, fatherOccupation, fatherMobile, motherName, motherEmail, motherOccupation, motherMobile, annualIncome, tenthSchool, tenthExam, tenthYear, tenthBoard, tenthPercent, tenthMarksObtained, tenthMaxMarks, twelthSchool, twelthExam, twelthYear, twelthBoard, twelthPercent, twelthMarksObtained, twelthMaxMarks, hostel_facility, otherAchievements, secondLanguage, admissionYear, courseTypeId, applicationFormTypeId, studentPassword,applicationNo,age,paymentStatus,paymentMethod,fatherQualification,motherQualification,twelthCombination,tenthCombination,tenthRegNo,twelthRegNo,gamesProficiency,boardingPoint,bus_facility,recommendation,placeOfBirth,entranceRegno,entranceScore,entranceRank,entranceName,entranceYear,entranceapplnno,entranceMark,entranceMark_phyche,entranceMark_maths,entrance_status, quotaID, state2, parentName, twelthAttempts, employeeCode, bloodGroup, height, idMarks, entranceMaxMark, maritalStatus, entranceMonth, twelthMonth, parentRelationship, parentEmail, parishName, panchayath, bankAccountNo, bankName, bankBranch, ifscNo, wardNo, diplomaExam, diplomaRegNo, diplomaMonth, diplomaYear, diplomaInst, diplomaMarksObtained, diplomaMaxMarks, diplomaPercent, isLateral, createdBy, createdDate, updatedBy, updatedDate, jurisdiction, nriName, nriRelationship, tcNo, tcDate, tcInstitution, isAtchivement, scholarship, isPhysicallyChallenged, diplomaBrach, otherEntranceName, otherEntranceRegno, otherEntranceApplicationNo, otherEntranceMarks, otherEntranceRank, parentMobile, specialCategory, priestName, parentPhone, parenthouse, parentplace, parentstate, parentcity, parenttaluk, parentpin, sportsName, sportsPartLevel, sportsPrizeWin, tenthMonth, tenthGrade, twelthGrade, married, parentOccupation, ktuStudentId, currentCollegeName, currentBranchId, currentSemId, admitSemId, entranceExamCenter, jeeEntranceRegno, jeeEntranceApplicationNo, jeeEntranceMarks, jeeEntranceRank, keeEntranceRegno, keeEntranceApplicationNo, keeEntranceMarks, keeEntranceRank, keeEntranceMark_maths, keeEntranceMark_phyche, diocese, isBPL, twelthBoardOther, studentEmail, studentExtras, taluk, country, otherCategoryName, appliedDate, appliedPlace, twelfthAdditionalSubject, signImage, arrears, nriSponsor, passportNo, passportValidity, visaDetails, referralSource, otherReferral, capId, tenthMarkDetails, tenthMarkList,isDiplomaCertificateObtained,reasonForNoDiplomaCertificate,parentSignature,icseUid,icseIndexNo,cbseSchoolNo,cbseCentreNo,cbseAdmitCardId) | |
VALUES | |
('$admissionStudentDetailsUG->myimage', '$admissionStudentDetailsUG->studentName', '$admissionStudentDetailsUG->studentInitial', '$admissionStudentDetailsUG->dateofbirth', '$admissionStudentDetailsUG->gender', '$admissionStudentDetailsUG->aadharNo', '$admissionStudentDetailsUG->nationality', '$admissionStudentDetailsUG->motherTongue', '$admissionStudentDetailsUG->religion', '$admissionStudentDetailsUG->caste', '$admissionStudentDetailsUG->reservId', '$admissionStudentDetailsUG->permahouse', '$admissionStudentDetailsUG->permaplace', '$admissionStudentDetailsUG->permastate', '$admissionStudentDetailsUG->permacity', '$admissionStudentDetailsUG->permataluk', '$admissionStudentDetailsUG->permapin', '$admissionStudentDetailsUG->commuhouse', '$admissionStudentDetailsUG->commuplace', '$admissionStudentDetailsUG->commustate', '$admissionStudentDetailsUG->commucity', '$admissionStudentDetailsUG->commutaluk', '$admissionStudentDetailsUG->commupin', '$admissionStudentDetailsUG->mobilePhone', '$admissionStudentDetailsUG->studentResPhone', '$admissionStudentDetailsUG->email', '$admissionStudentDetailsUG->fatherName', '$admissionStudentDetailsUG->fatherEmail', '$admissionStudentDetailsUG->fatherOccupation', '$admissionStudentDetailsUG->fatherMobile', '$admissionStudentDetailsUG->motherName', '$admissionStudentDetailsUG->motherEmail', '$admissionStudentDetailsUG->motherOccupation', '$admissionStudentDetailsUG->motherMobile', '$admissionStudentDetailsUG->annualIncome', '$admissionStudentDetailsUG->tenthSchool', '$admissionStudentDetailsUG->tenthExam', '$admissionStudentDetailsUG->tenthYear', '$admissionStudentDetailsUG->tenthBoard', '$admissionStudentDetailsUG->tenthPercent', '$admissionStudentDetailsUG->tenthMarksObtained', '$admissionStudentDetailsUG->tenthMaxMarks', '$admissionStudentDetailsUG->twelthSchool', '$admissionStudentDetailsUG->twelthExam', '$admissionStudentDetailsUG->twelthYear', '$admissionStudentDetailsUG->twelthBoardId', '$admissionStudentDetailsUG->twelthPercent', '$admissionStudentDetailsUG->twelthMarksObtained', '$admissionStudentDetailsUG->twelthMaxMarks', '$admissionStudentDetailsUG->hostel_facility', '$admissionStudentDetailsUG->otherAchievements', '$admissionStudentDetailsUG->secondLanguage','$admissionStudentDetailsUG->admissionYear', '$admissionStudentDetailsUG->courseTypeId', '$admissionStudentDetailsUG->applicationFormTypeId', md5('$admissionStudentDetailsUG->studentPassword'), '$applicationNo', '$admissionStudentDetailsUG->age', '$paymentStatus', '$paymentMode', '$admissionStudentDetailsUG->fatherQualification' ,'$admissionStudentDetailsUG->motherQualification', '$admissionStudentDetailsUG->twelthCombination', '$admissionStudentDetailsUG->tenthCombination', '$admissionStudentDetailsUG->tenthRegNo', '$admissionStudentDetailsUG->twelthRegNo', '$admissionStudentDetailsUG->gamesProficiency', '$admissionStudentDetailsUG->boardingPoint', '$admissionStudentDetailsUG->bus_facility', '$admissionStudentDetailsUG->recommendation', '$admissionStudentDetailsUG->placeOfBirth', '$admissionStudentDetailsUG->entranceRegno', '$admissionStudentDetailsUG->entranceScore', '$admissionStudentDetailsUG->entranceRank', '$admissionStudentDetailsUG->entranceName', '$admissionStudentDetailsUG->entranceYear', '$admissionStudentDetailsUG->entranceapplnno', '$admissionStudentDetailsUG->entranceMark', '$admissionStudentDetailsUG->entranceMark_phyche', '$admissionStudentDetailsUG->entranceMark_maths', '$admissionStudentDetailsUG->entrance_status', '$admissionStudentDetailsUG->quotaID', '$admissionStudentDetailsUG->state2', '$admissionStudentDetailsUG->parentName', '$admissionStudentDetailsUG->twelthAttempts', '$admissionStudentDetailsUG->employeeCode', '$admissionStudentDetailsUG->bloodGroup', '$admissionStudentDetailsUG->height', '$admissionStudentDetailsUG->idMarks', '$admissionStudentDetailsUG->entranceMaxMark', '$admissionStudentDetailsUG->maritalStatus', '$admissionStudentDetailsUG->entranceMonth', '$admissionStudentDetailsUG->twelthMonth', '$admissionStudentDetailsUG->parentRelationship', '$admissionStudentDetailsUG->parentEmail', '$admissionStudentDetailsUG->parishName', '$admissionStudentDetailsUG->panchayath', '$admissionStudentDetailsUG->bankAccountNo', '$admissionStudentDetailsUG->bankName', '$admissionStudentDetailsUG->bankBranch', '$admissionStudentDetailsUG->ifscNo', '$admissionStudentDetailsUG->wardNo', '$admissionStudentDetailsUG->diplomaExam', '$admissionStudentDetailsUG->diplomaRegNo', '$admissionStudentDetailsUG->diplomaMonth', '$admissionStudentDetailsUG->diplomaYear', '$admissionStudentDetailsUG->diplomaInst', '$admissionStudentDetailsUG->diplomaMarksObtained', '$admissionStudentDetailsUG->diplomaMaxMarks', '$admissionStudentDetailsUG->diplomaPercent', '$admissionStudentDetailsUG->isLateral', '$admissionStudentDetailsUG->createdBy', utc_timestamp(), '$admissionStudentDetailsUG->updatedBy', utc_timestamp(), '$admissionStudentDetailsUG->jurisdiction', '$admissionStudentDetailsUG->nriName', '$admissionStudentDetailsUG->nriRelationship', '$admissionStudentDetailsUG->tcNo', '$admissionStudentDetailsUG->tcDate', '$admissionStudentDetailsUG->tcInstitution', '$admissionStudentDetailsUG->isAtchivement', '$admissionStudentDetailsUG->scholarship', '$admissionStudentDetailsUG->isPhysicallyChallenged', '$admissionStudentDetailsUG->diplomaBrach','$admissionStudentDetailsUG->otherEntranceName', '$admissionStudentDetailsUG->otherEntranceRegno', '$admissionStudentDetailsUG->otherEntranceApplicationNo', '$admissionStudentDetailsUG->otherEntranceMarks', '$admissionStudentDetailsUG->otherEntranceRank', '$admissionStudentDetailsUG->parentMobile', '$admissionStudentDetailsUG->specialCategory', '$admissionStudentDetailsUG->priestName', '$admissionStudentDetailsUG->parentPhone', '$admissionStudentDetailsUG->parenthouse', '$admissionStudentDetailsUG->parentplace', '$admissionStudentDetailsUG->parentstate', '$admissionStudentDetailsUG->parentcity', '$admissionStudentDetailsUG->parenttaluk', '$admissionStudentDetailsUG->parentpin', '$admissionStudentDetailsUG->sportsName', '$admissionStudentDetailsUG->sportsPartLevel', '$admissionStudentDetailsUG->sportsPrizeWin', '$admissionStudentDetailsUG->tenthMonth', '$admissionStudentDetailsUG->tenthGrade', '$admissionStudentDetailsUG->twelthGrade', '$admissionStudentDetailsUG->married', '$admissionStudentDetailsUG->parentOccupation', '$admissionStudentDetailsUG->ktuStudentId', '$admissionStudentDetailsUG->currentCollegeName', '$admissionStudentDetailsUG->currentBranchId', '$admissionStudentDetailsUG->currentSemId', '$admissionStudentDetailsUG->admitSemId', '$admissionStudentDetailsUG->entranceExamCenter', '$admissionStudentDetailsUG->jeeEntranceRegno', '$admissionStudentDetailsUG->jeeEntranceApplicationNo', '$admissionStudentDetailsUG->jeeEntranceMarks', '$admissionStudentDetailsUG->jeeEntranceRank', '$admissionStudentDetailsUG->keeEntranceRegno', '$admissionStudentDetailsUG->keeEntranceApplicationNo', '$admissionStudentDetailsUG->keeEntranceMarks', '$admissionStudentDetailsUG->keeEntranceRank', '$admissionStudentDetailsUG->keeEntranceMark_maths', '$admissionStudentDetailsUG->keeEntranceMark_phyche', '$admissionStudentDetailsUG->diocese', '$admissionStudentDetailsUG->isBPL', '$admissionStudentDetailsUG->twelthBoardOther', '$admissionStudentDetailsUG->studentEmail', '$admissionStudentDetailsUG->studentExtras','$admissionStudentDetailsUG->taluk','$admissionStudentDetailsUG->country','$admissionStudentDetailsUG->otherCategoryName','$admissionStudentDetailsUG->appliedDate','$admissionStudentDetailsUG->appliedPlace', '$admissionStudentDetailsUG->twelfthAdditionalSubject', '$admissionStudentDetailsUG->signImage', '$admissionStudentDetailsUG->arrears', '$admissionStudentDetailsUG->nriSponsor', '$admissionStudentDetailsUG->passportNo', '$admissionStudentDetailsUG->passportValidity', '$admissionStudentDetailsUG->visaDetails', '$admissionStudentDetailsUG->referralSource', '$admissionStudentDetailsUG->otherReferral', '$admissionStudentDetailsUG->capId', '$admissionStudentDetailsUG->tenthMarkDetails', '$tenthMarkList','$admissionStudentDetailsUG->isDiplomaCertificateObtained','$admissionStudentDetailsUG->reasonForNoDiplomaCertificate','$admissionStudentDetailsUG->Parentsignature','$admissionStudentDetailsUG->icseUid','$admissionStudentDetailsUG->icseIndexNo','$admissionStudentDetailsUG->cbseSchoolNo','$admissionStudentDetailsUG->cbseCentreNo','$admissionStudentDetailsUG->cbseAdmitCardId')"; | |
try { | |
$studentId = $this->executeQueryForObject($sql, true); | |
if(!$studentId) | |
{ | |
$logger = AMSLogger::getLogger(); | |
$logger->info(Events::ADMISSION_APPLICATION_GENERATION_ISSUE, ["query" => $sql]); | |
} | |
// Delete existing branchpreference if any | |
$this->deleteBranchPrefOfUGByStudentId($studentId); | |
// create branchprefernce | |
$this->createBranchPrefOfUG($admissionStudentDetailsUG->admissionStudentBranchPreference, $studentId); | |
if (!empty($admissionStudentDetailsUG->studentExamMarks)) { | |
$this->addStudentMarksUg($admissionStudentDetailsUG->studentExamMarks, $studentId); | |
} | |
} catch (\Exception $e) { | |
$logger = AMSLogger::getLogger(); | |
$logger->info(Events::ADMISSION_APPLICATION_GENERATION_ISSUE, ["query" => $sql]); | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} else { | |
$logger = AMSLogger::getLogger(); | |
$logger->info(Events::ADMISSION_APPLICATION_GENERATION_ISSUE, ["admissionStudentDetailsUG" => $admissionStudentDetailsUG]); | |
throw new ProfessionalException(ProfessionalException::INVALID_REQUEST, "Request is not valid or null."); | |
} | |
return $studentId; | |
} | |
/** | |
* update ug student admission details | |
* | |
* @param AdmissionStudentDetailsUG $admissionStudentDetailsUG | |
* @return number | |
*/ | |
public function updateUGStudentAdmissionDetails($admissionStudentDetailsUG) | |
{ | |
$tenthMarkList = $admissionStudentDetailsUG->tenthMarkList?$admissionStudentDetailsUG->tenthMarkList:"[]"; | |
$admissionStudentDetailsUG = $this->realEscapeObject($admissionStudentDetailsUG); | |
$sql = ""; | |
if ($admissionStudentDetailsUG != NULL) { | |
$studentId = $admissionStudentDetailsUG->studentId; | |
// update application | |
$sql = "UPDATE admission_student_details_ug SET | |
myimage= '$admissionStudentDetailsUG->myimage', | |
studentName = '$admissionStudentDetailsUG->studentName', | |
studentInitial = '$admissionStudentDetailsUG->studentInitial', | |
dateofbirth = '$admissionStudentDetailsUG->dateofbirth', | |
gender = '$admissionStudentDetailsUG->gender', | |
aadharNo = '$admissionStudentDetailsUG->aadharNo', | |
nationality = '$admissionStudentDetailsUG->nationality', | |
motherTongue = '$admissionStudentDetailsUG->motherTongue', | |
religion = '$admissionStudentDetailsUG->religion', | |
caste = '$admissionStudentDetailsUG->caste', | |
reservID = '$admissionStudentDetailsUG->reservId', | |
permahouse = '$admissionStudentDetailsUG->permahouse', | |
permaplace = '$admissionStudentDetailsUG->permaplace', | |
permastate = '$admissionStudentDetailsUG->permastate', | |
permacity = '$admissionStudentDetailsUG->permacity', | |
permataluk = '$admissionStudentDetailsUG->permataluk', | |
permapin = '$admissionStudentDetailsUG->permapin', | |
commuhouse = '$admissionStudentDetailsUG->commuhouse', | |
commuplace = '$admissionStudentDetailsUG->commuplace', | |
commustate = '$admissionStudentDetailsUG->commustate', | |
commucity = '$admissionStudentDetailsUG->commucity', | |
commutaluk = '$admissionStudentDetailsUG->commutaluk', | |
commupin = '$admissionStudentDetailsUG->commupin', | |
mobilePhone = '$admissionStudentDetailsUG->mobilePhone', | |
studentResPhone = '$admissionStudentDetailsUG->studentResPhone', | |
fatherName = '$admissionStudentDetailsUG->fatherName', | |
fatherEmail= '$admissionStudentDetailsUG->fatherEmail', | |
fatherOccupation = '$admissionStudentDetailsUG->fatherOccupation', | |
fatherQualification = '$admissionStudentDetailsUG->fatherQualification', | |
fatherMobile = '$admissionStudentDetailsUG->fatherMobile', | |
motherName = '$admissionStudentDetailsUG->motherName', | |
motherEmail = '$admissionStudentDetailsUG->motherEmail', | |
motherQualification = '$admissionStudentDetailsUG->motherQualification', | |
motherOccupation = '$admissionStudentDetailsUG->motherOccupation', | |
motherMobile = '$admissionStudentDetailsUG->motherMobile', | |
annualIncome = '$admissionStudentDetailsUG->annualIncome', | |
tenthSchool = '$admissionStudentDetailsUG->tenthSchool', | |
tenthExam = '$admissionStudentDetailsUG->tenthExam', | |
tenthYear = '$admissionStudentDetailsUG->tenthYear', | |
tenthBoard = '$admissionStudentDetailsUG->tenthBoard', | |
tenthCombination = '$admissionStudentDetailsUG->tenthCombination', | |
tenthPercent = '$admissionStudentDetailsUG->tenthPercent', | |
tenthMarksObtained = '$admissionStudentDetailsUG->tenthMarksObtained', | |
tenthMaxMarks = '$admissionStudentDetailsUG->tenthMaxMarks', | |
twelthSchool = '$admissionStudentDetailsUG->twelthSchool', | |
twelthExam = '$admissionStudentDetailsUG->twelthExam', | |
twelthCombination = '$admissionStudentDetailsUG->twelthCombination', | |
twelthYear = '$admissionStudentDetailsUG->twelthYear', | |
twelthBoard = '$admissionStudentDetailsUG->twelthBoardId', | |
twelthPercent = '$admissionStudentDetailsUG->twelthPercent', | |
twelthMarksObtained = '$admissionStudentDetailsUG->twelthMarksObtained', | |
twelthMaxMarks = '$admissionStudentDetailsUG->twelthMaxMarks', | |
hostel_facility = '$admissionStudentDetailsUG->hostel_facility', | |
otherAchievements = '$admissionStudentDetailsUG->otherAchievements', | |
secondLanguage = '$admissionStudentDetailsUG->secondLanguage', | |
tenthRegNo = '$admissionStudentDetailsUG->tenthRegNo', | |
twelthRegNo = '$admissionStudentDetailsUG->twelthRegNo', | |
updatedBy = '$admissionStudentDetailsUG->updatedBy', | |
updatedDate = utc_timestamp(), | |
age = '$admissionStudentDetailsUG->age', | |
gamesProficiency = '$admissionStudentDetailsUG->gamesProficiency', | |
boardingPoint = '$admissionStudentDetailsUG->boardingPoint', | |
bus_facility = '$admissionStudentDetailsUG->bus_facility', | |
recommendation = '$admissionStudentDetailsUG->recommendation', | |
placeOfBirth ='$admissionStudentDetailsUG->placeOfBirth', | |
entranceRegno = '$admissionStudentDetailsUG->entranceRegno', | |
entranceScore = '$admissionStudentDetailsUG->entranceScore', | |
entranceRank = '$admissionStudentDetailsUG->entranceRank', | |
entranceName = '$admissionStudentDetailsUG->entranceName', | |
entranceYear = '$admissionStudentDetailsUG->entranceYear', | |
entranceapplnno = '$admissionStudentDetailsUG->entranceapplnno', | |
entranceMark = '$admissionStudentDetailsUG->entranceMark', | |
entranceMark_phyche = '$admissionStudentDetailsUG->entranceMark_phyche', | |
entranceMark_maths = '$admissionStudentDetailsUG->entranceMark_maths', | |
entrance_status = '$admissionStudentDetailsUG->entrance_status', | |
quotaID = '$admissionStudentDetailsUG->quotaID', | |
state2 = '$admissionStudentDetailsUG->state2', | |
parentName = '$admissionStudentDetailsUG->parentName', | |
twelthAttempts = '$admissionStudentDetailsUG->twelthAttempts', | |
employeeCode = '$admissionStudentDetailsUG->employeeCode', | |
bloodGroup = '$admissionStudentDetailsUG->bloodGroup', | |
height = '$admissionStudentDetailsUG->height', | |
idMarks = '$admissionStudentDetailsUG->idMarks', | |
entranceMaxMark = '$admissionStudentDetailsUG->entranceMaxMark', | |
maritalStatus = '$admissionStudentDetailsUG->maritalStatus', | |
entranceMonth = '$admissionStudentDetailsUG->entranceMonth', | |
twelthMonth = '$admissionStudentDetailsUG->twelthMonth', | |
parentRelationship = '$admissionStudentDetailsUG->parentRelationship', | |
parentEmail = '$admissionStudentDetailsUG->parentEmail', | |
parishName = '$admissionStudentDetailsUG->parishName', | |
panchayath = '$admissionStudentDetailsUG->panchayath', | |
bankAccountNo = '$admissionStudentDetailsUG->bankAccountNo', | |
bankName = '$admissionStudentDetailsUG->bankName', | |
bankBranch = '$admissionStudentDetailsUG->bankBranch', | |
ifscNo = '$admissionStudentDetailsUG->ifscNo', | |
wardNo = '$admissionStudentDetailsUG->wardNo', | |
diplomaExam = '$admissionStudentDetailsUG->diplomaExam', | |
diplomaRegNo = '$admissionStudentDetailsUG->diplomaRegNo', | |
diplomaMonth = '$admissionStudentDetailsUG->diplomaMonth', | |
diplomaYear = '$admissionStudentDetailsUG->diplomaYear', | |
diplomaInst = '$admissionStudentDetailsUG->diplomaInst', | |
diplomaMarksObtained = '$admissionStudentDetailsUG->diplomaMarksObtained', | |
diplomaMaxMarks = '$admissionStudentDetailsUG->diplomaMaxMarks', | |
diplomaPercent = '$admissionStudentDetailsUG->diplomaPercent', | |
isLateral = '$admissionStudentDetailsUG->isLateral', | |
jurisdiction = '$admissionStudentDetailsUG->jurisdiction', | |
nriName = '$admissionStudentDetailsUG->nriName', | |
nriRelationship = '$admissionStudentDetailsUG->nriRelationship', | |
tcNo = '$admissionStudentDetailsUG->tcNo', | |
tcDate = '$admissionStudentDetailsUG->tcDate', | |
tcInstitution = '$admissionStudentDetailsUG->tcInstitution', | |
isAtchivement = '$admissionStudentDetailsUG->isAtchivement', | |
scholarship = '$admissionStudentDetailsUG->scholarship', | |
isPhysicallyChallenged = '$admissionStudentDetailsUG->isPhysicallyChallenged', | |
diplomaBrach = '$admissionStudentDetailsUG->diplomaBrach', | |
otherEntranceName = '$admissionStudentDetailsUG->otherEntranceName', | |
otherEntranceRegno = '$admissionStudentDetailsUG->otherEntranceRegno', | |
otherEntranceApplicationNo = '$admissionStudentDetailsUG->otherEntranceApplicationNo', | |
otherEntranceMarks = '$admissionStudentDetailsUG->otherEntranceMarks', | |
otherEntranceRank = '$admissionStudentDetailsUG->otherEntranceRank', | |
parentMobile = '$admissionStudentDetailsUG->parentMobile', | |
specialCategory = '$admissionStudentDetailsUG->specialCategory', | |
priestName = '$admissionStudentDetailsUG->priestName', | |
parentPhone = '$admissionStudentDetailsUG->parentPhone', | |
parenthouse = '$admissionStudentDetailsUG->parenthouse', | |
parentplace = '$admissionStudentDetailsUG->parentplace', | |
parentstate = '$admissionStudentDetailsUG->parentstate', | |
parentcity = '$admissionStudentDetailsUG->parentcity', | |
parenttaluk = '$admissionStudentDetailsUG->parenttaluk', | |
parentpin = '$admissionStudentDetailsUG->parentpin', | |
sportsName = '$admissionStudentDetailsUG->sportsName', | |
sportsPartLevel = '$admissionStudentDetailsUG->sportsPartLevel', | |
sportsPrizeWin = '$admissionStudentDetailsUG->sportsPrizeWin', | |
tenthMonth = '$admissionStudentDetailsUG->tenthMonth', | |
tenthGrade = '$admissionStudentDetailsUG->tenthGrade', | |
twelthGrade = '$admissionStudentDetailsUG->twelthGrade', | |
married = '$admissionStudentDetailsUG->married', | |
parentOccupation = '$admissionStudentDetailsUG->parentOccupation', | |
ktuStudentId = '$admissionStudentDetailsUG->ktuStudentId', | |
currentCollegeName = '$admissionStudentDetailsUG->currentCollegeName', | |
currentBranchId = '$admissionStudentDetailsUG->currentBranchId', | |
currentSemId = '$admissionStudentDetailsUG->currentSemId', | |
admitSemId = '$admissionStudentDetailsUG->admitSemId', | |
entranceExamCenter = '$admissionStudentDetailsUG->entranceExamCenter', | |
jeeEntranceRegno = '$admissionStudentDetailsUG->jeeEntranceRegno', | |
jeeEntranceApplicationNo ='$admissionStudentDetailsUG->jeeEntranceApplicationNo', | |
jeeEntranceMarks ='$admissionStudentDetailsUG->jeeEntranceMarks', | |
jeeEntranceRank ='$admissionStudentDetailsUG->jeeEntranceRank', | |
keeEntranceRegno ='$admissionStudentDetailsUG->keeEntranceRegno', | |
keeEntranceApplicationNo ='$admissionStudentDetailsUG->keeEntranceApplicationNo', | |
keeEntranceMarks ='$admissionStudentDetailsUG->keeEntranceMarks', | |
keeEntranceRank ='$admissionStudentDetailsUG->keeEntranceRank', | |
keeEntranceMark_maths ='$admissionStudentDetailsUG->keeEntranceMark_maths', | |
keeEntranceMark_phyche ='$admissionStudentDetailsUG->keeEntranceMark_phyche', | |
diocese ='$admissionStudentDetailsUG->diocese', | |
isBPL ='$admissionStudentDetailsUG->isBPL', | |
twelthBoardOther = '$admissionStudentDetailsUG->twelthBoardOther', | |
studentEmail = '$admissionStudentDetailsUG->studentEmail', | |
studentExtras = '$admissionStudentDetailsUG->studentExtras', | |
disableEdit = '" . ($admissionStudentDetailsUG->disableEdit ? 1 : 0) . "', | |
taluk='$admissionStudentDetailsUG->taluk', | |
country='$admissionStudentDetailsUG->country', | |
otherCategoryName='$admissionStudentDetailsUG->otherCategoryName', | |
appliedDate='$admissionStudentDetailsUG->appliedDate', | |
appliedPlace='$admissionStudentDetailsUG->appliedPlace', | |
twelfthAdditionalSubject='$admissionStudentDetailsUG->twelfthAdditionalSubject', | |
signImage='$admissionStudentDetailsUG->signImage', | |
parentSignature='$admissionStudentDetailsUG->Parentsignature', | |
arrears='$admissionStudentDetailsUG->arrears', | |
nriSponsor='$admissionStudentDetailsUG->nriSponsor', | |
passportNo='$admissionStudentDetailsUG->passportNo', | |
passportValidity='$admissionStudentDetailsUG->passportValidity', | |
visaDetails='$admissionStudentDetailsUG->visaDetails', | |
referralSource='$admissionStudentDetailsUG->referralSource', | |
otherReferral='$admissionStudentDetailsUG->otherReferral', | |
capId='$admissionStudentDetailsUG->capId', | |
tenthMarkDetails='$admissionStudentDetailsUG->tenthMarkDetails', | |
tenthMarkList='$tenthMarkList', | |
isDiplomaCertificateObtained='$admissionStudentDetailsUG->isDiplomaCertificateObtained', | |
reasonForNoDiplomaCertificate ='$admissionStudentDetailsUG->reasonForNoDiplomaCertificate', | |
icseUid='$admissionStudentDetailsUG->icseUid', | |
icseIndexNo='$admissionStudentDetailsUG->icseIndexNo', | |
cbseSchoolNo='$admissionStudentDetailsUG->cbseSchoolNo', | |
cbseCentreNo='$admissionStudentDetailsUG->cbseCentreNo', | |
cbseAdmitCardId ='$admissionStudentDetailsUG->cbseAdmitCardId', | |
transactionId_or_referenceNo = '$admissionStudentDetailsUG->transactionIdOrReferenceNo' | |
WHERE studentID = $studentId"; | |
try { | |
$this->executeQuery($sql); | |
// Delete existing branchpreference if any | |
$this->deleteBranchPrefOfUGByStudentId($studentId); | |
// create branchprefernce | |
$this->createBranchPrefOfUG($admissionStudentDetailsUG->admissionStudentBranchPreference, $studentId); | |
if (!empty($admissionStudentDetailsUG->studentExamMarks)) { | |
$this->deleteStudentMarksUg($studentId, $admissionStudentDetailsUG->twelthBoardId); | |
$this->addStudentMarksUg($admissionStudentDetailsUG->studentExamMarks, $studentId); | |
} | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} else { | |
throw new ProfessionalException(ProfessionalException::INVALID_REQUEST, "Request is not valid or null."); | |
} | |
} | |
/** | |
* create branch preference | |
* | |
* @param array $branchPrefList | |
* @param int $studentId | |
* @return boolean | |
* @throws ProfessionalException | |
*/ | |
public function createBranchPrefOfUG($branchPrefList, $studentId) | |
{ | |
if ($branchPrefList) { | |
$sql = "INSERT INTO admission_student_branch_preference_ug (studentId,deptId,deptPrefNo,createdBy,createdDate,updatedBy,updatedDate) VALUES "; | |
$values = NULL; | |
foreach ($branchPrefList as $branchPref) { | |
$values .= $values == NULL ? " ($studentId,$branchPref->deptId,$branchPref->deptPrefNo,$studentId,utc_timestamp(),$studentId,utc_timestamp())" : " , ($studentId,$branchPref->deptId,$branchPref->deptPrefNo,$studentId,utc_timestamp(),$studentId,utc_timestamp())"; | |
} | |
$sql .= $values; | |
try { | |
$result = $this->executeQuery($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
return true; | |
} | |
/** | |
* create branch preference | |
* | |
* @param array $branchPrefList | |
* @param int $studentId | |
* @return boolean | |
* @throws ProfessionalException | |
*/ | |
public function createBranchPrefOfPG($branchPrefList, $studentId) | |
{ | |
if ($branchPrefList) { | |
$sql = "INSERT INTO admission_student_branch_preference_pg (studentId,deptId,deptPrefNo,createdBy,createdDate,updatedBy,updatedDate) VALUES "; | |
$values = NULL; | |
foreach ($branchPrefList as $branchPref) { | |
$values .= $values == NULL ? " ($studentId,$branchPref->deptId,$branchPref->deptPrefNo,$studentId,utc_timestamp(),$studentId,utc_timestamp())" : " , ($studentId,$branchPref->deptId,$branchPref->deptPrefNo,$studentId,utc_timestamp(),$studentId,utc_timestamp())"; | |
} | |
$sql .= $values; | |
try { | |
$result = $this->executeQuery($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
return true; | |
} | |
/** | |
* update Pg student admission details | |
* | |
* @param int $studentId | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getBranchPrefOfPG($studentId) | |
{ | |
$branchPrefList = NULL; | |
try { | |
$sql = "SELECT pref.studentId,pref.deptId,pref.deptPrefNo, dept.deptName, dept.departmentDesc FROM admission_student_branch_preference_pg pref inner join department dept on pref.deptId = dept.deptID | |
WHERE studentID = $studentId order by pref.deptPrefNo"; | |
$branchPrefList = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $branchPrefList; | |
} | |
/** | |
* update ug student admission details | |
* | |
* @param int $studentId | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getBranchPrefOfUG($studentId) | |
{ | |
$branchPrefList = NULL; | |
try { | |
$sql = "SELECT pref.studentId,pref.deptId,pref.deptPrefNo, dept.deptName, dept.departmentDesc FROM admission_student_branch_preference_ug pref inner join department dept on pref.deptId = dept.deptID | |
WHERE studentID = $studentId order by pref.deptPrefNo"; | |
$branchPrefList = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $branchPrefList; | |
} | |
/** | |
* delete branch preference by studentId | |
* | |
* @param int $studentId | |
* @return \com\linways\base\dto\MySqlResult | |
* @throws ProfessionalException | |
*/ | |
public function deleteBranchPrefOfUGByStudentId($studentId) | |
{ | |
$sql = "DELETE FROM admission_student_branch_preference_ug WHERE studentId = $studentId "; | |
try { | |
return $this->executeQuery($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* delete branch preference by studentId | |
* | |
* @param int $studentId | |
* @return \com\linways\base\dto\MySqlResult | |
* @throws ProfessionalException | |
*/ | |
public function deleteBranchPrefOfPGByStudentId($studentId) | |
{ | |
$sql = "DELETE FROM admission_student_branch_preference_pg WHERE studentId = $studentId "; | |
try { | |
return $this->executeQuery($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* get admission religion | |
* | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getAdmissionReligion() | |
{ | |
$religion = NULL; | |
$sql = "SELECT religionID, religionName from admission_religion"; | |
try { | |
$religion = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $religion; | |
} | |
/** | |
* get admission student reservation | |
* | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getStudentReservation() | |
{ | |
$reservation = NULL; | |
$sql = "select reservID,reservName from student_reservation"; | |
try { | |
$reservation = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $reservation; | |
} | |
/** | |
* get admission student reservation by reservation id | |
* | |
* @param int $id | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getStudentReservationById($id) | |
{ | |
$reservation = NULL; | |
$sql = "select reservID,reservName from student_reservation WHERE reservID=$id"; | |
try { | |
$reservation = $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $reservation; | |
} | |
/** | |
* get admission community | |
* | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getAdmissionCommunity() | |
{ | |
$community = NULL; | |
$sql = "SELECT communityID, communityName from admission_community"; | |
try { | |
$community = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $community; | |
} | |
/** | |
* check whether student email present or not | |
* | |
* @param string $email | |
* @return boolean | |
* @throws ProfessionalException | |
*/ | |
public function checkAdmissionLoginEmailUG($email, $courseTypeId, $admissionYear,$formTypeId = null) | |
{ | |
$flag = FALSE; | |
$condition = ""; | |
if($formTypeId){ | |
$condition = " AND applicationFormTypeId = '$formTypeId'"; | |
} | |
$sql = "SELECT email FROM admission_student_details_ug WHERE email = '$email' and courseTypeId='$courseTypeId' AND admissionYear = '$admissionYear'".$condition.""; | |
try { | |
$loginDetails = $this->executeQueryForObject($sql)->email; | |
if ($loginDetails) { | |
$flag = TRUE; | |
} | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $flag; | |
} | |
/** | |
* check whether student email present or not | |
* | |
* @param string $email | |
* @return boolean | |
* @throws ProfessionalException | |
*/ | |
public function checkAdmissionLoginEmailBTECH($email, $courseTypeId, $admissionYear) | |
{ | |
$flag = FALSE; | |
$sql = "SELECT email FROM admission_student_details WHERE email = '$email' and courseTypeId='$courseTypeId' AND admissionYear = '$admissionYear'"; | |
try { | |
$loginDetails = $this->executeQueryForObject($sql)->email; | |
if ($loginDetails) { | |
$flag = TRUE; | |
} | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $flag; | |
} | |
/** | |
* check whether student email present or not | |
* | |
* @param string $email | |
* @return boolean | |
* @throws ProfessionalException | |
*/ | |
public function checkAdmissionLoginEmailPG($email, $courseTypeId, $admissionYear) | |
{ | |
$flag = FALSE; | |
$sql = "SELECT email FROM admission_student_details_pg_affiliated WHERE email = '$email' and courseTypeId='$courseTypeId' AND admissionYear = '$admissionYear'"; | |
try { | |
$loginDetails = $this->executeQueryForObject($sql)->email; | |
if ($loginDetails) { | |
$flag = TRUE; | |
} | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $flag; | |
} | |
/** | |
* get admission board exam types | |
* | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getAdmissionBoardExamType() | |
{ | |
$boardExam = NULL; | |
$sql = "SELECT typeID, typeName from admission_boardexam_type order by typeID asc"; | |
try { | |
$boardExam = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $boardExam; | |
} | |
/** | |
* Get Application Start No of given courseType | |
* | |
* @param string $courseTypeCode | |
* @return string | |
* @throws ProfessionalException | |
*/ | |
public function getApplicationStartNo($courseTypeCode) | |
{ | |
$applicationStartNo = NULL; | |
$settings_name = NULL; | |
switch ($courseTypeCode) { | |
case CourseType::BCOM: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_BCOM; | |
break; | |
case CourseType::BCA: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_BCA; | |
break; | |
case CourseType::MTECH: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_MTECH; | |
break; | |
case CourseType::BTECH: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_BTECH; | |
break; | |
case CourseType::MBA: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_MBA; | |
break; | |
case CourseType::BA: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_BA; | |
break; | |
case CourseType::IMCA: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_IMCA; | |
break; | |
case CourseType::BSC: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_BSC; | |
break; | |
case CourseType::MCA: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_MCA; | |
break; | |
case CourseType::MSC: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_MSC; | |
break; | |
case CourseType::MARCH: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_MARCH; | |
break; | |
case CourseType::BARCH: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_BARCH; | |
break; | |
case CourseType::OTHER_UG: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_OTHER_UG; | |
break; | |
case CourseType::BBA: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_BBA; | |
break; | |
case CourseType::BCA: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_BCA; | |
break; | |
case CourseType::BDES: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_BDES; | |
break; | |
case CourseType::MPLAN: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_MPLAN; | |
break; | |
case CourseType::PGDM: | |
$settings_name = AdmissionConstants::APPLICATION_START_NO_MBA; | |
break; | |
default: | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
break; | |
} | |
try { | |
$applicationStartNo = CommonService::getInstance()->getSettings(AdmissionConstants::SETTINGS_TYPE_ADMISSION_MODULE, $settings_name); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $applicationStartNo; | |
} | |
/** | |
* Get Last genratedapplication no of a given course type and year | |
* | |
* @param int $courseTypeId | |
* @param string $admissionYear | |
* @return int lastGeneratedApplicationNo | |
*/ | |
public function getLastGeneratedApplicationNo($courseTypeId, $admissionYear) | |
{ | |
$lastGeneratedApplicationNo = 0; | |
try { | |
$sql = "SELECT max(applicationNo) as lastApplicationNo FROM admission_student_details_ug WHERE courseTypeId = $courseTypeId AND admissionYear = '$admissionYear';"; | |
$lastGeneratedApplicationNo = $this->executeQueryForObject($sql)->lastApplicationNo; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $lastGeneratedApplicationNo; | |
} | |
/** | |
* get Admission application form by form type Id | |
* | |
* @param int $formTypeId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getApplicationFormByFormType($formTypeId) | |
{ | |
$admissionApplicationForm = NULL; | |
$sql = "SELECT aft.*, aaf.*, bct.type_code as courseTypeCode FROM applicationFormType aft | |
INNER JOIN admissionApplicationForm aaf on aaf.id = aft.applicationFormId | |
INNER JOIN batch_course_type bct ON bct.id = aaf.courseTypeId | |
WHERE aft.id = $formTypeId"; | |
try { | |
$admissionApplicationForm = $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $admissionApplicationForm; | |
} | |
/** | |
* get Admission application form by form type Id | |
* | |
* @param int $studentId | |
* @param int $courseTypeId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getApplicationFormByStudentId($studentId, $courseTypeId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$courseType = BatchService::getInstance()->getCourseTypeById($courseTypeId); | |
$postFix = '_ug'; | |
if ($courseType->isPG) { | |
$postFix = '_pg_affiliated'; | |
} | |
$admissionApplicationForm = NULL; | |
$sql = "SELECT aft.id as formTypeId, aaf.*, bct.type_code as courseTypeCode FROM applicationFormType aft | |
INNER JOIN admissionApplicationForm aaf on aaf.id = aft.applicationFormId | |
INNER JOIN batch_course_type bct ON bct.id = aaf.courseTypeId | |
INNER JOIN admission_student_details$postFix asd ON asd.applicationFormTypeId=aft.id | |
WHERE asd.studentID = $studentId"; | |
try { | |
$admissionApplicationForm = $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $admissionApplicationForm; | |
} | |
public function checkStudentMarkEntered($studentId) | |
{ | |
$flag = FALSE; | |
$sql = "select studentID from admission_student_marks where studentID=\"" . $studentId . "\""; | |
try { | |
$studentId = $this->executeQueryForObject($sql)->studentID; | |
if ($studentId) { | |
$flag = TRUE; | |
} | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $flag; | |
} | |
public function getStudentMarkEntered($studentId, $typeId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$typeId = $this->realEscapeString($typeId); | |
$sql = "select t1.examsubID, t1.subjectID, t1.isIndex, t1.minMark, t1.maxMark, t2.subjectName, t2.subjectDesc, t3.mark from admission_exam_subjects t1, admission_subjects t2, admission_student_marks_ug t3 where t1.typeID=\"$typeId\" and t2.subjectID=t1.subjectID and t3.subjectID=t1.subjectID and t3.studentID=\"$studentId\""; | |
try { | |
return $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* get applicationno by studentId | |
* | |
* @param int $studentId | |
* @return string $applicationNo | |
* @throws ProfessionalException | |
*/ | |
public function getApplicationNoByStudentId($studentId) | |
{ | |
$applicationNo = NULL; | |
try { | |
$sql = "select distinct CONCAT(aft.applicationPrefix,'',asdu.applicationNo) as applicationNo from admission_student_details_ug asdu | |
LEFT JOIN applicationFormType aft ON asdu.applicationFormTypeId = aft.id where asdu.studentID = $studentId"; | |
$applicationNo = $this->executeQueryForObject($sql)->applicationNo; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $applicationNo; | |
} | |
/** | |
* get applicationno by studentId | |
* | |
* @param int $studentId | |
* @return string $applicationNo | |
* @throws ProfessionalException | |
*/ | |
public function getApplicationNoByPgStudentId($studentId) | |
{ | |
$applicationNo = NULL; | |
try { | |
$sql = "select distinct CONCAT(aft.applicationPrefix,'',asdu.applicationNo) as applicationNo from admission_student_details_pg_affiliated asdu | |
LEFT JOIN applicationFormType aft ON asdu.applicationFormTypeId = aft.id where asdu.studentID = $studentId"; | |
$applicationNo = $this->executeQueryForObject($sql)->applicationNo; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $applicationNo; | |
} | |
/** | |
* get application fee | |
* | |
* @param int $formTypeId | |
* @return float $applicationFee | |
* @throws ProfessionalException | |
*/ | |
public function checkApplicationFee($formTypeId) | |
{ | |
$applicationFee = 0; | |
$sql = "select applicationFee FROM applicationFormType WHERE id=$formTypeId"; | |
try { | |
$applicationFee = $this->executeQueryForObject($sql)->applicationFee; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $applicationFee; | |
} | |
/** | |
* has application fee | |
* | |
* @param int $formTypeId | |
* @return boolean | |
* @throws ProfessionalException | |
*/ | |
public function hasApplicationFee($formTypeId) | |
{ | |
$hasApplicationFee = 0; | |
$sql = "select hasApplicationFee FROM applicationFormType WHERE id=$formTypeId"; | |
try { | |
$hasApplicationFee = $this->executeQueryForObject($sql)->hasApplicationFee; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $hasApplicationFee; | |
} | |
/** | |
* Add pg student admission details | |
* | |
* @param AdmissionStudentDetailsPG $admissionStudentDetailsPG | |
* @return number | |
*/ | |
public function createPGStudentAdmissionDetails($courseTypeCode, $admissionStudentDetailsPG) | |
{ | |
$courseTypeCode = $this->realEscapeString($courseTypeCode); | |
$admissionStudentDetailsPG = $this->realEscapeObject($admissionStudentDetailsPG); | |
$studentId = 0; | |
$configuresApplicationStartNo = 0; | |
$lastGeneratedApplicationNo = 0; | |
$applicationNo = 0; | |
$sql = ""; | |
if ($admissionStudentDetailsPG != NULL) { | |
// Generate application no corresponding to course type | |
// if no application created against coursetype and year then set application no as configured start application no | |
// else lastgeneratedapplicationno +1 | |
switch ($courseTypeCode) { | |
case CourseType::MCA: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getPGLastGeneratedApplicationNo($admissionStudentDetailsPG->courseTypeId, $admissionStudentDetailsPG->admissionYear); | |
if ($lastGeneratedApplicationNo == NULL || $lastGeneratedApplicationNo == 0) { | |
$applicationNo = $configuresApplicationStartNo; | |
} else { | |
$applicationNo = ($lastGeneratedApplicationNo + 1); | |
} | |
break; | |
case CourseType::MBA: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getPGLastGeneratedApplicationNo($admissionStudentDetailsPG->courseTypeId, $admissionStudentDetailsPG->admissionYear); | |
if ($lastGeneratedApplicationNo == NULL || $lastGeneratedApplicationNo == 0) { | |
$applicationNo = $configuresApplicationStartNo; | |
} else { | |
$applicationNo = ($lastGeneratedApplicationNo + 1); | |
} | |
break; | |
case CourseType::MSC: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getPGLastGeneratedApplicationNo($admissionStudentDetailsPG->courseTypeId, $admissionStudentDetailsPG->admissionYear); | |
if ($lastGeneratedApplicationNo == NULL || $lastGeneratedApplicationNo == 0) { | |
$applicationNo = $configuresApplicationStartNo; | |
} else { | |
$applicationNo = ($lastGeneratedApplicationNo + 1); | |
} | |
break; | |
case CourseType::MTECH: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getPGLastGeneratedApplicationNo($admissionStudentDetailsPG->courseTypeId, $admissionStudentDetailsPG->admissionYear); | |
if ($lastGeneratedApplicationNo == NULL || $lastGeneratedApplicationNo == 0) { | |
$applicationNo = $configuresApplicationStartNo; | |
} else { | |
$applicationNo = ($lastGeneratedApplicationNo + 1); | |
} | |
break; | |
case CourseType::MARCH: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getPGLastGeneratedApplicationNo($admissionStudentDetailsPG->courseTypeId, $admissionStudentDetailsPG->admissionYear); | |
if ($lastGeneratedApplicationNo == NULL || $lastGeneratedApplicationNo == 0) { | |
$applicationNo = $configuresApplicationStartNo; | |
} else { | |
$applicationNo = ($lastGeneratedApplicationNo + 1); | |
} | |
break; | |
case CourseType::MPLAN: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getPGLastGeneratedApplicationNo($admissionStudentDetailsPG->courseTypeId, $admissionStudentDetailsPG->admissionYear); | |
if ($lastGeneratedApplicationNo == NULL || $lastGeneratedApplicationNo == 0) { | |
$applicationNo = $configuresApplicationStartNo; | |
} else { | |
$applicationNo = ($lastGeneratedApplicationNo + 1); | |
} | |
break; | |
case CourseType::PGDM: | |
$configuresApplicationStartNo = $this->getApplicationStartNo($courseTypeCode); | |
$lastGeneratedApplicationNo = $this->getPGLastGeneratedApplicationNo($admissionStudentDetailsPG->courseTypeId, $admissionStudentDetailsPG->admissionYear); | |
if ($lastGeneratedApplicationNo == NULL || $lastGeneratedApplicationNo == 0) { | |
$applicationNo = $configuresApplicationStartNo; | |
} else { | |
$applicationNo = ($lastGeneratedApplicationNo + 1); | |
} | |
break; | |
default: | |
throw new ProfessionalException(ProfessionalException::INVALID_COURSE_CODE, "Invalid course type code."); | |
break; | |
} | |
// Create application | |
// By default, payment status will be not paid | |
if (empty($admissionStudentDetailsPG->paymentStatus)) { | |
$paymentStatus = AdmissionPaymentStatus::NOT_PAID; | |
} else { | |
$paymentStatus = $admissionStudentDetailsPG->paymentStatus; | |
} | |
// | |
// if(empty($admissionStudentDetailsPG->paymentMode)) | |
// { | |
// $paymentMode = AdmissionPaymentMode::ONLINE; | |
// } | |
// else | |
// { | |
// $paymentMode = $admissionStudentDetailsPG->paymentMode; | |
// } | |
$sql = "INSERT INTO admission_student_details_pg_affiliated(myimage, studentName, studentInitial, dateofbirth, gender, aadharNo, nationality, motherTongue, religion, caste, reservID, permahouse, permaplace, permastate, permacity, permataluk, permapin, commuhouse, commuplace, commustate, commucity, commutaluk, commupin, mobilePhone, studentResPhone, email, fatherName, fatherEmail, fatherOccupation, fatherMobile, motherName, motherEmail, motherOccupation, motherMobile, annualIncome, tenthSchool, tenthExam, tenthYear, tenthBoard, tenthPercent, tenthMarksObtained, tenthMaxMarks, twelthSchool, twelthExam, twelthYear, twelthBoard, twelthPercent, twelthMarksObtained, twelthMaxMarks, hostel_facility, otherAchievements, secondLanguage, createdBy, createdDate, updatedBy, updatedDate, admissionYear, courseTypeId, applicationFormTypeId, studentPassword, applicationNo, age, paymentStatus, paymentMethod, entranceName, entranceRegno, entranceScore, entranceRank, graduationExam, graduationInst, graduationMarksObtained, graduationMaxMarks, graduationPercent, pgExam, pgInst, pgMarksObtained, pgMaxMarks, pgPercent, graduationExamYear, pgExamYear, placeOfBirth, graduationRegNo, graduationClass, graduationSubject, twelthSubject, meritRank, gateScore, gatePercentile, gateMarkObtained, gateRank, gatePassedYear, isEmployed, jobDetails, isSponsored, sponsorDetails, quotaID, gateRegNo, bloodGroup, height, maritalStatus, idMarks, graduationMonth, entranceYear, entranceMonth, entranceMaxMark, entranceMark, graduationGrade , graduationRemark, jurisdiction, tcNo, tcDate, tcInstitution, isAtchivement, isPhysicallyChallenged, dteApplicationNo, parentName, tenthRegNo, parentMobile, graduationUniversity, parentRelationship, parentOccupation, jobOrganisation, jobDesignation, jobExperianceMonth,graduationCGPA, taluk, country, twelthBoardOther, otherCategoryName, appliedDate, appliedPlace, parentEmail, pgExamMonth, twelthExamMonth, tenthMonth, activity, tenthSpecialisation, twelthSpecialisation, ugSpecialisation, pgSpecialisation, otherPassYear, otherPassMonth, otherInst, otherPercent, otherSpecialisation, studentEmail, capId, customField1,signImage,parentSignature,twelthRegNo,employeeCode,gateQualified,boardingPoint,bus_facility,entranceAttended,commuDist,permaDist,twelthMathsObtainedMark,tenthMathsObtainedMark,ugSupplementary,ugNoOfArrears,electivePreference,otherEntranceName,otherDegreeExam,statementOfPurpose,expectations) | |
VALUES ('$admissionStudentDetailsPG->myimage', '$admissionStudentDetailsPG->studentName', '$admissionStudentDetailsPG->studentInitial', '$admissionStudentDetailsPG->dateofbirth', '$admissionStudentDetailsPG->gender', '$admissionStudentDetailsPG->aadharNo', '$admissionStudentDetailsPG->nationality', '$admissionStudentDetailsPG->motherTongue', '$admissionStudentDetailsPG->religion', '$admissionStudentDetailsPG->caste', '$admissionStudentDetailsPG->reservId', '$admissionStudentDetailsPG->permahouse', '$admissionStudentDetailsPG->permaplace', '$admissionStudentDetailsPG->permastate', '$admissionStudentDetailsPG->permacity', '$admissionStudentDetailsPG->permataluk', '$admissionStudentDetailsPG->permapin', '$admissionStudentDetailsPG->commuhouse', '$admissionStudentDetailsPG->commuplace', '$admissionStudentDetailsPG->commustate', '$admissionStudentDetailsPG->commucity', '$admissionStudentDetailsPG->commutaluk', '$admissionStudentDetailsPG->commupin', '$admissionStudentDetailsPG->mobilePhone', '$admissionStudentDetailsPG->studentResPhone', '$admissionStudentDetailsPG->email', '$admissionStudentDetailsPG->fatherName', '$admissionStudentDetailsPG->fatherEmail', '$admissionStudentDetailsPG->fatherOccupation', '$admissionStudentDetailsPG->fatherMobile', '$admissionStudentDetailsPG->motherName', '$admissionStudentDetailsPG->motherEmail', '$admissionStudentDetailsPG->motherOccupation', '$admissionStudentDetailsPG->motherMobile', '$admissionStudentDetailsPG->annualIncome', '$admissionStudentDetailsPG->tenthSchool', '$admissionStudentDetailsPG->tenthExam', '$admissionStudentDetailsPG->tenthYear', '$admissionStudentDetailsPG->tenthBoard', '$admissionStudentDetailsPG->tenthPercent', '$admissionStudentDetailsPG->tenthMarksObtained', '$admissionStudentDetailsPG->tenthMaxMarks', '$admissionStudentDetailsPG->twelthSchool', '$admissionStudentDetailsPG->twelthExam', '$admissionStudentDetailsPG->twelthYear', '$admissionStudentDetailsPG->twelthBoardId', '$admissionStudentDetailsPG->twelthPercent', '$admissionStudentDetailsPG->twelthMarksObtained', '$admissionStudentDetailsPG->twelthMaxMarks', '$admissionStudentDetailsPG->hostel_facility', '$admissionStudentDetailsPG->otherAchievements', '$admissionStudentDetailsPG->secondLanguage', '1', utc_timestamp(), '1', utc_timestamp(), '$admissionStudentDetailsPG->admissionYear', '$admissionStudentDetailsPG->courseTypeId', '$admissionStudentDetailsPG->applicationFormTypeId', md5('$admissionStudentDetailsPG->studentPassword'), '$applicationNo', '$admissionStudentDetailsPG->age', '$paymentStatus', '$paymentMethod', '$admissionStudentDetailsPG->entranceName', '$admissionStudentDetailsPG->entranceRegno', '$admissionStudentDetailsPG->entranceScore', '$admissionStudentDetailsPG->entranceRank', '$admissionStudentDetailsPG->graduationExam', '$admissionStudentDetailsPG->graduationInst', '$admissionStudentDetailsPG->graduationMarksObtained', '$admissionStudentDetailsPG->graduationMaxMarks', '$admissionStudentDetailsPG->graduationPercent', '$admissionStudentDetailsPG->pgExam', '$admissionStudentDetailsPG->pgInst', '$admissionStudentDetailsPG->pgMarksObtained', '$admissionStudentDetailsPG->pgMaxMarks', '$admissionStudentDetailsPG->pgPercent', '$admissionStudentDetailsPG->graduationExamYear', '$admissionStudentDetailsPG->pgExamYear', '$admissionStudentDetailsPG->placeOfBirth', '$admissionStudentDetailsPG->graduationRegNo', '$admissionStudentDetailsPG->graduationClass', '$admissionStudentDetailsPG->graduationSubject', '$admissionStudentDetailsPG->twelthSubject', '$admissionStudentDetailsPG->meritRank', '$admissionStudentDetailsPG->gateScore', '$admissionStudentDetailsPG->gatePercentile', '$admissionStudentDetailsPG->gateMarkObtained', '$admissionStudentDetailsPG->gateRank', '$admissionStudentDetailsPG->gatePassedYear', '$admissionStudentDetailsPG->isEmployed', '$admissionStudentDetailsPG->jobDetails', '$admissionStudentDetailsPG->isSponsored', '$admissionStudentDetailsPG->sponsorDetails', '$admissionStudentDetailsPG->quotaID', '$admissionStudentDetailsPG->gateRegNo', '$admissionStudentDetailsPG->bloodGroup', '$admissionStudentDetailsPG->height', '$admissionStudentDetailsPG->maritalStatus', '$admissionStudentDetailsPG->idMarks', '$admissionStudentDetailsPG->graduationMonth', '$admissionStudentDetailsPG->entranceYear', '$admissionStudentDetailsPG->entranceMonth', '$admissionStudentDetailsPG->entranceMaxMark', '$admissionStudentDetailsPG->entranceMark', '$admissionStudentDetailsPG->graduationGrade', '$admissionStudentDetailsPG->graduationRemark', '$admissionStudentDetailsPG->jurisdiction', '$admissionStudentDetailsPG->tcNo', '$admissionStudentDetailsPG->tcDate', '$admissionStudentDetailsPG->tcInstitution', '$admissionStudentDetailsPG->isAtchivement', '$admissionStudentDetailsPG->isPhysicallyChallenged', '$admissionStudentDetailsPG->dteApplicationNo', '$admissionStudentDetailsPG->parentName', '$admissionStudentDetailsPG->tenthRegNo', '$admissionStudentDetailsPG->parentMobile', '$admissionStudentDetailsPG->graduationUniversity', '$admissionStudentDetailsPG->parentRelationship', '$admissionStudentDetailsPG->parentOccupation', '$admissionStudentDetailsPG->jobOrganisation', '$admissionStudentDetailsPG->jobDesignation', '$admissionStudentDetailsPG->jobExperianceMonth','$admissionStudentDetailsPG->graduationCGPA','$admissionStudentDetailsPG->taluk','$admissionStudentDetailsPG->country', '$admissionStudentDetailsPG->twelthBoardOther', '$admissionStudentDetailsPG->otherCategoryName','$admissionStudentDetailsPG->appliedDate','$admissionStudentDetailsPG->appliedPlace', '$admissionStudentDetailsPG->parentEmail', '$admissionStudentDetailsPG->twelthExamMonth','$admissionStudentDetailsPG->pgExamMonth','$admissionStudentDetailsPG->tenthMonth','$admissionStudentDetailsPG->activity','$admissionStudentDetailsPG->tenthSpecialisation', '$admissionStudentDetailsPG->twelthSpecialisation', '$admissionStudentDetailsPG->ugSpecialisation','$admissionStudentDetailsPG->pgSpecialisation','$admissionStudentDetailsPG->otherPassYear', '$admissionStudentDetailsPG->otherPassMonth', '$admissionStudentDetailsPG->otherInst', '$admissionStudentDetailsPG->otherPercent', '$admissionStudentDetailsPG->otherSpecialisation', | |
'$admissionStudentDetailsPG->studentEmail', '$admissionStudentDetailsPG->capId', '$admissionStudentDetailsPG->customField1','$admissionStudentDetailsPG->signImage','$admissionStudentDetailsPG->signImageParent','$admissionStudentDetailsPG->twelthRegNo', '$admissionStudentDetailsPG->employeeCode', '$admissionStudentDetailsPG->gateQualified', | |
'$admissionStudentDetailsPG->boardingPoint', '$admissionStudentDetailsPG->bus_facility','$admissionStudentDetailsPG->entranceAttended', | |
'$admissionStudentDetailsPG->commuDist', | |
'$admissionStudentDetailsPG->permaDist', | |
'$admissionStudentDetailsPG->twelthMathsObtainedMark','$admissionStudentDetailsPG->tenthMathsObtainedMark', | |
'$admissionStudentDetailsPG->ugSupplementary','$admissionStudentDetailsPG->ugNoOfArrears', | |
'$admissionStudentDetailsPG->electivePreference','$admissionStudentDetailsPG->otherEntranceName','$admissionStudentDetailsPG->otherDegreeExam','$admissionStudentDetailsPG->statementOfPurpose','$admissionStudentDetailsPG->expectations' | |
)"; | |
$emailCount = $this->checkPreviousStudentEmailExists($admissionStudentDetailsPG->email, $admissionStudentDetailsPG->courseTypeId, $admissionStudentDetailsPG->applicationFormTypeId); | |
try { | |
if($emailCount == 0) | |
{ | |
$studentId = $this->executeQueryForObject($sql, TRUE); | |
} | |
else | |
{ | |
throw new ProfessionalException(ProfessionalException::INVALID_REQUEST, "Request is not valid or null."); | |
} | |
$sqlUpdate = "UPDATE admission_student_details_pg_affiliated SET fatherQualification='$admissionStudentDetailsPG->fatherQualification', motherQualification='$admissionStudentDetailsPG->motherQualification', workExperiance='$admissionStudentDetailsPG->workExperiance', otherWorkExperiance='$admissionStudentDetailsPG->otherWorkExperiance', additionalQualification='$admissionStudentDetailsPG->additionalQualification', candidateProfile='$admissionStudentDetailsPG->candidateProfile' WHERE studentID=$studentId"; | |
$this->executeQuery($sqlUpdate); | |
if ($admissionStudentDetailsPG->admissionStudentBranchPreference) { | |
// Delete existing branchpreference if any | |
$this->deleteBranchPrefOfPGByStudentId($studentId); | |
// create branchprefernce | |
$this->createBranchPrefOfPG($admissionStudentDetailsPG->admissionStudentBranchPreference, $studentId); | |
} | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} else { | |
throw new ProfessionalException(ProfessionalException::INVALID_REQUEST, "Request is not valid or null."); | |
} | |
return $studentId; | |
} | |
/** | |
* update pg student admission details | |
* | |
* @param AdmissionStudentDetailsPG $admissionStudentDetailsPG | |
* @return number | |
*/ | |
public function updatePGStudentAdmissionDetails($admissionStudentDetailsPG) | |
{ | |
$admissionStudentDetailsPG = $this->realEscapeObject($admissionStudentDetailsPG); | |
$sql = ""; | |
if ($admissionStudentDetailsPG != NULL) { | |
$studentId = $admissionStudentDetailsPG->studentId; | |
// $allowEmailEdit = CommonService::getInstance()->getSettings(AdmissionConstants::SETTINGS_TYPE_ADMISSION_MODULE,AdmissionConstants::ALLOW_STUDENT_LOGIN); | |
// if(!$allowEmailEdit) | |
// { | |
// $emailString = ",studentEmail = '$admissionStudentDetailsPG->studentEmail'"; | |
// } | |
// update application | |
$sql = "UPDATE admission_student_details_pg_affiliated SET | |
myimage= '$admissionStudentDetailsPG->myimage', | |
signImage= '$admissionStudentDetailsPG->signImage', | |
parentSignature= '$admissionStudentDetailsPG->signImageParent', | |
studentName = '$admissionStudentDetailsPG->studentName', | |
studentInitial = '$admissionStudentDetailsPG->studentInitial', | |
dateofbirth = '$admissionStudentDetailsPG->dateofbirth', | |
gender = '$admissionStudentDetailsPG->gender', | |
aadharNo = '$admissionStudentDetailsPG->aadharNo', | |
nationality = '$admissionStudentDetailsPG->nationality', | |
motherTongue = '$admissionStudentDetailsPG->motherTongue', | |
religion = '$admissionStudentDetailsPG->religion', | |
caste = '$admissionStudentDetailsPG->caste', | |
subCaste = '$admissionStudentDetailsPG->subCaste', | |
reservID = '$admissionStudentDetailsPG->reservId', | |
permahouse = '$admissionStudentDetailsPG->permahouse', | |
permaplace = '$admissionStudentDetailsPG->permaplace', | |
permastate = '$admissionStudentDetailsPG->permastate', | |
permacity = '$admissionStudentDetailsPG->permacity', | |
permataluk = '$admissionStudentDetailsPG->permataluk', | |
permapin = '$admissionStudentDetailsPG->permapin', | |
commuhouse = '$admissionStudentDetailsPG->commuhouse', | |
commuplace = '$admissionStudentDetailsPG->commuplace', | |
commustate = '$admissionStudentDetailsPG->commustate', | |
commucity = '$admissionStudentDetailsPG->commucity', | |
commutaluk = '$admissionStudentDetailsPG->commutaluk', | |
commupin = '$admissionStudentDetailsPG->commupin', | |
mobilePhone = '$admissionStudentDetailsPG->mobilePhone', | |
studentResPhone = '$admissionStudentDetailsPG->studentResPhone', | |
fatherName = '$admissionStudentDetailsPG->fatherName', | |
fatherEmail= '$admissionStudentDetailsPG->fatherEmail', | |
fatherOccupation = '$admissionStudentDetailsPG->fatherOccupation', | |
fatherMobile = '$admissionStudentDetailsPG->fatherMobile', | |
motherName = '$admissionStudentDetailsPG->motherName', | |
motherEmail = '$admissionStudentDetailsPG->motherEmail', | |
motherOccupation = '$admissionStudentDetailsPG->motherOccupation', | |
motherMobile = '$admissionStudentDetailsPG->motherMobile', | |
annualIncome = '$admissionStudentDetailsPG->annualIncome', | |
tenthSchool = '$admissionStudentDetailsPG->tenthSchool', | |
tenthExam = '$admissionStudentDetailsPG->tenthExam', | |
tenthYear = '$admissionStudentDetailsPG->tenthYear', | |
tenthMonth = '$admissionStudentDetailsPG->tenthMonth', | |
tenthBoard = '$admissionStudentDetailsPG->tenthBoard', | |
tenthPercent = '$admissionStudentDetailsPG->tenthPercent', | |
tenthMarksObtained = '$admissionStudentDetailsPG->tenthMarksObtained', | |
tenthMaxMarks = '$admissionStudentDetailsPG->tenthMaxMarks', | |
twelthSchool = '$admissionStudentDetailsPG->twelthSchool', | |
twelthExam = '$admissionStudentDetailsPG->twelthExam', | |
twelthYear = '$admissionStudentDetailsPG->twelthYear', | |
twelthExamMonth = '$admissionStudentDetailsPG->twelthExamMonth', | |
twelthBoard = '$admissionStudentDetailsPG->twelthBoardId', | |
twelthPercent = '$admissionStudentDetailsPG->twelthPercent', | |
twelthMarksObtained = '$admissionStudentDetailsPG->twelthMarksObtained', | |
twelthMaxMarks = '$admissionStudentDetailsPG->twelthMaxMarks', | |
hostel_facility = '$admissionStudentDetailsPG->hostel_facility', | |
otherAchievements = '$admissionStudentDetailsPG->otherAchievements', | |
secondLanguage = '$admissionStudentDetailsPG->secondLanguage', | |
entranceName ='$admissionStudentDetailsPG->entranceName', | |
entranceRegno = '$admissionStudentDetailsPG->entranceRegno', | |
entranceScore = '$admissionStudentDetailsPG->entranceScore', | |
entranceRank = '$admissionStudentDetailsPG->entranceRank', | |
graduationExam = '$admissionStudentDetailsPG->graduationExam', | |
graduationInst = '$admissionStudentDetailsPG->graduationInst', | |
graduationMarksObtained = '$admissionStudentDetailsPG->graduationMarksObtained', | |
graduationMaxMarks = '$admissionStudentDetailsPG->graduationMaxMarks', | |
graduationPercent = '$admissionStudentDetailsPG->graduationPercent', | |
pgExam = '$admissionStudentDetailsPG->pgExam', | |
pgInst = '$admissionStudentDetailsPG->pgInst', | |
pgMarksObtained = '$admissionStudentDetailsPG->pgMarksObtained', | |
pgMaxMarks = '$admissionStudentDetailsPG->pgMaxMarks', | |
pgPercent = '$admissionStudentDetailsPG->pgPercent', | |
graduationExamYear = '$admissionStudentDetailsPG->graduationExamYear', | |
pgExamYear = '$admissionStudentDetailsPG->pgExamYear', | |
updatedBy = '$admissionStudentDetailsPG->updatedBy', | |
updatedDate = utc_timestamp(), | |
age = '$admissionStudentDetailsPG->age', | |
placeOfBirth = '$admissionStudentDetailsPG->placeOfBirth', | |
graduationRegNo = '$admissionStudentDetailsPG->graduationRegNo', | |
graduationClass = '$admissionStudentDetailsPG->graduationClass', | |
graduationSubject = '$admissionStudentDetailsPG->graduationSubject', | |
twelthSubject = '$admissionStudentDetailsPG->twelthSubject', | |
meritRank = '$admissionStudentDetailsPG->meritRank', | |
gateScore = '$admissionStudentDetailsPG->gateScore', | |
gatePercentile = '$admissionStudentDetailsPG->gatePercentile', | |
gateMarkObtained = '$admissionStudentDetailsPG->gateMarkObtained', | |
gateRank = '$admissionStudentDetailsPG->gateRank', | |
gatePassedYear = '$admissionStudentDetailsPG->gatePassedYear', | |
isEmployed = '$admissionStudentDetailsPG->isEmployed', | |
jobDetails = '$admissionStudentDetailsPG->jobDetails', | |
isSponsored = '$admissionStudentDetailsPG->isSponsored', | |
sponsorDetails = '$admissionStudentDetailsPG->sponsorDetails', | |
quotaID = '$admissionStudentDetailsPG->quotaID', | |
gateRegNo = '$admissionStudentDetailsPG->gateRegNo', | |
bloodGroup = '$admissionStudentDetailsPG->bloodGroup', | |
height = '$admissionStudentDetailsPG->height', | |
maritalStatus = '$admissionStudentDetailsPG->maritalStatus', | |
idMarks = '$admissionStudentDetailsPG->idMarks', | |
graduationMonth = '$admissionStudentDetailsPG->graduationMonth', | |
entranceYear = '$admissionStudentDetailsPG->entranceYear', | |
entranceMonth = '$admissionStudentDetailsPG->entranceMonth', | |
entranceMaxMark = '$admissionStudentDetailsPG->entranceMaxMark', | |
entranceMark = '$admissionStudentDetailsPG->entranceMark', | |
graduationGrade = '$admissionStudentDetailsPG->graduationGrade', | |
graduationRemark = '$admissionStudentDetailsPG->graduationRemark', | |
jurisdiction = '$admissionStudentDetailsPG->jurisdiction', | |
tcNo = '$admissionStudentDetailsPG->tcNo', | |
tcDate = '$admissionStudentDetailsPG->tcDate', | |
tcInstitution = '$admissionStudentDetailsPG->tcInstitution', | |
isAtchivement = '$admissionStudentDetailsPG->isAtchivement', | |
isPhysicallyChallenged = '$admissionStudentDetailsPG->isPhysicallyChallenged', | |
dteApplicationNo = '$admissionStudentDetailsPG->dteApplicationNo', | |
parentName = '$admissionStudentDetailsPG->parentName', | |
tenthRegNo = '$admissionStudentDetailsPG->tenthRegNo', | |
twelthRegNo = '$admissionStudentDetailsPG->twelthRegNo', | |
parentMobile = '$admissionStudentDetailsPG->parentMobile', | |
graduationUniversity = '$admissionStudentDetailsPG->graduationUniversity', | |
parentRelationship = '$admissionStudentDetailsPG->parentRelationship', | |
parentOccupation = '$admissionStudentDetailsPG->parentOccupation', | |
jobOrganisation = '$admissionStudentDetailsPG->jobOrganisation', | |
jobDesignation = '$admissionStudentDetailsPG->jobDesignation', | |
jobExperianceMonth = '$admissionStudentDetailsPG->jobExperianceMonth', | |
fatherQualification='$admissionStudentDetailsPG->fatherQualification', | |
motherQualification='$admissionStudentDetailsPG->motherQualification', | |
workExperiance='$admissionStudentDetailsPG->workExperiance', | |
otherWorkExperiance='$admissionStudentDetailsPG->otherWorkExperiance', | |
additionalQualification='$admissionStudentDetailsPG->additionalQualification', | |
candidateProfile='$admissionStudentDetailsPG->candidateProfile', | |
graduationCGPA='$admissionStudentDetailsPG->graduationCGPA', | |
taluk='$admissionStudentDetailsPG->taluk', | |
country='$admissionStudentDetailsPG->country', | |
twelthBoardOther = '$admissionStudentDetailsPG->twelthBoardOther', | |
otherCategoryName = '$admissionStudentDetailsPG->otherCategoryName', | |
appliedDate = '$admissionStudentDetailsPG->appliedDate', | |
appliedPlace = '$admissionStudentDetailsPG->appliedPlace', | |
parentEmail = '$admissionStudentDetailsPG->parentEmail', | |
pgExamMonth = '$admissionStudentDetailsPG->pgExamMonth', | |
twelthExamMonth = '$admissionStudentDetailsPG->twelthExamMonth', | |
tenthMonth = '$admissionStudentDetailsPG->tenthMonth', | |
activity = '$admissionStudentDetailsPG->activity', | |
tenthSpecialisation = '$admissionStudentDetailsPG->tenthSpecialisation', | |
twelthSpecialisation = '$admissionStudentDetailsPG->twelthSpecialisation', | |
ugSpecialisation = '$admissionStudentDetailsPG->ugSpecialisation', | |
pgSpecialisation = '$admissionStudentDetailsPG->pgSpecialisation', | |
otherPassYear = '$admissionStudentDetailsPG->otherPassYear', | |
otherPassMonth = '$admissionStudentDetailsPG->otherPassMonth', | |
otherInst = '$admissionStudentDetailsPG->otherInst', | |
otherPercent = '$admissionStudentDetailsPG->otherPercent', | |
otherSpecialisation = '$admissionStudentDetailsPG->otherSpecialisation', | |
capId = '$admissionStudentDetailsPG->capId', | |
customField1 = '$admissionStudentDetailsPG->customField1', | |
employeeCode = '$admissionStudentDetailsPG->employeeCode', | |
gateQualified = '$admissionStudentDetailsPG->gateQualified', | |
studentEmail = '$admissionStudentDetailsPG->studentEmail', | |
boardingPoint = '$admissionStudentDetailsPG->boardingPoint', | |
bus_facility = '$admissionStudentDetailsPG->bus_facility', | |
commuDist = '$admissionStudentDetailsPG->commuDist', | |
permaDist = '$admissionStudentDetailsPG->permaDist', | |
entranceAttended = '$admissionStudentDetailsPG->entranceAttended', | |
tenthMathsObtainedMark = '$admissionStudentDetailsPG->tenthMathsObtainedMark', | |
twelthMathsObtainedMark = '$admissionStudentDetailsPG->twelthMathsObtainedMark', | |
ugSupplementary = '$admissionStudentDetailsPG->ugSupplementary', | |
ugNoOfArrears = '$admissionStudentDetailsPG->ugNoOfArrears', | |
electivePreference = '$admissionStudentDetailsPG->electivePreference', | |
otherEntranceName = '$admissionStudentDetailsPG->otherEntranceName', | |
otherDegreeExam = '$admissionStudentDetailsPG->otherDegreeExam', | |
statementOfPurpose = '$admissionStudentDetailsPG->statementOfPurpose', | |
expectations = '$admissionStudentDetailsPG->expectations' | |
WHERE studentID = $studentId"; | |
try { | |
$result = $this->executeQuery($sql); | |
if ($admissionStudentDetailsPG->admissionStudentBranchPreference) { | |
// Delete existing branchpreference if any | |
$this->deleteBranchPrefOfPGByStudentId($studentId); | |
// create branchprefernce | |
$this->createBranchPrefOfPG($admissionStudentDetailsPG->admissionStudentBranchPreference, $studentId); | |
} | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} else { | |
throw new ProfessionalException(ProfessionalException::INVALID_REQUEST, "Request is not valid or null."); | |
} | |
} | |
/** | |
* get applicationno of pg student by studentId | |
* | |
* @param int $studentId | |
* @return string | |
* @throws ProfessionalException | |
*/ | |
public function getPGApplicationNoByStudentId($studentId) | |
{ | |
$applicationNo = NULL; | |
try { | |
$sql = "select distinct CONCAT(aft.applicationPrefix,'',asdu.applicationNo) as applicationNo from admission_student_details_pg_affiliated asdu | |
LEFT JOIN applicationFormType aft ON asdu.applicationFormTypeId = aft.id where asdu.studentID = $studentId"; | |
$applicationNo = $this->executeQueryForObject($sql)->applicationNo; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, "Application no is not configured!"); | |
} | |
return $applicationNo; | |
} | |
/** | |
* Get Last genratedapplication no of a given course type and year | |
* | |
* @param int $courseTypeId | |
* @param string $admissionYear | |
* @return int lastGeneratedApplicationNo | |
*/ | |
public function getPGLastGeneratedApplicationNo($courseTypeId, $admissionYear) | |
{ | |
$lastGeneratedApplicationNo = 0; | |
try { | |
$sql = "SELECT max(applicationNo) as lastApplicationNo FROM admission_student_details_pg_affiliated WHERE courseTypeId = $courseTypeId AND admissionYear = '$admissionYear';"; | |
$lastGeneratedApplicationNo = $this->executeQueryForObject($sql)->lastApplicationNo; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $lastGeneratedApplicationNo; | |
} | |
/** | |
* Get Admission module payment category by course type id | |
* | |
* @param int $courseTypeId | |
* @return NULL|string | |
*/ | |
public function getAdmissionPaymentModuleCategoryByCourseType($courseTypeId) | |
{ | |
$category = null; | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$courseType = BatchService::getInstance()->getCourseTypeById($courseTypeId); | |
if (!empty($courseType)) { | |
$categorySettingName = AdmissionConstants::ADMISSION_PAYMENT_MODULE_CATEGORY . $courseType->code; | |
$category = CommonService::getInstance()->getSettings(AdmissionConstants::SETTINGS_TYPE_ADMISSION_MODULE, $categorySettingName); | |
} | |
return $category; | |
} | |
/** | |
* Make admission payment for a student pg | |
* | |
* @param StudentOnlinePaymentRequest $studentOnlinePaymentRequest | |
*/ | |
public function initiatePaymentPG($studentOnlinePaymentRequest, $module = 'ADMISSION', $category = 'ALL') | |
{ | |
$studentOnlinePaymentRequest = $this->realEscapeObject($studentOnlinePaymentRequest); | |
$module = $this->realEscapeString($module); | |
$category = $this->realEscapeString($category); | |
$clnt_txn_ref = mt_rand(); | |
$category = $this->getAdmissionPaymentModuleCategoryByCourseType($studentOnlinePaymentRequest->courseTypeId); | |
// If category not configured set default configuration | |
$category = empty($category) ? "ALL" : $category; | |
// Checking whether this student has alredy tried to make payment | |
$sql = "SELECT clnt_txn_ref FROM admission_student_online_payment_pg WHERE studentId = '$studentOnlinePaymentRequest->studentId'"; | |
$studentPayment = $this->executeQueryForObject($sql); | |
$amount = $studentOnlinePaymentRequest->amount; | |
$isEditFromParam = $studentOnlinePaymentRequest->isEdit ? '{from:stdEdit}' : ''; | |
if (empty($studentPayment)) { | |
$sql = "INSERT INTO admission_student_online_payment_pg (studentId, clnt_txn_ref, numberOfAttempts, status, applicationNo, admissionYear, dateOfTrasaction) VALUES('$studentOnlinePaymentRequest->studentId','$clnt_txn_ref', 1, '" . AdmissionPaymentStatus::PENDING . "', '" . $studentOnlinePaymentRequest->applicationNo . "', '" . $studentOnlinePaymentRequest->admissionYear . "','" . date("d-m-Y") . "')"; | |
} else { | |
$sql = "UPDATE admission_student_online_payment_pg SET clnt_txn_ref='$clnt_txn_ref', status = '" . AdmissionPaymentStatus::PENDING . "', dateOfTrasaction = \"" . date("d-m-Y") . "\" WHERE studentID = '$studentOnlinePaymentRequest->studentId'"; | |
} | |
// constructing payload | |
$payload = "rqst_type=T|tpsl_clnt_cd=" . AdmissionPaymentCredential::MERCHANT_ID . "|clnt_txn_ref=" . $clnt_txn_ref . "|clnt_rqst_meta={studentID:" . $studentOnlinePaymentRequest->studentId . "}$isEditFromParam{courseTypeID:" . $studentOnlinePaymentRequest->courseTypeId . "}|rqst_amnt=" . $amount . "|rqst_crncy=INR|rtrn_url=" . $studentOnlinePaymentRequest->returnURL . "|clnt_dt_tm=" . date("d-m-Y") . "|rqst_rqst_dtls=SCMS_" . $amount . "_0.00|tpsl_bank_cd=470"; | |
$this->executeQuery($sql); | |
$sql = "UPDATE admission_student_details_pg_affiliated SET paymentStatus = '" . AdmissionPaymentStatus::PENDING . "', paymentMethod = '" . AdmissionPaymentMode::ONLINE . "' WHERE studentID = $studentOnlinePaymentRequest->studentId "; | |
$this->executeQuery($sql); | |
$admissionStudentDetails = $this->getPGStudentAdmissionDetails($studentOnlinePaymentRequest->courseTypeId, $studentOnlinePaymentRequest->studentId); | |
if (!empty($admissionStudentDetails)) { | |
$exePaymentReq = new ExecutePaymentRequest(); | |
$exePaymentReq->module = $module; | |
$exePaymentReq->category = $category; | |
$exePaymentReq->amount = $amount; | |
$exePaymentReq->currency = 'INR'; | |
// $exePaymentReq->reqMetaData = "{studentID:" . $studentOnlinePaymentRequest->studentId . "}$isEditFromParam{courseTypeID:" . $studentOnlinePaymentRequest->courseTypeId . "}"; | |
$exePaymentReq->returnURL = $studentOnlinePaymentRequest->returnURL; | |
$exePaymentReq->timeStamp = date("d-m-Y"); | |
$exePaymentReq->txnId = $clnt_txn_ref; | |
$exePaymentReq->productInfo = 'Admission Application Fee'; | |
$exePaymentReq->email = $admissionStudentDetails->email; | |
$exePaymentReq->phone = $admissionStudentDetails->mobilePhone; | |
$exePaymentReq->userName = $admissionStudentDetails->studentName;; | |
$exePaymentReq->userId = $studentOnlinePaymentRequest->studentId; | |
$userDfParams = []; | |
$userDfParams['studentId'] = $studentOnlinePaymentRequest->studentId; | |
$userDfParams['courseTypeId'] = $studentOnlinePaymentRequest->courseTypeId; | |
$userDfParams['isEdit'] = $studentOnlinePaymentRequest->isEdit; | |
$exePaymentReq->userdfParams = $userDfParams; | |
PaymentGatewayService::getInstance()->executePayment($exePaymentReq); | |
} else { | |
throw new ProfessionalException(ProfessionalException::ADMISSION_INVALID_STUDENTDETAILS, "Student Details are null for studentId=$studentOnlinePaymentRequest->studentId and coursetypeId = $studentOnlinePaymentRequest->courseTypeId"); | |
} | |
} | |
/** | |
* getPGStudentAdmissionDetails | |
* | |
* @param int $courseTypeId | |
* @param int $studentId | |
*/ | |
public function getPGStudentAdmissionDetails($courseTypeId, $studentId) | |
{ | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$studentId = $this->realEscapeString($studentId); | |
$admissionStudentDetailsPG = NULL; | |
$branchPref = NULL; | |
$sql = "SELECT asd.myimage,asd.studentName,asd.studentInitial,asd.dateofbirth,asd.gender,asd.age,asd.aadharNo,asd.nationality,asd.motherTongue,asd.religion,asd.caste,asd.subCaste,asd.reservID,asd.permahouse,asd.permaplace,asd.permastate,asd.permacity,asd.permataluk,asd.permapin,asd.commuhouse,asd.commuplace,asd.commustate,asd.commucity,asd.commutaluk,asd.commupin,asd.mobilePhone,asd.studentResPhone,asd.email,asd.fatherName,asd.fatherEmail,asd.fatherOccupation,asd. fatherMobile,asd.motherName,asd.motherEmail,asd.motherOccupation,asd.motherMobile,asd.annualIncome,asd.tenthSchool,asd.tenthExam,asd.tenthYear,asd.tenthBoard,asd.tenthPercent,asd.tenthMarksObtained,asd.tenthMaxMarks,asd.twelthSchool,asd.twelthExam,asd.twelthYear,asd.twelthBoard,asd.twelthPercent,asd.twelthMarksObtained,asd.twelthMaxMarks,asd.hostel_facility,asd.otherAchievements,asd.secondLanguage,asd.createdBy,DATE_FORMAT(CONVERT_TZ(asd.createdDate,'+00:00',@@global.time_zone),'%Y-%m-%d %h:%i %p') as createdDate,asd.updatedBy,asd.updatedDate,asd.admissionYear,asd.courseTypeId,asd.applicationFormTypeId,CONCAT(aft.applicationPrefix,'',asd.applicationNo) as applicationNo,IF(sr.other_reserv=1,asd.otherCategoryName,sr.reservName) AS reservName,IF(twelthabt.unknown,asd.twelthBoardOther,twelthabt.typeName) as twelthBoardName, asd.paymentStatus as paymentStatus, asd.paymentMethod as paymentMethod, asd.isVerified as isVerified, asd.entranceName, asd.entranceRegno, asd.entranceScore, asd.entranceRank, asd.graduationExam, asd.graduationInst, asd.graduationMarksObtained, asd.graduationMaxMarks, asd.graduationPercent, asd.pgExam, asd.pgInst, asd.pgMarksObtained, asd.pgMaxMarks, asd.pgPercent, asd.graduationExamYear, asd.pgExamYear, off_payment.ddNumber, off_payment.ddDate, off_payment.bankName, off_payment.bankBranch, asd.placeOfBirth, asd.graduationRegNo, asd.graduationClass, asd.graduationSubject, asd.twelthSubject, asd.meritRank, asd.gateScore, asd.gatePercentile, asd.gateMarkObtained, asd.gateRank, asd.gatePassedYear, asd.isEmployed, asd.jobDetails, asd.isSponsored, asd.sponsorDetails, aq.quotaID, aq.quotaName, aq.quotaDesc, asd.gateRegNo, asd.bloodGroup, asd.height, asd.maritalStatus, asd.idMarks, asd.graduationMonth, asd.entranceYear, asd.entranceMonth, asd.entranceMaxMark, asd.entranceMark, asd.graduationGrade, asd.graduationRemark, IF(asd.paymentMethod='ONLINE',aop.dateOfTrasaction,off_payment.paymentDate) as dateOfTrasaction, asd.jurisdiction, asd.tcNo, asd.tcDate, asd.tcInstitution, asd.isAtchivement, asd.isPhysicallyChallenged, asd.dteApplicationNo, asd.parentName, asd.tenthRegNo, asd.parentMobile, asd.graduationUniversity, asd.parentRelationship, aft.applicationYear, asd.admittedDeptId, asd.admittedDate, asd.seatReservationQuotaId, asd.careOf, asd.admissionNo, asd.parentOccupation, asd.jobOrganisation, asd.jobDesignation, asd.jobExperianceMonth, asd.fatherQualification, asd.motherQualification, asd.workExperiance, asd.otherWorkExperiance, asd.additionalQualification, asd.candidateProfile,asd.graduationCGPA, asd.disableEdit, aft.feeEnabled, asd.taluk, asd.country, asd.twelthBoardOther, asd.appliedDate, asd.appliedPlace, asd.parentEmail, asd.pgExamMonth, asd.twelthExamMonth, asd.tenthMonth, asd.activity, asd.tenthSpecialisation, asd.twelthSpecialisation, asd.ugSpecialisation, asd.pgSpecialisation, asd.otherPassMonth, asd.otherPassYear, asd.otherInst, asd.otherPercent, asd.otherSpecialisation, asd.studentEmail, asd.capId, asd.signImage, asd.parentSignature, asd.customField1, asd.employeeCode, asd.gateQualified, asd.boardingPoint , asd.bus_facility ,asd.twelthRegNo,asd.entranceAttended,asd.permaDist,asd.commuDist,asd.twelthMathsObtainedMark,asd.tenthMathsObtainedMark,asd.electivePreference,asd.otherEntranceName,asd.ugSupplementary,asd.ugNoOfArrears,asd.otherDegreeExam,asd.expectations,asd.statementOfPurpose | |
FROM admission_student_details_pg_affiliated asd | |
LEFT JOIN applicationFormType aft ON asd.applicationFormTypeId = aft.id | |
LEFT JOIN student_reservation sr ON sr.reservID = asd.reservID | |
LEFT JOIN admission_boardexam_type twelthabt ON twelthabt.typeID = asd.twelthBoard | |
LEFT JOIN admission_student_offline_payment_pg off_payment ON asd.studentID = off_payment.studentID | |
LEFT JOIN admission_student_online_payment_pg aop ON aop.studentId = asd.studentID | |
LEFT JOIN admission_quotas aq ON aq.quotaID = asd.quotaID | |
WHERE asd.studentID = $studentId AND asd.courseTypeId = $courseTypeId;"; | |
try { | |
$admissionStudentDetailsPG = $this->executeQueryForObject($sql); | |
$admissionStudentDetailsPG->admissionStudentBranchPreference = $this->getBranchPrefOfPG($studentId); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $admissionStudentDetailsPG; | |
} | |
/** | |
* update payment status of a student | |
* | |
* @param int $studentID | |
* @param string $status | |
*/ | |
public function updatePaymentStatus($studentID, $status, $paymentGateway_txn_id) | |
{ | |
$receiptNo = ""; | |
if ($status == AdmissionPaymentStatus::SUCCESS) { | |
$billNo = CommonService::getInstance()->getSettings(AdmissionConstants::SETTINGS_TYPE_ADMISSION_MODULE, AdmissionConstants::STUDENT_ADMISSION_BILL_NO_LAST); | |
$billNo++; | |
$billNo = CommonService::getInstance()->appendZero($billNo, 3); | |
$receiptNo = ", receiptNo=$billNo"; | |
} | |
try { | |
$sql = " UPDATE admission_student_online_payment_ug SET tpsl_txn_id = '$paymentGateway_txn_id', status = '$status' $receiptNo WHERE studentID = $studentID "; | |
$result = $this->executeQueryForObject($sql); | |
if ($status == AdmissionPaymentStatus::SUCCESS) { | |
CommonService::getInstance()->updateSettings(AdmissionConstants::SETTINGS_TYPE_ADMISSION_MODULE, AdmissionConstants::STUDENT_ADMISSION_BILL_NO_LAST, $billNo); | |
} | |
$sql = "UPDATE admission_student_details_ug SET paymentStatus = '$status' WHERE studentID = $studentID "; | |
$result = $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* update payment status of a student | |
* | |
* @param int $studentID | |
* @param string $status | |
*/ | |
public function updatePaymentStatusB_TECH($studentID, $status, $paymentGateway_txn_id) | |
{ | |
try { | |
$sql = " UPDATE admission_student_online_payment_btech SET tpsl_txn_id = '$paymentGateway_txn_id', status = '$status' WHERE studentID = $studentID "; | |
$result = $this->executeQueryForObject($sql); | |
$sql = "UPDATE admission_student_details SET paymentStatus = '$status' WHERE studentID = $studentID "; | |
$result = $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* update payment status of a pg student | |
* | |
* @param int $studentID | |
* @param string $status | |
*/ | |
public function updatePaymentStatusPG($studentID, $status, $paymentGateway_txn_id) | |
{ | |
$receiptNo = ""; | |
if ($status == AdmissionPaymentStatus::SUCCESS) { | |
$billNo = CommonService::getInstance()->getSettings(AdmissionConstants::SETTINGS_TYPE_ADMISSION_MODULE, AdmissionConstants::STUDENT_ADMISSION_BILL_NO_LAST); | |
$billNo++; | |
$billNo = CommonService::getInstance()->appendZero($billNo, 3); | |
$receiptNo = ", receiptNo=$billNo"; | |
} | |
try { | |
$sql = " UPDATE admission_student_online_payment_pg SET tpsl_txn_id = '$paymentGateway_txn_id', status = '$status' $receiptNo WHERE studentID = $studentID "; | |
$result = $this->executeQueryForObject($sql); | |
if ($status == AdmissionPaymentStatus::SUCCESS) { | |
CommonService::getInstance()->updateSettings(AdmissionConstants::SETTINGS_TYPE_ADMISSION_MODULE, AdmissionConstants::STUDENT_ADMISSION_BILL_NO_LAST, $billNo); | |
} | |
$sql = "UPDATE admission_student_details_pg_affiliated SET paymentStatus = '$status' WHERE studentID = $studentID "; | |
$result = $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* Method for add offline payment details of pg | |
* | |
* @param StudentOfflinePaymentRequest $admissionFormType | |
* @return int | |
*/ | |
public function addAdmissionStudentOfflinePaymentPG($studentOfflinePaymentRequest) | |
{ | |
$studentOfflinePaymentRequest = $this->realEscapeObject($studentOfflinePaymentRequest); | |
$billNo = CommonService::getInstance()->getSettings(AdmissionConstants::SETTINGS_TYPE_ADMISSION_MODULE, AdmissionConstants::STUDENT_ADMISSION_BILL_NO_LAST); | |
$billNo++; | |
$billNo = CommonService::getInstance()->appendZero($billNo, 3); | |
$paymentDate = $studentOfflinePaymentRequest->paymentDate ? "'" . date("Y-m-d", strtotime($studentOfflinePaymentRequest->paymentDate)) . "'" : 'utc_timestamp()'; | |
$sql = "INSERT INTO admission_student_offline_payment_pg ( | |
studentId, | |
ddNumber, | |
ddDate, | |
bankName, | |
bankBranch, | |
admissionYear, | |
courseTypeId, | |
paymentDate, | |
receiptNo, | |
checkNo, | |
remarks, | |
chequeDate, | |
neftTransfId | |
) | |
VALUES | |
('$studentOfflinePaymentRequest->studentId', | |
'$studentOfflinePaymentRequest->ddNumber', | |
'$studentOfflinePaymentRequest->ddDate', | |
'$studentOfflinePaymentRequest->bankName', | |
'$studentOfflinePaymentRequest->bankBranch', | |
'$studentOfflinePaymentRequest->admissionYear', | |
$studentOfflinePaymentRequest->courseTypeId, | |
$paymentDate, | |
$billNo, | |
'$studentOfflinePaymentRequest->checkNo', | |
'$studentOfflinePaymentRequest->remarks', | |
'" . ($studentOfflinePaymentRequest->chequeDate ? date('Y-m-d', strtotime($studentOfflinePaymentRequest->chequeDate)) : '') . "','$studentOfflinePaymentRequest->neftTransfId' | |
)"; | |
try { | |
$this->executeQuery($sql); | |
CommonService::getInstance()->updateSettings(AdmissionConstants::SETTINGS_TYPE_ADMISSION_MODULE, AdmissionConstants::STUDENT_ADMISSION_BILL_NO_LAST, $billNo); | |
$sql = "UPDATE admission_student_details_pg_affiliated SET paymentStatus = '" . AdmissionPaymentStatus::SUCCESS . "', paymentMethod = '$studentOfflinePaymentRequest->offlinePaymentMode' WHERE studentID = $studentOfflinePaymentRequest->studentId "; | |
$result = $this->executeQuery($sql); | |
} catch (\Exception $e) { | |
if ($e->getCode() == ProfessionalException::DUPLICATE_ENTRY) { | |
throw new ProfessionalException(ProfessionalException::DUPLICATE_ENTRY, $e->getMessage()); | |
} else { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
} | |
/** | |
* Method for update offline payment details PG | |
* | |
* @param StudentOfflinePaymentRequest $admissionFormType | |
*/ | |
public function updateAdmissionStudentOfflinePaymentPG($studentOfflinePaymentRequest) | |
{ | |
$paymentDate = $studentOfflinePaymentRequest->paymentDate ? "'" . date("Y-m-d", strtotime($studentOfflinePaymentRequest->paymentDate)) . "'" : 'utc_timestamp()'; | |
$sql = "UPDATE admission_student_offline_payment_pg SET ddNumber = '$studentOfflinePaymentRequest->ddNumber', | |
ddDate = '$studentOfflinePaymentRequest->ddDate', | |
bankName = '$studentOfflinePaymentRequest->bankName', | |
bankBranch = '$studentOfflinePaymentRequest->bankBranch', | |
checkNo = '$studentOfflinePaymentRequest->checkNo', | |
remarks = '$studentOfflinePaymentRequest->remarks', | |
chequeDate = '" . ($studentOfflinePaymentRequest->chequeDate ? date('Y-m-d', strtotime($studentOfflinePaymentRequest->chequeDate)) : '') . "', | |
neftTransfId = '$studentOfflinePaymentRequest->neftTransfId', | |
paymentDate = $paymentDate | |
WHERE studentId = '$studentOfflinePaymentRequest->studentId'"; | |
try { | |
$this->executeQuery($sql); | |
$sql = "UPDATE admission_student_details_pg_affiliated SET paymentStatus = '" . AdmissionPaymentStatus::SUCCESS . "', paymentMethod = '$studentOfflinePaymentRequest->offlinePaymentMode' WHERE studentID = $studentOfflinePaymentRequest->studentId "; | |
$this->executeQuery($sql); | |
} catch (\Exception $e) { | |
if ($e->getCode() == ProfessionalException::DUPLICATE_ENTRY) { | |
throw new ProfessionalException(ProfessionalException::DUPLICATE_ENTRY, $e->getMessage()); | |
} else { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
} | |
/** | |
* Method to verify a pg student by Id | |
* | |
* @param int $studentId | |
*/ | |
public function verifyPGStudent($studentId) | |
{ | |
$sql = "UPDATE admission_student_details_pg_affiliated SET isVerified = 1 | |
WHERE studentID = '$studentId'"; | |
try { | |
$this->executeQuery($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* Method to verify a student by Id | |
* | |
* @param unknown $studentId | |
*/ | |
public function verifyUGStudent($studentId) | |
{ | |
$sql = "UPDATE admission_student_details_ug SET isVerified = 1, isRejected='' | |
WHERE studentID = '$studentId'"; | |
try { | |
$this->executeQuery($sql); | |
} catch (Exception $e) { | |
throw new AdmissionException(AdmissionException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* AdmitStudents | |
* | |
* @param AdmissionAdmitStudent $admissionAdmitStudent | |
* @return string | |
* @throws ProfessionalException | |
*/ | |
public function admitStudents($admissionAdmitStudent) | |
{ | |
$studentTableName = NULL; | |
$courseTypeId = BatchService::getInstance()->getCourseTypeIdByCode($admissionAdmitStudent->courseTypeCode)->id; | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_PG; | |
} else { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_UG; | |
} | |
$studentIds = implode(",", $admissionAdmitStudent->studentList); | |
$sql = "UPDATE $studentTableName SET isAdmitted = 1 , admittedDeptId =$admissionAdmitStudent->admittedDeptId, admittedDate='" . (date('Y-m-d', strtotime($admissionAdmitStudent->admittedDate))) . "', seatReservationQuotaId=$admissionAdmitStudent->seatReservationQuotaId, admissionNo='$admissionAdmitStudent->admissionNo', isRejected='' | |
WHERE studentID IN ($studentIds)"; | |
try { | |
$this->executeQuery($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return true; | |
} | |
/** | |
* Search Admitted Students | |
* | |
* @param AdmissionStudentRequest $admissionStudentRequest | |
* @return [] | |
* @throws ProfessionalException | |
*/ | |
public function searchAdmittedStudents($admissionStudentRequest) | |
{ | |
$admittedStudents = []; | |
$courseTypeId = BatchService::getInstance()->getCourseTypeIdByCode($admissionStudentRequest->courseTypeCode)->id; | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_PG; | |
} else { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_UG; | |
} | |
$sql = " SELECT asd.studentID,asd.gender,asd.dateofbirth,reserv.reservName, asd.myimage, asd.studentName, asd.aadharNo, asd.email, asd.mobilePhone, asd.parentMobile, asd.fatherMobile, | |
concat(form.applicationPrefix,asd.applicationNo) as applicationNo, asd.admissionNo, | |
abt.typeName as twelthBoard, asd.paymentMethod, asd.paymentStatus,asd.capId,asd.secondLanguage, | |
asd.isVerified as isVerified,asd.isAdmitted,d.deptName as admittedDeptName,d.departmentDesc as admittedDeptDesc, asd.admittedDeptId, asd.dateofbirth, | |
asd.isTransferedToAMS, asd.applicationFormTypeId, asd.seatReservationQuotaId,asd.entranceRank,asd.entranceRegno,asd.entranceName, asd.parentName, asd.parentRelationship, asd.fatherName, asd.fatherOccupation, asd.parentOccupation, asd.admittedDate, asd.religion, asd.caste, asd.reservID, " . ($isPg ? 'asd.graduationInst' : 'IF((asd.diplomaInst != "") && (asd.diplomaInst is not null),asd.diplomaInst, asd.twelthSchool)') . " as prevInst,asd.tcInstitution, asd.permahouse, asd.permaplace, asd.permacity, asd.permastate, asd.permapin,b.batchID as admittedBatchId,b.batchName as admittedBatch,b.is_admission as isAdmissionBatch,asd.amsStudentId, asd.commuhouse,asd.commuplace, asd.commustate, asd.commucity, asd.commupin, asd.quotaID,asd.tcDate,asd.tcNo | |
FROM $studentTableName asd | |
LEFT JOIN applicationFormType form ON asd.courseTypeId = form.courseTypeId AND form.id = asd.applicationFormTypeId AND form.applicationYear=$admissionStudentRequest->admissionYear | |
LEFT JOIN admission_boardexam_type abt ON asd.twelthBoard = abt.typeID | |
INNER JOIN department d on d.deptID = asd.admittedDeptId | |
LEFT JOIN studentaccount sa on asd.amsStudentId=sa.studentID | |
LEFT JOIN batches b ON b.batchID=sa.batchID | |
LEFT JOIN student_reservation reserv on reserv.reservID = asd.reservID | |
WHERE asd.isAdmitted = 1 AND asd.admissionYear=$admissionStudentRequest->admissionYear AND asd.courseTypeId=$courseTypeId "; | |
$sqlFilter = ''; | |
if (!empty($admissionStudentRequest->studentName)) { | |
$sqlFilter .= " AND asd.studentName like '%$admissionStudentRequest->studentName%' "; | |
} | |
if (!empty($admissionStudentRequest->applicationNo)) { | |
$sqlFilter .= " AND concat(form.applicationPrefix,asd.applicationNo) like '%$admissionStudentRequest->applicationNo%' "; | |
} | |
if (!empty($admissionStudentRequest->formTypeId) && ($admissionStudentRequest->formTypeId != "null") && ($admissionStudentRequest->formTypeId != "")) { | |
if(gettype($admissionStudentRequest->formTypeId) == 'array'){ | |
$formTypeIdList = implode(",",$admissionStudentRequest->formTypeId); | |
$sqlFilter .= "AND asd.applicationFormTypeId in ($formTypeIdList ) "; | |
}else{ | |
$sqlFilter .= "AND asd.applicationFormTypeId in ($admissionStudentRequest->formTypeId ) "; | |
} | |
} | |
if (!empty($admissionStudentRequest->admittedDeptId)) { | |
$sqlFilter .= "AND asd.admittedDeptId=$admissionStudentRequest->admittedDeptId "; | |
} | |
if (!empty($admissionStudentRequest->admittedQuotaId)) { | |
$sqlFilter .= "AND asd.seatReservationQuotaId=$admissionStudentRequest->admittedQuotaId "; | |
} | |
$sqlSortOrder = " ORDER BY asd.admissionNo ASC"; | |
$sql .= $sqlFilter; | |
$sql .= $sqlSortOrder; | |
try { | |
$admittedStudents = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $admittedStudents; | |
} | |
/** | |
* Transfer admitted students to AMS. | |
* <p> Set $admissionStudentIdsArray if you want to transfer selected students if not set whole batch students will be transferred to selected batch </p> | |
* | |
* @param string $courseTypeCode | |
* @param int $admittedDeptId | |
* @param int $amsBatchId | |
* @param int $admissionYear | |
* @param array $admissionStudentIdsArray | |
* @return \stdClass | |
* @throws ProfessionalException | |
*/ | |
public function transferAdmittStudentsToAMS($courseTypeCode, $admittedDeptId, $amsBatchId, $admissionYear, $admissionStudentIdsArray = []) | |
{ | |
$response = new \stdClass(); | |
$transferedStudentsList = []; | |
$studentTableName = NULL; | |
$tranferStudentProcName = NULL; | |
$courseTypeId = BatchService::getInstance()->getCourseTypeIdByCode($courseTypeCode)->id; | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_PG; | |
$tranferStudentProcName = AdmissionConstants::STUDENT_TRANSFER_PROCEDURE_NAME_PG; | |
} else { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_UG; | |
$tranferStudentProcName = AdmissionConstants::STUDENT_TRANSFER_PROCEDURE_NAME_UG; | |
} | |
$getAdmittedStudentListQuery = "SELECT sa.studentID,sa.batchID FROM studentaccount sa INNER JOIN $studentTableName asd ON sa.studentID=asd.amsStudentId LEFT JOIN | |
applicationFormType aft ON asd.applicationFormTypeId = aft.id | |
AND aft.applicationYear=$admissionYear | |
WHERE asd.isTransferedToAMS = 1 | |
AND asd.isAdmitted = 1 AND asd.admittedDeptId = $admittedDeptId AND aft.feeEnabled=1"; | |
if (!empty($admissionStudentIdsArray)) { | |
$admissionStudentIdsStr = implode(",", $admissionStudentIdsArray); | |
$getAdmittedStudentListQuery .= " AND asd.studentID IN ($admissionStudentIdsStr) "; | |
} | |
$admittedStudentList = $this->executeQueryForList($getAdmittedStudentListQuery); | |
$updateBatch = "UPDATE studentaccount sa INNER JOIN $studentTableName asd ON sa.studentID=asd.amsStudentId LEFT JOIN | |
applicationFormType aft ON asd.applicationFormTypeId = aft.id | |
AND aft.applicationYear=$admissionYear SET sa.deptID = '$admittedDeptId',sa.batchID = '$amsBatchId',sa.quotaID=asd.seatReservationQuotaId | |
WHERE asd.isTransferedToAMS = 1 | |
AND asd.isAdmitted = 1 AND asd.admittedDeptId = $admittedDeptId AND aft.feeEnabled=1"; | |
if (!empty($admissionStudentIdsArray)) { | |
$admissionStudentIdsStr = implode(",", $admissionStudentIdsArray); | |
$updateBatch .= " AND asd.studentID IN ($admissionStudentIdsStr) "; | |
} | |
$this->executeQueryForObject($updateBatch); | |
$getTransferStudentsSql = " | |
SELECT asd.*,aft.applicationPrefix FROM $studentTableName asd left join | |
applicationFormType aft ON asd.applicationFormTypeId = aft.id | |
AND aft.applicationYear=$admissionYear | |
WHERE asd.isTransferedToAMS = 0 | |
AND asd.isAdmitted = 1 AND asd.admittedDeptId = $admittedDeptId "; | |
// If Students ids are present then transfer only those students | |
if (!empty($admissionStudentIdsArray)) { | |
$admissionStudentIdsStr = implode(",", $admissionStudentIdsArray); | |
$getTransferStudentsSql .= " AND asd.studentID IN ($admissionStudentIdsStr) "; | |
} | |
try { | |
$studentsToTranferList = $this->executeQueryForList($getTransferStudentsSql); | |
$successCount = 0; | |
$failedCount = 0; | |
if (!empty($studentsToTranferList) && count($studentsToTranferList) > 0) { | |
foreach ($studentsToTranferList as $studentDetails) { | |
$studentAccount = $courseTypeCode . date("Y") . $studentDetails->studentID; | |
// $studentPassword = ""; | |
$studentAddress = ""; | |
$studentAddress = $studentDetails->permahouse ? $studentDetails->permahouse . ", " : ""; | |
$studentAddress .= $studentDetails->permaplace ? $studentDetails->permaplace . ", " : ""; | |
$studentAddress .= $studentDetails->permacity ? $studentDetails->permacity . ", " : ""; | |
$studentAddress .= $studentDetails->permataluk ? $studentDetails->permataluk . "-" : ""; | |
$studentAddress .= $studentDetails->permapin ? $studentDetails->permapin . ". " : ""; | |
$studentAddress .= $studentDetails->permastate ? $studentDetails->permastate . ", " : ""; | |
$admissionType = AdmissionConstants::AMS_ADMISSION_TYPE; | |
$lateral = $studentDetails->isLateral; | |
$applicationNo = ""; | |
$userJoinday = date("Y-m-d H:i:s"); | |
$regNo = ""; | |
$rollNo = 0; | |
$myimage = ""; | |
$studentEmail = ""; | |
$studentMobile = ""; | |
$community = ""; | |
$parentName = ""; | |
$parentPhone = ""; | |
$parentEmail = ""; | |
$applicationNo = $studentDetails->applicationPrefix . $studentDetails->applicationNo; | |
$studentDetails->applicationNo = $applicationNo; | |
$myimage = $studentDetails->myimage; | |
$signImage = $studentDetails->signImage; | |
$studentEmail = $studentDetails->email; | |
$studentMobile = $studentDetails->mobilePhone; | |
$community = $studentDetails->caste; | |
$parentName = $studentDetails->fatherName; | |
$parentPhone = $studentDetails->fatherMobile; | |
$parentEmail = $studentDetails->fatherEmail; | |
$quotaID = $studentDetails->seatReservationQuotaId; | |
// Copy images | |
$myimage = $this->transferStudentImageToAMS($myimage); | |
$signImage = $this->transferStudentSignImageToAMS($signImage); | |
$tranferStudentSql = " | |
call $tranferStudentProcName( | |
'$applicationNo', | |
'$studentDetails->studentName', | |
'$studentEmail', | |
'$studentDetails->gender', | |
'$studentDetails->dateofbirth', | |
'$studentAddress', | |
'$studentMobile', | |
'$admittedDeptId', | |
'$amsBatchId', | |
'$admissionType', | |
'$lateral', | |
'$studentDetails->religion', | |
'$community', | |
'$studentDetails->admissionNo', | |
'$studentDetails->studentInitial', | |
'$parentName', | |
'$studentDetails->motherName', | |
'$userJoinday', | |
'$studentDetails->tenthPercent', | |
'$studentDetails->twelthPercent', | |
'$parentPhone', | |
'$regNo', | |
'$myimage', | |
'$rollNo', | |
'$parentEmail', | |
'$studentDetails->studentID', | |
'$quotaID', | |
'$signImage' | |
) | |
"; | |
try { | |
$this->executeQuery($tranferStudentSql); | |
// Additional data updations | |
$additionalDataUpdateQuery = "UPDATE studentaccount sa INNER JOIN $studentTableName asd ON sa.studentID=asd.amsStudentId | |
LEFT JOIN student_reservation reserv on reserv.reservID = asd.reservID | |
LEFT JOIN student_reservation studentreserv on studentreserv.reservID = asd.reservID | |
SET sa.category=studentreserv.reservName , | |
sa.bloodGroup='$studentDetails->bloodGroup', | |
sa.taluk='$studentDetails->taluk', | |
sa.annualIncome='$studentDetails->annualIncome', | |
aadhaar_no='$studentDetails->aadharNo'"; | |
if ($isPg) { | |
$additionalDataUpdateQuery .= " , sa.prev_institute_regiNo = '$studentDetails->graduationRegNo' ,sa.previousSchool = '$studentDetails->graduationInst' , sa.highestExamPassed = '$studentDetails->graduationExam' "; | |
}else{ | |
$additionalDataUpdateQuery .= " , sa.prev_institute_regiNo = '$studentDetails->twelthRegNo' ,sa.previousSchool = '$studentDetails->twelthSchool', sa.highestExamPassed = '$studentDetails->twelthExam' "; | |
} | |
$additionalDataUpdateQuery .= " WHERE asd.studentID IN ($admissionStudentIdsStr)"; | |
$this->executeQuery($additionalDataUpdateQuery); | |
$studentDetails->isTransferedToAMS = 1; | |
$transferedStudentsList[] = $studentDetails; | |
$successCount++; | |
$query = "UPDATE studentaccount sa INNER JOIN $studentTableName asd ON sa.studentID=asd.amsStudentId INNER JOIN batches bt ON bt.batchID=sa.batchID LEFT JOIN nationality n on asd.nationality=n.nationalityName LEFT JOIN student_caste sc ON asd.caste=sc.casteName and sa.religion=sc.religionID SET sa.reservID=IF((asd.reservID <> '' AND asd.reservID <> 0),asd.reservID,NULL),sa.nationality=n.id,sa.casteID = sc.casteID, sa.joiningSemId=bt.semID where asd.studentID='$studentDetails->studentID'"; | |
$this->executeQuery($query); | |
} catch (\Exception $e) { | |
error_log("Transferring students to ams exception :" . $e->getMessage()); | |
$transferedStudentsList[] = $studentDetails; | |
$failedCount++; | |
} | |
} | |
} | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
$response->transferedStudents = $transferedStudentsList; | |
$response->successCount = $successCount; | |
$response->failedCount = $failedCount; | |
$response->totalStudents = count($transferedStudentsList); | |
foreach($admittedStudentList as $student) | |
{ | |
if($amsBatchId !== $student->batchID) { | |
$request = new \stdClass; | |
$request->studentId = $student->studentID; | |
$request->newBatchId = $amsBatchId; | |
$request->oldBatchId = $student->batchID; | |
$request->createdBy = $_SESSION['adminID']; | |
$taskQueue = new AMSTaskQueue(); | |
$params = ['className' => 'com\linways\core\ams\professional\service\StudentService', | |
'methodName' => 'batchChangeAssinc', | |
'methodParams' => [$request]]; | |
$taskQueue->enqueue('EXECUTE SERVICE', $params); | |
} | |
} | |
return $response; | |
} | |
/** | |
* copy admission image to ams | |
* | |
* @param string $admissionImgPath | |
* @return string | |
*/ | |
private function transferStudentImageToAMS($admissionImgPath) | |
{ | |
global $COLLEGE_CODE; | |
$amsImgPath = ""; | |
if ($admissionImgPath != "") { | |
$myimage = explode('/', $admissionImgPath); | |
if (!empty($myimage) && count($myimage) > 4) { | |
$newImageName = $myimage[5]; | |
$oldPath = $admissionImgPath; | |
if (empty($COLLEGE_CODE)) { | |
$newPath = "studentsphoto/" . $newImageName; | |
} else { | |
$newPath = "studentsphoto/$COLLEGE_CODE/" . $newImageName; | |
} | |
if (is_file($oldPath)) { | |
copy($oldPath, '../../' . $newPath); | |
$amsImgPath = '../' . $newPath; | |
} | |
} else { | |
$amsImgPath = $admissionImgPath; | |
} | |
} | |
return $amsImgPath; | |
} | |
/** | |
* method get AdmissionFormTypes | |
* | |
* @param string $sortBy | |
* @param string $sortOrder | |
* @return AdmissionFormType[] | |
* @throws ProfessionalException | |
*/ | |
public function getAdmissionFormTypes($courseTypeCode = NULL, $inlcudeOnlyActiveTypes = FALSE, $sortBy = "name", $sortOrder = "ASC") | |
{ | |
$admissionFormTypes = []; | |
// Validate sort order and sort by | |
RequestUtil::validateSortOrder($sortBy, $sortOrder); | |
if (!empty($courseTypeCode)) { | |
$courseTypeCondition = ""; | |
} | |
$sql = "SELECT aft.*, | |
bct.type_code as courseTypeCode, | |
bct.type_name as courseTypeName | |
FROM applicationFormType aft | |
inner join batch_course_type bct | |
on bct.id = aft.courseTypeId "; | |
$sql .= $inlcudeOnlyActiveTypes ? " AND aft.isActive = 1" : ""; | |
$sql .= $courseTypeCode ? " AND bct.type_code = '$courseTypeCode'" : ""; | |
$sql .= " ORDER BY $sortBy $sortOrder"; | |
try { | |
$admissionFormTypes = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $sql); | |
} | |
return $admissionFormTypes; | |
} | |
/** | |
* Method for get AdmissionFormTypes based on coursetype | |
* | |
* @param string $sortBy | |
* @param string $sortOrder | |
* @return AdmissionFormType[] | |
* @throws ProfessionalException | |
*/ | |
public function getAdmissionFormTypesByCourseType($courseTypeId, $inlcudeOnlyActiveTypes = FALSE, $sortBy = "name", $sortOrder = "ASC") | |
{ | |
$admissionFormTypes = []; | |
// Validate sort order and sort by | |
RequestUtil::validateSortOrder($sortBy, $sortOrder); | |
$sql = "SELECT aft.*, | |
bct.type_code as courseTypeCode, | |
bct.type_name as courseTypeName | |
FROM applicationFormType aft | |
inner join batch_course_type bct | |
on bct.id = aft.courseTypeId | |
WHERE aft.courseTypeId = $courseTypeId "; | |
$sql .= $inlcudeOnlyActiveTypes ? " AND aft.isActive = 1" : ""; | |
$sql .= " ORDER BY $sortBy $sortOrder"; | |
try { | |
$admissionFormTypes = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $sql); | |
} | |
return $admissionFormTypes; | |
} | |
/** | |
* Method for creating admission form type | |
* | |
* @param AdmissionFormType $admissionFormType | |
* @return int | |
*/ | |
public function createAdmissionFormType($admissionFormType) | |
{ | |
$sql = "INSERT INTO applicationFormType ( | |
code, name, | |
description, | |
courseTypeId, | |
applicationYear, | |
applicationPrefix, | |
lastRegistrationDate, | |
applicationFormId, | |
applicationFee, | |
isActive, | |
createdBy, | |
updatedBy, | |
createdDate, | |
updatedDate, | |
hasApplicationFee | |
) | |
VALUES | |
('$admissionFormType->code', | |
'$admissionFormType->name', | |
'$admissionFormType->description', | |
$admissionFormType->courseTypeId, | |
'$admissionFormType->applicationYear', | |
'$admissionFormType->applicationPrefix', | |
'$admissionFormType->lastRegistrationDate', | |
$admissionFormType->applicationFormId, | |
$admissionFormType->applicationFee, | |
$admissionFormType->isActive, | |
$admissionFormType->createdBy, | |
$admissionFormType->updatedBy, | |
utc_timestamp(), | |
utc_timestamp(), | |
$admissionFormType->hasApplicationFee | |
); | |
"; | |
try { | |
return $this->executeQuery($sql); | |
} catch (\Exception $e) { | |
if ($e->getCode() == ProfessionalException::DUPLICATE_ENTRY) { | |
throw new ProfessionalException(ProfessionalException::DUPLICATE_ENTRY, $e->getMessage()); | |
} else { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
} | |
/** | |
* Method for updating admission form type | |
* | |
* @param AdmissionFormType $admissionFormType | |
* | |
*/ | |
public function updateAdmissionFormType($admissionFormType) | |
{ | |
$admissionFormType = $this->realEscapeObject($admissionFormType); | |
$sql = "UPDATE applicationFormType SET | |
name = '$admissionFormType->name', | |
lastRegistrationDate = '$admissionFormType->lastRegistrationDate', | |
description = '$admissionFormType->description', | |
applicationFormId = '$admissionFormType->applicationFormId', | |
applicationFee = '$admissionFormType->applicationFee', | |
isActive = '$admissionFormType->isActive', | |
updatedBy = '$admissionFormType->updatedBy', | |
applicationPrefix = '$admissionFormType->applicationPrefix', | |
updatedDate = utc_timestamp(),hasApplicationFee='$admissionFormType->hasApplicationFee' WHERE id = $admissionFormType->id"; | |
try { | |
return $this->executeQuery($sql); | |
} catch (\Exception $e) { | |
if ($e->getCode() == ProfessionalException::DUPLICATE_ENTRY) { | |
throw new ProfessionalException(ProfessionalException::DUPLICATE_ENTRY, $e->getMessage()); | |
} else { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
} | |
/** | |
* Method for updating admission form type | |
* | |
* @param AdmissionFormType $admissionFormType | |
* | |
*/ | |
public function deleteAdmissionFormType($admissionFormTypeId) | |
{ | |
$admissionFormTypeId = $this->realEscapeString($admissionFormTypeId); | |
$sql = "DELETE FROM applicationFormType WHERE id = $admissionFormTypeId"; | |
try { | |
return $this->executeQuery($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* Method for creating Application Fee Details | |
* | |
* @param ApplicationFeeDetails $admissionFeeDetails | |
* @return int | |
*/ | |
public function createAdmissionFeeDetails($applicationFeeDetails) | |
{ | |
$applicationFeeDetails = $this->realEscapeObject($applicationFeeDetails); | |
$sql = "INSERT INTO applicationFeeDetails ( | |
paymentTypeId, | |
receiptNo, | |
paymentDate, | |
amount, | |
studentId, | |
issuingBank, | |
issuingBranch, | |
createdBy, | |
updatedBy, | |
createdDate, | |
updatedDate | |
) | |
VALUES | |
('$applicationFeeDetails->paymentTypeId', | |
'$applicationFeeDetails->receiptNo', | |
'$applicationFeeDetails->paymentDate', | |
$applicationFeeDetails->amount, | |
'$applicationFeeDetails->studentId', | |
'$applicationFeeDetails->issuingBank', | |
'$applicationFeeDetails->issuingBranch', | |
$applicationFeeDetails->createdBy, | |
$applicationFeeDetails->updatedBy, | |
utc_timestamp(), | |
utc_timestamp() | |
); | |
"; | |
try { | |
return $this->executeQuery($sql); | |
} catch (\Exception $e) { | |
if ($e->getCode() == ProfessionalException::DUPLICATE_ENTRY) { | |
throw new ProfessionalException(ProfessionalException::DUPLICATE_ENTRY, $e->getMessage()); | |
} else { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
} | |
/** | |
* Method for updating applicationFeeDetails | |
* | |
* @param ApplicationFeeDetails $applicationFeeDetails | |
* | |
*/ | |
public function updateApplicationFeeDetails($applicationFeeDetails) | |
{ | |
$applicationFeeDetails = $this->realEscapeObject($applicationFeeDetails); | |
$sql = "UPDATE applicationFeeDetails SET | |
paymentTypeId = '$applicationFeeDetails->paymentTypeId', | |
receiptNo = '$applicationFeeDetails->receiptNo', | |
paymentDate = '$applicationFeeDetails->paymentDate', | |
amount = '$applicationFeeDetails->amount', | |
issuingBank = '$applicationFeeDetails->issuingBank', | |
issuingBranch = '$applicationFeeDetails->issuingBranch', | |
updateDate = utc_timestamp(), | |
updatedBy = '$applicationFeeDetails->updatedBy' | |
WHERE id = $applicationFeeDetails->id"; | |
try { | |
return $this->executeQuery($sql); | |
} catch (\Exception $e) { | |
if ($e->getCode() == ProfessionalException::DUPLICATE_ENTRY) { | |
throw new ProfessionalException(ProfessionalException::DUPLICATE_ENTRY, $e->getMessage()); | |
} else { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
} | |
/** | |
* Method for updating applicationFeeDetails by studentID | |
* | |
* @param ApplicationFeeDetails $applicationFeeDetails | |
* | |
*/ | |
public function updateApplicationFeeDetailsByStudentId($applicationFeeDetails) | |
{ | |
$applicationFeeDetails = $this->realEscapeObject($applicationFeeDetails); | |
$sql = "UPDATE applicationFeeDetails SET | |
paymentTypeId = '$applicationFeeDetails->paymentTypeId', | |
receiptNo = '$applicationFeeDetails->receiptNo', | |
paymentDate = '$applicationFeeDetails->paymentDate', | |
amount = '$applicationFeeDetails->amount', | |
issuingBank = '$applicationFeeDetails->issuingBank', | |
issuingBranch = '$applicationFeeDetails->issuingBranch', | |
updatedDate = utc_timestamp(), | |
updatedBy = '$applicationFeeDetails->updatedBy' | |
WHERE studentId = $applicationFeeDetails->studentId"; | |
try { | |
return $this->executeQuery($sql); | |
} catch (\Exception $e) { | |
if ($e->getCode() == ProfessionalException::DUPLICATE_ENTRY) { | |
throw new ProfessionalException(ProfessionalException::DUPLICATE_ENTRY, $e->getMessage()); | |
} else { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
} | |
/** | |
* method get ApplicationFeeDetails by student Id | |
* | |
* @param int $studentId | |
* @return ApplicationFeeDetails | |
* @throws ProfessionalException | |
*/ | |
public function getApplicationFeeDetailseByStudentId($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$applicationFeeDetails = NULL; | |
$sql = "SELECT * | |
FROM applicationFeeDetails WHERE studentId = $studentId"; | |
try { | |
$applicationFeeDetails = $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $applicationFeeDetails; | |
} | |
/** | |
* get Admission application forms | |
* | |
* @return AdmissionApplicationForm application forms array | |
* @throws ProfessionalException | |
*/ | |
public function getApplicationForms($sortBy = "name", $sortOrder = "ASC") | |
{ | |
$admissionApplicationForms = []; | |
// Validate sort order and sort by | |
RequestUtil::validateSortOrder($sortBy, $sortOrder); | |
$sql = "SELECT aaf.*, | |
bct.type_code as courseTypeCode, | |
bct.type_name as courseTypeName | |
FROM admissionApplicationForm aaf | |
inner join batch_course_type bct on | |
bct.id = aaf.courseTypeId | |
ORDER BY $sortBy $sortOrder"; | |
try { | |
$admissionApplicationForms = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $admissionApplicationForms; | |
} | |
/** | |
* get Admission application forms by courseType | |
* | |
* @return AdmissionApplicationForm application forms array | |
* @throws ProfessionalException | |
*/ | |
public function getApplicationFormsByCourseType($courseTypeId, $sortBy = "name", $sortOrder = "ASC") | |
{ | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$sortBy = $this->realEscapeString($sortBy); | |
$sortOrder = $this->realEscapeString($sortOrder); | |
$admissionApplicationForms = []; | |
// Validate sort order and sort by | |
RequestUtil::validateSortOrder($sortBy, $sortOrder); | |
$sql = "SELECT aaf.*, | |
bct.type_code as courseTypeCode, | |
bct.type_name as courseTypeName | |
FROM admissionApplicationForm aaf | |
inner join batch_course_type bct on | |
bct.id = aaf.courseTypeId | |
WHERE aaf.courseTypeId = $courseTypeId | |
ORDER BY $sortBy $sortOrder"; | |
try { | |
$admissionApplicationForms = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $admissionApplicationForms; | |
} | |
/** | |
* get Admission application form by id | |
* | |
* @return AdmissionApplicationForm admissionApplicationForm | |
* @throws ProfessionalException | |
*/ | |
public function getApplicationFormById($admissionApplicationFormId) | |
{ | |
$admissionApplicationFormId = $this->realEscapeString($admissionApplicationFormId); | |
$admissionApplicationForm = NULL; | |
$sql = "SELECT aaf.*, | |
bct.type_code as courseTypeCode, | |
bct.type_name as courseTypeName | |
FROM admissionApplicationForm aaf | |
inner join batch_course_type bct on | |
bct.id = aaf.courseTypeId | |
WHERE aaf.id = $admissionApplicationFormId"; | |
try { | |
$admissionApplicationForm = $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $admissionApplicationForm; | |
} | |
/** | |
* create seat resvervation for UG | |
* | |
* @param object $seatReservationUG | |
* @throws ProfessionalException | |
*/ | |
public function createSeatReservationUG($seatReservationUGList) | |
{ | |
$seatReservationUGList = $this->realEscapeArray($seatReservationUGList); | |
foreach ($seatReservationUGList as $key => $reservation) { | |
if ($key == 0) { | |
$this->deleteSeatReservationUG($reservation); | |
} | |
$sql = "insert into admission_department_seat_reservation (quotaID, numberofSeat, deptID, courseTypeId, admissionYear) values('$reservation->quotaID', '$reservation->numberofSeat', '$reservation->deptID', '$reservation->courseTypeId', '$reservation->applicationYear')"; | |
try { | |
$this->executeQuery($sql); | |
} catch (\Exception $e) { | |
if ($e->getCode() == ProfessionalException::DUPLICATE_ENTRY) { | |
throw new ProfessionalException(ProfessionalException::DUPLICATE_ENTRY, $e->getMessage()); | |
} else { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
} | |
} | |
/** | |
* delete seat reservation for UG by coursetypeId, admission year, deptID | |
* | |
* @param object $ReservationUG | |
*/ | |
public function deleteSeatReservationUG($reservationUG) | |
{ | |
$reservationUG = $this->realEscapeObject($reservationUG); | |
$sql = "delete from admission_department_seat_reservation where deptID = '$reservationUG->deptID' and courseTypeId = '$reservationUG->courseTypeId' and admissionYear = '$reservationUG->applicationYear'"; | |
try { | |
return $this->executeQuery($sql);; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* Method for getting department-wise reservation for UG Courses | |
* | |
* @param int $courseTypeId | |
* @param int $admissionYear | |
* @param string $sortBy | |
* @param string $sortOrder | |
* @return $objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getDepartmentReservationForUG($courseTypeId, $admissionYear, $sortBy = "deptName", $sortOrder = "ASC") | |
{ | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$admissionYear = $this->realEscapeString($admissionYear); | |
$sortBy = $this->realEscapeString($sortBy); | |
$sortOrder = $this->realEscapeString($sortOrder); | |
$departments = []; | |
// | |
$sql = " SELECT dept.deptID, dept.departmentDesc as deptDescription, dept.deptName ,sum(res.numberofSeat) as totalSeat | |
FROM assigned_dept_courses assigned | |
INNER JOIN department dept ON assigned.deptId = dept.deptID | |
LEFT JOIN (SELECT * FROM admission_department_seat_reservation asdsr WHERE asdsr.courseTypeId=$courseTypeId and asdsr.admissionYear=$admissionYear) res on dept.deptID = res.deptID | |
WHERE assigned.courseTypeId = $courseTypeId group by dept.deptID | |
ORDER BY dept.$sortBy $sortOrder"; | |
// Validate sort order and sort by | |
RequestUtil::validateSortOrder($sortBy, $sortOrder); | |
try { | |
$departments = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $departments; | |
} | |
/** | |
* get reservation quotas and no. | |
* of seats of a department | |
* | |
* @param int $deptID | |
* @param int $courseTypeID | |
* @param string $admissionYear | |
*/ | |
public function getDepartmentReservationQuotas($deptID, $courseTypeId, $admissionYear) | |
{ | |
$deptID = $this->realEscapeObject($deptID); | |
$courseTypeId = $this->realEscapeObject($courseTypeId); | |
$admissionYear = $this->realEscapeObject($admissionYear); | |
$departmentQuotas = []; | |
$sql = "select quota.quotaID, quota.quotaName, quota.quotaDesc, reservation.numberofSeat, CASE WHEN reservation.numberofSeat is null THEN 0 ELSE reservation.numberofSeat end as numberofSeat | |
from admission_quotas quota left join (select * from admission_department_seat_reservation adsr | |
where adsr.deptID = '$deptID' and adsr.courseTypeId = | |
'$courseTypeId' and adsr.admissionYear = '$admissionYear') reservation on reservation.quotaID = quota.quotaID"; | |
try { | |
$departmentQuotas = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $departmentQuotas; | |
} | |
/* | |
* method get getReligionById by Id | |
* @param int $Id | |
* @throws ProfessionalException | |
* @return $religionDetails | |
*/ | |
public function getReligionById($Id) | |
{ | |
$Id = $this->realEscapeObject($Id); | |
$religionDetails = NULL; | |
$sql = "SELECT religionID, religionName from admission_religion WHERE religionID=$Id"; | |
try { | |
$religionDetails = $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $religionDetails; | |
} | |
/** | |
* Method for student login | |
* | |
* @param string $username | |
* @param string $password | |
* @return $objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function studentLogin($username, $password) | |
{ | |
$studentDetails = NULL; | |
$username = $this->realEscapeString($username); | |
$password = $this->realEscapeString($password); | |
$sql = "SELECT studentID, email, studentPassword, studentName,applicationFormTypeId as formTypeId,admissionYear FROM admission_student_details WHERE email='$username' AND studentPassword= md5('$password') "; | |
try { | |
$studentDetails = $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
if ($studentDetails == NULL) { | |
throw new ProfessionalException(ProfessionalException::INVALID_LOGIN, "Login failed.Invalid username or password!"); | |
} | |
return $studentDetails; | |
} | |
/** | |
* Method for resetting student admission password | |
* | |
* @param string $emailID | |
* @param int $rand_number | |
* @param int $courseTypeID | |
* @param string $reset_password | |
*/ | |
public function resetPassword($emailID, $rand_number, $courseTypeId, $reset_password) | |
{ | |
$emailID = $this->realEscapeObject($emailID); | |
$rand_number = $this->realEscapeObject($rand_number); | |
$courseTypeId = $this->realEscapeObject($courseTypeId); | |
$reset_password = $this->realEscapeObject($reset_password); | |
try { | |
$courseType = BatchService::getInstance()->getCourseTypeById($courseTypeId); | |
if ($courseType == NULL) { | |
throw new ProfessionalException(ProfessionalException::COURSE_TYPE_NOT_FOUND, "No course type found for the given id"); | |
} else { | |
$courseTypeCode = $courseType->code; | |
switch ($courseTypeCode) { | |
case CourseType::BTECH: | |
case CourseType::BCOM: | |
case CourseType::BCA: | |
case CourseType::BA: | |
case CourseType::BSC: | |
case CourseType::IMCA: | |
case CourseType::BARCH: | |
$tableName = "admission_student_details_ug"; | |
break; | |
case CourseType::MBA: | |
case CourseType::MSC: | |
case CourseType::MCA: | |
case CourseType::MTECH: | |
case CourseType::MARCH: | |
$tableName = "admission_student_details_pg_affiliated"; | |
break; | |
} | |
$sql = " SELECT asd.studentId FROM admission_forgetpassword afp | |
inner join $tableName asd on asd.email = afp.email | |
WHERE afp.email='$emailID' | |
and afp.random_number = '$rand_number' and afp.courseTypeId = '$courseTypeId'"; | |
$resultObj = $this->executeQueryForObject($sql);; | |
$studentId = $resultObj != NULL ? $resultObj->studentId : NULL; | |
if ($studentId == NULL) { | |
throw new ProfessionalException(ProfessionalException::RESET_PWD_LINK_EXPIRED, 'Reset password link expired!!'); | |
} else { | |
$sql = "UPDATE $tableName SET studentPassword =md5('$reset_password') WHERE studentID ='$studentId'"; | |
$result = $this->executeQuery($sql); | |
$sql = "delete from admission_forgetpassword where email=\"$emailID\""; | |
$result = $this->executeQuery($sql); | |
} | |
} | |
} catch (ProfessionalException $e) { | |
throw $e; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* Method for getting department-wise paid student count | |
* | |
* @param int $courseTypeId | |
* @param | |
* $courseTypeCode | |
* @param string $admissionYear | |
* @return int Count | |
* @throws ProfessionalException | |
*/ | |
public function getPaidStudentCount($deptId, $courseTypeId, $courseTypeCode, $admissionYear) | |
{ | |
$StudentCount = 0; | |
$deptId = $this->realEscapeObject($deptId); | |
$courseTypeId = $this->realEscapeObject($courseTypeId); | |
$courseTypeCode = $this->realEscapeObject($courseTypeCode); | |
$admissionYear = $this->realEscapeObject($admissionYear); | |
switch ($courseTypeCode) { | |
case "B_TECH": | |
$sql = "select count(student.studentID) as PaidStudentCount | |
from admission_btech_remarks remark , admission_student_branch_preference pref, admission_student_details student | |
where remark.studentID = pref.studentID and (remark.payment = 1 or remark.payment = 2 or remark.payment = 3 or remark.payment = 5) | |
and pref.deptprefNo = 1 and pref.deptID = '$deptId' and pref.studentID = student.studentID and student.admissionYear='$admissionYear' and student.courseTypeId = '$courseTypeId'"; | |
break; | |
case "M_TECH": | |
$sql = "select count(student.studentID) as PaidStudentCount | |
from admission_mtech_remarks remark , admission_student_branch_preference_mtech pref, admission_student_details_mtech student | |
where remark.studentID = pref.studentID and (remark.payment = 1 or remark.payment = 2 or remark.payment = 3 or remark.payment = 5) | |
and pref.deptprefNo = 1 and pref.deptID = '$deptId' and pref.studentID = student.studentID and student.admissionYear='$admissionYear' and student.courseTypeId = '$courseTypeId'"; | |
break; | |
case "MBA": | |
$sql = "select count(student.studentID) as PaidStudentCount | |
from admission_mba_remarks remark , admission_student_branch_preference_mba pref, admission_student_details_mba student | |
where remark.studentID = pref.studentID and (remark.payment = 1 or remark.payment = 2 or remark.payment = 3 or remark.payment = 5) | |
and pref.deptprefNo = 1 and pref.deptID = '$deptId' and pref.studentID = student.studentID and student.admissionYear='$admissionYear' and student.courseTypeId = '$courseTypeId'"; | |
break; | |
} | |
try { | |
$StudentCount = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $StudentCount; | |
} | |
/** | |
* Method for getting department-wise verfied student count | |
* | |
* @param int $courseTypeId | |
* @param | |
* $courseTypeCode | |
* @param string $admissionYear | |
* @return int Count | |
* @throws ProfessionalException | |
*/ | |
public function getVerifiedStudentCount($courseTypeId) | |
{ | |
$courseTypeId = $this->realEscapeObject($courseTypeId); | |
try { | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$tablePosfix = "pg_affiliated"; | |
} else { | |
$tablePosfix = "ug"; | |
} | |
$sql = "SELECT count(studentID) as totalCount FROM admission_student_details_$tablePosfix WHERE isVerified=1 AND courseTypeId=$courseTypeId"; | |
$StudentCount = $this->executeQueryForObject($sql)->totalCount; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $StudentCount; | |
} | |
/** | |
* Method for export admission student request deatils | |
* | |
* @param AdmissionStudentExportRequest $admissionStudentExportRequest | |
* <p> NRI status : isNRI should be set null or ALL to list all else set 1 to list only nri 0 to list non nri applications</p> | |
* <p>Supported Sort fields</p> | |
* <p> studentName -> asd.studentName | |
* @throws ProfessionalException | |
*/ | |
public function searchBtechAdmissionStudentDetails($admissionStudentExportRequest) | |
{ | |
$admissionStudentExportRequest = $this->realEscapeObject($admissionStudentExportRequest); | |
$admissionStudentDetails = []; | |
$sql = NULL; | |
if ($admissionStudentExportRequest != NULL) { | |
RequestUtil::validateSortOrder($admissionStudentExportRequest->sortBy, $admissionStudentExportRequest->sortOrder); | |
// Main Query | |
$sql = "SELECT asd.*,abr.remarks,abr.remarkID,abr.office,abr.payment,abr.paymetDate,abt.typeName as twelthBoardName FROM admission_student_details asd | |
LEFT JOIN admission_boardexam_type abt ON asd.twelthBoard = abt.typeID | |
LEFT JOIN admission_btech_remarks abr ON abr.studentID = asd.studentID | |
WHERE asd.admissionYear = '$admissionStudentExportRequest->admissionYear' | |
AND asd.courseTypeId = $admissionStudentExportRequest->courseTypeId "; | |
// Add filter conditions | |
// Student Name | |
if ($admissionStudentExportRequest->studentName) { | |
$sql .= " AND asd.studentName LIKE '%$admissionStudentExportRequest->studentName%' "; | |
} | |
// Application no | |
if ($admissionStudentExportRequest->applicationNo) { | |
$sql .= " AND asd.applicationNo LIKE '%$admissionStudentExportRequest->applicationNo%' "; | |
} | |
// payment status | |
if ($admissionStudentExportRequest->paymentStatus) { | |
$sql .= " AND abr.payment = $admissionStudentExportRequest->paymentStatus "; | |
} | |
// NRI status : isNRI should be set null or ALL to list all else set 1 to list only nri 0 to list non nri applications | |
if ($admissionStudentExportRequest->isNRI != NULL && ($admissionStudentExportRequest->isNRI == "0" || $admissionStudentExportRequest->isNRI == "1")) { | |
$sql .= " AND asd.is_nri = $admissionStudentExportRequest->isNRI"; | |
} | |
$sql .= " ORDER BY asd.$admissionStudentExportRequest->sortBy $admissionStudentExportRequest->sortOrder "; | |
try { | |
$admissionStudentDetails = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} else { | |
throw new ProfessionalException(ProfessionalException::INVALID_REQUEST, "Request is not valid or null."); | |
} | |
return $admissionStudentDetails; | |
} | |
/** | |
* Get admission preferences of given student by studentID | |
* | |
* @param int $studentId | |
* @return $objectList[] | |
*/ | |
public function getAdmissionStudentPreferences($studentId) | |
{ | |
$studentId = $this->realEscapeObject($studentId); | |
$admissionStudentPreferences = []; | |
$sql = NULL; | |
if ($studentId != NULL) { | |
$sql = "select pref.*, dept.deptName from | |
admission_student_branch_preference pref | |
inner join department dept on pref.deptID=dept.deptID | |
where studentID=$studentId"; | |
try { | |
$admissionStudentPreferences = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} else { | |
throw new ProfessionalException(ProfessionalException::INVALID_REQUEST, "Request is not valid or null."); | |
} | |
return $admissionStudentPreferences; | |
} | |
/** | |
* Get admission payment details of given student by studentID | |
* | |
* @param int $studentId | |
* @return $object | |
*/ | |
public function getAdmissionStudentPaymentDetails($studentId) | |
{ | |
$studentId = $this->realEscapeObject($studentId); | |
$paymentDetail = NULL; | |
$sql = ""; | |
if ($studentId != NULL) { | |
$sql = "select * from admission_btech_remarks where studentID = $studentId"; | |
try { | |
$paymentDetail = $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} else { | |
throw new ProfessionalException(ProfessionalException::INVALID_REQUEST, "Request is not valid or null."); | |
} | |
return $paymentDetail; | |
} | |
public function getAdmissionExamSubjectDetailsByType($typeId) | |
{ | |
$typeId = $this->realEscapeObject($typeId); | |
$subjectList = null; | |
$sql = "select * from admission_exam_subjects where typeID=\"$typeId\""; | |
try { | |
$subjectList = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $subjectList; | |
} | |
/** | |
* insert student exam marks | |
* | |
* @param AdmissionStudentMarks $studentExamMarkList | |
* @param int $studentId | |
* @throws ProfessionalException | |
*/ | |
public function addStudentMarksUg($studentExamMarkList, $studentId) | |
{ | |
$studentExamMarkList = $this->realEscapeArray($studentExamMarkList); | |
$studentId = $this->realEscapeObject($studentId); | |
$values = []; | |
foreach ($studentExamMarkList as $studentExamMark) { | |
$values[] = "('$studentId','$studentExamMark->typeId', '$studentExamMark->subjectId', '$studentExamMark->mark', '$studentExamMark->maxMark', '$studentExamMark->eleventhMark', '$studentExamMark->eleventhMaxMark')"; | |
} | |
$sql = "INSERT INTO admission_student_marks_ug(studentID, typeID, subjectID, mark, maxMark, eleventhMark, eleventhMaxMark) VALUES " . implode(', ', $values); | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
public function deleteStudentMarksUg($studentId, $typeId) | |
{ | |
$studentId = $this->realEscapeObject($studentId); | |
$typeId = $this->realEscapeObject($typeId); | |
$sql = "DELETE FROM admission_student_marks_ug WHERE studentID=$studentId"; | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* add admission advance fee for student | |
* | |
* @param AdmissionAdvanceFee $admissionAdvanceFee | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function addAdmissionAdvanceFee($admissionAdvanceFee) | |
{ | |
$admissionAdvanceFee = $this->realEscapeObject($admissionAdvanceFee); | |
$billNo = CommonService::getInstance()->getSettings(AdmissionConstants::SETTINGS_TYPE_ADMISSION_MODULE, AdmissionConstants::STUDENT_ADMISSION_BILL_NO_LAST); | |
$billNo++; | |
$billNo = CommonService::getInstance()->appendZero($billNo, 3); | |
CommonService::getInstance()->updateSettings(AdmissionConstants::SETTINGS_TYPE_ADMISSION_MODULE, AdmissionConstants::STUDENT_ADMISSION_BILL_NO_LAST, $billNo); | |
$sql = "INSERT INTO admissionAdvanceFee(studentId, courseTypeId, amount, mode, ddNumber, ddDate, bankName, bankBranch, date, receiptNo, checkNo, remarks, chequeDate, createdBy, createdDate, updatedBy, updatedDate) VALUES($admissionAdvanceFee->studentId, $admissionAdvanceFee->courseTypeId, $admissionAdvanceFee->amount, '$admissionAdvanceFee->mode', '$admissionAdvanceFee->ddNumber', '$admissionAdvanceFee->ddDate', '$admissionAdvanceFee->bankName', '$admissionAdvanceFee->bankBranch', '" . date('Y-m-d', strtotime($admissionAdvanceFee->date)) . "', $billNo, '$admissionAdvanceFee->checkNo', '$admissionAdvanceFee->remarks', '" . ($admissionAdvanceFee->chequeDate ? date('Y-m-d', strtotime($admissionAdvanceFee->chequeDate)) : '') . "', $admissionAdvanceFee->createdBy, utc_timestamp(), $admissionAdvanceFee->updatedBy, utc_timestamp())"; | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* update admission advance fee for student | |
* | |
* @param AdmissionAdvanceFee $admissionAdvanceFee | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function updateAdmissionAdvanceFee($admissionAdvanceFee) | |
{ | |
$admissionAdvanceFee = $this->realEscapeObject($admissionAdvanceFee); | |
$sql = "UPDATE admissionAdvanceFee SET amount=$admissionAdvanceFee->amount, mode='$admissionAdvanceFee->mode', date='" . date('Y-m-d', strtotime($admissionAdvanceFee->date)) . "', ddNumber='$admissionAdvanceFee->ddNumber', ddDate='" . ($admissionAdvanceFee->ddDate ? date('Y-m-d', strtotime($admissionAdvanceFee->ddDate)) : '') . "', bankName='$admissionAdvanceFee->bankName', bankBranch='$admissionAdvanceFee->bankBranch', checkNo='$admissionAdvanceFee->checkNo', remarks='$admissionAdvanceFee->remarks', chequeDate='" . ($admissionAdvanceFee->chequeDate ? date('Y-m-d', strtotime($admissionAdvanceFee->chequeDate)) : '') . "', updatedBy=$admissionAdvanceFee->updatedBy, updatedDate=utc_timestamp() WHERE studentId=$admissionAdvanceFee->studentId AND courseTypeId=$admissionAdvanceFee->courseTypeId AND id=$admissionAdvanceFee->id"; | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get admission advance fee by student | |
* | |
* @param int $studentId | |
* @param int $courseTypeId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getAdmissionAdvanceFee($studentId, $courseTypeId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$sql = "SELECT * FROM admissionAdvanceFee WHERE studentId=$studentId AND courseTypeId=$courseTypeId order by date desc"; | |
try { | |
return $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get admission advance fee by student | |
* | |
* @param int $studentId | |
* @param int $courseTypeId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getTotalAdmissionAdvanceFee($studentId, $courseTypeId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$sql = "SELECT sum(amount) as amount FROM admissionAdvanceFee WHERE studentId=$studentId AND courseTypeId=$courseTypeId order by date desc"; | |
try { | |
return $this->executeQueryForObject($sql)->amount; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get admission advance fee by id | |
* | |
* @param int $id | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getAdmissionAdvanceFeeById($id) | |
{ | |
$id = $this->realEscapeString($id); | |
$sql = "SELECT * FROM admissionAdvanceFee WHERE id=$id"; | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get community by religion | |
* | |
* @param string $religion | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getCommunityByReligion($religion) | |
{ | |
$religion = $this->realEscapeString($religion); | |
$sql = "SELECT ac.communityID, ac.communityName from admission_community ac INNER JOIN admission_religion ar ON ar.religionID=ac.religionID WHERE ar.religionName ='$religion'"; | |
try { | |
return $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* Method for add offline payment details | |
* | |
* @param StudentOfflinePaymentRequest $studentOfflinePaymentRequest | |
* @throws ProfessionalException | |
*/ | |
public function addAdmissionStudentOfflinePayment($studentOfflinePaymentRequest) | |
{ | |
$studentOfflinePaymentRequest = $this->realEscapeObject($studentOfflinePaymentRequest); | |
$billNo = CommonService::getInstance()->getSettings(AdmissionConstants::SETTINGS_TYPE_ADMISSION_MODULE, AdmissionConstants::STUDENT_ADMISSION_BILL_NO_LAST); | |
$billNo++; | |
$billNo = CommonService::getInstance()->appendZero($billNo, 3); | |
$paymentDate = $studentOfflinePaymentRequest->paymentDate ? "'" . date("Y-m-d", strtotime($studentOfflinePaymentRequest->paymentDate)) . "'" : 'utc_timestamp()'; | |
$sql = "INSERT INTO admission_student_offline_payment_ug ( | |
studentId, | |
ddNumber, | |
ddDate, | |
bankName, | |
bankBranch, | |
admissionYear, | |
courseTypeId, | |
paymentDate, | |
receiptNo, | |
checkNo, | |
remarks, | |
chequeDate, | |
neftTransfId | |
) | |
VALUES | |
('$studentOfflinePaymentRequest->studentId', | |
'$studentOfflinePaymentRequest->ddNumber', | |
'$studentOfflinePaymentRequest->ddDate', | |
'$studentOfflinePaymentRequest->bankName', | |
'$studentOfflinePaymentRequest->bankBranch', | |
'$studentOfflinePaymentRequest->admissionYear', | |
$studentOfflinePaymentRequest->courseTypeId, | |
'".date('Y-m-d', strtotime($studentOfflinePaymentRequest->paymentDate))."', | |
$billNo, | |
'$studentOfflinePaymentRequest->checkNo', | |
'$studentOfflinePaymentRequest->remarks', | |
'" . ($studentOfflinePaymentRequest->chequeDate ? date('Y-m-d', strtotime($studentOfflinePaymentRequest->chequeDate)) : '') . "','$studentOfflinePaymentRequest->neftTransfId' | |
); | |
"; | |
try { | |
$this->executeQueryForObject($sql); | |
CommonService::getInstance()->updateSettings(AdmissionConstants::SETTINGS_TYPE_ADMISSION_MODULE, AdmissionConstants::STUDENT_ADMISSION_BILL_NO_LAST, $billNo); | |
$sqlUpdate = "UPDATE admission_student_details_ug SET paymentStatus = '" . AdmissionPaymentStatus::SUCCESS . "', paymentMethod = '$studentOfflinePaymentRequest->offlinePaymentMode' WHERE studentID = $studentOfflinePaymentRequest->studentId "; | |
$this->executeQueryForObject($sqlUpdate); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* Method for update offline payment details | |
* | |
* @param StudentOfflinePaymentRequest $studentOfflinePaymentRequest | |
* @throws ProfessionalException | |
*/ | |
public function updateAdmissionStudentOfflinePayment($studentOfflinePaymentRequest) | |
{ | |
$paymentDate = $studentOfflinePaymentRequest->paymentDate ? "'" . date("Y-m-d", strtotime($studentOfflinePaymentRequest->paymentDate)) . "'" : 'utc_timestamp()'; | |
$sql = "UPDATE admission_student_offline_payment_ug SET ddNumber = '$studentOfflinePaymentRequest->ddNumber', | |
ddDate = '$studentOfflinePaymentRequest->ddDate', | |
bankName = '$studentOfflinePaymentRequest->bankName', | |
bankBranch = '$studentOfflinePaymentRequest->bankBranch', | |
checkNo = '$studentOfflinePaymentRequest->checkNo', | |
remarks = '$studentOfflinePaymentRequest->remarks', | |
chequeDate = '" . ($studentOfflinePaymentRequest->chequeDate ? date('Y-m-d', strtotime($studentOfflinePaymentRequest->chequeDate)) : '') . "', | |
neftTransfId = '$studentOfflinePaymentRequest->neftTransfId', | |
paymentDate = $paymentDate | |
WHERE studentId = '$studentOfflinePaymentRequest->studentId'"; | |
try { | |
$this->executeQueryForObject($sql); | |
$sqlUpdate = "UPDATE admission_student_details_ug SET paymentStatus = '" . AdmissionPaymentStatus::SUCCESS . "', paymentMethod = '$studentOfflinePaymentRequest->offlinePaymentMode' WHERE studentID = $studentOfflinePaymentRequest->studentId "; | |
$this->executeQueryForObject($sqlUpdate); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
public function getApplicationFeePaymentDetailsUg($studentId, $mode) | |
{ | |
if ($mode == AdmissionPaymentMode::ONLINE) { | |
$sql = "SELECT id, clnt_txn_ref, receiptNo, dateOfTrasaction,'Online' as remarks FROM admission_student_online_payment_ug WHERE studentID=$studentId"; | |
} else { | |
$sql = "SELECT id, receiptNo, paymentDate as dateOfTrasaction, remarks FROM admission_student_offline_payment_ug WHERE studentID=$studentId"; | |
} | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
public function getApplicationFeePaymentDetailsPg($studentId, $mode) | |
{ | |
if ($mode == AdmissionPaymentMode::ONLINE) { | |
$sql = "SELECT receiptNo, dateOfTrasaction, 'Online' as remarks FROM admission_student_online_payment_pg WHERE studentID=$studentId"; | |
} else { | |
$sql = "SELECT receiptNo, paymentDate as dateOfTrasaction, remarks FROM admission_student_offline_payment_pg WHERE studentID=$studentId"; | |
} | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
public function getAdmissionQuotaByName($quotaName) | |
{ | |
$quotaName = $this->realEscapeString($quotaName); | |
$sql = "SELECT * FROM admission_quotas WHERE quotaName = '$quotaName'"; | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
public function getAdmissionQuota() | |
{ | |
$quotaName = $this->realEscapeString($quotaName); | |
$sql = "SELECT * FROM admission_quotas"; | |
try { | |
return $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get verified student details | |
* | |
* @param AdmissionStudentRequest $admissionStudentRequest | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getVerifiedStudents($admissionStudentRequest) | |
{ | |
$admissionStudentRequest = $this->realEscapeObject($admissionStudentRequest); | |
$isPg = BatchService::getInstance()->getCourseTypeById($admissionStudentRequest->courseTypeId)->isPG; | |
if ($isPg) { | |
$tablePosfix = "pg_affiliated"; | |
} else { | |
$tablePosfix = "ug"; | |
} | |
$admissionStudentResponse = new AdmissionStudentResponse(); | |
$cond = ""; | |
$sql_count = "select count(asd.studentID) as totalRecord FROM admission_student_details_$tablePosfix asd LEFT JOIN applicationFormType form ON asd.courseTypeId = form.courseTypeId AND asd.applicationFormTypeId=form.id AND form.applicationYear=$admissionStudentRequest->admissionYear LEFT JOIN admission_boardexam_type abt ON asd.twelthBoard = abt.typeID WHERE asd.isVerified=1 AND asd.admissionYear=$admissionStudentRequest->admissionYear AND asd.courseTypeId=$admissionStudentRequest->courseTypeId "; | |
$sql = "select asd.studentID, asd.studentName, concat(form.applicationPrefix,asd.applicationNo) as applicationNo, asd.capId,asd.createdDate, asd.email, asd.mobilePhone, | |
abt.typeName as twelthBoard, applicationFormTypeId, asd.paymentMethod, asd.paymentStatus,asd.isAdmitted, asd.isVerified, asd.isRejected ".($isPg==0?",asd.indexMarkRank, asd.indexMark":"")." FROM admission_student_details_$tablePosfix asd LEFT JOIN applicationFormType form ON asd.courseTypeId = form.courseTypeId AND asd.applicationFormTypeId=form.id AND form.applicationYear=$admissionStudentRequest->admissionYear LEFT JOIN admission_boardexam_type abt ON asd.twelthBoard = abt.typeID WHERE asd.isVerified=1 AND asd.admissionYear=$admissionStudentRequest->admissionYear AND asd.courseTypeId=$admissionStudentRequest->courseTypeId "; | |
if ($admissionStudentRequest->studentName) { | |
$cond .= "AND asd.studentName like '%$admissionStudentRequest->studentName%' "; | |
} | |
if ($admissionStudentRequest->applicationNo) { | |
$cond .= "AND concat(form.applicationPrefix,asd.applicationNo) like \"%" . $admissionStudentRequest->applicationNo . "%\" "; | |
} | |
switch ($admissionStudentRequest->applnStatus) { | |
case AdmissionStatus::ADMIT_CANCEL: | |
$cond .= "AND asd.isRejected='" . AdmissionStatus::ADMIT_CANCEL . "' "; | |
break; | |
case AdmissionStatus::VERIFIED: | |
$cond .= " AND asd.isVerified=1 AND asd.isAdmitted !=1 "; | |
break; | |
case AdmissionStatus::ADMITTED: | |
$cond .= " AND asd.isAdmitted=1 "; | |
break; | |
} | |
if ($admissionStudentRequest->formTypeId) { | |
$cond .= " AND asd.applicationFormTypeId = $admissionStudentRequest->formTypeId "; | |
} | |
if($admissionStudentRequest->fromDate && $admissionStudentRequest->toDate) | |
{ | |
$cond .= " AND asd.createdDate BETWEEN CAST(\"".date('Y-m-d', strtotime($admissionStudentRequest->fromDate))."\" AS DATETIME) AND CAST(\"".date('Y-m-d', strtotime($admissionStudentRequest->toDate))."\" AS DATETIME)"; | |
} | |
if ($admissionStudentRequest->sortBy && $admissionStudentRequest->sortOrder) { | |
if ($admissionStudentRequest->sortBy == 'indexMarkRank') { | |
$cond .= "ORDER BY CASE WHEN asd.$admissionStudentRequest->sortBy is null then 1 else 0 end, $admissionStudentRequest->sortBy $admissionStudentRequest->sortOrder "; | |
} else { | |
$cond .= "ORDER BY asd.$admissionStudentRequest->sortBy $admissionStudentRequest->sortOrder "; | |
} | |
} | |
$sql .= $cond; | |
$sql_count .= $cond; | |
try { | |
$admissionStudentResponse->totalRecords = $this->executeQueryForObject($sql_count)->totalRecord; | |
if ($admissionStudentRequest->isExport) { | |
$admissionStudentRequest->endIndex = $admissionStudentResponse->totalRecords; | |
} | |
$sql .= "LIMIT $admissionStudentRequest->startIndex,$admissionStudentRequest->endIndex"; | |
$admissionStudentResponse->students = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $admissionStudentResponse; | |
} | |
/** | |
* cancel student admission verification | |
* | |
* @param int $studentId | |
* @param int $courseTypeId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function cancelVerification($studentId, $courseTypeId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
try { | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$tablePosfix = "pg_affiliated"; | |
} else { | |
$tablePosfix = "ug"; | |
} | |
$sql = "UPDATE admission_student_details_$tablePosfix SET isRejected='" . AdmissionStatus::VERIFICATION_CANCEL . "', isVerified=0 WHERE studentID=$studentId"; | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* cancel student admission | |
* | |
* @param int $studentId | |
* @param int $courseTypeId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function cancelAdmission($studentId, $courseTypeId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
try { | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$tablePosfix = "pg_affiliated"; | |
} else { | |
$tablePosfix = "ug"; | |
} | |
$sql = "UPDATE admission_student_details_$tablePosfix SET isRejected='" . AdmissionStatus::ADMIT_CANCEL . "', isAdmitted=0 WHERE studentID=$studentId"; | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* | |
* @param int $studentId | |
* @param string $admissionType | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
* @deprecated | |
*/ | |
public function getOldAdmissionStudentPaymentReqInfoUG($studentId, $admissionType = "MANAGMENT") | |
{ | |
$tableName = null; | |
switch ($admissionType) { | |
case "MANAGMENT": | |
$sql = " select studentName,email,mobilePhone from admission_student_details where studentID = $studentId"; | |
break; | |
case "M_TECH": | |
// TODO | |
break; | |
} | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* Make admission payment for a student | |
* $admissionType - 'MANAGMENT','MERIT' | |
* | |
* @param StudentOnlinePaymentRequest $studentOnlinePaymentRequest | |
* @deprecated | |
*/ | |
public function initiatePaymentOldAdmissionUG($studentOnlinePaymentRequest, $admissionType = "MANAGMENT", $module = 'ADMISSION', $category = 'ALL') | |
{ | |
$studentOnlinePaymentRequest = $this->realEscapeObject($studentOnlinePaymentRequest); | |
$module = $this->realEscapeString($module); | |
$category = $this->realEscapeString($category); | |
$admissionType = $this->realEscapeString($admissionType); | |
$clnt_txn_ref = mt_rand(); | |
// Checking whether this student has alredy tried to make payment | |
$sql = "SELECT clnt_txn_ref FROM admission_student_online_payment WHERE studentId = '$studentOnlinePaymentRequest->studentId'"; | |
$studentPayment = $this->executeQueryForObject($sql); | |
$amount = $studentOnlinePaymentRequest->amount; | |
$isEditFromParam = $studentOnlinePaymentRequest->isEdit ? '{from:stdEdit}' : ''; | |
if (empty($studentPayment)) { | |
$sql = "INSERT INTO admission_student_online_payment (studentId, clnt_txn_ref, numberOfAttempts, status, applicationNo, admissionYear, dateOfTrasaction) VALUES('$studentOnlinePaymentRequest->studentId','$clnt_txn_ref', 1, '" . AdmissionPaymentStatus::PENDING . "', '" . $studentOnlinePaymentRequest->applicationNo . "', '" . $studentOnlinePaymentRequest->admissionYear . "','" . date("d-m-Y") . "')"; | |
} else { | |
$sql = "UPDATE admission_student_online_payment SET clnt_txn_ref='$clnt_txn_ref', status = '" . AdmissionPaymentStatus::PENDING . "', dateOfTrasaction = \"" . date("d-m-Y") . "\" WHERE studentId = '$studentOnlinePaymentRequest->studentId'"; | |
} | |
$this->executeQuery($sql); | |
$sql = "UPDATE admission_student_details SET paymentStatus = '" . AdmissionPaymentStatus::PENDING . "', paymentMethod = '" . AdmissionPaymentMode::ONLINE . "' WHERE studentId = $studentOnlinePaymentRequest->studentId "; | |
$this->executeQuery($sql); | |
$admissionStudentDetails = $this->getOldAdmissionStudentPaymentReqInfoUG($studentOnlinePaymentRequest->studentId, $admissionType); | |
if (!empty($admissionStudentDetails)) { | |
$exePaymentReq = new ExecutePaymentRequest(); | |
$exePaymentReq->module = $module; | |
$exePaymentReq->category = $category; | |
$exePaymentReq->amount = $amount; | |
$exePaymentReq->currency = 'INR'; | |
$exePaymentReq->returnURL = $studentOnlinePaymentRequest->returnURL; | |
$exePaymentReq->timeStamp = date("d-m-Y"); | |
$exePaymentReq->txnId = $clnt_txn_ref; | |
$exePaymentReq->productInfo = 'Admission Application Fee'; | |
$exePaymentReq->email = $admissionStudentDetails->email; | |
$exePaymentReq->phone = $admissionStudentDetails->mobilePhone; | |
$exePaymentReq->userName = $admissionStudentDetails->studentName; | |
$exePaymentReq->userId = $studentOnlinePaymentRequest->studentId; | |
$userDfParams = []; | |
$userDfParams['studentId'] = $studentOnlinePaymentRequest->studentId; | |
$userDfParams['courseTypeId'] = $studentOnlinePaymentRequest->courseTypeId; | |
$userDfParams['isEdit'] = $studentOnlinePaymentRequest->isEdit; | |
$exePaymentReq->userdfParams = $userDfParams; | |
PaymentGatewayService::getInstance()->executePayment($exePaymentReq); | |
} else { | |
throw new ProfessionalException(ProfessionalException::ADMISSION_INVALID_STUDENTDETAILS, "Student Details are null for studentId=$studentOnlinePaymentRequest->studentId and coursetypeId = $studentOnlinePaymentRequest->courseTypeId"); | |
} | |
} | |
/** | |
* update payment status of a pg student | |
* | |
* @param int $studentID | |
* @param string $status | |
* @deprecated | |
*/ | |
public function updatePaymentStatusOldAdmission($studentID, $status, $paymentGateway_txn_id) | |
{ | |
// $receiptNo =""; | |
// if($status == AdmissionPaymentStatus::SUCCESS) | |
// { | |
// $billNo = CommonService::getInstance()->getSettings(AdmissionConstants::SETTINGS_TYPE_ADMISSION_MODULE, AdmissionConstants::STUDENT_ADMISSION_BILL_NO_LAST); | |
// $billNo++; | |
// $billNo = CommonService::getInstance()->appendZero($billNo, 3); | |
// $receiptNo =", receiptNo=$billNo"; | |
// } | |
try { | |
$sql = " UPDATE admission_student_online_payment SET tpsl_txn_id = '$paymentGateway_txn_id', status = '$status' WHERE studentID = $studentID "; | |
$result = $this->executeQueryForObject($sql); | |
$sql = " UPDATE admission_student_details SET paymentStatus = '$status' WHERE studentID = $studentID "; | |
$result = $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* | |
* @param string $email | |
* @throws ProfessionalException | |
* @deprecated | |
*/ | |
public function getStudentIdOldAdmissionByStudentAccount($studentAccount) | |
{ | |
$studentId = null; | |
try { | |
$sql = " Select studentId from admission_student_details where studentAccount = '$studentAccount'"; | |
$studentId = $this->executeQueryForObject($sql)->studentId; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $studentId; | |
} | |
/** | |
* reject student application | |
* | |
* @param int $studentId | |
* @param int $courseTypeId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function rejectApplication($studentId, $courseTypeId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
try { | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$tablePosfix = "pg_affiliated"; | |
} else { | |
$tablePosfix = "ug"; | |
} | |
$sql = "UPDATE admission_student_details_$tablePosfix SET isRejected='" . AdmissionStatus::APPLICATION_REJECTED . "', isAdmitted=0, isVerified=0 WHERE studentID=$studentId"; | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* cancel application rejection of student | |
* | |
* @param int $studentId | |
* @param int $courseTypeId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function cancelRejectApplication($studentId, $courseTypeId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
try { | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$tablePosfix = "pg_affiliated"; | |
} else { | |
$tablePosfix = "ug"; | |
} | |
$sql = "UPDATE admission_student_details_$tablePosfix SET isRejected='', isAdmitted=0, isVerified=0 WHERE studentID=$studentId"; | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get rejected student details | |
* | |
* @param AdmissionStudentRequest $admissionStudentRequest | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getRejectedStudents($admissionStudentRequest) | |
{ | |
$admissionStudentRequest = $this->realEscapeObject($admissionStudentRequest); | |
$isPg = BatchService::getInstance()->getCourseTypeById($admissionStudentRequest->courseTypeId)->isPG; | |
if ($isPg) { | |
$tablePosfix = "pg_affiliated"; | |
} else { | |
$tablePosfix = "ug"; | |
} | |
$admissionStudentResponse = new AdmissionStudentResponse(); | |
$cond = ""; | |
$sql_count = "select count(asd.studentID) totalRecord FROM admission_student_details_$tablePosfix asd LEFT JOIN applicationFormType form ON asd.courseTypeId = form.courseTypeId AND asd.applicationFormTypeId=form.id AND form.applicationYear=$admissionStudentRequest->admissionYear LEFT JOIN admission_boardexam_type abt ON asd.twelthBoard = abt.typeID WHERE asd.isRejected='" . AdmissionStatus::APPLICATION_REJECTED . "' AND asd.admissionYear=$admissionStudentRequest->admissionYear AND asd.courseTypeId=$admissionStudentRequest->courseTypeId "; | |
$sql = "select asd.studentID, asd.studentName, concat(form.applicationPrefix,asd.applicationNo) as applicationNo, asd.createdDate, asd.email, asd.mobilePhone, | |
abt.typeName as twelthBoard, applicationFormTypeId, asd.paymentMethod, asd.paymentStatus,asd.isAdmitted, asd.isVerified, asd.isRejected FROM admission_student_details_$tablePosfix asd LEFT JOIN applicationFormType form ON asd.courseTypeId = form.courseTypeId AND asd.applicationFormTypeId=form.id AND form.applicationYear=$admissionStudentRequest->admissionYear LEFT JOIN admission_boardexam_type abt ON asd.twelthBoard = abt.typeID WHERE asd.isRejected='" . AdmissionStatus::APPLICATION_REJECTED . "' AND asd.admissionYear=$admissionStudentRequest->admissionYear AND asd.courseTypeId=$admissionStudentRequest->courseTypeId "; | |
if ($admissionStudentRequest->studentName) { | |
$cond = "AND asd.studentName like '%$admissionStudentRequest->studentName%' "; | |
} | |
if ($admissionStudentRequest->applicationNo) { | |
$cond = "AND concat(form.applicationPrefix,asd.applicationNo) like \"%" . $admissionStudentRequest->applicationNo . "%\" "; | |
} | |
if ($admissionStudentRequest->formTypeId) { | |
$cond .= " AND asd.applicationFormTypeId=$admissionStudentRequest->formTypeId"; | |
} | |
$sql_count .= $cond; | |
try { | |
$admissionStudentResponse->totalRecords = $this->executeQueryForObject($sql_count)->totalRecord; | |
if ($admissionStudentRequest->isExport) { | |
$admissionStudentRequest->endIndex = $admissionStudentResponse->totalRecords; | |
} | |
$sql .= $cond . "LIMIT $admissionStudentRequest->startIndex,$admissionStudentRequest->endIndex"; | |
$admissionStudentResponse->students = $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $admissionStudentResponse; | |
} | |
/** | |
* update student care of field | |
* | |
* @param int $studentId | |
* @param int $courseTypeId | |
* @param string $careOf | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function updateCareOf($studentId, $courseTypeId, $careOf) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$careOf = $this->realEscapeString($careOf); | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_PG; | |
} else { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_UG; | |
} | |
try { | |
$sql = "UPDATE $studentTableName SET careOf='$careOf' WHERE studentID=$studentId"; | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* update student remarks | |
* | |
* @param int $studentId | |
* @param int $courseTypeId | |
* @param string $remarks | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function updateRemarks($studentId, $courseTypeId, $remarks) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$remarks = $this->realEscapeString($remarks); | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_PG; | |
} else { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_UG; | |
} | |
try { | |
$sql = "UPDATE $studentTableName SET remarks='$remarks' WHERE studentID=$studentId"; | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get admission quota by quotaID | |
* | |
* @param int $quotaId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getAdmissionQuotaById($quotaId) | |
{ | |
$quotaId = $this->realEscapeString($quotaId); | |
$sql = "SELECT * FROM admission_quotas WHERE quotaID = $quotaId"; | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get admission seat filled status | |
* | |
* @param int $courseTypeId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getAdmissionSeatFilledStatus($courseTypeId) | |
{ | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_PG; | |
} else { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_UG; | |
} | |
$sql = "SELECT sr.deptID, dept.deptName, aq.quotaID, aq.quotaName, sr.numberofSeat, (SELECT count(studentID) FROM $studentTableName WHERE admittedDeptId=sr.deptID AND courseTypeId=sr.courseTypeId AND seatReservationQuotaId=sr.quotaID AND (isRejected is null OR isRejected='') AND admissionYear='".date('Y')."') AS filledSeats, (SELECT count(studentID) FROM $studentTableName WHERE admittedDeptId=sr.deptID AND courseTypeId=sr.courseTypeId AND (isRejected is null OR isRejected='') AND admissionYear='".date('Y')."') AS totalfilledSeats, (SELECT SUM(numberofSeat) FROM admission_department_seat_reservation WHERE deptID=sr.deptID AND courseTypeId=sr.courseTypeId AND admissionYear='".date('Y')."') AS totalSeats FROM admission_department_seat_reservation sr INNER JOIN admission_quotas aq ON aq.quotaID=sr.quotaID INNER JOIN department dept ON dept.deptID=sr.deptID WHERE sr.courseTypeId=$courseTypeId ORDER BY sr.deptID, aq.quotaID"; | |
try { | |
return $this->executeQueryForList($sql, $this->mapper[AdmissionServiceMapper::GET_SEAT_FILLED_STATUS]); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
public function updateRefund($studentId, $courseTypeId) | |
{ | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_PG; | |
} else { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_UG; | |
} | |
try { | |
$sql = "UPDATE $studentTableName SET isRefund=1 WHERE studentID=$studentId"; | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* add fee structure | |
* | |
* @param FeeStructure $feeStructure | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function addFeeStructure($feeStructure) | |
{ | |
$feeStructure = $this->realEscapeObject($feeStructure); | |
$sql = "INSERT INTO fee_structure (name, description, createdBy, createdDate, updatedBy, updatedDate) values('$feeStructure->name','$feeStructure->description', $feeStructure->createdBy, utc_timestamp(), $feeStructure->updatedBy, utc_timestamp())"; | |
try { | |
return $this->executeQueryForObject($sql, true); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* update fee structure | |
* | |
* @param FeeStructure $feeStructure | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function updateFeeStructure($feeStructure) | |
{ | |
$feeStructure = $this->realEscapeObject($feeStructure); | |
$sql = "UPDATE fee_structure SET name='$feeStructure->name', description='$feeStructure->description', updatedBy=$feeStructure->updatedBy, updatedDate=utc_timestamp() WHERE id=$feeStructure->id"; | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* delete fee structure | |
* | |
* @param int $id | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function deleteFeeStructure($id) | |
{ | |
$id = $this->realEscapeString($id); | |
$sql = "DELETE FROM fee_structure WHERE id=$id"; | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get all fee structure | |
* | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getFeeStructure() | |
{ | |
$sql = "SELECT * FROM fee_structure"; | |
try { | |
return $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get fee structure by id | |
* | |
* @param int $id | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getFeeStructureById($id) | |
{ | |
$id = $this->realEscapeString($id); | |
$sql = "SELECT * FROM fee_structure WHERE id=$id"; | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* add fee heads to fee structure | |
* | |
* @param array $feeStructureFeeHeadList | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function addFeeStructureFeeHead($feeStructureFeeHeadList) | |
{ | |
$feeStructureFeeHeadList = $this->realEscapeArray($feeStructureFeeHeadList); | |
$value = []; | |
$sql = "INSERT INTO fee_structure_fee_head (fee_structure_id, fee_head_id, amount, createdBy, createdDate, updatedBy, updatedDate) VALUES "; | |
foreach ($feeStructureFeeHeadList as $feeStructureFeeHead) { | |
$value[] = "($feeStructureFeeHead->feeStructureId, $feeStructureFeeHead->feeHeadId, '$feeStructureFeeHead->amount', $feeStructureFeeHead->createdBy, utc_timestamp(), $feeStructureFeeHead->updatedBy, utc_timestamp())"; | |
} | |
try { | |
$sql .= implode(', ', $value); | |
return $this->executeQueryForObject($sql, true); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* delete fee heads from fee structure by fee structure id | |
* | |
* @param int $feeStructureId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function deleteFeeStructureFeeHeadByFeeStructureId($feeStructureId) | |
{ | |
$feeStructureId = $this->realEscapeString($feeStructureId); | |
$sql = "DELETE FROM fee_structure_fee_head WHERE fee_structure_id=$feeStructureId"; | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get fee heads from fee structure by fee structure id | |
* | |
* @param int $feeStructureId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getFeeStructureFeeHeadByFeeStructureId($feeStructureId) | |
{ | |
$feeStructureId = $this->realEscapeString($feeStructureId); | |
$feeModuleVersion = CommonService::getInstance()->getSettings(SettingsConstants::FEE_MODULE, SettingsConstants::FEE_MODULE_VERSION); | |
$feeHeadTableName = $feeModuleVersion == 2 ? 'fm_fee_head' : 'feeHead'; | |
$sql = "SELECT fsfh.id, fsfh.fee_structure_id, fsfh.fee_head_id, fh.name, fsfh.amount FROM fee_structure_fee_head fsfh INNER JOIN $feeHeadTableName fh ON fsfh.fee_head_id=fh.id WHERE fee_structure_id=$feeStructureId"; | |
try { | |
return $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
public function asignFeeStructureToStudent($studentId, $courseTypeId, $feeStructureId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$feeStructureId = $this->realEscapeString($feeStructureId); | |
$sql = "INSERT INTO fee_structure_asigned_studentwise (student_id, courseTypeId, fee_structure_id, fee_head_id, amount) SELECT $studentId, $courseTypeId, fee_structure_id, fee_head_id, amount WHERE fee_structure_id=$feeStructureId"; | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* asign fee heads to student for fee structure | |
* | |
* @param array $feeStructureAsignedStudentWiseList | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function asignFeeHeadToStudent($feeStructureAsignedStudentWiseList) | |
{ | |
$feeStructureAsignedStudentWiseList = $this->realEscapeArray($feeStructureAsignedStudentWiseList); | |
$sql = "INSERT INTO fee_structure_asigned_studentwise (student_id, courseTypeId, fee_structure_id, fee_head_id, amount, createdBy, createdDate, updatedBy, updatedDate) VALUES "; | |
$value = []; | |
foreach ($feeStructureAsignedStudentWiseList as $feeStructureAsignedStudentWise) { | |
$value[] = "($feeStructureAsignedStudentWise->studentId, $feeStructureAsignedStudentWise->courseTypeId, $feeStructureAsignedStudentWise->feeStructureId, $feeStructureAsignedStudentWise->feeHeadId, '$feeStructureAsignedStudentWise->amount', $feeStructureAsignedStudentWise->createdBy, utc_timestamp(), $feeStructureAsignedStudentWise->updatedBy, utc_timestamp())"; | |
} | |
try { | |
$sql .= implode(', ', $value); | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get fee heads from fee structure by fee structure id | |
* | |
* @param int $feeStructureId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getFeeHeadByFeeStructureId($feeStructureId) | |
{ | |
$feeStructureId = $this->realEscapeString($feeStructureId); | |
$feeModuleVersion = CommonService::getInstance()->getSettings(SettingsConstants::FEE_MODULE, SettingsConstants::FEE_MODULE_VERSION); | |
$feeHeadTableName = $feeModuleVersion == 2 ? 'fm_fee_head' : 'feeHead'; | |
$sql = "SELECT fsfh.id, fsfh.fee_structure_id, fh.id as feeHeadId ,fh.name, fsfh.amount FROM $feeHeadTableName fh LEFT JOIN fee_structure_fee_head fsfh ON fsfh.fee_head_id=fh.id AND fsfh.fee_structure_id=$feeStructureId"; | |
try { | |
return $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get admission seat filled status by dept | |
* | |
* @param int $courseTypeId | |
* @param int $deptId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getAdmissionSeatFilledStatusByDept($courseTypeId, $deptId) | |
{ | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$deptId = $this->realEscapeString($deptId); | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_PG; | |
} else { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_UG; | |
} | |
$sql = "SELECT sr.deptID, dept.deptName, aq.quotaID, aq.quotaName, sr.numberofSeat, (SELECT count(studentID) FROM $studentTableName WHERE admittedDeptId=sr.deptID AND courseTypeId=sr.courseTypeId AND seatReservationQuotaId=sr.quotaID AND (isRejected is null OR isRejected='')) AS filledSeats, (SELECT count(studentID) FROM $studentTableName WHERE admittedDeptId=sr.deptID AND courseTypeId=sr.courseTypeId AND (isRejected is null OR isRejected='')) AS totalfilledSeats, (SELECT SUM(numberofSeat) FROM admission_department_seat_reservation WHERE deptID=sr.deptID AND courseTypeId=sr.courseTypeId) AS totalSeats FROM admission_department_seat_reservation sr INNER JOIN admission_quotas aq ON aq.quotaID=sr.quotaID INNER JOIN department dept ON dept.deptID=sr.deptID WHERE sr.courseTypeId=$courseTypeId AND dept.deptID=$deptId ORDER BY sr.deptID, aq.quotaID"; | |
try { | |
return $this->executeQueryForObject($sql, false, $this->mapper[AdmissionServiceMapper::GET_SEAT_FILLED_STATUS]); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* delete fee structure by student id | |
* | |
* @param int $studentId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function deleteFeeStructureByStudentId($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$sql = "DELETE FROM fee_structure_asigned_studentwise WHERE student_id=$studentId"; | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get fee structure by student id | |
* | |
* @param int $studentId | |
* @param int $courseTypeId | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getFeeStructureByStudentId($studentId, $courseTypeId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$feeModuleVersion = CommonService::getInstance()->getSettings(SettingsConstants::FEE_MODULE, SettingsConstants::FEE_MODULE_VERSION); | |
$feeHeadTableName = $feeModuleVersion == 2 ? 'fm_fee_head' : 'feeHead'; | |
$sql = "SELECT fsfh.id, fsfh.fee_structure_id, fsfh.fee_head_id, fh.name, fsfh.amount FROM fee_structure_asigned_studentwise fsfh INNER JOIN $feeHeadTableName fh ON fsfh.fee_head_id=fh.id WHERE fsfh.student_id=$studentId AND fsfh.courseTypeId=$courseTypeId"; | |
try { | |
return $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get fee structure by student id | |
* | |
* @param int $studentId | |
* @param int $courseTypeId | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getFeeStructureIdByStudentId($studentId, $courseTypeId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$feeModuleVersion = CommonService::getInstance()->getSettings(SettingsConstants::FEE_MODULE, SettingsConstants::FEE_MODULE_VERSION); | |
$feeHeadTableName = $feeModuleVersion == 2 ? 'fm_fee_head' : 'feeHead'; | |
$sql = "SELECT distinct fsfh.fee_structure_id FROM fee_structure_asigned_studentwise fsfh INNER JOIN $feeHeadTableName fh ON fsfh.fee_head_id=fh.id WHERE fsfh.student_id=$studentId AND fsfh.courseTypeId=$courseTypeId"; | |
try { | |
return $this->executeQueryForObject($sql)->fee_structure_id; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get student details by ids | |
* | |
* @param array $studentIds | |
* @param int $courseTypeId | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getStudentDetailsByIds($studentIds, $courseTypeId) | |
{ | |
$studentIds = $this->realEscapeArray($studentIds); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
if (!empty($studentIds) && $studentIds != NULL) { | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_PG; | |
} else { | |
$studentTableName = AdmissionConstants::STUDENT_TABLE_NAME_UG; | |
} | |
$sql = "SELECT asu.studentID, asu.studentName, asu.mobilePhone, asu.email, concat(form.applicationPrefix,asu.applicationNo) as applicationNo from $studentTableName asu INNER JOIN applicationFormType form ON asu.courseTypeId = form.courseTypeId AND asu.applicationFormTypeId=form.id WHERE asu.studentID IN (" . implode(', ', $studentIds) . ")"; | |
try { | |
return $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
} | |
/** | |
* get admission exam subjects | |
* | |
* @param int $typeId | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getAdmissionExamSubjects($typeId = null) | |
{ | |
$typeId = $this->realEscapeString($typeId); | |
$sql = "select distinct t1.subjectID, t2.subjectName, t2.subjectDesc from admission_exam_subjects t1, admission_subjects t2 where t2.subjectID=t1.subjectID "; | |
if ($typeId) { | |
$sql .= "AND t1.typeID=$typeId "; | |
} | |
$sql .= "ORDER BY t1.subjectID"; | |
try { | |
return $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* Method for get student exam marks | |
* NRI status : isNRI should be set null or ALL to list all else set 1 to list only nri 0 to list non nri applications | |
* | |
* @param AdmissionStudentExportRequest $admissionStudentExportRequest | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getStudentExamMarks($admissionStudentExportRequest) | |
{ | |
$sql = NULL; | |
if ($admissionStudentExportRequest != NULL) { | |
// Main Query | |
// $sql = " select distinct asm.*, IF(aes.maxMark,aes.maxMark,asm.maxMark) as subjectMaxMark | |
// from admission_student_marks_ug asm INNER JOIN admission_exam_subjects aes ON aes.typeID=asm.typeID | |
// INNER JOIN admission_student_details_ug asd ON asm.studentID=asd.studentID | |
// LEFT JOIN applicationFormType form ON asd.courseTypeId = form.courseTypeId AND asd.applicationFormTypeId= form.id AND form.applicationYear='$admissionStudentExportRequest->admissionYear' | |
// LEFT JOIN admission_boardexam_type abt ON asd.twelthBoard = abt.typeID | |
// LEFT JOIN admission_student_offline_payment_ug off_payment ON asd.studentID = off_payment.studentID | |
// LEFT JOIN admission_quotas aq ON aq.quotaID = asd.quotaID | |
// LEFT JOIN admission_student_online_payment_ug aop ON aop.studentId = asd.studentID | |
// LEFT JOIN admissionAdvanceFee aaf ON aaf.studentID=asd.studentID AND aaf.courseTypeId=asd.courseTypeId | |
// where asd.courseTypeId=$admissionStudentExportRequest->courseTypeId | |
// and asd.admissionYear='$admissionStudentExportRequest->admissionYear'"; | |
//simplified query | |
$sql = "select distinct asm.*, IF(aes.maxMark,aes.maxMark,asm.maxMark) as subjectMaxMark | |
from admission_student_marks_ug asm INNER JOIN admission_student_details_ug asd ON asm.studentID=asd.studentID | |
INNER JOIN admission_exam_subjects aes ON aes.typeID=asm.typeID | |
LEFT JOIN applicationFormType form ON asd.courseTypeId = form.courseTypeId AND asd.applicationFormTypeId= form.id AND form.applicationYear='2020' | |
LEFT JOIN admission_boardexam_type abt ON asd.twelthBoard = abt.typeID | |
where asd.courseTypeId=$admissionStudentExportRequest->courseTypeId | |
and asd.admissionYear='$admissionStudentExportRequest->admissionYear'"; | |
// Add filter conditions | |
// Student Name | |
if (!empty($admissionStudentExportRequest->studentName)) { | |
$sql .= " AND asd.studentName LIKE '%$admissionStudentExportRequest->studentName%' "; | |
} | |
// Application no | |
if (!empty($admissionStudentExportRequest->applicationNo)) { | |
$sql .= " AND asd.applicationNo LIKE '%$admissionStudentExportRequest->applicationNo%' "; | |
} | |
// payment status | |
if (!empty($admissionStudentExportRequest->paymentStatus)) { | |
$sql .= " AND asd.paymentStatus = '$admissionStudentExportRequest->paymentStatus' "; | |
} | |
// payment mode | |
if (!empty($payment_mode)) { | |
$payment_modeCond = " AND asd.paymentMethod = '$admissionStudentExportRequest->paymentMode'"; | |
} | |
switch ($applnStatus) { | |
case AdmissionStatus::ADMIT_CANCEL: | |
$sql .= " AND asd.isRejected='" . AdmissionStatus::ADMIT_CANCEL . "'"; | |
break; | |
case AdmissionStatus::VERIFICATION_CANCEL: | |
$sql .= " AND asd.isRejected='" . AdmissionStatus::VERIFICATION_CANCEL . "'"; | |
break; | |
case AdmissionStatus::VERIFIED: | |
$sql .= " AND asd.isVerified=1"; | |
break; | |
case AdmissionStatus::ADMITTED: | |
$sql .= " AND asd.isAdmitted=1"; | |
break; | |
} | |
try { | |
return $this->executeQueryForList($sql, $this->mapper[AdmissionServiceMapper::GET_STUDENT_EXAM_MARKS]); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} else { | |
throw new ProfessionalException(ProfessionalException::INVALID_REQUEST, "Request is not valid or null."); | |
} | |
} | |
/** | |
* get All certificates | |
* | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getCertificates() | |
{ | |
$sql = "SELECT * FROM admission_student_certificates"; | |
try { | |
return $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* Method for get student exam marks | |
* NRI status : isNRI should be set null or ALL to list all else set 1 to list only nri 0 to list non nri applications | |
* | |
* @param AdmissionStudentExportRequestBCOM $admissionStudentExportRequest | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getStudentCertificateDetails($admissionStudentExportRequest) | |
{ | |
$sql = NULL; | |
if ($admissionStudentExportRequest != NULL) { | |
// Main Query | |
$sql = "SELECT DISTINCT sac.studentId, sac.certificateTypeId, sac.fileName, sac.path | |
FROM studentApplicationCertificate sac | |
INNER JOIN admission_student_details_ug asd ON sac.studentID=asd.studentID AND sac.courseTypeId = asd.courseTypeId | |
LEFT JOIN applicationFormType form ON asd.courseTypeId = form.courseTypeId AND asd.applicationFormTypeId= form.id AND form.applicationYear='$admissionStudentExportRequest->admissionYear' | |
LEFT JOIN admission_boardexam_type abt ON asd.twelthBoard = abt.typeID | |
LEFT JOIN admission_student_offline_payment_ug off_payment ON asd.studentID = off_payment.studentID | |
LEFT JOIN admission_quotas aq ON aq.quotaID = asd.quotaID | |
LEFT JOIN admission_student_online_payment_ug aop ON aop.studentId = asd.studentID | |
LEFT JOIN admissionAdvanceFee aaf ON aaf.studentID=asd.studentID AND aaf.courseTypeId=asd.courseTypeId | |
where asd.courseTypeId=$admissionStudentExportRequest->courseTypeId | |
and asd.admissionYear='$admissionStudentExportRequest->admissionYear'"; | |
// Add filter conditions | |
// Student Name | |
if (!empty($admissionStudentExportRequest->studentName)) { | |
$sql .= " AND asd.studentName LIKE '%$admissionStudentExportRequest->studentName%' "; | |
} | |
// Application no | |
if (!empty($admissionStudentExportRequest->applicationNo)) { | |
$sql .= " AND asd.applicationNo LIKE '%$admissionStudentExportRequest->applicationNo%' "; | |
} | |
// payment status | |
if (!empty($admissionStudentExportRequest->paymentStatus)) { | |
$sql .= " AND asd.paymentStatus = '$admissionStudentExportRequest->paymentStatus' "; | |
} | |
// payment mode | |
if (!empty($admissionStudentExportRequest->paymentMethod)) { | |
$sql .= " AND asd.paymentMethod = '$admissionStudentExportRequest->paymentMethod'"; | |
} | |
switch ($admissionStudentExportRequest->applnStatus) { | |
case AdmissionStatus::ADMIT_CANCEL: | |
$sql .= " AND asd.isRejected='" . AdmissionStatus::ADMIT_CANCEL . "'"; | |
break; | |
case AdmissionStatus::VERIFICATION_CANCEL: | |
$sql .= " AND asd.isRejected='" . AdmissionStatus::VERIFICATION_CANCEL . "'"; | |
break; | |
case AdmissionStatus::VERIFIED: | |
$sql .= " AND asd.isVerified=1"; | |
break; | |
case AdmissionStatus::ADMITTED: | |
$sql .= " AND asd.isAdmitted=1"; | |
break; | |
} | |
try { | |
return $this->executeQueryForList($sql, $this->mapper[AdmissionServiceMapper::GET_STUDENT_CERTIFICATES]); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} else { | |
throw new ProfessionalException(ProfessionalException::INVALID_REQUEST, "Request is not valid or null."); | |
} | |
} | |
/** | |
* get advance fee report | |
* | |
* @param AdvanceFeeReportRequest $advanceFeeReportRequest | |
* @param string $show | |
* @return \com\linways\core\ams\professional\response\AdmissionStudentResponse | |
* @throws ProfessionalException | |
*/ | |
public function getAdvanceFeeReport($advanceFeeReportRequest, $show) | |
{ | |
$advanceFeeReportRequest = $this->realEscapeObject($advanceFeeReportRequest); | |
$isPg = BatchService::getInstance()->getCourseTypeById($advanceFeeReportRequest->courseTypeId)->isPG; | |
if ($isPg) { | |
$tablePosfix = "pg_affiliated"; | |
} else { | |
$tablePosfix = "ug"; | |
} | |
$showCond = ""; | |
switch ($show) { | |
case "ADMITTED": | |
$showCond = "AND asu.admittedDeptId !=0 "; | |
break; | |
case "NOT_ADMITTED": | |
$showCond = "AND asu.admittedDeptId =0 "; | |
break; | |
} | |
$sql_count = "SELECT COUNT(distinct asu.studentID) AS totalRecord FROM admissionAdvanceFee adf INNER JOIN admission_student_details_$tablePosfix asu ON adf.studentId=asu.studentID LEFT JOIN department dept ON dept.deptID=asu.admittedDeptId LEFT JOIN admission_quotas aq ON aq.quotaID=asu.seatReservationQuotaId WHERE adf.courseTypeId=$advanceFeeReportRequest->courseTypeId AND asu.admissionYear=$advanceFeeReportRequest->year $showCond"; | |
$admissionStudentResponse = new AdmissionStudentResponse(); | |
$sql_student = "SELECT asu.studentID FROM admissionAdvanceFee adf INNER JOIN admission_student_details_$tablePosfix asu ON adf.studentId=asu.studentID LEFT JOIN department dept ON dept.deptID=asu.admittedDeptId LEFT JOIN admission_quotas aq ON aq.quotaID=asu.seatReservationQuotaId WHERE adf.courseTypeId=$advanceFeeReportRequest->courseTypeId AND asu.admissionYear=$advanceFeeReportRequest->year $showCond"; | |
$cond = ""; | |
$sumCond = ""; | |
if ($advanceFeeReportRequest->fromDate && $advanceFeeReportRequest->toDate) { | |
$cond .= "AND DATE_FORMAT(adf.date,'%Y-%m-%d') BETWEEN '" . date('Y-m-d', strtotime($advanceFeeReportRequest->fromDate)) . "' AND '" . date('Y-m-d', strtotime($advanceFeeReportRequest->toDate)) . "' "; | |
$sumCond .= "AND DATE_FORMAT(date,'%Y-%m-%d') BETWEEN '" . date('Y-m-d', strtotime($advanceFeeReportRequest->fromDate)) . "' AND '" . date('Y-m-d', strtotime($advanceFeeReportRequest->toDate)) . "' "; | |
} | |
if ($advanceFeeReportRequest->paymentMode) { | |
$cond .= "AND adf.mode='$advanceFeeReportRequest->paymentMode' "; | |
$sumCond .= "AND mode='$advanceFeeReportRequest->paymentMode' "; | |
} | |
$sql = "select asu.studentID, concat(form.applicationPrefix,asu.applicationNo) as applicationNo, asu.studentName, asu.admittedDeptId, dept.deptName, asu.seatReservationQuotaId, aq.quotaName, adf.id, DATE_FORMAT(adf.date,'%Y-%m-%d') as date, adf.mode, adf.receiptNo, adf.amount, adf.ddNumber, adf.ddDate, adf.bankName, adf.bankBranch, adf.checkNo, adf.chequeDate, adf.remarks, (SELECT SUM(amount) FROM admissionAdvanceFee WHERE studentId=adf.studentId AND courseTypeId=$advanceFeeReportRequest->courseTypeId $sumCond) as totalAmount from admissionAdvanceFee adf INNER JOIN admission_student_details_$tablePosfix asu ON adf.studentId=asu.studentID LEFT JOIN department dept ON dept.deptID=asu.admittedDeptId LEFT JOIN admission_quotas aq ON aq.quotaID=asu.seatReservationQuotaId LEFT JOIN applicationFormType form ON asu.courseTypeId = form.courseTypeId AND asu.applicationFormTypeId=form.id AND form.applicationYear=$advanceFeeReportRequest->year WHERE adf.courseTypeId=$advanceFeeReportRequest->courseTypeId AND asu.admissionYear=$advanceFeeReportRequest->year $showCond"; | |
if ($advanceFeeReportRequest->deptId) { | |
$cond .= "AND asu.admittedDeptId=$advanceFeeReportRequest->deptId "; | |
} | |
if ($advanceFeeReportRequest->quotaId) { | |
$cond .= "AND asu.seatReservationQuotaId=$advanceFeeReportRequest->quotaId "; | |
} | |
try { | |
$sql_count .= $cond; | |
$admissionStudentResponse->totalRecords = $this->executeQueryForObject($sql_count)->totalRecord; | |
if ($advanceFeeReportRequest->isExport) { | |
$advanceFeeReportRequest->endIndex = $admissionStudentResponse->totalRecords; | |
} | |
if (!$advanceFeeReportRequest->isExport) { | |
$sql_student .= $cond . "GROUP BY asu.studentID ORDER BY asu.studentID LIMIT $advanceFeeReportRequest->startIndex,$advanceFeeReportRequest->endIndex"; | |
$studentList = $this->executeQueryForList($sql_student); | |
if (!empty($studentList)) { | |
$studentIdList = array_map(function ($obj) { | |
return $obj->studentID; | |
}, $studentList); | |
$sql .= "AND asu.studentID IN (" . implode(', ', $studentIdList) . ") "; | |
} | |
} | |
if (!empty($studentList) || $advanceFeeReportRequest->isExport) { | |
$sql .= $cond . "ORDER BY asu.studentID, adf.date, adf.receiptNo"; | |
$admissionStudentResponse->students = $this->executeQueryForList($sql, $this->mapper[AdmissionServiceMapper::GET_ADVANCE_FEE_REPORT]); | |
} | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
return $admissionStudentResponse; | |
} | |
/** | |
* add student ug semester marks | |
* | |
* @param array $admissionUgSemMarkList | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function addAdmissionUgSemMarks($admissionUgSemMarkList) | |
{ | |
$admissionUgSemMarkList = $this->realEscapeArray($admissionUgSemMarkList); | |
$value = []; | |
$sql = "INSERT INTO admissionUgSemMarks (studentId, courseTypeId, semId, sgpa, isFullPass) VALUES "; | |
if (!empty($admissionUgSemMarkList)) { | |
foreach ($admissionUgSemMarkList as $admissionUgSemMark) { | |
$value[] = "($admissionUgSemMark->studentId, $admissionUgSemMark->courseTypeId, $admissionUgSemMark->semId, '$admissionUgSemMark->sgpa', '$admissionUgSemMark->isFullPass')"; | |
} | |
} | |
try { | |
$sql .= implode(', ', $value); | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* remove student ug semester marks | |
* | |
* @param int $studentId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function removeAdmissionUgSemMarksByStudentId($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
try { | |
$sql = "DELETE FROM admissionUgSemMarks WHERE studentId=$studentId"; | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get student ug semester marks | |
* | |
* @param int $studentId | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @throws ProfessionalException | |
*/ | |
public function getAdmissionUgSemMarksByStudentId($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
try { | |
$sql = "SELECT sm.*, sem.semName FROM admissionUgSemMarks sm INNER JOIN semesters sem ON sem.semID=sm.semId WHERE studentId=$studentId"; | |
return $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/******************Admission V2 Services*******************************/ | |
public function updateAdmittedPaidDetails($studentId, $paid, $admitted) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$paid = $this->realEscapeString($paid); | |
$admitted = $this->realEscapeString($admitted); | |
if ( $paid == 1 ) { | |
$paidDate = date("Y-m-d"); | |
$query = "UPDATE admission_admitted_students SET paid='$paid',admitted='$admitted',paid_date = '".$paidDate."' WHERE studentaccount_id='$studentId'"; | |
} | |
else { | |
$query = "UPDATE admission_admitted_students SET paid = 0 ,admitted = '$admitted' WHERE studentaccount_id='$studentId'"; | |
} | |
try { | |
$this->executeQuery($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* check if student is paying fee in installments | |
*/ | |
public function getStudentPaymentType($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
try { | |
$query = "SELECT other_details AS otherDetails FROM admission_admitted_students WHERE studentaccount_id='$studentId'"; | |
$otherDetails = $this->executeQueryForObject($query); | |
return json_decode($otherDetails->otherDetails)->isInstallment; | |
} catch (\Exception $e) { | |
throw new AutonomousException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* check if student is paying fee in bank payment | |
*/ | |
public function getStudentIsBankPayment($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
try { | |
$query = "SELECT other_details AS otherDetails FROM admission_admitted_students WHERE studentaccount_id='$studentId'"; | |
$otherDetails = $this->executeQueryForObject($query); | |
return json_decode($otherDetails->otherDetails)->isBankPayment; | |
} catch (\Exception $e) { | |
throw new AutonomousException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* add application form type notification content | |
* @param ApplicationFormTypeNotificationContent $applicationFormTypeNotificationContent | |
* @return \com\linways\base\dto\MySqlResult | |
* @throws AutonomousException | |
*/ | |
public function addApplicationFormTypeNotificationContent(ApplicationFormTypeNotificationContent $applicationFormTypeNotificationContent) | |
{ | |
$applicationFormTypeNotificationContent = $this->realEscapeObject($applicationFormTypeNotificationContent); | |
$sql = "INSERT INTO applicationFormTypeNotificationContent (formTypeId, content, subject, contentType, context, enableNotification, createdBy, createdDate, updatedBy, updatedDate) VALUES ('$applicationFormTypeNotificationContent->formTypeId', '$applicationFormTypeNotificationContent->content', '$applicationFormTypeNotificationContent->subject', '$applicationFormTypeNotificationContent->contentType', '$applicationFormTypeNotificationContent->context', '$applicationFormTypeNotificationContent->enableNotification', '$applicationFormTypeNotificationContent->createdBy', utc_timestamp(), '$applicationFormTypeNotificationContent->updatedBy', utc_timestamp())"; | |
try { | |
return $this->executeQuery($sql); | |
} catch (\Exception $e) { | |
throw new AutonomousException($e->getCode(), $e->getMessage()); | |
} | |
} | |
public function updateApplicationFormTypeNotificationContent(ApplicationFormTypeNotificationContent $applicationFormTypeNotificationContent) | |
{ | |
$applicationFormTypeNotificationContent = $this->realEscapeObject($applicationFormTypeNotificationContent); | |
$sql = "UPDATE applicationFormTypeNotificationContent SET content='$applicationFormTypeNotificationContent->content', subject='$applicationFormTypeNotificationContent->subject', enableNotification='$applicationFormTypeNotificationContent->enableNotification', updatedBy='$applicationFormTypeNotificationContent->updatedBy', updatedDate=utc_timestamp() WHERE id='$applicationFormTypeNotificationContent->id'"; | |
try { | |
return $this->executeQuery($sql); | |
} catch (\Exception $e) { | |
throw new AutonomousException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* get application form type notification content | |
* @param int $formTypeId | |
* @param string $context | |
* @param string $contentType | |
* @return object|NULL|\com\linways\base\util\$objectList[]|object|array|\com\linways\base\util\$objectList[] | |
* @throws AutonomousException | |
*/ | |
public function getApplicationFormTypeNotificationContent(int $formTypeId, string $context, string $contentType = null) | |
{ | |
try { | |
$sql = "SELECT * FROM applicationFormTypeNotificationContent WHERE formTypeId='$formTypeId' AND context='$context'"; | |
if ($contentType) { | |
$sql .= " AND contentType='$contentType'"; | |
return $this->executeQueryForObject($sql); | |
} else { | |
return $this->executeQueryForList($sql); | |
} | |
} catch (\Exception $e) { | |
throw new AutonomousException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* add admission student ug mark list | |
* @param array $admissionStudentUgMarkList | |
* @return \com\linways\base\dto\MySqlResult | |
* @throws AutonomousException | |
*/ | |
public function addAdmissionStudentUgMarkDetails($admissionStudentUgMarkList) | |
{ | |
$admissionStudentUgMarkList = $this->realEscapeArray($admissionStudentUgMarkList); | |
$values = []; | |
try { | |
$sql = "INSERT INTO admission_student_ug_mark_details (studentId, name, mark) VALUES "; | |
foreach ($admissionStudentUgMarkList as $admissionStudentUgMarkDetails) { | |
$values[] = "('$admissionStudentUgMarkDetails->studentId', '$admissionStudentUgMarkDetails->name', '$admissionStudentUgMarkDetails->mark')"; | |
} | |
$sql .= implode(', ', $values); | |
return $this->executeQuery($sql); | |
} catch (\Exception $e) { | |
throw new AutonomousException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* delete admission student ug mark details | |
* @param int $studentId | |
* @return \com\linways\base\dto\MySqlResult | |
* @throws AutonomousException | |
*/ | |
public function deleteAdmissionStudentUgMarkDetails($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
try { | |
$sql = "DELETE FROM admission_student_ug_mark_details WHERE studentId='$studentId'"; | |
return $this->executeQuery($sql); | |
} catch (\Exception $e) { | |
throw new AutonomousException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* get admission student ug mark details | |
* @param int $studentId | |
* @return object|array|\com\linways\base\util\$objectList[] | |
* @throws AutonomousException | |
*/ | |
public function getAdmissionStudentUgMarkDetails($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
try { | |
$sql = "SELECT * FROM admission_student_ug_mark_details WHERE studentId='$studentId'"; | |
return $this->executeQueryForList($sql); | |
} catch (\Exception $e) { | |
throw new AutonomousException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* update student edit by form type | |
* @param int $flag | |
* @param int $formTypeId | |
* @param int $courseTypeId | |
* @throws AutonomousException | |
*/ | |
public function updateStudentEditByFormType($flag, $formTypeId, $courseTypeId) | |
{ | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$tablePosfix = "pg_affiliated"; | |
} else { | |
$tablePosfix = "ug"; | |
} | |
$sql = "UPDATE applicationFormType SET disableStudentEdit='$flag' WHERE id=$formTypeId"; | |
try { | |
$this->executeQuery($sql); | |
$sql_std = "UPDATE admission_student_details_$tablePosfix SET disableEdit='$flag' WHERE applicationFormTypeId=$formTypeId"; | |
$this->executeQuery($sql_std); | |
} catch (\Exception $e) { | |
throw new AutonomousException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* update student edit by studentId | |
* @param int $flag | |
* @param int $studentId | |
* @param int $courseTypeId | |
* @throws AutonomousException | |
*/ | |
public function updateStudentEditByStudentId($flag, $studentId, $courseTypeId) | |
{ | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$tablePosfix = "pg_affiliated"; | |
} else { | |
$tablePosfix = "ug"; | |
} | |
try { | |
$sql = "UPDATE admission_student_details_$tablePosfix SET disableEdit='$flag' WHERE studentID=$studentId"; | |
$this->executeQuery($sql); | |
} catch (\Exception $e) { | |
throw new AutonomousException($e->getCode(), $e->getMessage()); | |
} | |
} | |
public function isEditDisabledByFormTypeId($formTypeId) | |
{ | |
$formTypeId = $this->realEscapeString($formTypeId); | |
try { | |
$sql = "SELECT disableStudentEdit FROM applicationFormType WHERE id='$formTypeId'"; | |
$disableStudentEdit = $this->executeQueryForObject($sql)->disableStudentEdit; | |
if ($disableStudentEdit) { | |
return true; | |
} else { | |
return false; | |
} | |
} catch (\Exception $e) { | |
throw new AutonomousException($e->getCode(), $e->getMessage()); | |
} | |
} | |
public function editDisableOfStudentByStudentId($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
try { | |
$sql = "SELECT disableEdit FROM admission_student_details_ug WHERE studentID='$studentId'"; | |
$disableEdit = $this->executeQueryForObject($sql)->disableEdit; | |
if ($disableEdit) { | |
return true; | |
} else { | |
return false; | |
} | |
} catch (\Exception $e) { | |
throw new AutonomousException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* @param $admissionYear | |
* @param $courseTypeId | |
* @return bool | |
*/ | |
public function generateRankList($admissionYear, $courseTypeId) | |
{ | |
$admissionYear = $this->realEscapeString($admissionYear); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$rankList = []; | |
$indexMarkList = []; | |
try { | |
$sql = "select asd.studentID, studentName, twelthBoard, SUM(asm.mark) as marks, asd.entranceMark, aim.rule, asd.entranceMark_phyche, asd.entranceMark_maths from admission_student_details_ug asd INNER JOIN admission_student_marks_ug asm ON asm.studentID=asd.studentID INNER JOIN admission_exam_subjects aes ON aes.subjectID=asm.subjectID AND aes.typeID=asm.typeID INNER JOIN admission_index_mark_rule aim ON aim.examTypeId=asd.twelthBoard AND aim.formTypeId=asd.applicationFormTypeId where admissionYear='$admissionYear' AND isVerified=1 AND aes.isIndex=1 AND asd.entranceMark_phyche>=10 AND asd.entranceMark_maths>=10 group by asd.studentID"; | |
$studentList = $this->executeQueryForList($sql); | |
if (!empty($studentList)) { | |
foreach ($studentList as $student) { | |
$studentRank = new \stdClass(); | |
$studentRank->studentId = $student->studentID; | |
$rule = $student->rule; | |
$indexSubjectMark = $student->marks; | |
$entranceMark = $student->entranceMark; | |
$rule = StringUtil::replace_tags($rule, array( | |
"INDEX_SUBJECT_SUM" => $indexSubjectMark, | |
"KEAM_MARK" => $entranceMark | |
)); | |
$indexMark = round(eval("return $rule;"), 4); | |
$studentRank->indexMark = $indexMark; | |
$indexMarkList[$student->studentID] = $indexMark; | |
$studentRank->rank = ''; | |
$rankList[$student->studentID] = $studentRank; | |
} | |
$i = 1; | |
foreach ($indexMarkList as $key => $mark) { | |
$max = max($indexMarkList); | |
$keys = array_search($max, $indexMarkList); | |
$rankList[$keys]->rank = $i; | |
unset($indexMarkList[$keys]); | |
if (sizeof($indexMarkList) > 0) | |
if (!in_array($max, $indexMarkList)) | |
$i++; | |
} | |
foreach ($rankList as $rank) { | |
$sql_update = "UPDATE admission_student_details_ug SET indexMark='$rank->indexMark', indexMarkRank='$rank->rank' WHERE studentID=$rank->studentId"; | |
$this->executeQuery($sql_update); | |
} | |
return true; | |
} else { | |
throw new AutonomousException($e->getCode(), $e->getMessage()); | |
} | |
} catch (\Exception $e) { | |
throw new AutonomousException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* @param CreateAdmissionStatisticsRequest $request | |
* @throws ProfessionalException | |
*/ | |
public function createAdmissionStatisticsDetails(CreateAdmissionStatisticsRequest $request) | |
{ | |
$request = $this->realEscapeObject($request); | |
if (empty($request->year)) { | |
throw new ProfessionalException(ProfessionalException::INVALID_ACADEMIC_YEAR, "Invalid Academic year given"); | |
} | |
if (empty($request->courseTypeId)) { | |
throw new ProfessionalException(ProfessionalException::INVALID_COURSE_TYPE_ID, "Invalid course type given"); | |
} | |
if (empty($request->departmentId)) { | |
throw new ProfessionalException(ProfessionalException::INVALID_DEPARTMENT_ID, "Invalid department given"); | |
} | |
if (empty($request->availableSeats)) { | |
throw new ProfessionalException(ProfessionalException::INVALID_AVAILABLE_SEATS, "Invalid available seats count"); | |
} | |
if (empty($request->allottedSeats)) { | |
throw new ProfessionalException(ProfessionalException::INVALID_ALLOTTED_SEATS, "Invalid allotted seats count"); | |
} | |
$sql = "INSERT INTO admission_admission_statistics (year, department_id, pattern_dept_course_id, course_type_id, | |
available_seats, allotted_seats, created_by, created_date) | |
VALUES ($request->year,$request->departmentId,$request->patternDeptCourseId,$request->courseTypeId, | |
$request->availableSeats,$request->allottedSeats,$request->createdBy,UTC_TIMESTAMP())"; | |
try { | |
$this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* @param $id | |
* @throws ProfessionalException | |
*/ | |
public function deleteAdmissionStatisticsDetails($id) | |
{ | |
$id = $this->realEscapeString($id); | |
if (empty($id)) { | |
throw new ProfessionalException("INVALID_ADMISSION_STATISTICS_ID", "Invalid admission statistics id"); | |
} | |
$sql = "DELETE FROM admission_admission_statistics WHERE id = $id"; | |
try { | |
$this->executeQuery($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* @param UpdateAdmissionStatisticsRequest $request | |
* @throws ProfessionalException | |
*/ | |
public function updateAdmissionStatisticsDetails(UpdateAdmissionStatisticsRequest $request) | |
{ | |
$request = $this->realEscapeObject($request); | |
if (empty($request->id)) { | |
throw new ProfessionalException(ProfessionalException::INVALID_REQUEST, "Invalid request sent"); | |
} | |
if (empty($request->year)) { | |
throw new ProfessionalException(ProfessionalException::INVALID_ACADEMIC_YEAR, "Invalid Academic year given"); | |
} | |
if (empty($request->courseTypeId)) { | |
throw new ProfessionalException(ProfessionalException::INVALID_COURSE_TYPE_ID, "Invalid course type given"); | |
} | |
if (empty($request->departmentId)) { | |
throw new ProfessionalException(ProfessionalException::INVALID_DEPARTMENT_ID, "Invalid department given"); | |
} | |
if (empty($request->availableSeats)) { | |
throw new ProfessionalException(ProfessionalException::INVALID_AVAILABLE_SEATS, "Invalid available seats count"); | |
} | |
if (empty($request->allottedSeats)) { | |
throw new ProfessionalException(ProfessionalException::INVALID_ALLOTTED_SEATS, "Invalid allotted seats count"); | |
} | |
$sql = "UPDATE admission_admission_statistics SET year =$request->year, department_id = $request->departmentId, | |
course_type_id=$request->courseTypeId,pattern_dept_course_id=$request->patternDeptCourseId, | |
allotted_seats=$request->allottedSeats,available_seats=$request->availableSeats,updated_date=UTC_TIMESTAMP(), | |
updated_by =$request->updatedBy WHERE id =$request->id"; | |
try { | |
$this->executeQuery($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* @return array|Object | |
* @throws ProfessionalException | |
*/ | |
public function getAdmissionStatistics() | |
{ | |
$response = []; | |
$sql = "SELECT aam.id,aam.year,d.deptName,d.deptID,pd.patterncourseID,pd.patterncourseName, ct.courseTypeID,ct.typeName, | |
aam.available_seats,aam.allotted_seats | |
FROM admission_admission_statistics aam | |
INNER JOIN course_type ct on aam.course_type_id = ct.courseTypeID | |
INNER JOIN pattern_deptcourses pd on aam.pattern_dept_course_id = pd.patterncourseID | |
INNER JOIN department d on aam.department_id = d.deptID | |
ORDER BY created_date DESC ,updated_date DESC"; | |
try { | |
$response = $this->executeQueryForList($sql, $this->mapper[AdmissionServiceMapper::GET_ADMISSION_STATISTICS]); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $response; | |
} | |
/** | |
* @param $startYear | |
* @param $endYear | |
* @return array|AdmissionStatistics[]|Object | |
* @throws ProfessionalException | |
*/ | |
public function getDepartmentWiseAdmissionStatistics($startYear=null, $endYear=null) | |
{ | |
$response = []; | |
$condition = ""; | |
if ((empty($startYear) && !empty($endYear)) || (!empty($startYear) && empty($endYear))) { | |
throw new ProfessionalException(ProfessionalException::INVALID_YEAR_RANGE, "Invalid year range given"); | |
} else if (!empty($startYear) && !empty($endYear)) { | |
$condition = " AND aas.year BETWEEN $startYear AND $endYear"; | |
} | |
$sql = "SELECT aas.id,aas.`year`,SUM(aas.allotted_seats) as totalAllottedSeats,SUM(aas.available_seats) as totalAvailableSeats, | |
d.deptName,d.deptID | |
FROM admission_admission_statistics aas | |
INNER JOIN department d ON d.deptID=aas.department_id | |
WHERE 1=1 $condition | |
GROUP BY aas.year,aas.department_id"; | |
try { | |
$response = $this->executeQueryForList($sql, $this->mapper[AdmissionServiceMapper::GET_ADMISSION_STATISTICS_REPORT]); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $response; | |
} | |
public function getAdmissionBatchByDeptId($deptId, $admissionYear,$courseTypeId) | |
{ | |
$deptId = $this->realEscapeString($deptId); | |
$admissionYear = $this->realEscapeString($admissionYear); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$query = "SELECT batchID,deptID,semID FROM batches WHERE deptID = '$deptId' and is_admission=1 and batchStartYear='".$admissionYear."' AND course_type_id='$courseTypeId'"; | |
try{ | |
return $this->executeQueryForObject($query); | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
public function getstudentAmsIdByStudentId($studentId, $courseTypeId) | |
{ | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$studentId = $this->realEscapeString($studentId); | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$tablePosfix = "pg_affiliated"; | |
} else { | |
$tablePosfix = "ug"; | |
} | |
try { | |
$sql = "SELECT isTransferedToAMS, amsStudentId FROM admission_student_details_$tablePosfix WHERE studentID=$studentId"; | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
public function updateAdmittedStudentDetails($student) | |
{ | |
$student = $this->realEscapeObject($student); | |
$query = "UPDATE studentaccount SET deptID = '$student->departmentId',batchID = '$student->batchId', quotaId='$student->quotaId' WHERE studentID = '$student->studentaccountId'"; | |
try{ | |
$this->executeQuery($query); | |
}catch(\Exception $e) | |
{ | |
error_log("CODE: ".$e->getCode()."MESSAGE: ".$e->getMessage()); | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
public function checkAdmissionNo($admissionNo, $courseTypeCode) | |
{ | |
$flag=0; | |
$totalAdmissionNo=0; | |
$admissionNo = $this->realEscapeString($admissionNo); | |
$courseTypeCode = $this->realEscapeString($courseTypeCode); | |
$courseTypeId = BatchService::getInstance()->getCourseTypeIdByCode($courseTypeCode)->id; | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$tablePosfix = "pg_affiliated"; | |
} else { | |
$tablePosfix = "ug"; | |
} | |
$sql ="SELECT count(studentID) as totalAdmissionNo from admission_student_details_$tablePosfix where admissionNo='$admissionNo'"; | |
try{ | |
$totalAdmissionNo = $this->executeQueryForObject($sql)->totalAdmissionNo; | |
if($totalAdmissionNo == 1) | |
{ | |
$flag=1; | |
} | |
}catch(\Exception $e) | |
{ | |
error_log("CODE: ".$e->getCode()."MESSAGE: ".$e->getMessage()); | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $flag; | |
} | |
/** | |
* Get Last generated admission No | |
* @param int $deptId | |
* @param int $courseTypeId | |
* @throws ProfessionalException | |
* @return string | |
*/ | |
public function getLastGeneratedAdmissionNoByDeptId($deptId, $courseTypeId) | |
{ | |
$admissionNo =""; | |
$deptId = $this->realEscapeString($deptId); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$isPg = BatchService::getInstance()->getCourseTypeById($courseTypeId)->isPG; | |
if ($isPg) { | |
$tablePosfix = "pg_affiliated"; | |
} else { | |
$tablePosfix = "ug"; | |
} | |
$sql ="SELECT admissionNo from admission_student_details_$tablePosfix where admittedDeptId=$deptId ORDER BY studentID DESC LIMIT 1"; | |
try{ | |
$admissionNo = $this->executeQueryForObject($sql)->admissionNo; | |
return $admissionNo; | |
}catch(\Exception $e) | |
{ | |
error_log("CODE: ".$e->getCode()."MESSAGE: ".$e->getMessage()); | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* Returns whether matching email is found or not corresponding to its courseTypeId & formTypeId | |
* | |
* @param string $email | |
* @param int $courseTypeId | |
* @param int $formTypeId | |
* @return int | |
* @author George Jose | |
*/ | |
public function checkPreviousStudentEmailExists($email, $courseTypeId, $formTypeId = NULL) | |
{ | |
$emailCount = 0; | |
$email = $this->realEscapeString($email); | |
$courseTypeID = $this->realEscapeString($courseTypeId); | |
$formTypeId = $this->realEscapeString($formTypeId); | |
$validateStudentRegistrationWithFormTypeId = CommonService::getInstance()->getSettings(AdmissionConstants::SETTINGS_TYPE_ADMISSION_MODULE, AdmissionConstants::VALIDATE_STUDENT_REGISTRATION_WITH_APPLICATION_FORM_TYPE_ID); | |
if($validateStudentRegistrationWithFormTypeId) | |
{ | |
$sql = "SELECT count(email) as emailCount FROM admission_student_details_pg_affiliated where email=\"$email\" and courseTypeId=$courseTypeId and applicationFormTypeId=$formTypeId"; | |
} | |
else | |
{ | |
$sql = "SELECT count(email) as emailCount FROM admission_student_details_pg_affiliated where email=\"$email\" and courseTypeId=$courseTypeId"; | |
} | |
try | |
{ | |
$emailCount = $this->executeQueryForObject($sql)->emailCount; | |
if($emailCount) | |
{ | |
return 1; | |
} | |
else | |
{ | |
return 0; | |
} | |
} | |
catch(\Exception $e) | |
{ | |
error_log("CODE: ".$e->getCode()."MESSAGE: ".$e->getMessage()); | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
public function addEnquiryStudentDetailsUG($email, $studentName, $studentMobile, $courseTypeId, $formTypeId, $admissionYear, $applicationNo) | |
{ | |
$email = $this->realEscapeString($email); | |
$studentName = $this->realEscapeString($studentName); | |
$studentMobile = $this->realEscapeString($studentMobile); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$formTypeId = $this->realEscapeString($formTypeId); | |
$applicationNo = $this->realEscapeString($applicationNo); | |
$sql = "INSERT INTO admission_student_details_ug (email, studentName, mobilePhone, courseTypeId, applicationFormTypeId, studentPassword, admissionYear, applicationNo, createdDate, paymentStatus) VALUES (\"$email\", \"$studentName\", $studentMobile, $courseTypeId, $formTypeId, md5(\"$email\"), \"$admissionYear\", $applicationNo, utc_timestamp(), 'NOT_PAID')"; | |
try{ | |
return $this->executeQuery($sql, true)->id; | |
} | |
catch(\Exception $e) | |
{ | |
error_log("CODE: ".$e->getCode()."MESSAGE: ".$e->getMessage()); | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
public function addEnquiryStudentDetailsPG($email, $studentName, $studentMobile, $courseTypeId, $formTypeId, $admissionYear, $applicationNo) | |
{ | |
$email = $this->realEscapeString($email); | |
$studentName = $this->realEscapeString($studentName); | |
$studentMobile = $this->realEscapeString($studentMobile); | |
$courseTypeId = $this->realEscapeString($courseTypeId); | |
$formTypeId = $this->realEscapeString($formTypeId); | |
$admissionYear = $this->realEscapeString($admissionYear); | |
$applicationNo = $this->realEscapeString($applicationNo); | |
$sql = "INSERT INTO admission_student_details_pg_affiliated (email, studentName, mobilePhone, courseTypeId, applicationFormTypeId, studentPassword, admissionYear, applicationNo, createdDate, paymentStatus) VALUES (\"$email\", \"$studentName\", $studentMobile, $courseTypeId, $formTypeId, md5(\"$email\"), \"$admissionYear\", $applicationNo, utc_timestamp(), 'NOT_PAID')"; | |
try{ | |
return $this->executeQuery($sql, true)->id; | |
} | |
catch(\Exception $e) | |
{ | |
error_log("CODE: ".$e->getCode()."MESSAGE: ".$e->getMessage()); | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
public function getStudentListUg($request) | |
{ | |
global $barPrefixUg; | |
$request = $this->realEscapeObject($request); | |
$whereConditions = ""; | |
$between = ""; | |
$response = null; | |
$sortString = ""; | |
$choiceQuery = ""; | |
$enablechoiceQuery = CommonService::getInstance()->getSettings('ADMISSION', 'SHOW_FIRST_CHOICE_IN_STUDENT_LIST'); | |
if($request->list == 1) | |
{ | |
if($request->admissionYear) | |
{ | |
$whereConditions .= " WHERE t1.admissionYear = '$request->admissionYear' "; | |
} | |
if($request->studentName) | |
{ | |
$whereConditions .= " AND t1.studentName LIKE '$request->studentName%' "; | |
} | |
if($request->applicationNo) | |
{ | |
if($barPrefixUg){ | |
$whereConditions .= " AND CONCAT('$barPrefixUg',t2.admissionID) LIKE '%$request->applicationNo'"; | |
}else{ | |
$whereConditions .= " AND t2.admissionID = '$request->applicationNo'"; | |
} | |
} | |
} | |
else | |
{ | |
if($request->admissionYear) | |
{ | |
$whereConditions .= " AND t1.admissionYear = '$request->admissionYear' "; | |
} | |
if($request->studentName) | |
{ | |
$whereConditions .= " AND t1.studentName LIKE '$request->studentName%' "; | |
} | |
if($request->applicationNo) | |
{ | |
if($barPrefixUg){ | |
$whereConditions .= " AND CONCAT('$barPrefixUg',t2.admissionID) LIKE '%$request->applicationNo'"; | |
}else{ | |
$whereConditions .= " AND t2.admissionID = '$request->applicationNo'"; | |
} | |
} | |
} | |
if($request->startIndex >=0 && $request->endIndex && !$request->export) | |
{ | |
$limitQry .= " LIMIT $request->startIndex,$request->endIndex "; | |
} | |
if($request->fromDate && $request->toDate) | |
{ | |
$request->fromDate = date('Y-m-d',strtotime($request->fromDate)); | |
$request->toDate = date('Y-m-d',strtotime($request->toDate)); | |
$between = " AND t1.verifiedTime BETWEEN '$request->fromDate 00:00:00' AND '$request->toDate 23:59:59' "; | |
} | |
if($request->sortBy && $request->sortOrder) | |
{ | |
if($request->sortBy == "studentName") | |
{ | |
$sortString = " ORDER BY t1.studentName ".$request->sortOrder." "; | |
} | |
elseif($request->sortBy == "applicationNo") | |
{ | |
$sortString = " ORDER BY t2.admissionID ".$request->sortOrder." "; | |
} | |
} | |
if($enablechoiceQuery == 1){ | |
$choiceQuery = " , (select concat(pdt.patterncourseName,'[',at.name,']') from admission_student_branch_preference asbp INNER join pattern_deptcourses pdt on pdt.patterncourseID = asbp.patterncourseID left join admission_campus_type at ON at.patterncourseID = asbp.patterncourseID where asbp.studentID = t1.studentID and asbp.prefNo =1) as choice1 "; | |
} | |
if($request->list == 1) | |
{ | |
$sql = "SELECT t1.studentID,t1.enableOrDisableCertificateUpload, t1.studentName, t1.studentEmail, t3.typeName, t1.hssStream, t1.hssPercentage, t2.admissionID, t3.typeName, t4.streamName,t5.reservName,t1.phoneNo". $choiceQuery ." FROM admission_student_details t1 left join admission_id_table t2 on t1.studentID = t2.studentID left join admission_boardexam_type t3 on t1.hssExamName = t3.typeID left join twelth_streams t4 on t1.hssStream = t4.streamID left join student_reservation t5 on t5.reservID = t1.reservation ".$whereConditions.$between.$sortString.$limitQry; | |
$countSql = "SELECT COUNT(t1.studentID) AS count FROM admission_student_details t1 left join admission_id_table t2 on t1.studentID = t2.studentID left join admission_boardexam_type t3 on t1.hssExamName = t3.typeID left join twelth_streams t4 on t1.hssStream = t4.streamID left join student_reservation t5 on t5.reservID = t1.reservation ".$whereConditions.$between; | |
} | |
else if($request->list == 2) | |
{ | |
$sql = "SELECT t1.studentID,t1.enableOrDisableCertificateUpload, t1.studentName, t1.studentEmail, t3.typeName, t1.hssStream, t1.hssPercentage, t2.admissionID, t3.typeName, t4.streamName, t1.verifiedTime, t1.studentReservation, t1.paymentType,t1.application_fee_category_id, t5.reservName,t1.phoneNo". $choiceQuery ." FROM admission_student_details t1 inner join admission_id_table t2 on t1.studentID = t2.studentID inner join admission_boardexam_type t3 on t1.hssExamName = t3.typeID inner join twelth_streams t4 on t1.hssStream = t4.streamID left join student_reservation t5 on t5.reservID = t1.reservation WHERE t1.verified=1 ".$between." ".$whereConditions.$sortString.$limitQry; | |
$countSql = "SELECT COUNT(t1.studentID) AS count FROM admission_student_details t1 inner join admission_id_table t2 on t1.studentID = t2.studentID inner join admission_boardexam_type t3 on t1.hssExamName = t3.typeID inner join twelth_streams t4 on t1.hssStream = t4.streamID left join student_reservation t5 on t5.reservID = t1.reservation WHERE t1.verified=1 ".$between." ".$whereConditions; | |
} | |
else if($request->list == 3) | |
{ | |
$sql = "SELECT t1.studentID,t1.enableOrDisableCertificateUpload, t1.studentName, t1.studentEmail, t3.typeName, t1.hssStream, t1.hssPercentage, t2.admissionID, t3.typeName, t4.streamName, t5.reservName,t1.phoneNo". $choiceQuery ." FROM admission_student_details t1 inner join admission_id_table t2 on t1.studentID = t2.studentID left join admission_boardexam_type t3 on t1.hssExamName = t3.typeID left join twelth_streams t4 on t1.hssStream = t4.streamID left join student_reservation t5 on t5.reservID = t1.reservation WHERE (t1.verified is NULL OR t1.verified =0) ".$whereConditions.$sortString.$limitQry; | |
$countSql = "SELECT COUNT(t1.studentID) AS count FROM admission_student_details t1 inner join admission_id_table t2 on t1.studentID = t2.studentID left join admission_boardexam_type t3 on t1.hssExamName = t3.typeID left join twelth_streams t4 on t1.hssStream = t4.streamID left join student_reservation t5 on t5.reservID = t1.reservation WHERE (t1.verified is NULL OR t1.verified =0) ".$whereConditions; | |
}else if ($request->list == 4) | |
{ | |
$whereConditions .= " AND t1.verified= 1 AND t1.isManagement = '1' "; | |
$sql = "SELECT t1.studentID,t1.enableOrDisableCertificateUpload, t1.studentName, t1.studentEmail, t3.typeName, t1.hssStream, t1.hssPercentage, t2.admissionID, t3.typeName, t4.streamName,t5.reservName,t1.phoneNo". $choiceQuery ." FROM admission_student_details t1 left join admission_id_table t2 on t1.studentID = t2.studentID left join admission_boardexam_type t3 on t1.hssExamName = t3.typeID left join twelth_streams t4 on t1.hssStream = t4.streamID left join student_reservation t5 on t5.reservID = t1.reservation WHERE 1=1 ".$whereConditions.$between.$sortString.$limitQry; | |
$countSql = "SELECT COUNT(t1.studentID) AS count FROM admission_student_details t1 left join admission_id_table t2 on t1.studentID = t2.studentID left join admission_boardexam_type t3 on t1.hssExamName = t3.typeID left join twelth_streams t4 on t1.hssStream = t4.streamID left join student_reservation t5 on t5.reservID = t1.reservation WHERE 1=1 ".$whereConditions.$between; | |
} | |
else if ($request->list == 5) | |
{ | |
$whereConditions .= " AND (t1.verified is NULL OR t1.verified =0 )AND t1.isManagement = '1' "; | |
$sql = "SELECT t1.studentID,t1.enableOrDisableCertificateUpload, t1.studentName, t1.studentEmail, t3.typeName, t1.hssStream, t1.hssPercentage, t2.admissionID, t3.typeName, t4.streamName,t5.reservName,t1.phoneNo". $choiceQuery ." FROM admission_student_details t1 left join admission_id_table t2 on t1.studentID = t2.studentID left join admission_boardexam_type t3 on t1.hssExamName = t3.typeID left join twelth_streams t4 on t1.hssStream = t4.streamID left join student_reservation t5 on t5.reservID = t1.reservation WHERE 1=1 ".$whereConditions.$between.$sortString.$limitQry; | |
$countSql = "SELECT COUNT(t1.studentID) AS count FROM admission_student_details t1 left join admission_id_table t2 on t1.studentID = t2.studentID left join admission_boardexam_type t3 on t1.hssExamName = t3.typeID left join twelth_streams t4 on t1.hssStream = t4.streamID left join student_reservation t5 on t5.reservID = t1.reservation WHERE 1=1 ".$whereConditions.$between; | |
} | |
else if ($request->list == 7) //for st-thomas management students ..dont delete | |
{ | |
$sql = "SELECT t1.studentID,t1.enableOrDisableCertificateUpload, t1.studentName, t1.studentEmail, t3.typeName, t1.hssStream, t1.hssPercentage, t2.mqApplnNo, t3.typeName, t4.streamName, JSON_EXTRACT(t5.verification, '$.verifiedTime') AS verifiedTime , t1.studentReservation, t1.paymentType,t1.application_fee_category_id, t6.reservName,t1.phoneNo". $choiceQuery ." FROM admission_student_details t1, admission_management_appln_no t2, admission_boardexam_type t3, twelth_streams t4,admission_management_student_online_payment t5, student_reservation t6 WHERE t6.reservID = t1.reservation and t1.studentID = t2.studentID and t1.studentID = t5.studentID and t1.hssExamName = t3.typeID and t1.hssStream = t4.streamID and JSON_CONTAINS(t5.verification, '{\"verified\":1}') ".$between." ".$whereConditions.$sortString.$limitQry ; | |
$countSql = "SELECT COUNT(t1.studentID) AS count FROM admission_student_details t1, admission_management_appln_no t2, admission_boardexam_type t3, twelth_streams t4,admission_management_student_online_payment t5, student_reservation t6 WHERE t6.reservID = t1.reservation and t1.studentID = t2.studentID and t1.studentID = t5.studentID and t1.hssExamName = t3.typeID and t1.hssStream = t4.streamID and JSON_CONTAINS(t5.verification, '{\"verified\":1}') ".$between." ".$whereConditions; | |
} | |
else if ($request->list == 8) //for st-thomas management students ..dont delete | |
{ | |
$sql = "SELECT t1.studentID,t1.enableOrDisableCertificateUpload, t1.studentName, t1.studentEmail, t3.typeName, t1.hssStream, t1.hssPercentage, t2.mqApplnNo, t3.typeName, t4.streamName, JSON_EXTRACT(t5.verification, '$.verifiedTime') AS verifiedTime , t1.studentReservation, t1.paymentType,t1.application_fee_category_id, t6.reservName,t1.phoneNo". $choiceQuery ." FROM admission_student_details t1 inner join admission_management_appln_no t2 on t1.studentID = t2.studentID left join admission_boardexam_type t3 on t1.hssExamName = t3.typeID left join twelth_streams t4 on t1.hssStream = t4.streamID inner join admission_management_student_online_payment t5 on t1.studentID = t5.studentID left join student_reservation t6 on t6.reservID = t1.reservation WHERE (t5.verification IS NULL OR JSON_CONTAINS(t5.verification, '{\"verified\":0}')) ".$whereConditions.$sortString.$limitQry; | |
$countSql = "SELECT COUNT(t1.studentID) AS count FROM admission_student_details t1 inner join admission_management_appln_no t2 on t1.studentID = t2.studentID left join admission_boardexam_type t3 on t1.hssExamName = t3.typeID left join twelth_streams t4 on t1.hssStream = t4.streamID inner join admission_management_student_online_payment t5 on t1.studentID = t5.studentID left join student_reservation t6 on t6.reservID = t1.reservation WHERE (t5.verification IS NULL OR JSON_CONTAINS(t5.verification, '{\"verified\":0}')) ".$whereConditions; | |
} | |
else if($request->list == 6) | |
{ | |
$sql = "SELECT t1.studentID,t1.enableOrDisableCertificateUpload, t1.studentName, t1.studentEmail, t3.typeName, t1.hssStream, t1.hssPercentage, t2.admissionID, t3.typeName, t4.streamName, t1.verifiedTime, t1.studentReservation, t1.paymentType,t1.application_fee_category_id, t5.reservName,t1.phoneNo". $choiceQuery ." FROM admission_student_details t1 inner join admission_id_table t2 on t1.studentID = t2.studentID inner join admission_boardexam_type t3 on t1.hssExamName = t3.typeID inner join twelth_streams t4 on t1.hssStream = t4.streamID inner join admission_appln_current_section aacs on t1.studentID=aacs.studentID left join student_reservation t5 on t5.reservID = t1.reservation WHERE t1.verified=1 AND aacs.sectionID=(SELECT id FROM admission_appln_forms_section ORDER BY priority DESC LIMIT 1) ".$between." ".$whereConditions.$sortString.$limitQry; | |
$countSql = "SELECT COUNT(t1.studentID) AS count FROM admission_student_details t1 inner join admission_id_table t2 on t1.studentID = t2.studentID inner join admission_boardexam_type t3 on t1.hssExamName = t3.typeID inner join twelth_streams t4 on t1.hssStream = t4.streamID inner join admission_appln_current_section aacs on t1.studentID=aacs.studentID left join student_reservation t5 on t5.reservID = t1.reservation WHERE t1.verified=1 AND aacs.sectionID=(SELECT id FROM admission_appln_forms_section ORDER BY priority DESC LIMIT 1) ".$between." ".$whereConditions; | |
} | |
try | |
{ | |
$response->students = $this->executeQueryForList($sql); | |
$response->totalRecords = $this->executeQueryForObject($countSql)->count; | |
}catch(\Exception $e) | |
{ | |
error_log("CODE: ".$e->getCode()."MESSAGE: ".$e->getMessage()); | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $response; | |
} | |
/** | |
* copy admission sign image to ams | |
* | |
* @param string $admissionImgPath | |
* @return string | |
*/ | |
private function transferStudentSignImageToAMS($admissionImgPath) | |
{ | |
global $COLLEGE_CODE; | |
$amsImgPath = ""; | |
if ($admissionImgPath != "") { | |
$myimage = explode('/', $admissionImgPath); | |
if (!empty($myimage) && count($myimage) > 4) { | |
$newImageName = $myimage[5]; | |
$oldPath = $admissionImgPath; | |
if (empty($COLLEGE_CODE)) { | |
$newPath = "signaturephoto_profile/" . $newImageName; | |
} else { | |
$newPath = "signaturephoto_profile/$COLLEGE_CODE/" . $newImageName; | |
} | |
if (is_file($oldPath)) { | |
copy($oldPath, '../../' . $newPath); | |
$amsImgPath = '../' . $newPath; | |
} | |
} else { | |
$amsImgPath = $admissionImgPath; | |
} | |
} | |
return $amsImgPath; | |
} | |
/** | |
* Method for resetting student admission password by StudentID | |
* | |
* @param int $studentID | |
* @param int $courseTypeID | |
* @param string $reset_password | |
*/ | |
public function resetPasswordByStudentID($studentID, $courseTypeId) | |
{ | |
$studentID = $this->realEscapeObject($studentID); | |
$courseTypeId = $this->realEscapeObject($courseTypeId); | |
try { | |
$courseType = BatchService::getInstance()->getCourseTypeById($courseTypeId); | |
if ($courseType == NULL) { | |
throw new ProfessionalException(ProfessionalException::COURSE_TYPE_NOT_FOUND, "No course type found for the given id"); | |
} else { | |
$courseTypeCode = $courseType->code; | |
switch ($courseTypeCode) { | |
case CourseType::BTECH: | |
$tableName = "admission_student_details_ug"; | |
break; | |
case CourseType::BCOM: | |
$tableName = "admission_student_details_ug"; | |
break; | |
case CourseType::BCA: | |
$tableName = "admission_student_details_ug"; | |
break; | |
case CourseType::BA: | |
$tableName = "admission_student_details_ug"; | |
break; | |
case CourseType::BSC: | |
$tableName = "admission_student_details_ug"; | |
break; | |
case CourseType::IMCA: | |
$tableName = "admission_student_details_ug"; | |
break; | |
case CourseType::BARCH: | |
$tableName = "admission_student_details_ug"; | |
break; | |
case CourseType::BBA: | |
$tableName = "admission_student_details_ug"; | |
break; | |
case CourseType::MBA: | |
$tableName = "admission_student_details_pg_affiliated"; | |
break; | |
case CourseType::MSC: | |
$tableName = "admission_student_details_pg_affiliated"; | |
break; | |
case CourseType::MCA: | |
$tableName = "admission_student_details_pg_affiliated"; | |
break; | |
case CourseType::MTECH: | |
$tableName = "admission_student_details_pg_affiliated"; | |
break; | |
case CourseType::MARCH: | |
$tableName = "admission_student_details_pg_affiliated"; | |
break; | |
case CourseType::PGDM: | |
$tableName = "admission_student_details_pg_affiliated"; | |
break; | |
} | |
if ($studentID) { | |
$sql = "UPDATE $tableName SET studentPassword =md5(mobilePhone) WHERE studentID ='$studentID'"; | |
$result = $this->executeQuery($sql)->sqlResult; | |
return $result; | |
} | |
} | |
} catch (ProfessionalException $e) { | |
throw $e; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
public function updateEntranceDetailsByStudentIdPG($studentId, $entranceDetailsJson) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$sql ="UPDATE admission_student_details_pg SET entranceDetails=\"".str_replace('"', '\"', $entranceDetailsJson)."\" WHERE studentID='$studentId'"; | |
try { | |
return $this->executeQueryForObject($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
public function getEntranceDetailsByStudentIdPG($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$sql ="SELECT entranceDetails FROM admission_student_details_pg WHERE studentID='$studentId'"; | |
try { | |
// error_log($sql.$cond); | |
return $this->executeQueryForObject($sql)->entranceDetails; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
public function updateUgSemMarksPG($value,$studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$value = addslashes(json_encode($value)); | |
$sql = "UPDATE admission_student_details_pg SET ugSemMarks= '$value' WHERE studentID=$studentId"; | |
try { | |
$this->executeQuery($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
public function getUgSemMarksPG($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$sql ="SELECT ugSemMarks FROM admission_student_details_pg WHERE studentID='$studentId'"; | |
try { | |
$ugSemMarks = $this->executeQueryForObject($sql); | |
$marks = json_decode($ugSemMarks->ugSemMarks); | |
return $marks; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
public function updatePgSemMarksPG($value,$studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$value = addslashes($value); | |
$sql = "UPDATE admission_student_details_pg SET pgSemMarks= '$value' WHERE studentID=$studentId"; | |
try { | |
$this->executeQuery($sql); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
public function getpgSemMarksPG($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$sql ="SELECT pgSemMarks FROM admission_student_details_pg WHERE studentID='$studentId'"; | |
try { | |
$pgSemMarks = $this->executeQueryForObject($sql); | |
$marks = json_decode($pgSemMarks->pgSemMarks); | |
return $marks; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get patterncourses and fees | |
*/ | |
public function getPatternCourses($catgoryId){ | |
$sql ="SELECT | |
pd.patterncourseID, pd.patterncourseName,afp.feesName,afp.feesID,pcp.categoryId | |
FROM | |
pattern_deptcourses pd | |
INNER JOIN | |
course_pattern cp ON cp.patternID = pd.patternID | |
INNER JOIN | |
course_type ct ON ct.courseTypeID = cp.courseTypeID | |
LEFT JOIN | |
pattern_course_pg_fee_assign pcp ON pcp.pattern_course_id = pd.patterncourseID and pcp.categoryId= '$catgoryId' | |
LEFT JOIN | |
application_fees_pg afp ON pcp.feesID = afp.FeesId | |
WHERE | |
ct.typeName = 'PG' | |
order by pd.patterncourseID,afp.feesID;"; | |
try { | |
$response = $this->executeQueryForList($sql, $this->mapper[AdmissionServiceMapper::GET_PG_PATTERN_COURSE_FEES]); | |
return $response; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get getApplicationFeeCategory | |
*/ | |
public function getApplicationFeeCategory(){ | |
$sql ="SELECT id,categoryName from application_fee_category order by categoryName ASC"; | |
try { | |
$response = $this->executeQueryForList($sql); | |
return $response; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* get application fees pg | |
*/ | |
public function getApplicationFeePg(){ | |
$sql ="SELECT * from application_fees_pg "; | |
try { | |
$response = $this->executeQueryForList($sql); | |
return $response; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* update fees for patern courses | |
*/ | |
public function updateFeesForPatternCourses($feeArray,$categoryId){ | |
$feeArray = json_decode($feeArray); | |
$sql ="DELETE from pattern_course_pg_fee_assign where categoryid = '$categoryId' "; | |
try { | |
$this->executeQuery($sql); | |
foreach($feeArray as $key=>$value) | |
{ | |
$sql = "INSERT INTO pattern_course_pg_fee_assign (pattern_course_id,feesID,categoryId) values ('$value->patternCourseId','$value->feesID','$categoryId')"; | |
$this->executeQuery($sql); | |
} | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* GET HSE PERCENT OF UG STUDENT | |
*/ | |
public function getStudentHseMarkListUg($studentID){ | |
try { | |
$percent = null; | |
$sql = "select sum(mark) as marks from admission_student_marks where studentID='$studentID'"; | |
$rowStudentmark = $this->executeQueryForObject($sql); | |
$queryMaxMark = "select sum(maxmark) as maxMark,typeID,streamID from admission_student_marks where studentID ='$studentID'"; | |
$rowMaxMark =$this->executeQueryForObject($queryMaxMark); | |
if($rowMaxMark->maxMark == NULL) | |
{ | |
$typeID = $rowMaxMark->typeID; | |
$streamID = $rowMaxMark->streamID; | |
$queryMaxMark = "select sum(maxMark) as maxMark from admission_exam_subjects where typeID = '$typeID' and streamID ='$streamID' "; | |
$rowMaxMark = $this->executeQueryForObject($queryMaxMark); | |
} | |
if($rowStudentmark->marks == 0) | |
{ | |
$percent = ""; | |
} | |
else | |
{ | |
$marks = (integer) $rowStudentmark->marks; | |
$maxMarks = (float) $rowMaxMark->maxMark; | |
$hseCalculatedPercent = round((($marks/$maxMarks)*100),2); | |
} | |
return $hseCalculatedPercent; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* GET SCHOLERSHIP DETAILS OF STUDENT ENTERED FROM ADMISSION ADMIN SIDE(VERIFIED LIST) | |
*/ | |
public function getUGStudentScholershipDetails($studentID){ | |
try { | |
$query = "select scholershipDetails from admission_student_details_ug where studentID ='$studentID'"; | |
$row =$this->executeQueryForObject($query)->scholershipDetails; | |
return $row; | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/** | |
* SAVE SCHOLERSHIP DETAILS OF STUDENT ENTERED FROM ADMISSION ADMIN SIDE(VERIFIED LIST) | |
*/ | |
public function saveUGStudentScholershipDetails($studentID , $scholershipDetails){ | |
try { | |
$scholershipDetails = json_encode($scholershipDetails); | |
$query = "update admission_student_details_ug set scholershipDetails='$scholershipDetails' where studentID ='$studentID'"; | |
$this->executeQueryForObject($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException(ProfessionalException::QUERY_EXECUTION_FAILED, $e->getMessage()); | |
} | |
} | |
/*************************Admission V1 Services *********************/ | |
public function updateAdmittedPaidDetailsV1($studentId, $paid, $admitted) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$paid = $this->realEscapeString($paid); | |
$admitted = $this->realEscapeString($admitted); | |
if ( $paid == 1 ) { | |
$query = "UPDATE admission_admitted_student_details SET paid='$paid',admitted='$admitted' WHERE studentaccount_id='$studentId'"; | |
} | |
else { | |
$query = "UPDATE admission_admitted_student_details SET paid = 0 ,admitted = '$admitted' WHERE studentaccount_id='$studentId'"; | |
} | |
try { | |
$this->executeQuery($query); | |
if($paid == 1) | |
{ | |
$admissionOnlineAllotmentEnabled = CommonService::getInstance()->getSettings("ADMISSION","ADMISSION_ONLINE_ALLOTMENT") == "1"; | |
if($admissionOnlineAllotmentEnabled) | |
{ | |
$query = "INSERT INTO admission_admit_student_inbrach (studentID,patterncourseID,reservID,campus_type_id,mark,rank,admittime,admissionNo) SELECT aoacs.studentID,aoacs.patterncourseID,aoacs.reservID,aoacs.campus_type_id,aoacs.mark,aoacs.rank,aoacs.admittime,aoacs.admissionNo FROM admission_online_allotment_confirmed_students aoacs INNER JOIN admission_admitted_student_details aasd ON aoacs.studentID=aasd.student_id INNER JOIN admission_allotment_merit_students aams ON aoacs.patterncourseID=aams.patterncourseID AND aoacs.studentID=aams.studentID INNER JOIN admission_allotment_table aat ON aams.admission_allotment_table_id = aat.id WHERE aasd.studentaccount_id='$studentId' AND aasd.is_pg=0 AND aat.closed=0"; | |
$this->executeQuery($query); | |
} | |
} | |
} catch (\Exception $e) { | |
throw new AutonomousException($e->getCode(), $e->getMessage()); | |
} | |
} | |
public function getTransactionIdByStudentIdOfUG($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$query = "SELECT transactionId_or_referenceNo FROM admission_student_details_ug WHERE studentID='$studentId'"; | |
try { | |
$result = $this->executeQueryForObject($query)->transactionId_or_referenceNo; | |
return $result; | |
} catch (\Exception $e) { | |
throw new AutonomousException($e->getCode(), $e->getMessage()); | |
} | |
} | |
public function updateAdmittedPaidDetailsV3($studentId,$paid,$admitted){ | |
try { | |
$sql="SELECT paid FROM adm_admission_admitted_student_details where studentAccountId = '$studentId'"; | |
$alreadyPaidStatus = $this->executeQueryForObject($sql)->paid; | |
$cancelled = ""; | |
$student_lock = ""; | |
if($paid==1){ | |
$cancelled = ",is_canceled = 0"; | |
$student_lock = ",sa.student_lock = '0'"; | |
} | |
$sql = "update adm_admission_admitted_student_details aasd inner join studentaccount sa on aasd.studentAccountId=sa.studentID set aasd.paid = '$paid', aasd.admitted = '$admitted',aasd.paid_date = now() $cancelled $student_lock where aasd.studentAccountId = '$studentId'"; | |
$this->executeQuery($sql); | |
$sql ="SELECT content from adm_contents where name='ADMISSION_ADMIT_STUDENT_GENERAL_SETTINGS'"; | |
$paymentCompleteStage = json_decode($this->executeQueryForObject($sql)->content)->paymentCompleteStage; | |
if($paymentCompleteStage&&$paid==1&&$alreadyPaidStatus==0){ | |
// insert data | |
$sql = "INSERT INTO `adm_admission_stage_log` (`studentId`, `formId`, `patternCourseId`, `stageId`, `created_by`) | |
select aasbp.studentId,aasbp.formId,aasbp.patternCourseId,aasbp.currentStageId,'".$GLOBALS['userId']."'from adm_admission_admitted_student_details aaasd inner join adm_admission_student_branch_preference aasbp on aasbp.applicantId = aaasd.applicantId | |
and aaasd.formId = aasbp.formId and aaasd.patternCourseId= aasbp.patternCourseId | |
where aaasd.studentAccountId = '$studentId' "; | |
$this->executeQuery($sql); | |
// update stage | |
$sql = "UPDATE adm_admission_admitted_student_details aaasd inner join adm_admission_student_branch_preference aasbp on aasbp.applicantId = aaasd.applicantId | |
and aaasd.formId = aasbp.formId and aaasd.patternCourseId= aasbp.patternCourseId | |
SET aasbp.currentStageId = '$paymentCompleteStage' | |
where aaasd.studentAccountId = '$studentId' "; | |
$this->executeQuery($sql); | |
} | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return; | |
} | |
public function getAdmittedOtherDetailsV3($studentId) { | |
$sql = "SELECT other_details FROM adm_admission_admitted_student_details WHERE studentAccountId='$studentId'"; | |
try{ | |
$otherDetails = $this->executeQueryForObject($sql);$otherDetails = json_decode($otherDetails->other_details); | |
}catch(\Exception $e) { | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
return $otherDetails; | |
} | |
public function updateAcadamicProgramStatus($studentId,$paid,$semesterId,$batchId){ | |
$reason=''; | |
$academicStatus='ACTIVE'; | |
$remark_id="NULL"; | |
$remarks="NULL"; | |
$updatedBy=$GLOBALS['userId']; | |
if(!$paid){ | |
$remark_id="(select id from remarks_table where code='FEE_PENDING')"; | |
$remarks="(select remarks from remarks_table where code='FEE_PENDING')"; | |
$reason='Fee Pending'; | |
$academicStatus='FAILED'; | |
} | |
try{ | |
$sql = "UPDATE student_program_batch_log spbl | |
inner join student_program_account spa ON spbl.program_student_id=spa.id and spbl.term_id=spa.current_term_id | |
inner join semesters s ON s.termId=spa.current_term_id | |
inner join group_members gm ON gm.groups_id = spa.current_batch_id AND spa.id = gm.student_id | |
inner join batches b ON b.groups_id=spbl.batch_group_id | |
SET spa.properties = JSON_SET(spa.properties,'$.academicStatus','$academicStatus'), | |
spbl.properties = JSON_SET(spbl.properties, | |
'$.academicStatus', '$academicStatus', | |
'$.reason', '$reason' | |
), | |
spbl.`remark_id` = $remark_id, | |
spbl.`remark_desc` = $remarks, | |
spbl.`status_date` = utc_date(), | |
spa.updated_by='$updatedBy', | |
spa.updated_date= utc_timestamp(), | |
spbl.updated_by='$updatedBy', | |
spbl.updated_date= NOW(), | |
gm.properties=JSON_SET(gm.properties,'$.academicStatus','$academicStatus') | |
where spa.student_id='$studentId' and s.semID='$semesterId' and b.batchID='$batchId'"; | |
$sqlSubject = "UPDATE group_members gm | |
INNER JOIN student_program_account spa ON spa.id = gm.student_id | |
INNER JOIN groups_relations gr ON gr.child_groups_id = gm.groups_id AND gr.parent_groups_id = spa.current_batch_id | |
INNER JOIN `groups` g ON g.id = gr.child_groups_id AND g.academic_term_id = spa.current_term_id | |
INNER JOIN semesters s ON (s.termId = g.academic_term_id) | |
INNER JOIN batches b ON b.groups_id = spa.current_batch_id | |
SET gm.properties = JSON_SET(gm.properties,'$.academicStatus','$academicStatus') | |
WHERE g.`type` = '".GroupTypeConstant::SUBJECT."' AND s.semID = '$semesterId' AND spa.student_id='$studentId' AND b.batchID='$batchId' AND gm.academic_status <> '".StatusConstants::TRASHED."'"; | |
$this->executeQuery($sql); | |
$this->executeQuery($sqlSubject); | |
}catch(\Exception $e) { | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
/** | |
* Function used to update the student's joining date as the date of their first fee payment. | |
* @param String $studentID | |
* @throws ProfessionalException | |
*/ | |
public function updateStudentJoiningDateAsFirstPaymentDate($studentID) { | |
$studentID = $this->realEscapeString($studentID); | |
$feeDetails = ''; | |
try { | |
$feePaidDate = $this->getStudentFirstFeePaidDate($studentID); | |
if($feeDetails){ | |
$sql = "UPDATE studentaccount s SET s.studentJoindate = '$feePaidDate' WHERE s.studentID = '$studentID' AND s.studentJoindate != '$feePaidDate';"; | |
return $this->executeQuery($sql); | |
} | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* Function used to get student first fee paid date | |
* @param String $studentID | |
* @return String $feeDetails | |
* @throws ProfessionalException | |
*/ | |
public function getStudentFirstFeePaidDate($studentID) | |
{ | |
$studentID = $this->realEscapeString($studentID); | |
$sql = "SELECT DATE(ft.remitted_date) AS feePaidDate FROM fm_transactions ft WHERE ft.user_id = '$studentID' AND ft.user_type = 'STUDENT' ORDER BY ft.created_date ASC LIMIT 1"; | |
try { | |
$feePaidDate = $this->executeQueryForObject($sql)->feePaidDate; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $feePaidDate; | |
} | |
} | |