<?php
include("admin/connection.php");
function path()
{
    echo 'https://demo-server.wedigitalindia.in/NDWeMake/';
}
// meta tag
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://demo-server.wedigitalindia.in/NDWeMake/'; // 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);

?>
<!-- header -->
<?php
$query = "SELECT * FROM `header` LIMIT 1";
$sql = mysqli_query($con, $query);
$row = mysqli_fetch_assoc($sql);
?>

<!doctype html>
<html class="no-js" lang="zxx">

<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">

    <title>ND We Make | uPVC Doors & Windows Manufacturer in India</title>

    <meta name="author" content="ND We Make Pvt Ltd">
    <meta name="description"
        content="ND We Make is a trusted manufacturer and supplier of premium uPVC doors and windows in India. We provide durable, stylish, and energy-efficient solutions for residential and commercial spaces." />
    <meta name="keywords"
        content="ND We Make, uPVC windows, uPVC doors, uPVC manufacturer, windows supplier, doors supplier, sliding windows, casement windows, uPVC India" />
    <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/favicons/favicon.png" />

    <link rel="manifest" href="<?php path() ?>/assets/img/favicons/manifest.json">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-TileImage" content="<?php path() ?>/assets/img/favicons/ms-icon-144x144.png">
    <meta name="theme-color" content="#ffffff">
    <link rel="preconnect" href="<?php path() ?>/https://fonts.googleapis.com/">
    <link rel="preconnect" href="<?php path() ?>/https://fonts.gstatic.com/">
    <link
        href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&amp;family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&amp;display=swap"
        rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
    <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">
</head>

