Current Path : /var/www/vhosts/thaisoho.com/httpdocs/
Upload File :
Current File : /var/www/vhosts/thaisoho.com/httpdocs/product_group.php

<?php include '_header.php'; ?>
<style>
.card-body {
    /* -ms-flex: 1 1 auto;
    flex: 1 1 auto; */
    min-height: 1px;
    display: grid;
    padding: 0.25rem;
}
.stars{
  color: #ffa500;
}
.container {
  background: black;
}
.nav-active{
  background-color: #d5d5d5;
    color: black;
}
body{
  background-color: #0e0e0e !important;
}
</style>
  <div class="container pt-5  position-relative " >
<div class="product-h1 p-3" style="min-height: 1154px;">
  <h1 class="text-left mt-2 mb-0 ml-5" style="color: #dc960f;"></h1>
  <header class="header-line position-relative d-flex mb-4" style="z-index: 1;">
        <h3 class="pr-3" style="background: black; z-index: 10;">
          <span class="text-responsive" style="color:#dc960f;">THAISOHO PRODUCT</span>
          <div class="text-right" style="color: #dc960f; font-size: 16px;">Recommaned product</div>
        </h3>
  </header>
  <div class="row justify-content-center m-0" style="">
    <div class="col-12 text-right mb-3">
      <div class="form-inline">
        <nav aria-label="breadcrumb">
          <ol class="breadcrumb mb-0" style="background-color: #fff0!important;">
            <li class="breadcrumb-item "><a style="color: #dc960c;" href="index.php">REFERENCE SITE</a></li>
            <li class="breadcrumb-item "><a style="color: #dc960c;" href="product.php">PRODUCT</a></li>
            <li class="breadcrumb-item "><a style="color: #dc960c;" href="product.php"><?=$_GET['name']?></a></li>
          </ol>
        </nav>
        <a href="product.php" class="btn ml-auto btn-warning"> <i class="fa  fa-chevron-double-left"></i> BACK</a>
      </div>
    </div>
    <?php
    $group = $_GET['group'];
    $perpage = 6;
    if (isset($_GET['page'])) {
     $page = $_GET['page'];
     } else {
     $page = 1;
     }
    $start = ($page - 1) * $perpage;

    $query_product = mysqli_query($dbc , "SELECT * FROM real_product WHERE type = '$group' limit {$start} , {$perpage} ");
    while ($result = mysqli_fetch_assoc($query_product)) { ?>
      <div class="col-sm-12 col-lg-4">
      <div class="card m-3">
        <div class="card-body product">
          <a href="product_details.php?id=<?=$result['id']?>"  >
            <img src="Admin/uploads/<?=$result['picture']?>" width="100%"  >
            <span class="name_product text-dark pl-2 mt-3"><?=$result['title']?></span>
          </a>
          <a href="product_details.php?id=<?=$result['id']?>"  class="btn btn-primary mt-2"><i class="fa fa-search"></i> More..</a>
        </div>
      </div>
    </div>
    <?php } ?>


  </div>

<div class="row justify-content-center">
  <nav class="" aria-label="Page navigation example">
    <ul class="pagination">
      <li class="page-item"><a class="page-link" href="product_group.php?page=1&group=<?=$_GET['group']?>&name=<?=$_GET['name']?>">Previous</a></li>
      <?php
      $query_product2 = mysqli_query($dbc , "SELECT * FROM real_product WHERE type = '$group' order by created_at desc");
      $total_record = mysqli_num_rows($query_product2);
      $total_page = ceil($total_record / $perpage);
      $me = 0;
      for ($i=0; $i < $total_page; $i++) { $me++ ; ?>
        <li class="page-item "><a class="page-link <?=$me == $_GET['page'] ? "nav-active" : NULL?>" href="product_group.php?page=<?=$me?>&group=<?=$_GET['group']?>&name=<?=$_GET['name']?>"><?=$me?></a></li>
    <?php } ?>
      <li class="page-item"><a class="page-link" href="product_group.php?page=<?=$total_page?>&group=<?=$_GET['group']?>&name=<?=$_GET['name']?>">Next</a></li>
    </ul>
  </nav>
</div>


</div>
</div>
<?php include '_footer.php'; ?>

  </body>
</html>