Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Walter Spolidoro

Problema para passar CDONTS para CDOSYS

Recommended Posts

Olá, estou tentando fazer a passagem do formulario de cdonts para cdosys.

Alguem pode me ajudar?

 

 

 

 

__________________________________________________________

 

 

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="fc_crypt.asp" -->
<%

	Session.LCID = 1046
	
	If Request.QueryString("language") = "portugues" Then
	
	strIdioma = "pt"
	strNaoEncontrado = "ERRO! Cliente não encontrado!"
	strTitulo = "Copacabana Holiday - Atualização de dados cadastrais"
	strAviso1 = "AVISO DE SEGURANÇA!"
	strAviso2 = "Fique tranquilo, você está em um <strong>ambiente seguro</strong>."
	strAviso3 = "Por favor, atualize suas informações a fim de agilizarmos o processo de Check In na data de sua chegada (contrato, recibos, entre outros)."
	strAtualize = "Por favor, atualize os dados abaixo:"
	strNome = "Nome Completo:"
	strEmail = "E-mail:"
	strCPF = "CPF (caso possua):"
	strIdentidade = "Identidade (caso possua):"
	strPassaporte = "Passaporte:"
	strNacionalidade = "Nacionalidade:"
	strEstadoCivil = "Estado Civil:"
	strProfissao = "Profissão:"
	strEndereco = "Endereço:"
	strBairro = "Bairro:"
	strCidade = "Cidade:"
	strEstado = "Estado:"
	strCEP = "CEP:"
	strPais = "País:"
	strTelResidencial = "Telefone residencial:"
	strTelComercial = "Telefone comercial:"
	strRamal = "R.:"
	strCelular = "Telefone celular:"
	strSuasReservas = "Você possui as seguintes reservas cadastradas:"
	strSuasReservas2 = "Você não possui reservas cadastradas."
	strDias = "Dias:"
	strValor = "Valor:"
	strCaucao = "Caução:"
	strSinal = "Sinal:"
	strAtualizeOk = "Suas informações foram atualizadas com sucesso!"
	strMsgErro1 = "Por favor, é necessário o preenchimento do NOME!"
	strMsgErro2 = "Por favor, é necessário o preenchimento do SOBRENOME!"
	strMsgErro3 = "Por favor, é necessário o preenchimento correto do E-MAIL!"
	strMsgErro3a = "Por favor, é necessário o preenchimento do CPF OU DO PASSAPORTE!"
	strMsgErro4 = "Por favor, é necessário o preenchimento da NACIONALIDADE!"
	strMsgErro5 = "Por favor, é necessário o preenchimento do ESTADO CIVIL!"
	strMsgErro6 = "Por favor, é necessário o preenchimento da PROFISSÃO!"
	strMsgErro7 = "Por favor, é necessário o preenchimento do ENDEREÇO!"
	strMsgErro8 = "Por favor, é necessário o preenchimento da CIDADE!"
	strMsgErro9 = "Por favor, é necessário o preenchimento do PAÍS!"
	strCPFValid = "Você precisa preencher um CPF válido"

	Else
	
	strIdioma = "en"
	strNaoEncontrado = "ERROR! Client not found!"
	strTitulo = "Copacabana Holiday - Update your informations"
	strAviso1 = "SECURITY ANNOUNCEMENT!"
	strAviso2 = "Please, do not be alarmed; <strong>you are in a secure environment</strong>."
	strAviso3 = "In order to activate the check in process in your arrival date (contract, receipts and other paperworks), please fill out the form below."
	strAtualize = "Please, fill out our form:"
	strNome = "Full Name:"
	strEmail = "E-mail:"
	strCPF = "CPF number (If Brazilian):"
	strIdentidade = "Identity card (For South American and Brazilian citizens):"
	strPassaporte = "Passport number:"
	strNacionalidade = "Nationality:"
	strEstadoCivil = "Marital status:"
	strProfissao = "Profession:"
	strEndereco = "Address:"
	strBairro = "District:"
	strCidade = "City:"
	strEstado = "State:"
	strCEP = "Postal code:"
	strPais = "Country:"
	strTelResidencial = "Home phone number:"
	strTelComercial = "Work phone number:"
	strRamal = "Ext #:"
	strCelular = "Mobile phone number:"
	strSuasReservas = "You have the following registered booking:"
	strSuasReservas2 = "There is no registered booking."
	strDias = "Days:"
	strValor = "Value:"
	strCaucao = "Security deposit:"
	strSinal = "Down payment:"
	strAtualizeOk = "Your information was successfully updated!"
	strMsgErro1 = "Please, fill out the FIRST NAME(S)!"
	strMsgErro2 = "Please, fill out the LAST NAME!"
	strMsgErro3 = "Please, fill out the E-MAIL!"
	strMsgErro3a = "Please, fill out the CPF NUMBER OR PASSPORT NUMBER!"
	strMsgErro4 = "Please, fill out the NATIONALITY!"
	strMsgErro5 = "Please, fill out the MARITAL STATUS!"
	strMsgErro6 = "Please, fill out the PROFESSION!"
	strMsgErro7 = "Please, fill out the ADDRESS!"
	strMsgErro8 = "Please, fill out the CITY!"
	strMsgErro9 = "Please, fill out the COUNTRY!"
	strCPFValid = "Please, fill out the CPF with a valid number!"
	
	End If

	' Função Anti SQL Injection
	Function MakeOk(sTrings)
		MakeOk = Replace(sTrings,"'","")
		MakeOk = Replace(sTrings,"""","")
		MakeOk = Replace(MakeOk,Chr(34),"")
		MakeOk = Replace(MakeOk,Chr(39),"")
		MakeOk = Trim(MakeOk)
	End Function 

	' ================================== INÍCIO DO POST ==================================
	' ================================== INÍCIO DO POST ==================================
	' ================================== INÍCIO DO POST ==================================

	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
	
	Function Cap(strTexto)
		If strTexto = "" Then Exit Function
		Cap = UCase(Mid(strTexto,1,1)) & LCase(Mid(strTexto,2,Len(strTexto)-1))
	End Function
	
	Function Cap2(strTexto)
		If strTexto = "" Then Exit Function
	strTexto = Lcase(Trim(strTexto))
	If inStr(strTexto," ") = 0 Then
		Cap2 = Cap(strTexto)
	Else
		arrTexto = Split(strTexto," ")
		For x = 0 To UBound(arrTexto)
			If arrTexto(x) = "de" OR arrTexto(x) = "e" OR arrTexto(x) = "do" OR arrTexto(x) = "dos" OR arrTexto(x) = "da" OR arrTexto(x) = "com" OR arrTexto(x) = "das" Then
				Cap2 = Cap2 & arrTexto(x) & " "
			Else
				Cap2 = Cap2 & Cap(arrTexto(x)) & " "
			End If
		Next
	End If
	Cap2 = Trim(Cap2)
	End Function
	
	Function FormFieldList()
	Dim str, i, name
	str = ""
	For i = 1 to Request.Form.Count
	   For Each name In Request.Form
		 If Left(name, 1) <> "_" and Request.Form(name) is Request.Form(i) Then
		   If str <> "" Then
			 str = str & ","
		   End If
		   str = str & name
		   Exit For
		 End If
	   Next
	 Next
	 FormFieldList = Split(str, ",")
	End Function
		
	' Pegar dados do form
	IDCli = Cint(Request.Form("IDCli"))
	NomeForm = Request.Form("Nome")
	CorreioEletronicoForm = Request.Form("CorreioEletronico")
	CPFForm = Request.Form("CPF")
	IdentidadeForm = Request.Form("Identidade")
	PassaporteForm = Request.Form("Passaporte")
	NacionalidadeForm = Request.Form("Nacionalidade")
	EstadoCivilForm = Request.Form("EstadoCivil")
	ProfissaoForm = Request.Form("Profissao")
	EnderecoForm = Request.Form("Endereco")
	BairroForm = Request.Form("Bairro")
	CidadeForm = Request.Form("Cidade")
	EstadoForm = Request.Form("Estado")
	CEPForm = Request.Form("CEP")
	PaisForm = Request.Form("Pais")
	TelefoneResidencialForm = Request.Form("TelefoneResidencial")
	TelefoneComercialForm = Request.Form("TelefoneComercial")
	RamalForm = Request.Form("Ramal")
	CelularForm = Request.Form("Celular")
	
	' Cadastra a reserva no banco de dados - Conexao SQL
	Set conexao = server.CreateObject("ADODB.connection")
	conexao.open Application("holiday")
	
	SQL2 = "UPDATE [dbo].[tbl_Clientes]"
	SQL2 = SQL2 & "SET [NomeCompleto] = '" & NomeForm & "'"
	SQL2 = SQL2 & ",[CorreioEletronico] = '" & CorreioEletronicoForm & "'"
	SQL2 = SQL2 & ",[CPF] = '" & CPFForm & "'"
	SQL2 = SQL2 & ",[Identidade] = '" & IdentidadeForm & "'"
	SQL2 = SQL2 & ",[Passaporte] = '" & PassaporteForm & "'"
	SQL2 = SQL2 & ",[Nacionalidade] = '" & NacionalidadeForm & "'"
	SQL2 = SQL2 & ",[EstadoCivil] =  '" & EstadoCivilForm & "'"
	SQL2 = SQL2 & ",[Profissao] =  '" & ProfissaoForm & "'"
	SQL2 = SQL2 & ",[Endereco] =  '" & EnderecoForm & "'"
	SQL2 = SQL2 & ",[Bairro] =  '" & BairroForm & "'"
	SQL2 = SQL2 & ",[Cidade] =  '" & CidadeForm & "'"
	SQL2 = SQL2 & ",[Estado] =  '" & EstadoForm & "'"
	SQL2 = SQL2 & ",[CEP] =  '" & CEPForm & "'"
	SQL2 = SQL2 & ",[Pais] =  '" & PaisForm & "'"
	SQL2 = SQL2 & ",[TelefoneResidencial] =  '" & TelefoneResidencialForm & "'"
	SQL2 = SQL2 & ",[TelefoneComercial] =  '" & TelefoneComercialForm & "'"
	SQL2 = SQL2 & ",[RamalComercial] =  '" & RamalForm & "'"
	SQL2 = SQL2 & ",[Celular] =  '" & CelularForm & "'"
	SQL2 = SQL2 & "WHERE idCliente = '" & IDCli & "'"
	
	conexao.Execute (SQL2)
	
	conexao.Close
	Set conexao = Nothing

	str = ""
	If Request.Form("_fieldOrder") <> "" Then
	 fieldOrder = Split(Request.Form("_fieldOrder"), ",")
	 For Each Campo In fieldOrder
	   if str <> "" then
		 str = str & ","
	   End If
	   str = str & Trim(name)
	 Next
	 fieldOrder = Split(str, ",")
   Else
	 fieldOrder = FormFieldList()
   End If

	   
	For Each Campo In fieldOrder
		strHTML = strHTML & "			<tr>" & vbcrlf
		'strHTML = strHTML & "			  <td width='50%' bgcolor='#efefef'><b><font size='2' face='Tahoma'>" & MakeOk(Campo) & "</font></b></td>" & vbcrlf
		'strHTML = strHTML & "			  <td width='50%' bgcolor='#efefef'><font size='2' face='Tahoma'>" & MakeOk(Request.Form(Campo)) & "</font></td>" & vbcrlf
		strHTML = strHTML & "			  <td width='100%'><b><font size='2' face='Tahoma'>" & MakeOk(Campo) & ":</b>   " & MakeOk(Request.Form(Campo)) & "</font></td>" & vbcrlf
		'strHTML = strHTML & "			  <td width='50%' bgcolor='#efefef'><font size='2' face='Tahoma'></font></td>" & vbcrlf
		strHTML = strHTML & "			</tr>" & vbcrlf
	Next
					
	
		strCorpoHTML = ""
		strCorpoHTML = strCorpoHTML & "<html>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "<head>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "<meta http-equiv=""Content-Language"" content=""pt-br"">" & vbCrlf
		strCorpoHTML = strCorpoHTML & "<meta http-equiv=""Content-Type"" content=""text/html; charset=windows-1252"">" & vbCrlf
		strCorpoHTML = strCorpoHTML & "<title>Copacabana Holiday - Atualização de dados cadastrais</title>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "</head>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "" & vbCrlf
		strCorpoHTML = strCorpoHTML & "<body bgcolor=""#FFFFFF"">" & vbCrlf
		strCorpoHTML = strCorpoHTML & "" & vbCrlf
		strCorpoHTML = strCorpoHTML & "" & vbCrlf
		strCorpoHTML = strCorpoHTML & "<div align=""center"">" & vbCrlf
		strCorpoHTML = strCorpoHTML & "  <center>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "  <table width=""100%"" height=""100%"" bgcolor=""#FFFFFF"" cellspacing cellpadding>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	<tr>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	  <td width=""100%"" height=""100%"" valign=""top""><hr bgcolor=""#717E8D"" size=""1"" style=""width: 1;"">" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	  " & vbCrlf
		strCorpoHTML = strCorpoHTML & "" & vbCrlf
		strCorpoHTML = strCorpoHTML & "<div align=""center"">" & vbCrlf
		strCorpoHTML = strCorpoHTML & "  <center>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "  <table width=""500"" cellspacing cellpadding style=""border: 1 solid #000000"">" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	<tr>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	  <td width=""100%"" bgcolor=""#FFFFFF"">" & vbCrlf
		strCorpoHTML = strCorpoHTML & "		<div align=""center"">" & vbCrlf
		strCorpoHTML = strCorpoHTML & "		  <center>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "		  <table width=""500"" cellspacing cellpadding>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "		  </table>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "		  </center>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "		</div>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	  </td>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	</tr>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	<tr>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	  <td width=""100%"" bgcolor=""#FFFFFF""><IMG WIDTH=""1"" HEIGHT=""5"" BORDER=""0""></td>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	</tr>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	<tr>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	  <td width=""100%"" bgcolor=""#FFFFFF""><IMG WIDTH=""1"" HEIGHT=""5"" BORDER=""0""></td>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	</tr>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	<tr>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	  <td width=""100%"" bgcolor=""#FFFFFF"">" & vbCrlf
		strCorpoHTML = strCorpoHTML & "		<div align=""center"">" & vbCrlf
		strCorpoHTML = strCorpoHTML & "		  <center>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "		  <table width=""470"" cellspacing cellpadding><br><center><IMG SRC=""http://www.copacabanaholiday.com.br/admin/imagens/logo_email.gif"" BORDER=""0""><br><br><font size='2' face='Tahoma'><b>www.copacabanaholiday.com.br</b></font></center><br><br>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "			<tr>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "			  <td width=""100%"">" & strHTML & "<font face=""Tahoma"" size=""2"">" & vbCrlf
		strCorpoHTML = strCorpoHTML & "<br></td>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "			</tr>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "		  </table>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "		  </center>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "		</div>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	  </td>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	</tr>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	<tr>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	  <td width=""100%"" bgcolor=""#FFFFFF""><IMG WIDTH=""1"" HEIGHT=""12"" BORDER=""0""></td>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	</tr>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "  </table>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "  </center>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "</div>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "<hr bgcolor=""#717E8D"" size=""1"" style=""width: 1;""></td>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "	</tr>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "  </table>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "  </center>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "</div>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "</body>" & vbCrlf
		strCorpoHTML = strCorpoHTML & "</html>" & vbCrlf


	Set objCdonts = Server.Createobject("CDONTS.NewMail")
		objCdonts.From = "rio@copacabanaholiday.com.br"
		objCdonts.To = "rio@copacabanaholiday.com.br"
		objCdonts.Subject = "Copacabana Holiday - Atualizacao cadastral de cliente"
		objCdonts.Body = strCorpoHTML
		objCdonts.BodyFormat = 0
		objCdonts.MailFormat = 0
		objCdonts.Send
	Set objCdonts = Nothing
				
	js "alert('" & strAtualizeOk & "');location.href='http://www.copacabanaholiday.com.br/';"
	Response.End	

	End If

	' ================================== FIM DO POST ==================================
	' ================================== FIM DO POST ==================================
	' ================================== FIM DO POST ==================================

'Email = MakeOk(Request.QueryString("id"))
Email = MakeOk(Decripta(Request.QueryString("id")))

Set Cliente = Server.CreateObject("ADODB.Recordset")
Cliente.ActiveConnection = Application("holiday")
Cliente.Source = "SELECT TOP 1 * FROM dbo.tbl_CLIENTES WHERE CorreioEletronico = '" + Replace(MakeOk(Email), "'", "''") + "'"
Cliente.CursorType = 0
Cliente.CursorLocation = 2
Cliente.LockType = 1
Cliente.Open()

Cliente_numRows = 0

If Cliente.EOF OR Cliente.BOF OR Request.QueryString("id") = "" OR Len(Request.QueryString("id")) < 7 OR IsEmpty(Email) = True OR Email = "" Then
	js "alert('"&strNaoEncontrado&"');location.href='http://www.copacabanaholiday.com.br/tools/update/default.asp';"
	Response.End()
End If


%>
<%
Dim Reservas__MMColParam
Reservas__MMColParam = "1"
If Cliente.Fields.Item("idCliente").Value <> "" Then 
  Reservas__MMColParam = Cliente.Fields.Item("idCliente").Value
End If
%>
<%
Dim Reservas
Dim Reservas_numRows

Set Reservas = Server.CreateObject("ADODB.Recordset")
Reservas.ActiveConnection = Application("holiday")
Reservas.Source = "SELECT * FROM dbo.tbl_RESERVAS WHERE idCliente = '" + Replace(Reservas__MMColParam, "'", "''") + "'"
Reservas.CursorType = 0
Reservas.CursorLocation = 2
Reservas.LockType = 1
Reservas.Open()

Reservas_numRows = 0

Dim Repeat2__numRows
Dim Repeat2__index

Repeat2__numRows = -1
Repeat2__index = 0
Reservas_numRows = Reservas_numRows + Repeat2__numRows


	Function js(str)
	Response.Write "<script>" & str & "</script>"
	End Function

	Function DataZero(sData)
	IF isDate(sData) = False THEN Exit Function
		CheckIn_Dia	= Split(sData,"/")(0)
		CheckIn_Mes	= Split(sData,"/")(1)
		CheckIn_Ano	= Split(sData,"/")(2)
	If CheckIn_Dia <= 9 Then CheckIn_Dia = "0" & CheckIn_Dia
	If CheckIn_Mes <= 9 Then CheckIn_Mes = "0" & CheckIn_Mes
		sData	= Response.write(CheckIn_Dia & "/" & CheckIn_Mes & "/" & CheckIn_Ano)
	End Function
	
%>	
	
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><%= strTitulo %></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script LANGUAGE="JavaScript" type="text/javascript">
<!--
	function valForm(form){

		if(form.Nome.value==''){
			alert('<%= strMsgErro1 %>');
			form.Nome.focus();
			return false;
		}
				
		if(form.CorreioEletronico.value==''){
			alert('<%= strMsgErro3 %>');
			form.CorreioEletronico.focus();
			return false;
		}
		
			var Result1, Result2;
			Result1 = form.CorreioEletronico.value.indexOf("@", 0);

			if (Result1 == -1 || form.CorreioEletronico.length < 6){
				alert('<%= strMsgErro3 %>');
				form.CorreioEletronico.focus();
				return false;
			}else{
				Result2 = form.CorreioEletronico.value.indexOf(".", Number(Result1 + 3));
				if (Result2 == -1 || form.CorreioEletronico.length < 6){
					alert('<%= strMsgErro3 %>');
					form.CorreioEletronico.focus();
					return false;
				}
			}

		// Para Preenchimento obrigatorio do CPF ou do Passaporte
		if(form.CPF.value=='' && form.Passaporte.value==''){
			alert('<%= strMsgErro3a %>');
			<% If strIdioma = "pt" Then %>			
			form.CPF.focus();
			<% Else %>
			form.Passaporte.focus();
			<% End If %>
			return false;
		}else if(form.CPF.value!=''){

				if(VerifyCPF(form.CPF.value) != 1){ 
					alert('<%= strCPFValid %>');
					form.CPF.focus();
					return false;
				}
		}
		
		
		// Função para limpar CPF
		// ---------------------------------
		
			function LIMP©{ 
		
		while((cx=c.indexOf("-"))!=-1){ 
			c = c.substring(0,cx)+c.substring(cx+1); 
		} 

		while((cx=c.indexOf("/"))!=-1){ 
			c = c.substring(0,cx)+c.substring(cx+1); 
		} 

		while((cx=c.indexOf(","))!=-1){ 
			c = c.substring(0,cx)+c.substring(cx+1); 
		} 

		while((cx=c.indexOf("."))!=-1){ 
			c = c.substring(0,cx)+c.substring(cx+1); 
		} 

		while((cx=c.indexOf("("))!=-1){ 
			c = c.substring(0,cx)+c.substring(cx+1); 
		} 

		while((cx=c.indexOf(")"))!=-1){ 
			c = c.substring(0,cx)+c.substring(cx+1); 
		} 

		while((cx=c.indexOf(" "))!=-1){ 
			c = c.substring(0,cx)+c.substring(cx+1); 
		} 

		return©; 

	} 
		
		function VerifyCPF(pcpf)  { 

	pcpf = LIMP(pcpf); 

 if (pcpf.length != 11) {sim=false} 
 else {sim=true} 

  if (sim )  // valida o primeiro digito 
  { 
  for (i=0;((i<=(pcpf.length-1))&& sim); i++) 
  { 
   val = pcpf.charAt(i) 
   if 

 ((val!="9")&&(val!="0")&&(val!="1")&&(val!="2")&&(val!="3")&&(val!="4") 

 &&	(val!="5")&&(val!="6")&&(val!="7")&&(val!="8")) {sim=false} 
   } 

   if (sim) 
  { 
	soma = 0 
	for (i=0;i<=8;i++) 
	{ 
	 val = eval(pcpf.charAt(i)) 
	 soma = soma + (val*(i+1)) 
	} 

	resto = soma % 11 
	if (resto>9) dig = resto -10 
	else  dig = resto 
	if (dig != eval(pcpf.charAt(9))) { sim=false } 
   else   // valida o segundo digito 
	{ 

	 soma = 0 
	for (i=0;i<=7;i++) 
	 { 
	 val = eval(pcpf.charAt(i+1)) 
	  soma = soma + (val*(i+1)) 
	} 

	 soma = soma + (dig * 9) 
	resto = soma % 11 
	 if (resto>9) dig = resto -10 
	 else  dig = resto 
   if (dig != eval(pcpf.charAt(10))) { sim = false } 
	else sim = true 
   } 
   } 
  } 

  if (sim) { 
	return (1);
	//alert("Valor Valido de CPF") 
	} 
  else 
	return (0);
	//alert("Valor invalido de CPF");
 } 
 
 // --------------------------------------------
		
		
		if(form.Nacionalidade.value==''){
			alert('<%= strMsgErro4 %>');
			form.Nacionalidade.focus();
			return false;
		}
		
		if(form.EstadoCivil.value==''){
			alert('<%= strMsgErro5 %>');
			form.EstadoCivil.focus();
			return false;
		}
		
		if(form.Profissao.value==''){
			alert('<%= strMsgErro6 %>');
			form.Profissao.focus();
			return false;
		}
		
		if(form.Endereco.value==''){
			alert('<%= strMsgErro7 %>');
			form.Endereco.focus();
			return false;
		}
		
		if(form.Cidade.value==''){
			alert('<%= strMsgErro8 %>');
			form.Cidade.focus();
			return false;
		}
		
		if(form.Pais.value==''){
			alert('<%= strMsgErro9 %>');
			form.Pais.focus();
			return false;
		}
		
	return true;
	}
//-->
</SCRIPT>
<style type="text/css">
<!--
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	color: #000099;
}
body {
	background-color: #FFFFFF;
	background-image: url(images/main_bg.gif);
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
a:link {
	color: #000099;
	text-decoration: underline;
}
a:visited {
	text-decoration: underline;
	color: #000099;
}
a:hover {
	text-decoration: none;
	color: #000099;
}
a:active {
	text-decoration: underline;
	color: #000099;
}
.style1 {
	color: #FF0000;
	font-weight: bold;
}
.input{
	background-color: #ffffff;
	font-family: Verdana, Arial, Helvetica, sans-serif; 
	font-size: 11px; 
	font-weight: bold; 
	color: 102771;
	border : 1px Black solid;

}
.U				  { border: #000000 1px solid; background-color: #FFFFE1}
.style2 {
	font-size: 16;
	color: #FF0000;
	font-weight: bold;
	}
-->
</style></head>
<body>
<form id="form" name="form" method="post" action="" onSubmit="return valForm(this);">
<table width="680" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
   <td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
   <td><img src="images/spacer.gif" width="14" height="1" border="0" alt=""></td>
   <td><img src="images/spacer.gif" width="3" height="1" border="0" alt=""></td>
   <td><img src="images/spacer.gif" width="94" height="1" border="0" alt=""></td>
   <td><img src="images/spacer.gif" width="245" height="1" border="0" alt=""></td>
   <td><img src="images/spacer.gif" width="106" height="1" border="0" alt=""></td>
   <td><img src="images/spacer.gif" width="36" height="1" border="0" alt=""></td>
   <td><img src="images/spacer.gif" width="12" height="1" border="0" alt=""></td>
   <td><img src="images/spacer.gif" width="22" height="1" border="0" alt=""></td>
   <td><img src="images/spacer.gif" width="77" height="1" border="0" alt=""></td>
   <td><img src="images/spacer.gif" width="22" height="1" border="0" alt=""></td>
   <td><img src="images/spacer.gif" width="47" height="1" border="0" alt=""></td>
   <td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
   <td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
  </tr>

  <tr>
   <td rowspan="13" bgcolor="#000000"></td>
   <td colspan="6"><img name="linhatopoa" src="images/linha-topo-a.gif" width="498" height="10" border="0" alt=""></td>
   <td rowspan="4" colspan="5"><img name="formulario" src="images/formulario.gif" width="180" height="97" border="0" alt=""></td>
   <td rowspan="13" bgcolor="#000000"></td>
   <td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="3"><img name="linhatopoe" src="images/linha-topo-e.gif" width="14" height="87" border="0" alt=""></td>
   <td colspan="4"><img name="logotipo" src="images/logotipo.gif" width="448" height="39" border="0" alt=""></td>
   <td rowspan="3"><img name="linhatopob" src="images/linha-topo-b.gif" width="36" height="87" border="0" alt=""></td>
   <td><img src="images/spacer.gif" width="1" height="39" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="2"><img name="default_r3_c3" src="images/default_r3_c3.gif" width="97" height="35" border="0" alt=""></td>
   <td colspan="2"><img name="slogan" src="images/slogan_<%= strIdioma %>.gif" width="351" height="35" border="0" alt=""></td>
   <td><img src="images/spacer.gif" width="1" height="35" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="4" bgcolor="#0033CC"></td>
   <td><img src="images/spacer.gif" width="1" height="13" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="11" bgcolor="#000099"></td>
   <td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="11" bgcolor="#FBF70E"></td>
   <td><img src="images/spacer.gif" width="1" height="4" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="7" rowspan="2" bgcolor="#FBF70E"> </td>
   <td><img name="bandeira_portugues" src="images/bandeira_portugues.gif" width="22" height="15" border="0" alt=""></td>
   <td rowspan="2" valign="top" bgcolor="#FBF70E"> <a href="client.asp?language=portugues&id=<%= Request.querystring("id") %>">Português</a></td>
   <td><img name="bandeira_english" src="images/bandeira_english.gif" width="22" height="15" border="0" alt=""></td>
   <td rowspan="2" valign="top" bgcolor="#FBF70E"> <a href="client.asp?language=english&id=<%= Request.querystring("id") %>">English</a></td>
   <td><img src="images/spacer.gif" width="1" height="15" border="0" alt=""></td>
  </tr>
  <tr>
   <td bgcolor="#FBF70E"></td>
   <td bgcolor="#FBF70E"></td>
   <td><img src="images/spacer.gif" width="1" height="4" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="11"><img name="linhaidiomas" src="images/linha-idiomas.gif" width="678" height="4" border="0" alt=""></td>
   <td><img src="images/spacer.gif" width="1" height="4" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="11" bgcolor="#FFFFFF"> </td>
   <td><img src="images/spacer.gif" width="1" height="11" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="2" rowspan="2" bgcolor="#FFFFFF"> </td>
   <td colspan="9" rowspan="2" valign="top" bgcolor="#FFFFFF"><p><img name="client_<%= strIdioma %>" src="images/client_<%=strIdioma%>.gif" border="0" alt=""></p>
   <br>
	 <table width="400" border="0" align="center" cellpadding="2" cellspacing="2" style="border:dashed 1px;">
	   <tr>
		 <td width="507"><table width="100%" height="100%" border="0" align="center">
		   <tr>
			 <td width="7%" valign="top"><div align="center"><img src="images/index_r13_c4.gif" width="53" height="57"></div></td>
			  <td width="93%" valign="top"><p><span class="style1"><%=strAviso1%></span><br>
			   <%=strAviso2%><br>
			   <br>
			   <%=strAviso3%></p>
			   </td>
		   </tr>
		 </table></td>
	   </tr>
	 </table>
	 <br>
	 <%= strAtualize %>
		<table width="100%" border="0" cellspacing="3">
  <tr>
	<td width="243"><%=strNome%> *</td>
	<td width="408"><input name="Nome" type="text" class="input" id="Nome" value="<%=(Cliente.Fields.Item("NomeCompleto").Value)%>" size="62" s:helptext="Nome" onkeyup="this.value=this.value.toUpperCase();" /></td>
  </tr>
  <tr>
	<td><%=strEmail%> *</td>
	<td><input name="CorreioEletronico" type="text" class="input" id="CorreioEletronico" value="<%=(Cliente.Fields.Item("CorreioEletronico").Value)%>" size="35" /></td>
  </tr>
  <tr>
	<td><%=strCPF%></td>
	<td><input name="CPF" type="text" class="input" id="CPF" value="<%=(Cliente.Fields.Item("CPF").Value)%>" size="35" onkeyup="this.value=this.value.toUpperCase();" /></td>
  </tr>
  <tr>
	<td><%=strIdentidade%></td>
	<td><input name="Identidade" type="text" class="input" id="Identidade" value="<%=(Cliente.Fields.Item("Identidade").Value)%>" size="35" onkeyup="this.value=this.value.toUpperCase();" /></td>
  </tr>
  <tr>
	<td><%=strPassaporte%></td>
	<td><input name="Passaporte" type="text" class="input" id="Passaporte" value="<%=(Cliente.Fields.Item("Passaporte").Value)%>" size="35" onkeyup="this.value=this.value.toUpperCase();" /></td>
  </tr>
  <tr>
	<td><%=strNacionalidade%> *</td>
	<td><input name="Nacionalidade" type="text" class="input" id="Nacionalidade" value="<%=(Cliente.Fields.Item("Nacionalidade").Value)%>" size="35" onkeyup="this.value=this.value.toUpperCase();" /></td>
  </tr>
  <tr>
	<td><%=strEstadoCivil%> *</td>
	<td><input name="EstadoCivil" type="text" class="input" id="EstadoCivil" value="<%=(Cliente.Fields.Item("EstadoCivil").Value)%>" size="35" onkeyup="this.value=this.value.toUpperCase();" /></td>
  </tr>
  <tr>
	<td><%=strProfissao%> *</td>
	<td><input name="Profissao" type="text" class="input" id="Profissao" value="<%=(Cliente.Fields.Item("Profissao").Value)%>" size="35" onkeyup="this.value=this.value.toUpperCase();" /></td>
  </tr>
  <tr>
	<td><%=strEndereco%> *</td>
	<td><input name="Endereco" type="text" class="input" id="Endereco" onkeyup="this.value=this.value.toUpperCase();" value="<%=(Cliente.Fields.Item("Endereco").Value)%>" size="62" maxlength="255" /></td>
  </tr>
  <tr>
	<td><%=strBairro%></td>
	<td><input name="Bairro" type="text" class="input" id="Bairro" value="<%=(Cliente.Fields.Item("Bairro").Value)%>" size="35" onkeyup="this.value=this.value.toUpperCase();" /></td>
  </tr>
  <tr>
	<td><%=strCidade%> *</td>
	<td><input name="Cidade" type="text" class="input" id="Cidade" value="<%=(Cliente.Fields.Item("Cidade").Value)%>" size="35" onkeyup="this.value=this.value.toUpperCase();" /></td>
  </tr>
  <tr>
	<td><%=strEstado%></td>
	<td><input name="Estado" type="text" class="input" id="Estado" value="<%=(Cliente.Fields.Item("Estado").Value)%>" size="35" onkeyup="this.value=this.value.toUpperCase();" /></td>
  </tr>
  <tr>
	<td><%=strCEP%></td>
	<td><input name="CEP" type="text" class="input" id="CEP" value="<%=(Cliente.Fields.Item("CEP").Value)%>" size="35" onkeyup="this.value=this.value.toUpperCase();" /></td>
  </tr>
  <tr>
	<td><%=strPais%> *</td>
	<td><input name="Pais" type="text" class="input" id="Pais" value="<%=(Cliente.Fields.Item("Pais").Value)%>" size="35" onkeyup="this.value=this.value.toUpperCase();" /></td>
  </tr>
  <tr>
	<td><%=strTelResidencial%></td>
	<td><input name="TelefoneResidencial" type="text" class="input" id="TelefoneResidencial" value="<%=(Cliente.Fields.Item("TelefoneResidencial").Value)%>" size="35" onkeyup="this.value=this.value.toUpperCase();" /></td>
  </tr>
  <tr>
	<td><%=strTelComercial%></td>
	<td><input name="TelefoneComercial" type="text" class="input" id="TelefoneComercial" value="<%=(Cliente.Fields.Item("TelefoneComercial").Value)%>" size="24" onkeyup="this.value=this.value.toUpperCase();" /> 
	  <%=strRamal%> 
		<input name="Ramal" type="text" class="input" id="Ramal" value="<%=(Cliente.Fields.Item("RamalComercial").Value)%>" size="4" onkeyup="this.value=this.value.toUpperCase();" /></td>
  </tr>
  <tr>
	<td><%=strCelular%></td>
	<td><input name="Celular" type="text" class="input" id="Celular" value="<%=(Cliente.Fields.Item("Celular").Value)%>" size="35" onkeyup="this.value=this.value.toUpperCase();" /></td>
  </tr>
  <tr>
	<td colspan="2"><input name="IDCli" type="hidden" id="IDCli" value="<%=(Cliente.Fields.Item("idCliente").Value)%>"></td>
  </tr>
  <tr>
	<td colspan="2"><br>
	  <strong><%=strSuasReservas%></strong><br> 
	  <br>
	<!-- INICIO -->
	
	<% If Not Reservas.EOF Or Not Reservas.BOF Then %>
	<% 
		While ((Repeat2__numRows <> 0) AND (NOT Reservas.EOF)) 
	%>
	<table width="98%" border="0" class="U">
	  <tr>
		<td width="5%"><div align="center"><strong>Ref.:</strong></div></td>
		<td width="11%"><div align="center"><strong>Check In:</strong></div></td>
		<td width="11%"><div align="center"><strong>Check Out:</strong></div></td>
		<td width="5%"><div align="center"><strong><%=strDias%></strong></div></td>
		<td width="11%"><div align="center"><strong><%=strValor%></strong></div></td>
		<td width="11%"><div align="center"><strong><%=strCaucao%></strong></div></td>
		<td width="11%"><div align="center"><strong><%=strSinal%></strong></div></td>
		</tr>
	  <tr>
		<td><div align="center" class="style2" title="<%=(Reservas.Fields.Item("Endereco").Value)%>"><%=(Reservas.Fields.Item("idImovel").Value)%></div></td>
		  <td><div align="center"><% DataZero(Reservas.Fields.Item("CheckIn").Value)%></div></td>
		<td><div align="center"><% DataZero(Reservas.Fields.Item("CheckOut").Value) + 1 %>(12:00pm)</div></td>
		<td><div align="center"><% Dias = DateDiff("d", (Reservas.Fields.Item("CheckIn").Value), (Reservas.Fields.Item("CheckOut").Value)) %>
		<%= Dias +1 %></div></td>
		<td><div align="center">R$ <%=(Reservas.Fields.Item("Valor").Value)%></div></td>
		<td><div align="center">R$ <%=(Reservas.Fields.Item("Caucao").Value)%></div></td>
		<td><div align="center">R$ <%=(Reservas.Fields.Item("Sinal").Value)%></div></td>
		</tr>
	</table>
	<br />
<% 
  Repeat2__index=Repeat2__index+1
  Repeat2__numRows=Repeat2__numRows-1
  Reservas.MoveNext()
Wend
%>
	<% Else %>
	<span id="statmsg">
  <br />
  <table  cellpadding="0"
		width="100%">
  <tr><td align="center">
  <table width="300" align="left" cellpadding="1" cellspacing="0" class="U">
  <tr>

  <td width="20" valign="middle" align="center">
  <img alt="" border="0" src="images/botao_nao.gif" width="14" height="14" />  </td>
  <td class="S" style="padding: 4px 4px;" valign="middle" align="center"><b><span class="stylered"><%=strSuasReservas2%></span></td>
  </tr>
  </table>
  </td></tr>
  </table>
</span>
<br /><br />			
		<% End If ' end Not Reservas.EOF Or NOT Reservas.BOF %></td>
<% If 0 = 1 Then %>
</table>
<% End If %>
	
	<!-- FIM -->
	</td>
	</tr>
  <br /><br />  
  <tr>
	<td><input name="Enviar" type="image" value="Enviar" id="Enviar" src="images/update_<%=strIdioma%>.gif" align="top">
		<br>
	</td>
	<td></td>
  </tr>
  <tr>
	<td> </td>
	<td> </td>
  </tr>
</table>
<p><br></p>
</td>
   <td><img src="images/spacer.gif" width="1" height="25" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="images/spacer.gif" width="1" height="88" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="11" bgcolor="#000000"></td>
   <td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
  </tr>
</table>
</form>
</body>
</html>
<%
Cliente.Close()
Set Cliente = Nothing
%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Não precisava postar esse código todo, a alteração é realizada somente na parte que utiliza CDONTS.

 

Set objCdonts = Server.Createobject("CDONTS.NewMail")
		objCdonts.From = "rio@copacabanaholiday.com.br"
		objCdonts.To = "rio@copacabanaholiday.com.br"
		objCdonts.Subject = "Copacabana Holiday - Atualizacao cadastral de cliente"
		objCdonts.Body = strCorpoHTML
		objCdonts.BodyFormat = 0
		objCdonts.MailFormat = 0
		objCdonts.Send
	Set objCdonts = Nothing
Sobre o CDOSYS faça uma pesquisa aqui no Fórum, existem vários tópicos sobre esse componente.

 

Qualquer dúvida poste aqui.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.