<?php require_once("koneksi.php");
if (!isset($_SESSION)) {
  session_start();
} ?>
<!DOCTYPE html>
<html lang="en">
<head>
  <!-- start: Meta -->
  <meta charset="utf-8">
  <title>OmbusKing | Rajanya Ombus-Ombus Makanan Khas dari Tapanuli Utara</title>
  <meta name="description" content="OmbusOmbus, king, enak, berkualitas, technology, tapanuli utara, sumatra, murah"/>
  <meta name="keywords" content="OmbusOmbus, Murah, Tapanuli, Baru, Enak, harga, terjangkau" />
  <meta name="author" content="Fujiatma Pratama Napitupulu"/>
  <!-- end: Meta -->

  <!-- start: Mobile Specific -->
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <!-- end: Mobile Specific -->

  <!-- start: Facebook Open Graph -->
  <meta property="og:title" content=""/>
  <meta property="og:description" content=""/>
  <meta property="og:type" content=""/>
  <meta property="og:url" content=""/>
  <meta property="og:image" content=""/>
  <!-- end: Facebook Open Graph -->

  <!-- start: CSS -->
  <link href="css/bootstrap.css" rel="stylesheet">
  <link href="css/bootstrap-responsive.css" rel="stylesheet">
  <link href="css/style.css" rel="stylesheet">
  <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans:400,700">
  <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Serif">
  <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Boogaloo">
  <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Economica:700,400italic">
  <!-- end: CSS -->

  <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
  <!--[if lt IE 9]>
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
  <![endif]-->
