-
Notifications
You must be signed in to change notification settings - Fork 0
/
nota.php
124 lines (107 loc) · 2.98 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
<?php
//error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));
session_start();
include 'date.php';
include 'koneksi.php';
?>
<!DOCTYPE html>
<html>
<head>
<title>Nota Pembelian</title>
<link rel="stylesheet" type="text/css" href="admin/assets/css/bootstrap.css">
<style>
@media print
{
.noprint {display:none;}
}
</style>
</head>
<body>
<!-- navbar -->
<?php include 'navbar.php'; ?>
<section class="konten">
<div class="container">
<ul class="text-right">
<div class="noprint">
<a href="">
<button onClick="window.print();" class="btn btn-info btn-sm">
Cetak <span class="glyphicon glyphicon-print"></span>
</button>
</a>
</div>
</ul>
<h1 style="color: red;">MarketPlace</h1>
<h3>Invoice</h3>
<?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
$idbeli = $detail["id_pelanggan"];
$idlogin = $_SESSION["pelanggan"]["id_pelanggan"];
if ($idbeli!==$idlogin)
{
echo "<script>location='riwayat.php'</script>";
exit();
}
?>
<h3><strong>Dear <?php echo $detail['nama_pelanggan']; ?></strong></h3>
Terima kasih, Anda telah melakukan pemesanan sebagai berikut :
<p></p>
<table class="table table-bordered">
<thead>
<tr>
<th style="text-align: center;" width="50">No</th>
<th>Nama Barang</th>
<th>Harga</th>
<th style="text-align: center;" width="10">Jumlah</th>
<th>Subtotal</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 style="text-align: center;"><?php echo $nomor; ?></td>
<td><?php echo $pecah['nama']; ?></td>
<td>Rp<?php echo number_format($pecah['harga']); ?></td>
<td style="text-align: center;"><?php echo $pecah['jumlah']; ?></td>
<td>Rp<?php echo number_format($pecah['subharga']); ?></td>
</tr>
<?php $nomor++; ?>
<?php } ?>
</tbody>
<tfoot>
<tr>
<th colspan="4" style="text-align: left;">Ongkos Kirim</th>
<th>Rp<?php echo number_format($detail['tarif']); ?></th>
</tr>
<tr>
<th colspan="4" style="text-align: left;">Total Pembayaran</th>
<th>Rp<?php echo number_format($detail['total_pembelian']); ?></th>
</tr>
</tfoot>
</table>
<strong>Alamat Tujuan :</strong>
<p>
<strong><?php echo $detail['nama_pelanggan']; ?></strong> <br>
<?php echo $detail['alamat_pengiriman']; ?> <br>
HP : <?php echo $detail['hp_pelanggan']; ?>
</p>
<div class="noprint">
<div class="row">
<div class="col-md-4">
<div class="alert alert-info">
<p>
Silakan melakukan pembayaran Rp<?php echo number_format($detail['total_pembelian']); ?> ke <br>
<strong>BANK BCA 123-456-78910 AN. MarketPlace</strong>
</p>
</div>
</div>
</div>
</div>
</div>
</section>
</body>
</html>