<!--#include file="funcoes.asp"-->
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>VIDA SIMPLES - CONTROLE DE PROPOSTA</title>
<base target="meio">
</head>
<%
wCPF_CNPJ=request.item("CPF")

wCPF_CNPJ=replace(wCPF_CNPJ, ".", "")
wCPF_CNPJ=replace(wCPF_CNPJ, "-", "")
wCPF_CNPJ=replace(wCPF_CNPJ, "/", "")
wCPF_CNPJ=replace(wCPF_CNPJ, " ", "")

if Len(wCPF_CNPJ) > 11 then
  if not IsCNPJ(wCPF_CNPJ) then
    response.redirect("MSG_CPF_Invalido.asp?CPF="&wCPF_CNPJ)
  else
    wCPF_CNPJ = FormatarCNPJ(wCPF_CNPJ)    
  end if
else
  if not IsCPF(wCPF_CNPJ) then
    response.redirect("MSG_CPF_Invalido.asp?CPF="&wCPF_CNPJ)
  else
    wCPF_CNPJ = FormatarCPF(wCPF_CNPJ)    
  end if
end if  


wProposta=request.item("Proposta")
wEmpresa=request.item("Empresa")
wVendedor=request.item("Vendedor")
wID_Vendedor=request.item("ID_Vendedor")

Set Database = Server.CreateObject("ADODB.Connection")
Database.Open StringConexao

SQL= "SELECT ID_PROPOSTA, DESCRICAO, VLR_MENSAL, NOME FROM LISTA_PROPOSTAS_CLIENTE('" & wCPF_CNPJ & "')"
Set TabPropostas = Database.Execute(SQL)

if TabPropostas.EOF then
  response.redirect("Cad_Clientes.asp?Proposta=" & wProposta & "&Empresa=" & wEmpresa & "&Vendedor=" & wVendedor & "&ID_Vendedor=" & wID_Vendedor & "&CPF=" & wCPF_CNPJ )
end if

%>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" background="images/Fundo.bmp">

<div align="center">
	<table border="0" width="700" cellspacing="0" cellpadding="0" height="100%" id="table1">
		<tr>
			<td style="border-left-style: solid; border-left-width: 1px; border-right-style: solid; border-right-width: 1px; border-top-width: 1px; border-bottom-width: 1px" bgcolor="#FFFFFF" valign="top">
			<div align="center">
				<table border="0" width="590" id="table2">
					<tr>
						<td width="565">
						<p align="center"><b><font face="Arial" size="2">
						Propostas do Cliente</font></b></td>
					</tr>
						<tr>
							<td>&nbsp;</td>
						</tr>
						<tr>
							<td><b><font face="Arial" size="2" color="#FF0000">
							Este cliente já possui proposta cadastrada...</font></b></td>
						</tr>
						<tr>
							<td>&nbsp;</td>
						</tr>
						<tr>
							<td><font face="Arial" size="2">
							<font color="#0000FF"><b>Cliente:</b></font> <b><%=TabPropostas("NOME")%></b></font></td>
						</tr>
						<tr>
							<td>&nbsp;</td>
						</tr>
						<tr>
							<td width="648">
							<table border="1" width="100%" id="table3" bordercolorlight="#808080" cellspacing="0" cellpadding="0" bordercolordark="#C0C0C0">
								<tr>
									<td width="108"><b>
									<font face="Arial" size="2" color="#000080">
									Proposta</font></b></td>
									<td><b>
									<font face="Arial" size="2" color="#000080">
									Plano</font></b></td>
									<td width="156" align="right"><b>
									<font face="Arial" size="2" color="#000080">
									Valor Mensal</font></b></td>
								</tr>
                                <% While NOT TabPropostas.EoF %>  								
								<tr>
									<td width="108"><font face="Arial" size="2">
									<%=TabPropostas("ID_PROPOSTA")%></font></td>
									<td><font face="Arial" size="2"><%=TabPropostas("DESCRICAO")%></font></td>
									<td width="156" align="right">
									<font face="Arial" size="2"><%=TabPropostas("VLR_MENSAL")%></font></td>
								</tr>
                                <% TabPropostas.MoveNext %> 
                                <% Wend %>      									
							</table>
							</td>
						</tr>
						<tr>
							<td width="648">&nbsp;</td>
						</tr>
						<tr>
							<td width="648">
							<p align="center" style="line-height: 150%"><b>
							<font color="#0000FF" size="2" face="Arial">Deseja 
							continuar o cadastro da Nova Proposta ?</font></b></p>
							<ul>
								<li>
								<p align="center" style="line-height: 150%"><b>
								<font face="Arial" size="2" color="#0000FF">
								<a href="Cad_Clientes.asp?Proposta=<%=wProposta%>&Empresa=<%=wEmpresa%>&Vendedor=<%=wVendedor%>&ID_Vendedor=<%=wID_Vendedor%>&CPF=<%=wCPF_CNPJ%>">Sim</a></font></b></li>
								<li>
								<p align="center" style="line-height: 150%"><b>
								<font face="Arial" size="2" color="#0000FF">
								<a href="Cad_Propostas_Detalhes.asp?Acao=C&TProposta=<%=wProposta%>&ID_EMPRESA=<%=wEmpresa%>&ID_Vendedor=<%=wID_Vendedor%>&Origem=S">Não</a></font></b></li>
							</ul>
							</td>
						</tr>
						<tr>
							<td width="648">&nbsp;</td>
						</tr>
   			    </table>
			</div>
			</td>
		</tr>
	</table>
</div>

</body>

</html>