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

<head>
  <!-- Required meta tags -->
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
  <title>Workforce Tracking</title>
  <!-- plugins:css -->
  <link rel="stylesheet" href="<?=base_url('assets')?>/node_modules/mdi/css/materialdesignicons.min.css" />
  <link rel="stylesheet" href="<?=base_url('assets')?>/node_modules/simple-line-icons/css/simple-line-icons.css" />
  <link rel="stylesheet" href="<?=base_url('assets')?>/node_modules/flag-icon-css/css/flag-icon.min.css" />
  <link rel="stylesheet" href="<?=base_url('assets')?>/node_modules/perfect-scrollbar/dist/css/perfect-scrollbar.min.css" />
  <link rel="stylesheet" href="<?=base_url('assets')?>/node_modules/jsgrid/dist/jsgrid.min.css" />
  <link rel="stylesheet" href="<?=base_url('assets')?>/node_modules/jsgrid/dist/jsgrid-theme.min.css" />
  <link rel="stylesheet" href="<?=base_url('assets')?>/node_modules/icheck/skins/all.css" />
  <link rel="stylesheet" href="<?=base_url('assets')?>/node_modules/select2/dist/css/select2.min.css" />
  <link rel="stylesheet" href="<?=base_url('assets')?>/node_modules/select2-bootstrap-theme/dist/select2-bootstrap.min.css" />
  <link rel="stylesheet" href="<?=base_url('assets')?>/node_modules/datatables.net-bs4/css/dataTables.bootstrap4.css" />
  <link rel="stylesheet" href="<?=base_url('assets')?>/node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css" />
  <link rel="stylesheet" href="<?=base_url('assets')?>/node_modules/icheck/skins/all.css" />
  <script src="<?=base_url('assets')?>/node_modules/jquery/dist/jquery.min.js"></script>
  <!-- endinject -->
  <!-- plugin css for this page -->
  <!-- End plugin css for this page -->
  <!-- inject:css -->
  <link rel="stylesheet" href="<?=base_url('assets')?>/css/style.css" />
  <!-- endinject -->
  <link rel="shortcut icon" href="<?=base_url('assets')?>/images/favicon.png" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>

