<?php
include "includes/db.php";

$site = mysqli_fetch_assoc(
    mysqli_query($conn,"SELECT * FROM site_settings ORDER BY id DESC LIMIT 1")
);
?>
<!doctype html>
<html class="no-js" lang="zxx">

<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>KRB Metal Detectors | Worlds Best Metal Detectors</title>
    <meta name="robots" content="noindex, follow" />
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Favicon -->
    <!-- <link rel="shortcut icon" type="image/x-icon" href="assets/images/favicon.ico"> -->

    <!-- CSS
	============================================ -->

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
    <!-- Fontawesome -->
    <link rel="stylesheet" href="assets/css/font-awesome.css">
    <!-- Fontawesome Star -->
    <link rel="stylesheet" href="assets/css/fontawesome-stars.css">
    <!-- Ion Icon -->
    <link rel="stylesheet" href="assets/css/ion-fonts.css">
    <!-- Slick CSS -->
    <link rel="stylesheet" href="assets/css/slick.css">
    <!-- Animation -->
    <link rel="stylesheet" href="assets/css/animate.min.css">
    <!-- jQuery Ui -->
    <link rel="stylesheet" href="assets/css/jquery-ui.min.css">
    <!-- Lightgallery -->
    <link rel="stylesheet" href="assets/css/lightgallery.min.css">
    <!-- Nice Select -->
    <link rel="stylesheet" href="assets/css/nice-select.css">

    <!-- Style CSS -->
    <link rel="stylesheet" href="assets/css/style.css">

    <link href="https://fonts.googleapis.com/css2?family=Changa:wght@200..800&display=swap" rel="stylesheet">
    <!-- CKEditor content CSS -->
<link rel="stylesheet" href="https://cdn.ckeditor.com/ckeditor5/38.1.0/classic/themes/lark.css">

<style>
.ck-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.ck-content table,
.ck-content th,
.ck-content td {
    border: 1px solid #999;
}

.ck-content th,
.ck-content td {
    padding: 8px 10px;
    text-align: left;
}

.ck-content th {
    background-color: #f2f2f2;
    font-weight: bold;
}
</style>

</head>

<body class="template-color-1">
    <div class="main-wrapper">
        <!-- Begin krb's Header Main Area -->
        <header class="header-main_area header-main_area-2 header-main_area-3">
            <div class="header-middle_area">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-lg-3"></div>
                        <div class="col-lg-9 text-lg-end text-center">
                            <div class="header-logo_area">
                                <ul class="d-flex align-items-center justify-content-end">
                                  <li class="cross-box-li">
    <a href="mailto:<?= $site['email'] ?>" class="text-dark">
        <i class="far fa-envelope"></i>
        <?= htmlspecialchars($site['email']) ?>
    </a>
</li>

<li class="cross-box-li ms-2 me-sm-2">
    <a href="tel:<?= preg_replace('/\s+/', '', $site['phone']) ?>" class="text-dark">
        <i class="ion-android-call"></i>
        <?= htmlspecialchars($site['phone']) ?>
    </a>
</li><li class="header-logo_area cross-box">
    <ul class="social_icon ul_li">

        <?php if(!empty($site['facebook'])){ ?>
        <li>
            <a href="<?= htmlspecialchars($site['facebook']) ?>" target="_blank">
                <i class="fab fa-facebook-f"></i>
            </a>
        </li>
        <?php } ?>

        <?php if(!empty($site['twitter'])){ ?>
        <li>
            <a href="<?= htmlspecialchars($site['twitter']) ?>" target="_blank">
                <i class="fab fa-twitter"></i>
            </a>
        </li>
        <?php } ?>

        <?php if(!empty($site['instagram'])){ ?>
        <li>
            <a href="<?= htmlspecialchars($site['instagram']) ?>" target="_blank">
                <i class="fab fa-instagram"></i>
            </a>
        </li>
        <?php } ?>

        <?php if(!empty($site['linkedin'])){ ?>
        <li>
            <a href="<?= htmlspecialchars($site['linkedin']) ?>" target="_blank">
                <i class="fab fa-linkedin-in"></i>
            </a>
        </li>
        <?php } ?>

    </ul>
