-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexport-pdf.php
63 lines (50 loc) · 1.92 KB
/
export-pdf.php
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
// memanggil file koneksi
include 'conn.php';
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Sistem Informasi Swalayan</title>
<!-- link cdn css bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
</head>
<body>
<h2 class="text-center">Tabel Stok Barang</h2>
<hr><br>
<!-- data tabel -->
<table class="table">
<thead>
<tr class="table-warning">
<th scope="col">No</th>
<th scope="col">Kode Barang</th>
<th scope="col">Nama Barang</th>
<th scope="col">Harga Barang</th>
<th scope="col">Foto Barang</th>
</tr>
</thead>
<tbody>
<!-- kode menampilkan data dengan php -->
<?php
$data = $conn->query("SELECT * FROM tb_barang");
$no = 1;
while ($dataBarang = $data->fetch_assoc()) { ?>
<tr>
<td><?php echo $no++ ?></td>
<td><?php echo $dataBarang['barang_kode'] ?></td>
<td><?php echo $dataBarang['barang_nama'] ?></td>
<td><?php echo $dataBarang['barang_harga'] ?></td>
<td><img src="uploadFoto/<?php echo $dataBarang['barang_foto'] ?>" alt="" width="100px"></td>
</tr>
<?php } ?>
</tbody>
</table>
<!-- link cdn javascript bootstrap -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
</body>
</html>
<script>
window.print();
</script>