-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathriwayat.php
116 lines (101 loc) · 3.1 KB
/
riwayat.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
<?php
//error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));
session_start();
include 'date.php';
include 'koneksi.php';
if (!isset($_SESSION["pelanggan"]) or empty($_SESSION["pelanggan"]))
{
echo "<script>alert('Silakan login terlebih dahulu.')</script>";
echo "<script>location='login.php';</script>";
}
?>
<!DOCTYPE html>
<html>
<head>
<title>MarketPlace</title>
<link rel="stylesheet" type="text/css" href="admin/assets/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="popup1.css">
</head>
<body>
<!-- navbar -->
<?php include 'navbar.php'; ?>
<section class="riwayat">
<div class="container">
<h3>Transaksi <?php echo $_SESSION["pelanggan"]["nama_pelanggan"] ?></h3>
<table class="table table-bordered">
<thead>
<tr>
<th style="text-align: center;">No</th>
<th>Tanggal Pembelian</th>
<th>Status</th>
<th>Total Pembelian</th>
<th style="text-align: center;">Opsi</th>
</tr>
</thead>
<tbody>
<?php
$nomor = 1;
$id_pelanggan = $_SESSION["pelanggan"]["id_pelanggan"];
$ambil = $koneksi->query("SELECT * FROM pembelian WHERE id_pelanggan='$id_pelanggan'");
while ($pecah = $ambil->fetch_assoc())
{
?>
<tr>
<td style="text-align: center;"><?php echo $nomor; ?></td>
<td><?php $source = $pecah["tanggal_pembelian"];
$date = new DateTime($source);
echo $date->format('d - m - Y'); ?>
</td>
<td><?php echo $pecah["status_pembelian"]; ?>
<br>
<?php if (!empty($pecah["resi_pengiriman"])): ?>
No. Resi : <?php echo $pecah["resi_pengiriman"]; ?>
<?php
endif ?>
<br>
<?php $source = $pecah["tgl_pengiriman"];
$date = new DateTime($source);
if (!empty($pecah["tgl_pengiriman"])): ?>
Tgl. Pengiriman : <?php echo $date->format('d - m - Y');
endif
?>
</td>
<td>Rp<?php echo number_format($pecah["total_pembelian"]); ?></td>
<td>
<a href="nota.php?id=<?php echo $pecah["id_pembelian"]; ?>" class="btn btn-info">Invoice</a>
<!-- <?php //if ($pecah['status_pembelian']=="Menunggu Pembayaran"):
?>
<a href="pembayaran.php?id=<?php //echo $pecah["id_pembelian"];
?>" class="btn btn-danger">Konfirmasi Pembayaran</a>
<?php //else:
?>
<a href="lihat_pembayaran.php?id=<?php //echo $pecah["id_pembelian"];
?>" class="btn btn-warning">Lihat Pembayaran</a>
<?php //endif
?> -->
<?php if ($pecah['status_pembelian'] == "Menunggu Pembayaran")
{ ?>
<a href="pembayaran.php?id=<?php echo $pecah["id_pembelian"]; ?>" class="btn btn-danger">Konfirmasi Pembayaran</a>
<?php
}
elseif ($pecah['status_pembelian'] == "Dibayar" or $pecah['status_pembelian'] == "Transaksi Selesai")
{ ?>
<a href="lihat_pembayaran.php?id=<?php echo $pecah["id_pembelian"]; ?>" class="btn btn-warning">Lihat Pembayaran</a>
<?php
}
else
{ ?>
<a href="terima_pesanan.php?id=<?php echo $pecah["id_pembelian"]; ?>" class="btn btn-success">Terima Pesanan</a>
<?php
} ?>
</td>
</tr>
<?php $nomor++; ?>
<?php
} ?>
</tbody>
</table>
</div>
</section>
</body>
</html>