<div class="sidebar-wrapper">
    <div class="logo">
        <img src="./assets/img/logo.png" alt="logo.png" width="55%" style="display:block;margin:auto;"/>
        <a href="#" class="simple-text">
            <b>KPDNKK</b>
        </a>
    </div>

    <ul class="nav" id="sidemenu">
        <li class="active" id="app-menu-001">
            <a href="#">
                <i class="ti-stats-up"></i>
                <p>Dashboard</p>
            </a>
        </li>

        <!-- PENGUATKUASAAN -->
        <li style="background-color:#EAEAEA;">
            <a href="#" aria-disabled="disabled">
                <i class="ti-comment-alt"></i>
                <p>PENGUATKUASAAN</p>
            </a>
        </li>                
        <li id="app-menu-101">
            <a href="#">
                <i class="ti-angle-right"></i>
                <p>&nbsp;Kes Baru</p>
            </a>
        </li>  
        <li id="app-menu-102">
            <a href="#">
                <i class="ti-angle-right"></i>
                <p>&nbsp;Kes Dalam Siasatan</p>
            </a>
        </li>  
        <li  id="app-menu-103">
            <a href="#">
                <i class="ti-angle-right"></i>
                <p>&nbsp;Kes Selesai</p>
            </a>
        </li>  
        <li id="app-menu-104">
            <a href="#">
                <i class="ti-angle-right"></i>
                <p>&nbsp;Kes Tiada Tindakan</p>
            </a>
        </li>    
        <li id="app-menu-105">
            <a href="#">
                <i class="ti-angle-right"></i>
                <p>&nbsp;Carian Kes</p>
            </a>
        </li>    
        <li id="app-menu-106">
            <a href="#">
                <i class="ti-angle-right"></i>
                <p>&nbsp;Carian Anggota</p>
            </a>
        </li>                              

        <!-- PENGILANG -->
        <li style="background-color:#EAEAEA;">
            <a href="#" aria-disabled="disabled">
                <i class="ti-home"></i>
                <p>PENGILANG</p>
            </a>
        </li>                
        <li>
            <a href="table_sahmanu.php">
                <i class="ti-angle-right"></i>
                <p>&nbsp;Sah Permohonan</p>
            </a>
        </li>                
        <li>
            <a href="table_manu.php">
                <i class="ti-angle-right"></i>
                <p>&nbsp;Senarai Pengilang</p>
            </a>
        </li> 

        <!-- PRODUK -->
        <li style="background-color:#EAEAEA;">
            <a href="#" aria-disabled="disabled">
                <i class="ti-package"></i>
                <p>PRODUK</p>
            </a>
        </li>                
        <li>
            <a href="#">
                <i class="ti-angle-right"></i>
                <p>&nbsp;Sah Produk</p>
            </a>
        </li>                
        <li>
            <a href="table_prod.php?id=M00001">
                <i class="ti-angle-right"></i>
                <p>&nbsp;Senarai Produk</p>
            </a>
        </li>                


        <!-- TADBIR -->
        <li style="background-color:#EAEAEA;">
            <a href="#" aria-disabled="disabled">
                <i class="ti-settings"></i>
                <p>TADBIR</p>
            </a>
        </li>                
        <li>
            <a href="#">
                <i class="ti-angle-right"></i>
                <p>&nbsp;Pengguna</p>
            </a>
        </li>                
        <li>
            <a href="#">
                <i class="ti-angle-right"></i>
                <p>&nbsp;Settings</p>
            </a>
        </li>                 

    </ul>
</div>

<script type="text/javascript">
    $(document).ready(function(){

        var url = "";
        url = url + "http://myori.afxtechnologies.com/";


        //pageload
        $("#app-content").load('dashboard.php');


        //menulist
        $("#app-menu-001").click(function(){
            setPage(this, 'Dashboard', 'dashboard.php')
        });

        $("#app-menu-101").click(function(){
            setPage(this, 'Kes Baru', 'enc001.php')
        });  
        $("#app-menu-102").click(function(){
            setPage(this, 'Kes Dalam Siasatan', 'enc002.php')
        }); 
        $("#app-menu-103").click(function(){
            setPage(this, 'Kes Selesai', 'enc003.php')
        });         
        $("#app-menu-104").click(function(){
            setPage(this, 'Kes Tiada Tindakan', 'enc004.php')
        });         
        $("#app-menu-105").click(function(){
            setPage(this, 'Carian Kes', 'enc005.php')
        });         
        $("#app-menu-106").click(function(){
            setPage(this, 'Carian Anggota', 'enc006.php')
        });     



        function setPage(li, title, page){
            setActive(li);
            $("#contentTitle").text(title);
            $("#app-content").load(page, function(txt, sts, xhr) {
                console.log("xhr", xhr);
                if (xhr && xhr.status === 200) {}
                else {
                    //alert("Load Page Error: " + xhr.status + " ResponseText: " + xhr.responseText);
                    $("#app-content").html("<h4 class='navbar-brand'> Error " + xhr.status + " - Page: " + xhr.statusText + " </h4>");
                }
            });
        }  

        function setActive(li){
            $("#sidemenu li").removeClass("active");
            $(li).addClass("active");
        }        
        
    });
</script>