<body class="sidebar-dark">
  <div class="container-scroller">
    <!-- partial:../partials/_navbar.html -->
    <nav class="navbar col-lg-12 col-12 p-0 fixed-top d-flex flex-row navbar-dark">
      <div class="text-center navbar-brand-wrapper d-flex align-items-top justify-content-center">
        <a class="navbar-brand brand-logo" href="<?=site_url()?>"><h3>Workforce Tracking</h3></a>
        <a class="navbar-brand brand-logo-mini" href="<?=site_url()?>"><h2>WFT</h2></a>
      </div>
      <div class="navbar-menu-wrapper d-flex align-items-center">
        <button class="navbar-toggler navbar-toggler align-self-center" type="button" data-toggle="minimize">
          <span class="icon-menu"></span>
        </button>
        <ul class="navbar-nav navbar-nav-right">
          <li class="nav-item nav-settings d-none d-lg-block">
            <a class="nav-link" href="<?=site_url()?>/login/sign_out">
              <i class="icon-logout"></i>
            </a>
          </li>
        </ul>
        <button class="navbar-toggler navbar-toggler-right d-lg-none align-self-center" type="button" data-toggle="offcanvas">
          <span class="icon-menu"></span>
        </button>
      </div>
    </nav>
    <!-- partial -->
    <div class="container-fluid page-body-wrapper">
      <div class="row row-offcanvas row-offcanvas-right">
        <!-- partial:../partials/_settings-panel.html -->
        <div class="theme-setting-wrapper">
          <div id="settings-trigger"><i class="mdi mdi-settings"></i></div>
          <div id="theme-settings" class="settings-panel">
            <i class="settings-close mdi mdi-close"></i>
            <p class="settings-heading">SIDEBAR SKINS</p>
            <div class="sidebar-bg-options selected" id="sidebar-light-theme"><div class="img-ss rounded-circle bg-light border mr-3"></div>Light</div>
            <div class="sidebar-bg-options" id="sidebar-dark-theme"><div class="img-ss rounded-circle bg-dark border mr-3"></div>Dark</div>
            <p class="settings-heading mt-2">HEADER SKINS</p>
            <div class="color-tiles mx-0 px-4">
              <div class="tiles primary"></div>
              <div class="tiles success"></div>
              <div class="tiles warning"></div>
              <div class="tiles danger"></div>
              <div class="tiles pink"></div>
              <div class="tiles info"></div>
              <div class="tiles dark"></div>
              <div class="tiles default"></div>
            </div>
          </div>
        </div>
        <!-- partial -->
        <!-- partial:../partials/_sidebar.html -->
        <nav class="sidebar sidebar-offcanvas" id="sidebar">
          <ul class="nav">
            <li class="nav-item nav-profile">
              <div class="nav-link">
                <div class="profile-image">
                  <img src="<?=base_url('assets')?>/images/faces/logo.png" alt="image" />
                  <span class="online-status online"></span> <!--change class online to offline or busy as needed-->
                </div>
                <div class="profile-name">
                  <p class="name">
                  <?php 
                    $level = $this->session->userdata('level');
                    if(isset($level)){
                      if($level == 1) {
                        echo "Super Admin";
                      }else if($level == 2){
                        echo "Admin";
                      }else{
                        echo "User";
                      }
                    }
                  ?>
                  </p>
                </div>
              </div>
            </li>
            <?php if (isset($level) && ($level == 1 || $level == 2)) {?>
            <li class="nav-item">
              <a class="nav-link" href="<?=site_url('group')?>">
                <i class="icon-people menu-icon"></i>
                <span class="menu-title">Groups</span>
              </a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="<?=site_url('users')?>">
                <i class="icon-user menu-icon"></i>
                <span class="menu-title">Users</span>
              </a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="<?=site_url('users/get_users_status')?>">
                <i class="icon-user menu-icon"></i>
                <span class="menu-title">Online/Offline</span>
              </a>
            </li>
            <?php } ?>    
            <li class="nav-item">
              <a class="nav-link" data-toggle="collapse" href="#page-layouts" aria-expanded="false" aria-controls="page-layouts">
                <i class="icon-docs menu-icon"></i>
                <span class="menu-title">Reports</span>
              </a>
              <div class="collapse" id="page-layouts">
                <ul class="nav flex-column sub-menu">
                  <li class="nav-item d-none d-lg-block"> <a class="nav-link" href="<?=site_url('pins')?>">Pins</a></li>
                  <li class="nav-item d-none d-lg-block"> <a class="nav-link" href="<?=site_url('report')?>">Report</a></li>
                </ul>
              </div>
            </li>
            <?php if (isset($level) && ($level == 1 || $level == 2)) {?>
            <li class="nav-item">
              <a class="nav-link" href="<?=site_url('sync')?>">
                <i class="icon-cloud-upload menu-icon"></i>
                <span class="menu-title">Sync</span>
              </a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="<?=site_url('frequency')?>">
                <i class="icon-bell menu-icon"></i>
                <span class="menu-title">Frequency</span>
              </a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="<?=site_url('uuid')?>">
                <i class="icon-menu menu-icon"></i>
                <span class="menu-title">UUIDs</span>
              </a>
            </li>
            <?php } 
                if (isset($level) && ($level == 1)) {
            ?> 
            <li class="nav-item">
              <a class="nav-link" href="<?=site_url('purge')?>">
                <i class="icon-close menu-icon"></i>
                <span class="menu-title">Purge Data</span>
              </a>
            </li>
            <?php } ?>
          </ul>
        </nav>
        <!-- partial -->
        <div class="content-wrapper" id="main_content">
          <?php
            if(isset($view)){
              if(isset($data)){
                $this->load->view($view, $data);
              }else{
                $this->load->view($view);
              }
              
            }
          ?>
        </div>
        <!-- content-wrapper ends -->
        <!-- partial:../partials/_footer.html -->
        <footer class="footer">
          <div class="container-fluid clearfix">
            <span class="text-muted d-block text-center text-sm-left d-sm-inline-block">Copyright © 2017 <a href="#">Workforce Tracking</a>. All rights reserved.</span>
          </div>
        </footer>
        <!-- partial -->
      </div>
      <!-- row-offcanvas ends -->
    </div>
    <!-- page-body-wrapper ends -->
  </div>
  <!-- container-scroller -->
  <!-- plugins:js -->

  <script src="http://malsup.github.com/jquery.form.js"></script>
  <script src="<?=base_url('assets')?>/node_modules/popper.js/dist/umd/popper.min.js"></script>
  <script src="<?=base_url('assets')?>/node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
  <script src="<?=base_url('assets')?>/node_modules/perfect-scrollbar/dist/js/perfect-scrollbar.jquery.min.js"></script>
  <!-- endinject -->
  <!-- Plugin js for this page-->
  <script src="<?=base_url('assets')?>/node_modules/jsgrid/dist/jsgrid.min.js"></script>
  <script src="<?=base_url('assets')?>/node_modules/select2/dist/js/select2.min.js"></script>
  <script src="<?=base_url('assets')?>/node_modules/icheck/icheck.min.js"></script>
  <script src="<?=base_url('assets')?>/node_modules/datatables.net/js/jquery.dataTables.js"></script>
  <script src="<?=base_url('assets')?>/node_modules/datatables.net-bs4/js/dataTables.bootstrap4.js"></script>
  <script src="<?=base_url('assets')?>/node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
  <!-- End plugin js for this page-->
  <!-- inject:js -->
  <script src="<?=base_url('assets')?>/js/off-canvas.js"></script>
  <script src="<?=base_url('assets')?>/js/hoverable-collapse.js"></script>
  <script src="<?=base_url('assets')?>/js/misc.js"></script>
  <script src="<?=base_url('assets')?>/js/settings.js"></script>
  <script src="<?=base_url('assets')?>/js/todolist.js"></script>
  <!-- endinject -->
  <!-- Custom js for this page-->
  <script>
    function gotoPage(url){
      $.get(url, function(res){
        $("#main_content").html(res);
      })
    }
  </script>
  <!-- End custom js for this page-->
</body>

</html>
