Commit c88a9bc1 by Roy Junedi Simamora

Penambahan Pemesanan

parent f2f0bf5a
<?php
include 'koneksi.php';
include 'common/header.php';
?>
<h3> <span class="glyphicon glyphicon-credit-card"></span> Menu Pembayaran </h3>
<br/> <hr/>
<?php
global $total;
$member_id = $_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'");
while($row = mysqli_fetch_assoc($query)){
$jumlah = $row['jumlah'] * $row['harga'];
$total = $total += $jumlah;
}
?>
<div class="col-md-12" align="center">
<h3> Terimakasih telah memesan </h3>
<div> Pesanan anda sebesar Rp. <?= $total?>,- <br>
Silahkan Kirim uang dengan nominal tertera ke No. Rekening 0413- XXX. <br>
</div>
<br> <br>
<div>
Setelah mengirim uang upload bukti pengiriman :<br>
<form action="selesai.php?id_member=<?= $member_id?>" method="post" enctype="multipart/form-data">
<input type="file" name="bukti">
<input type="submit" class="btn btn-info" value="Upload">
</form>
<br>
<?php
$kueri = mysqli_query($koneksi, "SELECT * FROM pembayaran WHERE member_id = '$member_id'");
$bukti = mysqli_fetch_array($kueri);
if($bukti['bukti'] != NULL){
?>
<img src="picture/<?php $bukti['bukti']?>" class="img img-rounded" width="250" height="250">
<?php
} else{
echo 'Gambar Bukti Belum di Upload!';
}
?>
<br>
</div>
<br>
</div>
<?php include 'common/footer.php'; ?>
\ No newline at end of file
<?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';
?>
\ No newline at end of file
...@@ -40,8 +40,6 @@ require 'koneksi.php'; ...@@ -40,8 +40,6 @@ require 'koneksi.php';
</td> </td>
</tr> </tr>
</table> </table>
<a class="btn btn-primary" href="member_menu.php"><span class="glyphicon glyphicon-chevron-left"></span>Pesan Lagi</a>
<a class="btn btn-warning" href="bayar.php?id=<?php echo $id ?>">Checkout<span class="glyphicon glyphicon-chevron-right"></span></a>
</div> </div>
<?php <?php
} }
......
<?php <?php
require 'koneksi.php'; require 'koneksi.php';
include 'common/header.php'; include 'common/header.php';
?>
<h1><span class="glyphicon glyphicon-shopping-cart"></span> Daftar Menu </h1>
<br/>
<hr/>
<?php
$per_hal = 8; $per_hal = 8;
$query = "SELECT * from menu"; $query = "SELECT * from menu";
$jumlah_record = mysqli_query($koneksi, $query); $jumlah_record = mysqli_query($koneksi, $query);
...@@ -14,13 +9,17 @@ $jum = mysqli_num_rows($jumlah_record); ...@@ -14,13 +9,17 @@ $jum = mysqli_num_rows($jumlah_record);
$halaman = ceil($jum / $per_hal); $halaman = ceil($jum / $per_hal);
$page = (isset($_GET['page'])) ? (int) $_GET['page'] : 1; $page = (isset($_GET['page'])) ? (int) $_GET['page'] : 1;
$start = ($page - 1) * $per_hal; $start = ($page - 1) * $per_hal;
?>
<br/>
<?php
if(isset($_SESSION['username'])){ if(isset($_SESSION['username'])){
$id_member = $_SESSION['id_member']; $id_member = $_SESSION['id_member'];
} }
$menu = mysqli_query($GLOBALS["___mysqli_ston"], "select * from menu limit $start, $per_hal"); $menu = mysqli_query($GLOBALS["___mysqli_ston"], "select * from menu limit $start, $per_hal");
?>
<h1><span class="glyphicon glyphicon-shopping-cart"></span> Daftar Menu </h1>
<br/>
<hr/>
<br/>
<?php
while ($b = mysqli_fetch_array($menu)) { while ($b = mysqli_fetch_array($menu)) {
?> ?>
......
...@@ -10,5 +10,5 @@ ...@@ -10,5 +10,5 @@
$jumlah = $_POST['jumlah']; $jumlah = $_POST['jumlah'];
mysqli_query($koneksi, "INSERT INTO pemesanan VALUES('', '$member_id', '$menu_id', '$tanggal', $jumlah)"); mysqli_query($koneksi, "INSERT INTO pemesanan VALUES('', '$member_id', '$menu_id', '$tanggal', $jumlah)");
header('Location: detail.php?id='. $id .'&id_member='. $member_id); header('Location: cart.php?id_member='. $member_id);
?> ?>
\ No newline at end of file
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