<header class="mdl-layout__header">
  <div class="mdl-layout__header-row">
    <!-- Title -->
    <span class="mdl-layout-title">
      <?php
      if (isset($mesa) && !empty($mesa)) :
        echo "<a href='pedido.php?mesa={$mesa}' class='link-topo'>Mesa {$mesa}</a>";
      elseif (isset($comanda) && !empty($comanda)):

        $cliente = (isset($cliente)) ? $cliente : '';
        echo "<a href='comanda.php?comanda={$comanda}&cliente={$cliente}' class='link-topo'>Comanda {$comanda}</a>";
      else:
        echo "<span>" . $_COOKIE['usuario'] . "</span>";
      endif;
      ?>
    </span>
    <!-- Add spacer, to align navigation to the right -->
    <div class="mdl-layout-spacer"></div>
    <?php
    if (isset($mesa) && !empty($mesa)) :
      echo "<a href='' class='link-icone-topo'><i class='material-icons'>autorenew</i></a>";
      echo "<a href='mesa.php' class='link-icone-topo'><i class='material-icons'>view_module</i></a>";
    endif;

    if ((isset($comanda) && !empty($comanda)) || (isset($cliente) && !empty($cliente))) :
      echo "<a href='' class='link-icone-topo'><i class='material-icons'>autorenew</i></a>";
      echo "<a href='comandas.php' class='link-icone-topo'><i class='material-icons'>assignment_ind</i></a>";
    endif;
    ?>
  </div>
</header>
<div class="mdl-layout__drawer">
  <span class="mdl-layout-title">Menu</span>
  <hr>
  <nav class="mdl-navigation">
    <a class="mdl-navigation__link" href="mesa.php"><i class="fa fa-th-large"></i> Mesas</a>
    <a class="mdl-navigation__link" href="comandas.php"><i class="fa fa-address-card-o"></i> Comandas</a>
    <a class="mdl-navigation__link" href="produto.php"><i class="fa fa-shopping-cart"></i> Produtos</a>
    <a class="mdl-navigation__link red" href="logout.php"><i class="fa fa-power-off"></i> Sair</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>