-
Notifications
You must be signed in to change notification settings - Fork 0
/
detail.php
119 lines (105 loc) · 3.9 KB
/
detail.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!DOCTYPE html>
<html lang="en">
<head>
<title>Detail Pembelian</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Use the correct Bootstrap CSS link -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<!-- Use the correct Bootstrap and jQuery scripts -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<style>
body {
background-color: #3498db;
}
.card {
background-color: #ffffff;
border-radius: 10px;
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
margin-top: 50px;
margin-bottom: 50px;
}
h2 {
color: #007bff;
text-align: center;
/* Center the text */
}
.barcode {
text-align: center;
margin-top: 20px;
margin-bottom: 20px;
}
</style>
<script>
function printPage() {
window.print();
}
</script>
</head>
<body>
<div class="container">
<div class="card">
<div class="card-body">
<h2 class="card-title">Detail Pembelian</h2>
<br>
<?php
include 'koneksi.php';
session_start();
// Mendapatkan ID dari URL
$id_pembeli = $_GET['id'];
// Query untuk mendapatkan data pembeli berdasarkan ID
$query = "SELECT * FROM rahid WHERE id_pembeli = '$id_pembeli'";
$result = mysqli_query($koneksi, $query);
$data = mysqli_fetch_assoc($result);
?>
<table class="table table-bordered">
<tbody>
<tr>
<th>Nama</th>
<td><?php echo $data['nama']; ?></td>
</tr>
<tr>
<th>Alamat</th>
<td><?php echo $data['alamat']; ?></td>
</tr>
<tr>
<th>Nomer Handphone</th>
<td><?php echo $data['hp']; ?></td>
</tr>
<tr>
<th>Tanggal Transaksi</th>
<td><?php echo $data['tgl_transaksi']; ?></td>
</tr>
<tr>
<th>Jenis Barang</th>
<td><?php echo $data['jenis_barang']; ?></td>
</tr>
<tr>
<th>Nama Barang</th>
<td><?php echo $data['nama_barang']; ?></td>
</tr>
<tr>
<th>Jumlah</th>
<td><?php echo $data['jumlah']; ?></td>
</tr>
<tr>
<th>Harga</th>
<td><?php echo "Rp " . number_format($data['harga'], 0, ',', '.'); ?></td>
</tr>
<tr>
<th>Total Harga</th>
<td><?php echo "Rp " . number_format($data['jumlah'] * $data['harga'], 0, ',', '.'); ?></td>
</tr>
</tbody>
</table>
<div class="text-center">
<a href="index.php" class="btn btn-primary">Kembali</a>
<button class="btn btn-primary" onclick="printPage()">Print</button>
</div>
</div>
</div>
</div>
</body>
</html>