<?php
include_once("include/main.inc.php");
$query = "Select catID,catName, displayName from category_tbl where parentID='0' and status='Y' order by catOrder";
$sqlMain = mysqli_query($dbcon, $query);

?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- <title>Sitemap - Mangla Plastic Industries</title>
      <meta name=description content="Sitemap - Mangla Plastic Industries">
      <meta name=keywords content="Sitemap - Mangla Plastic Industries"> -->
    <?php include "top.php"; ?>
</head>

<body>
    <div class="webpulse-main-wrapper wrapper-wide" id="top">

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

        <div class="sitemap_page">
            <div class="container">
                <ul class="sitemap">
                    <li><a href="javascript:void(0);" title="">Primary Pages</a>
                        <ul>
                            <li><a href="<?=SITE_URL_PATH;?>" title="Home">Home</a></li>
                            <li><a href="<?=SITE_URL_PATH;?>/about.htm" title="About Us">About Us</a></li>
                            <li><a href="<?=SITE_URL_PATH;?>/photo-gallery.htm" title="Photo-Gallery">Photo Gallery</a>
                            </li>
                            <!-- <li><a href="<?=SITE_URL_PATH;?>/careers.htm" title="Careers">Careers</a></li> -->
                            <!-- <li><a href="<?=SITE_URL_PATH;?>/our-clients.htm" title="Our Clients">Our Clients</a></li> -->
                            <li><a href="<?=SITE_URL_PATH;?>/blog.htm" title="Blog">Blog</a></li>
                            <li><a href="<?=SITE_URL_PATH;?>/contact.htm" title="Contact Us">Contact Us</a></li>
                            <li><a href="<?=SITE_URL_PATH;?>/market-area.htm" title="Market area">Market area</a></li>
                        </ul>
                    </li>
                </ul>


                <ul class="all_sitemap">
                    <?php $sql=mysqli_query($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($dbcon,"select * from category_tbl where parentID='$catID' && status='Y' order by catOrder");
              
									?>
                    <li><a href="<?=SITE_URL_PATH;?>/<?=getValidFileName($res['catName']);?>.htm"
                            title="<?php echo $res['catName']; ?> "> <?php echo $res['catName']; ?></a>
                        <?php if(mysqli_num_rows($sql_sub) > 0){?>
                        <ul>
                            <?php while($subres=mysqli_fetch_array($sql_sub)) {
									$catIDs=$subres['catID'];
									$sql_subsub=mysqli_query($dbcon,"select * from category_tbl where parentID='$catIDs' && status='Y' order by catOrder");
									if(mysqli_num_rows($sql_subsub) > 0) {?>
                            <li class="list-sitemap"><a class="bg-head"
                                    href="<?=SITE_URL_PATH;?>/<?=getValidFileName($subres['catName']);?>.htm"
                                    title="<?php echo $subres['catName']; ?>"><?php echo $subres['catName']; ?> </a>
                                <ul>
                                    <?php while($subsubres=mysqli_fetch_array($sql_subsub)){
									$catIDss=$subsubres['catID'];
									$sql_final=mysqli_query($dbcon,"select * from category_tbl where parentID='$catIDss' order by catOrder");
									if(mysqli_num_rows($sql_final) > 0){ ?>
                                    <li> <a href="<?=SITE_URL_PATH;?>/<?=getValidFileName($subsubres['catName']);?>.htm"
                                            title="<?php echo $subsubres['catName']; ?> "><?php echo $subsubres['catName']; ?></a>
                                        <ul>
                                            <?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['catName']; ?></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['catName']; ?></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['catName']; ?></a>
                            </li>
                            <?php } }?>
                        </ul>
                        <?php }?>
                    </li>
                    <?php }?>


                </ul>



            </div>
        </div>
   




    <?php include "footer.php"; ?>
    </div>
    <?php include "bottom.php"; ?>
</body>

</html>