</head>
<body>

  <!--start: Header -->
  <header>

    <!--start: Container -->
    <div class="container">

      <!--start: Row -->
      <div class="row">

        <!--start: Logo -->
        <div class="logo span3">

          <a class="brand" href="#"><img src="img/logo2.png" alt="Logo"></a>

        </div>
        <!--end: Logo -->

        <!--start: Navigation -->
        <div class="span9">

          <div class="navbar navbar-inverse">
            <div class="navbar-inner">
              <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </a>
              <div class="nav-collapse collapse">
                <ul class="nav">
                  <li class="active"><a href="index.php">Home</a></li>
                  <li><a href="produk.php">Produk Kami</a></li>
                  <li><a href="testimoni.php">Testimoni</a></li>
                  <li><a href="detail.php">Keranjang</a></li>
                  <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Login <b class="caret"></b></a>
                    <ul class="dropdown-menu">
                      <li><a href="index.html">Admin</a></li>
                      <li><a href="index.php">Konsumen</a></li>
                      <!--<li class="divider"></li>
                      <li class="nav-header">Nav header</li>
                      <li><a href="#">Separated link</a></li>
                      <li><a href="#">One more separated link</a></li>-->
                    </ul>
                  </li>
                </ul>
              </div>
            </div>
          </div>

        </div>
        <!--end: Navigation -->

      </div>
      <!--end: Row -->

    </div>
    <!--end: Container-->

  </header>
  <!--end: Header-->

  <!-- start: Page Title -->
  <div id="page-title">

    <div id="page-title-inner">

      <!-- start: Container -->
      <div class="container">

        <h2><i class="ico-usd ico-white"></i>Keranjang</h2>

      </div>
      <!-- end: Container  -->

    </div>

  </div>
  <!-- end: Page Title -->

  <!--start: Wrapper-->
  <div id="wrapper">

    <!-- start: Container -->
    <div class="container">

      <!-- start: Table -->
      <div class="title"><h3>Detail Keranjang Belanja</h3></div>
      <table class="table table-hover table-condensed">
        <tr>
          <th><center>No Pembelian</center></th>
          <th><center>Kode Barang</center></th>
          <th><center>Nama Barang</center></th>
          <th><center>Harga Satuan</center></th>
          <th><center>Jumlah</center></th>
          <th><center>Sub Total</center></th>
          <th><center>Opsi</center></th>
        </tr>
        <?php
        //MENAMPILKAN DETAIL KERANJANG BELANJA//

        $total = 0;
        //mysql_select_db($database_conn, $conn);
        if (isset($_SESSION['items'])) {
          foreach ($_SESSION['items'] as $key => $val) {
            $query = mysqli_query($koneksi, "select * from barang where br_id = '$key'");
            $data = mysqli_fetch_array($query);

            $jumlah_harga = $data['br_hrg'] * $val;
            $total += $jumlah_harga;
            $no = 1;
            ?>
            <tr>
              <td><center><?php echo $no++; ?></center></td>
              <td><center><?php echo $data['br_id']; ?></center></td>
              <td><center><?php echo $data['br_nm']; ?></center></td>
              <td><center><?php echo number_format($data['br_hrg']); ?></center></td>
              <td><center><?php echo number_format($val); ?></center></td>
              <td><center><?php echo number_format($jumlah_harga); ?></center></td>
              <td><center><a href="cart.php?act=plus&amp;barang_id=<?php echo $key; ?>&amp;ref=detail.php" class="btn btn-xs btn-success">Tambah</a> <a href="cart.php?act=min&amp;barang_id=<?php echo $key; ?>&amp;ref=detail.php" class="btn btn-xs btn-warning">Kurang</a> <a href="cart.php?act=del&amp;barang_id=<?php echo $key; ?>&amp;ref=detail.php" class="btn btn-xs btn-danger">Hapus</a></center></td>
            </tr>

            <?php
            //mysql_free_result($query);
          }
          //$total += $sub;
        }?>
        <?php
        if($total == 0){
          echo '<tr><td colspan="5" align="center">Ups, Keranjang kosong!</td></tr></table>';
          echo '<p><div align="right">
          <a href="index.php" class="btn btn-info btn-lg">&laquo; Continue Shopping</a>
          </div></p>';
        } else {
          echo '
          <tr style="background-color: #DDD;"><td colspan="4" align="right"><b>Total :</b></td><td align="right"><b>Rp. '.number_format($total,2,",",".").'</b></td></td></td><td></td></tr></table>
          <p><div align="right">
          <a href="index.php" class="btn btn-info">&laquo; CONTINUE SHOPPING</a>
          <a href="checkout.php?total='.$total.'" class="btn btn-success"><i class="glyphicon glyphicon-shopping-cart icon-white"></i> CHECK OUT &raquo;</a>
          </div></p>
          ';
        }
        ?>

      </table>


      <!-- end: Table -->

    </div>
    <!-- end: Container -->

  </div>
  <!-- end: Wrapper  -->

  <!-- start: Footer Menu -->
  <div id="footer-menu" class="hidden-tablet hidden-phone">

    <!-- start: Container -->
    <div class="container">

      <!-- start: Row -->
      <div class="row">

        <!-- start: Footer Menu Logo -->
        <div class="span2">
          <div id="footer-menu-logo">
            <a href="#"><img src="img/logo-footer-menu.png" alt="logo" /></a>
          </div>
        </div>
        <!-- end: Footer Menu Logo -->

        <!-- start: Footer Menu Links-->
        <div class="span9">

          <div id="footer-menu-links">

            <ul id="footer-nav">

              <li><a href="#">Kelapa Gula Merah</a></li>

              <li><a href="#">Kelapa Gula Putih</a></li>

              <li><a href="#">Cokelat</a></li>

              <li><a href="#">Pandan</a></li>

              <li><a href="#">Strawberry</a></li>

            </ul>

          </div>

        </div>
        <!-- end: Footer Menu Links-->

        <!-- start: Footer Menu Back To Top -->
        <div class="span1">

          <div id="footer-menu-back-to-top">
            <a href="#"></a>
          </div>

        </div>
        <!-- end: Footer Menu Back To Top -->

      </div>
      <!-- end: Row -->

    </div>
    <!-- end: Container  -->

  </div>
  <!-- end: Footer Menu -->

  <!-- start: Footer -->
  <div id="footer">

    <!-- start: Container -->
    <div class="container">

      <!-- start: Row -->
      <div class="row">

        <!-- start: About -->
        <div class="span3">

          <h3>Tentang OmbusOmbus</h3>
          <p align="justify">
            Kue Ombusombus adalah makanan atau jajanan khas Batak yang berasal dari Siborongborong, Tapanuli Utara. <br>
            Kue ombusombus terbuat dari tepung beras yang diberi gula di tengahnya dan dibungkus dengan daun pisang.<br>
            Nama Ombusombus itu konon dibuat harus memberi tiupan (menghembuskan nafas) ketika memakannya dan kue ini enak dimakan di saat masih hangat.<br>
            Tak jelas sejak kapan penganan ini mulai “membudaya”, namun pada acara seremonial adat Batak tertentu, biasanya lampet atau ombusoombus tetap menjadi hidangan sela dan dibarengi kopi atau teh.
          </p>

        </div>
        <!-- end: About -->

        <!-- start: Photo Stream -->
        <div class="span3">

          <h3>Alamat Kami</h3>
          Jl. Sisingamangaraja, Sitoluama, Laguboti, Sumatera Utara, Indonesia<br />
          Telp : 0823-0448-1300<br />
          Email : <a href="mailto:fujiatmapratama@gmail.com">fujiatmapratama@gmail.com</a> / <a href="mailto:fujiatman@gmail.com">fujiatman@gmail.com</a>
        </div>
        <!-- end: Photo Stream -->

        <div class="span6">

          <!-- start: Follow Us -->
          <h3>Follow Us!</h3>
          <ul class="social-grid">
            <li>
              <div class="social-item">
                <div class="social-info-wrap">
                  <div class="social-info">
                    <div class="social-info-front social-twitter">
                      <a href="http://twitter.com"></a>
                    </div>
                    <div class="social-info-back social-twitter-hover">
                      <a href="http://twitter.com"></a>
                    </div>
                  </div>
                </div>
              </div>
            </li>
            <li>
              <div class="social-item">
                <div class="social-info-wrap">
                  <div class="social-info">
                    <div class="social-info-front social-facebook">
                      <a href="http://facebook.com"></a>
                    </div>
                    <div class="social-info-back social-facebook-hover">
                      <a href="http://facebook.com"></a>
                    </div>
                  </div>
                </div>
              </div>
            </li>
            <li>
              <div class="social-item">
                <div class="social-info-wrap">
                  <div class="social-info">
                    <div class="social-info-front social-dribbble">
                      <a href="http://dribbble.com"></a>
                    </div>
                    <div class="social-info-back social-dribbble-hover">
                      <a href="http://dribbble.com"></a>
                    </div>
                  </div>
                </div>
              </div>
            </li>
            <li>
              <div class="social-item">
                <div class="social-info-wrap">
                  <div class="social-info">
                    <div class="social-info-front social-flickr">
                      <a href="http://flickr.com"></a>
                    </div>
                    <div class="social-info-back social-flickr-hover">
                      <a href="http://flickr.com"></a>
                    </div>
                  </div>
                </div>
              </div>
            </li>
          </ul>
          <!-- end: Follow Us -->

          <!-- start: Newsletter -->
          <!--	<form id="newsletter">
          <h3>Newsletter</h3>
          <p>Please leave us your email</p>
          <label for="newsletter_input">@:</label>
          <input type="text" id="newsletter_input"/>
          <input type="submit" id="newsletter_submit" value="submit">
        </form> -->
        <!-- end: Newsletter -->

      </div>

    </div>
    <!-- end: Row -->

  </div>
  <!-- end: Container  -->

</div>
<!-- end: Footer -->

<!-- start: Copyright -->
<div id="copyright">

  <!-- start: Container -->
  <div class="container">

    <p>
      Copyright &copy; <a href="https://www.youtube.com/watch?v=9c7_4ZtD6sU">Make OmbusOmbus</a> <a href="http://bootstrapmaster.com" alt="Bootstrap Themes">Bootstrap Themes</a> designed by BootstrapMaster
    </p>

  </div>
  <!-- end: Container  -->

</div>
<!-- end: Copyright -->

<!-- start: Java Script -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery-1.8.2.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/flexslider.js"></script>
<script src="js/carousel.js"></script>
<script src="js/jquery.cslider.js"></script>
<script src="js/slider.js"></script>
<script def src="js/custom.js"></script>
<!-- end: Java Script -->

</body>
</html>
