📁 File Manager
Editing:
/home/wedigitalindia/www/mvskpowdercoating.com/includes/header.php
<?php require_once __DIR__ . "/../data/site.php"; // require_once __DIR__ . "/../data/products.php"; require_once __DIR__ . "/../data/about.php"; $current_page = basename($_SERVER["SCRIPT_NAME"] ?? ""); $product_pages = [ "products.php", "product-category.php", "product.php" ]; require_once __DIR__ . '/../admin/inc/config.php'; $products = []; $sql = " SELECT c.id AS category_id, c.top_category_name AS category, c.top_category_slug AS category_slug, c.banner As category_banner, s.id AS product_id, s.product_name AS product_name, s.product_slug AS product_slug, s.main_image AS main_image FROM tbl_top_category c LEFT JOIN tbl_service s ON s.top_category_id = c.id AND s.status = 1 WHERE c.status = 1 AND c.show_on_menu = 'Yes' AND c.id != 13 ORDER BY c.id ASC, s.id ASC "; $stmt = $pdo->prepare($sql); $stmt->execute(); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); foreach ($rows as $row) { $category_id = $row['category_id']; if (!isset($products[$category_id])) { $products[$category_id] = [ 'category' => $row['category'], 'slug' => $row['category_slug'], 'main_image' => '', 'category_banner' => $row['category_banner'], 'items' => [] ]; } if (!empty($row['product_id'])) { if ( empty($products[$category_id]['main_image']) && !empty($row['main_image']) ) { $products[$category_id]['main_image'] = $row['main_image']; } $products[$category_id]['items'][] = [ 'name' => $row['product_name'], 'slug' => $row['product_slug'] ]; } } $products = array_values($products); $machines = []; $machine_sql = " SELECT id, product_name, product_slug FROM tbl_service WHERE top_category_id = 13 AND status = 1 ORDER BY id ASC "; $machine_stmt = $pdo->prepare($machine_sql); $machine_stmt->execute(); $machines = $machine_stmt->fetchAll(PDO::FETCH_ASSOC); // $host = $_SERVER['HTTP_HOST']; // $currentURL = $_SERVER['REQUEST_URI']; // $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ? "https" : "http"; // $actual_link = $protocol . "://" . $host . $currentURL; // if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') { // echo "<script>window.location.href = 'https://{$host}{$currentURL}';</script>"; // exit; // } // if (strpos($currentURL, 'index') !== false) { // header('Location: http://localhost/mvsk_10-27-26/'); // exit; // } // $stmt = $pdo->prepare("SELECT * FROM meta_tag WHERE page_name = :page_name LIMIT 1"); // $stmt->execute(['page_name' => $actual_link]); // $row = $stmt->fetch(PDO::FETCH_ASSOC); // if ($row) { // $meta_title = $row['meta_title'] ?? ''; // $meta_description = $row['meta_description'] ?? ''; // $meta_keyword = $row['meta_keyword'] ?? ''; // } else { // $path = parse_url($currentURL, PHP_URL_PATH); // $slug = basename($path); // $blog_stmt = $pdo->prepare("SELECT * FROM blogs WHERE slug = :slug LIMIT 1"); // $blog_stmt->execute(['slug' => $slug]); // $blog_row = $blog_stmt->fetch(PDO::FETCH_ASSOC); // if ($blog_row) { // $meta_title = $blog_row['meta_title'] ?? ''; // $meta_description = $blog_row['short_description'] ?? ''; // $meta_keyword = $blog_row['keywords'] ?? ''; // } else { // $meta_title = ''; // $meta_description = ''; // $meta_keyword = ''; // } // } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <!-- <title><?php echo $meta_title; ?></title> <meta name="description" content="<?php echo $meta_description; ?>" /> <meta name="keywords" content="<?php echo $meta_keyword ; ?>"> --> <!-- <link rel="canonical" href="<?php echo $actual_link ?>" /> --> <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=Inter:wght@400;500;600;700&family=Montserrat:wght@500;600;700;800&display=swap" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet"> <link rel="icon" type="image/webp" href="<?= htmlspecialchars( rtrim($site['base_url'], '/') . '/assets/images/mvsk-logo.webp' ) ?>"> <script src="https://www.google.com/recaptcha/api.js" async defer> </script> <link href="<?= $site['base_url'] ?>assets/css/style.css" rel="stylesheet"> <link rel="stylesheet" href="<?= $site['base_url'] ?>assets/css/custom.css"> <!-- Google Search Console Verification --> <meta name="google-site-verification" content="45n5rRCXTuyXfPYHTr96usSzaX4DzpS3PnTClk70FLU" /> <!-- Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-MG0L376K8C"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-MG0L376K8C'); </script> </head> <style> .mega-product-grid > div:nth-child(7) .mega-product-items { height: 90px !important; max-height: 100px !important; overflow-y: auto !important; overflow-x: hidden !important; scrollbar-width: thin; } .mega-product-grid > div:nth-child(7) .mega-product-items::-webkit-scrollbar { width: 4px !important; height: 0 !important; } .mega-product-grid > div:nth-child(7) .mega-product-items::-webkit-scrollbar-button { display: none !important; visibility: hidden !important; opacity: 0 !important; width: 0 !important; height: 0 !important; min-width: 0 !important; min-height: 0 !important; } .about-dropdown { min-width: 220px; padding: 8px 0; border: 0; border-radius: 0 0 10px 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); } .about-dropdown .dropdown-item { padding: 12px 20px; font-size: 15px; font-weight: 500; color: #222; } .about-dropdown .dropdown-item:hover { color: #e91e63; background: #f7f7f7; } .about-menu-parent { position: relative; } .about-dropdown-toggle { display: none; } @media (min-width: 992px) { .about-menu-parent .about-dropdown { display: block !important; position: absolute; top: 100%; left: 0; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(8px); margin-top: 0; z-index: 9999; transition: opacity .2s ease, visibility .2s ease, transform .2s ease; } .about-menu-parent:hover .about-dropdown { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); } } .mega-product-item { display: block !important; position: relative; height: 100%; padding: 14px 14px 9px; background: #fff; } .mega-product-main-link { display: block !important; width: 100%; padding: 0; color: #252525; text-decoration: none !important; } .mega-product-content { display: block !important; width: 100%; } .mega-product-content h4 { display: block; width: 100%; margin: 0 0 4px; color: #252525; font-size: 16px; line-height: 1.3; font-weight: 700; text-transform: uppercase; letter-spacing: -.3px; } .mega-product-items { display: flex !important; flex-direction: column !important; width: 100% !important; gap: 5px; margin: 0; } .mega-product-subitem { display: flex; align-items: center; justify-content: space-between; } .mega-product-subitem span { display: flex; align-items: center; } .mega-product-subitem span::before { content: ""; width: 6px; height: 6px; background: #e51670; border-radius: 50%; margin-right: 9px; flex-shrink: 0; } .mega-product-subitem i { flex-shrink: 0; } .mega-product-subitem:hover { color: #d71963; background: #fff7fa; padding-left: 5px !important; } .machine-menu-parent { position: relative; } .machine-menu-parent .machine-dropdown { min-width: 260px; padding: 8px 0; border: 0; border-radius: 0 0 10px 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); } .machine-menu-parent .machine-dropdown .dropdown-item { padding: 12px 20px; font-size: 15px; font-weight: 500; color: #222; } .machine-menu-parent .machine-dropdown .dropdown-item:hover { color: #e91e63; background: #f7f7f7; } .machine-dropdown-toggle { display: none; } @media (min-width: 992px) { .machine-menu-parent .machine-dropdown { display: block !important; position: absolute; top: 100%; left: 0; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(8px); margin-top: 0; z-index: 9999; transition: opacity .2s ease, visibility .2s ease, transform .2s ease; } .machine-menu-parent:hover .machine-dropdown { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); } } @media (max-width: 991px) { .about-menu-parent, .mega-menu-parent, .machine-menu-parent { display: flex !important; flex-wrap: wrap; align-items: center; width: 100%; } .about-menu-parent > .nav-link, .mega-menu-parent > .nav-link, .machine-menu-parent > .nav-link { flex: 1 1 auto; width: auto; display: flex !important; align-items: center; } .about-menu-parent > .nav-link::after, .mega-menu-parent > .nav-link::after { display: none !important; } .about-dropdown-toggle, .product-dropdown-toggle, .machine-dropdown-toggle { display: flex !important; align-items: center; justify-content: center; width: 42px; height: 42px; padding: 0; margin: 0; border: 0; background: transparent; color: inherit; cursor: pointer; flex: 0 0 42px; } .about-dropdown-toggle i, .product-dropdown-toggle i, .machine-dropdown-toggle i { font-size: 13px; transition: transform .25s ease; } .about-dropdown-toggle.active i, .product-dropdown-toggle.active i, .machine-dropdown-toggle.active i { transform: rotate(180deg); } .about-menu-parent .about-dropdown, .mega-menu-parent .mega-menu, .machine-menu-parent .machine-dropdown { position: static !important; display: none !important; float: none !important; width: 100% !important; min-width: 100% !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; opacity: 1 !important; visibility: visible !important; pointer-events: auto !important; transform: none !important; } .about-menu-parent .about-dropdown { padding: 5px 0 10px 20px !important; } .mega-menu-parent .mega-menu { padding: 10px 0 !important; } .machine-menu-parent .machine-dropdown { padding: 5px 0 10px 20px !important; } .about-menu-parent.active .about-dropdown, .mega-menu-parent.active .mega-menu, .machine-menu-parent.active .machine-dropdown { display: block !important; } #mainNavigation .navbar-nav { max-height: 70vh !important; overflow-y: auto !important; overflow-x: hidden !important; scrollbar-width: thin; scrollbar-color: #d91b68 transparent; } #mainNavigation .navbar-nav::-webkit-scrollbar { width: 4px !important; } #mainNavigation .navbar-nav::-webkit-scrollbar-track { background: transparent !important; } #mainNavigation .navbar-nav::-webkit-scrollbar-thumb { background: #d91b68 !important; border-radius: 10px !important; } #mainNavigation .navbar-nav::-webkit-scrollbar-button { display: none !important; width: 0 !important; height: 0 !important; } } @media (min-width: 992px) { .machine-menu-parent { position: relative; } .machine-dropdown { max-height: 500px !important; height: 500px !important; overflow-y: scroll !important; overflow-x: hidden !important; } .machine-dropdown::-webkit-scrollbar { width: 7px; } .machine-dropdown::-webkit-scrollbar-track { background: #f1f1f1; } .machine-dropdown::-webkit-scrollbar-thumb { background: #999; border-radius: 10px; } } @media (max-width: 991px) { .topbar { position: sticky; top: 0; z-index: 10000; } .site-header { position: sticky; top: 40px; z-index: 9999; } .topbar { display: block !important; width: 100% !important; padding: 15px 4px; } .topbar-inner { display: flex !important; justify-content: center !important; align-items: center !important; } .topbar-contact { display: flex; justify-content: center !important; align-items: center !important; gap: 15px !important; width: 100% !important; } .topbar-contact>span:first-child { display: flex !important; align-items: center !important; font-size: 0 !important; white-space: nowrap !important; } .topbar-contact>span:first-child i { display: inline-block !important; font-size: 12px !important; margin-right: 4px !important; } .topbar-contact>span:first-child::after { content: "+91-9818293370"; font-size: 12px !important; line-height: 1.3 !important; } .topbar-contact>span:nth-child(2) { display: flex !important; align-items: center !important; font-size: 12px !important; white-space: nowrap !important; } .topbar-contact>span:nth-child(2) i { font-size: 12px !important; margin-right: 4px !important; } .topbar-contact>span:nth-child(3) { display: none !important; } .topbar-social { display: none !important; } } </style> <body> <div class="topbar"> <div class="container-fluid px-lg-5"> <div class="topbar-inner"> <div class="topbar-contact"> <!-- <span> <i class="bi bi-geo-alt"></i> <?= htmlspecialchars($site["address"]) ?> </span> --> <span> <i class="bi bi-telephone"></i> <?= htmlspecialchars($site["phone"][0]) ?> / <?= htmlspecialchars($site["phone"][1]) ?> </span> <span> <i class="bi bi-envelope"></i> <?= htmlspecialchars($site["email"][0]) ?> </span> <span> <i class="bi bi-envelope"></i> <?= htmlspecialchars($site["email"][1]) ?> </span> </div> <div class="topbar-social"> <a href="https://www.facebook.com/mvskindustriesllp" aria-label="Facebook"> <i class="bi bi-facebook"></i> </a> <a href="https://www.instagram.com/mvsk_industries_l.l.p" aria-label="Instagram"> <i class="bi bi-instagram"></i> </a> <a href="#" aria-label="LinkedIn"> <i class="bi bi-linkedin"></i> </a> <a href="https://www.youtube.com/" aria-label="YouTube"> <i class="bi bi-youtube"></i> </a> </div> </div> </div> </div> <header class="site-header" id="siteHeader"> <nav class="navbar navbar-expand-lg main-navbar"> <div class="container-fluid px-lg-5"> <a class="navbar-brand" href="<?= $site['base_url'] ?>"> <img src="<?= htmlspecialchars( rtrim($site['base_url'], '/') . '/assets/images/mvsk-logo.webp' ) ?>" alt="MVSK Industries LLP"> </a> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNavigation" aria-controls="mainNavigation" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="mainNavigation"> <ul class="navbar-nav mx-auto align-items-lg-center"> <li class="nav-item"> <a class="nav-link <?= $current_page === "index.php" ? "active" : "" ?>" href="<?= $site['base_url'] ?>"> Home </a> </li> <li class="nav-item dropdown about-menu-parent"> <a class="nav-link dropdown-toggle about-main-link <?= $current_page === "about.php" ? "active" : "" ?>" href="<?= $site['base_url'] ?>about" role="button" aria-expanded="false"> About Us </a> <button type="button" class="about-dropdown-toggle" aria-expanded="false" aria-label="Open About Us menu"> <i class="bi bi-chevron-down"></i> </button> <ul class="dropdown-menu about-dropdown"> <?php foreach ($about_menu as $item): ?> <li> <a class="dropdown-item" href="<?= $site['base_url'] ?><?= htmlspecialchars($item["link"]) ?>"> <?= htmlspecialchars($item["title"]) ?> </a> </li> <?php endforeach; ?> </ul> </li> <li class="nav-item dropdown mega-menu-parent"> <a class="nav-link dropdown-toggle product-main-link <?= in_array($current_page, $product_pages) ? "active" : "" ?>" href="<?= $site['base_url'] ?>products" role="button" aria-expanded="false"> Products </a> <button type="button" class="product-dropdown-toggle d-md-none" aria-expanded="false" aria-label="Open Products menu"> <i class="bi bi-chevron-down"></i> </button> <div class="dropdown-menu mega-menu"> <div class="container-fluid"> <div class="mega-menu-header"> <div> <h3> Our Products </h3> </div> <a href="<?= $site['base_url'] ?>products" class="mega-view-all"> View All Products <i class="bi bi-arrow-right"></i> </a> </div> <div class="row g-0 mega-product-grid"> <?php foreach ($products as $product): ?> <div class="col-lg-4 col-xl-3"> <div class="mega-product-item"> <a href="<?= $site['base_url'] ?>products/<?= urlencode($product["slug"]) ?>" class="mega-product-main-link"> <div class="mega-product-content"> <h4> <?= htmlspecialchars( $product["category"], ENT_QUOTES, "UTF-8" ) ?> </h4> </div> </a> <?php if (!empty($product["items"])): ?> <div class="mega-product-items"> <?php foreach ($product["items"] as $item): ?> <a href="<?= $site['base_url'] ?>products/<?= $product["slug"] . '/' . urlencode($item["slug"]) ?>" class="mega-product-subitem"> <span> <?= htmlspecialchars( $item["name"], ENT_QUOTES, "UTF-8" ) ?> </span> </a> <?php endforeach; ?> </div> <?php endif; ?> </div> </div> <?php endforeach; ?> </div> </div> </div> </li> <li class="nav-item dropdown machine-menu-parent"> <a class="nav-link machine-main-link <?= $current_page === "machines.php" || $current_page === "product.php" ? "active" : "" ?>" href="<?= $site['base_url'] ?>machines"> Our Machines </a> <button type="button" class="machine-dropdown-toggle" aria-expanded="false" aria-label="Open Our Machines menu"> <i class="bi bi-chevron-down"></i> </button> <ul class="dropdown-menu machine-dropdown"> <?php if (!empty($machines)): ?> <?php foreach ($machines as $machine): ?> <li> <a class="dropdown-item" href="<?= $site['base_url'] ?>machines/<?= urlencode($machine['product_slug']) ?>"> <?= htmlspecialchars( $machine['product_name'], ENT_QUOTES, 'UTF-8' ) ?> </a> </li> <?php endforeach; ?> <?php else: ?> <li> <span class="dropdown-item"> No machines available </span> </li> <?php endif; ?> </ul> </li> <li class="nav-item"> <a class="nav-link <?= $current_page === "industries.php" ? "active" : "" ?>" href="<?= $site['base_url'] ?>industries"> Industries </a> </li> <li class="nav-item"> <a class="nav-link" href="<?= $site['base_url'] ?>blog"> Blog </a> </li> <li class="nav-item"> <a class="nav-link" href="<?= $site['base_url'] ?>gallery"> Gallery </a> </li> <li class="nav-item"> <a class="nav-link <?= $current_page === "contact.php" ? "active" : "" ?>" href="<?= $site['base_url'] ?>contact"> Contact Us </a> </li> </ul> <div class="header-action"> <a href="<?= $site['base_url'] ?>contact.php#enquiry" class="btn btn-brand"> Get a Quote <i class="bi bi-arrow-right"></i> </a> </div> </div> </div> </nav> </header> <main> <script> document.addEventListener('DOMContentLoaded', function () { const menus = [ { parent: '.about-menu-parent', toggle: '.about-dropdown-toggle' }, { parent: '.mega-menu-parent', toggle: '.product-dropdown-toggle' }, { parent: '.machine-menu-parent', toggle: '.machine-dropdown-toggle' } ]; menus.forEach(function (item) { document.querySelectorAll(item.parent).forEach(function (menu) { const toggle = menu.querySelector(item.toggle); if (!toggle) { return; } toggle.addEventListener('click', function (e) { if (window.innerWidth > 991) { return; } e.preventDefault(); e.stopPropagation(); const isOpen = menu.classList.toggle('active'); toggle.classList.toggle('active', isOpen); toggle.setAttribute( 'aria-expanded', isOpen ? 'true' : 'false' ); }); }); }); }); </script>
Save
Cancel