<?php
$mysqli_page_website = $mysqli->query("SELECT * FROM system_post
                                       WHERE post_type = 'website-page-menu' LIMIT 1") ;
// check table exsits
if ($mysqli_page_website->num_rows > 0){
    $row_page_website = $mysqli_page_website->fetch_array(MYSQLI_ASSOC) ;   
}
?>

<!-- preloader -->
<div class="loading-container"><div class="loading"><div class="l1"><div></div></div><div class="l2"><div></div></div><div class="l3"><div></div></div><div class="l4"><div></div></div></div></div>
<!-- end preloader -->
<!-- left panel -->
<aside class="left-panel">	
    <div class="user text-center">
        <img src="/images/logo.png" />
        <h4 class="user-name"><?= dataFilter($row_user['user_fullname']) ?></h4>
        <div class="dropdown user-login">
        	<button class="btn btn-xs dropdown-toggle btn-rounded" type="button" data-toggle="dropdown" aria-expanded="true">
        		<i class="fa fa-circle status-icon available"></i> <?= $lang['Active']?> <i class="fa fa-angle-down"></i>
        	</button>
            <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                <li role="presentation"><a role="menuitem" href="page-logout.php"><i class="fa fa-circle status-icon signout"></i> <?= $lang['Sign out']?></a></li>
            </ul>
        </div>	 

        <!-- 
        <div class="language">
            <a href="language.php?lang=en&link=//<?= $_SERVER['HTTP_HOST'].urlencode($_SERVER['REQUEST_URI']) ?>" class="<?= $get_lang == 'en' ? 'active' :'' ?>">ENG</a>
            <a href="language.php?lang=cn&link=//<?= $_SERVER['HTTP_HOST'].urlencode($_SERVER['REQUEST_URI']) ?>" class="<?= $get_lang == 'cn' ? 'active' :'' ?>">中文</a>
        </div>
        -->
    </div>
    <nav class="navigation">
        <ul class="list-unstyled">

            <?php if ( permissionWebsite($row_page_website, 'dashboard') ){ ?>
            <?php if ( permissionCheck($row_user, 'dashboard-view') ){ ?>
            	<li class="has-submenu <?= ($active_main_menu == 'dashboard' ? 'active' : '') ?>">
                    <a href="page-dashboard.php">
                        <i class="fa fa-tachometer"></i> <span class="nav-label"><?= $lang['Dashboard']?></span>
                    </a>
                </li>
            <?php } ?>
            <?php } ?>

            <?php if ( permissionWebsite($row_page_website, 'visitor-list') ){ ?>
            <?php if ( permissionCheck($row_user, 'visitor-list-view') ){ ?>
                <li class="has-submenu <?= ($active_main_menu == 'visitor' ? 'active' : '') ?>">
                    <a href="#"><i class="fa fa-male"></i> <span class="nav-label">Visitor</span></a>
                    <ul class="list-unstyled">
                        <?php if ( permissionWebsite($row_page_website, 'visitor-list') ){ ?>
                        <?php if ( permissionCheck($row_user, 'visitor-list-view') ){ ?>
                        <li class="has-submenu <?= ($active_sub_menu == 'visitor-list' ? 'active' : '') ?>"><a href="visitor.php?page_mode=list"><span class="nav-label">List</span></a></li>
                        <?php } ?>
                        <?php } ?>
                    </ul>
                </li>
            <?php } ?>
            <?php } ?>

            <?php if ( permissionWebsite($row_page_website, 'application-form') || permissionWebsite($row_page_website, 'application-pending-list') || permissionWebsite($row_page_website, 'application-offer-list') || permissionWebsite($row_page_website, 'application-confirmation-list') || permissionWebsite($row_page_website, 'application-terminate-list') || permissionWebsite($row_page_website, 'staff-list') || permissionWebsite($row_page_website, 'staff-resign-list') || permissionWebsite($row_page_website, 'staff-run-away-list') || permissionWebsite($row_page_website, 'staff-warning-list') || permissionWebsite($row_page_website, 'attendance-list') || permissionWebsite($row_page_website, 'attendance-report') || permissionWebsite($row_page_website, 'attendance-qrcode') || permissionWebsite($row_page_website, 'attendance-health') || permissionWebsite($row_page_website, 'leave') || permissionWebsite($row_page_website, 'advance') || permissionWebsite($row_page_website, 'payment-slip') || permissionWebsite($row_page_website, 'hr-merit-points-movement') || permissionWebsite($row_page_website, 'hr-merit-points-adjustment') || permissionWebsite($row_page_website, 'hr-merit-points-task')  ){ ?>
            <?php if ( permissionCheck($row_user, 'application-form-view') || permissionCheck($row_user, 'application-list-view')  || permissionCheck($row_user, 'staff-list-view') || permissionCheck($row_user, 'staff-resign-list-view') || permissionCheck($row_user, 'staff-run-away-list-view') || permissionCheck($row_user, 'staff-warning-list-view') || permissionCheck($row_user, 'attendance-list-view') || permissionCheck($row_user, 'attendance-report-view') || permissionCheck($row_user, 'attendance-qrcode-view') || permissionCheck($row_user, 'attendance-health-view') || permissionCheck($row_user, 'leave-view') || permissionCheck($row_user, 'advance-view') || permissionCheck($row_user, 'payment-slip-view') || permissionCheck($row_user, 'hr-merit-points-movement-view') || permissionCheck($row_user, 'hr-merit-points-adjustment-view') || permissionCheck($row_user, 'hr-merit-points-task-view')  ){ ?>
                <li class="has-submenu <?= ($active_main_menu == 'hr' ? 'active' : '') ?>"><a href="#"><i class="fa fa-user"></i> <span class="nav-label"><?= $lang['HR']?></span></a>
                    <ul class="list-unstyled">

                        <?php if ( permissionWebsite($row_page_website, 'application-form') || permissionWebsite($row_page_website, 'application-pending-list') || permissionWebsite($row_page_website, 'application-offer-list') || permissionWebsite($row_page_website, 'application-confirmation-list') || permissionWebsite($row_page_website, 'application-terminate-list') ){ ?>
                        <?php if ( permissionCheck($row_user, 'application-form-view') || permissionCheck($row_user, 'application-list-view') ){ ?>
                            <li class="has-submenu <?= ($active_sub_menu == 'hr-employment' ? 'active' : '') ?>"><a href="#"><i class="fa fa-user-circle-o" aria-hidden="true"></i> <span class="nav-label"><?= $lang['Staff Application']?></span></a>
                                <ul class="list-unstyled">
                                    <?php if ( permissionWebsite($row_page_website, 'application-form') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'application-form-view') ){ ?>
                                    <li class="<?= ($active_menu == 'hr-employment-new' ? 'active' : '') ?>"><a href="hr-employment.php?page_mode=new&type=new"><span class="nav-label"><?= $lang['Application Form']?></span></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'application-pending-list') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'application-list-view') ){ ?>
                                    <li class="<?= $active_menu == 'hr-letter-pending' ? 'active' : '' ?>"><a href="hr-employment.php?page_mode=all&select_worker=Local&type=pending"><?= $lang['Pending'].' '.$lang['list']?> </a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'application-offer-list') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'application-list-view') ){ ?>
                                    <li class="<?= $active_menu == 'hr-letter-offer' ? 'active' : '' ?>"><a href="hr-employment.php?page_mode=all&select_worker=Local&type=offer"><?= $lang['Offer'].' '.$lang['list']?> </a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'application-confirmation-list') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'application-list-view') ){ ?>
                                    <li class="<?= $active_menu == 'hr-letter-confirmation' ? 'active' : '' ?>"><a href="hr-employment.php?page_mode=all&select_worker=Local&type=confirmation"><?= $lang['Confirmation'].' '.$lang['list']?> </a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'application-terminate-list') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'application-list-view') ){ ?>
                                    <li class="<?= $active_menu == 'hr-letter-terminate' ? 'active' : '' ?>"><a href="hr-employment.php?page_mode=all&select_worker=Local&type=terminate"><?= $lang['Terminate'].' '.$lang['list']?> </a></li>
                                    <?php } ?>
                                    <?php } ?>
                                </ul>
                            </li>
                        <?php } ?>
                        <?php } ?>


                        <?php if ( permissionWebsite($row_page_website, 'staff-list') || permissionWebsite($row_page_website, 'staff-resign-list') || permissionWebsite($row_page_website, 'staff-run-away-list') || permissionWebsite($row_page_website, 'staff-warning-list') || permissionWebsite($row_page_website, 'staff-adjustment') ){ ?>
                        <?php if ( permissionCheck($row_user, 'staff-list-view') || permissionCheck($row_user, 'staff-resign-list-view') || permissionCheck($row_user, 'staff-run-away-list-view') || permissionCheck($row_user, 'staff-warning-list-view') || permissionCheck($row_user, 'staff-adjustment-view') ){ ?>

                            <li class="has-submenu <?= ($active_sub_menu == 'hr-staff' ? 'active' : '') ?>"><a href="#"><i class="fa fa-users" aria-hidden="true"></i> <span class="nav-label"><?= $lang['Staff']?></span></a>
                                <ul class="list-unstyled">
                                    <?php if ( permissionWebsite($row_page_website, 'staff-list') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'staff-list-view') ){ ?>
                                    <li class="<?= ($active_menu == 'hr-staff-list' ? 'active' : '') ?>"><a href="hr-staff.php?page_mode=all"> <span class="nav-label"><?= $lang['list']?></span></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'staff-point-history') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'staff-point-history-view') ){ ?>
                                    <li class="<?= ($active_menu == 'hr-staff-point-history' ? 'active' : '') ?>"><a href="hr-staff.php?page_mode=staff-point-history"> <span class="nav-label">Point Movement</span></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'staff-resign-list') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'staff-resign-list-view') ){ ?>
                                    <li class="<?= ($active_menu == 'hr-staff-resgined' ? 'active' : '') ?>"><a href="hr-staff.php?page_mode=resign"> <span class="nav-label"><?= $lang['Resign List']?></span></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'staff-run-away-list') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'staff-run-away-list-view') ){ ?>
                                    <li class="<?= ($active_menu == 'hr-staff-run-away' ? 'active' : '') ?>"><a href="hr-staff.php?page_mode=run_away"> <span class="nav-label"><?= $lang['Run Away List']?></span></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'staff-warning-list') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'staff-warning-list-view') ){ ?>
                                    <li class="<?= ($active_menu == 'hr-staff-warning' ? 'active' : '') ?>"><a href="hr-staff-request.php?page_mode=warning"> <span class="nav-label"><?= $lang['Warning Letter']?></span></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'staff-adjustment') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'staff-adjustment-view') ){ ?>
                                    <li class="<?= ($active_menu == 'hr-staff-adjustment' ? 'active' : '') ?>"><a href="hr-staff-adjustment.php?page_mode=all"> <span class="nav-label"><?= $lang['Adjustment']?></span></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                </ul>
                            </li> 
                        <?php } ?>
                        <?php } ?>


                        <?php if ( permissionWebsite($row_page_website, 'hr-merit-points-movement') || permissionWebsite($row_page_website, 'hr-merit-points-adjustment') || permissionWebsite($row_page_website, 'hr-merit-points-task') ){ ?>
                        <?php if ( permissionCheck($row_user, 'hr-merit-points-movement-view') || permissionCheck($row_user, 'hr-merit-points-adjustment-view') || permissionCheck($row_user, 'hr-merit-points-task-view') ){ ?>
                            <li class="has-submenu <?= ($active_sub_menu == 'hr-merit-points' ? 'active' : '') ?>"><a href="#"><i class="fa fa-bar-chart" aria-hidden="true"></i> <span class="nav-label">Merit Points System</span></a>
                                <ul class="list-unstyled">
                                    <?php if ( permissionWebsite($row_page_website, 'hr-merit-points-movement') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'hr-merit-points-movement-view') ){ ?>
                                    <li class="<?= ($active_menu == 'hr-merit-points-movement' ? 'active' : '') ?>"><a href="hr-merit-points.php?page_mode=movement"> <span class="nav-label">Movement</span></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'hr-merit-points-adjustment') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'hr-merit-points-adjustment-view') ){ ?>
                                    <li class="<?= ($active_menu == 'hr-merit-points-adjustment' ? 'active' : '') ?>"><a href="hr-merit-points.php?page_mode=adjustment"> <span class="nav-label">Adjustment Record</span></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'hr-merit-points-task') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'hr-merit-points-task-view') ){ ?>
                                    <li class="<?= ($active_menu == 'hr-merit-points-task' ? 'active' : '') ?>"><a href="hr-merit-points.php?page_mode=task"> <span class="nav-label">Task Record</span></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                </ul>
                            </li> 
                        <?php } ?>
                        <?php } ?>

                        <?php if ( permissionWebsite($row_page_website, 'attendance-list') || permissionWebsite($row_page_website, 'attendance-report') || permissionWebsite($row_page_website, 'attendance-qrcode') || permissionWebsite($row_page_website, 'attendance-health') ){ ?>
                        <?php if ( permissionCheck($row_user, 'attendance-list-view') || permissionCheck($row_user, 'attendance-report-view') || permissionCheck($row_user, 'attendance-qrcode-view') || permissionCheck($row_user, 'attendance-health-view') ){ ?>
                            <li class="has-submenu <?= ($active_sub_menu == 'hr-attendance' ? 'active' : '') ?>"><a href="#"><i class="fa fa-clock-o" aria-hidden="true"></i> <span class="nav-label"><?= $lang['attendance']?></span></a>
                                <ul class="list-unstyled">
                                    <?php if ( permissionWebsite($row_page_website, 'attendance-list') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'attendance-list-view') ){ ?>
                                    <li class="<?= ($active_menu == 'hr-attendance-list' ? 'active' : '') ?>"><a href="hr-attendance.php?page_mode=list"><span class="nav-label"><?= $lang['list']?></span></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'attendance-report') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'attendance-report-view') ){ ?>
                                    <li class="<?= ($active_menu == 'hr-attendance-report' ? 'active' : '') ?>"><a href="hr-attendance.php?page_mode=report"><span class="nav-label"><?= $lang['Report']?></span></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'attendance-qrcode') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'attendance-qrcode-view') ){ ?>
                                    <li class="<?= ($active_menu == 'hr-attendance-qrcode' ? 'active' : '') ?>"><a href="hr-attendance.php?page_mode=qrcode"><span class="nav-label"><?= $lang['Qrcode']?></span></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'attendance-health') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'attendance-health-view') ){ ?>
                                    <li class="<?= ($active_menu == 'hr-health' ? 'active' : '') ?>"><a href="hr-health.php?page_mode=record-all"><span class="nav-label">Health</span></a></li>
                                    <?php } ?>
                                    <?php } ?> 
                                    <?php if ( permissionWebsite($row_page_website, 'attendance-list-import') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'attendance-list-import') ){ ?>
                                    <li class="<?= ($active_menu == 'hr-staff-attendance' ? 'active' : '') ?>"><a href="hr-staff.php?page_mode=staff-attendance"> <span class="nav-label"><?= $lang['Import']?></span></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                </ul>
                            </li> 
                        <?php } ?>
                        <?php } ?>


                        <?php if ( permissionWebsite($row_page_website, 'leave') ){ ?>
                        <?php if ( permissionCheck($row_user, 'leave-view') ){ ?>
                        <li class="has-submenu <?= ($active_sub_menu == 'hr-leave' ? 'active' : '') ?>"><a href="hr-leave.php?page_mode=list&ist_type=confirmed"><i class="fa fa-sign-out" aria-hidden="true"></i> <span class="nav-label"><?= $lang['Leave']?></span></a></li>
                        <?php } ?>
                        <?php } ?>
                        <?php if ( permissionWebsite($row_page_website, 'advance') ){ ?>
                        <?php if ( permissionCheck($row_user, 'advance-view') ){ ?>
                        <li class="has-submenu <?= ($active_sub_menu == 'hr-advance' ? 'active' : '') ?>"><a href="hr-advance.php?page_mode=list"><i class="fa fa-credit-card" aria-hidden="true"></i> <span class="nav-label"><?= $lang['advance']?></span></a></li>
                        <?php } ?>
                        <?php } ?>
                        <?php if ( permissionWebsite($row_page_website, 'payment-slip') ){ ?>
                        <?php if ( permissionCheck($row_user, 'payment-slip-view') ){ ?>
                        <li class="has-submenu <?= ($active_sub_menu == 'hr-payment-slip' ? 'active' : '') ?>"><a href="hr-payment-slip.php?page_mode=list"><i class="fa fa-money" aria-hidden="true"></i> <span class="nav-label"><?= $lang['payment-slip']?></span></a></li>
                        <?php } ?>
                        <?php } ?>
                    </ul>
                </li>
            <?php } ?>
            <?php } ?>

            <?php if ( permissionWebsite($row_page_website, 'task-list') || permissionWebsite($row_page_website, 'task-report') ){ ?>
            <?php if ( permissionCheck($row_user, 'task-list-view') || permissionCheck($row_user, 'task-report-view') ){ ?>
                <li class="has-submenu <?= ($active_main_menu == 'task' ? 'active' : '') ?>">
                    <a href="#"><i class="fa fa-tasks"></i> <span class="nav-label">Task</span></a>
                    <ul class="list-unstyled">
                        <?php if ( permissionWebsite($row_page_website, 'task-list') ){ ?>
                        <?php if ( permissionCheck($row_user, 'task-list-view') ){ ?>
                        <li class="has-submenu <?= ($active_sub_menu == 'task-list' ? 'active' : '') ?>"><a href="task.php?page_mode=list"><span class="nav-label">List</span></a></li>
                        <?php } ?>
                        <?php } ?>
                        <?php if ( permissionWebsite($row_page_website, 'task-report') ){ ?>
                        <?php if ( permissionCheck($row_user, 'task-report-view') ){ ?>
                        <li class="has-submenu <?= ($active_sub_menu == 'task-report' ? 'active' : '') ?>"><a href="task-report.php"><span class="nav-label">Report</span></a></li>
                        <?php } ?>
                        <?php } ?>
                    </ul>
                </li>
            <?php } ?>
            <?php } ?>

            <?php if ( permissionWebsite($row_page_website, 'announcement') || permissionWebsite($row_page_website, 'inbox') || permissionWebsite($row_page_website, 'our-suggestion') ||permissionWebsite($row_page_website, 'our-main-request') || permissionWebsite($row_page_website, 'our-sub-request') || permissionWebsite($row_page_website, 'our-request') || permissionWebsite($row_page_website, 'redeem-list') || permissionWebsite($row_page_website, 'redeem-category') || permissionWebsite($row_page_website, 'association-list') || permissionWebsite($row_page_website, 'association-category') || permissionWebsite($row_page_website, 'training') || permissionWebsite($row_page_website, 'handbook-list') || permissionWebsite($row_page_website, 'handbook-main-category') || permissionWebsite($row_page_website, 'handbook-sub-category') || permissionWebsite($row_page_website, 'catalog-list') || permissionWebsite($row_page_website, 'catalog-main-category') || permissionWebsite($row_page_website, 'catalog-sub-category') ){ ?>
            <?php if ( permissionCheck($row_user, 'announcement-view') || permissionCheck($row_user, 'inbox-view') || permissionCheck($row_user, 'our-suggestion-view') ||permissionCheck($row_user, 'our-main-request-view') || permissionCheck($row_user, 'our-sub-request-view') || permissionCheck($row_user, 'our-request-view') || permissionCheck($row_user, 'redeem-list-view') || permissionCheck($row_user, 'redeem-category-view') || permissionCheck($row_user, 'association-list-view') || permissionCheck($row_user, 'association-category-view') || permissionCheck($row_user, 'training-view') || permissionCheck($row_user, 'handbook-list-view') || permissionCheck($row_user, 'handbook-main-category-view') || permissionCheck($row_user, 'handbook-sub-category-view') || permissionCheck($row_user, 'catalog-list-view') || permissionCheck($row_user, 'catalog-main-category-view') || permissionCheck($row_user, 'catalog-sub-category-view') ){ ?>

                <li class="has-submenu <?= ($active_main_menu == 'service' ? 'active' : '') ?>">
                    <a href="#"><i class="fa fa-briefcase"></i> <span class="nav-label">Service</span></a>
                    <ul class="list-unstyled">

                        <?php if ( permissionWebsite($row_page_website, 'announcement') ){ ?>
                        <?php if ( permissionCheck($row_user, 'announcement-view') ){ ?>
                        <li class="has-submenu <?= ($active_sub_menu == 'service-announcement' ? 'active' : '') ?>"><a href="service-announcement.php?page_mode=list"><i class="fa fa-picture-o" aria-hidden="true"></i> <span class="nav-label"><?= $lang['announcement']?></span></a></li>
                        <?php } ?>
                        <?php } ?>

                        <?php if ( permissionWebsite($row_page_website, 'inbox') ){ ?>
                        <?php if ( permissionCheck($row_user, 'inbox-view') ){ ?>
                        <li class="has-submenu <?= ($active_sub_menu == 'inbox' ? 'active' : '') ?>"><a href="inbox.php?page_mode=list"><i class="fa fa-newspaper-o" aria-hidden="true"></i> <span class="nav-label">Employee Inbox</span></a></li>
                        <?php } ?>
                        <?php } ?>

                        <?php if ( permissionWebsite($row_page_website, 'our-suggestion') || permissionWebsite($row_page_website, 'our-request') ||permissionWebsite($row_page_website, 'our-main-request') || permissionWebsite($row_page_website, 'our-sub-request') ){ ?>
                        <?php if ( permissionCheck($row_user, 'our-suggestion-view') || permissionCheck($row_user, 'our-request-view') ||permissionCheck($row_user, 'our-main-request-view') || permissionCheck($row_user, 'our-sub-request-view') ){ ?>
                        <li class="has-submenu <?= ($active_sub_menu == 'ourinbox' ? 'active' : '') ?>"><a href="#"><i class="fa fa-comment"></i> <span class="nav-label"><?= COMPANYSHORT ?> Inbox</span></a>
                            <ul class="list-unstyled">
                                <?php if ( permissionWebsite($row_page_website, 'our-suggestion') ){ ?>
                                <?php if ( permissionCheck($row_user, 'our-suggestion-view') ){ ?>
                                <li class="has-submenu <?= ($active_menu == 'ourinbox-suggestion-list' ? 'active' : '') ?>"><a href="app-suggestion.php?page_mode=list"><span class="nav-label">Suggestion</span></a></li>
                                <?php } ?>
                                <?php } ?>
                                <?php if ( permissionWebsite($row_page_website, 'our-request') ){ ?>
                                <?php if ( permissionCheck($row_user, 'our-request-view') ){ ?>
                                <li class="has-submenu <?= ($active_menu == 'ourinbox-request-list' ? 'active' : '') ?>"><a href="app-request.php?page_mode=list"><span class="nav-label">Request</span></a></li>
                                <?php } ?>
                                <?php } ?>
                                <?php if ( permissionWebsite($row_page_website, 'our-main-request') ){ ?>
                                <?php if ( permissionCheck($row_user, 'our-main-request-view') ){ ?>
                                <li class="has-submenu <?= ($active_menu == 'service-request-main' ? 'active' : '') ?>"><a href="app-request-main.php?page_mode=list"><span class="nav-label">Main Category</span></a></li>
                                <?php } ?>
                                <?php } ?>
                                <?php if ( permissionWebsite($row_page_website, 'our-sub-request') ){ ?>
                                <?php if ( permissionCheck($row_user, 'our-sub-request-view') ){ ?>
                                <li class="has-submenu <?= ($active_menu == 'service-request-sub' ? 'active' : '') ?>"><a href="app-request-sub.php?page_mode=list"><span class="nav-label">Sub Category</span></a></li>
                                <?php } ?>
                                <?php } ?>
                                <?php if ( permissionWebsite($row_page_website, 'our-grievance') ){ ?>
                                <?php if ( permissionCheck($row_user, 'our-grievance-view') ){ ?>
                                <li class="has-submenu <?= ($active_menu == 'ourinbox-grievance-list' ? 'active' : '') ?>"><a href="app-grievance.php?page_mode=list"><span class="nav-label">Grievance</span></a></li>
                                <?php } ?>
                                <?php } ?>
                            </ul>
                        </li>
                        <?php } ?>
                        <?php } ?>

                        <?php if ( permissionWebsite($row_page_website, 'redeem-list') || permissionWebsite($row_page_website, 'redeem-category') ){ ?>
                        <?php if ( permissionCheck($row_user, 'redeem-list-view') || permissionCheck($row_user, 'redeem-category-view') ){ ?>
                        <li class="has-submenu <?= ($active_sub_menu == 'redeem' ? 'active' : '') ?>"><a href="#"><i class="fa fa-gift"></i> <span class="nav-label">Redeem</span></a>
                            <ul class="list-unstyled">
                                <?php if ( permissionWebsite($row_page_website, 'redeem-list') ){ ?>
                                <?php if ( permissionCheck($row_user, 'redeem-list-view') ){ ?>
                                <!-- <li class="<?= $active_menu == 'redeem-list-list' ? 'active' : '' ?>"><a href="app-redeem.php?page_mode=all">List</a></li> -->
                                <li class="<?= $active_menu == 'redeem-list-list' ? 'active' : '' ?>"><a href="app-redeem.php?page_mode=category">List</a></li>
                                <?php } ?>
                                <?php } ?>
                                <?php if ( permissionWebsite($row_page_website, 'redeem-category') ){ ?>
                                <?php if ( permissionCheck($row_user, 'redeem-category-view') ){ ?>
                                <li class="<?= $active_menu == 'redeem-list-category' ? 'active' : '' ?>"><a href="app-redeem.php?page_mode=category">Category</a></li>
                                <?php } ?>
                                <?php } ?>
                            </ul>
                        </li>
                        <?php } ?>
                        <?php } ?>

                        <?php if ( permissionWebsite($row_page_website, 'association-list') || permissionWebsite($row_page_website, 'association-category') ){ ?>
                        <?php if ( permissionCheck($row_user, 'association-list-view') || permissionCheck($row_user, 'association-category-view') ){ ?>
                        <li class="has-submenu <?= ($active_sub_menu == 'association' ? 'active' : '') ?>"><a href="#"><i class="fa fa-share-square"></i> <span class="nav-label">Association</span></a>
                            <ul class="list-unstyled">
                                <?php if ( permissionWebsite($row_page_website, 'association-list') ){ ?>
                                <?php if ( permissionCheck($row_user, 'association-list-view') ){ ?>
                                <li class="<?= $active_menu == 'association-list-list' ? 'active' : '' ?>"><a href="app-association.php?page_mode=all">List</a></li>
                                <?php } ?>
                                <?php } ?>
                                <?php if ( permissionWebsite($row_page_website, 'association-category') ){ ?>
                                <?php if ( permissionCheck($row_user, 'association-category-view') ){ ?>
                                <li class="<?= $active_menu == 'association-list-category' ? 'active' : '' ?>"><a href="app-association-category.php?page_mode=all">Category</a></li>
                                <?php } ?>
                                <?php } ?>
                            </ul>
                        </li>
                        <?php } ?>
                        <?php } ?>

                        <?php if ( permissionWebsite($row_page_website, 'training') ){ ?>
                        <?php if ( permissionCheck($row_user, 'training-view') ){ ?>
                        <li class="has-submenu <?= ($active_sub_menu == 'training' ? 'active' : '') ?>"><a href="app-training.php?page_mode=all"><i class="fa fa-calendar-o"></i> <span class="nav-label">Training</span></a></li>
                        <?php } ?>
                        <?php } ?>

                        <?php if ( permissionWebsite($row_page_website, 'handbook-list') || permissionWebsite($row_page_website, 'handbook-main-category') || permissionWebsite($row_page_website, 'handbook-sub-category') ){ ?>
                        <?php if ( permissionCheck($row_user, 'handbook-list-view') || permissionCheck($row_user, 'handbook-main-category-view') || permissionCheck($row_user, 'handbook-sub-category-view') ){ ?>
                        <li class="has-submenu <?= ($active_sub_menu == 'handbook' ? 'active' : '') ?>"><a href="#"><i class="fa fa-book"></i> <span class="nav-label">Handbook</span></a>
                            <ul class="list-unstyled">
                                <?php if ( permissionWebsite($row_page_website, 'handbook-list') ){ ?>
                                <?php if ( permissionCheck($row_user, 'handbook-list-view') ){ ?>
                                <li class="has-submenu <?= ($active_menu == 'handbook-list-list' ? 'active' : '') ?>"><a href="app-handbook.php?page_mode=list"><span class="nav-label">List</span></a></li>
                                <?php } ?>
                                <?php } ?>
                                <?php if ( permissionWebsite($row_page_website, 'handbook-main-category') ){ ?>
                                <?php if ( permissionCheck($row_user, 'handbook-main-category-view') ){ ?>
                                <li class="has-submenu <?= ($active_menu == 'handbook-main-category' ? 'active' : '') ?>"><a href="app-handbook-maincategory.php?page_mode=list"><span class="nav-label">Main Category</span></a></li>
                                <?php } ?>
                                <?php } ?>
                                <?php if ( permissionWebsite($row_page_website, 'handbook-sub-category') ){ ?>
                                <?php if ( permissionCheck($row_user, 'handbook-sub-category-view') ){ ?>
                                <li class="has-submenu <?= ($active_menu == 'handbook-sub-category' ? 'active' : '') ?>"><a href="app-handbook-subcategory.php?page_mode=list"><span class="nav-label">Sub Category</span></a></li>
                                <?php } ?>
                                <?php } ?>
                            </ul>
                        </li>
                        <?php } ?>
                        <?php } ?>

                        <?php if ( permissionWebsite($row_page_website, 'catalog-list') || permissionWebsite($row_page_website, 'catalog-main-category') || permissionWebsite($row_page_website, 'catalog-sub-category') ){ ?>
                        <?php if ( permissionCheck($row_user, 'catalog-list-view') || permissionCheck($row_user, 'catalog-main-category-view') || permissionCheck($row_user, 'catalog-sub-category-view') ){ ?>
                        <li class="has-submenu <?= ($active_sub_menu == 'catalog' ? 'active' : '') ?>"><a href="#"><i class="fa fa-product-hunt"></i> <span class="nav-label">Catalog</span></a>
                            <ul class="list-unstyled">
                                <?php if ( permissionWebsite($row_page_website, 'catalog-list') ){ ?>
                                <?php if ( permissionCheck($row_user, 'catalog-list-view') ){ ?>
                                <li class="has-submenu <?= ($active_menu == 'catalog-list-list' ? 'active' : '') ?>"><a href="app-catalog.php?page_mode=list"><span class="nav-label">List</span></a></li>
                                <?php } ?>
                                <?php } ?>
                                <?php if ( permissionWebsite($row_page_website, 'catalog-main-category') ){ ?>
                                <?php if ( permissionCheck($row_user, 'catalog-main-category-view') ){ ?>
                                <li class="has-submenu <?= ($active_menu == 'catalog-main-category' ? 'active' : '') ?>"><a href="app-catalog-maincategory.php?page_mode=list"><span class="nav-label">Main Category</span></a></li>
                                <?php } ?>
                                <?php } ?>
                                <?php if ( permissionWebsite($row_page_website, 'catalog-sub-category') ){ ?>
                                <?php if ( permissionCheck($row_user, 'catalog-sub-category-view') ){ ?>
                                <li class="has-submenu <?= ($active_menu == 'catalog-sub-category' ? 'active' : '') ?>"><a href="app-catalog-subcategory.php?page_mode=list"><span class="nav-label">Sub Category</span></a></li>
                                <?php } ?>
                                <?php } ?>
                            </ul>
                        </li>
                        <?php } ?>
                        <?php } ?>

                    </ul>
                </li>
            <?php } ?>
            <?php } ?>
        	
            <?php if ( permissionWebsite($row_page_website, 'user-user') || permissionWebsite($row_page_website, 'user-new-user') || permissionWebsite($row_page_website, 'user-notification') || permissionWebsite($row_page_website, 'user-new-notification') || permissionWebsite($row_page_website, 'user-letterhead') || permissionWebsite($row_page_website, 'hr-branch') || permissionWebsite($row_page_website, 'hr-working-hours') || permissionWebsite($row_page_website, 'hr-leave-setting') || permissionWebsite($row_page_website, 'hr-sick-setting') || permissionWebsite($row_page_website, 'hr-holiday-list') || permissionWebsite($row_page_website, 'hr-hostel-list') || permissionWebsite($row_page_website, 'hr-knowledge-list') || permissionWebsite($row_page_website, 'hr-department-list') || permissionWebsite($row_page_website, 'hr-section-list') || permissionWebsite($row_page_website, 'hr-position-list') || permissionWebsite($row_page_website, 'hr-advance-setting') || permissionWebsite($row_page_website, 'hr-chief-list') || permissionWebsite($row_page_website, 'app-welcome-screen') || permissionWebsite($row_page_website, 'app-pop-up') || permissionWebsite($row_page_website, 'app-service') || permissionWebsite($row_page_website, 'app-page') || permissionWebsite($row_page_website, 'app-menu') || permissionWebsite($row_page_website, 'app-support') || permissionWebsite($row_page_website, 'app-point') || permissionWebsite($row_page_website, 'app-adjustment') || permissionWebsite($row_page_website, 'profile-star') || permissionWebsite($row_page_website, 'profile-point') || permissionWebsite($row_page_website, 'profile-achievement') || permissionWebsite($row_page_website, 'profile-tier') ){ ?>
            <?php if ( permissionCheck($row_user, 'user-user-view') || permissionCheck($row_user, 'user-new-user-new') || permissionCheck($row_user, 'user-notification-view') || permissionCheck($row_user, 'user-new-notification-view') || permissionCheck($row_user, 'user-letterhead-view') || permissionCheck($row_user, 'hr-branch-view') || permissionCheck($row_user, 'hr-working-hours-view') || permissionCheck($row_user, 'hr-leave-setting-view') || permissionCheck($row_user, 'hr-sick-setting-view') || permissionCheck($row_user, 'hr-holiday-list-view') || permissionCheck($row_user, 'hr-hostel-list-view') || permissionCheck($row_user, 'hr-knowledge-list-view') || permissionCheck($row_user, 'hr-department-list-view') || permissionCheck($row_user, 'hr-section-list-view') || permissionCheck($row_user, 'hr-position-list-view') || permissionCheck($row_user, 'hr-advance-setting-view') || permissionCheck($row_user, 'hr-chief-list-view') || permissionCheck($row_user, 'app-welcome-screen-view') || permissionCheck($row_user, 'app-pop-up-view') || permissionCheck($row_user, 'app-service-view') || permissionCheck($row_user, 'app-page-view') || permissionCheck($row_user, 'app-menu-view') || permissionCheck($row_user, 'app-support-view') || permissionCheck($row_user, 'app-point-view') || permissionCheck($row_user, 'app-adjustment-view') || permissionCheck($row_user, 'profile-star-view') || permissionCheck($row_user, 'profile-point-view') || permissionCheck($row_user, 'profile-achievement-view') || permissionCheck($row_user, 'profile-tier-view') ){ ?>
                <li class="has-submenu <?= ($active_main_menu == 'setting' ? 'active' : '') ?>"><a href="#"><i class="fa fa-cog"></i> <span class="nav-label"><?= $lang['Settings']?></span></a>
                    <ul class="list-unstyled">
                        
                            <?php if ( permissionWebsite($row_page_website, 'user-user') || permissionWebsite($row_page_website, 'user-new-user') ){ ?>
                            <?php if ( permissionCheck($row_user, 'user-user-view') || permissionCheck($row_user, 'user-new-user-new') ){ ?>
                            <li class="has-submenu <?= ($active_sub_menu == 'setting-user' ? 'active' : '') ?>"><a href="#"><i class="fa fa-user-plus"></i> <span class="nav-label"><?= $lang['User'].$lang['setting']?></span></a>
                                <ul class="list-unstyled">

                                        <?php if ( permissionWebsite($row_page_website, 'user-user') ){ ?>
                                        <?php if ( permissionCheck($row_user, 'user-user-view') ){ ?>
                                    <li class="<?= $active_menu == 'user' ? 'active' : '' ?>"><a href="user.php?page_mode=all"><?= $lang['User']?></a></li>
                                        <?php } ?>
                                        <?php } ?>
                                        <?php if ( permissionWebsite($row_page_website, 'user-new-user') ){ ?>
                                        <?php if ( permissionCheck($row_user, 'user-new-user-new') ){ ?>
                                        <li class="<?= $active_menu == 'user-new' ? 'active' : '' ?>"><a href="user.php?page_mode=new"><?= $lang['New'].$lang['User']?></a></li>
                                        <?php } ?>
                                        <?php } ?>

                                </ul>
                            </li>
                            <?php } ?>
                            <?php } ?>

                        <?php if ( permissionWebsite($row_page_website, 'user-notification') || permissionWebsite($row_page_website, 'user-new-notification') || permissionWebsite($row_page_website, 'user-letterhead') ){ ?>
                        <?php if ( permissionCheck($row_user, 'user-notification-view') || permissionCheck($row_user, 'user-new-notification-view') || permissionCheck($row_user, 'user-letterhead-view') ){ ?>
                        <li class="has-submenu <?= ($active_sub_menu == 'setting-notification' ? 'active' : '') ?>"><a href="#"><i class="fa fa-user-plus"></i> <span class="nav-label">Service Annoucment</span></a>
                            <ul class="list-unstyled">
                                    <?php if ( permissionWebsite($row_page_website, 'user-notification') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'user-notification-view') ){ ?>
                                    <li class="<?= $active_menu == 'page-notification' ? 'active' : '' ?>"><a href="page-notification.php?page_mode=all"><?= $lang['Notification']?></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'user-new-notification') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'user-new-notification-view') ){ ?>
                                    <li class="<?= $active_menu == 'page-notification-new' ? 'active' : '' ?>"><a href="page-notification.php?page_mode=new"><?= $lang['New'].$lang['Notification']?></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'user-letterhead') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'user-letterhead-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-letterhead' ? 'active' : '' ?>"><a href="setting-letterhead.php?page_mode=all"><?= $lang['Letterhead']?></a></li>
                                    <?php } ?>
                                    <?php } ?>

                            </ul>
                        </li>
                        <?php } ?>
                        <?php } ?>
                        
                            <?php if ( permissionWebsite($row_page_website, 'hr-branch') || permissionWebsite($row_page_website, 'hr-working-hours') || permissionWebsite($row_page_website, 'hr-leave-setting') || permissionWebsite($row_page_website, 'hr-sick-setting') || permissionWebsite($row_page_website, 'hr-holiday-list') || permissionWebsite($row_page_website, 'hr-hostel-list') || permissionWebsite($row_page_website, 'hr-knowledge-list') || permissionWebsite($row_page_website, 'hr-department-list') || permissionWebsite($row_page_website, 'hr-section-list') || permissionWebsite($row_page_website, 'hr-position-list') || permissionWebsite($row_page_website, 'hr-advance-setting') || permissionWebsite($row_page_website, 'hr-chief-list') ){ ?>
                            <?php if ( permissionCheck($row_user, 'hr-branch-view') || permissionCheck($row_user, 'hr-working-hours-view') || permissionCheck($row_user, 'hr-leave-setting-view') || permissionCheck($row_user, 'hr-sick-setting-view') || permissionCheck($row_user, 'hr-holiday-list-view') || permissionCheck($row_user, 'hr-hostel-list-view') || permissionCheck($row_user, 'hr-knowledge-list-view') || permissionCheck($row_user, 'hr-department-list-view') || permissionCheck($row_user, 'hr-section-list-view') || permissionCheck($row_user, 'hr-position-list-view') || permissionCheck($row_user, 'hr-advance-setting-view') || permissionCheck($row_user, 'hr-chief-list-view') ){ ?>
                            <li class="has-submenu <?= ($active_sub_menu == 'setting-hr' ? 'active' : '') ?>"><a href="#"><i class="fa fa-users"></i> <span class="nav-label"><?= $lang['HR'].' '.$lang['setting']?></span></a>
                                <ul class="list-unstyled">
                                    <?php if ( permissionWebsite($row_page_website, 'hr-branch') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'hr-branch-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-hr-branch' ? 'active' : '' ?>"><a href="setting-branch.php?page_mode=all"><?= $lang['branch']?></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'hr-working-hours') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'hr-working-hours-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-hr-working' ? 'active' : '' ?>"><a href="setting-working.php?page_mode=all"><?= $lang['working_hours']?></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'hr-leave-setting') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'hr-leave-setting-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-hr-leave' ? 'active' : '' ?>"><a href="setting-leave.php?page_mode=all"><?= $lang['Leave'].' '.$lang['setting']?></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'hr-sick-setting') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'hr-sick-setting-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-hr-sick' ? 'active' : '' ?>"><a href="setting-sick.php?page_mode=all"><?= $lang['sick1'].' '.$lang['setting']?></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'hr-holiday-list') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'hr-holiday-list-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-hr-holiday' ? 'active' : '' ?>"><a href="setting-holiday.php?page_mode=all"><?= $lang['Holiday'].' '.$lang['list']?></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'hr-hostel-list') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'hr-hostel-list-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-hr-hostel' ? 'active' : '' ?>"><a href="setting-hostel.php?page_mode=all"><?= $lang['Hostel'].' '.$lang['list']?></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'hr-knowledge-list') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'hr-knowledge-list-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-hr-knowledge' ? 'active' : '' ?>"><a href="setting-knowledge.php?page_mode=all"><?= $lang['knowledge'].' '.$lang['list']?></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'hr-department-list') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'hr-department-list-View') ){ ?>
                                    <li class="<?= $active_menu == 'setting-hr-department' ? 'active' : '' ?>"><a href="page-department.php?page_mode=all"><?= $lang['Department'].' '.$lang['list']?></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'hr-section-list') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'hr-section-list-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-hr-section' ? 'active' : '' ?>"><a href="setting-section.php?page_mode=all"><?= $lang['Section'].' '.$lang['list']?></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'hr-position-list') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'hr-position-list-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-hr-position' ? 'active' : '' ?>"><a href="setting-position.php?page_mode=all"><?= $lang['Designation'].' '.$lang['list']?></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'hr-advance-setting') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'hr-advance-setting-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-hr-advance' ? 'active' : '' ?>"><a href="setting-advance.php?page_mode=all"><?= $lang['advance'].' '.$lang['setting']?></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'hr-chief-list') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'hr-chief-list-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-hr-chief' ? 'active' : '' ?>"><a href="setting-chief.php?page_mode=all"><?= $lang['Chief'].' '.$lang['list']?></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                </ul>
                            </li>
                            <?php } ?>
                            <?php } ?>

                            <?php if ( permissionWebsite($row_page_website, 'app-welcome-screen') || permissionWebsite($row_page_website, 'app-pop-up') || permissionWebsite($row_page_website, 'app-service') || permissionWebsite($row_page_website, 'app-page') || permissionWebsite($row_page_website, 'app-menu') || permissionWebsite($row_page_website, 'app-support') || permissionWebsite($row_page_website, 'app-point') || permissionWebsite($row_page_website, 'app-adjustment') || permissionWebsite($row_page_website, 'profile-star') || permissionWebsite($row_page_website, 'profile-point') || permissionWebsite($row_page_website, 'profile-achievement') || permissionWebsite($row_page_website, 'profile-tier') ){ ?>
                            <?php if ( permissionCheck($row_user, 'app-welcome-screen-view') || permissionCheck($row_user, 'app-pop-up-view') || permissionCheck($row_user, 'app-service-view') || permissionCheck($row_user, 'app-page-view') || permissionCheck($row_user, 'app-menu-view') || permissionCheck($row_user, 'app-support-view') || permissionCheck($row_user, 'app-point-view') || permissionCheck($row_user, 'app-adjustment-view') || permissionCheck($row_user, 'profile-star-view') || permissionCheck($row_user, 'profile-point-view') || permissionCheck($row_user, 'profile-achievement-view') || permissionCheck($row_user, 'profile-tier-view') ){ ?>
                            <li class="has-submenu <?= ($active_sub_menu == 'setting-app' ? 'active' : '') ?>"><a href="#"><i class="fa fa-mobile"></i> <span class="nav-label">App Setting</span></a>
                                <ul class="list-unstyled">
                                    <?php if ( permissionWebsite($row_page_website, 'app-welcome-screen') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'app-welcome-screen-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-app-screen' ? 'active' : '' ?>"><a href="app-screen.php?page_mode=all">Welcome Screen</a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'app-pop-up') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'app-pop-up-view') ){ ?>
                                    <li class="<?= $active_menu == 'app-pop-up' ? 'active' : '' ?>"><a href="app-pop-up.php?page_mode=edit">Pop Up</a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'app-service') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'app-service-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-app-service' ? 'active' : '' ?>"><a href="app-service.php?page_mode=all">Service</a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'app-page') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'app-page-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-app-page' ? 'active' : '' ?>"><a href="app-page.php?page_mode=all">Page</a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'app-menu') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'app-menu-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-app-menu' ? 'active' : '' ?>"><a href="app-menu.php?page_mode=all">Menu</a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'app-support') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'app-support-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-app-support' ? 'active' : '' ?>"><a href="app-support.php?page_mode=all">Support</a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'app-difficulty') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'app-difficulty-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-app-difficulty' ? 'active' : '' ?>"><a href="app-difficulty.php?page_mode=all">Difficulty</a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'app-adjustment') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'app-adjustment-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-app-adjustment' ? 'active' : '' ?>"><a href="app-adjustment.php?page_mode=all">Adjustment</a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'profile-star') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'profile-star-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-profile-star' ? 'active' : '' ?>"><a href="profile-star.php?page_mode=all">Star</a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'profile-point') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'profile-point-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-profile-point' ? 'active' : '' ?>"><a href="profile-point.php?page_mode=all">Point</a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'profile-achievement') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'profile-achievement-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-profile-achievement' ? 'active' : '' ?>"><a href="profile-achievement.php?page_mode=all">Achievement</a></li>
                                    <?php } ?>
                                    <?php } ?>
                                    <?php if ( permissionWebsite($row_page_website, 'profile-tier') ){ ?>
                                    <?php if ( permissionCheck($row_user, 'profile-tier-view') ){ ?>
                                    <li class="<?= $active_menu == 'setting-profile-tier' ? 'active' : '' ?>"><a href="profile-tier.php?page_mode=all">Tier</a></li>
                                    <?php } ?>
                                    <?php } ?>
                                </ul>
                            </li>
                            <?php } ?>
                            <?php } ?>
                    </ul>
                </li>
            <?php } ?>
            <?php } ?>

            <li class="<?= $active_menu == 'logout' ? 'active' : '' ?>"><a href="page-logout.php"><i class="fa fa-sign-out"></i> <span class="nav-label"><?= $lang['Logout']?></span></a></li>
        </ul>
    </nav>
