<?php 
include_once("include/main.inc.php");


session_start();
$sesion=session_id();
@extract($_GET);
@extract($_POST);
@extract($_REQUEST);
$chunk = $_REQUEST['keyword'];
$chunk = substr($chunk, 0, 5);
if(!empty($keyword)){
	$query =" SELECT * FROM category_tbl WHERE catName LIKE '%".$keyword."%' or catName LIKE '%".$chunk."%' or displayName LIKE '%".$chunk."%'";
}else{
   $query = "SELECT * FROM category_tbl order by catID desc";
}

$sql_dds = mysqli_query($GLOBALS['dbconn'],$query);
$wnum=mysqli_num_rows($sql_dds);
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?= COMPANY_NAME;?> - Search</title>
    <meta name="description" content="<?= COMPANY_NAME;?>" />
    <meta name="keywords" content="<?= COMPANY_NAME;?>" />
    
    <?php include "app_top.php";?>
</head>

<body>
    <?php include "app_header.php";?>


    <!-- Heading Banner--->
    <section class="heading_banner" style="background-image: url(<?=site_url;?>/designer/images/category-banner.jpg)">
        <div class="container">
            <div class="row">
                <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12 text-center">
                    <div class="cat_title">Search Result For "<?php echo "  " . $keyword." (".$wnum.") "; ?>"</div>
                    <div class="clearfix"></div>
                    <div class="cat_title2">We Are Available For You</div>
                </div>
            </div>
        </div>
    </section>

    <!-- Breadcrumb--->
    <section class="inner_breadcrumb hidden_xs">
        <div class="container">
            <div class="row">
                <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                    <ul class="breadcrumb">
                        <li><a href="<?=site_url;?>" title="Home">Home</a></li>
                        <li class="active">Search</li>
                    </ul>
                </div>
            </div>
        </div>
    </section>


    <!-- Home About--->
    <section class="category_page">
        <div class="container">
            <div class="row">
                <?php include "app_sidebar.php"; ?>
                <div class="col-xxl-9 col-xl-9 col-lg-9 col-md-9 col-sm-9 col-12">
                    <div class="right_side">
                        <h1>Search Result For "<?php echo "  " . $keyword." (".$wnum.") "; ?>"</h1>
                        <?php
$num=mysqli_num_rows($sql_dds);
if($num > 0) { ?>
                        <div class="wps_right">
                        <?php while($row=mysqli_fetch_array($sql_dds)){
                                    ?>
                            <div class="product_listing">
                                <div class="row">
                               
                                    <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-4 col-sm-4 col-12">
                                        <div class="product">
                                            <a href="<?=site_url;?>/<?=getValidFileName($row['catName']);?>.htm" title="<?=$row['catName'];?>">
                                                <div class="image1">
                                                    <img src="<?= getImage($row['catImage'], 267, 267, $row['catName'],"/uploaded-files/category/images/");?>" alt="<?=$row['displayName'];?>" title="<?=$row['displayName'];?>">
                                                </div>
                                            </a>
                                            
                                            <p>Interested in this product?</p>
                                            <a class="read_more_product" href="javascript:void(0);" data-bs-toggle="modal" data-bs-target="#productID" onclick="$('#catID').val('<?php echo $related_res['catID']; ?>');
                                 $('#catName').val('<?php echo $related_res['catName']; ?>');
                                 $('.catName').html('<?php echo $related_res['catName']; ?>');  $('.catImg').attr('src','<?=$img_link1;?>');" title="Get Best Quote"><i class="fa fa-envelope"></i> Get Best Quote</a>
                                        </div>
                                    </div>
                                    <div class="col-xxl-8 col-xl-8 col-lg-8 col-md-8 col-sm-8 col-12">
                                        <div class="right-content">
                                            <h3><a href="<?=site_url;?>/<?=getValidFileName($row['catName']);?>.htm" title="<?=$row['displayName'];?>"><?=$row['displayName'];?></a></h3>
                                            <div class="blue-line1"></div>
                                            <p><?=$row['catDesc'];?> </p>
                                           
                                                
                                            <div class="clearfix"></div>
                                            <a href="<?=site_url;?>/<?=getValidFileName($row['catName']);?>.htm" class="read_more_product" title="">Read More <i class="fa fa-long-arrow-right fa-1x"></i></a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                           <?php } } ?>



                        </div>
                    </div>
                </div>


            </div>
        </div>
    </section>

    <!-- Home Testimonials -->
    <section class="home_testimonials_webpulse">
    <?php include "testimonial.php";?>
    </section>


    <!-- Home Clients -->
    <section class="webpulse_home_clients">
        
    </section>


    <?php include "app_footer.php";?>
    <?php include "app_bottom.php";?>
</body>

</html>