<section class="new-arrival">
        <!-- 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 products  WHERE sub_category_id = 16";
    $res6 = mysqli_query($conn, $sql6);
    $count6= mysqli_num_rows($res6);
    $count6 = ceil($count6 / $per_page);
    echo $count6;
     ?>

        <div class="arrival-heading">
          <strong>Kids Wear</strong>
          <p>See Kids Wear</p>
        </div>
        <div class="product-container">
          <!-- pproduct box-->
          <?php


            $sql = "SELECT * FROM products WHERE sub_category_id = 16 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'];
                $description = $row['description'];
                $featured = $row['featured'];
                $active = $row['active'];
                $size = $row['size'];
                $price = $row['price'];
                $qty = $row['qty'];
                ?>
          <form action="item-description1.php" method="post" enctype="multipart/form-data">
            <div class="product-box">

              <div class="product-img">
                  <!-- cart-->
                  <!-- cart -->
               
                <!-- <input type="submit" name="submit" value="cart" class="add-cart"> -->

                <?php
                if ($image_name) {
                  //img is available
                  ?>
                  <img src="<?php echo SITEURL; ?>images/products/<?php echo $image_name; ?>" width="100px" >
                  <?php
                }else {
                  //img is not available
                  echo  "<div class='error'>Img is not Added</div>";
                }

                 ?>
              </div>
              <div class="product-details">
                <a href="javascript:void(0);" class="p-name"><?php echo $title?></a>
                <span class="p-price">$<?php echo $price?></span>
                <button type="submit" name="submit" class="add-cart">
                   VIEW PRODUCT
                </button>
              </div>
              <input type="hidden" name="qty" value="<?php echo $qty?>">
              <input type="hidden" name="id" value="<?php echo $id?>">
              <input type="hidden" name="title" value="<?php echo $title?>">
              <input type="hidden" name="image_name" value="<?php echo $image_name?>">
              <input type="hidden" name="price" value="<?php echo $price?>">
              <input type="hidden" name="size" value="<?php echo $size?>">
              <input type="hidden" name="description" value="<?php echo $description?>">
              <input type="hidden" name="active" value="<?php echo $active?>">
              <input type="hidden" name="featured" value="<?php echo $featured?>">

            </div>
            <!-- pproduct box -->
          </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='kids.php?page22=$i'>$i</a></li>";
              }else {
                echo "<li><a href='kids.php?page22=$i'>$i</a></li>";
              }

            }

             ?>


          </ul>

      </section>
