-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdajam.php
More file actions
38 lines (37 loc) · 1.4 KB
/
dajam.php
File metadata and controls
38 lines (37 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
require_once __DIR__ . '/vendor/autoload.php';
include "koneksi.php";
$i = 1;
$querys = mysql_query("SELECT * FROM pinjam");
$mpdf = new \Mpdf\Mpdf();
$html = '<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
<h1>Laporan Data Peminjaman Buku dari Perpustakaan Universitas Bina Insan</h1><br>
<table border="1" cellspacing="0" cellpadding="10">
<tr>
<th>#</th>
<th>Judul Buku</th>
<th>Nama Peminjam</th>
<th>Nama Petugas</th>
<th>Tanggal Pinjam</th>
<th>Durasi</th>
</tr>';
while ($hasil = mysql_fetch_assoc($querys)) {
$html .= '<tr>
<td>' . $i++ . '</td>
<td>' . $hasil["judul_buku"] . '</td>
<td>' . $hasil["nama_peminjam"] . '</td>
<td>' . $hasil["nama_petugas"] . '</td>
<td>' . $hasil["tgl_pinjam"] . '</td>
<td>' . $hasil["durasi"] . ' Hari</td>
</tr>';
};
$html .= '</table>
</body>
</html>';
$mpdf->WriteHTML($html);
$mpdf->Output('Bukti Peminjaman.pdf', 'I');