GIF89a php
Current File : /home/hencockfreshchic/public_html/app/viewAll.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 Your Favourite Items..." onclick="location.href='searchAll.php';">
            </div>
          </div>
        </div>
       </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
             $SR=0;
               if($_GET['subcat']=="")
               {
                  $sqlC="SELECT * FROM `subCat` WHERE `cat_name`='".$_GET['cat']."'";
               }
               else
               {
                  $sqlC="SELECT * FROM `subCat` WHERE `cat_name`='".$_GET['cat']."' && `subcat_name`='".$_GET['subcat']."'";
               }         
                $rsC=mysqli_query($conn,$sqlC);
                while($rowC=mysqli_fetch_array($rsC)){
              ?>
            <div class="row my-1">             
              <div class="col">
                <h6>
                  <i class="bi bi-droplet-fill fs-4 text-success"></i> <?php echo ucfirst($rowC['subcat_name']); ?>
                </h6>
              </div>
            </div>
            <div class="row my-1">
              <?php 
                $sqlP="SELECT * FROM `products` WHERE `cat_name`='".$rowC['cat_name']."' && `subcat_name`='".$rowC['subcat_name']."'";
                $rsP=mysqli_query($conn,$sqlP);                            
                while($rowP=mysqli_fetch_array($rsP)){
              ?>
              <div class="col-6 p-2">
                 <div class="border bg-light p-2 rounded">
                  <button type="button" class="btn btn-primary btn-sm py-0 px-1 rounded-pill my-1"><small class="text-size"><?php echo discountCal($rowP['sale_price'],$rowP['real_price']); ?>% OFF</small></button>
                   <figure class="figure" onclick="location.href='description.php?prod_id=<?php echo $rowP['sr']; ?>';">
                     <img src="<?php echo "../admin.cpanel/".$rowP['image']; ?>" class="figure-img img-fluid mx-auto d-flex w-90 img-thumbnail" style="width:130px; height: 100px">
                     <span><i class="bi bi-stopwatch-fill text-success"><small>35 Mins. delivery time</small></i></span><br>
                     <span class="text-dark p-0"><b class=""><?php echo ucfirst($rowP['p_name']); ?></b></span><br>
                     <span class="text-size p-0"><?php echo ucfirst($rowP['p_size']); ?></span>                     
                   </figure>
                   <button class="btn btn-outline-success" type="button" onclick="addCart('<?php echo $rowP['sr']; ?>','<?php echo $_COOKIE["user_id"]; ?>','<?php echo $rowP['sale_price']; ?>','1')">ADD</button>
                </div>
              </div>             
            <?php } ?>
            </div>
            <?php } ?>
          </div>
         </div>
       </div>
   </div>
 </div>
   
<div style="height: 140px;"></div>
<?php include 'footer.php';?>
  <script>
function openNav() {
  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>