<?php 
include_once("include/main.inc.php"); 
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);
// error_reporting(E_ALL);
 if(isset($_POST['loadmores'])){
   
    $error = array('success' => false);
    $in = $_POST;
    if(empty($in['start']) || !ctype_digit($in['start'])){$error['msg'] = 'invalid start';}
    if(empty($in['whr'])){$error['msg'] = 'invalid start';}
   
    if(!isset($error['msg'])){
    $target_location = $_POST['loadmores'];
   $whr= $_POST['whr'];
   $start=$_POST['start'];

     $product_s= mysqli_query($GLOBALS['dbconn'],"select product_image,product_title,catalog,product_id,product_video,product_specfi,product_name from product_tbl where  " .$whr." order by product_id desc limit ".$start.",10");
                  if(mysqli_num_rows($product_s)>0) {          ?>

<?php $i=1;
                   while($product_r=mysqli_fetch_array($product_s)){
                    $pro_image =  explode(',',$product_r['product_image']); 
                    $imgname=explode('.',$pro_image[0]);
                    $productName=($product_r['product_name']!='')?$product_r['product_name']:$product_r['product_title'];
                    ?>
<div class="col productlist">
    <div class="c_bx pr-bx wow fadeInUp" data-wow-delay=".1s">
        <a href="<?=site_url;?>/<?=getValidFileName($productName);?>-<?=$product_r['product_id'];?>.htm" class="img_bx"
            title="<?=$product_r['product_title'];?> Manufacturers, Suppliers, Exporters in <?=$admin_res['targetlocation'];?>">
            <img src="<?=getImage($pro_image[0], 316, 474, $productName.$product_r['product_id'].$imgname[0],"/uploaded-files/product-images/");?>"
                alt="<?=$product_r['product_title'];?> Manufacturers, Suppliers, Exporters in <?=$admin_res['targetlocation'];?>"
                title="<?=$product_r['product_title'];?> Manufacturers, Suppliers, Exporters in <?=$admin_res['targetlocation'];?>">
            <span title="View More"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                    class="bi bi-zoom-in" viewBox="0 0 16 16">
                    <path fill-rule="evenodd"
                        d="M6.5 12a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11M13 6.5a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0" />
                    <path
                        d="M10.344 11.742q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1 6.5 6.5 0 0 1-1.398 1.4z" />
                    <path fill-rule="evenodd"
                        d="M6.5 3a.5.5 0 0 1 .5.5V6h2.5a.5.5 0 0 1 0 1H7v2.5a.5.5 0 0 1-1 0V7H3.5a.5.5 0 0 1 0-1H6V3.5a.5.5 0 0 1 .5-.5" />
                </svg> View More</span>
        </a>
        <div class="des">
            <div class="tt"><a  href="<?=site_url;?>/<?=getValidFileName($productName);?>-<?=$product_r['product_id'];?>.htm"
                    title="<?=$product_r['product_title'];?> Manufacturers, Suppliers, Exporters in <?=$admin_res['targetlocation'];?>"><?=$product_r['product_title'];?></a>
            </div>
            <!-- <div class="price">₹12,000 (MAQ: 100)</div> -->
        </div>
    </div>
</div>

<?php $i++; }  } } } ?>