<?php
include_once("include/main.inc.php");
@extract($_REQUEST);
if (preg_match('webpulse\.co$/', $_SERVER['HTTP_HOST'], $match)) {

  $match1 = $match[1];

  $vanity_url = 'http://' . $_SERVER['HTTP_HOST'];
}

$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";

$ee = explode('/', $actual_link);

$mm = $ee[3];

$ss = explode('.', $mm);

$cc = $ss[0];

$cat = str_replace("-", " ", $cc);

$cats = ucfirst($cat);

$cat_s = "select catImage, catName, displayName, catDesc, catID, catDesc1, catDesc2, keyword1, keyword2, keyword3, parentID, headingh1, headingh2,alttag from category_tbl where catName='$cats'";

$cat_q = mysqli_query($GLOBALS['dbconn'], $cat_s);

$num = mysqli_num_rows($cat_q);

$cat_r = mysqli_fetch_array($cat_q);

$category_id = $cat_r['catID'];

$hover = 'category';

$catn = $cat_r['catName'];

$cat_sql = "select * from category_tbl where parentID='$category_id' and status='Y'";

$cat_qry = mysqli_query($GLOBALS['dbconn'], $cat_sql);

$cccnum = mysqli_num_rows($cat_qry);

$cat_sql1 = "select * from category_tbl where catID='$category_id'";

$cat_qry1 = mysqli_query($GLOBALS['dbconn'], $cat_sql1);

$cat_res = mysqli_fetch_array($cat_qry1);

$pageTitles = $cat_res['catName'];

$disTitles = $cat_res['displayName'];

$pdes = $cat_res['catDesc'];

$pdes1 = $cat_res['catDesc1'];

$pdes2 = $cat_res['catDesc2'];

$parent = $cat_res['parentID'];

$cat_sql2 = "select * from category_tbl where catID='$parent'";

$cat_qry2 = mysqli_query($GLOBALS['dbconn'], $cat_sql2);

$num2 = mysqli_num_rows($cat_qry2);

$cat_res2 = mysqli_fetch_array($cat_qry2);

$mparent = $cat_res2['parentID'];

$cat_sql3 = "select * from category_tbl where catID='$mparent'";

$cat_qry3 = mysqli_query($GLOBALS['dbconn'], $cat_sql3);

$num3 = mysqli_num_rows($cat_qry3);

$cat_res3 = mysqli_fetch_array($cat_qry3);

$mmparent = $cat_res3['parentID'];

$cat_sql4 = "select * from category_tbl where catID='$mmparent'";

$cat_qry4 = mysqli_query($GLOBALS['dbconn'], $cat_sql4);

$num4 = mysqli_num_rows($cat_qry4);

$cat_res4 = mysqli_fetch_array($cat_qry4);

$admin_sql = mysqli_query($GLOBALS['dbconn'], "select * from admin_details");

$admin_res = mysqli_fetch_array($admin_sql);

$mobile = $admin_res['mobile'];

$city = $admin_res['city'];

$state = $admin_res['state'];

$country = $admin_res['country'];

$companyName = $admin_res['companyName'];

$address = $admin_res['address'];

if ($cat_res['catImage'] != '') {

  $imglink = getImage($cat_res[catImage], 356, 356, $cat_res[catName], "/uploaded-files/category/images/");
} else {

  $imglink = NO_IMG_URL;
}



$page_metatitle = $cat_res['pageTitle'];

$page_metakey = $cat_res['pageKeywords'];

$page_metadesc = $cat_res['pageDescription'];

$heading2 = explode(',', $page_metatitle);

if ($heading2[0] != '') {

  $h2 = $heading2[0];
} else {

  $h2 = $disTitles . ' in ' . $admin_res['targetlocation'];
}

// if (in_array($cat_res['catID'], [9])) {
//     $redirectUrl = site_url . '/' . getValidFileName($cat_res['catName']) . '.htm';
//     header("Location: " . $redirectUrl);
//     exit;
// }