</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="header-top_area">
                <div class="container-fluid">
                    <div class="header-main-1">
                       <div class="header-logo_area logo-header">
    <a href="index.php">

        <?php if(!empty($site['logo'])){ ?>
            <img src="admin/uploads/<?= $site['logo'] ?>" alt="Logo">
        <?php } ?>
              <h2>KRB Metal Detectors
                                    <span>World's Best Metal Detectors</span></h2>
   

    </a>
</div>

                        <div class="custom-menu_col-2 d-none d-lg-block">
                            <div class="main-menu_area position-relative">
                                <nav class="main-nav">
                                    <ul class="nav-item">
                                        <li class="active"><a href="index.php">Home</a></li>
    
<li>
    <a href="javascript:void(0)">Detectors <i class="ion-ios-arrow-down"></i></a>
    <ul class="hm-dropdown">
        <?php
      

        // Fetch active categories
        $categories = mysqli_query($conn, "SELECT name FROM masters WHERE type='category' AND status=1 ORDER BY position");
        // Loop through categories
        while($cat = mysqli_fetch_assoc($categories)){
            echo '<li>
        <a href="products.php?category[]='.urlencode($cat['name']).'">
            '.htmlspecialchars($cat['name']).'
        </a>
      </li>';

        }
        ?>
    </ul>
</li>

<li>
    <a href="javascript:void(0)">Shop by Brands <i class="ion-ios-arrow-down"></i></a>
  <ul class="hm-dropdown">
<?php
$brands = mysqli_query($conn, "SELECT name FROM masters WHERE type='brand' AND status=1 ORDER BY position");

while($brand = mysqli_fetch_assoc($brands)){
    echo '<li>
            <a href="products.php?brand[]='.urlencode($brand["name"]).'">
                '.htmlspecialchars($brand["name"]).'
            </a>
          </li>';
}
?>
</ul>

</li>
<li>
        <a href="javascript:void(0)">Detection Systems <i class="ion-ios-arrow-down"></i></a>
      <ul class="hm-dropdown">
<?php
$detection = mysqli_query($conn, "SELECT name FROM masters WHERE type='detection' AND status=1 ORDER BY name");
while($det = mysqli_fetch_assoc($detection)){
    echo '<li>
            <a href="products.php?detection[]='.urlencode($det["name"]).'">
                '.htmlspecialchars($det["name"]).'
            </a>
          </li>';
}
?>
</ul>

    </li>
                                        <li><a href="javascript:void(0)">Support <i class="ion-ios-arrow-down"></i></a>
                                            <ul class="hm-dropdown">
                                                <li><a href="javascript:void(0)">About </a></li>
                                                <li><a href="javascript:void(0)">Blog</a></li>
                                            </ul>
                                        </li>
                                        <li><a href="contact.php">Contact</a></li>
                                    </ul>
                                </nav>
                            </div>
                        </div>
                        <div class="mb-view1 d-flex align-items-center justify-content-end">
                            <div class="custom-setting_col">
                                <div class="ht-right_area">
                                    <div class="ht-menu header-right_area">
                                        <ul>
                                            <li class="mt-1 me-1 search-popup">
                                                <a href="" class="minicart-btn toolbar-btn" data-bs-toggle="modal"
                                                    data-bs-target="#exampleModal">
                                                    <div class="minicart-count_area">
                                                        <i class="ion-ios-search-strong"></i>
                                                    </div>
                                                </a>
                                            </li>
                                            <li><a href="javascript:void(0)" class="d-flex align-items-center"><span
                                                        class="d-flex align-items-center"><i
                                                            class="fas fa-rupee-sign me-1"></i> INR</span><i
                                                        class="fa fa-chevron-down"></i></a>
                                                <ul class="ht-dropdown ht-currency">
                                                    <li><a href="javascript:void(0)"><i class="fas fa-rupee-sign"></i>
                                                            INR</a></li>
                                                    <li><a href="javascript:void(0)">$ USD</a></li>
                                                </ul>
                                            </li>
                                            <li class="minicart-wrap ms-sm-2 ms-3">
                                                <a href="#miniCart" class="minicart-btn toolbar-btn p-0">
                                                    <div class="minicart-count_area">
                                                        <span class="item-count">3</span>
                                                        <i class="ion-bag"></i>
                                                    </div>
                                                    <!-- <div class="minicart-front_text">
                                                    <span>Cart:</span>
                                                    <span class="total-price">462.4</span>
                                                </div> -->
                                                </a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div class="mobile-menu_wrap d-flex d-lg-none ms-3">
                                <a href="#mobileMenu" class="mobile-menu_btn toolbar-btn color--white">
                                    <i class="ion-navicon"></i>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Sticky Header -->
            <div class="header-top_area header-sticky bg--white">
                <div class="container-fluid">
                    <div class="header-main-1">
                        <div class="header-logo_area logo-header">
    <a href="index.php">

        <?php if(!empty($site['logo'])){ ?>
            <img src="admin/uploads/<?= $site['logo'] ?>" alt="Logo">
        <?php } ?>

        <h2>
            <?= htmlspecialchars($site['header_text'] ?? 'KRB Metal Detectors') ?>
            <span><?= htmlspecialchars($site['footer_text'] ?? '') ?></span>
        </h2>

    </a>
