$c->{$cp} = $valor;
    }
}
$e = $dt->buscaCadastroAdicionais($id);
if (count($e) > 0) {
    foreach ($e as $cp => $valor) {
        $c->{$cp} = $valor;
    }
}
$e = $dt->buscaConjuge($id);
if (count($e) > 0) {
    foreach ($e as $cp => $valor) {
        $c->{$cp} = $valor;
    }
}
$e = $dt->buscaEndereco2($id);
if (count($e) > 0) {
    foreach ($e as $cp => $valor) {
        $c->{$cp} = $valor;
    }
}
$e = $dt->buscaReferenciaBancaria($id);
if (count($e) > 0) {
    foreach ($e as $cp => $valor) {
        $c->{$cp} = $valor;
    }
}
$e = $dt->buscaDemonstrativoRendimento($id);
if (count($e) > 0) {
    foreach ($e as $cp => $valor) {
        $c->{$cp} = $valor;
function EmailFichaHTML($id, $safpostal_fantasia)
{
    $ficha = new ListaInteressadosDAO();
    $a = $ficha->buscaCadastroAdicionais($id);
    $e = $ficha->buscaEndereco2($id);
    $f = $ficha->buscaFichaCadastros($id);
    $fantasia = utf8_encode($safpostal_fantasia);
    $nome = $f->nome == '' ? ' ' : utf8_encode(strtoupper($f->nome));
    $rg = $f->rg == '' ? ' ' : utf8_encode(strtoupper($f->rg));
    $cpf = $f->cpf == '' ? ' ' : utf8_encode(strtoupper($f->cpf));
    $email = $f->email == '' ? ' ' : utf8_encode(strtolower($f->email));
    $nascimento = $f->nascimento == '' ? ' ' : $f->nascimento;
    $tel_res = $f->tel_res == '' ? ' ' : utf8_encode(strtoupper($f->tel_res));
    $tel_rec = $f->tel_rec == '' ? ' ' : utf8_encode(strtoupper($f->tel_rec));
    $tel_cel = $f->tel_cel == '' ? ' ' : utf8_encode(strtoupper($f->tel_cel));
    $nacionalidade = $a->nacionalidade == '' ? ' ' : utf8_encode(strtoupper($a->nacionalidade));
    $nascimento = $a->local_nascimento == '' ? '-' : utf8_encode(strtoupper($a->local_nascimento));
    $estado_civil = $f->estado_civil == '' ? ' ' : utf8_encode(strtoupper($f->estado_civil));
    $filhos = $f->filhos == '' ? ' ' : utf8_encode(strtoupper($f->filhos));
    $quant = $f->quant == '' ? ' ' : utf8_encode(strtoupper($f->quant));
    $regime = $a->regime == '' ? ' ' : utf8_encode(strtoupper($a->regime));
    $casamento = $a->data_casamento == '' ? ' ' : utf8_encode(strtoupper($a->data_casamento));
    $pai = $a->nome_pai == '' ? ' ' : utf8_encode(strtoupper($a->nome_pai));
    $mae = $a->nome_mae == '' ? ' ' : utf8_encode(strtoupper($a->nome_mae));
    $endereco = $f->endereco == '' ? '-' : utf8_encode(strtoupper($f->endereco));
    $numero = $f->numero == '' ? '-' : utf8_encode(strtoupper($f->numero));
    $complemento = $f->complemento == '' ? '-' : utf8_encode(strtoupper($f->complemento));
    $bairro = $teste = $e->bairro == '' ? '-' : utf8_encode(strtoupper($e->bairro));
    $estado = $f->estado == '' ? '-' : utf8_encode(strtoupper($f->estado));
    $cidade = $f->cidade == '' ? '-' : utf8_encode(strtoupper($f->cidade));
    $cep = $f->cep == '' ? '-' : utf8_encode(strtoupper($f->cep));
    switch ($a->tip_imovel) {
        case 0:
            $tip_imovel = ' ';
            break;
        case 1:
            $tip_imovel = 'Pr�prio';
            break;
        case 2:
            $tip_imovel = 'Alugada';
            break;
        case 3:
            $tip_imovel = 'Familiares';
            break;
    }
    $reside_praca = $a->reside_praca == '' ? '-' : utf8_encode(strtoupper($a->reside_praca));
    $endereco2 = $e->endereco == '' ? '-' : utf8_encode(strtoupper($e->endereco));
    $numero2 = $e->numero == '' ? '-' : utf8_encode(strtoupper($e->numero));
    $complemento2 = $e->complemento == '' ? '-' : utf8_encode(strtoupper($e->complemento));
    $estado2 = $e->estado == '' ? '-' : utf8_encode(strtoupper($e->estado));
    $cidade2 = $e->cidade == '' ? '-' : utf8_encode(strtoupper($e->cidade));
    $cep2 = $e->cep == '' ? '-' : utf8_encode(strtoupper($e->cep));
    $html = '
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>SAF Postal</title>
	<style type="text/css">
	<!--
	body,td,th {
		font-family: Verdana;
		font-size: 11px;
		color: #333333;
	}
	body {
		margin:15px;
	}
	hr {
		margin:0;
		padding:0;
		width:600px;
		background-color:#0071B6;
		height:3px;
		border:none;
		float:left;
	}
	.topo1 {
		float:left;
		width:25%;
		text-align:left;
	}
	.topo2 {
		float:right;
		width:75%;
		text-align:right;
	}
	.id {
		font-size:16px;
		font-weight:bold;
		float:left;
		color:#0071B6;
		width:600px;
	}
	.estrutura {
		border:solid 1px #0071B6;
		float:left;
		width:600px;
		margin-bottom:15px;
		padding-bottom:15px;
	}
	.titulo {
		background-color:#95D8FF;
		border-bottom:solid 2px #0071B6;
		float:left;
		width:600px;	
	}
	.titulo p {
		margin:3px;
		padding:3px;
		font-weight:bold;
	}
	.subtitulo {
		background-color:#FFE391;
		border-bottom:solid 1px #AE8300;
		float:left;
		width:600px;
	}
	.subtitulo2 {
		border-top:solid 1px #AE8300;
	}
	.subtitulo p {
		margin:3px;
		padding:3px;
	}
	.corpo {
		width:600px;
		margin-bottom:8px;
		padding-bottom:8px;
		float:left;
	}
	.corpo p {
		float:left;
		margin:0;
		padding:0;
		margin-left:10px;
		margin-top:5px;
		padding-left:10px;
		padding-top:5px;
	}
	-->
	</style>
	</head>
	<body>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	  <tr>
		<td>&nbsp;</td>
		<td width="600">
			<p class="topo1">Novos Interessados</p>
			<p class="topo2">Franquia: ' . $fantasia . '</p>
			<hr />
			<p class="id">#ID Ficha: ' . $id . '</p>
			<p style="width:100%;"><span style="color:#FF0000;">Aten��o, voc� deve solicitar os seguintes documentos, junto ao cliente:</span><br />
			- C�pias de documentos (RG e CPF);<br /> 
			- Comprovante de endere�o (C.N ou C.C); e<br />
			- Bens (Matr�cula do im�vel)</p>
			<div class="estrutura">
				<div class="titulo"><p>Dados do Solicitante</p></div>
				<div class="subtitulo"><p>- Dados Pessoais</p></div>
				<div class="corpo">
					<p style="width:325px;"><strong>Nome:</strong><br />' . $nome . '&nbsp;</p>
					<p style="width:100px;"><strong>RG:</strong><br />' . $rg . '&nbsp;</p>
					<p style="width:100px;"><strong>CPF:</strong><br />' . $cpf . '&nbsp;</p>
					<p style="width:325px;"><strong>E-mail:</strong><br />' . $email . '&nbsp;</p>
					<p style="width:200px;"><strong>Data de Nascimento:</strong><br />' . $nascimento . '&nbsp;</p>                
					<p style="width:175px;"><strong>Residencial:</strong><br />' . $tel_res . '&nbsp;</p>
					<p style="width:175px;"><strong>Recado:</strong><br />' . $tel_rec . '&nbsp;</p>
					<p style="width:175px;"><strong>Celular:</strong><br />' . $tel_cel . '&nbsp;</p>
					<p style="width:100px;"><strong>Nacionalidade:</strong><br />' . $nacionalidade . '&nbsp;</p>
					<p style="width:145px;"><strong>Local de Nascimento:</strong><br />' . $nascimento . '&nbsp;</p>
					<p style="width:80px;"><strong>Estado Civil:</strong><br />' . $estado_civil . '&nbsp;</p>
					<p style="width:95px;"><strong>Possui Filhos?</strong><br />' . $filhos . '&nbsp;</p>
					<p style="width:80px;"><strong>Quantos?</strong><br />' . $quant . '&nbsp;</p>
					<p style="width:262px;"><strong>Regime de Casamento:</strong><br />' . $regime . '&nbsp;</p>
					<p style="width:262px;"><strong>Data do Casamento:</strong><br />' . $casamento . '&nbsp;</p>
					<p style="width:262px;"><strong>Nome do nome pai:</strong><br />' . $pai . '&nbsp;</p>
					<p style="width:262px;"><strong>Nome da M�e:</strong><br />' . $mae . '&nbsp;</p>           
				</div>
				<div class="subtitulo subtitulo2"><p>- Endere�o Atual do Solicitante</p></div>
				<div class="corpo">
					<p style="width:262px;"><strong>Endere�o:</strong><br />' . $endereco . '&nbsp;</p> 
					<p style="width:43px;"><strong>N�:</strong><br />' . $numero . '&nbsp;</p> 
					<p style="width:150px;"><strong>Complemento:</strong><br />' . $complemento . '&nbsp;</p> 
					<p style="width:180px;"><strong>Bairro:</strong><br />' . $bairro . '&nbsp;</p> 
					<p style="width:40px;"><strong>Estado:</strong><br />' . $estado . '&nbsp;</p> 
					<p style="width:200px;"><strong>Cidade:</strong><br />' . $cidade . '&nbsp;</p> 
					<p style="width:60px;"><strong>CEP:</strong><br />' . $cep . '&nbsp;</p> 
					<p style="width:262px;"><strong>Tipo do Im�vel:</strong><br />' . strtoupper($tip_imovel) . '&nbsp;</p> 
					<p style="width:262px;"><strong>Reside na Pra�a Desde:</strong><br />' . $reside_praca . '&nbsp;</p> 
				</div>
				<div class="subtitulo subtitulo2"><p>- Endere�o Anterior do Solicitante</p></div>
				<div class="corpo">
					<p style="width:262px;"><strong>Endere�o:</strong><br />' . $endereco2 . '&nbsp;</p> 
					<p style="width:43px;"><strong>N�:</strong><br />' . $numero2 . '&nbsp;</p> 
					<p style="width:150px;"><strong>Complemento:</strong><br />' . $complemento2 . '&nbsp;</p> 
					<p style="width:180px;"><strong>Bairro:</strong><br />' . $bairro . '&nbsp;</p> 
					<p style="width:40px;"><strong>Estado:</strong><br />' . $estado2 . '&nbsp;</p> 
					<p style="width:200px;"><strong>Cidade:</strong><br />' . $cidade2 . '&nbsp;</p> 
					<p style="width:60px;"><strong>CEP:</strong><br />' . $cep2 . '&nbsp;</p> 
				</div>
			</div>
	
		</td>
		<td>&nbsp;</td>
	  </tr>
	</table>
	</body>
	</html>';
    return $html;
}