<?=$this->title('Filtro de Proponente');?>
<form id='frmFilter' enctype='application/x-www-form-urlencoded' action='/comercializacao/relacionartaxaproponente/getproponentes/id_taxa/<?=$this->id_taxa?>' class='frmFilter' method='post'>
	<div class="geral">	
		<fieldset>
			<legend>Buscar Proponentes</legend>
			<div class='row'>
			<table>
			<tr>
				<td>Nome:</td>
			 	<td><input type='text' name='nome'></td>
				<td>CPF/CNPJ:</td>
				<tD><input type='text' name="cpf_cnpj" class="cpf_cnpj"></td>
			</tr>
			<tr>
				<td colspan="4"><button name='pesquisar' id='pesquisar' type='submit'>Pesquisar</button></td>
			</tr>
			</table>
			</div>
		</fieldset>
	</div>
</form>

<?=$this->title('Proponente Encontrados');?>
<form class="formDefault">
<div class="geral">
	
	<fieldset>
	<legend>Proponentes</legend>
	<div id="list"></div>
	</fieldset>
</div>
</form>

<?=$this->title('Proponentes Relacionados');?>
<? if(count($this->paginator)): ?>
<table class='grid' cellspacing='1' cellpadding='0' border='0' id='tablePagination'>
<?
	$options = array(array('id'        => 'cpf_cnpj',
						   'nowrap'    => 'nowrap',
						   'link'      => '#',
						   'descricao' => 'CPF/CNPJ',
						   'image'     => '/resources/imagens/'),
	                 array('id'        => 'ds_nome_proponente',
						   'nowrap'    => 'nowrap',
						   'link'      => '#',
						   'descricao' => 'Nome',
						   'image'     => '/resources/imagens/'),
	                 array('id'        => 'ds_sigla',
						   'nowrap'    => 'nowrap',
						   'link'      => '#',
						   'descricao' => 'Estado',
						   'image'     => '/resources/imagens/'),
					 array('id'        => 'ds_nome_municipio',
						   'nowrap'    => 'nowrap',
						   'link'      => '#',
						   'descricao' => 'Municipio',
						   'image'     => '/resources/imagens/'),
					 array('id'        => 'id',
						   'nowrap'    => 'nowrap',
						   'link'      => '#',
						   'descricao' => 'Ações',
						   'image'     => '/resources/imagens/')
					 );
?>
	<?=$this->listHeader($options, $this->order, $this->orderType);?>
	
	<tbody>
		<?
		$i = 0;
		foreach ($this->paginator as $item):
			if ($i % 2 == 0) {
				$class = '';
			} else {
				$class = "highlight";
			}
			
			$imgActive = ($item['fl_ativo'] ? 'active.png' : 'inactive.png');
			
			?>
			<tr class="<?=$class?>">
				<td nowrap='nowrap'><?=($item['cpf_cnpj'] ? $item['cpf_cnpj'] : '&nbsp;'); ?></td>
				<td nowrap='nowrap'><?=($item['ds_nome_proponente'] ? $item['ds_nome_proponente'] : '&nbsp;'); ?></td>
				<td nowrap='nowrap'><?=($item['ds_sigla'] ? $item['ds_sigla'] : '&nbsp;'); ?></td>
				<td nowrap='nowrap'><?=($item['ds_nome_municipio'] ? $item['ds_nome_municipio'] : '&nbsp;'); ?></td>
				<td nowrap='nowrap'>
					<?=$this->iconDelete('comercializacao', 'relacionartaxaproponente', $item, $action='delete', '/id_taxa/' . $this->id_taxa . '/id_proponente/' . $item['id'])?>
				</td>
				
			</tr>
			<?
			$i++;
		endforeach;
		?>
	</tbody>
</table>
<?endif;?>