ECatalogo
<%
dim V_Connection
dim V_RUsuario
dim V_RCategorias
dim V_RProductos
dim V_RCompras
dim V_RTemcat
dim V_RTemprod
dim V_RFichas
dim sql
dim sql2
dim contador
dim compra
const max = 15
dim total
Set V_Connection = CreateObject("ADODB.Connection")
Set V_RTemprod = CreateObject("ADODB.Recordset")
Set V_RProductos = CreateObject("ADODB.Recordset")
Set V_RUsuario = CreateObject("ADODB.Recordset")
Set V_RFichas = CreateObject("ADODB.Recordset")
V_Connection.ConnectionString = "DRIVER=SQL Server;SERVER=196.40.23.206;UID=quimifarma;PASSWORD=farmaquimi;APP=Microsoft Development Environment;WSID=MSSQL2000;DATABASE=Quimifarma"
V_Connection.Open
%>
.
<%
if Request.Form("ingresar") <> "" then
sql = "select * from usuarios where usuario = '" + Request.Form("Login") + "' and password ='" + Request.Form("Clave") + "'"
V_RUsuario.Open sql, V_Connection
if V_RUsuario.EOF <> true then
session ("usuario") = V_RUsuario(2)
session ("username") = Request.Form("Login")
V_Connection.Execute ("delete temp_cat where usuario = '" + session("username") + "'")
V_Connection.Execute ("delete temp_prod where usuario = '" + session("username") + "'")
Session ("registro") = 0
Session ("registro2") = 0
Session ("maxreg") = 0
Session ("i")=0
Session ("totalreg")=0
Session("totalreg2")=0
session("maxreg")=0
Session("tempcat")=0
else
Session ("usuario") = 2
end if
V_RUsuario.Close
else
if Request.Form("sinclave" + ".x") <> "" then
Session("usuario") = 2
Session("username") = ""
%>
<%
end if
end if
if Request.Form("Isubmit1") = " Enviar " then
if validar() = true then
sql = "select * from usuarios where usuario = '" + Request.Form("usuario") + "'"
V_RUsuario.Open sql, V_Connection
if V_RUsuario.EOF = true then
V_Connection.Execute ("insert into usuarios (usuario,password,tipo,nombre,empresa,puesto,telefono,fax,correo,fecha_ingreso) values ('" + Request.Form("usuario") + "','" + Request.Form("clave1") + "','" + cstr(0) + "','" + Request.Form("nombre") + "','" + Request.Form("empresa") + "','" + Request.Form("puesto") + "','" + Request.Form("telefono") + "','" + Request.Form("fax") + "','" + Request.Form("correo") + "','" + cstr(date) + "')" )
session ("usuario") = 0
session ("username") = Request.Form("usuario")
V_Connection.Execute ("delete temp_cat where usuario = '" + session("username") + "'")
V_Connection.Execute ("delete temp_prod where usuario = '" + session("username") + "'")
V_RUsuario.close
else
session ("usuario") = 2
%>
El usuario ya existe, seleccione otro.
<%
end if
end if
end if
if Request.Form("sinclave" + ".x") = "" and Request.Form("ingresar") = "" and Request.Form("Isubmit1") = "" and Request.Form("submit3" + ".x") = "" and Request.Form("cotizar") = "" and Request.Form("submit8" ) = "" and Request.Form ("submit3") = "" and Request.Form ("submit4.x") = "" and Request.Form ("submit5.x")= "" and Request.Form ("submit6.x") = "" and Request.Form ("submit7.x") = "" and Request.Form ("submit1.x") = "" and Request.Form ("submit2.x") = "" then
%>
En una forma rápida y accesible, usted podrá encontrar en un solo lugar la mas amplia variedad de
productos del mercado, dirigido a sectores alimenticio, farmacéutico, cosmético, industrial y veterinario, en lo que se refiere a productos de empaque.
El catálogo esta conformado por diferentes secciones dependiendo de sus sectores de interés.
<%
else
if Session ("usuario") = 2 and Request.Form("sinclave" +".x") = "" then
if Request.Form("BSubmit2" + ".x") = "" and Request.Form("ISubmit1") = "" then
%>
El usuario o la contraseña son inválidos, intente de nuevo.
<%
end if
else
if Request.Form("sinclave" +".x") = "" then
Set V_RCategorias = CreateObject("ADODB.Recordset")
Set V_RTemcat = CreateObject("ADODB.Recordset")
sql = "select count(*) from categorias where cod_idioma = 0"
V_RCategorias.Open sql, V_Connection
session("totalreg") = V_RCategorias(0)
V_RCategorias.Close
sql = "select * from categorias where cod_idioma = 0 order by cod_categoria"
V_RCategorias.Open sql, V_Connection
if Request.Form ("submit1.x") <> "" then
Session("registro")= Session("registro") + max
i = 1
while i =< max
if Request.Form("checkbox" + cstr(i)) <> "" then
sql2 = "select cod_categoria from temp_cat where cod_categoria = '" + Request.Form("checkbox" + cstr(i)) + "' and usuario = '" + cstr(session("username")) + "'"
V_RTemcat.Open sql2, V_Connection
if V_RTemcat.EOF = true then
V_Connection.Execute( "insert into temp_cat (usuario,cod_categoria) values ('"+ cstr(session("username"))+ "','" + Request.Form("checkbox" + cstr(i)) +"')")
end if
V_RTemcat.Close
else
V_Connection.Execute( "delete from temp_cat where cod_categoria= '" + cstr(Session ("arreglo("+ cstr(i) + ")"))+ "' and usuario = '" + cstr(session("username")) + "'")
end if
i = i + 1
wend
else
if Request.Form ("submit2.x") <> "" then
if Session("registro") > 0 then
Session("registro")= Session("registro") - max
end if
i = 1
while i =< max
if Request.Form("checkbox" + cstr(i)) <> "" then
sql2 = "select cod_categoria from temp_cat where cod_categoria = '" + (Request.Form("checkbox" + cstr(i))) + "' and usuario = '" + cstr(session("username")) + "'"
V_RTemcat.Open sql2, V_Connection
if V_RTemcat.EOF = true then
V_Connection.Execute( "insert into temp_cat (usuario,cod_categoria) values ('"+ cstr(session("username"))+ "','" + Request.Form("checkbox" + cstr(i)) +"')")
end if
V_RTemcat.Close
else
V_Connection.Execute( "delete from temp_cat where cod_categoria = '" + cstr(Session ("arreglo("+ cstr(i) + ")"))+ "' and usuario = '" + cstr(session("username")) + "'")
end if
i = i + 1
wend
end if
end if
%>
<%
else
if Request.Form("cotizar") = "" then
%>