if (isset($cat_res['catID']) && $cat_res['catID'] == 9) {
    header("Location: " . site_url);
    exit;
}
if (mysqli_num_rows($cat_q) > 0) { ?>

<!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.0">

    <?php include 'top_header.php'; ?>

</head>

<body>
    <!-- Google Tag Manager (noscript) -->
    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5K6SGBCR" height="0" width="0"
            style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager (noscript) -->

    <div class="webpulse-main-wrapper">
        <!-- Header-->
        <?php include 'header.php'; ?>

        <!-- Heading Banner-->
        <section class="heading_banner"
            style="background-image: url(<?= site_url; ?>/designer/images/products/products.jpg)">

            <div class="container">

                <div class="row">

                    <div class="col-lg-12 text-center">

                        <div class="">

                            <h1><?= $disTitles; ?></h1>

                        </div>

                        <div class="clearfix"></div>

                    </div>

                </div>

            </div>

        </section>

        <!-- Breadcrumb-->
        <div class="inner_breadcrumb hidden-xs">

            <div class="container">

                <div class="row">

                    <div class="col-lg-12">

                        <ul class="breadcrumb">



                            <li><a href="<?= site_url; ?>" title="Home">Home</a></li>

                            <li><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                    class="bi bi-caret-right-fill" viewBox="0 0 16 16">
                                    <path
                                        d="m12.14 8.753-5.482 4.796c-.646.566-1.658.106-1.658-.753V3.204a1 1 0 0 1 1.659-.753l5.48 4.796a1 1 0 0 1 0 1.506z" />
                                </svg></li>

                            <?php if ($num4 > 0) { ?>

                            <li><a href="<?= site_url; ?>/<?= getValidFileName($cat_res4['catName']); ?>.htm"
                                    title="<?php echo $cat_res4['displayName']; ?> "><?php echo $cat_res4['displayName']; ?></a>

                            </li>

                            <li><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                    class="bi bi-caret-right-fill" viewBox="0 0 16 16">
                                    <path
                                        d="m12.14 8.753-5.482 4.796c-.646.566-1.658.106-1.658-.753V3.204a1 1 0 0 1 1.659-.753l5.48 4.796a1 1 0 0 1 0 1.506z" />
                                </svg></li>

                            <?php } ?>



                            <?php if ($num3 > 0) { ?>
                            <?php if($cat_res3['catID']=='9'){?>
                            <li><a href="javascript:void(0);"
                                    title="<?php echo $cat_res3['displayName']; ?>"><?php echo $cat_res3['displayName']; ?></a>
                            </li>
                            <?php } else{?>

                            <li><a href="<?= site_url; ?>/<?= getValidFileName($cat_res3['catName']); ?>.htm"
                                    title="<?php echo $cat_res3['displayName']; ?>"><?php echo $cat_res3['displayName']; ?></a>
                            </li>

                            <li><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                    class="bi bi-caret-right-fill" viewBox="0 0 16 16">
                                    <path
                                        d="m12.14 8.753-5.482 4.796c-.646.566-1.658.106-1.658-.753V3.204a1 1 0 0 1 1.659-.753l5.48 4.796a1 1 0 0 1 0 1.506z" />
                                </svg></li>

                            <?php } } ?>



                            <?php if ($num2 > 0) { ?>

                            <?php if($cat_res2['catID']=='9'){?>
                            <li><a href="javascript:void(0);"
                                    title="<?php echo $cat_res2['catName']; ?>"><?php echo $cat_res2['displayName']; ?></a>
                            </li>
                            <?php } else{?>

                            <li><a href="<?= site_url; ?>/<?= getValidFileName($cat_res2['catName']); ?>.htm"
                                    title="<?php echo $cat_res2['catName']; ?>"><?php echo $cat_res2['displayName']; ?></a>
                            </li>

                            <?php } ?>

                            <li><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                    class="bi bi-caret-right-fill" viewBox="0 0 16 16">
                                    <path
                                        d="m12.14 8.753-5.482 4.796c-.646.566-1.658.106-1.658-.753V3.204a1 1 0 0 1 1.659-.753l5.48 4.796a1 1 0 0 1 0 1.506z" />
                                </svg></li>

                            <?php }  ?>



                            <li class="active"><?php echo $cat_res['displayName']; ?></li>





                        </ul>

                    </div>

                </div>

            </div>

        </div>

        <!-- Home About-->
        <div class="about_page py-5">
            <div class="container">
                <div class="right_side">
                    <h2><?= $disTitles; ?> in <?= $admin_res['targetlocation']; ?></h2>
                    <div class="wps_right">
                        <div class="row">

                            <div class="col-xxl-8 col-xl-8 col-lg-8 col-md-6 col-sm-12 col-12">

                                <div class="aboutContentBox">

                                    <?php echo html_entity_decode($cat_res['catDesc1']); ?>

                                </div>

                            </div>

                            <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-6 col-sm-12 col-12">

                                <div class="aboutPageImage text-center">

                                    <img src="<?= $imglink; ?>"
                                        alt="<?= $disTitles; ?> in <?= $admin_res['targetlocation']; ?>"
                                        title="<?= $disTitles; ?> in <?= $admin_res['targetlocation']; ?>">

                                    <a class="read_more" href="javascript:void();" data-bs-toggle="modal"
                                        data-bs-target="#EnquiryNow" tabindex="0"
                                        onclick="$('.catID').val('<?php echo $cat_res['catID']; ?>');$('.catName').html('<?php echo $cat_res['catName']; ?>');$('.catImg').attr('src','<?= $imglink; ?>');  $('.catImg').attr('alt','<?= $disTitles; ?> in <?= $admin_res['targetlocation']; ?>'); $('.catImg').attr('title','<?= $disTitles; ?> in <?= $admin_res['targetlocation']; ?>');"
                                        title="Get Best Quote">Get Best Quote</a>

                                </div>

                            </div>

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

        <?php if (!empty($cat_res['catDesc2'])): ?>
        <div class="content-section py-5">
            <div class="container">

                <div class="tt"></div>

                <?php echo html_entity_decode($cat_res['catDesc2']); ?>

                <!-- <p>You can empower your child from the day they receive their name. Yes! Now you have the chance to give your child the best start with a name that speaks volumes through the lens of numerology. In numerology, each letter in a name corresponds to a number, and these numbers hold power and a unique frequency. A name therefore carries significant vibrations that shape a child’s personality, destiny, and success. This is why every parent is, and should be, very particular when choosing the right name for their newborn. At Numeroworldf, our highly skilled numerologist Puunit Dsai offers personalized consultations to craft the best baby names that not only resonate with the powerful energies of numerology (as per birth path numbers) but also complement your family’s aspirations. From choosing the first letter in the name to the last letter or using the right vowel in your baby’s name, his expert guidance will ensure that your child is supported by positive energies that will help them not only to deal with the ups and downs of life but will enhance their chances of having an optimistic approach to achieving their deepest goals & dreams. As part of our exclusive service, Puunit Sir himself suggest 12 names that are compatible with your baby’s date of birth, allowing you to select the one that best aligns with your vision for your child’s future.</p> -->
            </div>
        </div>
        <?php endif; ?>

        <section class="about_page  py-5">
            <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">
                            <div class="wps_right">
                                <!-- Products Range -->
                                         <?php $product_s = mysqli_query($GLOBALS['dbconn'], "select product_image, product_title,product_code from product_tbl where   FIND_IN_SET('" . $cat_res['catID'] . "',product_cat) ");
                  $num = mysqli_num_rows($product_s);
                  if ($num > 0) {    ?>
                                <div class="row g-3 pb-4">
                                    <?php
                      while ($product_r = mysqli_fetch_array($product_s)) {
                        $pro_image =  explode(',', $product_r['product_image']);
                        $probig_img = $pro_image[0]; ?>
                                    <div class="col-xxl-3 col-xl-3 col-lg-3 col-md-4 col-sm-6 col-12">
                                        <div class="productBox">
                                            <div class="product_imge">
                                                <img src="<?= getImage($probig_img, 261, 261, $product_r['product_title'], "/uploaded-files/product-images/"); ?>"
                                                    title="<?= $product_r['product_title']; ?> in <?= $admin_res['targetlocation']; ?>"
                                                    alt="<?= $product_r['product_title']; ?> in <?= $admin_res['targetlocation']; ?>">
                                            </div>
                                            <div class="productName">
                                                <h4 class="procdtHeading"><?= $product_r['product_title']; ?></h4>
                                                <span class="prodt_price">₹<?= $product_r['product_code']; ?></span>
                                                <a class="read_more" href="javascript:void();" data-bs-toggle="modal"
                                                    data-bs-target="#EnquiryNow"
                                                    onclick="$('.catID').val('<?php echo $sub_res['catID']; ?>');$('.catName').html('<?php echo $product_r['product_title']; ?>');$('.catImg').attr('src','<?= site_url; ?>/uploaded-files/product-images/<?= $probig_img; ?>'); $('.catImg').attr('alt','<?= $product_r['product_title']; ?> in <?= $admin_res['targetlocation']; ?>'); $('.catImg').attr('title','<?= $product_r['product_title']; ?> in <?= $admin_res['targetlocation']; ?>');"
                                                    title="Get Best Quote" tabindex="0">Get Best Quote</a>
                                            </div>
                                        </div>
                                    </div>
                                    <?php } ?>

                                </div>
                                <?php } ?>
                                <?php

                  if (mysqli_num_rows($cat_qry) > 0) {  ?>

                                <div class="you_may">You May Also Like</div>

                                <?php

                    while ($sub_res = mysqli_fetch_array($cat_qry)) {

                      if ($sub_res['catImage'] != '') {

                        $img_link = getImage($sub_res[catImage], 355, 355, $sub_res[catName], "/uploaded-files/category/images/");

                        $img_link1 = getImage($sub_res[catImage], 435, 428, $sub_res[catName], "/uploaded-files/category/images/");
                      } else {

                        $img_link = NO_IMG_URL;

                        $img_link1 = NO_IMG_URL;
                      }
                    ?>
                                <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($sub_res['catName']); ?>.htm"
                                                    title="<?= $sub_res['displayName']; ?> in <?= $admin_res['targetlocation']; ?>">
                                                    <div class="image1">
                                                        <img src="<?= $img_link; ?>"
                                                            alt="<?= $sub_res['displayName']; ?> in <?= $admin_res['targetlocation']; ?>"
                                                            title="<?= $sub_res['displayName']; ?> in <?= $admin_res['targetlocation']; ?>">
                                                    </div>
                                                </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">
                                                <h4><a href="<?= site_url; ?>/<?= getValidFileName($sub_res['catName']); ?>.htm"
                                                        title="<?= $sub_res['displayName']; ?> in <?= $admin_res['targetlocation']; ?>"><?= $sub_res['displayName']; ?></a>
                                                </h4>
                                                <div class="more_info">
                                                    <p><?= html_entity_decode($sub_res['catDesc']); ?></p>
                                                </div>
                                                <a class="read_more" href="javascript:void();" data-bs-toggle="modal"
                                                    data-bs-target="#EnquiryNow"
                                                    onclick="$('.catID').val('<?php echo $sub_res['catID']; ?>');$('.catName').html('<?php echo $sub_res['catName']; ?>');$('.catImg').attr('src','<?= $img_link1; ?>'); $('.catImg').attr('alt','<?= $sub_res['displayName']; ?> in <?= $admin_res['targetlocation']; ?>'); $('.catImg').attr('title','<?= $sub_res['displayName']; ?> in <?= $admin_res['targetlocation']; ?>');"
                                                    title="Get Best Quote" tabindex="0">Get Best Quote</a>
                                                <a class="read_more"
                                                    href="<?= site_url; ?>/<?= getValidFileName($sub_res['catName']); ?>.htm"
                                                    title="Read More">Read More</a>
                                                <div class="clearfix"></div>
                                            </div>

                                        </div>

                                    </div>

                                </div>
                           



                                <?php }
                  } else { ?>

                                <div class="you_may">You May Also Like</div>

                                <?php

                    $cat_final = mysqli_query($GLOBALS['dbconn'], "select catImage, catName, displayName, catDesc, catID, catDesc1, catDesc2, parentID from category_tbl where parentID ='$parent' and status='Y' and catID!='$category_id' and catID!='9' order by catOrder Asc");

                      if (mysqli_num_rows($cat_final) == 0) {
                          $parent_data = mysqli_fetch_array(mysqli_query($GLOBALS['dbconn'], "
                              SELECT parentID FROM category_tbl WHERE catID = '$parent'
                          "));
                          $grand_parent = $parent_data['parentID'];

                          $cat_final = mysqli_query($GLOBALS['dbconn'], "select catImage, catName, displayName, catDesc, catID, catDesc1, catDesc2, parentID from category_tbl where parentID ='$grand_parent' and status='Y' and catID ='$parent' and catID!='9'");
                      }
                      if (mysqli_num_rows($cat_final) > 0) {


                    while ($sub_res = mysqli_fetch_array($cat_final)) {

                      if ($sub_res['catImage'] != '') {

                        $img_link = getImage($sub_res[catImage], 355, 355, $sub_res[catName], "/uploaded-files/category/images/");

                        $img_link1 = getImage($sub_res[catImage], 435, 428, $sub_res[catName], "/uploaded-files/category/images/");
                      } else {

                        $img_link = NO_IMG_URL;

                        $img_link1 = NO_IMG_URL;
                      }

                    ?>

                                <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($sub_res['catName']); ?>.htm"
                                                    title="<?= $sub_res['displayName']; ?> in <?= $admin_res['targetlocation']; ?>">
                                                    <div class="image1">
                                                        <img src="<?= $img_link; ?>"
                                                            alt="<?= $sub_res['displayName']; ?> in <?= $admin_res['targetlocation']; ?>"
                                                            title="<?= $sub_res['displayName']; ?> in <?= $admin_res['targetlocation']; ?>">
                                                    </div>
                                                </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">
                                                <h4><a href="<?= site_url; ?>/<?= getValidFileName($sub_res['catName']); ?>.htm"
                                                        title="<?= $sub_res['displayName']; ?> in <?= $admin_res['targetlocation']; ?>"><?= $sub_res['displayName']; ?></a>
                                                </h4>
                                                <div class="more_info">
                                                    <p><?= html_entity_decode($sub_res['catDesc']); ?></p>
                                                </div>
                                                <a class="read_more" href="javascript:void();" data-bs-toggle="modal"
                                                    data-bs-target="#EnquiryNow"
                                                    onclick="$('.catID').val('<?php echo $sub_res['catID']; ?>');$('.catName').html('<?php echo $sub_res['catName']; ?>');$('.catImg').attr('src','<?= $img_link1; ?>'); $('.catImg').attr('alt','<?= $sub_res['displayName']; ?> in <?= $admin_res['targetlocation']; ?>'); $('.catImg').attr('title','<?= $sub_res['displayName']; ?> in <?= $admin_res['targetlocation']; ?>');"
                                                    title="Get Best Quote" tabindex="0">Get Best Quote</a>
                                                <a class="read_more"
                                                    href="<?= site_url; ?>/<?= getValidFileName($sub_res['catName']); ?>.htm"
                                                    title="Read More">Read More</a>
                                                <div class="clearfix"></div>
                                            </div>

                                        </div>

                                    </div>

                                </div>

                                <?php } }
                  } ?>

                             




                                <div class="clearfix"></div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </section>
        <?php include "app_video.php"; ?>
        <!-- Footer-->
        <?php include 'footer.php'; ?>

    </div>





    <?php include 'bottom_footer.php'; ?>

</body>

</html>

<?php

} else {
  header("Location: " . site_url);
  exit;
}

?>