<!DOCTYPE html>
<?php
require_once('../fyp_draft/mysqli_con.php');
include ("functions.php");
 ?>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Buy And Sell</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">
  <!-- Bootstrap style -->
  <link id="callCss" rel="stylesheet" href="themes/bootshop/bootstrap.min.css" media="screen"/>
  <link href="themes/css/base.css" rel="stylesheet" media="screen"/>
  <!-- Bootstrap style responsive -->
  <link href="themes/css/bootstrap-responsive.min.css" rel="stylesheet"/>
  <link href="themes/css/font-awesome.css" rel="stylesheet" type="text/css">
  <!-- Google-code-prettify -->
  <link href="themes/js/google-code-prettify/prettify.css" rel="stylesheet"/>
  <!-- fav and touch icons -->
  <link rel="shortcut icon" href="themes/images/ico/favicon.ico">
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="themes/images/ico/apple-touch-icon-144-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="themes/images/ico/apple-touch-icon-114-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="themes/images/ico/apple-touch-icon-72-precomposed.png">
  <link rel="apple-touch-icon-precomposed" href="themes/images/ico/apple-touch-icon-57-precomposed.png">
  <style type="text/css" id="enject"></style>
</head>
<body>
  <div id="header">
    <div class="container">
      <div id="welcomeLine" class="row">
        <div class="span6"><strong></strong></div>
        <div class="span6">
        </div>
      </div>
      <!-- Navbar ================================================== -->
      <div id="logoArea" class="navbar">
        <a id="smallScreen" data-target="#topMenu" data-toggle="collapse" class="btn btn-navbar">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </a>
        <div class="navbar-inner">
        <a class="brand" href="home2.php"><img style="width:100px;height:50px;" src="themes/images/buyandsell.png" alt="BuyAndSell"/></a>
          <form class="form-inline navbar-search" method="post" action="products.html" >
            <input id="srchFld" class="srchTxt" type="text" />
            <select class="srchTxt">
              <option>Category</option>
              <option>Cameras </option>
              <option>Computers</option>
              <option>Women's Clothing</option>
              <option>Women's Shoes</option>
              <option>Men's Clothings</option>
              <option>Men's Shoes</option>
              <option>Stationery</option>
              <option>Books</option>
            </select>
            <button type="submit" id="submitButton" class="btn btn-primary">Go</button>
          </form>
          <ul id="topMenu" class="nav pull-right">
            <li class=""><a href="product2.php">BROWSE</a></li>
            <li class=""><a href="register.php">REGISTRATION</a></li>
            <li class="">
              <a href="" role="button" data-toggle="modal" style="padding-right:0"><span class="btn btn-large btn-success">Logout</span></a>
                </div>
              </div>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
  <!--======================== Header End============================================== -->

  <div id="mainBody">
    <div class="container">
      <div class="row">
    <h4> &nbsp &nbsp &nbsp &nbsp All Items  </h4>
    <center><ul class="thumbnails">
      <!-- sini -->
      <?php

$query = "SELECT * FROM items ORDER BY items_id";

$result = mysqli_query($conn, $query);

if(mysqli_num_rows($result) >0){
  while ($row = mysqli_fetch_array($result)){
    $image = base64_encode($row['image']);?>


    <li class="span3">
      <div class="thumbnail">
        <a>
          <?php
          echo '<img style="width:200px;height:200px;" src="data:image/jpeg;base64,' .$image.'"/>';
           ?></a>
        <div class="caption">
        <?php
            echo "<h5>".$row['items_name']."</h5>";
            echo "<p>Buy Me!</p>";
          ?>

          <h4 style="text-align:center">

              <?php
              $prodID = $row["items_id"];
                echo '<a href="product_details.php?prodid='.$prodID.'" class="btn">View Details</a>'
             ?>
          <!--<button class="btn" name = "product" value = "" >View Details </button>-->



              <a class="btn btn-primary"><?php echo "RM ".$row['price']?></a>
            </h4>
          </div>
        </div>
      </li><?php

  }}


  ?>


    </div>
  </div>
</div>
<!-- Footer ================================================================== -->
<div  id="footerSection">
  <div class="container">
    <div class="row">
      <div class="span3">
        <h5>ACCOUNT</h5>
        <a href="register.html">REGISTRATION</a>
        <a href="login.html">LOG IN</a>
      </div>
      <div class="span3">
        <h5>INFORMATION</h5>
        <a href="contact.html">CONTACT</a>
        <a href="legal_notice.html">LEGAL NOTICE</a>
        <a href="tac.html">TERMS AND CONDITIONS</a>
      </div>
      <div id="socialMedia" class="span3 pull-right">
        <h5>Copyright : UniKL MIIT</h5>
        <a class="brand" href="index.html"><img width="6000" height="6000"src="themes/images/products/logoUnikl.png" alt="Bootsshop"/></a>
      </div>
    </div>
  </div>
</div><!-- Container End -->
</div>
<!-- Placed at the end of the document so the pages load faster ============================================= -->
<script src="themes/js/jquery.js" type="text/javascript"></script>
<script src="themes/js/bootstrap.min.js" type="text/javascript"></script>
<script src="themes/js/google-code-prettify/prettify.js"></script>

<script src="themes/js/bootshop.js"></script>
<script src="themes/js/jquery.lightbox-0.5.js"></script>

<span id="themesBtn"></span>
</body>
</html>