</div>

                        <div class="custom-menu_col-2 d-none d-lg-block">
                            <div class="main-menu_area position-relative">
                                <nav class="main-nav">
                                    <ul class="nav-item">
                                        <li class="active"><a href="index.php">Home</a></li>
                                       <li>
    <a href="javascript:void(0)">Detectors <i class="ion-ios-arrow-down"></i></a>
    <ul class="hm-dropdown">
        <?php
        // DB connection
       

        // Fetch categories (active only)
        $categories = mysqli_query($conn, "SELECT name FROM masters WHERE type='category' AND status=1 ORDER BY name");

        // Loop through categories
        while($cat = mysqli_fetch_assoc($categories)){
            echo '<li><a href="category.php?cat='.urlencode($cat['name']).'">'.htmlspecialchars($cat['name']).'</a></li>';
        }
        ?>
    </ul>
</li>


<li>
    <a href="javascript:void(0)">Shop by Brands <i class="ion-ios-arrow-down"></i></a>
    <ul class="hm-dropdown">
        <?php
        // DB connection (if not already connected)
      

        // Fetch active brands
        $brands = mysqli_query($conn, "SELECT name FROM masters WHERE type='brand' AND status=1 ORDER BY name");

        // Loop through brands
        while($brand = mysqli_fetch_assoc($brands)){
            echo '<li><a href="brand.php?brand='.urlencode($brand['name']).'">'.htmlspecialchars($brand['name']).'</a></li>';
        }
        ?>
    </ul>
