public function getAcademicCalendar($background = false) { $student = Student::select('students.*')->joinTermName()->findOrFail($this->student_id); $exams = Exam::inCurrentSemester()->ofStudent($this->student_id)->select('ss.name', 'exams.start_at')->get(); $pdf = $this->preparePdf($background); // ---- > $html = '<h2>التقويم الأكاديمي</h2>'; $pdf->writeHTMLCell(210, 20, 0, 50, $html, 0, 0, false, true, "C"); $pdf->SetFontSize(12); $html = 'بتاريخ : ' . Date::now()->format('l d F Y'); $pdf->writeHTMLCell(60, 10, 150, 40, $html, 0, 0, false, true, "C"); $pdf->SetFontSize(13, 'B'); $html = '<table cellpadding="3"> <tr><td align="right">إسم لطالب</td><td align="right">' . $student->name . '</td></tr> <tr><td align="right">الرقم الجامعي</td><td align="right">' . $student->code . '</td></tr> <tr><td align="right">تاريخ الإلتحاق</td><td align="right">' . Date::parse($student->created_at)->format('l d F Y') . '</td></tr> <tr><td align="right">السنة الدراسية</td><td align="right">' . $student->year_name . '</td></tr> </table>'; $pdf->writeHTMLCell(100, 20, 10, 70, $html, 0, 0, false, true, "R"); $pdf->SetFontSize(15, 'B'); $pdf->writeHTMLCell(170, 20, 20, 110, view('students::documents._examtable', compact('exams'))->render(), 0, 0, false, true, "C"); $html = '<table border="0" width="100%"><tbody><tr><td>القبول والتسجيل</td></tr> <tr><td>مركز التعليم عن بعد - كلية العلوم الشرعية</td></tr></tbody></table>'; $pdf->writeHTMLCell(130, 5, 90, 250, $html, 0, 0, false, true, "C"); ob_clean(); return $pdf; }