Problemas na busca por CEP
Estou com problemas em minha loja na hora de buscar o endereço pelo CEP Alguns Ceps ele busca normalmente o endereço, outros ele não busca. O que pode ser??.
Segue o código da minha página:
<!-- #include file="conf_funcoes.asp" -->
<!-- #include file="gerafrete.asp" -->
<%
SELECT CASE request("acao")
'**********************************************************************************
'FUNÇÃO PARA CALCULAR O FRETE
'**********************************************************************************
CASE "calcular_frete"
Response.Charset="ISO-8859-1"
session("cep_entrega") = pform("cep")
Cn_cep
sql = "SELECT * FROM enderecos WHERE cep='"&session("cep_entrega")&"'"
set vr = cnx.execute(sql)
if vr.bof or vr.eof then
'ARQUIVO RESPONSÁVEL POR PEGAR O ENDEREÇO DO CEP DIGITADO
caminho="http://www.bronzebusiness.com.br/webservices/wscep.asmx/cep?strcep="&session("cep_entrega")&""
Set xml = Server.CreateObject("msxml2.DOMDocument.3.0")
xml.async = false
xml.setProperty "ServerHTTPRequest", true
xml.validateOnParse =false
xml.preserveWhiteSpace = false
folha = xml.Load(caminho)
If Not folha Then
endereco = "invalido"
bairro = "invalido"
cidade = "invalido"
estado = "invalido"
Else
Set logradouro = xml.getElementsByTagName("logradouro")
Set nome = xml.getElementsByTagName("nome")
Set bairro = xml.getElementsByTagName("bairro")
Set uf = xml.getElementsByTagName("UF")
Set cidade = xml.getElementsByTagName("cidade")
if logradouro.length > 0 then
endereco = logradouro.item(0).text & " " & nome.item(0).text
bairro = bairro.item(0).text
cidade = cidade.item(0).text
estado = uf.item(0).text
set gravar = cnx.execute("INSERT INTO enderecos (logradouro, cep, nome, bairro, cidade, uf) values ('"&logradouro.item(0).text&"', '"&session("cep_entrega")&"', '"&nome.item(0).text&"', '"&bairro&"', '"&cidade&"', '"&estado&"')")
else
endereco = "invalido"
bairro = "invalido"
cidade = "invalido"
estado = "invalido"
end if
end if
'aqui é da funçao
else
endereco = vr("logradouro") & " " & vr("nome")
bairro = vr("bairro")
cidade = vr("cidade")
estado = vr("uf")
end if
Des_cep
''pega todos os produtos comprados e calcula o peso
Conectar
set rs = conexao.execute("SELECT * FROM cesta WHERE compra='"&session("id_compra")&"'")
kg = 0
valor = 0
kgtranp = 0
while not rs.eof
set pd = conexao.execute("SELECT * FROM produtos WHERE id='"&rs("produto")&"'")
alt = pd("altura")
larg = pd("largura")
comp = pd("comprimento")
alt = formatnumber(alt,2)
larg = formatnumber(larg ,2)
comp = formatnumber(comp,2)
kgtranp = (alt larg comp) 200 rs("quantidade")
kgpac = (alt larg comp) / 4800
'response.write kgpac
frete = pd("frete_gratis")
If ((frete = "s" and estado = "MG") or (frete = "s" and estado = "SP") or (frete = "s" and estado = "RJ") or (frete = "s" and estado = "ES")or(frete = "s" and estado = "SC") or (frete = "s" and estado = "PR") or (frete = "s" and estado = "RS"))then
kg = kg + (0 * rs("quantidade"))
totkgtranp = totkgtranp + kgtranp
kgpac = kgpac +(0*rs("quantidade"))
else
kg = kg + (pd("peso") * rs("quantidade"))
totkgtranp = totkgtranp + kgtranp
kgpac = (kgpac*rs("quantidade"))
valor = valor + (pd("preco") * rs("quantidade"))
end if
rs.movenext
wend
Desconectar
if kgpac < kg then
kgpac = kg
end if
if kgtranp < kg then
kgtranp = kg
end if
'prepara os ítens para cálculo
um = formatnumber(kg,3)
peso = replace(um, ",", ".")
session("peso") = peso
tiracasasdecimais = formatnumber(totkgtranp,0)
pesosemponto = replace(tiracasasdecimais, ",", "")
pesosemponto = replace(tiracasasdecimais, ".", "")
pesopag = formatnumber(kgpac,0)
pesosempontopac = replace(pesopag, ",", "")
cep_origem = dados("cep", "config_frete", "")
cep_destino = session("cep_entrega")
valor_declarado = replace(formatnumber(valor,2), ".", "")
'formas de entrega a ser calculadas
sedex_normal = dados("sedex", "config_frete", "")
sedex_acrescimo = dados("sedex_acrescimo", "config_frete", "")
sedex_seguro = dados("sedex_seguro", "config_frete", "")
sedex_10 = dados("sedex_10", "config_frete", "")
dez_acrescimo = dados("sedex_10_acrescimo", "config_frete", "")
dez_seguro = dados("sedex_10_seguro", "config_frete", "")
sedex_cobrar = dados("sedex_cobrar", "config_frete", "")
cobrar_acrescimo = dados("sedex_cobrar_acrescimo", "config_frete", "")
cobrar_seguro = dados("sedex_cobrar_seguro", "config_frete", "")
encomenda_normal = dados("encomenda_normal", "config_frete", "")
en_acrescimo = dados("en_acrescimo", "config_frete", "")
transportadora = dados("transportadora", "config_frete", "")
entrega_local = dados("entrega_local", "config_frete", "")
descricao_local = dados("descricao_entregalocal", "config_frete", "")
regiao_local = dados("regiao_entregalocal", "config_frete", "")
valor_local = dados("valor_entregalocal", "config_frete", "")
area_entregalocal = dados("area_entregalocal", "config_frete", "")
carta_registrada = dados("carta_registrada", "config_frete", "")
peso_cartaregistrada = dados("peso_cartaregistrada", "config_frete", "")
valor_cartaregistrada = dados("valor_cartaregistrada", "config_frete", "")
'identifica estado do cep de destino
If cep_destino >= 69900000 And cep_destino <= 69999999 Then
If cep_destino >= 69900000 And cep_destino <= 69920999 Then
session("estado_destino") = "Acre - Capital"
estado = "AC"
else
session("estado_destino") = "Acre - Interior"
estado = "AC"
end if
ElseIf cep_destino >= 57000000 And cep_destino <= 57999999 Then
If cep_destino >= 57000000 And cep_destino <= 57099999 Then
session("estado_destino") = "Alagoas - Capital"
estado = "AL"
else
session("estado_destino") = "Alagoas - Interior"
estado = "AL"
end if
ElseIf cep_destino >= 68900000 And cep_destino <= 68999999 Then
If cep_destino >= 68900000 And cep_destino <= 68909999 OR cep_destino >= 68925000 And cep_destino <= 68929999 Then
session("estado_destino") = "Amapá - Capital"
estado = "AP"
else
session("estado_destino") = "Amapá - Interior"
estado = "AP"
end if
ElseIf cep_destino >= 69000000 And cep_destino <= 69899999 Then
If cep_destino >= 69000000 And cep_destino <= 69099999 Then
session("estado_destino") = "Amazonas - Capital"
estado = "AM"
else
session("estado_destino") = "Amazonas - Interior"
estado = "AM"
end if
ElseIf cep_destino >= 40000000 And cep_destino <= 48999999 Then
If cep_destino >= 40000000 And cep_destino <= 43849999 OR cep_destino >= 44450000 And cep_destino <= 44470999 Then
session("estado_destino") = "Bahia - Capital"
estado = "BA"
else
session("estado_destino") = "Bahia - Interior"
estado = "BA"
end if
ElseIf cep_destino >= 60000000 And cep_destino <= 63999999 Then
If cep_destino >= 60000000 And cep_destino <= 61699999 OR cep_destino >= 61900000 And cep_destino <= 61939999 Then
session("estado_destino") = "Ceará - Capital"
estado = "CE"
else
session("estado_destino") = "Ceará - Interior"
estado = "CE"
end if
ElseIf cep_destino >= 70000000 And cep_destino <= 72799999 Then
If cep_destino >= 70000000 And cep_destino <= 72799999 OR cep_destino >= 73000999 And cep_destino <= 73699999 Then
session("estado_destino") = "Distrito Federal - Capital"
estado = "DF"
else
session("estado_destino") = "Distrito Federal - Interior"
estado = "DF"
end if
ElseIf cep_destino >= 29000000 And cep_destino <= 29999999 Then
If cep_destino >= 29000000 And cep_destino <= 29184999 Then
session("estado_destino") = "Espirito Santo - Capital"
estado = "ES"
else
session("estado_destino") = "Espirito Santo - Interior"
estado = "ES"
end if
ElseIf cep_destino >= 72800000 And cep_destino <= 76999999 Then
If cep_destino >= 74000000 And cep_destino <= 74999999 OR cep_destino >= 75250000 And cep_destino <= 75259999 Then
session("estado_destino") = "Goiás - Capital"
estado = "GO"
else
session("estado_destino") = "Góiás - Interior"
estado = "GO"
end if
ElseIf cep_destino >= 65000000 And cep_destino <= 65999999 Then
If cep_destino >= 65000000 And cep_destino <= 65099999 Then
session("estado_destino") = "Maranhão - Capital"
estado = "MA"
else
session("estado_destino") = "Maranhão - Interior"
estado = "MA"
end if
ElseIf cep_destino >= 78000000 And cep_destino <= 78899999 Then
If cep_destino >= 78000000 And cep_destino <= 78169999 Then
session("estado_destino") = "Mato Grosso - Capital"
estado = "MT"
else
session("estado_destino") = "Mato Grosso - Interior"
estado = "MT"
end if
ElseIf cep_destino >= 79000000 And cep_destino <= 79999999 Then
If cep_destino >= 79000000 And cep_destino <= 79124999 Then
session("estado_destino") = "Mato Grosso do Sul - Capital"
estado = "MS"
else
session("estado_destino") = "Mato Grosso do Sul - Interior"
estado = "MS"
end if
ElseIf cep_destino >= 30000000 And cep_destino <= 39999999 Then
If cep_destino >= 30000000 And cep_destino <= 34999999 Then
session("estado_destino") = "Minas Gerais - Capital"
estado = "MG"
else
session("estado_destino") = "Minas Gerais - Interior"
estado = "MG"
end if
ElseIf cep_destino >= 66000000 And cep_destino <= 68899999 Then
If cep_destino >= 66000000 And cep_destino <= 67999999 Then
session("estado_destino") = "Pará - Capital"
estado = "PA"
else
session("estado_destino") = "Pará - Interior"
estado = "PA"
end if
ElseIf cep_destino >= 58000000 And cep_destino <= 58999999 Then
If cep_destino >= 58000000 And cep_destino <= 58099999 Then
session("estado_destino") = "Paraiba - Capital"
estado = "PB"
else
session("estado_destino") = "Paraiba - Interior"
estado = "PB"
end if
ElseIf cep_destino >= 80000000 And cep_destino <= 87999999 Then
If cep_destino >= 80000000 And cep_destino <= 83189999 OR cep_destino >= 83300000 And cep_destino <= 83349999 OR cep_destino >= 83400000 And cep_destino <= 83749999 OR cep_destino >= 83800000 And cep_destino <= 83939999 Then
session("estado_destino") = "Paraná - Capital"
estado = "PR"
else
session("estado_destino") = "Paraná - Interior"
estado = "PR"
end if
ElseIf cep_destino >= 50000000 And cep_destino <= 56999999 Then
If cep_destino >= 50000000 And cep_destino <= 53989999 OR cep_destino >= 54000000 And cep_destino <= 54799999 Then
session("estado_destino") = "Pernambuco - Capital"
estado = "PE"
else
session("estado_destino") = "Pernambuco - Interior"
estado = "PE"
end if
ElseIf cep_destino >= 64000000 And cep_destino <= 64999999 Then
If cep_destino >= 64000000 And cep_destino <= 64999999 Then
session("estado_destino") = "Piauí - Capital"
estado = "PI"
else
session("estado_destino") = "Piauí - Interior"
estado = "PI"
end if
ElseIf cep_destino >= 20000000 And cep_destino <= 28999999 Then
If cep_destino >= 20000000 And cep_destino <= 23799999 OR cep_destino >= 24000000 And cep_destino <= 24799999 Then
session("estado_destino") = "Rio de Janeiro - Capital"
estado = "RJ"
else
session("estado_destino") = "Rio de Janeiro - Interior"
estado = "RJ"
end if
ElseIf cep_destino >= 59000000 And cep_destino <= 59999999 Then
If cep_destino >= 59000000 And cep_destino <= 59149999 Then
session("estado_destino") = "Rio Grande do Norte - Capital"
estado = "RN"
else
session("estado_destino") = "Rio Grande do Norte - Interior"
estado = "RN"
end if
ElseIf cep_destino >= 90000000 And cep_destino <= 99999999 Then
If cep_destino >= 90000000 And cep_destino <= 91999999 Then
session("estado_destino") = "Rio Grande do Sul - Capital"
estado = "RS"
else
session("estado_destino") = "Rio Grande do Sul - Interior"
estado = "RS"
end if
ElseIf cep_destino >= 78900000 And cep_destino <= 78999999 Then
If cep_destino >= 78900000 And cep_destino <= 78924999 Then
session("estado_destino") = "Rondônia - Capital"
estado = "RO"
else
session("estado_destino") = "Rondônia - Interior"
estado = "RO"
end if
ElseIf cep_destino >= 69300000 And cep_destino <= 69399999 Then
If cep_destino >= 69300000 And cep_destino <= 69339999 Then
session("estado_destino") = "Roraima - Capital"
estado = "RR"
else
session("estado_destino") = "Roraima - Interior"
estado = "RR"
end if
ElseIf cep_destino >= 77000000 And cep_destino <= 77999999 Then
If cep_destino >= 77000000 And cep_destino <= 77299999 Then
session("estado_destino") = "Tocantins - Capital"
estado = "TO"
else
session("estado_destino") = "Tocantins - Interior"
estado = "TO"
end if
ElseIf cep_destino >= 88000000 And cep_destino <= 89999999 Then
If cep_destino >= 88000000 And cep_destino <= 88149999 OR cep_destino >= 88160000 And cep_destino <= 888179999 Then
session("estado_destino") = "Santa Catarina - Capital"
estado = "SC"
else
session("estado_destino") = "Santa Catarina - Interior"
estado = "SC"
end if
ElseIf cep_destino >= 01000000 And cep_destino <= 19999999 Then
If cep_destino >= 01000000 And cep_destino <= 09999999 Then
session("estado_destino") = "São Paulo - Capital"
estado = "SP"
else
session("estado_destino") = "São Paulo - Interior"
estado = "SP"
end if
ElseIf cep_destino >= 49000000 And cep_destino <= 49999999 Then
If cep_destino >= 49000000 And cep_destino <= 49099999 Then
session("estado_destino") = "Sergipe - Capital"
estado = "SE"
else
session("estado_destino") = "Sergipe - Interior"
estado = "SE"
end if
End If
'ARQUIVO RESPONSÁVEL Frete da BRASPRESS
'valorproduto = "&ValorDeclarado="&valor_declarado&""
valorproduto = replace(valor_declarado, ",", ".")
CNPJ="05832184000170"
EMPORIGEM="2"
CEPORIGEM="35500016"
CEPDESTINO=session("cep_entrega")
CNPJREM="05832184000170"
CNPJDES="05832184000170"
TIPOFRETE="1"
PESOPROD= pesosemponto
VALORNF=valorproduto
VOLUME="1"
'caminho = "http://tracking.braspress.com.br/trk/trkisapi.dll/PgCalcFrete_XML?param="&cnpj&","&emporigem&","&ceporigem&","&cepdestino&","&cnpjrem&","&cnpjdes&","&tipofrete&","&pesoprod&","&valornf&","&volume&""
'response.write caminho
'response.end
Set xml = Server.CreateObject("msxml2.DOMDocument.3.0")
xml.async = false
xml.setProperty "ServerHTTPRequest", true
xml.validateOnParse =false
xml.preserveWhiteSpace = false
Press = xml.Load(caminho)
Set TOTALFRETE = xml.getElementsByTagName("TOTALFRETE")
braspress = TOTALFRETE.item(0).text
'response.write braspress
'response.end
braspress = FormatNumber(braspress,2)
session("tr") = braspress
txcodigo = "9042687"
txsenha = "05832187"
'Entrega Local
if entrega_local = "s" then
if session("estado_destino") = area_entregalocal then
session("motoboy") = True
else
session("motoboy") = False
end if
end if
id = 0
CepDestino = cep_destino
CepOrigem = cep_origem
Peso = peso
Peso = Replace(Peso, ",", ".")
'If ServicoCodigo = "" Then
'ServicoCodigo = 40010'41106'
ServicoCodigo = 41106'
'End If
If ServicoCodigo2 = "" Then
ServicoCodigo2 = 41106
End If
If MaoPropria = "" Then
MaoPropria = "N"
End If
ValorDeclarado = valor_declarado
If AvisoRecebimento = "" Then
AvisoRecebimento = "N"
End If
comprimento = 50
largura = 50
altura = 0.5 * kgpac
If altura < 2.0 then
altura = 3
End If
altura = replace(altura,",",".")
diametro = 0
dim oXmlHttp, oXmlDom
dim sReturn, sPacoteSoap
dim nCodigoRet, sDescricaoRet
set oXmlHttp = server.CreateObject("Microsoft.XMLHTTP")
const sSoapServer = "http://ws.correios.com.br/calculador/CalcPrecoPrazo.asmx"
sPacoteSoap = GerarPacoteSoap("","","40010",cepOrigem,cepDestino,Peso,"1",comprimento,altura,largura,diametro,MaoPropria,"0",AvisoRecebimento)
oXmlHttp.open "POST", sSoapServer, false
oXmlHttp.setRequestHeader "SOAPAction", "http://tempuri.org/CalcPrecoPrazo"
oXmlHttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
oXmlHttp.send(sPacoteSoap)
sReturn = oXmlHttp.responseText
'parse xml
Set oXmlDom = Server.CreateObject("Microsoft.XMLDOM")
oXmlDom.loadXML sReturn
set oXmlDom = oXmlDom.selectSingleNode("soap:Envelope/soap:Body/CalcPrecoPrazoResponse/CalcPrecoPrazoResult")
dim oNodes, oNode
'Seleciona os fretes no XML
Set oNodes = oXmlDom.selectNodes("Servicos/cServico")
'Mostra todos os fretes disponíveis
for each oNode in oNodes
'Response.Write "Código " & oNode.selectSingleNode("Codigo").Text & "<br>"
'Response.Write "Valor " & oNode.selectSingleNode("Valor").Text & "<br>"
'Response.Write "Prazo de entrega " & oNode.selectSingleNode("PrazoEntrega").Text & "<br>"
'Response.Write "Valor mão Própria " & oNode.selectSingleNode("ValorMaoPropria").Text & "<br>"
'Response.Write "Valor aviso de recebimento " & oNode.selectSingleNode("ValorAvisoRecebimento").Text & "<br>"
'Response.Write "Valor declarado " & oNode.selectSingleNode("ValorValorDeclarado").Text & "<br>"
'Response.Write "Entrega domiciliar " & oNode.selectSingleNode("EntregaDomiciliar").Text & "<br>"
'Response.Write "Entrega sábado " & oNode.selectSingleNode("EntregaSabado").Text & "<br>"
'Response.Write "Erro " & oNode.selectSingleNode("Erro").Text & "<br>"session("sn") = oNode.selectSingleNode("Valor").Text
next
'response.end
Set oXmlDom = Nothing
'###### PARA O PAC
dim oXmlHttp2, oXmlDom2
dim sReturn2, sPacoteSoap2
dim nCodigoRet2, sDescricaoRet2
set oXmlHttp2 = server.CreateObject("Microsoft.XMLHTTP")
const sSoapServer2 = "http://ws.correios.com.br/calculador/CalcPrecoPrazo.asmx"
sPacoteSoap2 = GerarPacoteSoap("","","41106",cepOrigem,cepDestino,Peso,"1",comprimento,altura,largura,diametro,MaoPropria,"0",AvisoRecebimento)
oXmlHttp2.open "POST", sSoapServer2, false
oXmlHttp2.setRequestHeader "SOAPAction", "http://tempuri.org/CalcPrecoPrazo"
oXmlHttp2.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
oXmlHttp2.send(sPacoteSoap2)
sReturn2 = oXmlHttp2.responseText
'parse xml
Set oXmlDom2 = Server.CreateObject("Microsoft.XMLDOM")
oXmlDom2.loadXML sReturn2
set oXmlDom2 = oXmlDom2.selectSingleNode("soap:Envelope/soap:Body/CalcPrecoPrazoResponse/CalcPrecoPrazoResult")
dim oNodes2, oNode2
'Seleciona os fretes no XML
Set oNodes2 = oXmlDom2.selectNodes("Servicos/cServico")
'Mostra todos os fretes disponíveis
for each oNode2 in oNodes2
'Response.Write "Código " & oNode2.selectSingleNode("Codigo").Text & "<br>"
'Response.Write "Valor " & oNode2.selectSingleNode("Valor").Text & "<br>"
'Response.Write "Prazo de entrega " & oNode2.selectSingleNode("PrazoEntrega").Text & "<br>"
'Response.Write "Valor mão Própria " & oNode2.selectSingleNode("ValorMaoPropria").Text & "<br>"
'Response.Write "Valor aviso de recebimento " & oNode2.selectSingleNode("ValorAvisoRecebimento").Text & "<br>"
'Response.Write "Valor declarado " & oNode2.selectSingleNode("ValorValorDeclarado").Text & "<br>"
'Response.Write "Entrega domiciliar " & oNode2.selectSingleNode("EntregaDomiciliar").Text & "<br>"
'Response.Write "Entrega sábado " & oNode2.selectSingleNode("EntregaSabado").Text & "<br>"
'Response.Write "Erro " & oNode2.selectSingleNode("Erro").Text & "<br>"session("en") = oNode2.selectSingleNode("Valor").Text
'response.write (valor_declarado * 0.01)
'session("en") = session("en") + (valor_declarado * 0.01)
'response.write session("en")
next
' response.write altura
'response.end
Set oXmlDom2 = Nothing
'session("alt") = session("alt") + alt
'session("larg") = session("larg") + larg
'session("comp") = session("comp") + comp
'if alt > "0,60" or larg > "0,60" or comp > "0,60" then
'session("en") = 0
'session("sn") = 0
'session("sd") = 0
'session("sc") = 0
'end if
'response.write frete
'response.write estado
If ((frete = "s" and estado = "MG") or (frete = "s" and estado = "SP") or (frete = "s" and estado = "RJ") or (frete = "s" and estado = "ES") or (frete = "s" and estado = "SC") or (frete = "s" and estado = "PR") or (frete = "s" and estado = "RS") or (frete = "s" and estado = "AL") OR(frete = "s" and estado = "BA") OR (frete = "s" and estado = "CE") OR (frete = "s" and estado = "DF") OR (frete = "s" and estado = "GO") OR (frete = "s" and estado = "MA") OR (frete = "s" and estado = "MS") OR (frete = "s" and estado = "MT") OR (frete = "s" and estado = "PB") OR (frete = "s" and estado = "PE") OR (frete = "s" and estado = "PI") OR (frete = "s" and estado = "RN") OR (frete = "s" and estado = "SE") OR (frete = "s" and estado = "TO"))then
peso = 0
session("en") = 0
session("sn") = 0
end if
response.write session("estado_destino")%>
### <form action="oct_atu_compra.asp" method="post" name="seguir" id="seguir"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr>
<td height="30" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" align="left"><span style="font-weight:bold">Endereço para Entrega: </span>Por favor, informe o endereço para Entrega. </td>
</tr>
<tr>
<td height="1" align="left" bgcolor="#CCCCCC"></td>
</tr>
<tr>
<td height="25" align="left" bgcolor="#FBFBFB" ><table width="100%" border="0" cellpadding="5" style="line-height:25px">
<tr>
<td><table width="100%" border="0">
<tr>
<td width="68" height="25" align="right"><strong>Endereço:</strong></td>
<td width="1283"><%if endereco<>"invalido" then
response.write endereco
end if%><input name="endereco" <% if endereco = "invalido" then%>type="text" size="50"<%else%>type="hidden" value="<%=endereco%>"<%end if%> id="endereco"/></td>
</tr>
<tr>
<td height="25" align="right"><strong>Número:</strong></td>
<td><input name="numero" type="text" id="numero" size="4" /></td>
</tr>
<tr>
<td height="25" align="right"><strong>Compl.:</strong></td>
<td><input name="complemento" type="text" id="complemento" /></td>
</tr>
<tr>
<td height="25" align="right"><strong>Cep:</strong></td>
<td><%=session("cep_entrega")%></td>
</tr>
<tr>
<td height="25" align="right"><strong>Bairro:</strong></td>
<td><%if bairro<>"invalido" then
response.write bairro
end if%><input name="bairro" <% if bairro = "invalido" then%>type="text" size="50" <%else%>type="hidden" value="<%=bairro%>" <%end if%> id="bairro"/></td>
</tr>
<tr>
<td height="25" align="right"><strong>Cidade:</strong></td>
<td><%if cidade<>"invalido" then
response.write cidade
end if%><input name="cidade" <% if cidade = "invalido" then%>type="text" size="50"<%else%>type="hidden" value="<%=cidade%>"<%end if%> id="cidade"/></td>
</tr>
<tr>
<td height="25" align="right"><strong>Estado:</strong></td>
<td><%if estado<>"invalido" then
response.write estado
end if%><input name="estado" <% if estado = "invalido" then%>type="text" size="50"<%else%>type="hidden" value="<%=estado%>"<%end if%> id="estado"/></td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
<p><span style="font-weight:bold">Forma de Entrega: </span></p></td>
</tr>
<tr>
<td height="1" align="left" bgcolor="#CCCCCC"></td>
</tr>
<%if session("sn") <> 0 and sedex_normal="s" and session("sotransportadora") <> "Sim" then
id = id + 1 %>
<tr>
<td bgcolor="#FBFBFB"><table width="100%" border="0" cellpadding="5">
<tr><td height="44" ><input style="border:none" name="frete" id="f<%=id%>" type="radio" value="sn" onClick="totalcompra('<%=FormatNumber(session("sn"),2)%>');" >
<strong>Sedex - R$ <%=FormatNumber(session("sn"),2)%><br>
</strong> Prazo: Capital de todo Brasil: 02 a 03 dias. Interior de Todo Brasil: 03 a 04 dias.</td>
</tr>
<%end if%>
<%if session("sd") <> 0 and sedex_10="s" and session("sotransportadora") <> "Sim" then
id = id + 1 %>
<tr>
<td height="44" ><input style="border:none" name="frete" id="f<%=id%>" type="radio" value="sd" onClick="totalcompra('<%=FormatNumber(session("sd"),2)%>');" >
<strong>Sedex 10 - R$ <%=FormatNumber(session("sd"),2)%><br>
</strong> <span class="verdana size10">Prazo: Até as 10 horas do dia seguinte para pedidos efetuados até às 13:00 hs. </span></td>
</tr>
<%end if%>
<%if session("sc") <> 0 and sedex_cobrar="s" and session("sotransportadora") <> "Sim" then
id = id + 1 %>
<tr>
<td height="44" ><input style="border:none" name="frete" id="f<%=id%>" type="radio" value="sc" onClick="totalcompra('<%=FormatNumber(session("sc"),2)%>');" >
<strong>Sedex à cobrar - R$ <%=FormatNumber(session("sc"),2)%><br>
</strong> <span class="verdana size10">Prazo: Capital de todo Brasil: 02 a 03 dias. Interior de Todo Brasil: 03 a 04 dias.</span></td>
</tr>
<%end if%>
<%if encomenda_normal = "s" and session("en") <> 0 and session("en") <> "" and session("sotransportadora") <> "Sim" then
id = id + 1 %>
<tr>
<td height="44" ><input style="border:none" name="frete" id="f<%=id%>" type="radio" value="en" onClick="totalcompra('<%=FormatNumber(session("en"),2)%>');">
<strong>Encomenda Normal - R$ <%=FormatNumber(session("en"),2)%></strong><br>
Prazo: Capital de todo Brasil: 05 a 07 dias. Interior de Todo Brasil: 07 a 15 dias.</td>
</tr>
<%end if%>
<%If ((frete = "s" and estado = "MG") or (frete = "s" and estado = "SP") or (frete = "s" and estado = "RJ") or (frete = "s" and estado = "ES") or (frete = "s" and estado = "SC") or (frete = "s" and estado = "PR") or (frete = "s" and estado = "RS") or (frete = "s" and estado = "AL") OR(frete = "s" and estado = "BA") OR (frete = "s" and estado = "CE") OR (frete = "s" and estado = "DF") OR (frete = "s" and estado = "GO") OR (frete = "s" and estado = "MA") OR (frete = "s" and estado = "MS") OR (frete = "s" and estado = "MT") OR (frete = "s" and estado = "PB") OR (frete = "s" and estado = "PE") OR (frete = "s" and estado = "PI") OR (frete = "s" and estado = "RN") OR (frete = "s" and estado = "SE") OR (frete = "s" and estado = "TO"))then
id = id + 1 %>
<tr>
<td height="44" ><input style="border:none" name="frete" id="f<%=id%>" type="radio" value="el" onclick="totalcompra('');" />
<strong><%=descricao_local%> <%=regiao_local%></strong><br>
<%
end if
if carta_registrada = "s" and session("sotransportadora") <> "Sim" and replace(formatnumber(peso_cartaregistrada,3), ",", ".") => session("peso") then
id = id + 1 %>
<tr>
<td height="44" ><input style="border:none" name="frete" id="f<%=id%>" type="radio" value="cr" onClick="totalcompra('<%=FormatNumber(valor_cartaregistrada,2)%>');" >
<strong>Carta Registrada - R$ <%=FormatNumber(valor_cartaregistrada,2)%></strong><br>
Prazo: Prazo: Capital de todo Brasil: 03 a 07 dias. Interior de Todo Brasil: 05 a 15 dias.</td></tr><%end if
if transportadora = "s" or peso > "30.000" then
id = id + 1 %>
<tr>
<% if peso > 0 then %>
<td height="44" >
<p align="left">
<%if braspress <> 0 then %> <%=braspress%> <%end if%></strong><br> <% if braspress = 0 then %> <%end if%>
</td>
</tr>
<%end if%>
<%end if%>
</table></td>
</tr>
</form>
</table>
<%
END SELECT%>
Discussão (5)
Carregando comentários...