<?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($dbconn,$query);
$wnum=mysqli_num_rows($sql_dds);
$page_metatitle = "Search - ".COMPANY_NAME;
$page_metakey = "Search - ".COMPANY_NAME;
$page_metadesc = "Search - ".COMPANY_NAME;
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title><?=$page_metatitle;?></title>
    <meta name="description" content="<?=$page_metadesc;?>" > 
    <meta name="keywords" content="<?=$page_metakey;?>" >
    <?php include "app_top.php"; ?>
</head>

<body>
    <?php include "app_header.php"; ?> 
    
    <section class="heading_banner" style="background-image: url(<?=site_url;?>/designer/images/about-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">
                    <h1 class="cat_title">Search Result For "<?php echo "  " . $keyword." (".$wnum.") "; ?>"</h1>
                </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-12">
                    <ul class="breadcrumb">
                        <li><a href="<?=site_url;?>" title="Home">Home</a></li>
                        <li class="active">Search Page</li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    
    <section class="about_page">
        <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">
                    <div class="right_side">
                        <h2 class="title_h2">Search Result For "<?php echo $keyword; ?>"</h2>

                        <?php
$num=mysqli_num_rows($sql_dds);
if($num > 0) { ?>


                     <div class="wps_right">

                        

                             <div class="row">

                             <?php while($row=mysqli_fetch_array($sql_dds)){
                                    ?>

                                <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-4 col-sm-6 col-6">
                                    <div class="searchProduct">
                                        <a href="javascript:void(0);">
                                        <div class="image">
                                            <img src="<?= getImage($row['catImage'], 400, 400, $row['catName'],"/uploaded-files/category/images/");?>" alt="<?=$row['displayName'];?>" title="<?=$row['displayName'];?>">
                                            
                                    
                                        </div>
                                      </a>

                                            

                                        <div class="searchProduct_info">
                                            <h3><a href="<?=site_url;?>/<?=getValidFileName($row['catName']);?>.htm" title="<?=$row['displayName'];?>"><?=$row['displayName'];?></a></h3>
                                            <a class="readmoree" href="<?=site_url;?>/<?=getValidFileName($row['catName']);?>.htm" title="Read More">Read More</a>
                                        </div>
                                    </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 } ?>


                  </div>


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

</html>
