Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 38 |
CRAP | |
0.00% |
0 / 1008 |
| FalseNumberService | |
0.00% |
0 / 1 |
|
0.00% |
0 / 38 |
25440.00 | |
0.00% |
0 / 1008 |
| __construct | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
|||
| __clone | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
|||
| getInstance | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 4 |
|||
| searchStudentFalseNumber | |
0.00% |
0 / 1 |
90.00 | |
0.00% |
0 / 58 |
|||
| getFalseNumber | |
0.00% |
0 / 1 |
56.00 | |
0.00% |
0 / 41 |
|||
| mapFalseNumber | |
0.00% |
0 / 1 |
110.00 | |
0.00% |
0 / 66 |
|||
| getMappedFalseNumber | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 21 |
|||
| getStudentDetailsWithFalseNumberByBatchSemIdAndSubbatchId | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 53 |
|||
| getExamRegisteredStudentFalseNumbers | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 24 |
|||
| setFalseNumberStartRange | |
0.00% |
0 / 1 |
56.00 | |
0.00% |
0 / 47 |
|||
| getFalseNumberStartRange | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 13 |
|||
| setFalseNumbers | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 16 |
|||
| getStudentsFalseNumberByBatchAndSubject | |
0.00% |
0 / 1 |
42.00 | |
0.00% |
0 / 68 |
|||
| getFalseNumberDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 19 |
|||
| saveFalseNumberAlphaNumericCode | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 14 |
|||
| getFalseNumbersByExamRegistration | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 22 |
|||
| saveStudentFalseNumbers | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 17 |
|||
| getStudentFalseNumbersByExamRegistration | |
0.00% |
0 / 1 |
72.00 | |
0.00% |
0 / 27 |
|||
| getStudentsFalseNumberByBatchAndSubjectSem | |
0.00% |
0 / 1 |
42.00 | |
0.00% |
0 / 68 |
|||
| getFalseNumberSubjectDetails | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 24 |
|||
| getSubjectGroupsExamRegistrationDetails | |
0.00% |
0 / 1 |
42.00 | |
0.00% |
0 / 31 |
|||
| getSubjectGroupsByExamRegDetails | |
0.00% |
0 / 1 |
56.00 | |
0.00% |
0 / 30 |
|||
| getFalseNumberBySubjectGroups | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 16 |
|||
| saveStudentFalseNumbersWithAlphaNumericCodes | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 17 |
|||
| getStudentFalseNumberDetailsWithpacketNoByExamSubjectRequest | |
0.00% |
0 / 1 |
110.00 | |
0.00% |
0 / 37 |
|||
| saveFolioNumberDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 13 |
|||
| getFolioNumberDetails | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 26 |
|||
| deleteFolioNumber | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
| saveStudentFolioNumber | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 15 |
|||
| getBatchAssignedFolioNo | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
| getFalseNumbersByExams | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 14 |
|||
| getFalseNumbersDetailsByStudentRegNo | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 30 |
|||
| getMainBookNumberDetailsFromBookNo | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 16 |
|||
| getGeneratedFalseNumbersByPrefix | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 18 |
|||
| getGeneratedFalseNumbersByHall | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 15 |
|||
| getFalseNumberDetailsByRequest | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 24 |
|||
| getFalseNumberRangeAssignedForStaffByRequest | |
0.00% |
0 / 1 |
72.00 | |
0.00% |
0 / 51 |
|||
| getFalseNumbersByRequest | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 30 |
|||
| <?php | |
| namespace com\linways\core\ams\professional\service\examcontroller\falsenumber; | |
| use stdClass; | |
| use com\linways\core\ams\professional\service\BaseService; | |
| use com\linways\core\ams\professional\exception\ProfessionalException; | |
| use com\linways\core\ams\professional\service\SemesterService; | |
| use com\linways\core\ams\professional\constant\ExamType as ExamTypeConstant; | |
| use com\linways\core\ams\professional\constant\ExamType; | |
| class FalseNumberService extends BaseService | |
| { | |
| private static $_instance = null; | |
| // /Condition 2 - Locked down the constructor | |
| private function __construct() { | |
| } | |
| // 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; | |
| } | |
| /** | |
| * | |
| * @throws ProfessionalException | |
| * @return object|array|\com\linways\base\util\$objectList[] | |
| * @author Vishnu M | |
| */ | |
| public function searchStudentFalseNumber ( $request ) { | |
| $request = $this->realEscapeObject($request); | |
| $studentFalseNumber = []; | |
| $sql = null; | |
| $conditions = null; | |
| if ( $request->studentId ) { | |
| $conditions .= " AND ehas.studentID = $request->studentId "; | |
| } | |
| if ( $request->groupId ) { | |
| $conditions .= " AND ege.groupID = $request->groupId "; | |
| } | |
| if ( $request->hallId ) { | |
| $conditions .= " AND ehas.hallID = $request->hallId "; | |
| } | |
| if ( $request->examDate ) { | |
| $conditions .= " AND e.examDate = '$request->examDate' "; | |
| } | |
| if ( $request->examTypeId ) { | |
| $conditions .= " AND e.examTypeID = $request->examTypeId "; | |
| } | |
| if ( $request->unixStartTime && $request->endStartTime ) { | |
| $conditions .= " AND e.unixtime_start BETWEEN $request->unixStartTime AND $request->endStartTime "; | |
| } | |
| try { | |
| $sql = "SELECT | |
| sa.studentID AS studentId, | |
| sa.regNo, | |
| sa.studentName, | |
| sa.myImage AS studentImage, | |
| efn.false_number AS falseNumber, | |
| e.examStartTime, | |
| e.examEndTime | |
| FROM | |
| exam_group_exams ege | |
| INNER JOIN | |
| exam_hall_arranged_students ehas ON (ege.groupID = ehas.groupID | |
| AND ege.examID = ehas.examID) | |
| INNER JOIN | |
| exam e ON (e.examID = ege.examID) | |
| INNER JOIN | |
| batches b ON (b.batchID = e.batchID) | |
| INNER JOIN | |
| subjects s ON (s.subjectID = e.subjectID) | |
| INNER JOIN | |
| studentaccount sa ON (ehas.studentID = sa.studentID) | |
| INNER JOIN | |
| examcontroller_false_number efn ON (efn.studentID = ehas.studentID | |
| AND ehas.examID = efn.examID) | |
| WHERE | |
| sa.studentID IS NOT NULL | |
| $conditions | |
| ORDER BY sa.regNo ASC"; | |
| $studentFalseNumber = $this->executeQueryForList($sql); | |
| } | |
| catch (\Exception $e) { | |
| throw new ProfessionalException ( $e->getCode(), $e->getMessage() ); | |
| } | |
| return $studentFalseNumber; | |
| } | |
| /** | |
| * @param FalseNoRequest $request | |
| * @return Object List|null | |
| * @throws ProfessionalException | |
| * @author Vishnu M | |
| */ | |
| public function getFalseNumber ( $request ) { | |
| $request = $this->realEscapeObject($request); | |
| $conditions = null; | |
| if ( $request->studentId ) { | |
| $conditions .= " AND ecfn.studentID = '$request->studentId' "; | |
| } | |
| if ( $request->examRegId ) { | |
| $conditions .= " AND ecfn.examregID = '$request->examRegId' "; | |
| } | |
| else if ( $request->examSupplyId ) { | |
| $conditions .= " AND ecfn.exam_supplementary_id = '$request->examSupplyId' "; | |
| } | |
| if ( $request->examId ) { | |
| $conditions .= " AND ecfn.examID = '$request->examId' "; | |
| } | |
| if ( $request->batchId ) { | |
| $conditions .= " AND sa.batchID = '$request->batchId' "; | |
| } | |
| $sql = null; | |
| $falseNoList = null; | |
| try { | |
| $sql = "SELECT | |
| sa.studentID AS studentId, | |
| sa.studentName, | |
| sa.regNo, | |
| ecfn.false_number AS falseNo, | |
| ecfn.examregID AS examRegId, | |
| ecfn.exam_supplementary_id AS examSupplyId, | |
| ecfn.examID AS examId | |
| FROM | |
| examcontroller_false_number ecfn | |
| INNER JOIN | |
| studentaccount sa ON sa.studentID = ecfn.studentID | |
| WHERE | |
| ecfn.false_number IS NOT NULL | |
| $conditions ORDER BY sa.regNo ASC"; | |
| $falseNoList = $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $falseNoList; | |
| } | |
| /** | |
| * @param FalseNoRequest $request | |
| * @return Object List|null | |
| * @throws ProfessionalException | |
| * @author Sibin | |
| */ | |
| public function mapFalseNumber($request){ | |
| $request = $this->realEscapeObject($request); | |
| $examId=$request->examId; | |
| $examRegId=$request->examRegId; | |
| $studentList=$request->studentList; | |
| $isSupply= (int)$request->isSupply; | |
| $valueString=""; | |
| $isExist=""; | |
| $sqlUpdate=''; | |
| $mapFalseNumber = null; | |
| if($isSupply){ | |
| $examregColumn ="exam_supplementary_id"; | |
| } | |
| else{ | |
| $examregColumn ="examregID"; | |
| } | |
| foreach($studentList as $student){ | |
| $studentId=$student['studentID']; | |
| $falseNumber=$student['falseNumber']; | |
| if($falseNumber){ | |
| $sqlIsExist = "SELECT id,studentID from examcontroller_false_number | |
| where studentID='$studentId' | |
| and examID='$examId' | |
| and $examregColumn ='$examRegId'"; | |
| try { | |
| $isExist=$this->executeQueryForObject($sqlIsExist); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| //upadte entry | |
| if($isExist){ | |
| $sqlUpdate = "UPDATE examcontroller_false_number | |
| SET false_number ='$falseNumber' | |
| where studentID='$studentId' | |
| and examID='$examId' | |
| and $examregColumn ='$examRegId'"; | |
| try { | |
| $update=$this->executeQueryForObject($sqlUpdate); | |
| $mapFalseNumber=true; | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| } | |
| //insert entry | |
| else{ | |
| if($valueString){ | |
| $valueString = $valueString . ",('$studentId','$falseNumber','$examRegId','$examId')"; | |
| }else{ | |
| $valueString = $valueString . "('$studentId','$falseNumber','$examRegId','$examId')"; | |
| } | |
| } | |
| } | |
| else{ | |
| continue; | |
| } | |
| } | |
| $sql = null; | |
| if($valueString){ | |
| try { | |
| $sql = "INSERT into examcontroller_false_number(studentID,false_number,$examregColumn,examID) | |
| values $valueString"; | |
| $this->executeQueryForObject($sql); | |
| $mapFalseNumber=true; | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| } | |
| return $mapFalseNumber; | |
| } | |
| /** | |
| * @param examRegId,examId | |
| * @return $studentList | |
| * @throws ProfessionalException | |
| * @author Sibin | |
| */ | |
| public function getMappedFalseNumber($examRegId,$examId,$isSupply){ | |
| $examRegId = $this->realEscapeString($examRegId); | |
| $examId = $this->realEscapeString($examId); | |
| $isSupply = (int)$this->realEscapeString($isSupply); | |
| if($isSupply){ | |
| $examRegColumn="exam_supplementary_id"; | |
| } | |
| else{ | |
| $examRegColumn="examregID"; | |
| } | |
| $studentList=[]; | |
| $sql = null; | |
| try { | |
| $sql = "SELECT id,studentID,false_number as falseNumber,$examRegColumn,examID from examcontroller_false_number | |
| where examID='$examId' | |
| and $examRegColumn='$examRegId'"; | |
| $studentList= $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $studentList; | |
| } | |
| /* | |
| *get student list with false number | |
| * @param integer $batchID | |
| * @param integer $semID | |
| * @param integer $subbatchID | |
| * @param string $sortByColumn | |
| * @return $studentList | |
| */ | |
| public function getStudentDetailsWithFalseNumberByBatchSemIdAndSubbatchId($batchID, $semID, $subbatchID = 0, $sortByColumn = 'regNo',$examRegId,$examId, $subjectId,$registeredStudentsOnly, $getAttendedStudentsOnly = false) | |
| { | |
| $sql = $joinExamReg = ""; | |
| if($registeredStudentsOnly){ | |
| $joinExamReg .="INNER JOIN exam_reg_studentchallan ersc | |
| ON ersc.examregID ='$examRegId' AND ersc.studentID = sa.studentID AND ersc.paid =1 | |
| INNER JOIN exam_reg_studentsubject erss | |
| ON erss.examregID = ersc.examregID AND erss.studentID = sa.studentID AND erss.subjectID = '$subjectId'"; | |
| } | |
| if ($getAttendedStudentsOnly) { | |
| $joinExamReg .= "INNER JOIN exam_attendance ea | |
| ON ea.examID ='$examId' AND ea.studentID = sa.studentID AND ea.isAbsent = '0'"; | |
| } | |
| if ($subbatchID) { | |
| $sql = "SELECT DISTINCT (sa.studentID), sa.studentName,sa.batchID,sa.rollNo,sa.admissionNo,sa.regNo | |
| from studentaccount sa | |
| inner join subbatch_student ss | |
| on sa.studentID = ss.studentID | |
| inner join batches ba | |
| on ba.batchID = sa.batchID | |
| inner join semesters sem | |
| on sem.semID = ba.semID | |
| inner join semesters joinedSem | |
| on sa.joiningSemId = joinedSem.semID | |
| $joinExamReg | |
| where sa.batchID=$batchID | |
| and ss.subbatchID IN ($subbatchID) | |
| and joinedSem.orderNo <= sem.orderNo | |
| -- and efn.examregID='$examRegId' | |
| -- and efn.examID = '$examId' | |
| ORDER BY sa.$sortByColumn ASC"; | |
| } else { | |
| $sql = "SELECT DISTINCT (sa.studentID), sa.studentName,sa.batchID,sa.rollNo,sa.admissionNo,sa.regNo | |
| from studentaccount sa | |
| inner join batches ba | |
| on ba.batchID = sa.batchID | |
| inner join semesters sem | |
| on sem.semID = ba.semID | |
| inner join semesters joinedSem | |
| on sa.joiningSemId = joinedSem.semID | |
| $joinExamReg | |
| where sa.batchID=$batchID | |
| and joinedSem.orderNo <= sem.orderNo | |
| -- and efn.examregID='$examRegId' | |
| -- and efn.examID = '$examId' | |
| ORDER BY sa.$sortByColumn ASC"; | |
| } | |
| try { | |
| $studentList = $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $studentList; | |
| } | |
| /** | |
| * @author Sibin | |
| */ | |
| public function getExamRegisteredStudentFalseNumbers($examType, $examRegId, $batchId, $studentId) | |
| { | |
| $examType = $this->realEscapeString($examType); | |
| $examRegId = $this->realEscapeString($examRegId); | |
| $batchId = $this->realEscapeString($batchId); | |
| $studentId = $this->realEscapeString($studentId); | |
| $falseNumberDetails = []; | |
| if ($examType == ExamTypeConstant::REGULAR) { | |
| $sql = "SELECT e.examID,s.subjectID,s.subjectName,s.subjectDesc,e.examregID,e.supply_examreg_id,efn.false_number from exam e | |
| INNER JOIN subjects s ON s.subjectID= e.subjectID | |
| LEFT JOIN examcontroller_false_number efn ON efn.examID = e.examID AND efn.studentID = '$studentId' AND efn.examregID = e.examregID | |
| WHERE e.examregID = '$examRegId' and e.batchID = '$batchId' order by e.examID"; | |
| } else if ($examType == ExamTypeConstant::SUPPLY) { | |
| $sql = "SELECT e.examID,s.subjectID,s.subjectName,s.subjectDesc,e.examregID,e.supply_examreg_id,efn.false_number from exam e | |
| INNER JOIN subjects s ON s.subjectID= e.subjectID | |
| LEFT JOIN examcontroller_false_number efn ON efn.examID = e.examID AND efn.studentID = '$studentId' AND efn.exam_supplementary_id = e.supply_examreg_id | |
| WHERE e.supply_examreg_id = '$examRegId' and e.batchID = '$batchId' order by e.examID"; | |
| } | |
| try { | |
| $falseNumberDetails = $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $falseNumberDetails; | |
| } | |
| /** | |
| * @author sibin | |
| * set false number range | |
| */ | |
| public function setFalseNumberStartRange($isSupply, $examRegId, $falseNoStart, $adminId){ | |
| $isSupply = $this->realEscapeString($isSupply); | |
| $examRegId = $this->realEscapeString($examRegId); | |
| $falseNoStart = $this->realEscapeString($falseNoStart); | |
| $adminId = $this->realEscapeString($adminId); | |
| $result = 0; | |
| $isExist = ""; | |
| $isExistFalseNoSql=""; | |
| $isExistFalseNo=""; | |
| //check fale no generated or not | |
| if($isSupply){ | |
| $isExistFalseNoSql = "SELECT exam_supplementary_id from examcontroller_false_number | |
| where exam_supplementary_id='$examRegId'"; | |
| }else{ | |
| $isExistFalseNoSql = "SELECT examRegId from examcontroller_false_number | |
| where examRegId='$examRegId'"; | |
| } | |
| try { | |
| $isExistFalseNo = $this->executeQueryForObject($isExistFalseNoSql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| if($isExistFalseNo){ | |
| $result=2; | |
| return $result; | |
| } | |
| //check if already exist if yes update | |
| $isExistSql = "SELECT examRegId,isSupply,falseNumberStart | |
| from false_number_range | |
| where examRegId='$examRegId' AND isSupply='$isSupply'"; | |
| try { | |
| $isExist = $this->executeQueryForObject($isExistSql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| if($isExist){ | |
| $sql = "UPDATE false_number_range set falseNumberStart='$falseNoStart',updated_by='$adminId' | |
| WHERE examRegId='$examRegId' AND isSupply='$isSupply'"; | |
| }else{ | |
| $sql = "INSERT into false_number_range(examRegId,isSupply,falseNumberStart,created_by) | |
| values($examRegId,$isSupply,$falseNoStart,$adminId)"; | |
| } | |
| try { | |
| $this->executeQueryForObject($sql); | |
| $result = 1; | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $result; | |
| } | |
| /** | |
| * @author sibin | |
| * get false number range | |
| */ | |
| public function getFalseNumberStartRange($isSupply, $examRegId){ | |
| $isSupply = $this->realEscapeString($isSupply); | |
| $examRegId = $this->realEscapeString($examRegId); | |
| $flaseNumberDetails=""; | |
| $sql = "SELECT examRegId,isSupply,falseNumberStart | |
| from false_number_range | |
| where examRegId='$examRegId' AND isSupply='$isSupply'"; | |
| try { | |
| $flaseNumberDetails = $this->executeQueryForObject($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $flaseNumberDetails; | |
| } | |
| /** | |
| * @author sibin | |
| *set false numbers | |
| */ | |
| public function setFalseNumbers($isSupply,$insertRegularStr) | |
| { | |
| //$insertRegularStr = $this->realEscapeString($insertRegularStr); | |
| $isSupply = $this->realEscapeString($isSupply); | |
| $result=0; | |
| if($isSupply){ | |
| $sql = "INSERT into examcontroller_false_number (studentID, false_number, examID, exam_supplementary_id) values $insertRegularStr"; | |
| }else{ | |
| $sql = "INSERT into examcontroller_false_number (studentID, false_number, examID, examregID) values $insertRegularStr"; | |
| } | |
| try { | |
| $this->executeQueryForObject($sql); | |
| $result=1; | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $result; | |
| } | |
| /** | |
| * @author sibin | |
| *get students false numbers by batch and subject | |
| */ | |
| public function getStudentsFalseNumberByBatchAndSubject($examregId,$examSupplyRegId, $isSupply, $batchId, $examId, $limit) | |
| { | |
| $isSupply = $this->realEscapeString($isSupply); | |
| $examregId = $this->realEscapeString($examregId); | |
| $examSupplyRegId = $this->realEscapeString($examSupplyRegId); | |
| $batchId = $this->realEscapeString($batchId); | |
| $examId = $this->realEscapeString($examId); | |
| $limit = $this->realEscapeString($limit); | |
| $condition=""; | |
| if( $batchId){ | |
| $condition .="AND sa.batchID='$batchId'"; | |
| } | |
| if($examId){ | |
| $condition .="AND efn.examID='$examId'"; | |
| } | |
| $subjectStudents = []; | |
| if ($isSupply==1) { | |
| $sql = "SELECT sa.studentName,sa.regNo,sa.studentAccount,sa.batchID,b.batchName,efn.examID,es.supplyDesc as examregName,efn.false_number,b.batchName,e.examCode,e.examName,e.examDate | |
| from studentaccount sa,exam_supplementary es,examcontroller_false_number efn,batches b,exam e | |
| WHERE efn.examID=e.examID | |
| AND sa.batchID = b.batchID | |
| AND sa.studentID = efn.studentID | |
| AND es.id = efn.exam_supplementary_id | |
| AND b.batchID = e.batchID | |
| AND efn.exam_supplementary_id ='$examSupplyRegId' | |
| $condition | |
| order by efn.false_number,sa.batchID,e.examID | |
| $limit"; | |
| } elseif($isSupply == 0) { | |
| $sql = "SELECT sa.studentName,sa.regNo,sa.studentAccount,sa.batchID,b.batchName,efn.examID,er.examregName as examregName,efn.false_number,b.batchName,e.examCode,e.examName,e.examDate | |
| from studentaccount sa,exam_registration er,examcontroller_false_number efn,batches b,exam e | |
| WHERE efn.examID=e.examID | |
| AND sa.batchID = b.batchID | |
| AND sa.studentID = efn.studentID | |
| AND er.examregID = efn.examregID | |
| AND b.batchID = e.batchID | |
| AND efn.examregID ='$examregId' | |
| $condition | |
| order by efn.false_number,sa.batchID,e.examID | |
| $limit"; | |
| } | |
| else{ | |
| $sql="(SELECT sa.studentName,sa.regNo,sa.studentAccount,sa.batchID,b.batchName,efn.examID,es.supplyDesc as examregName,efn.false_number,b.batchName,e.examCode,e.examName,e.examDate | |
| from studentaccount sa,exam_supplementary es,examcontroller_false_number efn,batches b,exam e | |
| WHERE efn.examID=e.examID | |
| AND sa.batchID = b.batchID | |
| AND sa.studentID = efn.studentID | |
| AND es.id = efn.exam_supplementary_id | |
| AND b.batchID = e.batchID | |
| AND efn.exam_supplementary_id ='$examSupplyRegId' | |
| $condition | |
| order by sa.batchID,e.examID, sa.regNo) union (SELECT sa.studentName,sa.regNo,sa.studentAccount,sa.batchID,b.batchName,efn.examID,er.examregName as examregName,efn.false_number,b.batchName,e.examCode,e.examName,e.examDate | |
| from studentaccount sa,exam_registration er,examcontroller_false_number efn,batches b,exam e | |
| WHERE efn.examID=e.examID | |
| AND sa.batchID = b.batchID | |
| AND sa.studentID = efn.studentID | |
| AND er.examregID = efn.examregID | |
| AND b.batchID = e.batchID | |
| AND efn.examregID ='$examregId' | |
| $condition | |
| order by efn.false_number,sa.batchID,e.examID)$limit"; | |
| } | |
| try { | |
| $subjectStudents= $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $subjectStudents; | |
| } | |
| /** | |
| * @param FalseNo | |
| * @return Object List|null | |
| * @throws ProfessionalException | |
| */ | |
| public function getFalseNumberDetails ( $falseNumber ) { | |
| $falseNumber = $this->realEscapeString($falseNumber); | |
| $sql = null; | |
| try { | |
| $sql = "SELECT | |
| studentID AS studentId, | |
| examregID AS examRegId, | |
| exam_supplementary_id AS examSupplyId, | |
| examID AS examId | |
| FROM | |
| examcontroller_false_number | |
| WHERE | |
| false_number ='$falseNumber' | |
| "; | |
| $falseNoList = $this->executeQueryForObject($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $falseNoList; | |
| } | |
| /** | |
| *inert alpha_numeric_code | |
| */ | |
| public function saveFalseNumberAlphaNumericCode($studentId,$examId,$alpha_numeric_code) | |
| { | |
| $studentId = $this->realEscapeString($studentId); | |
| $examId = $this->realEscapeString($examId); | |
| $alpha_numeric_code = $this->realEscapeString($alpha_numeric_code); | |
| $result=0; | |
| $sql = "UPDATE examcontroller_false_number set alpha_numeric_code = '$alpha_numeric_code' WHERE studentID=$studentId and examID=$examId"; | |
| try { | |
| $this->executeQueryForObject($sql); | |
| $result=1; | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $result; | |
| } | |
| /** | |
| * @param FalseNo | |
| * @return Object List|null | |
| * @throws ProfessionalException | |
| */ | |
| public function getFalseNumbersByExamRegistration($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $sql = null; | |
| $result=[]; | |
| if ($request->isSupply == 1) { | |
| $sql = "SELECT | |
| examID from examcontroller_false_number where exam_supplementary_id = '$request->examSupplyRegId'"; | |
| } else if ($request->isSupply == 2) { | |
| $sql = "SELECT | |
| examID from examcontroller_false_number where examregID = '$request->examRegId' OR exam_supplementary_id = '$request->examSupplyRegId'"; | |
| } | |
| else { | |
| $sql= "SELECT | |
| examID from examcontroller_false_number where examregID = '$request->examRegId'"; | |
| } | |
| try { | |
| $result = $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $result; | |
| } | |
| /** | |
| * @author sibin | |
| *set false numbers | |
| */ | |
| public function saveStudentFalseNumbers($regularDetails, $supplyDetails ) | |
| { | |
| //$insertRegularStr = $this->realEscapeString($insertRegularStr); | |
| $insertRegularStr = implode(",", $regularDetails); | |
| $insertSupplyStr = implode(",", $supplyDetails); | |
| try { | |
| if (!empty($supplyDetails)) { | |
| $sql = "INSERT into examcontroller_false_number (studentID, false_number, examID, exam_supplementary_id) values $insertSupplyStr"; | |
| $this->executeQueryForObject($sql); | |
| } | |
| if (!empty($regularDetails)) { | |
| $sql = "INSERT into examcontroller_false_number (studentID, false_number, examID, examregID) values $insertRegularStr"; | |
| $this->executeQueryForObject($sql); | |
| } | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return true; | |
| } | |
| /** | |
| * @author sibin | |
| *set false numbers | |
| */ | |
| public function getStudentFalseNumbersByExamRegistration($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $studentList=[]; | |
| if ($request->startIndex !== "" && $request->startIndex !== null) { | |
| if ($request->startIndex !== "" && $request->recordsPerPage) { | |
| $limitCondition = " LIMIT $request->startIndex , $request->recordsPerPage "; | |
| } | |
| } | |
| try { | |
| if ($request->examRegId) { | |
| $sql = "SELECT t1.studentName,t2.examregName as examName,t3.false_number,t1.regNo,t1.studentAccount,t4.batchName, t5.examCode, t5.examName, t5.examDate | |
| FROM studentaccount t1,exam_registration t2, examcontroller_false_number t3,batches t4, exam t5 where t3.examID = t5.examID and t1.batchID = t4.batchID and | |
| t1.studentID = t3.studentID and t2.examregID = t3.examregID and t1.batchID = t4.batchID and t4.batchID = t5.batchID and t3.examregID= $request->examRegId order by t1.regNo,t5.examID $limitCondition"; | |
| $studentList = $this->executeQueryForList($sql); | |
| } | |
| if ($request->examSupplyRegId) { | |
| $sql = "SELECT t1.studentName,t2.supplyDesc as examName,t3.false_number,t1.regNo,t1.studentAccount,t4.batchName, t5.examCode, t5.examName, t5.examDate | |
| FROM studentaccount t1,exam_supplementary t2, examcontroller_false_number t3,batches t4, exam t5 where t3.examID = t5.examID and t1.batchID = t4.batchID and t1.studentID = t3.studentID and | |
| t2.id = t3.exam_supplementary_id and t1.batchID = t4.batchID and t4.batchID = t5.batchID and t3.exam_supplementary_id = $request->examSupplyRegId order by t1.regNo,t5.examID $limitCondition"; | |
| $this->executeQueryForObject($sql); | |
| $studentList = array_merge($studentList, $this->executeQueryForList($sql)); | |
| } | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $studentList; | |
| } | |
| /** | |
| *get students false numbers by batch and subject | |
| */ | |
| public function getStudentsFalseNumberByBatchAndSubjectSem($examregId,$examSupplyRegId, $isSupply, $batchId, $examId, $limit) | |
| { | |
| $isSupply = $this->realEscapeString($isSupply); | |
| $examregId = $this->realEscapeString($examregId); | |
| $examSupplyRegId = $this->realEscapeString($examSupplyRegId); | |
| $batchId = $this->realEscapeString($batchId); | |
| $examId = $this->realEscapeString($examId); | |
| $limit = $this->realEscapeString($limit); | |
| $condition=""; | |
| if( $batchId){ | |
| $condition .="AND sa.batchID='$batchId'"; | |
| } | |
| if($examId){ | |
| $condition .="AND efn.examID='$examId'"; | |
| } | |
| $subjectStudents = []; | |
| if ($isSupply==1) { | |
| $sql = "SELECT sa.studentName,sa.regNo,sa.studentAccount,sa.batchID,b.batchName,efn.examID,es.supplyDesc as examregName,efn.false_number,b.batchName,e.examCode,e.examName,e.examDate | |
| from studentaccount sa,exam_supplementary es,examcontroller_false_number efn,batches b,exam e | |
| WHERE efn.examID=e.examID | |
| AND sa.batchID = b.batchID | |
| AND sa.studentID = efn.studentID | |
| AND es.id = efn.exam_supplementary_id | |
| AND b.batchID = e.batchID | |
| AND efn.exam_supplementary_id ='$examSupplyRegId' | |
| $condition | |
| order by sa.batchID,e.examID | |
| $limit"; | |
| } elseif($isSupply == 0) { | |
| $sql = "SELECT sa.studentName,sa.regNo,sa.studentAccount,sa.batchID,b.batchName,efn.examID,er.examregName as examregName,efn.false_number,b.batchName,e.examCode,e.examName,e.examDate | |
| from studentaccount sa,exam_registration er,examcontroller_false_number efn,batches b,exam e | |
| WHERE efn.examID=e.examID | |
| AND sa.batchID = b.batchID | |
| AND sa.studentID = efn.studentID | |
| AND er.examregID = efn.examregID | |
| AND b.batchID = e.batchID | |
| AND efn.examregID ='$examregId' | |
| $condition | |
| order by sa.batchID,e.examID | |
| $limit"; | |
| } | |
| else{ | |
| $sql="(SELECT sa.studentName,sa.regNo,sa.studentAccount,sa.batchID,b.batchName,efn.examID,es.supplyDesc as examregName,efn.false_number,b.batchName,e.examCode,e.examName,e.examDate | |
| from studentaccount sa,exam_supplementary es,examcontroller_false_number efn,batches b,exam e | |
| WHERE efn.examID=e.examID | |
| AND sa.batchID = b.batchID | |
| AND sa.studentID = efn.studentID | |
| AND es.id = efn.exam_supplementary_id | |
| AND b.batchID = e.batchID | |
| AND efn.exam_supplementary_id ='$examSupplyRegId' | |
| $condition | |
| order by sa.batchID,e.examID, sa.regNo) union (SELECT sa.studentName,sa.regNo,sa.studentAccount,sa.batchID,b.batchName,efn.examID,er.examregName as examregName,efn.false_number,b.batchName,e.examCode,e.examName,e.examDate | |
| from studentaccount sa,exam_registration er,examcontroller_false_number efn,batches b,exam e | |
| WHERE efn.examID=e.examID | |
| AND sa.batchID = b.batchID | |
| AND sa.studentID = efn.studentID | |
| AND er.examregID = efn.examregID | |
| AND b.batchID = e.batchID | |
| AND efn.examregID ='$examregId' | |
| $condition | |
| order by sa.batchID,e.examID)$limit"; | |
| } | |
| try { | |
| $subjectStudents= $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $subjectStudents; | |
| } | |
| /** | |
| * @param FalseNo | |
| * @return Object List|null | |
| * @throws ProfessionalException | |
| */ | |
| public function getFalseNumberSubjectDetails($falseNumber,$isSupply) | |
| { | |
| $falseNumber = $this->realEscapeString($falseNumber); | |
| $isSupply = $this->realEscapeString($isSupply); | |
| $examRegIdField = $isSupply ? "supply_examreg_id": "examregID"; | |
| $sql = null; | |
| try { | |
| $sql = "SELECT | |
| efn.studentID AS studentId, | |
| efn.examID AS examId, | |
| e.subjectID as subjectId, | |
| e.$examRegIdField as examRegId, | |
| e.batchID | |
| FROM | |
| examcontroller_false_number efn | |
| INNER JOIN exam e ON e.examID = efn.examID | |
| WHERE | |
| efn.false_number ='$falseNumber' | |
| "; | |
| $falseNoList = $this->executeQueryForObject($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $falseNoList; | |
| } | |
| /** | |
| * @param request | |
| * @return Object List|null | |
| * @throws ProfessionalException | |
| * author sibin | |
| */ | |
| public function getSubjectGroupsExamRegistrationDetails($examRegistrationDetailsRequest) | |
| { | |
| $examRegistrationDetailsRequest = $this->realEscapeObject($examRegistrationDetailsRequest); | |
| $examRegistrationDetails = null; | |
| $courseTypeCondition = $sqlRegular = $sqlSupply = ""; | |
| if ($examRegistrationDetailsRequest->courseTypeId) { | |
| $courseTypeCondition = " AND b.courseTypeID = $examRegistrationDetailsRequest->courseTypeId "; | |
| } | |
| $sqlRegular = "SELECT DISTINCT er.examregID AS id,er.examregName AS name,'REGULAR' AS examType FROM exam_registration er | |
| INNER JOIN exam_registration_batches erb ON er.examregID = erb.examregID | |
| INNER JOIN batches b ON erb.batchID = b.batchID | |
| INNER JOIN assignstaff_exam_group_relation aegr ON aegr.exam_registration_id = er.examregID | |
| WHERE er.examregID = er.examregID $courseTypeCondition ORDER BY er.examYear DESC"; | |
| $sqlSupply = "SELECT DISTINCT es.id AS id,es.supplyDesc AS name,'SUPPLY' AS examType FROM exam_supplementary es | |
| LEFT JOIN supply_improve_batches sib ON es.id = sib.exam_supplementary_id | |
| INNER JOIN batches b ON sib.batchID = b.batchID | |
| INNER JOIN assignstaff_exam_group_relation aegr ON aegr.exam_supplementary_id = es.id | |
| WHERE es.id = es.id $courseTypeCondition ORDER BY es.examYear DESC"; | |
| try { | |
| if ($examRegistrationDetailsRequest->examType == ExamType::REGULAR) { | |
| $examRegistrationDetails->REGULAR = $this->executeQueryForList($sqlRegular); | |
| } else if ($examRegistrationDetailsRequest->examType == ExamType::SUPPLY) { | |
| $examRegistrationDetails->SUPPLY = $this->executeQueryForList($sqlSupply); | |
| } else if ($examRegistrationDetailsRequest->examType == ExamType::BOTH) { | |
| $examRegistrationDetails->REGULAR = $this->executeQueryForList($sqlRegular); | |
| $examRegistrationDetails->SUPPLY = $this->executeQueryForList($sqlSupply); | |
| } | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $examRegistrationDetails; | |
| } | |
| /** | |
| * @param request | |
| * @return Object List|null | |
| * @throws ProfessionalException | |
| * author sibin | |
| */ | |
| public function getSubjectGroupsByExamRegDetails($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $condition = $sql = ""; | |
| $subjectGroups = []; | |
| try { | |
| if ($request->examType == ExamType::REGULAR) { | |
| $condition = " aegr.exam_registration_id IN ($request->examRegId)"; | |
| } else if ($request->examType == ExamType::SUPPLY) { | |
| $condition = " aegr.exam_supplementary_id IN ($request->supplyRegId)"; | |
| } else if ($request->examType == ExamType::BOTH) { | |
| if ($request->examRegId) { | |
| $condition .= " aegr.exam_registration_id IN ($request->examRegId)"; | |
| } | |
| if ($request->supplyRegId) { | |
| $condition .= " OR | |
| aegr.exam_supplementary_id IN ($request->supplyRegId)"; | |
| } | |
| } | |
| $sql = "SELECT distinct aegr.assignstaff_exam_groupname_id as subjectGroupId ,aeg.group_name as groupName,aeg.examTypeFlag, | |
| aegr.exam_id as examId,aegr.subjects_id as subjectId,s.subjectName,s.subjectDesc | |
| FROM assignstaff_exam_group_relation aegr | |
| INNER JOIN assignstaff_exam_groupname aeg ON aeg.id = aegr.assignstaff_exam_groupname_id | |
| INNER JOIN subjects s ON s.subjectID = aegr.subjects_id | |
| WHERE $condition GROUP BY aegr.assignstaff_exam_groupname_id"; | |
| $subjectGroups = $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $subjectGroups; | |
| } | |
| /** | |
| * @param request | |
| * @return Object List|null | |
| * @throws ProfessionalException | |
| * author sibin | |
| */ | |
| public function getFalseNumberBySubjectGroups($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $sql = ""; | |
| $falseNumbers = []; | |
| try { | |
| $sql = "SELECT efn.studentID as studentId,sa.regNo,sa.studentName,sa.myImage,efn.false_number as falseNumber,efn.examID as examId,aegr.subjects_id as subjectId | |
| FROM examcontroller_false_number efn | |
| INNER JOIN assignstaff_exam_group_relation aegr ON aegr.exam_id = efn.examID | |
| INNER JOIN studentaccount sa ON sa.studentID = efn.studentID | |
| WHERE aegr.assignstaff_exam_groupname_id IN ($request->groupId) order by sa.regNo,efn.examID"; | |
| $falseNumbers = $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $falseNumbers; | |
| } | |
| /** | |
| * @author sibin | |
| *set false numbers with alpha numeric codes | |
| */ | |
| public function saveStudentFalseNumbersWithAlphaNumericCodes($regularDetails, $supplyDetails) | |
| { | |
| //$insertRegularStr = $this->realEscapeString($insertRegularStr); | |
| $insertRegularStr = implode(",", $regularDetails); | |
| $insertSupplyStr = implode(",", $supplyDetails); | |
| try { | |
| if (!empty($supplyDetails)) { | |
| $sql = "INSERT into examcontroller_false_number (studentID, false_number, examID, exam_supplementary_id,alpha_numeric_code) values $insertSupplyStr"; | |
| $this->executeQueryForObject($sql); | |
| } | |
| if (!empty($regularDetails)) { | |
| $sql = "INSERT into examcontroller_false_number (studentID, false_number, examID, examregID,alpha_numeric_code) values $insertRegularStr"; | |
| $this->executeQueryForObject($sql); | |
| } | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return true; | |
| } | |
| /** | |
| * @author sibin | |
| *get StudentFalseNumberDetailsWithpacketNoByExamSubjectRequest | |
| */ | |
| public function getStudentFalseNumberDetailsWithpacketNoByExamSubjectRequest($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $sql = ""; | |
| $studentList = []; | |
| $examRegField = $request->isSupply ? "supply_examreg_id" : "examregID"; | |
| $externalMarkTable = $request->isPg ? "externalexammarks_finalized" : "exammarks_external"; | |
| $condition = ""; | |
| if($request->subjectId){ | |
| $condition .= " AND e.subjectID IN ($request->subjectId) "; | |
| } | |
| if($request->batchId){ | |
| $condition .= " AND e.batchID IN ($request->batchId) "; | |
| } | |
| if ($request->packetNo) { | |
| $packetNoValues = ""; | |
| foreach ($request->packetNo as $packetNo) { | |
| $packetNoValues .= $packetNoValues ? ",\"$packetNo\"" : "\"$packetNo\""; | |
| } | |
| $request->packetNo = $packetNoValues; | |
| $condition .= " AND evps.packetNo IN ($request->packetNo) "; | |
| } | |
| $joinPacketsTable = $request->leftJoinPackets ? ' LEFT JOIN ' : ' INNER JOIN '; | |
| try { | |
| $sql = "SELECT sa.studentID,sa.regNo,sa.studentName,evps.packetNo,efn.false_number as falseNumber,efn.alpha_numeric_code as alphaNumericCode,ee.mark | |
| FROM examcontroller_false_number efn | |
| $joinPacketsTable examValuationStudentPacketsRelation evps ON evps.examId = efn.examID AND evps.studentId = efn.studentID | |
| INNER JOIN exam e ON e.examID = efn.examID | |
| INNER JOIN studentaccount sa ON sa.studentID = efn.studentID | |
| LEFT JOIN $externalMarkTable ee ON ee.studentID = efn.studentID AND ee.examID = efn.examID | |
| WHERE e.$examRegField IN ($request->examRegId) | |
| $condition ORDER BY sa.regNo"; | |
| $studentList = $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $studentList; | |
| } | |
| /** | |
| * save folio number | |
| * @param courseType | |
| * @param batchStartYear | |
| * @throws ProfessionalException | |
| */ | |
| public function saveFolioNumberDetails ( $courseType, $batchStartYear, $folioStart ) { | |
| $courseType = $this->realEscapeString($courseType); | |
| $batchStartYear = $this->realEscapeString($batchStartYear); | |
| $folioStart = $this->realEscapeString($folioStart); | |
| $sql = null; | |
| $condition = null; | |
| try { | |
| $sql = "INSERT INTO folioNumber_prefix (courseTypeID, year, prefix) VALUES($courseType, $batchStartYear, $folioStart)"; | |
| $falseNoList = $this->executeQuery($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $falseNoList; | |
| } | |
| /** | |
| * get folio number | |
| * @param courseType | |
| * @param batchStartYear | |
| * @throws ProfessionalException | |
| */ | |
| public function getFolioNumberDetails ( $courseType, $batchStartYear ) { | |
| $courseType = $this->realEscapeString($courseType); | |
| $batchStartYear = $this->realEscapeString($batchStartYear); | |
| $sql = null; | |
| $condition = null; | |
| if($courseType){ | |
| $condition .= " AND ct.courseTypeID = $courseType"; | |
| } | |
| if($batchStartYear){ | |
| $condition .= " AND fnp.year = $batchStartYear"; | |
| } | |
| try { | |
| $sql = "SELECT | |
| fnp.id, fnp.prefix, fnp.year, fnp.courseTypeID, ct.course_Type, ct.typeName | |
| FROM | |
| folioNumber_prefix fnp | |
| LEFT JOIN course_type ct ON (ct.courseTypeID = fnp.courseTypeID) | |
| WHERE | |
| 1=1 | |
| $condition | |
| "; | |
| $falseNoList = $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $falseNoList; | |
| } | |
| /** | |
| * delete folio number | |
| * @param id | |
| * @throws ProfessionalException | |
| */ | |
| public function deleteFolioNumber ($id) { | |
| $id = $this->realEscapeString($id); | |
| $sql = null; | |
| try { | |
| $sql = "DELETE FROM folioNumber_prefix WHERE id = $id"; | |
| $falseNoList = $this->executeQuery($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $falseNoList; | |
| } | |
| /** | |
| * save folio number | |
| * @param id | |
| * @throws ProfessionalException | |
| */ | |
| public function saveStudentFolioNumber ( $batchId, $batchStartYear, $studentId,$batchPriority,$folioNo ) { | |
| $batchId = $this->realEscapeString($batchId); | |
| $batchStartYear = $this->realEscapeString($batchStartYear); | |
| $studentId = $this->realEscapeString($studentId); | |
| $batchPriority = $this->realEscapeString($batchPriority); | |
| $folioNo = $this->realEscapeString($folioNo); | |
| $sql = null; | |
| $condition = null; | |
| try { | |
| $sql = "INSERT INTO generate_batchFolioNumber | |
| (batchID, batchPriority, studentID, folioNumber, `year`) VALUES($batchId, $batchPriority, $studentId, $folioNo, $batchStartYear)"; | |
| return $this->executeQuery($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| } | |
| /** | |
| * get folio number | |
| * @param courseType | |
| * @param batchStartYear | |
| * @throws ProfessionalException | |
| */ | |
| public function getBatchAssignedFolioNo ( $batchIds) { | |
| $batchIds = $this->realEscapeString($batchIds); | |
| $sql = null; | |
| try { | |
| $sql = "SELECT folioNumber FROM generate_batchFolioNumber WHERE batchID IN ($batchIds) | |
| "; | |
| $folioList = $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $folioList; | |
| } | |
| /** | |
| * @param examIds | |
| * @return Object List|null | |
| * @throws ProfessionalException | |
| */ | |
| public function getFalseNumbersByExams($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $sql = null; | |
| $result = []; | |
| try { | |
| if($request->examIds){ | |
| $sql = "SELECT false_number as falseNumber from examcontroller_false_number where examID IN ($request->examIds)"; | |
| $result = $this->executeQueryForList($sql); | |
| } | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $result; | |
| } | |
| /** | |
| * @param request | |
| * @return Object List|null | |
| * @throws ProfessionalException | |
| */ | |
| public function getFalseNumbersDetailsByStudentRegNo($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $sql = null; | |
| $result = []; | |
| try { | |
| if ($request->regNo) { | |
| $sql = "SELECT efn.studentID,sa.regNo,sa.studentName,e.batchID as batchId,b.batchName,e.semID as semId, | |
| IF(e.examregID,er.examregName,es.supplyDesc) as examRegName,IF(e.examregID,'REGULAR',es.supplyDesc) as examType, | |
| e.subjectID as subjectId,s.subjectName,s.subjectDesc,efn.examID,efn.false_number as falseNumber,ba.batchName as currentBatch, | |
| ex.examregID as regularExamRegId,erx.examregName AS regularExamRegName | |
| FROM examcontroller_false_number efn | |
| INNER JOIN studentaccount sa ON sa.studentID = efn.studentID | |
| INNER JOIN exam e ON e.examID = efn.examID | |
| INNER JOIN subjects s ON s.subjectID = e.subjectID | |
| INNER JOIN batches b ON b.batchID = e.batchID | |
| LEFT JOIN exam_registration er ON er.examregID = e.examregID | |
| LEFT JOIN exam_supplementary es ON es.id = e.supply_examreg_id | |
| LEFT JOIN batches ba ON ba.batchID = sa.batchID | |
| LEFT JOIN exam ex ON ex.semID = e.semID AND ex.batchID = e.batchID AND ex.subjectID = e.subjectID AND ex.examregID IS NOT NULL | |
| LEFT JOIN exam_registration erx ON erx.examregID = ex.examregID | |
| WHERE sa.regNo='$request->regNo' | |
| ORDER BY e.semID,e.subjectID, | |
| IF(CAST(es.examYear AS SIGNED) = 0, 99999, CAST(es.examYear AS SIGNED)) ,IF(CAST(es.examMonth AS SIGNED) = 0, 99999, CAST(es.examMonth AS SIGNED))"; | |
| $result = $this->executeQueryForList($sql); | |
| } | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $result; | |
| } | |
| /** | |
| * Get main book number details | |
| * @param bookNo | |
| * @return Object List|null | |
| * @throws ProfessionalException | |
| */ | |
| public function getMainBookNumberDetailsFromBookNo ( $bookNo ) { | |
| $bookNo = $this->realEscapeString($bookNo); | |
| $sql = null; | |
| try { | |
| $sql = "SELECT | |
| studentID AS studentId, | |
| examID AS examId | |
| FROM | |
| ec_main_book_number | |
| WHERE | |
| bookNo ='$bookNo'"; | |
| $mainBookDetails = $this->executeQueryForObject($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $mainBookDetails; | |
| } | |
| /** | |
| * get false numbers | |
| * @request | |
| */ | |
| public function getGeneratedFalseNumbersByPrefix($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $condition =""; | |
| if(!$request->considerAllExamTypes){ | |
| $condition .= " AND examregID NOT IN (0)"; | |
| } | |
| $sql = null; | |
| try { | |
| $sql = "SELECT studentID,false_number,examregID,examID FROM examcontroller_false_number | |
| WHERE 1=1 | |
| AND false_number LIKE '$request->prefixString%' $condition | |
| ORDER BY false_number ASC"; | |
| $falseNoList = $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $falseNoList; | |
| } | |
| /** | |
| * get false numbers | |
| * @request | |
| */ | |
| public function getGeneratedFalseNumbersByHall($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $sql = null; | |
| try { | |
| $sql = "SELECT t1.studentID, t2.studentName, t2.rollNo, t2.regNo, t3.false_number, t1.examID, t2.myImage,t3.alpha_numeric_code,t2.batchID,t1.seatNo,s.subjectName,s.subjectDesc | |
| from exam_hall_arranged_students t1, studentaccount t2, examcontroller_false_number t3 | |
| inner join exam e on e.examID = t3.examID | |
| inner join subjects s on s.subjectID = e.subjectID | |
| where t1.groupID='$request->groupID' and t1.hallID ='$request->hallID' and t1.studentID =t2.studentID and t2.batchID ='$request->batchID' and t1.studentID=t3.studentID and t1.examID=t3.examID and t2.studentID=t3.studentID order by t1.seatNo ASC"; | |
| $falseNoList = $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $falseNoList; | |
| } | |
| /** | |
| * @param FalseNo | |
| * @return Object List|null | |
| * @throws ProfessionalException | |
| */ | |
| public function getFalseNumberDetailsByRequest($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $sql = null; | |
| $condition = ""; | |
| if($request->subjectId){ | |
| $condition .= " AND e.subjectID IN ($request->subjectId)"; | |
| } | |
| try { | |
| $sql = "SELECT | |
| efn.studentID AS studentId, | |
| efn.examregID AS examRegId, | |
| efn.exam_supplementary_id AS examSupplyId, | |
| efn.examID AS examId | |
| FROM | |
| examcontroller_false_number efn | |
| INNER JOIN exam e ON e.examID = efn.examID | |
| WHERE | |
| efn.false_number = '$request->falseNumber' $condition"; | |
| $falseNoList = $this->executeQueryForObject($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $falseNoList; | |
| } | |
| /** | |
| * @param request | |
| * @return Object List|null | |
| * @throws ProfessionalException | |
| */ | |
| public function getFalseNumberRangeAssignedForStaffByRequest($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $sql = null; | |
| $condition = ""; | |
| $falseNoRange= ""; | |
| if((int)$request->isSupply){ | |
| $examRegIdField = "exam_supplementary_id"; | |
| $subjectFiled = "evss.subjectId"; | |
| }else{ | |
| $examRegIdField = "examregID"; | |
| $subjectFiled = "erss.subjectID"; | |
| } | |
| if ($request->examRegId) { | |
| $condition .= " AND erss.$examRegIdField IN ($request->examRegId)"; | |
| } | |
| if ($request->subjectId) { | |
| $condition .= " AND $subjectFiled IN ($request->subjectId)"; | |
| } | |
| if ($request->valuationCount) { | |
| $condition .= " AND evss.valuationCount IN ($request->valuationCount)"; | |
| } | |
| if ($request->staffId) { | |
| $condition .= " AND evss.staffId IN ($request->staffId)"; | |
| } | |
| try { | |
| if((int)$request->isSupply){ | |
| $sql ="SELECT MIN(CAST(efn.false_number AS CHAR)) AS startingFalseNumber,MAX(CAST(efn.false_number AS CHAR)) AS endingFalseNumber FROM exam_supplementary_student_subjects erss | |
| INNER JOIN exam_supplementary_student_details ersc ON ersc.exam_supplementary_id = erss.exam_supplementary_id AND ersc.studentID= erss.studentID | |
| INNER JOIN exam ex ON ex.examID = erss.examID | |
| INNER JOIN examValuationStaffAssignedStudents evss ON evss.examRegId = erss.exam_supplementary_id AND evss.subjectId = ex.subjectID AND evss.studentId = erss.studentID | |
| INNER JOIN staffaccounts sa ON sa.staffID = evss.staffId | |
| INNER JOIN studentaccount s ON s.studentID = ersc.studentID | |
| INNER JOIN exam e ON e.supply_examreg_id = erss.exam_supplementary_id AND e.subjectID = evss.subjectId AND e.batchID = s.batchID | |
| INNER JOIN examcontroller_false_number efn ON efn.studentID = s.studentID AND efn.examID = e.examID | |
| WHERE ersc.paid=1 AND evss.examType = 'SUPPLY' $condition"; | |
| }else{ | |
| $sql = "SELECT MIN(CAST(efn.false_number AS CHAR)) AS startingFalseNumber,MAX(CAST(efn.false_number AS CHAR)) AS endingFalseNumber FROM exam_reg_studentsubject erss | |
| INNER JOIN exam_reg_studentchallan ersc ON ersc.examregID = erss.examregID AND ersc.studentID= erss.studentID | |
| INNER JOIN examValuationStaffAssignedStudents evss ON evss.examRegId = erss.examregID AND evss.subjectId = erss.subjectID AND evss.studentId = erss.studentID | |
| INNER JOIN staffaccounts sa ON sa.staffID = evss.staffId | |
| INNER JOIN studentaccount s ON s.studentID = ersc.studentID | |
| INNER JOIN exam e ON e.examregID = erss.examregID AND e.subjectID = erss.subjectID AND e.batchID = s.batchID | |
| INNER JOIN examcontroller_false_number efn ON efn.studentID = s.studentID AND efn.examID = e.examID | |
| WHERE ersc.paid=1 AND evss.examType = 'REGULAR' $condition"; | |
| } | |
| $falseNoRange = $this->executeQueryForObject($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $falseNoRange; | |
| } | |
| /** | |
| * @param request | |
| * @return Object List|null | |
| * @throws ProfessionalException | |
| */ | |
| public function getFalseNumbersByRequest($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $sql = null; | |
| $condition = ""; | |
| if($request->regularExamRegId){ | |
| $condition .= " AND efn.examregID IN ($request->regularExamRegId)"; | |
| } | |
| if(is_array($request->studentIds)){ | |
| $request->studentIds = implode(",",$request->studentIds); | |
| } | |
| if($request->studentIds){ | |
| $condition .= " AND efn.studentID IN ($request->studentIds)"; | |
| } | |
| try { | |
| $sql = "SELECT | |
| efn.studentID AS studentId, | |
| efn.false_number as falseNumber, | |
| efn.examregID AS examRegId, | |
| efn.exam_supplementary_id AS examSupplyId | |
| FROM | |
| examcontroller_false_number efn | |
| INNER JOIN exam e ON e.examID = efn.examID | |
| WHERE | |
| 1=1 $condition GROUP BY efn.studentID"; | |
| $falseNoList = $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
| } | |
| return $falseNoList; | |
| } | |
| } | |
| ?> |