<br style="clear:both" />
<div style="width:98%;float:left;">
    <fieldset>
    <legend><b>Dados do Corretor</b></legend>
	<div class="view">
		<ul>
			<li><label>Nome/Razão Social</label><?=($this->data['ds_nome_corretor'] ? $this->data['ds_nome_corretor'] : '-')?></li>
			<li><label>Nome Fantasia</label><?=($this->data['ds_nome_fantasia'] ? $this->data['ds_nome_fantasia'] : '-')?></li>
            <li><label>Nome Abreviado</label><?=($this->data['ds_nome_abreviado'] ? $this->data['ds_nome_abreviado'] : '-')?></li>
			<li><label>Nome do Responsável</label><?=($this->data['ds_nome_responsavel'] ? $this->data['ds_nome_responsavel'] : '-')?></li>
			<li><label>Tipo Pessoa</label><?=($this->data['tp_pessoa'] == 'F' ? 'Física' : 'Jurídica')?></li>
			<li><label><?=($this->data['tp_pessoa'] == 'F' ? 'CPF' : 'CNPJ')?></label><?=($this->data['tp_pessoa'] == 'F' ? $this->data['cpf_cnpj'] : $this->data['cpf_cnpj'])?></li>
        </ul>
	</div>
    </fieldset>
    <br style="clear:both" />    
</div>

<div style="width:98%;float:left;">
    <fieldset>
    <legend><b>Informações de Contato</b></legend>

    <table class='grid' cellspacing='10' border='0' id='tablePagination'>
        
        <tr>
            <td><b>Contato Seguro Agrícola</b><br><?=($this->data['ds_contato_seguro_agricola'] ? $this->data['ds_contato_seguro_agricola'] : '-')?></td>
            <td><b>CPF</b><br><?=($this->data['cpf_contato_seguro_agricola'] ? $this->data['cpf_contato_seguro_agricola'] : '-')?></td>
            <td><b>E-mail Principal</b><br><?=($this->data['ds_email'] ? $this->data['ds_email'] : '-')?></td>
            <td><b>Telefone</b><br><?=($this->data['ds_telefone_contato_seguro_agricola'] ? $this->data['ds_telefone_contato_seguro_agricola'] : '-')?></td>
        </tr>
        <tr>
            <td><b>Contato Responsável</b><br><?=($this->data['ds_nome_responsavel'] ? $this->data['ds_nome_responsavel'] : '-')?></td>
            <td><b>CPF</b><br><?=($this->data['cpf_responsavel'] ? $this->data['cpf_responsavel'] : '-')?></td>
            <td><b>E-mail</b><br><?=($this->data['ds_email_responsavel'] ? $this->data['ds_email_responsavel'] : '-')?></td>
            <td><b>Telefone</b><br><?=($this->data['ds_telefone_responsavel'] ? $this->data['ds_telefone_responsavel'] : '-')?></td>
        </tr>
        <tr>
            <td><b>Contato (Outros 1)</b><br><?=($this->data['ds_contato_outros'] ? $this->data['ds_contato_outros'] : '-')?></td>
            <td><b>CPF</b><br>-</td>
            <td><b>E-mail</b><br><?=($this->data['ds_email_contato_outros'] ? $this->data['ds_email_contato_outros'] : '-')?></td>
            <td><b>Telefone</b><br><?=($this->data['ds_telefone_contato_outros'] ? $this->data['ds_telefone_contato_outros'] : '-')?></td>
        </tr>
        <tr>
            <td><b>Contato (Outros 2)</b><br><?=($this->data['ds_contato_outros_2'] ? $this->data['ds_contato_outros_2'] : '-')?></td>
            <td><b>CPF</b><br>-</td>
            <td><b>E-mail</b><br><?=($this->data['ds_email_contato_outros_2'] ? $this->data['ds_email_contato_outros_2'] : '-')?></td>
            <td><b>Telefone</b><br><?=($this->data['ds_telefone_contato_outros_2'] ? $this->data['ds_telefone_contato_outros_2'] : '-')?></td>
        </tr>
        
    </table>
  
    </fieldset>
    <br style="clear:both" />    
</div>


<div style="width:98%;float:left;">
    <fieldset>
    <legend><b>Observações</b></legend>

    <table class='grid' cellspacing='1' cellpadding='1' border='0' id='tablePagination'>
        <tr><td><?=($this->data['ds_observacao']) ? $this->data['ds_observacao'] : "Nenhum dado cadastrado.";?></td></tr>
    </table>
    
    </fieldset>
    <br style="clear:both" />
</div>

