-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathriwayat.php
executable file
·100 lines (93 loc) · 3.05 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
<?php
session_start();
include 'admin/koneksi.php';
if (!isset($_SESSION["pelanggan"]) or empty($_SESSION["pelanggan"])) {
echo "<script>
alert('Tidak dapat mengakses, silahkan login');
location='login.php';
</script>";
exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<title>tuKol</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<!-- VENDOR CSS -->
<link rel="stylesheet" href="admin/assets/vendor/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="admin/assets/vendor/font-awesome/css/font-awesome.min.css">
<!-- TABLE STYLES-->
<link href="admin/assets/vendor/dataTables/dataTables.bootstrap.css" rel="stylesheet" />
<link rel="stylesheet" href="admin/assets/vendor/linearicons/style.css">
</head>
<body>
<?php
include 'menu.php';
?>
<section class="konten">
<div class="container">
<div class="panel panel-primary">
<div class="panel-heading">
<h3>Riwayat Belanja <?php echo $_SESSION["pelanggan"]["nama_pelanggan"]; ?></h3>
</div>
<div class="panel-body">
<table class="table table-bordered table-striped" id="dataTable">
<thead>
<tr>
<th>No</th>
<th>Tanggal</th>
<th>Status</th>
<th>Total</th>
<th>Opsi</th>
</tr>
</thead>
<tbody>
<?php
$nomor=1;
$id_pelanggan=$_SESSION["pelanggan"]["id_pelanggan"];
$ambil=$koneksi->query("SELECT*FROM tb_pembelian WHERE id_pelanggan='$id_pelanggan' ");
while ($pecah=$ambil->fetch_assoc()) {
?>
<tr>
<td><?php echo $nomor; ?></td>
<td><?php echo $pecah["tanggal_pembelian"]; ?></td>
<td>
<?php echo $pecah["status_pembelian"]; ?><br>
<?php if (!empty($pecah["resi_pengiriman"])): ?>
Resi : <?php echo $pecah["resi_pengiriman"]; ?>
<?php endif ?>
</td>
<td><?php echo number_format($pecah["total_pembelian"]); ?></td>
<td>
<a href="nota.php?id=<?php echo $pecah["id_pembelian"]; ?>" class="btn btn-info">Nota</a>
<?php if ($pecah["status_pembelian"]=="pending"): ?>
<a href="pembayaran.php?id=<?php echo $pecah["id_pembelian"]; ?>" class="btn btn-warning">Input Pembayaran</a>
<?php else: ?>
<a href="lihat_pembayaran.php?id=<?php echo $pecah["id_pembelian"]; ?>" class="btn btn-success">Lihat Pembayaran</a>
<?php endif ?>
</td>
</tr>
<?php
$nomor++;
}
?>
</tbody>
</table>
</div>
</div>
</div>
</section>
<script src="admin/assets/vendor/jquery/jquery.min.js"></script>
<script src="admin/assets/vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="admin/assets/vendor/dataTables/jquery.dataTables.js"></script>
<script src="admin/assets/vendor/dataTables/dataTables.bootstrap.js"></script>
<script>
$(document).ready(function () {
$('#dataTable').dataTable();
});
</script>
</body>
</html>