-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdaus.php
More file actions
36 lines (35 loc) · 1.31 KB
/
daus.php
File metadata and controls
36 lines (35 loc) · 1.31 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
<?php
require_once __DIR__ . '/vendor/autoload.php';
include "koneksi.php";
$i = 1;
$querys = mysql_query("SELECT * FROM login WHERE level='admin' OR level='user' ORDER BY level ASC");
$mpdf = new \Mpdf\Mpdf();
$html = '<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
<h1>Laporan Data User dari Perpustakaan Universitas Bina Insan</h1><br>
<table border="1" cellspacing="0" cellpadding="10">
<tr>
<th>#</th>
<th>Username</th>
<th>Password</th>
<th>Nama Lengkap</th>
<th>Level</th>
</tr>';
while ($hasil = mysql_fetch_assoc($querys)) {
$html .= '<tr>
<td>' . $i++ . '</td>
<td>' . $hasil["username"] . '</td>
<td>' . $hasil["password"] . '</td>
<td>' . $hasil["nama_lengkap"] . '</td>
<td>' . $hasil["level"] . '</td>
</tr>';
};
$html .= '</table>
</body>
</html>';
$mpdf->WriteHTML($html);
$mpdf->Output('Bukti Peminjaman.pdf', 'I');