GIF89a php
Current File : /home/hencockfreshchic/public_html/app_old/log.php
<?php
ob_start();
ini_set('error_reporting', E_STRICT);
/*include("session.php");*/
include("connect.php");
include("libs.php");
mysqli_set_charset($conn,'utf8');
date_default_timezone_set('Asia/Kolkata');
?>
<!DOCTYPE html>
<html>

<?php include'head.php'; ?>
<body >
<?php include'header.php'; ?>
<div onclick="closeNav()">
  <div class="container no-gutters" >
    <div class="row row-spac no-gutters">
       <div class="col-md-5 no-gutters" style="margin: auto;padding: 0px;">
        <div class="container m-0 p-0">
          <div class="row my-1">
            <div class="form-group my-1">
              <input type="text" class="form-control py-2" name="search" placeholder="Search for Chicken, Mutton, Fish..." onclick="location.href='search.php';" readonly>
            </div>
          </div>
        </div>
       </div>
     </div>
     <div class="row row-spac no-gutters mb-4">
       <div class="col-md-5 no-gutters" style="margin: auto;padding: 0px;">
         <div id="carouselExampleSlidesOnly" class="carousel slide mt-1 mx-auto px-1" data-bs-ride="carousel" style="">
            <div class="carousel-inner">
              <?php
                $BR=0;
                $sqlB="SELECT * FROM `banner_images` ORDER BY `sr` DESC";
                $rsB=mysqli_query($conn,$sqlB);
                while($rowB=mysqli_fetch_array($rsB)){
                  $BR=$BR+1;
                  if($BR==1){
                    $url="viewAll.php?cat=".$rowB['banner_cat'];
              ?>
              <div class="carousel-item active" onclick="pageRedirect('<?php echo $url; ?>')">
                <img src="<?php echo "../admin.cpanel/".$rowB['banner_image']; ?>" class="d-block w-100 rounded shadow" style="height:150px;">
              </div>
            <?php } else { ?>
               <div class="carousel-item" onclick="pageRedirect('<?php echo $url; ?>')">
                <img src="<?php echo "../admin.cpanel/".$rowB['banner_image']; ?>" class="d-block w-100 rounded shadow" style="height:150px;">
              </div>
              <?php } } ?>
            </div>
          </div>
       </div>
     </div>
  
   </div> 


    <div class="container no-gutters">
      <div class="row row-spac no-gutters my-2">
       <div class="col-md-5 no-gutters" style="margin: auto;padding: 0px;">
         <h6 class="mx-2 fw-bold"><i class="bi bi-bag-check-fill text-dark"></i> Category</h6>
          <div class="container no-gutters">
            <div class="row row-spac no-gutters">
              <?php
                $sqlC="SELECT * FROM `category` ORDER BY `sr` DESC";
                $rsC=mysqli_query($conn,$sqlC);
                while($rowC=mysqli_fetch_array($rsC)){
              ?>
             <div class="col-4" onclick="pageRedirect('viewAll.php?cat=<?php echo $rowC['cat_name']; ?>')">
               <figure class="figure">
                <figcaption class="fig-caption text-center text-size fw-bold"><?php echo ucfirst($rowC['cat_name']); ?></figcaption>
                 <img src="<?php echo "../admin.cpanel/".$rowC['cat_icon']; ?>" class="figure-img w-100 my-0" style="height:70px;" >         
               </figure>
             </div>
            <?php } ?>
           </div>
          </div>
       </div>
     </div>
    </div>

    <div class="container no-gutters">
      <div class="row row-spac no-gutters my-2">
       <div class="col-md-5 no-gutters" style="margin: auto;padding: 0px;">
         <h6 class="mx-2 fw-bold"><i class="bi bi-bag-check-fill text-dark"></i> Offers & Sale</h6>
          <div class="container no-gutters">
            <div class="row row-spac no-gutters">
              <?php 
                $sqlP="SELECT * FROM `products` ORDER BY `sr` DESC";
                $rsP=mysqli_query($conn,$sqlP);
                while($rowP=mysqli_fetch_array($rsP)){
              ?>
              
             <div class="col-4" onclick="pageRedirect('viewAll.php?cat=<?php echo $rowP['cat_name']; ?>&subcat=<?php echo $rowP['subcat_name']; ?>&prod_id=<?php echo $rowP['sr']; ?>')">
               <figure class="figure">
                <figcaption class="fig-caption text-center" style="font-size: 13px;"><?php echo ucfirst($rowP['p_name']); ?></figcaption>
                 <img src="<?php echo "../admin.cpanel/".$rowP['image']; ?>" class="figure-img w-100 my-1 "style="height:100px;">
                <figcaption class="fig-caption text-center bg-primary text-light rounded text-size "><?php echo "UP TO ".discountCal($rowP['sale_price'],$rowP['real_price'])."% OFF"; ?></figcaption>
               </figure>
             </div>
            <?php } ?>
           </div>
          </div>
       </div>
     </div>
    </div>
    <div class="container no-gutters">
      <div class="row row-spac no-gutters">
       <div class="col-md-5 no-gutters" style="margin: auto;padding: 0px;">
         <img src="assest/images/banner/img-10.png" class="mx-auto" style="height: auto; max-width: 100%;"> 
       </div>
     </div>
   </div>
   <div class="container no-gutters my-2">
     <div class="row row-spac no-gutters">
         <div class="col-md-5 no-gutters" style="margin: auto;padding: 0px;">
          <div class="container m-0 p-0">
            <?php 
              $sqlSC="SELECT * FROM `subCat` ORDER BY `sr` DESC";
              $rsSC=mysqli_query($conn,$sqlSC);
              while($rowSC=mysqli_fetch_array($rsSC)){
            ?>
            <div class="row my-1">
              <div class="col-8"><h6><i class="bi bi-droplet-fill fs-4 text-success"></i> <?php echo ucfirst($rowSC['subcat_name']); ?> </h6></div>
              <div class="col-4 text-end"> <button type="button" class="btn btn-sm btn-success rounded-pill fw-light" onclick="location.href='viewAll.php?cat=<?php echo $rowSC['cat_name']; ?>&subcat=<?php echo $rowSC['subcat_name']; ?>';">VIEW ALL</button></div>
            </div>

            <div class="row my-1">
              <?php
                $sqlP2="SELECT * FROM `products` WHERE `cat_name`='".$rowSC['cat_name']."' && `subcat_name`='".$rowSC['subcat_name']."'";
                $rsP2=mysqli_query($conn,$sqlP2);
                while($rowP2=mysqli_fetch_array($rsP2)){
              ?>
              <div class="col-6 border-right-1">
                 <div>
                  <button type="button" class="btn btn-primary btn-sm py-0 px-1 rounded-pill my-1"><small class="text-size"><?php echo discountCal($rowP2['sale_price'],$rowP2['real_price']) ?>% OFF</small></button>
                   <figure class="figure" onclick="location.href='description.php?prod_id=<?php echo $rowP2['sr']; ?>';">
                     <img src="<?php echo "../admin.cpanel/".$rowP2['image']; ?>" class="figure-img w-90 img-fluid mx-auto d-flex" style="width: ; height: 100px">
                     <span><i class="bi bi-stopwatch-fill text-success"><small>2 Days</small></i></span><br>
                     <span class="text-dark p-0"><b class=""><?php echo ucfirst($rowP2['p_name']); ?></b></span><br>
                     
                     <span class="text-size p-0"><?php echo $rowP2['p_size']; ?></span>
                     <!-- <figcaption class="fig-caption"> <i class="bi bi-stopwatch-fill text-success"></i> 9 Minutes</figcaption> -->
                   </figure>
                   <button class="btn btn-outline-success" type="button" onclick="addCart('<?php echo $rowP2['sr']; ?>','<?php echo $_COOKIE["user_id"]; ?>','<?php echo $rowP2['sale_price']; ?>','1')">ADD</button>
                </div>
              </div>
            <?php } ?>
            </div>
          <?php } ?>
          </div>
         </div>
       </div>
   </div>
         </div>
       </div>
     </div>
   </div> 
  </section>
</div>
<div style="height: 150px;"></div>
<?php include 'footer.php';?>

<script>
    function openNav() {
      if(document.getElementById("mySidebar").style.width=="250px")
      {
        document.getElementById("mySidebar").style.width = "0";
        document.getElementById("main").style.marginLeft= "0";
      }
      else
      {
        document.getElementById("mySidebar").style.width = "250px";
        document.getElementById("main").style.marginLeft = "250px";
      }  
}

function closeNav() {
  document.getElementById("mySidebar").style.width = "0";
  document.getElementById("main").style.marginLeft= "0";
}
  </script>
</body>
</html>


<div id="snackbar"><span id="snack_msgg" style="color: white"></span></div>