pemesanan

parent 10a97dda
...@@ -44,7 +44,9 @@ ...@@ -44,7 +44,9 @@
foreach ($_SESSION['items'] as $key => $val) { foreach ($_SESSION['items'] as $key => $val) {
$query = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE isbn = '$key'"); $query = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE isbn = '$key'");
$data = mysqli_fetch_array($query); $data = mysqli_fetch_array($query);
if (isset($_SESSION['pengunjung'])) {
$id_user = $_SESSION['id_user'];
}else{}
$jumlah_harga = $data['harga'] * $val; $jumlah_harga = $data['harga'] * $val;
$total += $jumlah_harga; $total += $jumlah_harga;
$no = 1; $no = 1;
...@@ -78,21 +80,19 @@ ...@@ -78,21 +80,19 @@
} }
?> ?>
<?php <?php
if($total != 0 && isset($_SESSION['pengunjung'])){ 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. <?php echo number_format($total,2,",",".")?></b></tr></table>
<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>
<p><div align="right"> <p><div align="right">
<div class="checkout-right-basket"> <div class="checkout-right-basket">
<a href="allbook.php"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>Lanjut Berbelanja</a> <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> <br><br><br><br><br><br>
</div> </div>
</div></p> </div></p>
'; ;
} <?php }
elseif($total != 0) { 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. <?php echo number_format($total,2,",",".")?></b></td></td></td></tr></table>
<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>
<p><div align="right"> <p><div align="right">
<div class="checkout-right-basket"> <div class="checkout-right-basket">
<a href="allbook.php"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>Lanjut Berbelanja</a> <a href="allbook.php"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>Lanjut Berbelanja</a>
...@@ -100,18 +100,17 @@ ...@@ -100,18 +100,17 @@
<br><br><br><br><br> <br><br><br><br><br>
</div> </div>
</div></p> </div></p>
'; ;
} <?php }
else { else { ?>
echo '
<tr><td colspan="7" align="center" style="background-color:#ffffff"> <tr><td colspan="7" align="center" style="background-color:#ffffff">
Ups, Keranjang belanja kosong ! </td></tr></table> Ups, Keranjang belanja kosong ! </td></tr></table>
<div class="checkout-right-basket"> <div class="checkout-right-basket">
<a href="allbook.php"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>Lanjut Berbelanja</a> <a href="allbook.php"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>Lanjut Berbelanja</a>
<br><br><br><br><br> <br><br><br><br><br>
</div> </div>
'; ;
} <?php } ?>
?> ?>
</table> </table>
</div> </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