<?php include_once("include/main.inc.php");
$admin_res=getAdminDetails();
$keyword = $_REQUEST['keyword'];
$cat_s="select * from category_tbl where parentID!='0' and catName LIKE '%$keyword%'";
$cat_q=mysqli_query($dbconn,$cat_s);
$num=mysqli_num_rows($cat_q);
$displayName = ucfirst($keyword);
?>
<!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>Search - <?=$keyword;?> | <?=$admin_res[companyName]?></title>
    <meta name="description" content="Search - <?=$displayName;?> | <?=$admin_res[companyName]?>" >
    <meta name="keywords" content="Search - <?=$displayName;?> | <?=$admin_res[companyName]?>" >
    <?php include "app_top.php"; ?>
</head>

<body>

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


    <!-- Heading Banner-->
    <section class="heading_banner" style="background-image: url(<?=theme_url?>images/sitemap-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 <?=$displayName?></div>
                    <div class="clearfix"></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 Result For <?=$displayName?></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-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                    <div class="right_side">
                        <h1>Search Result For - <?=$displayName?></h1>
                        <div class="wps_right">
                            <?php
    if($num>0)  {
    while($related_res=mysqli_fetch_array($cat_q)) {
         $img = getImage($related_res[catImage], 338, 338, $related_res[catName],"/uploaded-files/category/images/");
                ?>
                            <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($related_res['catName']);?>.htm" title="<?=$related_res[catName]?>">
                                                <div class="image1">
                                                    <img src="<?=$img;?>" alt="<?=$related_res[catName]?>" title="<?=$related_res[catName]?>">
                                                </div>
                                            </a>
                                            <p>Interested in this product?</p>
                                            <a class="read_more_btn_2" href="javascript:void(0);" data-bs-toggle="modal" data-bs-target="#productID" title="Get Best Quote" 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','<?= site_url; ?>/uploaded-files/category/images/<?php echo ($related_res['catImage']); ?>');"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                                                    <path d="M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414.05 3.555ZM0 4.697v7.104l5.803-3.558L0 4.697ZM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586l-1.239-.757Zm3.436-.586L16 11.801V4.697l-5.803 3.546Z" />
                                                </svg> 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($related_res['catName']);?>.htm" title="<?=$related_res['catName']?>"><?=$related_res['catName']?></a></h3>
                                            <div class="blue-line1"></div>
                                            <div class="more_info">
                                                <p><?=html_entity_decode($related_res['catDesc']);?></p>
                                                <div class="clearfix"></div>
                                            </div>
                                            <a href="<?=site_url;?>/<?=getValidFileName($related_res['catName']);?>.htm" class="read_more_btn_2" title="Read More">Read More</a>

                                        </div>
                                    </div>
                                </div>
                            </div>
                            <?php  } } else{ ?>

                            <div class="product_listing">
                                <div class="row">
                                    <img src="<?=theme_url?>images/NoRecordFound.jpg" alt="No Record Found" title="No Record Found">
                                </div>
                            </div>
                            <?php } ?>

                        </div>

                    </div>
                </div>


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

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

</html>
