-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathitem.php
26 lines (21 loc) · 866 Bytes
/
item.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
<?php
$sid = session_id();
$sql = mysql_query("SELECT SUM(jumlah*(harga-(diskon/100)*harga)) as total,SUM(jumlah) as totaljumlah FROM orders_temp, produk
WHERE id_session='$sid' AND orders_temp.id_produk=produk.id_produk");
//$disc = ($r[diskon]/100)*$r[harga];
//$subtotal = ($r[harga]-$disc) * $r[jumlah];
while($r=mysql_fetch_array($sql)){
if ($r['totaljumlah'] != ""){
$total_rp = format_rupiah($r['total']);
echo "($r[totaljumlah]) item produk <br />
<span class='border_cart'></span>
Total: <span class='price'>Rp. $total_rp</span><br />
<i><a href='proses-order.html'>Keranjang</a></i> <br />";
}
else{
echo "<i>0 item produk</i><br />
<span class='border_cart'></span>
Total: <span class='price'>Rp. 0</span>";
}
}
?>