<?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, tagline, catDesc1,catBanner, 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_id;
$catn = $cat_r['catName'];
$cat_sql = "select catImage, catName, displayName, catDesc, catID, tagline, catDesc1,catBanner, parentID 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 catName, displayName, catID, parentID,catImage, tagline, catDesc1,catBanner,keyword1,keyword2,keyword3,headingh1, headingh2,alttag,pageTitle,pageKeywords,pageDescription,multi_image 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'];
$page_desc = $cat_res['catDesc1'];
$page_desc = str_ireplace('{companyName}', $admin_res['companyName'], $page_desc);
$parent = $cat_res['parentID'];
$cat_sql2 = "select catName, displayName, catID, parentID 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 catName, displayName, catID, parentID 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 catName, displayName, catID, parentID 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);
$mobile = $admin_res['mobile'];
$city = $admin_res['city'];
$state = $admin_res['state'];
$country = $admin_res['country'];
$companyName = $admin_res['companyName'];
$address = $admin_res['address'];
$multi_image = explode(',', $cat_res['multi_image']);

if ($cat_res['catImage'] != '') {
    $imglink = getImage($cat_res[catImage], 498, 498, $cat_res[catName], "/uploaded-files/category/images/");
} else {
    $imglink = getImage("noimage.jpg", 498, 498, "noimages", "/uploaded-files/category/images/");
}
if ($cat_res['keyword1'] != '' && $cat_res['keyword2'] != '' && $cat_res['keyword3'] != '') {
    // echo "3";
    // exit;
    $m_title = "hotkeyword1 in state, hotkeyword2 Services, Suppliers Exporters in country";
    $page_metatitle = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2],  str_replace('state', $admin_res[targetlocation], str_replace('country', $admin_res[country], $m_title))));
    $m_keyword = "hotkeyword1 in state, hotkeyword2 in state, hotkeyword3 in state, hotkeyword1 Services in state, hotkeyword2 Services in state, hotkeyword3 Services in state, hotkeyword1 Suppliers in state, hotkeyword2 Suppliers in state, hotkeyword1 Exporters in state, hotkeyword2 Exporters in state";
    $page_metakey = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2], str_replace('hotkeyword3', $cat_res[keyword3], str_replace('state', $admin_res[targetlocation], $m_keyword))));
    $m_desc = "companyName leading hotkeyword1 Services in state, Since 1998. Premium Quality hotkeyword2 Suppliers Exporters in country, Get latest factory price for hotkeyword3. Call phone, ✓Fast Delivery ✓Good Price ✓Premium Quality";
    $page_metadesc = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2], str_replace('companyName', $admin_res[companyName], str_replace('phone', $admin_res[mobile_meta], str_replace('hotkeyword3', $cat_res[keyword3], str_replace('state', $admin_res[targetlocation], str_replace('country', $admin_res[state], $m_desc)))))));
} else if ($cat_res['keyword1'] != '' && $cat_res['keyword2'] != '') {
    // echo "2";
    // exit;
    $m_title = "hotkeyword1 in state, hotkeyword2 Services, Suppliers Exporters in country";
    $page_metatitle = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2],  str_replace('state', $admin_res[targetlocation], str_replace('country', $admin_res[country], $m_title))));
    $m_keyword = "hotkeyword1 in state, hotkeyword2 in state, hotkeyword1 Services in state, hotkeyword2 Services in state, hotkeyword1 Suppliers in state, hotkeyword2 Suppliers in state, hotkeyword1 Exporters in state, hotkeyword2 Exporters in state";
    $page_metakey = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2],  str_replace('state', $admin_res[targetlocation], $m_keyword)));
    $m_desc = "companyName leading hotkeyword1 Services in state, Since 1998. Premium Quality hotkeyword2 Suppliers Exporters in India, Get latest factory price for hotkeyword1. Call phone, ✓Fast Delivery ✓Good Price ✓Premium Quality";
    $page_metadesc = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2], str_replace('companyName', $admin_res[companyName], str_replace('phone', $admin_res[mobile_meta], str_replace('state', $admin_res[targetlocation], str_replace('country', $admin_res[state], $m_desc))))));
} else if ($cat_res['keyword1'] != '') {
    // echo "1";
    // exit;
    $m_title = "hotkeyword1 in state, hotkeyword1 Services, Suppliers Exporters in country";
    $page_metatitle = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('state', $admin_res[targetlocation], str_replace('country', $admin_res[country], $m_title)));
    $m_keyword = "hotkeyword1 in state, hotkeyword1 Services in state, hotkeyword1 Suppliers in state, hotkeyword1 Exporters in state";
    $page_metakey = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('state', $admin_res[targetlocation], $m_keyword));
    $m_desc = "companyName leading hotkeyword1 Services in state, Since 1998. Premium Quality hotkeyword1 Suppliers Exporters in country, Get latest factory price for hotkeyword1. Call phone, ✓Fast Delivery ✓Good Price ✓Premium Quality";
    $page_metadesc = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('companyName', $admin_res[companyName], str_replace('phone', $admin_res[mobile_meta], str_replace('state', $admin_res[targetlocation], str_replace('country', $admin_res[state], $m_desc)))));
} else {
    // echo "0";
    // exit;
    $page_metatitle = $cat_res['pageTitle'];
    $page_metakey = $cat_res['pageKeywords'];
    $page_metadesc = $cat_res['pageDescription'];
}


