<?php
if (!$this->error) {
    if (count($this->paginator)) { ?>
      <table class='grid' id='tablePagination'>
          <?
          $options = [
              [
                  'id' => 'id',
                  'nowrap' => 'nowrap',
                  'link' => '#',
                  'descricao' => 'ID',
                  'image' => '/resources/imagens/'
              ],
              [
                  'id' => 'ds_descricao',
                  'nowrap' => 'nowrap',
                  'link' => '#',
                  'descricao' => 'Descrição',
                  'image' => '/resources/imagens/'
              ],
              [
                  'nowrap' => 'nowrap',
                  'descricao' => 'Ações'
              ]
          ];

          echo $this->listHeader($options, $this->order, $this->orderType);
          ?>

        <tbody>
        <?php
        $i = 0;

        foreach ($this->paginator as $item) {
            $class = $i % 2 == 0 ? '' : "highlight";

            ?>
          <tr class="<?= $class ?>">
            <td nowrap='nowrap'><?= $item['id']; ?></td>
            <td nowrap='nowrap'><?= $item['ds_descricao']; ?></td>
            <td nowrap='nowrap' style="width: 5%">
                <?= $this->iconEdit("seguro", "pendenciasvistoriador", $item) ?>
                <?= $this->iconActive("seguro", "pendenciasvistoriador", $item) ?>
                <?= $this->iconDelete("seguro", "pendenciasvistoriador", $item) ?>
            </td>
          </tr>
            <?
            $i++;
        }
        ?>
        </tbody>
      </table>

        <?= $this->paginationControl($this->paginator, 'Sliding');
    }
} else {
    echo $this->showListError($this->error);
}
?>
