<? if (!$this->error): ?>
	<? if(count($this->paginator)): ?>
		<table class='grid' cellspacing='1' cellpadding='0' border='0' id='tablePagination'>
			<thead>
				<tr>
					<th nowrap="nowrap">Nome</th>
					<th nowrap="nowrap">Safra</th>
					<th nowrap="nowrap">Produto</th>
					<th nowrap="nowrap">Início Comercialização</th>
					<th nowrap="nowrap">Fim Comercialização</th>
					<th nowrap="nowrap">Inicio Vigência</th>
					<th nowrap="nowrap">Fim Vigência</th>
					<th nowrap="nowrap">Ativo</th>
					<th nowrap="nowrap">Ações</th>
				</tr>
			</thead>
			<tbody>
				<?
				$i = 0;
				foreach ($this->paginator as $item):
					?>
					<tr>
						<td nowrap="nowrap" align="center"><?=$item['ds_nome_comercializacao']?></td>
						<td nowrap="nowrap" align="center"><?=$item['ds_nome_safra']?></td>
						<td nowrap="nowrap" align="center"><?=$item['ds_nome_produto']?></td>
						<td nowrap="nowrap" width="1%" align="center"><?=Agro_Util::formatDate($item['dt_comercializacao_inicio'])?></td>
						<td nowrap="nowrap" width="1%" align="center"><?=Agro_Util::formatDate($item['dt_comercializacao_fim'])?></td>
						<td nowrap="nowrap" width="1%" align="center"><?=Agro_Util::formatDate($item['dt_cobertura_inicio'])?></td>
						<td nowrap="nowrap" width="1%" align="center"><?=Agro_Util::formatDate($item['dt_cobertura_fim'])?></td>
						<td nowrap="nowrap" width="1%"  align="center">
							<? if ($item['fl_ativo']): ?>
									<img title="Ativo" src="/resources/imagens/mini/active.png" border="0">
							<? else: ?>
									<img title="Inativo" src="/resources/imagens/mini/inactive.png" border="0">
							<? endif; ?>
						</td>
						<td nowrap="nowrap" align="center" width="1%">
							<a href="/comercializacao/usuario/view/id/<?=$item['id']?>" title="Visualizar" class="icon_view">
                <img src="/resources/imagens/mini/view.png" border="0">
              </a>
							<a href="/comercializacao/usuario/form/id/<?=$item['id']?>" title="Editar" class="icon_form">
                <img src="/resources/imagens/mini/edit.png" border="0">
              </a>
							<a href="/comercializacao/relacionarusuario/index/id/<?=$item['id']?>" title="Relacionar Usuários" class="icon_index">
                <img src="/resources/imagens/mini/relaciona_usuario.png" border="0">
              </a>
              <a href="/comercializacao/relacionarmunicipio/index/id/<?=$item['id']?>" title="Relacionar Municípios" class="icon_index_municipio">
                <img src="/resources/imagens/mini/relaciona_municipio.png" border="0">
              </a>
              <a id="<?=$item['id']?>" href="/seguro/proponente/relacionaproponente/id/<?=$item['id']?>/tipo/comercializacao" title="Relacionar Proponentes" class="icon_relaciona_proponente">
                <img src="/resources/imagens/mini/relaciona_proponente.png" border="0">
              </a>
							<a href="/comercializacao/usuario/delete/id/<?=$item['id']?>" title="Deletar" class="icon_delete">
                <img src="/resources/imagens/mini/delete.png" border="0">
              </a>
						</td>
					</tr>
					<?
					$i++;
				endforeach;
				?>
			</tbody>
		</table>
		<?=$this->paginationControl($this->paginator, 'Sliding'); ?>
	<? endif; ?>
<? else: ?>
	<?=$this->showListError($this->error); ?>
<? endif; ?>