if ($cat_res['headingh1'] != '') {
    $heading1 = $cat_res['headingh1'];
} else {
    $heading1 = $disTitles;
}

if ($cat_res['headingh2'] != '') {
    $heading2 = $cat_res['headingh2'] . ' in ' . $admin_res['targetlocation'];
} else {
    $heading2 = $disTitles . ' Services in ' . $admin_res['targetlocation'];
}

if ($cat_res['alttag'] != '') {
    $alttag = $cat_res['alttag'] . ' Services in ' . $admin_res['targetlocation'];
} else {
    $alttag = $disTitles . ' Services in ' . $admin_res['targetlocation'];
}

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">

        <?php include "app_top.php"; ?>
    </head>

    <body>

        <?php include "app_header.php"; ?>
        <?php
        if ($cat_res['catBanner'] != '') { ?>
            <div class="heading_banner" style="background-image: url(<?= site_url; ?>/uploaded-files/category/banners/<?php echo $cat_res['catBanner']; ?>)" title="<?php echo $cat_res['displayName']; ?> in <?= $admin_res['targetlocation']; ?>">
            <?php } else { ?>
                <div class="heading_banner" style="background-image: url(<?= site_url; ?>/designer/images/category-banner.webp)" title="<?php echo $cat_res['displayName']; ?> in <?= $admin_res['targetlocation']; ?>">
                <?php } ?>
                <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"><?= $heading1; ?></h1>
                            <div class="clearfix"></div>
                            <div class="cat_title2"><?= $cat_res['tagline']; ?></div>

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

                <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>
                                    <?php if ($num4 > 0) { ?>
                                        <li><a href="<?= site_url; ?>/<?= getValidFileName($cat_res4['catName']); ?>.htm"
                                                title="<?php echo $cat_res4['catName']; ?> "><?php echo $cat_res4['catName']; ?></a>
                                        </li>
                                    <?php } ?>
                                    <?php if ($num3 > 0) { ?>
                                        <li><a href="<?= site_url; ?>/<?= getValidFileName($cat_res3['catName']); ?>.htm"
                                                title="<?php echo $cat_res3['catName']; ?>"><?php echo $cat_res3['catName']; ?></a>
                                        </li>
                                    <?php } ?>
                                    <?php if ($num2 > 0) {

                                    ?>
                                        <li>
                                            <?php if ($cat_res2['catID'] == '1') { ?>
                                                <a href="javascript:void()"
                                                    title="<?php echo $cat_res2['catName']; ?>"><?php echo $cat_res2['catName']; ?></a>
                                            <?php } else {  ?>
                                                <a href="<?= site_url; ?>/<?= getValidFileName($cat_res2['catName']); ?>.htm"
                                                    title="<?php echo $cat_res2['catName']; ?>"><?php echo $cat_res2['catName']; ?></a>
                                            <?php } ?>
                                        </li>
                                    <?php  } ?>
                                    <li class="active"><?php echo $cat_res['catName']; ?></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>

                <section class="category_page">
                    <div class="container">
                        <h2 class="catTitle_2"><?= $heading2; ?> </h2>
                        <div class="clearfix"></div>
                        <div class="row">
                            <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                                <div class="wps_right">
                                    <div class="product_right_image">
                                        <a href="javascript:void(0);" data-bs-toggle="modal" data-bs-target="#productID" onclick="$('.catID').val('<?php echo $cat_res['catID']; ?>');
                                        $('.catName').html('<?php echo $cat_res['catName']; ?>');
                                        $('.catImg').attr('src','<?= $imglink; ?>');  $('.catImg').attr('alt','<?= $alttag; ?>'); $('.catImg').attr('title','<?= $alttag; ?>');"
                                            title="<?= $alttag; ?>">
                                            <div class="detail_image">
                                                <img src="<?= $imglink; ?>" alt="<?= $alttag; ?>"
                                                    title="<?= $alttag; ?>">
                                            </div>
                                            <span class="read_more_btn">
                                                <span>
                                                    <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"></path>
                                                    </svg> Consult with Dr. Riddhe Sshilpi
                                                </span>
                                            </span>
                                        </a>
                                    </div>
                                    <?php echo html_entity_decode($page_desc); ?>

                                    <div class="row">
                                        <?php $gallery_122 = mysqli_query($GLOBALS['dbconn'], "select gallery_image,gallery_title,image_name,id from catgallery_tbl where FIND_IN_SET('" . $cat_res['catID'] . "',gallery_cat) order by id ASC limit 0,6");

                                        while ($gallery_res1 = mysqli_fetch_assoc($gallery_122)) {
                                            $galImg = getImage($gallery_res1[gallery_image], 380, 285, $gallery_res1[gallery_title] . $gallery_res1[id], "/uploaded-files/gallery/");
                                            $galImg1 = getImage($gallery_res1[gallery_image], 1200, 900, $gallery_res1[galery_title] . $gallery_res1[id], "/uploaded-files/gallery/");
                                        ?>

                                            <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-6 col-sm-6 col-12">
                                                <a data-fancybox="photo-gallery" href="<?= $galImg1; ?>" title="<?= $gallery_res1['gallery_title']; ?>">
                                                    <div class="productGallery2">
                                                        <img src="<?= $galImg; ?>" alt="<?= $gallery_res1['gallery_title']; ?>" title="<?= $gallery_res1['gallery_title']; ?>">
                                                    </div>
                                                </a>
                                            </div>
                                        <?php } ?>

                                    </div>


                                    <h3 class="title_2">Services Provided by <?= $admin_res['name']; ?></h3>
                                    <div class="maxWidth">
                                        <p>Explore our expert numerology and vastu services, offering personalized guidance and cosmic insights to illuminate your path.</p>
                                    </div>
                                    <div class="clearfix"></div>

                                    <div class="row astrologyGrid">
                                        <div class="col-xl-3 col-lg-3 col-md-3 col-sm-6 grid5 col-6">
                                            <div class="benefitsItem">
                                                <div class="benefitsItemInfo">
                                                    <div class="benefitsItemIcon">
                                                        <img src="<?= site_url; ?>/designer/images/horoscope.png" alt="Horoscope Analysis" title="Horoscope Analysis">
                                                    </div>
                                                    <h4 class="tp-service-2-title">Horoscope Analysis</h4>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-xl-3 col-lg-3 col-md-3 col-sm-6 grid5 col-6">
                                            <div class="benefitsItem">
                                                <div class="benefitsItemInfo">
                                                    <div class="benefitsItemIcon">
                                                        <img src="<?= site_url; ?>/designer/images/birth.png" alt="Birth Chart Analysis" title="Birth Chart Analysis">
                                                    </div>
                                                    <h4 class="tp-service-2-title">Birth Chart Analysis</h4>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-xl-3 col-lg-3 col-md-3 col-sm-6 grid5 col-6">
                                            <div class="benefitsItem">
                                                <div class="benefitsItemInfo">
                                                    <div class="benefitsItemIcon">
                                                        <img src="<?= site_url; ?>/designer/images/Kundali-Matching.png" alt="Kundali Matching" title="Kundali Matching">
                                                    </div>
                                                    <h4 class="tp-service-2-title">Kundali Matching</h4>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-xl-3 col-lg-3 col-md-3 col-sm-6 grid5 col-6">
                                            <div class="benefitsItem">
                                                <div class="benefitsItemInfo">
                                                    <div class="benefitsItemIcon">
                                                        <img src="<?= site_url; ?>/designer/images/portfolio.png" alt="Career Problems" title="Career Problems">
                                                    </div>
                                                    <h4 class="tp-service-2-title">Career Problems</h4>
                                                </div>
                                            </div>
                                        </div>


                                        <div class="col-xl-3 col-lg-3 col-md-3 col-sm-6 grid5 col-6">
                                            <div class="benefitsItem">
                                                <div class="benefitsItemInfo">
                                                    <div class="benefitsItemIcon">
                                                        <img src="<?= site_url; ?>/designer/images/Vastu-Consultation.png" alt="Vastu Consultation" title="Vastu Consultation">
                                                    </div>
                                                    <h4 class="tp-service-2-title">Vastu Consultation</h4>
                                                </div>
                                            </div>
                                        </div>

                                        

                                    </div>



                                    <div class="you_may">All Services</div>
                                    <div class="allListing">


                                        <?php

                                        if (mysqli_num_rows($cat_qry) > 1) {

                                            $subcat_sql = $cat_qry;
                                        } else {

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

                                            if (mysqli_num_rows($sqlsub2) > 1) {



                                                $subcat_sql = $sqlsub2;
                                            } else {



                                                $subcat_sql = mysqli_query($GLOBALS['dbconn'], "select catImage, catName, displayName, catDesc, catID, catDesc1, parentID from category_tbl where parentID ='1' and status='Y' and catID!='$category_id' order by catOrder Asc");
                                            }
                                        }
                                        while ($sub_res = mysqli_fetch_array($subcat_sql)) {
                                            if ($sub_res['catImage'] != '') {
                                                $img_link = getImage($sub_res[catImage], 375, 375, $sub_res[catName], "/uploaded-files/category/images/");
                                                $img_link1 = getImage($sub_res[catImage], 375, 375, $sub_res[catName], "/uploaded-files/category/images/");
                                            } else {
                                                $img_link = getImage("noimage.jpg",  375, 375, "noimages", "/uploaded-files/category/images/");
                                                $img_link1 = getImage("noimage.jpg", 375, 375, "noimages", "/uploaded-files/category/images/");
                                            }
                                            $sub_desc = $sub_res['catDesc'];
                                            $sub_desc = str_ireplace('{companyName}', $admin_res['companyName'], $sub_desc);
                                            if ($sub_res['alttag'] != '') {
                                                $alttag1 = $sub_res['alttag'] . ' in ' . $ca_nam1;
                                            } else {
                                                if ($sub_res['catID'] == '7' || $sub_res['parentID'] == '7' || $sub_res['catID'] == '64' || $sub_res['parentID'] == '64') {
                                                    $alttag1 = $sub_res['catName'] . ' in ' . $admin_res['targetlocation'];
                                                } else {
                                                    $alttag1 = $sub_res['catName'] . ' Manufacturers in ' . $admin_res['targetlocation'];
                                                }
                                            }
                                        ?>

                                            <div class="product_listing">
                                                <div class="row">
                                                    <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-4 col-sm-5 col-12">
                                                        <div class="product">
                                                            <a href="<?= site_url; ?>/<?= getValidFileName($sub_res['catName']); ?>.htm" title="<?= $sub_res['displayName']; ?> Services in <?= $admin_res['targetlocation']; ?>">
                                                                <div class="image1">
                                                                    <img src="<?= $img_link; ?>" alt="<?= $sub_res['displayName']; ?> Services in <?= $admin_res['targetlocation']; ?>" title="<?= $sub_res['displayName']; ?> Services in <?= $admin_res['targetlocation']; ?>">
                                                                </div>
                                                            </a>
                                                        </div>
                                                    </div>
                                                    <div class="col-xxl-8 col-xl-8 col-lg-8 col-md-8 col-sm-7 col-12">
                                                        <div class="right-content">
                                                            <h4 class="productTitle"><a href="<?= site_url; ?>/<?= getValidFileName($sub_res['catName']); ?>.htm" title="<?= $sub_res['displayName']; ?> Services in <?= $admin_res['targetlocation']; ?>"><?= $sub_res['displayName']; ?></a></h4>
                                                            <div class="blue-line1"></div>
                                                            <div class="more_info">
                                                                <p><?= html_entity_decode($sub_desc); ?></p>

                                                            </div>

                                                            <div class="clearfix"></div>
                                                            <a class="read_more_btn quoteBtn" href="javascript:void(0);" data-bs-toggle="modal" data-bs-target="#productID" 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']; ?> Services in <?= $admin_res['targetlocation']; ?>'); $('.catImg').attr('title','<?= $sub_res['displayName']; ?> Services in <?= $admin_res['targetlocation']; ?>');" title=" Consult with Dr. Riddhe Sshilpi">
                                                                <span><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> Consult with Dr. Riddhe Sshilpi</span></a>

                                                            <a href="<?= site_url; ?>/<?= getValidFileName($sub_res['catName']); ?>.htm" class="read_more_btn" title="Read More"><span> Read More <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                                                                        <path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"></path>
                                                                    </svg></span></a>

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



                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
                <?php include 'award_video.php'; ?>
                <?php include "app_testimonials.php"; ?>
                <?php include "app_faq.php"; ?>
                <?php include "app_footer.php"; ?>
                <?php include "app_bottom.php"; ?>

    </body>

    </html>


<?php
} else {
    header("Location: " . site_url);
    exit;
}
?>