Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include '../public/MPDF57/mpdf.php';
- include_once '../apps/model/class.survey.php';
- session_start();
- $survey = new Survey();
- if (!isset($_SESSION['username'])) {
- $survey->redirect('login.php');
- }
- $query = $survey->execute("SELECT tpoint.id_point, student.npm, student.fullname, tpoint.total
- FROM tbl_student AS student LEFT JOIN tbl_point AS tpoint ON student.npm = tpoint.npm
- WHERE student.npm");
- $now = date("F j, Y, g:i a");
- $html .= "<html>
- <head>
- </head>
- <body>
- <h3>Laporan Nilai Mahasiswa</h3>
- <h5>Dicetak pada : $now</h5>
- <table class='bpmTopicC'>
- <thead>
- <tr class='headerrow'>
- <th>No</th>
- <th>NPM</th>
- <th>Nama</th>
- <th>Skor</th>
- </tr>
- </thead>";
- $no = 0;
- while ($row = $query->fetch_object()) {
- $no++;
- $html .= "<tbody>
- <tr>
- <td class='layout'>$no</td>
- <td class='layout'>$row->npm</td>
- <td class='layout'>$row->fullname</td>
- <td class='layout'>$row->total</td>
- </tr>
- </tbody>
- </table>";
- }
- $html .= "</body></html>";
- $fileName = 'reportHistoryRubric--' . date('d-m-Y') . '-' . date('h.i.s');
- $mpdf=new mPDF('utf-8', 'A4','','',32,25,27,25,16,13);
- $mpdf->SetDisplayMode('fullpage');
- // LOAD a stylesheet
- $stylesheet = file_get_contents('../public/MPDF57/examples/mpdfstyletables.css');
- $mpdf->WriteHTML($stylesheet,1);
- $mpdf->WriteHTML($html, 2);
- $mpdf->Output($fileName. '.pdf','D');
- exit;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement