    
   <!-- Loading Container -->
    <div class="loading-container">
        <div class="loader"></div>
    </div>
    <!--  /Loading Container -->
    <!-- Navbar -->
    <div class="navbar">
        <div class="navbar-inner">
            <div class="navbar-container">
                <!-- Navbar Barnd -->
                <div class="navbar-header <?php if($this->session->lang == "ar" && $this->session->langfolder == "arabic") echo "pull-right"; else echo "pull-left"; ?>">
                    <a href="<?= base_url() ?>dashboard/welcome" class="navbar-brand">
                        <small>
                            <img src="<?= base_url() ?>assets/img/logo.png" alt="" />
                        </small>
                    </a>
                </div>
                <!-- /Navbar Barnd -->
                <!-- Sidebar Collapse -->
                <div class="sidebar-collapse" id="sidebar-collapse">
                    <i class="collapse-icon fa fa-bars"></i>
                </div>
                <!-- Sidebar Collapse -->
                <!-- Account Area and Settings -->
                <div class="navbar-header pull-right">
                    
                    <div class="navbar-account">
                        <ul class="account-area" style="right: 0px;">
                            
                            <li>
                                <a class="login-area dropdown-toggle" data-toggle="dropdown" style="width: 190px;">
                                    <section style="float: right;">
                                        <h2><span class="profile"><?= $this->session->userdata('user') ?></span></h2>
                                    </section>
                                </a>
                                <!--Login Area Dropdown-->
                                <ul class="pull-right dropdown-menu dropdown-arrow dropdown-login-area">
                                    <li class="edit">
                                        <a href="<?= base_url() ?>settings/users/changepassword" class="pull-left" style="padding: 9px 11px;text-align: right;width: 100%;">
                                            <?php echo $this->lang->line("CHANGEPASSWORD"); ?></a>
                                    </li>
                                    <li class="edit">
                                        <a href="<?= base_url() ?>login/logout" style="text-align: right;width: 100%;padding: 9px 11px;">
                                            <?php echo $this->lang->line("LOGOUT"); ?>
                                        </a>
                                    </li>
                                    <!--Theme Selector Area-->
                                    <li class="theme-area">
                                        <ul class="colorpicker" id="skin-changer">
                                            <li><a class="colorpick-btn" href="#" style="background-color:#5DB2FF;" rel="<?php echo base_url();?>assets/css/skins/blue.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#2dc3e8;" rel="<?php echo base_url();?>assets/css/skins/azure.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#03B3B2;" rel="<?php echo base_url();?>assets/css/skins/teal.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#53a93f;" rel="<?php echo base_url();?>assets/css/skins/green.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#FF8F32;" rel="<?php echo base_url();?>assets/css/skins/orange.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#cc324b;" rel="<?php echo base_url();?>assets/css/skins/pink.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#AC193D;" rel="<?php echo base_url();?>assets/css/skins/darkred.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#8C0095;" rel="<?php echo base_url();?>assets/css/skins/purple.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#0072C6;" rel="<?php echo base_url();?>assets/css/skins/darkblue.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#585858;" rel="<?php echo base_url();?>assets/css/skins/gray.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#474544;" rel="<?php echo base_url();?>assets/css/skins/black.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#001940;" rel="<?php echo base_url();?>assets/css/skins/deepblue.min.css"></a></li>
                                        </ul>
                                    </li>
                                    <!--/Theme Selector Area-->
                                    
                                </ul>
                                <!--/Login Area Dropdown-->
                            </li>
                            <!-- /Account Area -->
                            <!--Note: notice that setting div must start right after account area list.
                            no space must be between these elements-->
                            <!-- Settings -->
                        </ul>
<!--                        <div class="setting">
                            <a id="btn-setting" title="Setting" href="#">
                                <i class="icon glyphicon glyphicon-cog"></i>
                            </a>
                        </div>-->
<!--                        <div class="setting-container">
                            <label>
                                <input type="checkbox" id="checkbox_fixednavbar">
                                <span class="text"><?php echo $this->lang->line("FIXEDNAVBAR"); ?></span>
                            </label>
                            <label>
                                <input type="checkbox" id="checkbox_fixedsidebar">
                                <span class="text"><?php echo $this->lang->line("FIXEDSIDEBAR"); ?></span>
                            </label>
                            <label>
                                <input type="checkbox" id="checkbox_fixedheader">
                                <span class="text"><?php echo $this->lang->line("FIXEDHEADER"); ?></span>
                            </label>
                        </div>-->
                <!-- Settings -->
            </div>
        </div>
        <!-- /Account Area and Settings -->
    </div>
