<%
Set lojas = Server.CreateObject("ADODB.Recordset")
lojas.Open "SELECT * FROM lojas where lojavirtual = 0 ORDER BY nome_loja", Conexao
lojas.MoveFirst
While Not lojas.EOF
loja = lojas("codigo_loja")
v = 0
Set Categorias = Server.CreateObject("ADODB.Recordset")
str="SELECT * FROM categorias where codigo_loja = "& lojas("codigo_loja") &" ORDER BY nome_categoria"
Categorias.Open str , Conexao
While Not Categorias.EOF
v = v + 1
Categorias.MoveNext
Wend
Categorias.Close
Set Categorias = Nothing
txt_loja = lojas("nome_loja")
'nn = len(txt_loja) - 3
'txt_loja2 = right(txt_loja,nn)
v=0
if v = 0 then
%>
<%else%>
<%response.write txt_loja%>
<%end if
loja = lojas("codigo_loja")
ccate = 0
Set Categorias = Server.CreateObject("ADODB.Recordset")
str="SELECT * FROM categorias where codigo_loja = "& lojas("codigo_loja") &" ORDER BY nome_categoria"
Categorias.Open str , Conexao
While Not Categorias.EOF
ccate = ccate + 1
if ccate = 1 then
response.write "
"
end if
Set tprodutos = Server.CreateObject("ADODB.Recordset")
tprodutos.Open "SELECT COUNT(*) As totalRegistros FROM subcategorias where codigo_categoria = "& Categorias("codigo_categoria"), Conexao
tprodutos.MoveFirst
While Not tprodutos.EOF
total = tprodutos("totalRegistros")
tprodutos.MoveNext
wend
tprodutos.Close
Set tprodutos = Nothing
if total > 0 then%>
<%= Categorias("nome_categoria") %>
<%else%>
&codigo_loja=<%= loja %>" class="subcategoria"><%= Categorias("nome_categoria") %>
<%end if
'----------------------------------------------
csub = 0
catego = Categorias("codigo_categoria")
Set sCategorias = Server.CreateObject("ADODB.Recordset")
str1 ="SELECT * FROM subcategorias where codigo_categoria="& catego &" ORDER BY nome_subcategoria"
sCategorias.Open str1, Conexao
While Not sCategorias.EOF
csub= csub + 1
if csub=1 then
response.write "
"
end if
'----------------------------------------------
Categorias.MoveNext
Wend
Categorias.Close
Set Categorias = Nothing
if ccate > 0 then
response.write ""
end if
lojas.MoveNext
Wend
lojas.Close
Set lojas = Nothing
%>
<%
Call Valida_Request()
codigo_produto = LimparTexto(Request("codigo_produto"))
Set Produtos = Server.CreateObject("ADODB.Recordset")
Produtos.Open "SELECT * FROM Produtos WHERE produtos.lojavirtual = 0 and produtos.codigo_produto=" & codigo_produto , Conexao
if Produtos.EOF then
Response.write "Produto removido."
'response.redirect("default.asp")
else%>
" itemprop="name"><%= Produtos("nome_produto") %>
<%
IF Produtos("referencia") = "" THEN
COD = Produtos("codigo_produto")
else
COD = Produtos("referencia")
end if
%>
<% if cod<> "" then %>
Referência: <%=COD%>
<%end if%>
<%if Produtos("modelo") <> null then response.write Produtos("modelo") & " "
if Produtos("marca") <> null then
Set tipob = Server.CreateObject("ADODB.Recordset")
StrQuery="select nome from marcas where codigo_marca = " & Produtos("marca")
tipob.Open (StrQuery), conexao
if tipob.EOF then
end if
While Not tipob.EOF
MARCA = TIPOB("NOME")
tipob.Movenext
Wend
tipob.Close
Set tipob = Nothing
%>
" itemprop="brand"><%= MARCA %>
<%
end if
%>
<%IF Produtos("lancamentos") = 1 THEN%>
<%END IF%>
<%if session("lojamobile") = "1981" then
response.write "
"
%>
<%imags_bd = Produtos("url_imagem")
if imags_bd <> "" then
img = Split(imags_bd, ";")
For i=0 to UBound(img)
foto = (img(i))
if i = 0 then
if zoom <> "sim" then
tamanho=5
if session("lojamobile") = "1981" then tamanho=50
'espaco = " "
else
tamanho=90
espaco = ""
end if
else
tamanho=90
espaco = ""
end if%>
<%if Ubound(img) > 0 then response.write espaco
Next
end if
%>
<%end if%>
Detalhes do Produto
<%
completa = Produtos("descricao_completa")
if completa <> "" then
response.write replace(completa,"medium", "")
else
response.write Replace(Produtos("descricao_simples"), Chr(13), " ")
end if
%>
<%
if Produtos("itens_inclusos") <> "" then%>
Itens Inclusos
<%
itens = Replace(Produtos("itens_inclusos"), Chr(13), " ")
itens = Replace(Produtos("itens_inclusos"), ";", "; ")
response.write itens
%>
<%end if
if Produtos("outros") <> "" then%>
Mais Informações
<%=Replace(Produtos("outros"), Chr(13), " ")%>
<%end if%>
<%if session("lojamobile") <> "1981" then%>
<%IF UCASE(RIGHT(Produtos("zoom_imagem"),3)) = "JPG" THEN
produto = Produtos("zoom_imagem")
END IF
if produto <> "" then%>
<%imags_bd = Produtos("url_imagem")
if imags_bd <> "" then
img = Split(imags_bd, ";")
For i=0 to UBound(img)
foto = (img(i))
if i = 0 then
if zoom <> "sim" then
tamanho=410
if session("lojamobile") = "1981" then tamanho=310
'espaco = " "
else
tamanho=90
espaco = ""
end if
else
tamanho=90
espaco = ""
end if%>
<%'if UBound(img) > 0 then%>
" > class="foto"<%end if%>>
<%if Ubound(img) > 0 then response.write espaco
Next
end if
%>
" >
<%
if session("lojamobile") = "1981" then response.write "
"
strv = "Select codigo_produto, nome_produto, preco_unitario, url_imagem, disponivel, lancamentos, frete_gratis, promocao FROM Produtos WHERE lojavirtual = 0 and codigo_produto in (" & juntos &")"
call PRD(strv)
if session("lojamobile") = "1981" then response.write "
"
%>
<%
end if
if Produtos("visitas") <> "" then
visitas = Produtos("visitas") + 1
Conexao.Execute "UPDATE produtos SET visitas = " & visitas & " WHERE codigo_produto = " & Produtos("codigo_produto")
else
visitas =1
Conexao.Execute "UPDATE produtos SET visitas = " & visitas & " WHERE codigo_produto = " & Produtos("codigo_produto")
end if
end if
Produtos.Close
Set Produtos = Nothing
%>