<!-- featured-categories -->
<section class="featured">
    <!-- heading -->
        <?php
    $per_page = 4;
    if (isset($_GET['page22'])) {
      //echo "lets go";
      $page22 = $_GET['page22'];
    }else {
      //echo "wait for a minute";
      $page22 = "";
    }if ($page22=='' || $page22==1) {
      $page1 = 0;
    }else {
      $page1 = ($page22 * $per_page) - $per_page;
    }



    $sql6 = "SELECT * FROM sub_categories  WHERE active = 'Yes'";
    $res6 = mysqli_query($conn, $sql6);
    $count6= mysqli_num_rows($res6);
    $count6 = ceil($count6 / $per_page);
    echo $count6;
     ?>

  <div class="feature-heading">
    <h2>FEATURED CATEGORIES</h2>
  </div>
  <div class="feature-cat">
       <?php
            $sql = "SELECT * FROM sub_categories WHERE active='Yes'  limit $page1, $per_page";
            $res = mysqli_query($conn, $sql);
            $count= mysqli_num_rows($res);
            if ($count>0) {
              while ($row = mysqli_fetch_assoc($res)) {
                // code...
                $id = $row['id'];
                $title = $row['title'];
                $image_name = $row['image_name'];
                
                $featured = $row['featured'];
                $active = $row['active'];
                 
                 
                ?>
    <form action="obed.php"  method="post" enctype="multipart/form-data">
    <div class="feature-item">
      <div class="feature-box">
          <?php
                if ($image_name) {
                  //img is available
                  ?>
                  <img src="<?php echo SITEURL; ?>images/sub-category/<?php echo $image_name; ?>" width="100px" >
                  <?php
                }else {
                  //img is not available
                  echo  "<div class='error'>Img is not Added</div>";
                }

                 ?>
      </div>
      <span><a href="" class="p-name"><?php echo $title?></a></span>
      <!-- <a class="add-cart" href="<?php echo SITEURL;?>shopping/catproducts.php?id=<?php echo $id;?>&title=<?php echo $title;?>"> -->
         
                   
            
      </a>
      <input class="add-cart" type="submit" name="VPROD" value="VIEW PRODUCTS">
      
        <input type="hidden" name="id" value="<?php echo $id?>">

        <input type="hidden" name="title" value="<?php echo $title?>">
              
    </div>
    </form>
   
    <?php
        }
      }else {
        echo 'No clothes Added';
      }
      ?>
  </div>
  <ul class="pager">
            <?php
            for ($i=1; $i <=$count6 ; $i++) {
              if ($i == $page22) {
                  echo "<li><a class='active_link' href='index.php?page22=$i'>$i</a></li>";
              }else {
                echo "<li><a href='index.php?page22=$i'>$i</a></li>";
              }

            }

             ?>


          </ul>
 <?php
      if (isset($_POST['VPROD'])) {
        echo $username = $title;
      }


     ?>
</section>
  




 
