member_menu.php 1.46 KB
Newer Older
1 2 3 4
<?php
require 'koneksi.php';
include 'common/header.php';
?>
5
<h1><span class="glyphicon glyphicon-shopping-cart"></span>  Daftar Menu </h1>
6 7 8 9 10
<br/>
<hr/>

<?php
$per_hal = 8;
11
$query = "SELECT * from menu";
12
$jumlah_record = mysqli_query($koneksi, $query);
13
$jum = mysqli_num_rows($jumlah_record);
14 15 16 17 18 19
$halaman = ceil($jum / $per_hal);
$page = (isset($_GET['page'])) ? (int) $_GET['page'] : 1;
$start = ($page - 1) * $per_hal;
?>
<br/>
<?php
20 21 22
if(isset($_SESSION['username'])){
	$id_member = $_SESSION['id_member'];
}
23 24
$menu = mysqli_query($GLOBALS["___mysqli_ston"], "select * from menu limit $start, $per_hal");
while ($b = mysqli_fetch_array($menu)) {
25 26 27
    ?>

    <div class="col-md-3">
28
        <a href="detail.php?id=<?php echo $b['id_menu'];?>&id_member=<?php echo $id_member; ?>" class="btn btn-lg btn-buy">
29
        <img src="picture/<?php echo $b['gambar'] ?>" class="img-rounded" width="250" height="250">
30
            <div class="caption">
31 32 33 34
                <h4 style="color: #3c3c3c;"> <?php echo $b['nama']; ?> </h4>
                <h4> <b> Rp. <?php echo number_format($b['harga']) ?>,- </b> </h4>
               
                <br/>
35
            </div>
36
         </a>
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
    </div>
    <?php
}
?>
<div class="col-md-12">
    <ul class="pagination">			
        <?php
        for ($x = 1; $x <= $halaman; $x++) {
            ?>
            <li><a href="?page=<?php echo $x ?>"><?php echo $x ?></a></li>
            <?php
        }
        ?>						
    </ul>
</div>
<?php
include 'common/footer.php';
?>