<?php
include_once("include/main.inc.php");
session_start();
$sesion=session_id();
@extract($_GET);
@extract($_POST);
@extract($_REQUEST);
//print_r($_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($dbcon,$query);
$wnum=mysqli_num_rows($sql_dds);
//echo " You have searched for keywords: " . $keyword." (".$wnum.") ";?>
<!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><?=$keyword;?></title>
    <meta name="keywords" content="<?=$keyword;?>" />
    <meta name="description" content="<?=$keyword;?>" /> -->
     <?php include "top.php"; ?>
</head>
<body>
   <div class="webpulse-main-wrapper wrapper-wide" id="top">
    <?php include "header.php"; ?>
    <div class="clearfix"></div>
	<section class="heading_banner about_us_banner" style="background-image: url('<?=SITE_URL_PATH;?>/images/search.jpg')">
  <div class="container">
    <div class="row">
      <div class="col-sm-12 col-lg-12 col-md-12 col-xl-12 col-xxl-12 text-center">
        <h1 class="cat_title"><?php echo $keyword; ?></h1>
        <div class="clearfix"></div>
      </div>
    </div>
  </div>
</section>
<div 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-xs-12 col-12">
        <ul class="breadcrumb">
         <li><a href="<?=SITE_URL_PATH;?>" title="Home">Home</a></li>
		  <li class="active"><?php echo $keyword; ?></li>
        </ul>
      </div>
    </div>
  </div>
</div>
<section class="about_page webpulse_tm_universal_title_holder">
  <div class="container">
    <div class="row">
      <div class="col-xxl-9 col-xl-9 col-lg-9 col-md-9 col-sm-9 col-md-push-3">
        <div class="right_side">
          <div class="title_holder_inner">
            <h2>Search result for " <?php echo "  " . $keyword." (".$wnum.") "; ?>"</h2>
          </div>
          <div class="wps_right">
<?php
$num=mysqli_num_rows($sql_dds);
if($num > 0) { ?>
              <div class="row" id="prodListingContainer">
                  <?php while($row=mysqli_fetch_array($sql_dds)){ 
?>
                                  <div class="col-lg-4 col-md-4 col-sm-6 listpager">
                    <div class="product_more product_add">
                      <a class="check_product" href="javascript:void()" title="click to add to bulk enquiry">
					  <i class="fa-solid fa-magnifying-glass-plus fa-plus-circle"></i> Shortlist</a>
                      <a href="<?=SITE_URL_PATH;?>/<?=getValidFileName($row['catName']);?>.htm" title="<?php echo $row['displayName'];?>">
                        <div class="may_image">
                          <div class="image">
                            <img src="<?= getImage($row['catImage'], 297, 174, $row['catName'],"/uploaded-files/category/images/");?>" alt="<?php echo $row['displayName'];?>" title="<?php echo $row['displayName'];?>">
                          </div>
                        </div>

                        <div class="may_describe">
                          <h4><span><?php echo $row['displayName'];?></span></h4>
                          <div class="clearfix"></div>
                          <span class="may_btn popupEnqBtn"><i class="fa fa-list"></i> Read More</span> 
                        </div>
                      </a>
                    </div>
                  </div>
                                   <?php } ?> 
                  </div>
                <?php } else { ?>
           <div style=text-align:center;>
<div class="alert alert-danger" style="display: inline-block;width: 600px;">
<strong>You Search for "<u><?php echo (ucwords($keyword));?></u>" Not Matched, Pls Try with Another Keywords</strong>
</div>
    </div>                  
                            <?php } ?>
            <!-- You May Also Like --->
            <div class="clearfix"></div>
          </div>  </div>
      </div>
         <?php include "about-left.php"; ?>
   </div>
   </div>

</section>


		<?php include "testimonail.php"; ?>					 
  <?php include "footer.php"; ?>
</div>
      <?php include "bottom.php"; ?>
</body>
</html>