diff --git a/app/Livewire/AcademicYearResultTabulation.php b/app/Livewire/AcademicYearResultTabulation.php index 2b5bf21c..f3168a67 100644 --- a/app/Livewire/AcademicYearResultTabulation.php +++ b/app/Livewire/AcademicYearResultTabulation.php @@ -106,6 +106,7 @@ public function print() { //used pdf class directly $pdf = Pdf::loadView('pages.exam.print-exam-tabulation', ['tabulatedRecords' => $this->tabulatedRecords, 'totalMarksAttainableInEachSubject' => $this->totalMarksAttainableInEachSubject, 'subjects' => $this->subjects])->output(); + //save as pdf return response()->streamDownload( fn () => print($pdf), diff --git a/app/Livewire/ExamTabulation.php b/app/Livewire/ExamTabulation.php index 174b4a9d..c2b0c327 100644 --- a/app/Livewire/ExamTabulation.php +++ b/app/Livewire/ExamTabulation.php @@ -123,6 +123,7 @@ public function print() { //used pdf class directly $pdf = Pdf::loadView('pages.exam.print-exam-tabulation', ['tabulatedRecords' => $this->tabulatedRecords, 'totalMarksAttainableInEachSubject' => $this->totalMarksAttainableInEachSubject, 'subjects' => $this->subjects])->output(); + //save as pdf return response()->streamDownload( fn () => print($pdf), diff --git a/app/Livewire/SemesterResultTabulation.php b/app/Livewire/SemesterResultTabulation.php index cfe619f1..8b4e52e8 100644 --- a/app/Livewire/SemesterResultTabulation.php +++ b/app/Livewire/SemesterResultTabulation.php @@ -104,6 +104,7 @@ public function print() { //used pdf class directly $pdf = Pdf::loadView('pages.exam.print-exam-tabulation', ['tabulatedRecords' => $this->tabulatedRecords, 'totalMarksAttainableInEachSubject' => $this->totalMarksAttainableInEachSubject, 'subjects' => $this->subjects])->output(); + //save as pdf return response()->streamDownload( fn () => print($pdf), diff --git a/app/Services/Exam/ExamRecordService.php b/app/Services/Exam/ExamRecordService.php index 2b5327d4..5d331076 100755 --- a/app/Services/Exam/ExamRecordService.php +++ b/app/Services/Exam/ExamRecordService.php @@ -58,6 +58,7 @@ public function getAllUserExamRecordInExamForSubject(Exam $exam, int $user, int { //get all exam slots in exam $examSlots = $exam->examSlots->pluck('id'); + //get all exam records in for user and subject return ExamRecord::where(['user_id' => $user, 'subject_id' => $subject])->whereIn('exam_slot_id', $examSlots)->get(); } @@ -83,6 +84,7 @@ public function getAllUserExamRecordInSemesterForSubject(Semester $semester, $us $examSlots[] = $j; } } + //get all exam records in for user and subject return ExamRecord::where(['user_id' => $user, 'subject_id' => $subject])->whereIn('exam_slot_id', $examSlots)->get(); }