<?php
ob_start();
if(!isset($_SESSION)) {
  session_start();
}
error_reporting(E_ALL ^ E_NOTICE);
require_once 'inc/usuario.php';
require_once 'inc/funcionalidade.php';

//checkLogin('login.php');
funcionalidade_verificaAcesso('desktop.php');
$user = getLoggedUser();

if (isset($_GET['modulo'])) {
    $modulo= base64_decode($_GET['modulo']);
    $_SESSION['modulo'] = $modulo;
}
if (isset($_GET['funcionalidade'])) {
  $_SESSION['funcionalidade'] = $_GET['funcionalidade'];
}

if($modulo==15){
    header('Location: comanda/erpc_comanda_selecionar.php');
}

?>
<!DOCTYPE html>
<html lang="pt-BR">
<?php // <!-- Mirrored from aqvatarius.com/themes/taurus_v11/ by HTTrack Website Copier/3.x [XR&CO'2013], Sat, 23 Nov 2013 18:10:46 GMT --> ?>

<head>
  <title>ERP - Code Tecnologia</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <link rel="icon" type="image/ico" href="favicon.html">
  <link href="css/stylesheets.css" rel="stylesheet" type="text/css">
  <link href="css/mystyles.css" rel="stylesheet" type="text/css">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">    
</head>



<body class="<?php echo isset($_SESSION['background_config_taurus']) ? $_SESSION['background_config_taurus'] : ''; ?>">
  <?php
    include 'menu-top.php';
  ?>
  <!-- classe alterada no js/settings.js -->
  <div  class="page-container scroll oh <?php
  echo ' ' . isset($_SESSION['theme']) ? $_SESSION['theme'] : '';
  echo ' ' . isset($_SESSION['container']) ? $_SESSION['container'] : '';
  ?>" id="pagewrap" data-animsition-out-duration="300" data-animsition-in-duration="300">
    <?php //echo '<pre>' . print_r($_SESSION, true) . '</pre>'; ?>
    <div class="row" style="height: 100%">
      <?php
      $script = basename($_SERVER["SCRIPT_FILENAME"], '.php');
      if ($script === 'desktop' or $script === 'erpc_dashboard' or $script === 'erpc_financeiro_dashboard' or $script === 'erpc_treinamentos') {
        echo "<div class='col-md-12'>";
      } else {
        echo "<div class=col-md-2>";

        $included = false;

        // Verifica se usuário está logado no sistema
        if(isset($_SESSION[SESSION_USER_NAME])){
          // menu do usuário logado no Sistema
          $menuLeftUrl = 'menu-left-user.php';
          // se não existe o arquivo, carrega o padrão
          $included = @include $menuLeftUrl;
        }

        if (!$included) {
          include 'menu-left.php';
        }

        echo "</div><div class='col-md-10'>";
      }
      ?>
