Commit 82a1b96c by Roy Junedi Simamora

edit

parent bc33105d
......@@ -46,9 +46,9 @@ $start = ($page - 1) * $per_hal;
<?php
if (isset($_GET['cari'])) {
$cari = mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $_GET['cari']);
$menu = mysqli_query($GLOBALS["___mysqli_ston"], "select * from menu where nama like 'A*'");
$menu = mysqli_query($GLOBALS["___mysqli_ston"], "select * from menu INNER JOIN kategori ON kategori_id = id_kategori where nama like '$cari' or kategori_id like '$cari'");
} else {
$menu = mysqli_query($GLOBALS["___mysqli_ston"], "select * from menu limit $start, $per_hal");
$menu = mysqli_query($GLOBALS["___mysqli_ston"], "select * from menu INNER JOIN kategori ON kategori_id = id_kategori limit $start, $per_hal");
}
$no = 1;
while ($b = mysqli_fetch_array($menu)) {
......@@ -60,19 +60,13 @@ $start = ($page - 1) * $per_hal;
</td>
<td><?php echo $b['nama'] ?></td>
<td>Rp.<?php echo number_format($b['harga']) ?>,-</td>
<td><?php
if ($b['kategori_id'] == 1) {
echo 'Makanan';
} else if ($b['kategori_id'] == 2) {
echo 'Minuman';
}
?>
<td><?php echo $b['nama_kategori'] ?>
</td>
<td>
<a href="edit.php?id=<?php echo $b['id_menu']; ?>" class="btn btn-info"><span class="glyphicon glyphicon-edit">edit</span></a>
<a href="edit.php?id=<?php echo $b['id_menu']; ?>" class="btn btn-info"><span class="glyphicon glyphicon-edit"></span></a>
<a onclick="if (confirm('Apakah anda yakin ingin menghapus data ini ??')) {
location.href = 'delete.php?id=<?php echo $b['id_menu']; ?>'
}" class="btn btn-danger"><span class="glyphicon glyphicon-remove">hapus</span></a>
}" class="btn btn-danger"><span class="glyphicon glyphicon-remove"></span></a>
</td>
</tr>
<?php
......
<?php
require('common/header.php');
include 'koneksi.php';
echo '<br>';
?>
......@@ -25,8 +26,36 @@
<span class="sr-only">Next</span>
</a>
</div>
<hr>
<div class="col-md-12">
<div align="left">
<h2><font face="gothic" size="7" color="#000090"> Menu Kami <br> <br> <span class="glyphicon glyphicon-chevron-down"></span></font> </h2>
<hr>
</div>
<?php
if(isset($_SESSION['username'])){
$id_member = $_SESSION['id_member'];
}
$query = mysqli_query($koneksi, "SELECT * FROM menu WHERE id_menu < 7");
while($row = mysqli_fetch_array($query)){
?>
<div class="col-md-3">
<a href="detail.php?id=<?php echo $row['id_menu'];?>&id_member=<?php echo $id_member; ?>" class="btn btn-buy">
<img src="picture/<?php echo $row['gambar'] ?>" class="img-rounded" width="250" height="250">
<div class="caption">
<h4 style="color: #3c3c3c;"> <?php echo $row['nama']; ?> </h4>
<h4> <b> Rp. <?php echo number_format($row['harga']) ?>,- </b> </h4>
</div>
</a>
</div>
<?php
}
?>
<div align="right">
<a href="member_menu.php" class="btn btn-buy" style="color: #000080"> <font size="5"> Lihat Selengkapnya &raquo; </font> </a>
</div>
</div>
<br/>
<?php
require ('common/footer.php');
?>
\ 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