</li>
<li>
        <a href="javascript:void(0)">Detection Systems <i class="ion-ios-arrow-down"></i></a>
        <ul class="hm-dropdown">
            <?php
            $detection = mysqli_query($conn, "SELECT name FROM masters WHERE type='detection' AND status=1 ORDER BY name");
            while($det = mysqli_fetch_assoc($detection)){
                echo '<li><a href="detection.php?system='.urlencode($det['name']).'">'.htmlspecialchars($det['name']).'</a></li>';
            }
            ?>
        </ul>
    </li>
                                        <li><a href="javascript:void(0)">Support <i class="ion-ios-arrow-down"></i></a>
                                            <ul class="hm-dropdown">
                                                <li><a href="javascript:void(0)">About </a></li>
                                                <li><a href="javascript:void(0)">Blog</a></li>
                                            </ul>
                                        </li>
                                        <li><a href="javascript:void(0)">Contact</a></li>
                                    </ul>
                                </nav>
                            </div>
                        </div>
                        <div class="mb-view1 d-flex align-items-center justify-content-end">
                            <div class="custom-setting_col">
                                <div class="ht-right_area">
                                    <div class="ht-menu header-right_area">
                                        <ul>
                                            <li class="mt-1 me-1 search-popup">
                                                <a href="" class="minicart-btn toolbar-btn" data-bs-toggle="modal"
                                                    data-bs-target="#exampleModal">
                                                    <div class="minicart-count_area">
                                                        <i class="ion-ios-search-strong"></i>
                                                    </div>
                                                </a>
                                            </li>
                                            <li><a href="javascript:void(0)" class="d-flex align-items-center"><span
                                                        class="d-flex align-items-center"><i
                                                            class="fas fa-rupee-sign me-1"></i> INR</span><i
                                                        class="fa fa-chevron-down"></i></a>
                                                <ul class="ht-dropdown ht-currency">
                                                    <li><a href="javascript:void(0)"><i class="fas fa-rupee-sign"></i>
                                                            INR</a></li>
                                                    <li><a href="javascript:void(0)">$ USD</a></li>
                                                </ul>
                                            </li>
                                            <li class="minicart-wrap ms-sm-2 ms-3">
                                                <a href="#miniCart" class="minicart-btn toolbar-btn p-0">
                                                    <div class="minicart-count_area">
                                                        <span class="item-count">3</span>
                                                        <i class="ion-bag"></i>
                                                    </div>
                                                    <!-- <div class="minicart-front_text">
                                                    <span>Cart:</span>
                                                    <span class="total-price">462.4</span>
                                                </div> -->
                                                </a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div class="mobile-menu_wrap d-flex d-lg-none ms-3">
                                <a href="#mobileMenu" class="mobile-menu_btn toolbar-btn color--white">
                                    <i class="ion-navicon"></i>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- Mobile Menu -->
            <div class="mobile-menu_wrapper" id="mobileMenu">
                <div class="offcanvas-menu-inner">
                    <div class="container">
                        <a href="#" class="btn-close"><i class="ion-android-close"></i></a>
                        <div class="offcanvas-inner_search">
                            <form action="#" class="inner-searchbox">
                                <input type="text" placeholder="Search for item...">
                                <button class="search_btn" type="submit"><i class="ion-ios-search-strong"></i></button>
                            </form>
                        </div>
                        <nav class="offcanvas-navigation">
                            <ul class="mobile-menu">
                                <li class="menu-item-has-children active"><a href="index.php"><span
                                            class="mm-text">Home</span></a>
                                </li>
                                    
<li>
    <a href="javascript:void(0)">Detectors <i class="ion-ios-arrow-down"></i></a>
    <ul class="hm-dropdown">
        <?php
        // DB connection (if not already connected)
       
        // Fetch active categories
        $categories = mysqli_query($conn, "SELECT name FROM masters WHERE type='category' AND status=1 ORDER BY name");

        // Loop through categories
        while($cat = mysqli_fetch_assoc($categories)){
            echo '<li><a href="category.php?category='.urlencode($cat['name']).'">'.htmlspecialchars($cat['name']).'</a></li>';
        }
        ?>
    </ul>
</li>

<li>
    <a href="javascript:void(0)">Shop by Brands <i class="ion-ios-arrow-down"></i></a>
    <ul class="hm-dropdown">
        <?php
        // DB connection (if not already connected)
      
        // Fetch active brands
        $brands = mysqli_query($conn, "SELECT name FROM masters WHERE type='brand' AND status=1 ORDER BY name");

        // Loop through brands
        while($brand = mysqli_fetch_assoc($brands)){
            echo '<li><a href="brand.php?brand='.urlencode($brand['name']).'">'.htmlspecialchars($brand['name']).'</a></li>';
        }
        ?>
    </ul>
