<?
 if (!$this->error): 
		if(count($this->paginator)): ?>
			<table class='grid' cellspacing='1' cellpadding='0' border='0' id='tablePagination'> 
			<?
			$options = array(array('id'        => 'ds_nome_safra',
								   'nowrap'    => 'nowrap',
								   'link'      => '#',
								   'descricao' => 'Safra',
								   'image'     => '/resources/imagens/')
								   ,
							 array('id'        => 'ds_nome_produto',
								   'nowrap'    => 'nowrap',
								   'link'      => '#',
								   'descricao' => 'Produto',
								   'image'     => '/resources/imagens/')
								   ,
							 array('id'        => 'ds_tipo_solo',
								   'nowrap'    => 'nowrap',
								   'link'      => '#',
								   'descricao' => 'Tipo de Solo',
								   'image'     => '/resources/imagens/')
								   ,
							 array('id'        => 'ds_nome_ciclo',
								   'nowrap'    => 'nowrap',
								   'link'      => '#',
								   'descricao' => 'Ciclo',
								   'image'     => '/resources/imagens/')
								  ,
							 array('id'        => 'dt_inicial',
								   'nowrap'    => 'nowrap',
								   'link'      => '#',
								   'descricao' => 'Data Inicial',
								   'image'     => '/resources/imagens/')
								   ,
							 array('id'        => 'dt_final',
								   'nowrap'    => 'nowrap',
								   'link'      => '#',
								   'descricao' => 'Data Final',
								   'image'     => '/resources/imagens/')
						);

			if (Zend_Auth::getInstance()->getIdentity()->id_departamento != 20) {
				$options[] = array('nowrap'    => 'nowrap',
							       'descricao' => 'Ações');
			}
		
			print $this->listHeader($options, $this->order, $this->orderType);?>

			<tbody>
				<?
				$i = 0;
				foreach ($this->paginator as $item):
					if ($i % 2 == 0) {
						$class = '';
					} else {
						$class = "highlight";
					}
					
					?>
					<tr class="<?=$class?>">
						<td nowrap='nowrap' width="10%"><?=($item['ds_nome_safra'] ? $item['ds_nome_safra'] : '&nbsp;'); ?></td>
						<td nowrap='nowrap' width="35%"><?=($item['ds_nome_produto'] ? $item['ds_nome_produto'] : '&nbsp;'); ?></td>
						<td nowrap='nowrap' width="15%"><?=($item['ds_tipo_solo'] ? $item['ds_tipo_solo'] : '---'); ?></td>
						<td nowrap='nowrap' width="20%"><?=($item['ds_nome_ciclo'] ? $item['ds_nome_ciclo'] : '&nbsp;'); ?></td>
						<td nowrap='nowrap' width="10%"><?=($item['dt_inicial'] ? date('d/m/Y', strtotime($item['dt_inicial'])) : '&nbsp;'); ?></td>
						<td nowrap='nowrap' width="10%"><?=($item['dt_final'] ? date('d/m/Y', strtotime($item['dt_final'])) : '&nbsp;'); ?></td>
						<? if (Zend_Auth::getInstance()->getIdentity()->id_departamento != 20) { ?>
							<td align='center' width='1%' nowrap='nowrap'>
								<?=$this->iconEdit("produto", "validacoeszoneamento", $item)?>
	&nbsp;<a href="/produto/validacoeszoneamento/relacionarmunicipios/id_validacao_zoneamento/<?= $item['id']?>/id_validacao/<?= $item['id_validacao']?>" class="icon_index"><img src="/resources/imagens/mini/menus.png" alt="menus.png" title="Relacionar Municipios" border="0"></a>
								<?=$this->iconActive("produto", "validacoeszoneamento", $item)?>
								<?=$this->iconDelete("produto", "validacoeszoneamento", $item)?>
							</td>
						<? } ?>
					</tr>
					<?
					$i++;
				endforeach;
				?>
			</tbody>
		</table>
		
		<?=$this->paginationControl($this->paginator, 'Sliding');
		endif;
	else:
		print $this->showListError($this->error);
	endif;
?>