<?php 
include_once("include/main.inc.php");
$page_metatitle = "Sitemap- ".COMPANY_NAME;
$page_metadesc = "Sitemap- ".COMPANY_NAME;
$page_metakey ="Sitemap- ".COMPANY_NAME;
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <?php include "app_top.php"; ?>
</head>

<body>

    <?php include "app_header.php"; ?>

    <section class="heading_banner" style="background-image: url(<?=site_url;?>/designer/images/sitemap-banner.jpg)">
        <div class="container">
            <div class="row">
                <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12 text-center">
                    <h1 class="cat_title">Sitemap</h1>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </section>

    <div class="inner_breadcrumb hidden_xs">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <ul class="breadcrumb">
                        <li><a href="<?=site_url;?>" title="Home">Home</a></li>
                        <li class="active">Sitemap</li>
                    </ul>
                </div>
            </div>
        </div>
    </div>


    <section class="sitemap_page">
        <div class="container">
            <h2 class="title_1">Sitemap</h2>
            <div class="clearfix"></div>
            <div class="row">
                <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                    <div class="sitemap_right_side">
                        <ul class="sitemap">
                        <li><a href="<?=site_url;?>" title="Home">Home</a></li>
                            <li><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;?>/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>
    </section>
    

    <?php include "app_footer.php"; ?>
    <?php include "app_bottom.php"; ?>
</body>

</html>