</div>
</div>
<!-- /Navbar -->
<!-- Main Container -->
<div class="main-container container-fluid">
    <!-- Page Container -->
    <div class="page-container">
        <!-- Page Sidebar -->
        <div class="page-sidebar" id="sidebar">
            <!-- Page Sidebar Header-->
            <div class="sidebar-header-wrapper">
                <input readonly="true" type="text" class="searchinput" value="<?= date('d-m-Y H:i') ?>">
            </div>
            <!-- /Page Sidebar Header -->
            <!-- Sidebar Menu -->
            <ul class="nav sidebar-menu">
                <?php
                if ($mainmenu) {

                    $xml = simplexml_load_string(htmlspecialchars_decode($mainmenu));
                    
                    $level1 = 0;
                    $level2 = 0;
                    $level3 = 0;
                    $menu_icons = array(
                       'Dashboard' => 'fa-home',
                       'dashboardKDS' => 'fa-cutlery',
                       'Sales' => 'fa-bar-chart',
                       'Purchase' => 'fa-cubes',
                       'Partners' => 'fa-users',
                       'Settings' => 'fa-gear',
                       'Finance' => 'fa-bank',
                        'Reports' => 'fa-file',
                       'Employees' => 'fa-user-secret',
                    );
                    foreach ($xml as $key0 => $value) {
                        foreach ($value->attributes() as $attributeskey0 => $attributesvalue1) {
                            if ($key0 == 'level1') {
                                if ($level3 == 1) {
                                    $level3 == 0;
                                    echo '</ul></li></ul>';
                                } else if ($level2 == 1) {
                                    $level2 = 0;
                                    echo '</li></ul>';
                                } else if ($level1 == 1) {
                                    echo '</li>';
                                }
                                $level1 = 1;
                                $icon_key = (isset($menu_icons[(string)$attributesvalue1])) ? $menu_icons[(string)$attributesvalue1] : 'fa_th';
                                echo '<li><a href="' . base_url() . $value . '" class="menu-dropdown"><i class="menu-icon fa '.(string)$icon_key.'"></i><span class="menu-text"> ' . $attributesvalue1 . ' </span></a>';
                            } else if ($key0 == 'level2') {
                                if ($level3 == 1) {
                                    $level3 = 0;
                                    echo '</ul>';
                                } else if ($level2 == 1) {
                                    echo '</li>';
                                } else if ($level1 == 1) {
                                    $level1 = 0;
                                    echo '<ul class="submenu">';
                                }
                                $level2 = 1;
                                echo '<li><a href="' . base_url() . $value . '" class="menu-dropdown">'
                                    . '<span class="menu-text"> ' . $attributesvalue1 . ' </span>'
                                    . '<i class="menu-expand"></i></a>';
                            } else if ($key0 == 'level3') {
                                if ($level2 == 1) {
                                    $level2 = 0;
                                    echo '<ul class="submenu">';
                                }
                                $level3 = 1;
                                echo '<li><a href="' . base_url() . $value . '" class="menu-dropdown"><span class="menu-text">' . $attributesvalue1 . '</span></a></li>';
                            }
                        }
                    }
                    if ($level3 == 1) {
                        echo '</ul></li></ul></li>';
                    } else if ($level2 == 1) {
                        echo '</li></ul></li>';
                    } else if ($level1 == 1) {
                        echo '</li>';
                    }
                }
                ?>
                <li>
                    <a href="#" class="menu-dropdown">
                        <i class="menu-icon fa fa-language"></i>
                        <span class="menu-text"> Languages </span>
                    </a>
                    <ul class="submenu">
                        <li>
                            <a href="<?=base_url()?>Language/setLanguage/en/english">
                                <span class="menu-text"> English </span>
                                <i class="menu-expand"></i>
                            </a>
                        </li>
                        <li>
                            <a href="<?=base_url()?>Language/setLanguage/ar/arabic">
                                <span class="menu-text"> Arabic </span>
                                <i class="menu-expand"></i>
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
            <!-- /Sidebar Menu -->
        </div>
        <!-- /Page Sidebar -->