-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnota.php
More file actions
126 lines (107 loc) · 3.57 KB
/
nota.php
File metadata and controls
126 lines (107 loc) · 3.57 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
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
<?php
session_start();
include 'koneksi.php';
?>
<?php include 'menu.php'; ?><br><br><br>
<!DOCTYPE html>
<html>
<head>
<title>Nota Pembelian</title>
<link rel="stylesheet" type="text/css" href="admin/assets/css/bootstrap.css">
<script src="fontawesome/js/all.min.js"></script>
</head>
<body>
<section class="konten">
<div class="container">
<!--nota disini copy dari folder admin-->
<h2>Detail Pembelian</h2>
<?php
$ambil =$koneksi->query("SELECT*FROM pembelian JOIN pelanggan
ON pembelian.id_pelanggan=pelanggan.id_pelanggan
WHERE pembelian.id_pembelian='$_GET[id]'");
$detail =$ambil->fetch_assoc();
?>
<?php
$idpelangganyangbeli=$detail["id_pelanggan"];
$idpelangganyanglogin=$_SESSION["pelanggan"]["id_pelanggan"];
if ($idpelangganyangbeli!==$idpelangganyanglogin)
{
echo "<script> alert('Goblok Ojo Ngono');</script>";
echo "<script> location ='riwayat.php';</script>";
}
?>
<div class="row">
<div class="col-md-4">
<h3>Pembelian</h3>
<strong>NO. PEMBELIAN: <?php echo $detail['id_pembelian']; ?></strong><br>
<?php if (!empty($detail['resipengiriman'])): ?> No Resi :
<?php echo $detail['resipengiriman']; ?>
<br><?php endif ?>
Tanggal : <?php echo date("d F Y", strtotime($detail['tanggal_pembelian']))?><br>
Total Bayar : Rp. <?php echo number_format($detail['total_pembelian']); ?>
</div>
<div class="col-md-4">
<h3>Pelanggan</h3>
<strong> NAMA : <?php echo $detail['nama_pelanggan']; ?> </strong><br>
Telepon : <?php echo $detail['telepon_pelanggan']; ?><br>
Email : <?php echo $detail['email_pelanggan']; ?>
</div>
<div class="col-md-4">
<h3>Pengiriman</h3>
<strong>ALAMAT : <?php echo $detail['tipe']; ?> <?php echo $detail['distrik']; ?> <?php echo $detail['provinsi']; ?></strong><br>
Ekspedisi : <?php echo $detail['ekspedisi']; ?> <?php echo $detail['paket']; ?> <?php echo $detail['estimasi']; ?><br>
Ongkos Kirim : Rp. <?php echo number_format($detail['ongkir']); ?><br>
Alamat Pengiriman: <?php echo $detail['alamatpengiriman']; ?>
</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>Ongkir</th>
<th>Total Harga</th>
<th>Subberat</th>
</tr>
</thead>
<tbody>
<?php $nomor=1;?>
<?php $ambil= $koneksi->query("SELECT * FROM pembelian_produk WHERE id_pembelian='$_GET[id]'");?>
<?php WHILE ($pecah =$ambil->fetch_assoc()){?>
<tr>
<td><?php echo $nomor;?></td>
<td><?php echo $pecah['nama'];?></td>
<td>Rp. <?php echo number_format($pecah['harga']);?></td>
<td><?php echo $pecah['berat'];?> Gram</td>
<td><?php echo $pecah['jumlah'];?></td>
<td>Rp. <?php echo number_format($detail['ongkir']);?></td>
<td>Rp. <?php echo number_format($pecah['subharga']);?></td>
<td><?php echo $pecah['subberat']?> Gram</td>
</tr>
<?php $nomor++;?>
<?php } ?>
</tbody>
</table>
<?php if ($detail['status_pembelian']=="belum bayar"): ?>
<div class="row">
<div class="col-md-7">
<div class="alert alert-info">
<p>
Silahkan Melakukan Pembayaran Rp. <?php echo number_format($detail['total_pembelian']); ?> Ke <br>
<strong>BANK MANDIRI 765-86544-7658 AN. Buyung Azhar M.F.</strong>
</p>
</div>
<center><img src="img/qrs.jpg" width="300" height="300"/></center>
<a href="pembayaran.php?id=<?php echo $detail["id_pembelian"] ?>" class= "btn btn-danger">Pembayaran</a><br>
</div>
</div>
<?php else: ?>
<a href="cetak.php?id=<?php echo $detail['id_pembelian'] ?>"><button class="btn btn-success "><i class="fa fa-print"></i>Cetak</button></a>
<?php endif ?>
</div>
</section>
</body>
</html>