<?php 
$url = $_SERVER['REQUEST_URI'];
$url_arr = explode('/', $url);
for ($i=0; $i < @count($url_arr); $i++) { 
    if($i > 2){   
        $str = $url_arr[$i];
        if(strpos($str,'list') !== false ){
            $url_arr[$i] = strtok($str, '?'); 
            $url_arr[$i] = $url_arr[$i]."1";
        }else{
            $url_arr[$i] = strtok($str, '?'); 
            $url_arr[$i] = $url_arr[$i]."2";
        }
    }
} 
?>
<style type="text/css">
    .ps {
        background: none;
    }
    .left-sidenav-menu li.mm-active .mm-active>a.active {
        color: #1761FE !important;
    }
</style>
        <!-- Left Sidenav -->
        <div class="left-sidenav">
            <!-- LOGO -->
            <div class="brand">
                <a href="javascript:void();" class="logo">
                    <!-- <span>
                        <img src="<?php echo DOCUMENT_ROOT_CLASS;?>assets/images/logo-sm.png" alt="logo-small" class="logo-sm">
                    </span> -->
                    <span>
                        <img src="<?php echo DOCUMENT_ROOT_CLASS;?>assets/images/accessystem-logo-long-white-og.png" alt="ACCESSYSTEM" class="logo-lg logo-light">
                        <img src="<?php echo DOCUMENT_ROOT_CLASS;?>assets/images/accessystem-logo-long.png" alt="ACCESSYSTEM" class="logo-lg logo-dark">
                    </span>
                </a>
            </div>
            <!--end logo-->
            <div class="menu-content h-100" data-simplebar>
                <ul class="metismenu left-sidenav-menu">
                    <!-- <li class="menu-label mt-0">Main</li> -->
                    <!-- <li>
                        <a href="<?php echo DOCUMENT_ROOT_CLASS;?>index.php"> <i data-feather="home" class="align-self-center menu-icon"></i><span>Dashboard</span></a>
                    </li> -->
                    <li>
                        <a href="javascript: void(0);"><i data-feather="grid" class="align-self-center menu-icon"></i><span>Receipts & Voucher</span><span class="menu-arrow"><i class="mdi mdi-chevron-right"></i></span></a>
                        <ul class="nav-second-level" aria-expanded="false">
                            <li class="nav-item <?php echo ( in_array('receipt.php1', $url_arr) OR in_array('view-receipt.php1', $url_arr) OR in_array('view-receipt.php2', $url_arr) OR in_array('receipt-create.php1', $url_arr) OR in_array('receipt-create.php2', $url_arr) OR in_array('receipt-card.php2', $url_arr) )?'mm-active':'';?> "><a class="nav-link" href="<?php echo DOCUMENT_ROOT_CLASS;?>receipt/receipt.php?state=list"><i class="ti-control-record"></i>View Receipts & Voucher</a></li>
                        </ul>
                    </li>
                    <li>
                        <a href="javascript: void(0);"><i class="fas fa-user-cog align-self-center"></i><span>User Settings</span><span class="menu-arrow"><i class="mdi mdi-chevron-right"></i></span></a>
                        <ul class="nav-second-level" aria-expanded="false">
                            <li class="nav-item <?php echo ( in_array('users.php1', $url_arr) OR in_array('users-card.php2', $url_arr) )?'mm-active':'';?>"><a class="nav-link" href="<?php echo DOCUMENT_ROOT_CLASS;?>admin-setting/users.php?state=list"><i class="fas fa-users"></i>User List</a></li>
                                 
                        </ul>
                    </li> 

                    <hr class="hr-dashed hr-menu">
                                       
                    <div class="update-msg text-center">
                        <a href="javascript: void(0);" class="float-right close-btn text-muted" data-dismiss="update-msg" aria-label="Close" aria-hidden="true">
                            <i class="mdi mdi-close"></i>
                        </a>
                        <h5 class="mt-3">QGL Receipt Generation</h5>
                        <p class="mb-3">Solution for your Business</p>
                        <a href="javascript: void(0);" class="btn btn-outline-warning btn-sm">Upgrade your plan</a>
                    </div>

                </ul>
            </div>
        </div>
        <!-- end left-sidenav-->