
<div>
	<?=$this->title('Dados do Contato');?>
	<div class="view">
		<table class='grid' width='100%' cellspacing='3' cellpadding='0' border='0' id='tablePagination'>
		<thead>
				<tr bgcolor="#666666">
					<th colspan='2'>DADOS PRINCIPAIS</th>
					
				</tr>
		</thead>
		<tbody>
			<Tr>
				<td width='50%'>
					<b>Nome</b>: <br> <?=$this->data['ds_nome_contato']?>
				</td>
				<td>
					<b>Nome Fantasia</b>: <br> <?=$this->data['ds_nome_fantasia']?>
				</td>
			</Tr>
			<Tr class="highlight">
				<td>
					<b>Nome da Empresa</b>: <br> <?=$this->data['ds_razao_social']?>
				</td>
				<td>
					<b>Categoria</b>: <br> <?=$this->data['ds_nome_categoria']?>
				</td>
			</Tr>
			<Tr>
				<td>
					<b>Assistente</b>: <br> <?=$this->data['ds_assistente']?>
				</td>
				<td>
					<b>Profissão</b>: <br> <?=$this->data['ds_profissao']?>
				</td>
			</tr>
			</tbody>
		</table>
		<table class='grid' width='70%' cellspacing='3' cellpadding='0' border='0' id='tablePagination'>
		<thead>
				<tr bgcolor="#666666">
					<th colspan='2'>PERFIL</th>
					
				</tr>
		</thead>
		<tbody>
			<tr>
				<td>
					<b>Email Pessoal</b>: <br> &nbsp;<?=$this->data['ds_email_pessoal']?>
				</td>
				<td>
					<b>Email Comercial</b>: <br> &nbsp;<?=$this->data['ds_email_comercial']?>
				</td>
			</Tr>
			<Tr class="highlight">
				<td>
					<b>Site Pessoal</b>: <br> &nbsp;<?=$this->data['ds_site_pessoal']?>
				</td>
				<td>
					<b>Site Comercial</b>: <br> &nbsp;<?=$this->data['ds_site_comercial']?>
				</td>
			</Tr>
			<Tr>
				<td>
					<b>Apelido</b>: <br> &nbsp;<?=$this->data['ds_apelido']?>
				</td>
				<td>
					<b>Estado Civil</b>: <br> &nbsp;<?=$this->data['ds_nome_estado_civil']?>
					
				</td>
			</tr>
			<tr class="highlight">
				<td>
					<b>Data de Nascimento</b>: <br> &nbsp;<?=Agro_Util::formatDate($this->data['dt_nascimento'], Zend_Date::DATES);?>
				</td>
				<td>
					<b>Data Última Visita</b>: <br> &nbsp;<?=Agro_Util::formatDate($this->data['dt_ultima_visita'], Zend_Date::DATES);?>
				</td>
			</Tr>
			<tr>
				<td>
					<b>Conjuge</b>: <br> &nbsp;<?=$this->data['ds_conjuge']?>
				</td>
				<td>
					<b>Número de Filhos</b>: <br> &nbsp;<?=$this->data['ds_numero_filhos']?>
				</td>
			</Tr>
			</tbody>
		</table>
	</div>
</div>

<div>
	<div class="view">
		<table class='grid' width='70%' cellspacing='1' cellpadding='0' border='0' id='tablePagination'>
			<thead>
					<tr bgcolor="#666666">
						<th colspan='3'>TELEFONES</th>
						
					</tr>
			</thead>
			<thead>
				<tr bgcolor="#666666">
					<th>Tipo</th>
					<th>Número</th>
					<th>Ramal</th>
				</tr>
			</thead>
		<?
		$i = 0;
		foreach ($this->telefones as $telefone):
			if ($i % 2 == 0) {
					$class = '';
				} else {
					$class = "highlight";
				}
			?>
			<tbody>
				<tr class="<?=$class?>">
					<td nowrap><?=$telefone['tp_telefone']?></td>
					<td nowrap><?=$telefone['ds_numero']?></td>
					<td nowrap><?=$telefone['ds_ramal']?></td>
				</tr>
			</tbody>
			<?
			$i++;
		endforeach;
		?></table>
	</div>
</div>


<div class="view">
	<table class='grid' cellspacing='1' cellpadding='0' border='0' id='tablePagination'>
		<thead>
				<tr bgcolor="#666666">
					<th colspan='8'>ENDEREÇOS</th>
					
				</tr>
		</thead>		
		<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>&nbsp;</th>
			</tr>
		</thead>
		<?
		$i = 0;
		foreach ($this->enderecos as $endereco):
			if ($i % 2 == 0) {
				$class = '';
			} else {
				$class = "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;
	?></table>
</div>

<div class="view">
	<table class='grid' cellspacing='1' cellpadding='0' border='0' id='tablePagination'>
		<thead>
			<tr bgcolor="#666666">
				<th width="8%">Observações</th>
			</tr>
		</thead>
		<tbody>
			<?php
			$i = 0;
			if(is_array($this->observacoes)):
				foreach($this->observacoes as $observacao):
					if ($i % 2 == 0) {
						$class = '';
					} else {
						$class = "highlight";
					}
					?>
					<tr class='<?= $class; ?>'>
						<td>
							<?= $observacao['ds_observacao']; ?>
						</td>
					</tr>
					<tr class='<?= $class; ?>'>
						<td align='right'>
							Por: <B><?= $observacao['ds_nome_usuario']; ?></B><br>
							Em:  <?=Agro_Util::formatDate($observacao['dt_criacao'], 'd/m/Y H:m'); ?>
						</td>
					</tr>
				<?php
					$i++;
				endforeach;
			endif;
			?>
		</tbody>
		
	</table>
</div>