<?php
include("admin/connection.php");
function path()
{
    echo 'https://glamglitter.wedigitalindia.in/';
}

ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);

$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
// echo $actual_link;exit;
$host = $_SERVER['HTTP_HOST'];
$currentURL = $_SERVER['REQUEST_URI'];


if (strpos($currentURL, 'index') !== false) {
    $redirectURL = 'https://glamglitter.wedigitalindia.in/'; // Change this URL to your desired destination
    header('Location: ' . $redirectURL);
    // exit;
}

$query = "SELECT * FROM meta_tag WHERE url='$actual_link'  ";
$meta_all = mysqli_query($con, $query);
$metaRow = mysqli_fetch_array($meta_all);
?>
<?php
$query = "SELECT * FROM `header` LIMIT 1";
$sql = mysqli_query($con, $query);
$row = mysqli_fetch_assoc($sql);
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title><?php echo isset($metaRow['meta_title']) ? $metaRow['meta_title'] : 'Glam & Glitter Unisex Studio'; ?></title>
    <meta name="author" content="Vecuro">
    <meta name="description" content="<?php echo isset($metaRow['description']) ? htmlspecialchars(strip_tags($metaRow['description'])) : 'Default site description.'; ?>">
    <meta name="keywords" content="<?php echo isset($metaRow['meta_key']) ? $metaRow['meta_key'] : 'Default, Keywords'; ?>">

    <meta name="robots" content="INDEX,FOLLOW">
    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
    <link rel="shortcut icon" href="<?php path() ?>/assets/img/favicon.png" type="image/x-icon">
    <link rel="icon" href="<?php path() ?>/assets/img/favicon.png" type="image/x-icon">
    <link rel="preconnect" href="https://fonts.googleapis.com/">
    <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&amp;family=Marcellus&amp;display=swap"
        rel="stylesheet">
    <link rel="stylesheet" href="<?php path() ?>/assets/css/app.min.css">
    <link rel="stylesheet" href="<?php path() ?>/assets/css/fontawesome.min.css">
    <link rel="stylesheet" href="<?php path() ?>/assets/css/style.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">

    <html class="no-js" lang="zxx">
    <meta name="google-site-verification" content="tPNXaLqRIbaETpDTk8D2GyI-pVOOXjsHBLNYDNxdJeA" />
</head>

<svg viewBox="0 0 150 150" class="svg-hidden">
    <path id="textPath" d="M 0,75 a 75,75 0 1,1 0,1 z"></path>
</svg>
<div class="vs-menu-wrapper">
    <div class="vs-menu-area text-center"><button class="vs-menu-toggle"><i class="fal fa-times"></i></button>
        <div class="mobile-logo"><a href="<?php path() ?>/index.php">
                <img src="<?php path(); ?>/admin/assets/images/slider/<?php echo $row['logo']; ?>" alt="makeupbymyra"
                    width="150px"></a>
        </div>
        <div class="vs-mobile-menu">
            <ul>
                <li style="color: #424242;"><a href="<?php path() ?>index.php">Home</a>

                </li>
                <li><a href="<?php path() ?>about.php">About Us</a></li>

                <?php
                // Fetch all top categories
                $top = mysqli_query($con, "SELECT * FROM tbl_top_category ORDER BY t_id DESC");

                if (mysqli_num_rows($top) > 0) {
                ?>
                    <li class="menu-item-has-children"><a href="">Services</a>
                        <ul class="sub-menu">
                            <?php
                            while ($roww = mysqli_fetch_assoc($top)) {

                                // Prevent XSS
                                $cat_name = htmlspecialchars($roww['cat_name'], ENT_QUOTES, 'UTF-8');
                                $slug     = htmlspecialchars($roww['slug'], ENT_QUOTES, 'UTF-8');
                            ?>
                                <li><a href="<?php echo path(); ?>service.php?slug=<?php echo $slug; ?>"><?php echo $cat_name; ?></a></li>
                            <?php } ?>
                        </ul>
                    </li>
                <?php } ?>

                <li class="menu-item-has-children"><a href="">Packages</a>
                    <ul class="sub-menu">
                        <li><a href="<?php path() ?>men_packages.php">Men</a></li>
                        <li><a href="<?php path() ?>women_packages.php">Women</a></li>
                        <!-- <li><a href="<?php path() ?>member_packages.php">Membership</a></li> -->
                    </ul>
                </li>

                <!-- <li><a href="#">Academy</a></li> -->
                <li class="menu-item-has-children"><a href="#">Gallery</a>
                    <ul class="sub-menu">
                        <li><a href="<?php path() ?>gallery.php">Image</a></li>
                        <li><a href="<?php path() ?>video.php">Video</a></li>

                    </ul>
                </li>
                <li><a href="<?php path() ?>blog.php">Blog</a></li>
                <li><a href="<?php path() ?>contact.php">Contact Us</a></li>
            </ul>
        </div>
    </div>
</div>
<div class="sidemenu-wrapper d-none d-lg-block">
    <div class="sidemenu-content"><button class="closeButton sideMenuCls"><i class="fa fa-close"></i></button>
        <div class="widget">
            <div class="footer-logo">
                <img src="<?php path(); ?>/admin/assets/images/slider/<?php echo $row['logo']; ?>" alt="logo" width="150px">
            </div>
            <div class="info-media1">
                <div class="media-icon">
                    <i class="fa-solid fa-location-dot"></i>
                </div>
                <span class="media-label"><?php echo $row['address']; ?></span>
            </div>
            <div class="info-media1">
                <div class="media-icon"><i class="fa-solid fa-phone"></i></div><span class="media-label"><a
                        href="tel:+919667596759" class="text-inherit"><?php echo $row['phone']; ?></a></span>
            </div>
            <d iv class="info-media1">
                <div class="media-icon"><i class="fa-solid fa-envelope"></i></div><span class="media-label"><a
                        class="text-inherit" href="mailto:info@myraluxe.com"><?php echo $row['email']; ?></a></span>
        </div>
    </div>

