% %> <% 'Chama dados do formulario strEmail = request.form("email") strEmaila = request.form("emailantigo") strNome = request.form("nomecompleto") strNascdia = request.form("nascdia") strNascmes = request.form("nascmes") strNascano = request.form("nascano") strCpf = request.form("cpf") strRg = request.form("rg") strEndereco = request.form("endereco") strBairro = request.form("bairro") strCidade = request.form("cidade") strEstado = request.form("estado") strOutropais = request.form("outropais") strCep = request.form("cepzz") strPais = request.form("pais") strFone = request.form("fone") strContato = request.form("contato") 'Tira letras do campo CPF/CNPJ strCpf = SoNumeros(strCPF) 'Tira letras do campo CEP strCep = SoNumeros(strCep) strFone = SoNumeros(strFone) 'Tira letras do campo RG/Inscricao if Ucase(strRG)<>"ISENTO" then strRg = SoNumeros(strRg) End if if strOutropais = "Sim" then strEstado = "-" strCep = "-" end if 'Faz validação do CPF e CNPJ bValido = ValidaCPF_CNPJ(strCPF,len(strCPF)) 'Verifica se o formulario está preenchido if strNome = "" OR strNascdia = "" OR strNascano = "" OR strNascmes = "" OR strRg = "" OR strEndereco = "" OR strBairro = "" OR strCidade = "" OR strCep = "" OR strFone = "" OR strCpf = "" OR bValido = "falso" then 'Valida e retorna o CPF para loja processar ElCpf = request.form("cpf") if bValido = "falso" then strCpf = ElCpf end if ElCPF = SoNumeros(ElCPF) if ElCpf = "" then erro4 = " - " & strLg141 & "" end if bValido = ValidaCPF_CNPJ(ElCPF,len(ElCPF)) if bValido="falso" then erro4 = " - " & strLg143 & "" end if 'Verifica se a pessoa escolheu ou não outro pais if strOutropais = "Sim" then strEstado = "-" strCep = "-" else if strCep = "" then erro9 = "- " & strLg141 & "" else if isnumeric(strCep) = false then erro9 = "- " & strLg144 & "" else erro9 = "" end if end if end if 'Verifica se o email já existe na base de dados Set dados = abredb.Execute("SELECT * FROM clientes WHERE email='"&Cripto(strEmail,true)&"';") if dados.EOF then strEmail = strEmail else if strEmail = strEmaila then strEmail = strEmail else strEmail = "sim@." end if end if dados.close set dados = nothing 'Verifica o telefone if strFone = "" then erro10 = "- " & strLg141 & "" else if isnumeric(strFone) = false then erro10 = "- " & strLg144 & "" else erro10 = "" end if end if 'Verifica o estado if strEstado = "" then strEstado = "-" end if 'Verifica o endereco if strCidade = "" then erro8 = "- " & strLg141 & "" else erro8 = "" end if if strBairro = "" then erro7 = "- " & strLg141 & "" else erro7 = "" end if if strEndereco = "" then erro6 = "- " & strLg141 & "" else erro6 = "" end if 'Verifica o RG if strRg = "" then erro5 = "- " & strLg141 & "" else if isnumeric(strRG) = false then erro5 = "- " & strLg144 & "" else erro5 = "" end if end if 'Verifica os dados pessoais if strNascdia = "" OR strNascmes = "" OR strNascano = "" then erro3 = "- " & strLg141 & "" else if strNascano < "1890" OR strNascano > "2002" then erro3 = "- " & strLg144 & "" else erro3 = "" end if end if if strEmail = "" OR instr(strEmail, "@") = 0 Or instr(strEmail, ".") = 0 then erro = "- " & strLg144 & "" end if if strEmail = "sim@." then erro = "- " & strLg145 & "" strEmail = "" end if if strNome = "" then erro2 = "- " & strLg141 & "" else erro2 = "" end if%>
|
|