-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcetak.php
More file actions
115 lines (98 loc) · 3.1 KB
/
cetak.php
File metadata and controls
115 lines (98 loc) · 3.1 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
<?php
session_start();
ob_start();
include 'koneksi.php';
if (!isset($_SESSION["pelanggan"]))
?>
<!DOCTYPE html>
<html>
<head>
<title>Nota Pembelian</title>
<link rel="stylesheet" type="text/css" href="admin/assets/css/bootstrap.css">
</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><br>
<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>
</section>
</body>
</html>
<?php
$isi = ob_get_clean();
require_once "./admin/assets/mpdf_v8.0.3-master/vendor/autoload.php";
$mpdf = new \Mpdf\Mpdf();
$mpdf->AddPage("L","","","","","5","5","5","5","","","","","","","","","","","","A4");
$mpdf->WriteHTML($isi);
$mpdf->Output();
?>