</div>
</div>

<header class="vs-header header-layout1">
    <div class="header-top">
        <div class="container-fluid">
            <div class="row justify-content-center justify-content-md-between align-items-center"
                style="background-color:white;">
                <div class="col-auto text-center py-2 py-md-0">
                    <div class="header-links style-white">
                        <ul>

                            <?php
                            // Split by <br or <br/> or <br /> safely
                            $firstPhoneOnly = explode('<br', $row['phone'])[0];

                            // Clean for tel link (digits only)
                            $cleanTel = preg_replace('/\D/', '', $firstPhoneOnly);
                            ?>
                            <li>
                                <i class="fa-solid fa-phone"></i><a href="tel:+91<?php echo $cleanTel; ?>">
                                    <?php echo htmlspecialchars(trim($firstPhoneOnly)); ?></a>

                            </li>
                            <?php
                            // Split the email string by <br> (or any similar tag)
                            $firstEmailOnly = explode('<br', $row['email'])[0];
                            $firstEmailOnly = trim(strip_tags($firstEmailOnly)); // Remove HTML and whitespace
                            ?>
                            <li><i class="fa-solid fa-envelope"></i><a href="mailto:<?php echo htmlspecialchars($firstEmailOnly); ?>">
                                    <?php echo htmlspecialchars($firstEmailOnly); ?></a>

                            </li>

                        </ul>
                    </div>
                </div>
                <div class="col-auto d-none d-md-block">
                    <div class="social-style1">
                        <a href="https://www.facebook.com/profile.php?id=61577090445235&mibextid=kFxxJD">
                            <i class="fab fa-facebook-f"></i></a>

                        <a href="https://www.instagram.com/myraluxe_salonand_academy?igsh=MTBtaXB3aXU2c280Zg==">
                            <i class="fab fa-instagram"></i></a>
                        <a href="#"><i class="fa-brands fa-x-twitter"></i></a>
                        <a href="https://www.linkedin.com/company/myraluxe-salon-and-academy/?viewAsMember=true"><i class="fab fa-linkedin-in"></i></a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <style>
        .sticky {
            position: fixed;
            top: 0;
            width: 100%;
        }

        .sticky+.content {
            padding-top: 102px;
        }
    </style>
    <div class="sticky-wrap" id="sticky-wrap">
        <div class="sticky-active">
            <div class="container-fluid">
                <div class="row justify-content-between align-items-center gx-60" style="background-color:#000000">
                    <div class="col">
                        <div class="header-logo"><a href="index.php"><img src="<?php path(); ?>/admin/assets/images/slider/<?php echo $row['logo']; ?>" alt="logo"
                                    width="200px"></a>
                        </div>
                    </div>
                    <div class="col-auto">
                        <nav class="main-menu menu-style1 d-none d-lg-block">
                            <ul>
                                <li style="color: #424242;"><a href="<?php path() ?>/index.php">Home</a>

                                </li>
                                <li><a href="<?php path() ?>about.php">About Us</a></li>
                                <?php
                                // Fetch all top categories
                                $top = mysqli_query($con, "SELECT * FROM tbl_top_category ORDER BY t_id DESC");

                                if (mysqli_num_rows($top) > 0) {
                                ?>
                                    <li class="menu-item-has-children"><a href="">Services
                                            <ul class="sub-menu">
                                                <?php
                                                while ($roww = mysqli_fetch_assoc($top)) {

                                                    // Prevent XSS
                                                    $cat_name = htmlspecialchars($roww['cat_name'], ENT_QUOTES, 'UTF-8');
                                                    $slug     = htmlspecialchars($roww['slug'], ENT_QUOTES, 'UTF-8');
                                                ?>
                                                    <li><a href="<?php echo path(); ?>service.php?slug=<?php echo $slug; ?>"><?php echo $cat_name; ?></a></li>
                                                <?php
                                                }
                                                ?>

                                            </ul>
                                    </li>
                                <?php } ?>

                                <!-- <li><a href="<?php path() ?>">Services</a></li> -->
                                <li class="menu-item-has-children"><a href="">Packages
                                        <ul class="sub-menu">
                                            <li><a href="<?php path() ?>men_packages.php">Men</a></li>
                                            <li><a href="<?php path() ?>women_packages.php">Women</a></li>
                                            <!-- <li><a href="<?php path() ?>member_packages.php">Membership</a></li> -->
                                        </ul>
                                </li>

                                <li class="menu-item-has-children"><a href="#">Gallery</a>
                                    <ul class="sub-menu">
                                        <li><a href="<?php path() ?>gallery.php">Image</a></li>
                                        <li><a href="<?php path() ?>video.php">Video</a></li>

                                    </ul>
                                </li>
                                <li><a href="<?php path() ?>blog.php">Blog</a></li>
                                <li><a href="<?php path() ?>contact.php">Contact Us</a></li>
                            </ul>
                        </nav>
                    </div>
                    <div class="col-auto">
                        <div class="header-btns">
                            <!-- Book Button -->
                            <a href="#" class="vs-btn style2 d-none d-xl-inline-block" data-bs-toggle="modal"
                                data-bs-target="#enquiryModal">

                                Appointment
                            </a>
                            <button
                                class="bar-btn sideMenuToggler d-none d-xl-inline-block"><span class="bar"></span>
                                <span class="bar"></span> <span class="bar"></span></button> <button
                                class="vs-menu-toggle d-inline-block d-lg-none" type="button"><i
                                    class="fal fa-bars"></i></button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</header>

<body id="top">