<?
if (!$this->error) {
    if (count($this->paginator)) { ?>
      <table class='grid' cellspacing='1' cellpadding='0' border='0' id='tablePagination'>
          <?
          $options = array
          (
            array(
              'id'        => 'id',
              'nowrap'    => 'nowrap',
              'link'      => '#',
              'descricao' => 'ID',
              'image'     => '/resources/imagens/'
            ),

            array(
              'id'        => 'valor',
              'nowrap'    => 'nowrap',
              'link'      => '#',
              'descricao' => 'Valor',
              'image'     => '/resources/imagens/'
            ),

            array(
              'id'        => 'id_estado',
              'nowrap'    => 'nowrap',
              'link'      => '#',
              'descricao' => 'Estado',
              'image'     => '/resources/imagens/'
            ),

            array(
              'id'        => 'data_inicio',
              'nowrap'    => 'nowrap',
              'link'      => '#',
              'descricao' => 'Data de Início',
              'image'     => '/resources/imagens/'
            ),

            array(
              'nowrap'    => 'nowrap',
              'descricao' => 'Ações'
            )
          );

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

        <tbody>
        <?
        $i = 0;
        foreach ($this->paginator as $item) {
            $class = $i % 2 == 0 ? '' : "highlight";
            $imgActive = ($item['fl_ativo'] ? 'active.png' : 'inactive.png');

            ?>
          <tr class="<?= $class ?>">
            <td nowrap='nowrap' align="left"><?= $item['id']; ?></td>
            <td nowrap='nowrap' align="center"><?= str_replace('.', ',', $item['valor']); ?></td>
            <td nowrap='nowrap' align="center"><?= $item['ds_nome_estado']; ?></td>
            <td nowrap='nowrap' align="center"><?= Agro_Util::formatDate($item['data_inicio']); ?></td>
            <td align='center' width='1%' nowrap='nowrap'>
                <?
                echo $this->iconEdit("sinistro2", "valorlitrocombustivel", $item);
                echo $this->iconActive("sinistro2", "valorlitrocombustivel", $item);
                echo $this->iconDelete("sinistro2", "valorlitrocombustivel", $item);
                ?>
            </td>
          </tr>
            <?
            $i++;
        }
        ?>
        </tbody>
      </table>

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