Skip to content

Instantly share code, notes, and snippets.

/codigo.asp Secret

Created January 22, 2016 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2a98b5285055eaa09555 to your computer and use it in GitHub Desktop.
Save anonymous/2a98b5285055eaa09555 to your computer and use it in GitHub Desktop.
<%
dim html
Dim mypage, numpages, numrecs, pagesize
dim conn
dim letter
Dim count2
Dim dato
Dim NumeroPedido2
Dim pCustomer
Dim pCustomerPo
Dim pOrderID
Dim pProducto
Dim pGramaje
Dim pDiaIni
Dim pMesIni
Dim pAnoIni
Dim pDiaFin
Dim pMesFin
Dim pAnoFin
Dim pEstado
Total_Mostrar = Request.QueryString ("cmb_registros")
if Total_Mostrar=Empty then
Total_Mostrar=10
end if
mypage = 0
'letter = Request("letter")
' Get the page number we need to display from Form or QueryString
if isnumeric(Request("page")) then
mypage = CInt( Request("page"))
end if
If mypage=0 Then mypage=1
' Get the requested number of records per page
if isnumeric(Request("recs")) then
pagesize = CInt( Request("recs") )
end if
If pagesize = 0 Then pagesize = Total_Mostrar ' If we aren't given a value use 10
' The code we need to set up a recordset object for paging
conn = conectar
'conn.ConnectionTimeOut = 0
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.CursorLocation=3 'clientside
rs.CursorType=3 'staticrecordset
rs.PageSize = pagesize
rs.CacheSize = pagesize ' This is optional
'rs.CursorLocation = adUseClient
if Request.QueryString ("consulta")="" then
if Request.QueryString ("cliente") = "" then
pCustomer = Request.QueryString(session("usuario2"))
qStringSql ="EXECUTE dbo.CMPC_CART_V_ORDENES_WEB '"& Request.QueryString("consulta") &"','"& pCustomer &"' "
else
pCustomer = Request.QueryString ("cliente")
qStringSql ="EXECUTE dbo.CMPC_CART_V_ORDENES_WEB '"& Request.QueryString("consulta") &"','"& pCustomer &"' "
end if
else
pCustomer = session("usuario2")
if Request.QueryString ("ORDEN")<>"" then
if ident <> 1 then ident = 1
pCustomerPo = Request.QueryString ("ORDEN")
else
pCustomerPo = ""
end if
if Request.QueryString ("PEDIDO")<>"" then
if ident <> 1 then ident = 1
pOrderID = Request.QueryString ("PEDIDO")
else
pOrderID = ""
end if
if Request.QueryString ("txtProducto")<>"Seleccione" then
if ident <> 1 then ident =1
pProducto = Request.QueryString ("txtProducto")
else
pProducto = ""
end if
if Request.QueryString ("txtGramaje")<>"Seleccione" then
if ident = 1 then ident=1
pGramaje = Request.QueryString ("txtGramaje")
else
pGramaje = ""
end if
if Request.QueryString ("ini_dia") <> "" then
if ident = 1 then ident=1
pDiaIni = Request.QueryString ("ini_dia")
pMesIni = Request.QueryString ("ini_mes")
pAnoIni = Request.QueryString ("ini_ano")
pDiaFin = Request.QueryString ("ter_dia")
pMesFin = Request.QueryString ("ter_mes")
pAnoFin = Request.QueryString ("ter_ano")
end if
' RPARRA; No esta siendo utilizada esta propiedad en el filtro
'if Request.QueryString ("txtCalibre")<>"" and Request.QueryString ("txtCalibre")<>"Seleccione" then
' if ident <> 1 then ident = 1
' qStringSql = qStringSql & " AND CALIBRE ='" & Request.QueryString ("txtCalibre") & "'"
'end if
if (Request.QueryString ("cmb_estado")<>"Seleccione" AND Request.QueryString ("cmb_estado")<>"Select") then
if Request.QueryString ("cmb_estado") = "1" then
if ident = 1 then ident=1
pEstado = Request.QueryString ("cmb_estado") 'qStringSql = qStringSql & " AND kg_despachados/(CASE kg_pedidos WHEN 0 THEN 1 ELSE kg_pedidos END)*100 < 95 AND kg_despachados/(CASE kg_pedidos WHEN 0 THEN 1 ELSE kg_pedidos END)*100 > 5 order by fecha_necesidad desc, nro_pedido asc, item_num asc "
elseif Request.QueryString ("cmb_estado") = "2" then
if ident = 1 then ident=1
pEstado = Request.QueryString ("cmb_estado") 'qStringSql = qStringSql & " AND kg_despachados/(CASE kg_pedidos WHEN 0 THEN 1 ELSE kg_pedidos END)*100 > 95 order by fecha_necesidad desc, nro_pedido asc, item_num asc "
elseif Request.QueryString ("cmb_estado") = "3" then
if ident = 1 then ident=1
pEstado = Request.QueryString ("cmb_estado") 'qStringSql = qStringSql & " AND kg_despachados/(CASE kg_pedidos WHEN 0 THEN 1 ELSE kg_pedidos END)*100 < 5 order by fecha_necesidad desc, nro_pedido asc, item_num asc "
else
pEstado = ""
end if
'else
''if orden ="" then
'qStringSql = qStringSql & " order by fecha_necesidad desc, nro_pedido asc, item_num asc"
''else
'' qStringSql = qStringSql & " order by " & orden & " " & tiporden
''end if
end if
qStringSql ="EXECUTE dbo.CMPC_CART_V_ORDENES_WEB "
qStringSql = qStringSql & "'" & Request.QueryString("consulta") & "',"
qStringSql = qStringSql & "'" & pCustomer & "',"
qStringSql = qStringSql & "'" & pCustomerPo & "',"
qStringSql = qStringSql & "'" & pOrderID & "',"
qStringSql = qStringSql & "'" & pProducto & "',"
qStringSql = qStringSql + "'" & pGramaje & "',"
qStringSql = qStringSql + "'" & pDiaIni & "',"
qStringSql = qStringSql + "'" & pMesIni & "',"
qStringSql = qStringSql + "'" & pAnoIni & "',"
qStringSql = qStringSql + "'" & pDiaFin & "',"
qStringSql = qStringSql + "'" & pMesFin & "',"
qStringSql = qStringSql + "'" & pAnoFin & "',"
qStringSql = qStringSql + "'" & pEstado & "'"
end if
response.write(qStringSql)
'revisar linea de abajo
rs.open qStringSql,conServerSQL,3,3
if err.number <> 0 then
rs.Close
set rs = Nothing
conServerSQL.close
end if
if not rs.EOF then
' Get the number of pages and records
numpages = rs.PageCount
numrecs = rs.RecordCount
If mypage > numpages Then mypage = numpages
If mypage < 1 Then mypage = 1
' Set the page we want to display
rs.AbsolutePage = mypage
if session("idioma")= "espanol" then%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment