pemesanan

parent 10a97dda
......@@ -44,7 +44,9 @@
foreach ($_SESSION['items'] as $key => $val) {
$query = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE isbn = '$key'");
$data = mysqli_fetch_array($query);
if (isset($_SESSION['pengunjung'])) {
$id_user = $_SESSION['id_user'];
}else{}
$jumlah_harga = $data['harga'] * $val;
$total += $jumlah_harga;
$no = 1;
......@@ -78,21 +80,19 @@
}
?>
<?php
if($total != 0 && isset($_SESSION['pengunjung'])){
echo '
<tr style="background-color:#dbase_delete_record(dbase_identifier, record_number);"><td colspan="5" align="right"><b>Total :</b></td><td align="right"><b>Rp. '.number_format($total,2,",",".").'</b></tr></table>
if($total != 0 && isset($_SESSION['pengunjung'])){?>
<tr style="background-color:#dbase_delete_record(dbase_identifier, record_number);"><td colspan="5" align="right"><b>Total :</b></td><td align="right"><b>Rp. <?php echo number_format($total,2,",",".")?></b></tr></table>
<p><div align="right">
<div class="checkout-right-basket">
<a href="allbook.php"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>Lanjut Berbelanja</a>
<a href="savebook.php">Lakukan pembayaran &nbsp&nbsp;<span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span></a>
<a href="savebook.php?isbn=<?php echo $data['isbn']?>&id_user=<?php echo $id_user;?>&total=<?php echo $jumlah_harga;?>">Lakukan pembayaran &nbsp&nbsp;<span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span></a>
<br><br><br><br><br><br>
</div>
</div></p>
';
}
elseif($total != 0) {
echo '
<tr style="background-color:#dbase_delete_record(dbase_identifier, record_number);"><td colspan="5" align="right"><b>Total :</b></td><td align="right"><b>Rp. '.number_format($total,2,",",".").'</b></td></td></td></tr></table>
;
<?php }
elseif($total != 0) { ?>
<tr style="background-color:#dbase_delete_record(dbase_identifier, record_number);"><td colspan="5" align="right"><b>Total :</b></td><td align="right"><b>Rp. <?php echo number_format($total,2,",",".")?></b></td></td></td></tr></table>
<p><div align="right">
<div class="checkout-right-basket">
<a href="allbook.php"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>Lanjut Berbelanja</a>
......@@ -100,18 +100,17 @@
<br><br><br><br><br>
</div>
</div></p>
';
}
else {
echo '
;
<?php }
else { ?>
<tr><td colspan="7" align="center" style="background-color:#ffffff">
Ups, Keranjang belanja kosong ! </td></tr></table>
<div class="checkout-right-basket">
<a href="allbook.php"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>Lanjut Berbelanja</a>
<br><br><br><br><br>
</div>
';
}
;
<?php } ?>
?>
</table>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment