-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaporan-print.php
66 lines (57 loc) · 2.2 KB
/
laporan-print.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
64
65
66
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cetak Laporan</title>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.2/css/bulma.min.css' integrity='sha512-byErQdWdTqREz6DLAA9pCnLbdoGGhXfU6gm1c8bkf7F51JVmUBlayGe2A31VpXWQP+eiJ3ilTAZHCR3vmMyybA==' crossorigin='anonymous' />
<style type="text/css" media="print">
@page {
size: landscape;
}
</style>
</head>
<body>
<?php
require_once __DIR__ . "/config/config.php";
?>
<div class="table-container">
<table class="table is-hoverable is-striped is-fullwidth">
<thead>
<tr>
<th>#</th>
<th>Nama Pelanggan</th>
<th>Telepon/Hp</th>
<th>Nama Barang</th>
<th>Harga</th>
<th>Berat</th>
<th>Total</th>
<th>Tanggal Laporan</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM transaksi JOIN barang ON barang.id_barang = transaksi.barang_id JOIN pelanggan ON pelanggan.id_pelanggan = transaksi.pelanggan_id ORDER BY id_transaksi DESC";
$query = $conn->query($sql);
while ($item = $query->fetch_object()) {
?>
<tr>
<td><?= $item->id_transaksi; ?></td>
<td><?= $item->nama_pelanggan; ?></td>
<td><?= $item->telepon_pelanggan; ?></td>
<td><?= $item->nama_barang; ?></td>
<td><?= money($item->harga_transaksi); ?></td>
<td><?= kilo($item->jumlah_transaksi); ?></td>
<td><?= money($item->total_transaksi); ?></td>
<td><?= dateTime($item->tanggal_transaksi); ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<script>
window.print();
</script>
</body>
</html>