<?php
require_once __DIR__ . '/../verifica_cookie.php';
require_once 'funcoes.php';

$scriptComanda = '';
switch (TIPO_COMANDA):
  case 0:
    $scriptComanda = 'comandas_nome.php';
    break;
  case 1:
    $scriptComanda = 'comandas_numero.php';
    break;
  case 2:
    $scriptComanda = 'comandas_numero_mesa.php';
    break;
  case 3:
    $scriptComanda = 'comandas_numero_pesquisa.php';
    break;
  case 4:
    $scriptComanda = 'comandas_numero_nome.php';
    break;
  default:
    $scriptComanda = 'comandas_numero.php';
    break;
endswitch;

?>

<div class="mdl-layout__drawer">
  <span class="mdl-layout-title">Menu</span>
  <hr>
  <nav class="mdl-navigation">
    <?php if (IsModuloAtivo('MESA')): ?>
      <a class="mdl-navigation__link" href="mesas.php">
        <i class="material-icons">view_comfy</i>
        <span class='item-menu'>MESAS</span>
      </a>
    <?php endif; ?>
    <?php if (IsModuloAtivo('COMANDA')): ?>
      <a class="mdl-navigation__link" href="<?= $scriptComanda ?>">
        <i class="material-icons">assignment_ind</i>
        <span class='item-menu'>COMANDAS</span>
      </a>
    <?php endif; ?>
    <a class="mdl-navigation__link" href="configuracao.php">
      <i class="material-icons">settings</i>
      <span class='item-menu'>CONFIGURAÇÕES</span>
    </a>
    <a class="mdl-navigation__link" href="enviar_texto.php">
      <i class="material-icons">print</i>
      <span class='item-menu'>ENVIAR TEXTO</span>
    </a>
    <a class="mdl-navigation__link text-red" href="logout.php">
      <i class="material-icons">power_settings_new</i>
      <span class='item-menu'>SAIR</span>
    </a>
    <hr>
    <button class="theme-toggle" id="btnThemeToggle" type="button" aria-label="Alternar tema claro/escuro">
      <i class="material-icons" id="themeIcon">brightness_6</i>
      <span class='item-menu' id="themeLabel">TEMA ESCURO</span>
    </button>
  </nav>
</div>