<body class="home-2">

    <div class="th-menu-wrapper">
        <div class="th-menu-area text-center"><button class="th-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="Piller-html"
                        style="height: 65px;"></a></div>
            <div class="th-mobile-menu">
                <ul>
                    <li><a href="<?php path() ?>/index.php">Home</a></li>
                    <li><a href="<?php path() ?>/about.php">About Us</a></li>

                    <?php
                    $ser = mysqli_query($con, "SELECT * FROM `upvc_door`");
                    if (mysqli_num_rows($ser) > 0) {
                    ?>
                    <li class="menu-item-has-children">
                        <a href="#">UPVC Doors</a>
                        <ul class="sub-menu">
                            <?php while ($rowd = mysqli_fetch_array($ser)) {
                                    $title = $rowd['title'];
                                    $slug = $rowd['slug'];
                                ?>
                            <li>
                                <a
                                    href="<?php path(); ?>/upvc-door-details.php?slug=<?php echo htmlspecialchars($slug); ?>">
                                    <?php echo htmlspecialchars($title); ?>
                                </a>
                            </li>
                            <?php } ?>
                        </ul>
                    </li>
                    <?php
                    }
                    ?>

                    <?php
                    $ser = mysqli_query($con, "SELECT * FROM `upvc_window`");
                    if (mysqli_num_rows($ser) > 0) {
                    ?>
                    <li class="menu-item-has-children">
                        <a href="#">UPVC Window</a>
                        <ul class="sub-menu">
                            <?php while ($roww = mysqli_fetch_array($ser)) {
                                    $title = $roww['title'];
                                    $slug = $roww['slug'];
                                ?>
                            <li>
                                <a
                                    href="<?php path(); ?>/upvc-window-details.php?slug=<?php echo htmlspecialchars($slug); ?>">
                                    <?php echo htmlspecialchars($title); ?>
                                </a>
                            </li>
                            <?php } ?>
                        </ul>
                    </li>
                    <?php
                    }
                    ?>
                    <?php
                    $ser = mysqli_query($con, "SELECT * FROM `aluminium`");
                    if (mysqli_num_rows($ser) > 0) {
                    ?>
                    <li class="menu-item-has-children">
                        <a href="#">Aluminium Systems</a>
                        <ul class="sub-menu">
                            <?php while ($roww = mysqli_fetch_array($ser)) {
                                    $title = $roww['title'];
                                    $slug = $roww['slug'];
                                ?>
                            <li>
                                <a
                                    href="<?php path(); ?>/aluminium-product-details.php?slug=<?php echo htmlspecialchars($slug); ?>">
                                    <?php echo htmlspecialchars($title); ?>
                                </a>
                            </li>
                            <?php } ?>
                        </ul>
                    </li>
                    <?php
                    }
                    ?>


                    <!-- Home & Interior Solutions -->
                    <li class="menu-item-has-children">
                     <a href="#">Home Decor</a>
                     <ul class="sub-menu">
                         <li><a href="homedecor.php?section=kitchen-wardrobe">Kitchen Wardrobe & TV
                                 Cabinet</a></li>
                         <li><a href="homedecor.php?section=residential-doors">Residential &
                                 Commercial Doors</a></li>
                         <li><a href="homedecor.php?section=home-automation">Home Automation</a></li>
                     </ul>
                    </li>

                    <!-- Architecture & Design Services -->
                    <li class="menu-item-has-children">
                        <a href="#">Architecture </a>
                        <ul class="sub-menu">
                            <li><a href="#">Interior Design Service</a></li>
                            <li><a href="#">Architectural Planning</a></li>
                            <li><a href="#">Collaboration & Builder Support</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">Images</a></li>
                            <li><a href="<?php path() ?>/video.php">Videos</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>


    <header class="th-header header-default">
        <div class="header-top">
            <div class="container th-container3">
                <div class="row justify-content-center justify-content-lg-between align-items-center gy-2">
                    <div class="col-auto d-none d-lg-block">
                        <div class="header-links">
                            <ul>
                                <?php
                                $fullEmail = $row['email'] ?? '';
                                $firstEmailOnly = explode('<br', $fullEmail)[0];
                                $firstEmailOnly = explode(',', $firstEmailOnly)[0];
                                $firstEmailOnly = trim(strip_tags($firstEmailOnly));
                                ?>
                                <li>
                                    <i class="fa-solid fa-envelope"></i> <a
                                        href="mailto:<?php echo htmlspecialchars($firstEmailOnly); ?>">
                                        <?php echo htmlspecialchars($firstEmailOnly); ?></a>
                                </li>

                                <?php
                                $fullPhone = $row['phone'] ?? '';
                                $firstPhoneOnly = explode(',', $fullPhone)[0];
                                $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>
                            </ul>
                        </div>
                    </div>
                    <div class="col-auto">
                        <div class="header-links">
                            <ul>
                                <li>
                                    <div class="th-social">
                                        <a href="https://www.facebook.com/"><i class="fab fa-facebook-f"></i></a>
                                        <a href="https://www.facebook.com/"><i class="fa-brands fa-instagram"></i></a>
                                        <a href="https://www.twitter.com/"><i class="fa-brands fa-x-twitter"></i></a>
                                        <a href="https://www.linkedin.com/"><i class="fab fa-linkedin-in"></i></a>
                                        <a href="https://www.whatsapp.com/"><i class="fa-brands fa-youtube"></i></a>
                                    </div>
                                </li>
                                <li class="lang-wrapper">
                                    <div class="btn-group justify-content-center">
                                        <a href="assets/img/about/website-homepage.pdf" class="th-btn style2 pill"
                                            download style="color: white;">
                                            <i class="fa fa-download me-2" aria-hidden="true"></i> Download Brochure
                                        </a>
                                    </div>

                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="sticky-wrapper">
            <div class="menu-area">
                <div class="container th-container3">
                    <div class="row align-items-center justify-content-between">
                        <div class="col-auto">
                            <div class="header-logo"><a href="<?php path() ?>/index.php">
                                    <img src="<?php path(); ?>/admin/assets/images/slider/<?php echo $row['logo']; ?>"
                                        alt="Piller-html"></a></div>
                        </div>
                        <div class="col-auto">
                            <nav class="main-menu d-none d-lg-inline-block">
                                <ul>

                                    <li><a href="<?php path() ?>/index.php">Home</a></li>
                                    <li><a href="<?php path() ?>/about.php">About Us</a></li>
                                    <!-- door -->

                                    <li class="menu-item-has-children"><a href="index.php">uPVC Doors & Windows</a>
                                        <ul class="sub-menu">

                                            <!-- UPVC Doors -->
                                            <li class="menu-item-has-children"><a href="#">UPVC Doors</a>
                                                <ul class="sub-menu">
                                                    <?php
                                        $door_query = mysqli_query($con, "SELECT title, slug FROM upvc_door ORDER BY id ASC");
                                        if(mysqli_num_rows($door_query) > 0){
                                            while($door = mysqli_fetch_assoc($door_query)){
                                                echo '<li><a href="upvc-door-details.php?slug='.$door['slug'].'">'.$door['title'].'</a></li>';
                                            }
                                        } else {
                                            echo '<li><a href="#">No Doors Found</a></li>';
                                        }
                                        ?>
                                                </ul>
                                            </li>

                                            <!-- UPVC Windows -->
                                            <li class="menu-item-has-children"><a href="#">UPVC Windows</a>
                                                <ul class="sub-menu">
                                                    <?php
                                            $window_query = mysqli_query($con, "SELECT title, slug FROM upvc_window ORDER BY id ASC");
                                            if(mysqli_num_rows($window_query) > 0){
                                                while($window = mysqli_fetch_assoc($window_query)){
                                                    echo '<li><a href="upvc-windows-details.php?slug='.$window['slug'].'">'.$window['title'].'</a></li>';
                                                }
                                            } else {
                                                echo '<li><a href="#">No Windows Found</a></li>';
                                            }
                                            ?>
                                                </ul>
                                            </li>

                                        </ul>
                                    </li>


                                    <!-- Aluminium  Products -->
                                    <li class="menu-item-has-children"><a href="#">Aluminium Products</a>
                                        <ul class="sub-menu">
                                            <?php
                                            $window_query = mysqli_query($con, "SELECT title, slug FROM aluminium ORDER BY id ASC");
                                            if(mysqli_num_rows($window_query) > 0){
                                                while($window = mysqli_fetch_assoc($window_query)){
                                                    echo '<li><a href="aluminium-product-details.php?slug='.$window['slug'].'">'.$window['title'].'</a></li>';
                                                }
                                            } else {
                                                echo '<li><a href="#">No Windows Found</a></li>';
                                            }
                                            ?>
                                        </ul>
                                    </li>




                                    <li class="menu-item-has-children">
                                        <a href="#">Home Decor</a>
                                        <ul class="sub-menu">
                                            <li><a href="homedecor.php?section=kitchen-wardrobe">Kitchen Wardrobe & TV
                                                    Cabinet</a></li>
                                            <li><a href="homedecor.php?section=residential-doors">Residential &
                                                    Commercial Doors</a></li>
                                            <li><a href="homedecor.php?section=home-automation">Home Automation</a></li>
                                        </ul>
                                    </li>


                                    <!-- Architecture & Design Services -->
                                    <li class="menu-item-has-children">
                                        <a href="#">Architecture </a>
                                        <ul class="sub-menu">
                                            <li><a href="#">Interior Design Service</a></li>
                                            <li><a href="#">Architectural Planning</a></li>
                                            <li><a href="#">Collaboration & Builder Support</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">Images</a></li>
                                            <li><a href="<?php path() ?>/video.php">Videos</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>
                            <button type="button" class="th-menu-toggle d-block d-lg-none"><i
                                    class="far fa-bars"></i></button>
                        </div>

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