<?php include_once("include/main.inc.php");
$admin_sql = mysqli_query($GLOBALS['dbcon'], "select * from admin_details");
$admin_res = mysqli_fetch_array($admin_sql); ?>
<header class="web-pulse-header">
    <div class="w-e-b-p-u-l-s-e-topbar">
        <div class="container">
            <div class="row">
                <div class="col col-sm-5 col-lg-5 col-md-6 col-xl-5 col-xxl-5">
                    <div class="w-p-s-logo"><a href="<?= SITE_URL_PATH; ?>" title="<?= $admin_res['companyName']; ?>">
                            <img src="<?= SITE_URL_PATH; ?>/images/logo.png" class="wps-logo h-auto"
                                alt="<?= $admin_res['companyName']; ?>" title="<?= $admin_res['companyName']; ?>"
                                width="240" height="113"></a>
                    </div>
                </div>
                <div class="col col-sm-3 col-lg-3 col-md-6 col-xl-3 col-xxl-3">
                    <div class="search-bar-holder">
                        <div class="search-bar">
                            <form method="get" action="<?= SITE_URL_PATH; ?>/search.php">
                                <input type="text" class="form-control" name="keyword" required
                                    placeholder="I am looking for...">
                                <button title="searchbar" aria-label="search_btn" class="search_btn"><i
                                        class="fa-solid fa-magnifying-glass"></i></button>
                            </form>
                        </div>
                    </div>
                </div>
                <div class="col-sm-4 col-lg-4 col-md-4 col-xl-4 col-xxl-4">
                    <ul class="connect_option">
                        <li>
                            <a class="login" href="tel:<?= $admin_res['phone']; ?>" title="<?= $admin_res['phone']; ?>"><i
                                    class="fa fa-volume-control-phone tada"></i> <?= $admin_res['phone']; ?></a>
                        </li>
                        <li class="social-icon hidden-xs">
                            <ul class="social-icons">
                                <li><a class="facebook" href="<?= $admin_res['facebook_link']; ?>" target="_blank"
                                        title="Facebook"><i class="fa-brands fa-facebook-f"></i></a></li>
                                <li><a class="twitter" href="<?= $admin_res['twitter_link']; ?>" target="_blank"
                                        title="Twitter">
                                        <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" fill="currentColor" class="bi bi-twitter-x" viewBox="0 0 16 16">
                                            <path d="M12.6.75h2.454l-5.36 6.142L16 15.25h-4.937l-3.867-5.07-4.425 5.07H.316l5.733-6.57L0 .75h5.063l3.495 4.633L12.601.75Zm-.86 13.028h1.36L4.323 2.145H2.865z" />
                                        </svg>
                                    </a></li>
                                <li><a class="instagram" href="<?= $admin_res['instagram_link']; ?>" target="_blank"
                                        title="Instagram"><i class="fa-brands fa-instagram"></i></a></li>
                                <li><a class="youtube" href="<?= $admin_res['youtube_link']; ?>" target="_blank"
                                        title="Youtube"><i class="fa-brands fa-youtube"></i></a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="webpulse-soluction">
        <div class="container">
            <div class="row">
                <div class="col-sm-12 col-lg-12 col-md-12 col-xl-12 col-xxl-12">
                    <div class="web-pulse-navigation-wps">
                        <div class="fixed_logo"><a href="<?= SITE_URL_PATH; ?>" title="<?= $admin_res['companyName']; ?>">
                                <img id="logo" src="<?= SITE_URL_PATH; ?>/images/logo.png"
                                    alt="<?= $admin_res['companyName']; ?>" title="<?= $admin_res['companyName']; ?>"
                                    width="240" height="113" class="h-auto"></a>
                        </div>
                        <div class="navbar">
                            <button aria-label="Name" id="fa-solid" title="menubar"><i class="fa-solid fa-bars"></i></button>
                        </div>
                        <div class="web-p-u-l-s-e-menu main_header">
                            <ul class="nav">
                                <li><a href="<?= SITE_URL_PATH; ?>" title="Home">Home</a></li>
                                <li><a href="<?= SITE_URL_PATH; ?>/about.htm" title="Company Profile">Company Profile</a>
                                </li>
                                <?php $sql = mysqli_query($GLOBALS['dbcon'], "select * from category_tbl where parentID='0' && status='Y' order by catOrder");
                                $count = mysqli_num_rows($sql);

                                while ($res = mysqli_fetch_array($sql)) { ?>
                                    <?php $catID = $res['catID'];
                                    $sql_sub = mysqli_query($GLOBALS['dbcon'], "select * from category_tbl where parentID='$catID' && status='Y' order by catOrder");
                                    $count = mysqli_num_rows($sql_sub);
                                    $iconClass = ($count > 0) ? '<i class="fa-solid fa-angle-down hidden-xs hidden-sm"></i>' : '';
                                    ?>
                                    <li
                                        class="cs-submenu <?php echo $catID; ?> <?php if ($hover == $catID) {
                                                                                    echo 'active';
                                                                                } ?>">
                                        <a href="#1" title="<?php echo $res['catName']; ?> ">
                                            <?php echo $res['displayName']; ?><i
                                                class="fa-solid fa-angle-down hidden-xs hidden-sm"></i></a>
                                        <?php if (mysqli_num_rows($sql_sub) > 0) { ?>
                                            <ul class="cs-dropdown">
                                                <?php while ($subres = mysqli_fetch_array($sql_sub)) {
                                                    $catIDs = $subres['catID'];
                                                    $sql_subsub = mysqli_query($GLOBALS['dbcon'], "select * from category_tbl where parentID='$catIDs' && status='Y' order by catOrder");
                                                    if (mysqli_num_rows($sql_subsub) > 0) { ?>
                                                        <li class="cs-submenu">
                                                            <a href="<?= SITE_URL_PATH; ?>/<?= getValidFileName($subres['catName']); ?>.htm"
                                                                title="<?php echo $subres['catName']; ?>"><?php echo $subres['displayName']; ?><i
                                                                    class="fa-solid fa-angle-right hidden-xs hidden-sm"></i> </a>
                                                            <ul class="cs-dropdown">
                                                                <?php while ($subsubres = mysqli_fetch_array($sql_subsub)) {
                                                                    $catIDss = $subsubres['catID'];
                                                                    $sql_final = mysqli_query($GLOBALS['dbcon'], "select * from category_tbl where parentID='$catIDss' order by catOrder");
                                                                    if (mysqli_num_rows($sql_final) > 0) { ?>
                                                                        <li class="cs-submenu">
                                                                            <a href="<?= SITE_URL_PATH; ?>/<?= getValidFileName($subsubres['catName']); ?>.htm"
                                                                                title="<?php echo $subsubres['catName']; ?> "><?php echo $subsubres['displayName']; ?></a>
                                                                            <ul class="cs-dropdown">
                                                                                <?php while ($finalres = mysqli_fetch_array($sql_final)) { ?>
                                                                                    <li><a href="<?= SITE_URL_PATH; ?>/<?= getValidFileName($finalres['catName']); ?>.htm"
                                                                                            title="<?php echo $finalres['catName']; ?> "><?php echo $finalres['displayName']; ?></a>
                                                                                    </li>
                                                                                <?php } ?>
                                                                            </ul>
                                                                        </li>
                                                                    <?php } else { ?>
                                                                        <li><a href="<?= SITE_URL_PATH; ?>/<?= getValidFileName($subsubres['catName']); ?>.htm"
                                                                                title="<?php echo $subsubres['catName']; ?> "><?php echo $subsubres['displayName']; ?></a>
                                                                        </li>
                                                                <?php }
                                                                } ?>
                                                            </ul>
                                                        </li>
                                                    <?php } else { ?>
                                                        <li><a href="<?= SITE_URL_PATH; ?>/<?= getValidFileName($subres['catName']); ?>.htm"
                                                                title="<?php echo $subres['catName']; ?> "><?php echo $subres['displayName']; ?></a>
                                                        </li>
                                                <?php }
                                                } ?>
                                            </ul>
                                        <?php } ?>
                                    </li>
                                <?php } ?>
                                <li><a href="<?= SITE_URL_PATH; ?>/our-certification.htm" title="Our Certification">Our
                                        Certification</a></li>
                                <li><a href="<?= SITE_URL_PATH; ?>/photo-gallery.htm" title="Photo Gallery">Photo
                                        Gallery</a>
                                </li>
                                <li><a href="<?= SITE_URL_PATH; ?>/blog.htm" title="Blogs">Blogs</a></li>
                                <li><a href="<?= SITE_URL_PATH; ?>/contact.htm" title="Contact Us">Contact Us</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</header>