public function studentPdf(Request $request) { $post = $request->all(); $user = $post['student']; $std = student::where('studentNo', '=', $user)->first(); $charge = charges::where('students_studentNo', '=', $user)->first(); $serial = Serial::where('students_studentNo', '=', $user)->first(); if ($charge->total == 0) { $html = PDF::make($std, $serial); } else { $html = PDF::create($std, $charge, $serial); } $mpdf = new mpdf(); $mpdf->WriteHTML($html); $mpdf->Output(); }
public static function report() { $appliedStudents = DB::table('students')->count(); $clearedStudentsFac = DB::table('cleared_by')->where('cleared_by.department_cleared_by', '!=', 'N/A')->count(); $pendingStudentsFac = DB::table('cleared_by')->where('cleared_by.department_cleared_by', '=', 'N/A')->count(); //cafeteria $clearedStudentsCaf = DB::table('cleared_by')->where('cleared_by.cafeteria_cleared_by', '!=', 'N/A')->count(); $pendingStudentsCaf = DB::table('cleared_by')->where('cleared_by.cafeteria_cleared_by', '=', 'N/A')->count(); //library $clearedStudentsLib = DB::table('cleared_by')->where('cleared_by.library_cleared_by', '!=', 'N/A')->count(); $pendingStudentsLib = DB::table('cleared_by')->where('cleared_by.library_cleared_by', '=', 'N/A')->count(); //Ex-Act $clearedStudentsExa = DB::table('cleared_by')->where('cleared_by.extra_curricular_cleared_by', '!=', 'N/A')->count(); $pendingStudentsExa = DB::table('cleared_by')->where('cleared_by.extra_curricular_cleared_by', '=', 'N/A')->count(); //Games $clearedStudentsGam = DB::table('cleared_by')->where('cleared_by.games_cleared_by', '!=', 'N/A')->count(); $pendingStudentsGam = DB::table('cleared_by')->where('cleared_by.games_cleared_by', '=', 'N/A')->count(); //F-Aid $clearedStudentsFna = DB::table('cleared_by')->where('cleared_by.financial_aid_cleared_by', '!=', 'N/A')->count(); $pendingStudentsFna = DB::table('cleared_by')->where('cleared_by.financial_aid_cleared_by', '=', 'N/A')->count(); //Fin $clearedStudentsFin = DB::table('cleared_by')->where('cleared_by.finance_cleared_by', '!=', 'N/A')->count(); $pendingStudentsFin = DB::table('cleared_by')->where('cleared_by.finance_cleared_by', '=', 'N/A')->count(); //total Students $totalStudentsCleared = DB::table('clearstatus')->where('status', '=', 'Cleared')->count(); $totalStudentsPending = DB::table('clearstatus')->where('status', '=', 'Pending')->count(); //faculty //FIT $reqStudentFIT = DB::table('students')->where('faculty', '=', 'FIT')->count(); $clearedStudentsFIT = DB::table('clearstatus')->join('students', 'clearstatus.students_studentNo', '=', 'students.studentNo')->where('clearstatus.status', '=', 'CLeared')->where('students.faculty', '=', 'FIT')->count(); $pendingStudentsFIT = DB::table('clearstatus')->join('students', 'clearstatus.students_studentNo', '=', 'students.studentNo')->where('clearstatus.status', '=', 'Pending')->where('students.faculty', '=', 'FIT')->count(); //SLS $reqStudentSLS = DB::table('students')->where('faculty', '=', 'SLS')->count(); $clearedStudentsSLS = DB::table('clearstatus')->join('students', 'clearstatus.students_studentNo', '=', 'students.studentNo')->where('clearstatus.status', '=', 'CLeared')->where('students.faculty', '=', 'SLS')->count(); $pendingStudentsSLS = DB::table('clearstatus')->join('students', 'clearstatus.students_studentNo', '=', 'students.studentNo')->where('clearstatus.status', '=', 'Pending')->where('students.faculty', '=', 'SLS')->count(); //SOA $reqStudentSOA = DB::table('students')->where('faculty', '=', 'SOA')->count(); $clearedStudentsSOA = DB::table('clearstatus')->join('students', 'clearstatus.students_studentNo', '=', 'students.studentNo')->where('clearstatus.status', '=', 'CLeared')->where('students.faculty', '=', 'SOA')->count(); $pendingStudentsSOA = DB::table('clearstatus')->join('students', 'clearstatus.students_studentNo', '=', 'students.studentNo')->where('clearstatus.status', '=', 'Pending')->where('students.faculty', '=', 'SOA')->count(); //SHSS $reqStudentSHSS = DB::table('students')->where('faculty', '=', 'SHSS')->count(); $clearedStudentsSHSS = DB::table('clearstatus')->join('students', 'clearstatus.students_studentNo', '=', 'students.studentNo')->where('clearstatus.status', '=', 'CLeared')->where('students.faculty', '=', 'SHSS')->count(); $pendingStudentsSHSS = DB::table('clearstatus')->join('students', 'clearstatus.students_studentNo', '=', 'students.studentNo')->where('clearstatus.status', '=', 'Pending')->where('students.faculty', '=', 'SHSS')->count(); //SFAE $reqStudentSFAE = DB::table('students')->where('faculty', '=', 'SFAE')->count(); $clearedStudentsSFAE = DB::table('clearstatus')->join('students', 'clearstatus.students_studentNo', '=', 'students.studentNo')->where('clearstatus.status', '=', 'CLeared')->where('students.faculty', '=', 'SFAE')->count(); $pendingStudentsSFAE = DB::table('clearstatus')->join('students', 'clearstatus.students_studentNo', '=', 'students.studentNo')->where('clearstatus.status', '=', 'Pending')->where('students.faculty', '=', 'SFAE')->count(); //SOA $reqStudentCHT = DB::table('students')->where('faculty', '=', 'CHT')->count(); $clearedStudentsCHT = DB::table('clearstatus')->join('students', 'clearstatus.students_studentNo', '=', 'students.studentNo')->where('clearstatus.status', '=', 'CLeared')->where('students.faculty', '=', 'CHT')->count(); $pendingStudentsCHT = DB::table('clearstatus')->join('students', 'clearstatus.students_studentNo', '=', 'students.studentNo')->where('clearstatus.status', '=', 'Pending')->where('students.faculty', '=', 'CHT')->count(); //SOA $reqStudentSBS = DB::table('students')->where('faculty', '=', 'SBS')->count(); $clearedStudentsSBS = DB::table('clearstatus')->join('students', 'clearstatus.students_studentNo', '=', 'students.studentNo')->where('clearstatus.status', '=', 'CLeared')->where('students.faculty', '=', 'SBS')->count(); $pendingStudentsSBS = DB::table('clearstatus')->join('students', 'clearstatus.students_studentNo', '=', 'students.studentNo')->where('clearstatus.status', '=', 'Pending')->where('students.faculty', '=', 'SBS')->count(); //financial report //facuty $totalDep = DB::table('charge')->sum('department_value'); //cafeteria $totalCaf = DB::table('charge')->sum('cafeteria_value'); // library $totalLib = DB::table('charge')->sum('library_value'); //Extra Cal $totalExc = DB::table('charge')->sum('extra_curricular_value'); //games $totalGam = DB::table('charge')->sum('games_value'); //financial aid $totalFna = DB::table('charge')->sum('financial_aid_value'); //finance $totalFin = DB::table('charge')->sum('finance_value'); $html = PDF::report($appliedStudents, $clearedStudentsFac, $pendingStudentsFac, $clearedStudentsCaf, $pendingStudentsCaf, $clearedStudentsGam, $pendingStudentsGam, $clearedStudentsExa, $pendingStudentsExa, $clearedStudentsFna, $pendingStudentsFna, $clearedStudentsFin, $pendingStudentsFin, $clearedStudentsLib, $pendingStudentsLib, $totalStudentsCleared, $totalStudentsPending, $reqStudentFIT, $clearedStudentsFIT, $pendingStudentsFIT, $reqStudentSOA, $clearedStudentsSOA, $pendingStudentsSOA, $reqStudentSLS, $clearedStudentsSLS, $pendingStudentsSLS, $reqStudentSFAE, $clearedStudentsSFAE, $pendingStudentsSFAE, $reqStudentCHT, $clearedStudentsCHT, $pendingStudentsCHT, $reqStudentSHSS, $clearedStudentsSHSS, $pendingStudentsSHSS, $reqStudentSBS, $clearedStudentsSBS, $pendingStudentsSBS, $totalDep, $totalCaf, $totalLib, $totalExc, $totalGam, $totalFna, $totalFin); $mpdf = new mpdf(); $mpdf->WriteHTML($html); $mpdf->Output(); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show() { $user = Auth::user()->regNo; $std = student::where('studentNo', '=', $user)->first(); $charge = charges::where('students_studentNo', '=', $user)->first(); if ($charge->total == 0) { $html = PDF::make($std); } else { $html = PDF::create($std, $charge); } $mpdf = new mpdf(); $mpdf->WriteHTML($html); $mpdf->Output(); }