-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnota.php
131 lines (115 loc) · 3.03 KB
/
nota.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
120
121
122
123
124
125
126
127
128
129
130
131
<?php
session_start();
include "admin/db/koneksi.php";
?>
<!DOCTYPE html>
<html>
<head>
<title>Nota Pembelian</title>
<link rel="stylesheet" type="text/css" href="admin/assets/css/bootstrap.css">
</head>
<body>
<!-- navbar -->
<?php include "menu.php"; ?>
<!-- navbar -->
<!-- konten -->
<section class="konten">
<div class="container">
<h2>Nota Pembelian</h2>
<?php
$result = $koneksi->query("SELECT * FROM pembelian JOIN pelanggan
ON pembelian.id_pelanggan=pelanggan.id_pelanggan
WHERE pembelian.id_pembelian='$_GET[id];' ");
$data1 = $result->fetch_assoc();
// cek apakah pembeli sama dengan Pelanggan Yg Login
if($data1['id_pelanggan'] !== $_SESSION['pelanggan']['id_pelanggan'])
{
header("Location:riwayat.php");
}
?>
<pre>
<?php print_r($data1); ?>
</pre>
<pre>
<?php print_r($_SESSION); ?>
</pre>
<div class="row">
<div class="col-md-4">
<h3>PEMBELIAN</h3>
<p>
Tanggal: <?= $data1['tanggal_pembelian']; ?><br>
Total : Rp. <?= number_format($data1['total_pembelian']); ?>
</p>
</div>
<div class="col-md-4">
<h3>PELANGGAN</h3>
<strong><?= $data1['nama_pelanggan']; ?></strong>
<p>
<?= $data1['telp_pelanggan']; ?><br>
<?= $data1['email_pelanggan']; ?>
</p>
</div>
<div class="col-md-4">
<h3>PENGIRIMAN</h3>
<strong><?= $data1['nama_kota']; ?></strong>
<p>Ongkos Kirim :<?= $data1['tarif']; ?><br>
<?= $data1['alamat_pengiriman']; ?></p>
</div>
</div>
<table class="table table-bordered">
<thead>
<tr>
<th>No</th>
<th>Nama Produk</th>
<th>Harga</th>
<th>Berat</th>
<th>Jumlah</th>
<th>Subberat</th>
<th>Subtotal</th>
</tr>
</thead>
<?php
$result = $koneksi->query("SELECT * FROM pembelian_produk WHERE id_pembelian='$_GET[id]'");
$no = 1;
?>
<?php foreach ($result as $data2): ?>
<tbody>
<tr>
<td><?= $no++; ?></td>
<td><?= $data2['nama']; ?></td>
<td><p>Rp. <?= number_format($data2['harga'] ); ?></p></td>
<td><p><?= $data2['berat']; ?> Gr.</p></td>
<td><?= $data2['jumlah']; ?></td>
<td><p><?= $data2['subberat']; ?> Gr.</p></td>
<td><p>Rp. <?= number_format($data2['subharga']); ?></p></td>
</tr>
</tbody>
<?php endforeach; ?>
</table>
<div class="row">
<div class="col-md-7">
<div class="alert alert-info">
<p>
Silahkan Lakukan Pembayaran Rp. <?= number_format($data1['total_pembelian']); ?> Ke. <br>
<strong>BANK BNI 083825121 AN. SARIFUDIN ABDJUL</strong>
</p>
</div>
</div>
</div>
</div>
</section>
<!-- konten -->
<!-- SCRIPTS -AT THE BOTOM TO REDUCE THE LOAD TIME-->
<!-- JQUERY SCRIPTS -->
<script src="admin/assets/js/jquery-1.10.2.js"></script>
<!-- BOOTSTRAP SCRIPTS -->
<script src="admin/assets/js/bootstrap.min.js"></script>
<!-- METISMENU SCRIPTS -->
<script src="admin/assets/js/jquery.metisMenu.js"></script>
<!-- MORRIS CHART SCRIPTS -->
<script src="admin/assets/js/morris/raphael-2.1.0.min.js"></script>
<script src="admin/assets/js/morris/morris.js"></script>
<!-- CUSTOM SCRIPTS -->
<script src="admin/assets/js/custom.js"></script>
</body>
</html>