</aside>
<!-- end left panel -->
<!-- section content -->
<section class="content">	
    <header class="top-head container-fluid">
        <button type="button" class="navbar-toggle pull-left">
            <span class="sr-only"><?= $lang['Toggle navigation']?></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <?php
        ?>
        <form method="get" role="search" action="<?=$action?>" class="navbar-left app-search pull-left">
        	<input type="hidden" name="selected_page" value="<?= ($s_selected_page!='' ? $s_selected_page : $selected_page) ?>" />
            <?= ($s_page_mode != ''? '<input type="hidden" name="page_mode" value="'.$s_page_mode.'" />' : ($page_mode != '' ? '<input type="hidden" name="page_mode" value="'.$page_mode.'" />' : '')) ?>
        	<?= ($type != '' ? '<input type="hidden" name="type" value="'.$type.'" />' : '') ?>
            <?= ($page_status != '' ? '<input type="hidden" name="page_status" value="'.$page_status.'" />' : '<input type="hidden" name="page_status" value="'.$s_page_status.'" />') ?>

            <?= ($id != '' ? '<input type="hidden" name="id" value="'.$id.'" />' : '') ?>
            <button type="submit" class="app-search-submit"><i class="fa fa-search"></i></button>
            <input type="text" name="search" class="form-control" value="<?= $search ?>" placeholder="Enter keywords...">
            <?php
			// for customer
			if ($show_map_script){
				echo '
				<input type="hidden" name="type" value="'.$type.'" />
				<input type="hidden" name="latitude" value="'.$current_lat.'" />
				<input type="hidden" name="longtitude" value="'.$current_lot.'" />
				<input type="hidden" name="submit" value="'.$submit.'" />
				<input type="hidden" name="sort_type" value="'.$sort_type.'" />
				<input type="hidden" name="sortby" value="'.$default_sortby.'" />' ;
			}
            echo $show_top_other_script ;
			?>
        </form>
        <?php
            $get_branch = $mysqli->query("SELECT * FROM branch
                                          WHERE deleted_at IS NULL".$user_branch_permission_sql_123) ;
            if ( $get_branch->num_rows > 0 ){
                if($row_user['user_permission'] == 'user'){

                    echo '<div class="panel-heading col-sm-2" style="float:right;">
                            <select class="form-control ui-search-input" onchange="location = this.value;">';
                    while ( $row_branch = $get_branch->fetch_assoc() ){
                        echo '<option value="'.$url_branch_ori.'&url_get_branch_admin_get='.$row_branch['branch_id'].'" '.($_SESSION['url_get_branch_admin'] == $row_branch['branch_id'] ? 'selected' : '').'>'.$row_branch['branch_name'].'</option>';
                    }
                    echo '</select>
                        </div>';

                }
            }
            $get_branch = $mysqli->query("SELECT * FROM branch
                                          WHERE deleted_at IS NULL") ;
            if ( $get_branch->num_rows > 0 ){
                if($row_user['user_permission'] == 'admin'){
                    echo '<div class="panel-heading col-sm-2" style="float:right;">
                            <select class="form-control ui-search-input" onchange="location = this.value;">';
                    while ( $row_branch = $get_branch->fetch_assoc() ){
                        echo '<option value="'.$url_branch_ori.'&url_get_branch_admin_get='.$row_branch['branch_id'].'" '.($_SESSION['url_get_branch_admin'] == $row_branch['branch_id'] ? 'selected' : '').'>'.$row_branch['branch_name'].'</option>';
                    }
                    echo '</select>
                        </div>';
                }
            }
        ?>
    </header>
    <?php
    echo $echo_script_url;
	$mysqli_query = "SELECT post_title FROM system_post
					 WHERE post_title != '' AND post_type = 'page-notification' AND post_trash = '0'" ;
	$mysqli_notification = $mysqli->query($mysqli_query." ORDER BY post_order") ;
	if ($mysqli_notification->num_rows > 0){

		$top_notification = '' ;
		while ($row_notification = $mysqli_notification->fetch_array(MYSQLI_ASSOC)){
			$top_notification .= '<li class="top_notification">'.dataFilter($row_notification['post_title']) .'</li>' ;
		}
		
		echo '
		<script src="'.PATH.'scripts/jquery.marquee.min.js"></script>
		<script>
		$(document).ready(function (){
			$(".marquee").marquee();
		});
		</script>
		<ul class="marquee">
			'.$top_notification.'
		</ul>' ;
		
	}
	?>