<?php
    if (!$this->error) {
        if ($this->paginator->count()) {
?>
            <?= $this->title('Proponentes'); ?>

            <table class="grid" border="0" id="tablePagination">
                <thead>
                    <tr>
                        <th><input type='checkbox' id='marcarTodos'></th>
                        <th>CPF/CNPJ</th>
                        <th>Nome</th>
                        <th>Data de vencimento</th>
                    </tr>
                </thead>
                <tbody id="tbody-proponentes">
                    <?php
                        foreach ($this->paginator as $item) {
                            $cpfCnpj = Agro_Util::formatarCpfCnpj($item['cpf_cnpj']);
                            $dtVencimento = !empty($item['dt_vencimento']) ? Agro_Util::formatDate($item['dt_vencimento'], Zend_Date::DATES) : '';
                            echo "
                                <tr>
                                    <td width='3%' align='center'><input type='checkbox' name='id[]' class='check_itens' value='{$item["id"]}'></td>
                                    <td style='text-align:center;'>{$cpfCnpj}</td>
                                    <td style='text-align:center;'>{$item['ds_nome_proponente']}</td>
                                    <td style='text-align:center;'>{$dtVencimento}</td>
                                </tr>
                            ";
                        }
                    ?>
                    
                </tbody>
            </table>

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