</li>
<li>
        <a href="javascript:void(0)">Detection Systems <i class="ion-ios-arrow-down"></i></a>
        <ul class="hm-dropdown">
            <?php
            $detection = mysqli_query($conn, "SELECT name FROM masters WHERE type='detection' AND status=1 ORDER BY name");
            while($det = mysqli_fetch_assoc($detection)){
                echo '<li><a href="detection.php?system='.urlencode($det['name']).'">'.htmlspecialchars($det['name']).'</a></li>';
            }
            ?>
        </ul>
    </li>
                                <li class="menu-item-has-children"><a href="#!"><span class="mm-text">About</span></a>
                                </li>
                                <li class="menu-item-has-children"><a href="#!"><span class="mm-text">Blog</span></a>
                                </li>
                                <li class="menu-item-has-children"><a href="#!"><span class="mm-text">Contact</span></a>
                                </li>
                            </ul>
                        </nav>
                    </div>
                </div>
            </div>

            <div class="custom-category_col col-12 mbl-shop">
                <div class="category-menu category-menu-hidden">
                    <div class="category-heading">
                        <h2 class="categories-toggle">
                            <span>Shop By</span>
                            <span>Department</span>
                        </h2>
                    </div>
                    <div id="cate-toggle" class="category-menu-list">
                        <ul>
                            <li class="right-menu"><a href="#!">Car Parts</a>
                                <ul class="cat-mega-menu">
                                    <li class="right-menu cat-mega-title">
                                        <a href="#!">Active body control</a>
                                        <ul>
                                            <li><a href="#!">Aluminum Nonstick</a></li>
                                            <li><a href="#!">Calphalon</a></li>
                                            <li><a href="#!">Contemporary</a></li>
                                            <li><a href="#!">Hard-Anodized</a></li>
                                        </ul>
                                    </li>
                                    <li class="right-menu cat-mega-title">
                                        <a href="#!">Battery Indicator</a>
                                        <ul>
                                            <li><a href="#!">Sanai laptops</a></li>
                                            <li><a href="#!">Byteflight</a></li>
                                            <li><a href="#!">EXcaliberPC</a></li>
                                            <li><a href="#!">Gaming Laptops</a></li>
                                        </ul>
                                    </li>
                                    <li class="right-menu cat-mega-title">
                                        <a href="#!">Remote Starter</a>
                                        <ul>
                                            <li><a href="#!">Dual Core</a></li>
                                            <li><a href="#!">Gaming Monitors</a></li>
                                            <li><a href="#!">GPS Monitors</a></li>
                                            <li><a href="#!">Heat Shield</a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </li>
                            <li class="right-menu"><a href="#!">Tools &amp; Accessories</a>
                                <ul class="cat-mega-menu cat-mega-menu-2">
                                    <li class="right-menu cat-mega-title">
                                        <a href="#!">Drills</a>
                                        <ul>
                                            <li><a href="#!">Angle Drills</a></li>
                                            <li><a href="#!">Combi Drills</a></li>
                                            <li><a href="#!">Drill Drivers</a></li>
                                            <li><a href="#!">PercussionDrills</a></li>
                                        </ul>
                                    </li>
                                    <li class="right-menu cat-mega-title">
                                        <a href="#!">Nail Guns</a>
                                        <ul>
                                            <li><a href="#!">Air Nail Guns</a></li>
                                            <li><a href="#!">Cordless Nail Guns</a></li>
                                            <li><a href="#!">Electric Nail Guns</a></li>
                                            <li><a href="#!">Gas Nail Guns</a></li>
                                        </ul>
                                    </li>
                                    <li class="right-menu cat-mega-title">
                                        <a href="#!">Sanders</a>
                                        <ul>
                                            <li><a href="#!">1/2 Sheet Sanders</a></li>
                                            <li><a href="#!">1/4 Sheet Sanders</a></li>
                                            <li><a href="#!">Belt Sanders</a></li>
                                            <li><a href="#!">Drywall Sanders</a></li>
                                        </ul>
                                    </li>
                                    <li class="right-menu cat-mega-title">
                                        <a href="#!">Saws</a>
                                        <ul>
                                            <li><a href="#!">Circular Saws</a></li>
                                            <li><a href="#!">Jigsaws</a></li>
                                            <li><a href="#!">Mitre Saws</a></li>
                                            <li><a href="#!">Reciprocating Saws</a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </li>
                            <li class="right-menu"><a href="#!">Suspension Systems</a>
                                <ul class="cat-mega-menu cat-mega-menu-3">
                                    <li class="right-menu cat-mega-title">
                                        <a href="#!">Clothing</a>
                                        <ul>
                                            <li><a href="#!">Cuisinart</a></li>
                                            <li><a href="#!">Homeinart</a></li>
                                            <li><a href="#!">Kettle Stainless</a></li>
                                            <li><a href="#!">Steel Stovetop</a></li>
                                        </ul>
                                    </li>
                                    <li class="right-menu cat-mega-title">
                                        <a href="#!">Jewelry</a>
                                        <ul>
                                            <li><a href="#!">Hard Anodized</a></li>
                                            <li><a href="#!">Scratch Resistant</a></li>
                                            <li><a href="#!">Thermo-Spot</a></li>
                                            <li><a href="#!">Ultimate</a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </li>
                            <li class="right-menu"><a href="#!">Turbo System</a>
                                <ul class="cat-mega-menu">
                                    <li class="right-menu cat-mega-title">
                                        <a href="#!">BMW</a>
                                        <ul>
                                            <li><a href="#!">Dining Chairs</a></li>
                                            <li><a href="#!">Dining Tables</a></li>
                                            <li><a href="#!">Gramophone</a></li>
                                            <li><a href="#!">Sideboards</a></li>
                                        </ul>
                                    </li>
                                    <li class="right-menu cat-mega-title">
                                        <a href="#!">FORD</a>
                                        <ul>
                                            <li><a href="#!">Chairs & Sofas</a></li>
                                            <li><a href="#!">Chest</a></li>
                                            <li><a href="#!">Loungers</a></li>
                                            <li><a href="#!">Sets</a></li>
                                        </ul>
                                    </li>
                                    <li class="right-menu cat-mega-title">
                                        <a href="#!">POSCHER</a>
                                        <ul>
                                            <li><a href="#!">Bed</a></li>
                                            <li><a href="#!">Daybed</a></li>
                                            <li><a href="#!">Futon</a></li>
                                            <li><a href="#!">Hammock</a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </li>
                            <li class="right-menu"><a href="#!">Oils & Fluids</a>
                                <ul class="cat-dropdown">
                                    <li>
                                        <a href="#!">Daylesford</a>
                                        <a href="#!">Delaware</a>
                                        <a href="#!">Fayence</a>
                                        <a href="#!">Franzea</a>
                                        <a href="#!">Mable</a>
                                        <a href="#!">Mobo</a>
                                        <a href="#!">Pippins</a>
                                    </li>
                                </ul>
                            </li>
                            <li class="right-menu"><a href="#!">Exterior</a>
                                <ul class="cat-dropdown cat-dropdown-2">
                                    <li>
                                        <a href="#!">Coffee & side tables</a>
                                        <a href="#!">Living room lighting</a>
                                        <a href="#!">Living room storage</a>
                                        <a href="#!">Living room textiles & rugs</a>
                                    </li>
                                </ul>
                            </li>
                            <li><a href="#!">Body Parts</a></li>
                            <li><a href="#!">Interior</a></li>
                            <li><a href="#!">Audio</a></li>
                            <li><a href="#!">End Tables</a></li>
                            <li class="rx-child"><a href="#!">Uncategorized</a></li>
                            <li class="rx-child"><a href="#!">Appliances</a></li>
                            <li class="rx-parent">
                                <a class="rx-default">More Categories</a>
                                <a class="rx-show">Collapse</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </header>
        <!-- krb's Header Main Area End Here -->