<?php
include 'header.php';
include 'erpc_usuarios_unidades_toolbar.php';
require_once 'inc/usuario.php';


?>

<div class="block">
  <div class="header">
    <h2>Usuário Unidades - Lista</h2>
  </div>
  <div class="content">
    <?php
    //echo '<pre>' . var_export($_SESSION, true) . '</pre>';
    displayMessagesAndErrors();
    ?>
    <div class="table-responsive">
      <table class="table table-bordered table-striped table-responsible code-sortable" data-order-by="0">
        <thead>
          <tr>
            <!--<th width="3%"><input type="checkbox" class="checkall" /></th>-->
            <th width="15%" >ID</th>
            <th>Usuário</th>
            <th>Status</th>
            <th width="3%" class="no-sort">Editar</th>
            <!-- <th width="3%" class="no-sort">Remover</th>-->
          </tr>
        </thead>
        <tbody>
          <?php
          $lista = usuarios_getAll();
          if ($lista !== false) {
            foreach($lista as $item) {
              $idUrl = urlencode(base64_encode($item['id']));
              ?>
          <tr>
            <td><?= sgcws_html($item['id']); ?></td>
            <td><?= sgcws_html($item['ds_nome']); ?></td>
            <td><?= $item['st_ativo'] === 0 ? 'Inativo' : 'Ativo'; ?></td>
            <td class='text-center'>
              <a href="erpc_usuarios_unidades_edit.php?id=<?= $idUrl; ?>"><i class="glyphicon glyphicon-pencil" title='Editar'><span class="sr-only">Editar</span></i></a>
            </td>

            <!--
            <td class='text-center'>
              <a href="erpc_usuarios_remove.php?id=<?= $idUrl; ?>"><i class="glyphicon glyphicon-remove" title='Remover'><span class="sr-only">Remover</span></i></a>
            </td>
            -->
          </tr>
              <?php
            }
          }
          ?>
        </tbody>
      </table>
    </div> <!-- table-responsive -->
  </div> <!-- content -->
</div> <!-- block -->

<?php include 'footer.php'; ?>
