<?php include_once("include/main.inc.php");
$about_page = mysqli_query($GLOBALS['dbconn'], "select pageDesc, pageDesc1, pageImage, page_keyword, page_metadesc, page_metatitle from static_pages where pageID='2'");
$about_res = mysqli_fetch_array($about_page);
?>

<a id="scrollUp" title="Go to Top"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
        <path fill-rule="evenodd" d="M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5z"></path>
    </svg></a>

<header class="header">
    <div class="container-fluid px-md-5">
        <div class="row align-items-center">
            <div class="col-xxl-2 col-xl-2 col-lg-2 col-md-2 col-sm-8 col-8">
                <div class="logo">
                    <a href="<?= site_url; ?>" title="<?= COMPANY_NAME; ?>">
                        <img src="<?= site_url; ?>/designer/images/logo.png" alt="<?= COMPANY_NAME; ?>" title="<?= COMPANY_NAME; ?>" width="200" height="221">
                    </a>
                </div>
            </div>
            <div class="col-xxl-10 col-xl-10 col-lg-10 col-md-10 col-sm-4 col-4">
                <div class="navigation">
                    <div class="navbar">
                        <button class="toggle_menu menu_show" id="menubar" title="menubar">
                            <span></span>
                            <span></span>
                            <span></span>
                        </button>
                    </div>
                        <div class="menu menu-changes">
                            <ul class="nav">
                                <li class="<?php if ($hover == 'home') {
                                            echo 'active';
                                        } ?>"><a href="<?= site_url; ?>" title="Home">Home</a></li>
                                <li class=" <?php if ($hover == 'about') {
                                            echo 'active';
                                        } ?>"><a href="<?= site_url; ?>/about-us.htm" title="About Us">About Us</a>
                                </li>


                                
                        <?php 
$sql = mysqli_query($GLOBALS['dbconn'], "
    SELECT displayName, catName, catID, parentID 
    FROM category_tbl 
    WHERE parentID='0' AND status='Y'
    ORDER BY catOrder
");

while ($res = mysqli_fetch_array($sql)) { 
    $catID = $res['catID'];
?>
    <li class="cs-submenu <?php if ($hover == 'category') echo 'active'; ?>">
        <a href="javascript:void(0);" title="<?= $res['displayName']; ?>">
            <?= $res['displayName']; ?>
        </a>

        <ul class="cs-dropdown">
            <?php 
            // LEVEL 2
            $sql_sub = mysqli_query($GLOBALS['dbconn'], "
                SELECT displayName, catName, catID 
                FROM category_tbl 
                WHERE parentID='$catID' AND status='Y'
                ORDER BY catOrder
            ");

            while ($sub_res = mysqli_fetch_array($sql_sub)) { 
                $catID2 = $sub_res['catID'];

                // LEVEL 3
                $sql_subsub = mysqli_query($GLOBALS['dbconn'], "
                    SELECT displayName, catName, catID 
                    FROM category_tbl 
                    WHERE parentID='$catID2' AND status='Y'
                    ORDER BY catOrder
                ");
            ?>
                <li class="<?= (mysqli_num_rows($sql_subsub) > 0) ? 'cs-submenu' : ''; ?>">
                    <a href="javascript:void(0);"
                       title="<?= $sub_res['displayName']; ?>">
                       <span><?= $sub_res['displayName']; ?></span>
                    </a>

                    <ul class="cs-dropdown">
                        <?php 
                        while ($subsub_res = mysqli_fetch_array($sql_subsub)) { 
                            $catID3 = $subsub_res['catID'];

                            // LEVEL 4
                            $sql_level4 = mysqli_query($GLOBALS['dbconn'], "
                                SELECT displayName, catName, catID 
                                FROM category_tbl 
                                WHERE parentID='$catID3' AND status='Y'
                                ORDER BY catOrder
                            ");
                        ?>
                            <li class="<?= (mysqli_num_rows($sql_level4) > 0) ? 'cs-submenu' : ''; ?>">
                                <a href="<?= site_url; ?>/<?= getValidFileName($subsub_res['catName']); ?>.htm"
                                   title="<?= $subsub_res['displayName']; ?>">
                                   <?= $subsub_res['displayName']; ?>
                                </a>

                                <ul class="cs-dropdown">
                                    <?php while ($lvl4 = mysqli_fetch_array($sql_level4)) { ?>
                                        <li>
                                            <a href="<?= site_url; ?>/<?= getValidFileName($lvl4['catName']); ?>.htm"
                                               title="<?= $lvl4['displayName']; ?>">
                                               <?= $lvl4['displayName']; ?>
                                            </a>
                                        </li>
                                    <?php } ?>
                                </ul>
                            </li>
                        <?php } ?>
                    </ul>
                </li>
            <?php } ?>
        </ul>
    </li>

<?php } ?>

                                <li><a href="<?= site_url; ?>/quality.htm" title="Quality">Quality</a></li>
                                <li><a href="<?= site_url; ?>/technical.htm" title="Technical Info">Technical Info</a>
                                </li>
                                <li><a href="<?= site_url; ?>/certificates.htm" title="Certificates">Certificates</a>
                                </li>
                                <li><a href="<?= site_url; ?>/blog.htm" title="Blogs">Blogs</a></li>
                                <li><a href="<?= site_url; ?>/contact-us.htm" title="Contact Us">Contact Us</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </header>



