-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathShowCart.php
52 lines (44 loc) · 1.51 KB
/
ShowCart.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
<?php
if($Jml){
if($GV=='shopping_cart'){
echo "
<form action='InsertProduct.php?act=update' method='POST'>
<table align='center' width='610' id='order-table'>
<tr bgcolor='#92a751'><th>No</th><th>Buku</th><th>Harga</th><th>Jumlah</th><th>Subtotal</th><th>Aksi</th></tr>";
$Tot=0;
$No=1;
while($r=mysql_fetch_array($QShowCart)){
$ID=$r['ID'];
$Jml=$r['JumlahBeli'];
$ISBN==$r['ISBN'];
$Harga=$r['harga'];
$Judul=$r['judul'];
$SubTotal=$Harga*$Jml;
$Tot=$Tot+$SubTotal;
if($No % 2==0){
echo "<tr bgcolor='#d8dfea'>";
}
else {
echo "<tr bgcolor='#edeff4'>";
}
echo "
<td>
<input type='hidden' name='ID[$No]' value='$ID' />
$No</td><td>$Judul</td><td align='right'>Rp ".number_format($Harga,2,",",".")."</td>
<td><input type='text' name='jml[$No]' value='$Jml' size='2'></td><td align='right'>Rp ".number_format($SubTotal,2,",",".")."</td>
<td><a href=\"InsertProduct.php?act=hapus&ID=$ID\"
OnClick=\"return confirm('Hapus $Judul?');\" title='Hapus'>Hapus</a></td></tr>";
$No++;
}
echo "<tr bgcolor='#92a751'><th colspan='4' align='right'>Total</th><th colspan='2' align='right'>Rp ".number_format($Tot,2,",",".")."</th></tr>";
echo "<tr><td colspan='3' align='right'><input type='submit' value='Beli Lagi' name='home' /></td><td colspan='3' align='right'><input type='submit' value='Selesai' name='selesai' /></td></tr>";
echo "</table>";
echo "</form>";
}
}
else
{
echo '<meta http-equiv="refresh" content="0;url=index.php">';
exit;
}
?>