Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 25 |
CRAP | |
0.00% |
0 / 473 |
| GraceMarkApplicaionService | |
0.00% |
0 / 1 |
|
0.00% |
0 / 25 |
4160.00 | |
0.00% |
0 / 473 |
| __construct | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 2 |
|||
| getAllGraceMarkSettingsTabMenus | |
0.00% |
0 / 1 |
42.00 | |
0.00% |
0 / 24 |
|||
| saveGraceMarkEventCategories | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 25 |
|||
| saveGraceMarkEventPositions | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 24 |
|||
| getAllGraceMarkEventCategoryDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 21 |
|||
| getAllGraceMarkEventPositionDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 20 |
|||
| deleteGraceMarkEventCategoryDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 12 |
|||
| deleteGraceMarkEventPositionDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 12 |
|||
| saveGraceMarkSubCategories | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 27 |
|||
| getAllGraceMarkSubCategories | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 25 |
|||
| deleteGraceMarkSubCategories | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 12 |
|||
| saveGraceMarkInitiateApplication | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 29 |
|||
| getAllGraceMarkInitiatedApplications | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 22 |
|||
| deleteGraceMarkInititeApplication | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 12 |
|||
| saveGraceMarkInitiateApplicationBatches | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 20 |
|||
| getAllAssignedGraceMarkInitiatedApplicationBatches | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 20 |
|||
| deleteAssignedGraceMarkBatch | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 12 |
|||
| getGraceMarkApplicationByStudentId | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 32 |
|||
| getGraceMarkApplicationDetailsByApplnId | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 27 |
|||
| saveGraceMarkEventLevels | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 22 |
|||
| getAllGraceMarkEventLevelDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 17 |
|||
| deleteGraceMarkEventLevelDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 12 |
|||
| getGraceMarkEventsAndSubEvents | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 21 |
|||
| getMaxApplicationNumberForGraceMarkAppliedDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 8 |
|||
| updateGraceMarkAppliedConfirmStatus | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 15 |
|||
| <?php | |
| namespace com\linways\ec\core\service; | |
| use com\linways\ec\core\dto\FalseNumberSetting; | |
| use com\linways\ec\core\dto\FalseNumberSettingExamLog; | |
| use com\linways\base\util\MakeSingletonTrait; | |
| use com\linways\base\util\SecurityUtils; | |
| use com\linways\ec\core\constant\StatusConstants; | |
| use com\linways\ec\core\exception\ExamControllerException; | |
| use com\linways\ec\core\mapper\GraceMarkApplicationServiceMapper; | |
| use com\linways\core\ams\professional\service\CommonService; | |
| use com\linways\core\ams\professional\dto\SettingsConstents; | |
| use com\linways\ec\core\request\SearchRuleRequest; | |
| use com\linways\ec\core\service\RuleService; | |
| class GraceMarkApplicaionService extends BaseService | |
| { | |
| use MakeSingletonTrait; | |
| private function __construct() { | |
| $this->mapper = GraceMarkApplicationServiceMapper::getInstance()->getMapper(); | |
| } | |
| /** | |
| * get Current Regular Exam UI Type | |
| * @param $searchRequest | |
| * @return $response | |
| */ | |
| public function getAllGraceMarkSettingsTabMenus($searchRequest) { | |
| $searchRequest = $this->realEscapeObject($searchRequest); | |
| try | |
| { | |
| $response = new \stdClass; | |
| $tabMenusDisplay = new \stdClass; | |
| $tabMenusDisplay->addEventCategory = false; | |
| $tabMenusDisplay->addLevel = false; | |
| $tabMenusDisplay->addEventSubCategory = false; | |
| $tabMenusDisplay->addPositions = false; | |
| $searchRuleRequest = new SearchRuleRequest; | |
| $searchRuleRequest->name = "GRACE_MARK_SETTINGS_TAB_MENU"; | |
| $graceMarkSettings = reset(RuleService::getInstance()->searchRule($searchRuleRequest))->rule; | |
| $tabMenusDisplay->addEventCategory = $graceMarkSettings->eventCategoryTemplate ? $graceMarkSettings->eventCategoryTemplate : false; | |
| $tabMenusDisplay->addLevel = $graceMarkSettings->eventLevelTemplate ? $graceMarkSettings->eventLevelTemplate : false; | |
| $tabMenusDisplay->addEventSubCategory = $graceMarkSettings->eventSubCategoryTemplate ? $graceMarkSettings->eventSubCategoryTemplate : false; | |
| $tabMenusDisplay->addPositions = $graceMarkSettings->eventPositionTemplate ? $graceMarkSettings->eventPositionTemplate : false; | |
| $response->tabMenus = $tabMenusDisplay; | |
| } | |
| catch (\Exception $e) | |
| { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| return $response; | |
| } | |
| /** | |
| * Save grace mark event category | |
| * @param $categoryName | |
| * @param $levelCount | |
| * @param $percentageLimit | |
| */ | |
| public function saveGraceMarkEventCategories($categoryObject) | |
| { | |
| $categoryObject = $this->realEscapeObject($categoryObject); | |
| $staffId = $GLOBALS['userId']; | |
| $categoryObject->properties = $categoryObject->properties ? json_encode($categoryObject->properties) : "{}"; | |
| if( $categoryObject->id){ | |
| $sql = "UPDATE | |
| ec_grace_mark_categories | |
| SET | |
| categoryName = '$categoryObject->name', | |
| level_select_count = '$categoryObject->levelSelectionCount', | |
| percentage_limit = '$categoryObject->percentageLimit', | |
| properties = '$categoryObject->properties', | |
| updated_by = '$staffId' | |
| WHERE | |
| id = $categoryObject->id"; | |
| } | |
| else{ | |
| $sql = "INSERT INTO ec_grace_mark_categories (categoryName,level_select_count,percentage_limit,properties,created_by) VALUES ('$categoryObject->name','$categoryObject->levelSelectionCount','$categoryObject->percentageLimit', ' $categoryObject->properties', '$staffId')"; | |
| } | |
| try { | |
| $this->executeQuery($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * Save grace mark event sub category | |
| * @param $categoryObject | |
| */ | |
| public function saveGraceMarkEventPositions($categoryObject) | |
| { | |
| $categoryObject = $this->realEscapeObject($categoryObject); | |
| $categoryObject->properties = $categoryObject->properties ? json_encode($categoryObject->properties) : "{}"; | |
| $staffId = $GLOBALS['userId']; | |
| if( $categoryObject->id){ | |
| $sql = "UPDATE | |
| ec_grace_mark_positions | |
| SET | |
| positionName = '$categoryObject->name', | |
| priority = '$categoryObject->priority', | |
| properties = '$categoryObject->properties', | |
| updated_by = '$staffId' | |
| WHERE | |
| id = $categoryObject->id"; | |
| } | |
| else{ | |
| $sql = "INSERT INTO ec_grace_mark_positions (positionName,priority,properties,created_by) VALUES ('$categoryObject->name','$categoryObject->priority', ' $categoryObject->properties','$staffId')"; | |
| } | |
| try { | |
| $this->executeQuery($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * get grace mark event category | |
| * @return mixed | |
| * @throws ExamControllerException | |
| */ | |
| public function getAllGraceMarkEventCategoryDetails($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $condition = ''; | |
| $sql = "SELECT | |
| id, | |
| categoryName as name, | |
| level_select_count as levelSelectionCount, | |
| percentage_limit as percentageLimit, | |
| properties | |
| FROM | |
| ec_grace_mark_categories | |
| WHERE | |
| 1=1 $condition | |
| ORDER BY | |
| created_date DESC"; | |
| try { | |
| return $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * get grace mark event positions | |
| * @return mixed | |
| * @throws ExamControllerException | |
| */ | |
| public function getAllGraceMarkEventPositionDetails($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $condition = ''; | |
| $sql = "SELECT | |
| id, | |
| positionName as name, | |
| priority as priority , | |
| properties | |
| FROM | |
| ec_grace_mark_positions | |
| WHERE | |
| 1=1 $condition | |
| ORDER BY | |
| priority ASC"; | |
| try { | |
| return $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * Delete grace mark event details | |
| * @param $id | |
| */ | |
| public function deleteGraceMarkEventCategoryDetails($categoryObject) | |
| { | |
| $categoryObject = $this->realEscapeObject($categoryObject); | |
| $sql = "DELETE FROM | |
| ec_grace_mark_categories | |
| WHERE | |
| id = $categoryObject->id"; | |
| try { | |
| $this->executeQuery($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * Delete grace mark event position details | |
| * @param $id | |
| */ | |
| public function deleteGraceMarkEventPositionDetails($categoryObject) | |
| { | |
| $categoryObject = $this->realEscapeObject($categoryObject); | |
| $sql = "DELETE FROM | |
| ec_grace_mark_positions | |
| WHERE | |
| id = $categoryObject->id"; | |
| try { | |
| $this->executeQuery($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * Save grace mark event category | |
| * @param $categoryName | |
| * @param $levelCount | |
| * @param $percentageLimit | |
| */ | |
| public function saveGraceMarkSubCategories($levelObj) | |
| { | |
| $levelObj = $this->realEscapeObject($levelObj); | |
| $levelObj->positionList = $levelObj->positionList ? json_encode($levelObj->positionList) : "{}";; | |
| $levelObj->properties = $levelObj->properties ? json_encode($levelObj->properties) : "{}"; | |
| $staffId = $GLOBALS['userId']; | |
| if($levelObj->levelId){ | |
| $sql = "UPDATE ec_grace_mark_levels | |
| SET | |
| levelLimit = '$levelObj->levelLimit', | |
| positions = '$levelObj->positionList', | |
| properties = '$levelObj->properties', | |
| updated_by = '$staffId' | |
| WHERE | |
| id = '$levelObj->levelId'"; | |
| } | |
| else{ | |
| $sql = "INSERT INTO ec_grace_mark_levels | |
| (levelName,categoryID,levelLimit,positions,properties,created_by) | |
| VALUES | |
| ('$levelObj->levelName','$levelObj->categoryId','$levelObj->levelLimit','$levelObj->positionList','$levelObj->properties','$staffId')"; | |
| } | |
| try { | |
| $this->executeQuery($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * get grace mark sub category | |
| * @return mixed | |
| * @throws ExamControllerException | |
| */ | |
| public function getAllGraceMarkSubCategories($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $sql = "SELECT | |
| egmc.id as categoryId, | |
| egmc.categoryName, | |
| egmc.properties->> '$.isPositionRequired' as hasPosition, | |
| egmc.properties as categoryProperty, | |
| egmc.percentage_limit as percentageLimit, | |
| egl.id as levelId, | |
| egl.levelName, | |
| egl.positions, | |
| egl.levelLimit, | |
| egl.properties | |
| FROM | |
| ec_grace_mark_levels egl | |
| INNER JOIN ec_grace_mark_categories egmc ON | |
| (egmc.id = egl.categoryID) | |
| ORDER BY | |
| egmc.id DESC"; | |
| try { | |
| return $this->executeQueryForList($sql, $this->mapper[GraceMarkApplicationServiceMapper::GET_GRACE_MARK_LEVELS]); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * Delete grace mark sub categories | |
| * @param $id | |
| */ | |
| public function deleteGraceMarkSubCategories($level) | |
| { | |
| $level = $this->realEscapeObject($level); | |
| $sql = "DELETE FROM | |
| ec_grace_mark_levels | |
| WHERE | |
| id = $level->levelId"; | |
| try { | |
| $this->executeQuery($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * Save grace mark inititiate application | |
| * @param $request | |
| */ | |
| public function saveGraceMarkInitiateApplication($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $staffId = $GLOBALS['userId']; | |
| $request->properties = $request->properties ? json_encode($request->properties) : "{}"; | |
| if($request->id){ | |
| $sql = "UPDATE ec_grace_mark_appln_initiate | |
| SET | |
| appln_heading = '$request->applicationName', | |
| startYear = '$request->startYear', | |
| endYear = '$request->endYear', | |
| startDate = '$request->fromDate', | |
| endDate = '$request->toDate', | |
| properties = '$request->properties', | |
| updated_by = '$staffId' | |
| WHERE | |
| id = '$request->id'"; | |
| } | |
| else{ | |
| $sql = "INSERT INTO ec_grace_mark_appln_initiate | |
| (appln_heading,startYear,endYear,startDate,endDate,properties,created_by) | |
| VALUES | |
| ('$request->applicationName','$request->startYear','$request->endYear','$request->fromDate','$request->toDate','$request->properties','$staffId')"; | |
| } | |
| try { | |
| $this->executeQuery($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * get grace mark application initiate | |
| * @return mixed | |
| * @throws ExamControllerException | |
| */ | |
| public function getAllGraceMarkInitiatedApplications($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $sql = "SELECT | |
| id, | |
| appln_heading as applicationName, | |
| appln_heading as applicationHeading, | |
| startYear, | |
| endYear, | |
| startDate as fromDate, | |
| endDate as toDate, | |
| properties ->> '$.semesters'as semesters, | |
| properties ->> '$.eventIds'as eventIds | |
| FROM | |
| ec_grace_mark_appln_initiate | |
| ORDER BY | |
| created_date DESC"; | |
| try { | |
| return $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * Delete grace mark initiate application | |
| * @param $id | |
| */ | |
| public function deleteGraceMarkInititeApplication($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $sql = "DELETE FROM | |
| ec_grace_mark_appln_initiate | |
| WHERE | |
| id = $request->id"; | |
| try { | |
| $this->executeQuery($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * Save grace mark inititiate application batches | |
| * @param $request | |
| */ | |
| public function saveGraceMarkInitiateApplicationBatches($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $application = $request->application ; | |
| foreach ( $request->selectedBatches as $selectedBatch ) { | |
| $selectedBatch = (object)$selectedBatch; | |
| $values[] = "( | |
| '$application->id', | |
| '$selectedBatch->id' | |
| )"; | |
| } | |
| $sql = "INSERT INTO ec_grace_mark_appln_assigned_batches | |
| (gracemark_appln_id,groups_id) | |
| VALUES | |
| " . implode(', ', $values); | |
| try { | |
| $this->executeQuery($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * get grace mark application initiate batches | |
| * @return mixed | |
| * @throws ExamControllerException | |
| */ | |
| public function getAllAssignedGraceMarkInitiatedApplicationBatches($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $sql = "SELECT | |
| egmaab.id as batchRelationId, | |
| g.id as groupId, | |
| g.name as name | |
| FROM | |
| ec_grace_mark_appln_assigned_batches egmaab | |
| INNER JOIN `groups` g ON | |
| g.id = egmaab.groups_id | |
| WHERE | |
| egmaab.gracemark_appln_id = '$request->id' | |
| ORDER BY | |
| created_date DESC"; | |
| try { | |
| return $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * Delete grace mark initiate application batch | |
| * @param $id | |
| */ | |
| public function deleteAssignedGraceMarkBatch($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $sql = "DELETE FROM | |
| ec_grace_mark_appln_assigned_batches | |
| WHERE | |
| id = $request->batchRelationId"; | |
| try { | |
| $this->executeQuery($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * get grace mark application by student request | |
| * @param $request | |
| */ | |
| public function getGraceMarkApplicationByStudentId($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $sql = "SELECT | |
| egmsb.id as assignedId, | |
| egmsb.gracemark_appln_id as applnId, | |
| egmpi.startYear, | |
| egmpi.endYear, | |
| egmpi.appln_heading as applnHeading, | |
| egmpi.startDate, | |
| egmpi.endDate, | |
| egmpi.properties ->> '$.semesters' as semesters | |
| FROM | |
| ec_grace_mark_appln_assigned_batches egmsb | |
| INNER JOIN | |
| ec_grace_mark_appln_initiate egmpi ON | |
| (egmsb.gracemark_appln_id = egmpi.id) | |
| INNER JOIN | |
| `groups` g ON | |
| g.id = egmsb.groups_id | |
| INNER JOIN program p ON | |
| p.id = g.properties ->> '$.programId' | |
| INNER JOIN student_program_account spa ON | |
| spa.current_program_id = p.id AND | |
| spa.current_batch_id = egmsb.groups_id AND | |
| spa.properties->>'$.academicStatus' IN ('ACTIVE','COMPLETED') | |
| WHERE spa.student_id = '$request->studentId'"; | |
| try { | |
| return $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * Get Grace Mark Application By applnId | |
| * @param $applnId | |
| */ | |
| public function getGraceMarkApplicationDetailsByApplnId($applnId) | |
| { | |
| $applnId = $this->realEscapeString($applnId); | |
| $sql = "SELECT | |
| egmsb.id as assignedId, | |
| egmsb.gracemark_appln_id as applnId, | |
| egmpi.startYear, | |
| egmpi.endYear, | |
| egmpi.appln_heading as applnHeading, | |
| egmpi.startDate, | |
| egmpi.endDate, | |
| egmsb.published_dates, | |
| egmpi.categoryIDs, | |
| egmpi.properties ->> '$.semesters' as semesters, | |
| egmpi.properties as properties | |
| FROM | |
| ec_grace_mark_appln_assigned_batches egmsb | |
| INNER JOIN | |
| ec_grace_mark_appln_initiate egmpi ON | |
| (egmsb.gracemark_appln_id = egmpi.id) | |
| WHERE | |
| egmsb.gracemark_appln_id = '$applnId'"; | |
| try { | |
| return $this->executeQueryForObject($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * Save grace mark event levels | |
| * @param $categoryObject | |
| */ | |
| public function saveGraceMarkEventLevels($categoryObject) | |
| { | |
| $categoryObject = $this->realEscapeObject($categoryObject); | |
| $staffId = $GLOBALS['userId']; | |
| if( $categoryObject->id){ | |
| $sql = "UPDATE | |
| gracemarks_levels | |
| SET | |
| levelName = '$categoryObject->name', | |
| levelDesc = '$categoryObject->levelDesc', | |
| updated_by = '$staffId' | |
| WHERE | |
| id = $categoryObject->id"; | |
| } | |
| else{ | |
| $sql = "INSERT INTO gracemarks_levels (levelName,levelDesc,created_by) VALUES ('$categoryObject->name','$categoryObject->levelDesc','$staffId')"; | |
| } | |
| try { | |
| $this->executeQuery($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * get grace mark event levels | |
| * @return mixed | |
| * @throws ExamControllerException | |
| */ | |
| public function getAllGraceMarkEventLevelDetails($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $condition = ''; | |
| $sql = "SELECT | |
| id, | |
| levelName as name, | |
| levelDesc | |
| FROM | |
| gracemarks_levels | |
| WHERE | |
| 1=1 $condition"; | |
| try { | |
| return $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * Delete grace mark event level details | |
| * @param $id | |
| */ | |
| public function deleteGraceMarkEventLevelDetails($categoryObject) | |
| { | |
| $categoryObject = $this->realEscapeObject($categoryObject); | |
| $sql = "DELETE FROM | |
| gracemarks_levels | |
| WHERE | |
| id = $categoryObject->id"; | |
| try { | |
| $this->executeQuery($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * Get grace mark event level details | |
| */ | |
| public function getGraceMarkEventsAndSubEvents() | |
| { | |
| $sql = "SELECT | |
| egl.categoryID, | |
| egc.categoryName, | |
| egc.level_select_count as levelSelectCount, | |
| egc.percentage_limit as percentageLimit, | |
| egl.levelName, egl.id as levelId, | |
| egl.levelLimit, | |
| egl.positions | |
| FROM | |
| ec_grace_mark_levels egl | |
| INNER JOIN ec_grace_mark_categories egc ON | |
| egl.categoryID = egc.id | |
| ORDER BY | |
| egc.id DESC"; | |
| try { | |
| return $this->executeQueryForList($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * Get grace mark applied max applno | |
| */ | |
| public function getMaxApplicationNumberForGraceMarkAppliedDetails() | |
| { | |
| $sql = "SELECT MAX(applNo) AS applnNo FROM ec_grace_mark_applied_students egmas ;"; | |
| try { | |
| return $this->executeQueryForObject($sql)->applnNo; | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| /** | |
| * Update grace mark applied confirm status | |
| * @params @request | |
| */ | |
| public function updateGraceMarkAppliedConfirmStatus($request) | |
| { | |
| $request = $this->realEscapeObject($request); | |
| $sql = "UPDATE | |
| ec_grace_mark_applied_students | |
| SET | |
| isConfirmed = '$request->confirm' | |
| WHERE | |
| studentID ='$request->studentId' | |
| AND gracemark_appln_id = '$request->applnId' "; | |
| try { | |
| return $this->executeQuery($sql); | |
| } catch (\Exception $e) { | |
| throw new ExamControllerException($e->getCode(),$e->getMessage()); | |
| } | |
| } | |
| } |