Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 72 |
| Template9SupplementaryConsolidatedResultGenerator | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
156.00 | |
0.00% |
0 / 72 |
| __construct | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 2 |
|||
| getTemplateName | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 14 |
|||
| processData | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 19 |
|||
| renderConsolidatedMarkListResult | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 37 |
|||
| <?php | |
| // Template Supplementary Consilidated Generator For Carmel Collage | |
| namespace com\linways\ec\core\service\SupplementaryConsolidatedMarkListGenerator; | |
| use com\linways\ec\core\service\StudentMarkListService; | |
| use com\linways\ec\core\service\ExamRegistrationService; | |
| use com\linways\ec\core\exception\ExamControllerException; | |
| use com\linways\base\util\TwigRenderer; | |
| use com\linways\core\ams\professional\util\PdfUtil; | |
| use com\linways\ec\core\service\SupplementaryConsolidatedMarkListGenerator\SupplementaryConsolidatedMarkListResultDataGenerator; | |
| use com\linways\ec\core\service\CommonExamService; | |
| use com\linways\core\ams\professional\util\CommonUtil; | |
| use com\linways\ec\core\service\MarkMigrationGenerator\Template9MigrationdResultGenerator; | |
| class Template9SupplementaryConsolidatedResultGenerator extends SupplementaryConsolidatedMarkListResultDataGenerator | |
| { | |
| private $MarkMigrationResultDataGenerator; | |
| public function __construct(){ | |
| $this->MarkMigrationResultDataGenerator = new Template9MigrationdResultGenerator(); | |
| } | |
| protected function getTemplateName($request){ | |
| $templateName = "template_9"; | |
| $examRegistrationDetails = new \stdClass; | |
| $examRegistrationDetailsArray = ExamRegistrationService::getInstance()->searchDetailedExamRegistrationDetails($request); | |
| if(empty($examRegistrationDetailsArray)){ | |
| throw new ExamControllerException(ExamControllerException::NO_DETAILS_FOUND,"No Details Found"); | |
| } | |
| $examRegistrationDetails->courseTypeID = $examRegistrationDetailsArray[0]->groups[0]->courseTypeID; | |
| $examRegistrationDetails->courseTypeName = $examRegistrationDetailsArray[0]->groups[0]->courseTypeName; | |
| $examRegistrationDetails->batchStartYear = $examRegistrationDetailsArray[0]->groups[0]->batchStartYear; | |
| $examRegistrationDetails->deptID = $examRegistrationDetailsArray[0]->groups[0]->deptID; | |
| $examRegistrationDetails->deptName = $examRegistrationDetailsArray[0]->groups[0]->deptName; | |
| $examRegistrationDetails->degreeName = $examRegistrationDetailsArray[0]->groups[0]->degreeName; | |
| return $templateName; | |
| } | |
| /** | |
| * Process Student data college base | |
| * | |
| * @param $request | |
| */ | |
| protected function processData($request){ | |
| $response = new \stdClass; | |
| $studentsMarkDetails = []; | |
| $studentsMarkDetails = StudentMarkListService::getInstance()->getAllRegistredStudentMarkDetailsDummyData($request); | |
| if(empty($studentsMarkDetails)){ | |
| throw new ExamControllerException(ExamControllerException::NO_DETAILS_FOUND,"No Details Found"); | |
| } | |
| $studentsMarkDetails = $this->MarkMigrationResultDataGenerator->processSupplementaryStudentData($studentsMarkDetails,$request); | |
| $response->studentData = $studentsMarkDetails->studentsDetails; | |
| $response->examRegistrationData = StudentMarkListService::getInstance()->getExamRegistrationDetailsDataForConsolidatedAndIndividualReports($request); | |
| $response->examRegistrationData->subjects = $studentsMarkDetails->displaySubjects; | |
| foreach( $response->examRegistrationData->subjects as $subject){ | |
| $subject->colspan = 1; | |
| $subject->colspan = $subject->isExternal == '1' ? $subject->colspan + 1 : $subject->colspan; | |
| $subject->colspan = $subject->isInternal == '1' ? $subject->colspan + 1 : $subject->colspan; | |
| } | |
| $response->examRegistrationData->subjectColSpan = array_sum(array_column($response->examRegistrationData->subjects, "colspan")); | |
| $response->collegeData = CommonExamService::getInstance()->getCollegeDetails(); | |
| return $response; | |
| } | |
| /** | |
| * Render Program Result | |
| * | |
| * @param $templateName | |
| * @param Object $data | |
| * @return Object | |
| */ | |
| protected function renderConsolidatedMarkListResult($templateName, $data){ | |
| if(empty($data)){ | |
| throw new ExamControllerException(ExamControllerException::NO_DETAILS_FOUND,"No Details Found"); | |
| } | |
| else{ | |
| $responseHtml = TwigRenderer::renderTemplateFileToHtml(realpath(DOCUMENT_ROOT."../examcontroller-api/src/com/linways/web/templates/SupplementaryConsolidatedMarkList/Template9/$templateName.twig"), [ 'data'=>$data ]); | |
| // photo Copy Of Answer Script Details | |
| $footerData = new \stdClass; | |
| if(!empty($data->examRegistrationData->examBatchProperties)){ | |
| $footerData = $data->examRegistrationData->examBatchProperties->consolidatedMarkListFooterData ? json_decode($data->examRegistrationData->examBatchProperties->consolidatedMarkListFooterData) : new \stdClass; | |
| } | |
| $responseHtmlPrint = TwigRenderer::renderTemplateFileToHtml(realpath(DOCUMENT_ROOT."../examcontroller-api/src/com/linways/web/templates/RegularConsolidatedMarkList/Template9/photoCopyOfAnswerScript.twig"), [ 'footerData'=>$footerData ]); | |
| $prtContent = NULL; | |
| $prtContent .= '<html><head>'; | |
| $prtContent .= "<style> | |
| </style>"; | |
| $prtContent .= '</head><title>Consolidated MarkList</title><body>'; | |
| $prtContent .= $responseHtml . $responseHtmlPrint; | |
| $prtContent .= '</body></html>'; | |
| $totalSubjectsCount = count($data->examRegistrationData->subjects); | |
| $totalWidth = ( $totalSubjectsCount * 3 * 15 ) + 100; | |
| $totalHeight = $totalWidth / 1.414; | |
| $options = array( | |
| 'page-width' => $totalWidth."mm", | |
| 'page-height' => $totalHeight."mm", | |
| 'dpi' => 96, | |
| 'margin-top' => "9mm", | |
| 'margin-left' => "9mm", | |
| 'margin-right' => "9mm", | |
| 'margin-bottom' => "9mm", | |
| // 'binary' => "/usr/local/bin/wkhtmltopdf", // For Mac | |
| 'user-style-sheet' => realpath(DOCUMENT_ROOT . "/libcommon/bootstrap/css/bootstrap.min.css") | |
| ); | |
| $programResult->dispalyHtmlData = $responseHtml; | |
| $programResult->printData = PdfUtil::renderPdf($prtContent, $options); | |
| $programResult->isShowPhotoCopyAnswerScriptFooter = 1; | |
| $programResult->photoCopyAnswerScriptFooterData = $footerData; | |
| return $programResult; | |
| } | |
| } | |
| } | |