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
<?php
include 'koneksi.php';
include 'common/header.php';
?>
<h2> <span class="glyphicon glyphicon-shopping-cart"></span>Cart </h2>
<br/> <hr/>
<div class="col-md-12" align="center">
<table class="table table-hover table-condensed">
<tr>
<th> No </th>
<th> Nama </th>
<th> Harga </th>
<th> Jumlah </th>
<th> Subtotal </th>
<th> Opsi</th>
</tr>
<?php
$id_member = $_GET['id_member'];
$query = mysqli_query($koneksi, "SELECT menu.nama AS nama_menu, menu.harga, pemesanan.jumlah FROM menu
INNER JOIN (pemesanan INNER JOIN member ON member_id = id_member) ON menu_id= id_menu WHERE member_id= '$id_member'");
$no = 1;
while($row = mysqli_fetch_assoc($query)){
$subtotal = $row['jumlah'] * $row['harga'];
?>
<tr>
<td> <?= $no?> </td>
<td> <?php echo $row['nama_menu'] ?> </td>
<td> <?= $row['harga']?> </td>
<td> <?= $row['jumlah']?> </td>
<td> <?= $subtotal?> </td>
<td> <a href="batal.php?id_member=<?= $id_member ?>" class="btn btn-danger"> <span class="glyphicon glyphicon-remove"></span> Batalkan </a> </td>
</tr>
<?php
global $total;
$total += $subtotal;
$no++;
}
?>
</table>
<div align="right">
<font face="arial" size="5"> Total : <?= $total?></font>
</div>
<div align="center">
<a href="member_menu.php" class="btn btn-info"><span class="glyphicon glyphicon-chevron-left"></span> Pesan Lagi</a>
<a href="bayar.php?id_member=<?= $id_member ?>" class="btn btn-success"> Checkout<span class="glyphicon glyphicon-chevron-right"></span> </a>
</div>
<br>
</div>
<?php
include 'common/footer.php';
?>