<?php
if (!$this->error):
    if (count($this->paginator)):
        $classColunaAcoes = $this->empresaVistoria ? 'hide' : 'show';
        ?>
      <table class='grid' cellspacing='1' cellpadding='0' border='0' id='tablePagination'>
        <thead>
        <tr>
          <th nowrap="nowrap">Nome Departamento</th>
          <th nowrap="nowrap">Chave</th>
          <th nowrap="nowrap" class="<?=$classColunaAcoes?>">Ações</th>
        </tr>
        </thead>
        <tbody>
        <?
        $i = 0;
        foreach ($this->paginator as $item):
            if ($i % 2 == 0) {
                $class = '';
            } else {
                $class = "highlight";
            }

            ?>
          <tr class="<?= $class ?>">
            <td nowrap='nowrap'><?= ($item['ds_nome_departamento'] ? $item['ds_nome_departamento'] : '&nbsp;'); ?></td>
            <td nowrap='nowrap'><?= ($item['ds_chave'] ? $item['ds_chave'] : '&nbsp;'); ?></td>
            <td align='center' width='1%' nowrap='nowrap' class="<?=$classColunaAcoes?>">
              <a class="showFormDepartamento"
                 href="/sistema/departamento/form/id_empresa/<?= $item['id_empresa'] ?>/id/<?= $item['id'] ?>">
                <img src="/resources/imagens/mini/edit.png" border="0" alt="edit.png" title="Editar Registro"
                     style="cursor:pointer"/>
              </a>

              <a class="deleteDepartamento" href="/sistema/departamento/delete/id/<?= $item['id'] ?>"
                 data-departamento="<?= $item['ds_nome_departamento'] ?>">
                <img src="/resources/imagens/mini/delete.png" border="0" alt="delete.png" title="Excluir Registro"
                     style="cursor:pointer"/>
              </a>
            </td>
          </tr>
            <?
            $i++;
        endforeach;
        ?>
        </tbody>
      </table>
    <? endif; ?>
<? else: ?>
    <?= $this->showListError($this->error); ?>
<? endif; ?>