<?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 = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
$ee = explode('/', $actual_link);
$mm = $ee[3];
$ss = explode('.', $mm);
$cc = $ss[0];
$cat_url = $cc;
$cat = str_replace("-", " ", $cc);
$cats = ucfirst($cat);
$cat_s = "select catName, catID from category_tbl where catName='$cats' or catUrl='$cat_url'";
$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, alt, title, catDesc1, parentID,catUrl 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,catDesc1,catBanner,keyword1,keyword2,keyword3,catHeading1, catHeading2,alt,pageTitle,pageKeywords,pageDescription,multi_image,catDesc2 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);
$page_desc1 = $cat_res['catDesc2'];
$page_desc1 = str_ireplace('{companyName}', $admin_res['companyName'], $page_desc1);
$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], 500, 500, $cat_res[catName], "/uploaded-files/category/images/");
} else {
    $imglink = getImage("noimage (10).jpg", 500, 500, "noimage", "/uploaded-files/category/images/");
}
if (!empty($cat_res['keyword1']) && !empty($cat_res['keyword2']) && !empty($cat_res['keyword3'])) {
    // echo "3";
    // exit;
    $m_title = "hotkeyword1 Services Mumbai, hotkeyword2 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 Mumbai, hotkeyword1 Services Mumbai, hotkeyword1 in Mumbai, hotkeyword2 in India, hotkeyword2 in India";
    $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 Mumbai, Since 1970. Premium Quality hotkeyword2 in country, Get latest factory price for hotkeyword1. ✓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 Services in Mumbai, hotkeyword2 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,hotkeyword2, hotkeyword1 Services, hotkeyword2 Services, hotkeyword1, hotkeyword2, hotkeyword1 Services in state, hotkeyword2 in India";
    $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 Mumbai, since . Premium Quality hotkeyword2 in India, Get latest factory price for hotkeyword1. ✓Fast Delivery ✓Good Price";
    $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 Services in Mumbai";
    $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 Mumbai, hotkeyword1 Services Mumbai, hotkeyword1 in Mumbai, hotkeyword1 in India, hotkeyword1 in India";
    $page_metakey = str_replace('hotkeyword1', $cat_res['keyword1'], str_replace('state', $admin_res[targetlocation], $m_keyword));
    $m_desc = "companyName leading hotkeyword1 Services in Mumbai, Since 1970. Premium Quality hotkeyword1 in country, Get latest factory price for hotkeyword1. ✓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['catHeading1'] != '') {
//     $heading1 = $cat_res['catHeading1'] . ' Services';
// } else {
//     // Join array into a string
//     $heading1 = explode(',', $page_metatitle)[0];
// }
// if($cat_res['keyword1']!=''){
//     $alttag=$cat_res['keyword1']. ' Suppliers in Delhi ';
// } else{
//     $alttag=$alttag=explode(',',$page_metatitle);
// }
// if ($cat_res['catHeading2'] != '') {
//     $heading2 = $cat_res['catHeading2'] . '<span> in ' . $admin_res['targetlocation'] . '</span>';
// } else {
//     $heading2 = $disTitles . '<span> in ' . $admin_res['targetlocation'] . '</span>';
// }
// if ($cat_res['alt'] != '') {
//     $alttag = $cat_res['alt'] . ' Services in ' . $admin_res['targetlocation'];
// } else {
//     $alttag = $disTitles . ' Services in ' . $admin_res['targetlocation'];
// }
// if ($cat_res['catHeading1'] != '') {
//     $alttag = $cat_res['catHeading1'] . ' Services';
// } else {
//     // Join array into a string
//     $alttag = explode(',', $page_metatitle)[0];
// }
if ($cat_res['catHeading1'] != '') {
    $heading1 = $cat_res['catHeading1'] . ' Services';
} else {
    $heading1 = $disTitles . '' ;
}
if ($cat_res['alttag'] != '') {
    $alttag = $cat_res['alttag'] . ' in ' . $admin_res['targetlocation'];
} else {
    if ($cat_res['catID'] == '8') {
        $alttag = $cat_res['displayName'] . ' in ' . $admin_res['targetlocation'];
    } else {
        $alttag = explode(',', $page_metatitle)[0];
    }
}
if ($cat_res['catHeading2'] != '') {
    $heading2 = $cat_res['catHeading2'] . ' Services';
} else {
    // Join array into a string
    $heading2 = explode(',', $page_metatitle)[0];
}
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 'apps/app_top.php'; ?>
</head>

<body>
    <?php include 'apps/app_header.php'; ?>

    <div class="heading_banner" style="background-image: url(<?=site_url;?>/assets/images/category-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"><?= $heading1; ?></h1>
                    <div class="clearfix"></div>
                    <!-- <div class="cat_title2">Explore the Science of Compatibility</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['displayName']; ?> "><?php echo $cat_res4['displayName']; ?></a>
                            </li>
                        <?php } ?>
                        <?php if ($num3 > 0) { ?>
                            <li><a href="<?= site_url; ?>/<?= getValidFileName($cat_res3['catName']); ?>.htm"
                                    title="<?php echo $cat_res3['displayName']; ?>"><?php echo $cat_res3['displayName']; ?></a>
                            </li>
                        <?php } ?>
                        <?php if ($num2 > 0) { ?>
                            <li><a href="<?= site_url; ?>/<?= getValidFileName($cat_res2['catName']); ?>.htm"
                                    title="<?php echo $cat_res2['displayName']; ?>"><?php echo $cat_res2['displayName']; ?></a>
                            </li>
                        <?php } ?>
                        <li class="active"><?php echo $cat_res['catName']; ?></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <div class="category_page">
        <div class="container">
            <h2 class="title_1"><?= $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">
                            <div 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="Consult With Astrologer">
                                <div class="detail_image">
                                    <img class="img-responsive" src="<?= $imglink; ?>" alt="<?= $alttag; ?>" title="<?= $alttag; ?>">
                                </div>
                                <span class="mainBtn3">
                                    <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 Astrologer
                                    </span>
                              </span>
                            </div>

                        </div>
                        <?php echo html_entity_decode($page_desc); ?>

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

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

                        <?php
                                if (mysqli_num_rows($cat_qry) > 0) {
                                    $subcat_sql = $cat_qry;
                                } else {
                                    $sqlsub2 = mysqli_query($GLOBALS['dbconn'], "select catImage, catName, displayName, catDesc, catID, catDesc1, alt, title, 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, alt, title, catDesc1, parentID from category_tbl  where parentID ='0' 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], 415, 415, $sub_res[catName], "/uploaded-files/category/images/");
                                        $img_link1 = getImage($sub_res[catImage], 415, 415, $sub_res[catName], "/uploaded-files/category/images/");
                                    } else {
                                        $img_link = getImage("noimage (10).jpg",  415, 415, "noimage", "/uploaded-files/category/images/");
                                        $img_link1 = getImage("noimage (10).jpg", 415, 415, "noimage", "/uploaded-files/category/images/");
                                    }
                                    $caturls1 = !empty($sub_res['catUrl']) ? $sub_res['catUrl'] : $sub_res['catName'];
                                    $sub_desc = $sub_res['catDesc'];
                                    $sub_desc = str_ireplace('{companyName}', $admin_res['companyName'], $sub_desc);
                                    if ($sub_res['alt'] != '') {
                                        $alttag1 = $sub_res['alt'] . ' in ' . $admin_res['targetlocation'];
                                    } else {
                                        if ($sub_res['catID'] == '8') {
                                            $alttag1 = $sub_res['displayName'] . ' in ' . $admin_res['targetlocation'];
                                        } else {
                                            $alttag1 = $sub_res['displayName'] . ' in ' . $admin_res['targetlocation'];
                                        }
                                    }


                                    // if (!empty($sub_res['alt'])) {
                                    //     $alttag1 = $sub_res['alt'] . ' in ' . $admin_res['targetlocation'];
                                    // } else {
                                    //     if (!empty($sub_res['page_metatitle'])) {
                                    //         // Use only the first part of the metatitle if it has commas, otherwise use full title
                                    //         $meta_parts = explode(',', $sub_res['page_metatitle']);
                                    //         $alttag1 = trim($meta_parts[0]);
                                    //     } elseif ($sub_res['catID'] == '8') {
                                    //         $alttag1 = $sub_res['displayName'] . ' in ' . $admin_res['targetlocation'];
                                    //     } else {
                                    //         $alttag1 = $sub_res['displayName'] . ' 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($caturls1); ?>.htm" title="<?= $alttag1; ?>">
                                                <div class="image1">
                                                    <img src="<?= $img_link; ?>" alt="<?= $alttag1; ?>"
                                                    title="<?= $alttag1; ?>">
                                                </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="titleH3_1"><a href="<?= site_url; ?>/<?= getValidFileName($caturls1); ?>.htm" title="<?= $alttag1; ?>"><?= $sub_res['displayName']; ?></a></h4>
                                            <div class="blue-line1"></div>
                                            <div class="more_info">
                                                <p><?= $sub_desc; ?></p>

                                            </div>

                                            <div class="buttons">
                                                <button type="button" class="mainBtn3" 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']; ?> in <?= $admin_res['targetlocation']; ?>'); $('.catImg').attr('title','<?= $sub_res['displayName']; ?> in <?= $admin_res['targetlocation']; ?>');" title="Consult With Astrologer">
                                                    <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 Astrologer</span>
                                                </button>

                                                <a href="<?= site_url; ?>/<?= getValidFileName($caturls1); ?>.htm" class="mainBtn4" 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>
                            </div>
                            <?php } ?>
                            
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>



    <div class="shouldConsult">
        <div class="container">
            <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12">

                <div class="titleLeft2">Why Should You Consult Acharya Vijay Shastri for Astrology?</div>
                <div class="imagesLeft">
                    <img src="<?=site_url;?>/assets/images/astrologer.webp" alt="Why Should You Consult Acharya Vijay Shastri for Astrology?" title="Why Should You Consult Acharya Vijay Shastri for Astrology?">
                </div>
                <p>Choosing the right astrologer can make all the difference when seeking clarity, peace, and purpose. With decades of experience and deep knowledge in Vedic sciences, Acharya Vijay Shastri has become a trusted name in the field of astrology. His compassionate approach, accurate predictions, and customized remedies have helped thousands find direction in love, career, health, and family matters. Whether facing personal dilemmas or seeking cosmic guidance, his insights are rooted in authenticity and spiritual wisdom. Let his guidance be your path to clarity.</p>

                <p><strong>Here&rsquo;s why consulting Acharya Vijay Shastri is a wise decision</strong>:</p>
<ul>
<li><strong>Decades of Experience</strong>: A seasoned astrologer with years of practice in multiple branches of astrology.</li>
<li><strong>Accurate Predictions</strong>: Trusted for precise, life-changing insights backed by traditional methods.</li>
<li><strong>Personalized Remedies</strong>: Offers practical, easy-to-follow remedies tailored to individual needs.</li>
<li><strong>Wide Range of Services</strong>: Expert in Kundali matching, medical astrology, love issues, and more.</li>
<li><strong>Client-Centric Approach</strong>: Listens with empathy and provides solutions that genuinely help.</li>
<li><strong>Spiritual Guidance</strong>: Combines astrology with spiritual wisdom for holistic healing.</li>
</ul>
                <button type="button" class="mainBtn3" data-bs-toggle="modal" data-bs-target="#myModal" title="Consult With Astrologer">
                    <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 Astrologer</span></button>

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


   
  <?php include "apps/app_testimonials.php"; ?>
    <?php include "apps/app_faq.php"; ?>
    <?php include 'apps/app_footer.php'; ?>
    <?php include 'apps/app_bottom.php'; ?>
</body>

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