<div style="width:98%;float:left;">
    <fieldset>
    <legend><b>Informações Bancárias</b></legend>    
        <table class='grid' cellspacing='1' cellpadding='5' border='0' id='tablePagination'>
        <? if(count($this->informacoes_bancarias) > 0): ?>
            <thead>
                <tr bgcolor="#666666">
                    <th nowrap>Banco</th>
                    <th nowrap>Tipo de Conta</th>
                    <th nowrap>Agência</th>
                    <th nowrap>Conta</th>
                    <th nowrap>Obs</th>
                </tr>
            </thead>
            <?
            $i = 0;
            foreach ($this->informacoes_bancarias as $contas):
                if ($i % 2 == 0) {
                        $class = '';
                    } else {
                        $class = "highlight";
                    }
                ?>
                <tbody>
                    <tr class="<?=$class?>">
                        <td nowrap><?=$contas['ds_nome_banco']?></td>
                        <td nowrap><?=($contas['ds_tipo_conta'] == 'C' ? 'Conta Corrente' : 'Conta Poupança')?></td>
                        <td nowrap><?=$contas['ds_agencia']?></td>
                        <td nowrap><?=$contas['ds_conta']?></td>
                        <td nowrap><?=$contas['ds_observacao']?></td>
                    </tr>
                </tbody>
                <?
                $i++;
            endforeach;
            ?>
            <? else: ?> 
                <tr><td>Nenhum dado cadastrado.</td></tr>           
            <? endif; ?>        
        </table>
    </fieldset>
    <br style="clear:both" />
</div>

<div style="width:98%;float:left;">
    <fieldset>
    <legend><b>Endereços</b></legend>    

    <table class='grid' cellspacing='1' cellpadding='5' border='0' id='tablePagination'>
    <? if(count($this->enderecos) > 0): ?>
        <thead>
            <tr bgcolor="#666666">
                <th width="8%">CEP</th>
                <th>Estado</th>
                <th>Cidade</th>
                <th>Bairro</th>
                <th>Endereço</th>
                <th width="1%">Número</th>
                <th width="1%">Complemento</th>
                <th>Endereço Principal</th>
            </tr>
        </thead>
        <?
        $i = 0;
        foreach ($this->enderecos as $endereco):
            $class = (($i % 2 == 0) ? 'highlight' : '');
            ?>
            <tbody>
                <tr class="<?=$class?>">
                    <td nowrap align="center"><?=$endereco['ds_endereco_cep']?></td>
                    <td nowrap align="center"><?=$endereco['ds_nome_estado']?></td>
                    <td nowrap align="center"><?=$endereco['ds_nome_municipio']?></td>
                    <td nowrap align="left"><?=$endereco['ds_endereco_bairro']?></td>
                    <td nowrap align="left"><?=$endereco['ds_endereco_rua']?></td>
                    <td nowrap align="center"><?=$endereco['ds_endereco_nro']?></td>
                    <td nowrap align="center"><?=$endereco['ds_endereco_complemento']?></td>
                    <td nowrap align="center"><img src="/resources/imagens/<?=($endereco['fl_principal'] ? '1' : '0')?>.gif" /></td>
                </tr>
            </tbody>
            <?
            $i++;
        endforeach; ?>
    <? else: ?> 
        <tr><td>Nenhum dado cadastrado.</td></tr>           
    <? endif; ?>        
    </table>

    </fieldset>
    <br style="clear:both" />
</div>

<div style="width:98%;float:left;">
    <fieldset>
    <legend><b>Sublogins Ativos</b></legend>    
		<table class='grid' cellspacing='1' cellpadding='1' border='0' id='tablePagination'>
        <? if(count($this->prepostos) > 0): ?>
			<thead>
				<tr bgcolor="#666666">
					<th>Nome</th>
					<th>Usuário</th>
                    <th>Ativo</th>
				</tr>
			</thead>
			<?
			$i = 0;
			foreach ($this->prepostos as $preposto):
				if ($i % 2 == 0) {
						$class = '';
					} else {
						$class = "highlight";
					}
				?>
				<tbody>
					<tr class="<?=$class?>">
						<td nowrap><?=$preposto['ds_nome_preposto']?></td>
						<td nowrap><?=$preposto['ds_nome_usuario']?></td>
                        <td aling="center"><?if($preposto['fl_ativo'] == 1 ) echo "Sim"; else echo "Não";?></td>
					</tr>
				</tbody>
				<?
				$i++;
			endforeach;
			?>
        <? else: ?> 
            <tr><td>Nenhum dado cadastrado.</td></tr>           
        <? endif; ?>
        </table>
    </fieldset>
    <br style="clear:both" />
</div>