Ver Mensaje Individual
  #5 (permalink)  
Antiguo 04/06/2004, 11:09
fercom
 
Fecha de Ingreso: septiembre-2003
Ubicación: Lima Peru
Mensajes: 70
Antigüedad: 21 años, 7 meses
Puntos: 0
esta es la pagina
Código HTML:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> 
<!--#include file="../Connections/ConCapacitacion.asp" -->
<%
Dim Registro_Notas__MMColParam
Registro_Notas__MMColParam = "0"
If (Request.QueryString("Id") <> "") Then 
  Registro_Notas__MMColParam = Request.QueryString("Id")
End If
%>
<%
Dim Registro_Notas
Dim Registro_Notas_numRows

Set Registro_Notas = Server.CreateObject("ADODB.Recordset")
Registro_Notas.ActiveConnection = MM_ConCapacitacion_STRING
Registro_Notas.Source = "SELECT *  FROM dbo.RegistroNotas  WHERE Id_Empleado = '" + Replace(Registro_Notas__MMColParam, "'", "''") + "'  ORDER BY Substring(Fecha,7,4) Desc, Substring(Fecha,4,2) Desc,Substring(Fecha,1,2) Desc"
Registro_Notas.CursorType = 0
Registro_Notas.CursorLocation = 2
Registro_Notas.LockType = 1
Registro_Notas.Open()

Registro_Notas_numRows = 0
%>
<%
Dim Empleados__MMColParam
Empleados__MMColParam = "1"
If (Request.QueryString("Id") <> "") Then 
  Empleados__MMColParam = Request.QueryString("Id")
End If
%>
<%
Dim Empleados
Dim Empleados_numRows

Set Empleados = Server.CreateObject("ADODB.Recordset")
Empleados.ActiveConnection = MM_ConCapacitacion_STRING
Empleados.Source = "SELECT * FROM dbo.Empleados WHERE Id_Empleado = " + Replace(Empleados__MMColParam, "'", "''") + ""
Empleados.CursorType = 0
Empleados.CursorLocation = 2
Empleados.LockType = 1
Empleados.Open()

Empleados_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = 10
Repeat1__index = 0
Registro_Notas_numRows = Registro_Notas_numRows + Repeat1__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

Dim Registro_Notas_total
Dim Registro_Notas_first
Dim Registro_Notas_last

' set the record count
Registro_Notas_total = Registro_Notas.RecordCount

' set the number of rows displayed on this page
If (Registro_Notas_numRows < 0) Then
  Registro_Notas_numRows = Registro_Notas_total
Elseif (Registro_Notas_numRows = 0) Then
  Registro_Notas_numRows = 1
End If

' set the first and last displayed record
Registro_Notas_first = 1
Registro_Notas_last  = Registro_Notas_first + Registro_Notas_numRows - 1

' if we have the correct record count, check the other stats
If (Registro_Notas_total <> -1) Then
  If (Registro_Notas_first > Registro_Notas_total) Then
    Registro_Notas_first = Registro_Notas_total
  End If
  If (Registro_Notas_last > Registro_Notas_total) Then
    Registro_Notas_last = Registro_Notas_total
  End If
  If (Registro_Notas_numRows > Registro_Notas_total) Then
    Registro_Notas_numRows = Registro_Notas_total
  End If
End If
%>

<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (Registro_Notas_total = -1) Then

  ' count the total records by iterating through the recordset
  Registro_Notas_total=0
  While (Not Registro_Notas.EOF)
    Registro_Notas_total = Registro_Notas_total + 1
    Registro_Notas.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (Registro_Notas.CursorType > 0) Then
    Registro_Notas.MoveFirst
  Else
    Registro_Notas.Requery
  End If

  ' set the number of rows displayed on this page
  If (Registro_Notas_numRows < 0 Or Registro_Notas_numRows > Registro_Notas_total) Then
    Registro_Notas_numRows = Registro_Notas_total
  End If

  ' set the first and last displayed record
  Registro_Notas_first = 1
  Registro_Notas_last = Registro_Notas_first + Registro_Notas_numRows - 1
  
  If (Registro_Notas_first > Registro_Notas_total) Then
    Registro_Notas_first = Registro_Notas_total
  End If
  If (Registro_Notas_last > Registro_Notas_total) Then
    Registro_Notas_last = Registro_Notas_total
  End If

End If
%>
<%
Dim MM_paramName 
%>
<%
' *** Move To Record and Go To Record: declare variables

Dim MM_rs
Dim MM_rsCount
Dim MM_size
Dim MM_uniqueCol
Dim MM_offset
Dim MM_atTotal
Dim MM_paramIsDefined

Dim MM_param
Dim MM_index

Set MM_rs    = Registro_Notas
MM_rsCount   = Registro_Notas_total
MM_size      = Registro_Notas_numRows
MM_uniqueCol = ""
MM_paramName = ""
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "") Then
  MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")
End If
%>
<%
' *** Move To Record: handle 'index' or 'offset' parameter

if (Not MM_paramIsDefined And MM_rsCount <> 0) then

  ' use index parameter if defined, otherwise use offset parameter
  MM_param = Request.QueryString("index")
  If (MM_param = "") Then
    MM_param = Request.QueryString("offset")
  End If
  If (MM_param <> "") Then
    MM_offset = Int(MM_param)
  End If

  ' if we have a record count, check if we are past the end of the recordset
  If (MM_rsCount <> -1) Then
    If (MM_offset >= MM_rsCount Or MM_offset = -1) Then  ' past end or move last
      If ((MM_rsCount Mod MM_size) > 0) Then         ' last page not a full repeat region
        MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
      Else
        MM_offset = MM_rsCount - MM_size
      End If
    End If
  End If

  ' move the cursor to the selected record
  MM_index = 0
  While ((Not MM_rs.EOF) And (MM_index < MM_offset Or MM_offset = -1))
    MM_rs.MoveNext
    MM_index = MM_index + 1
  Wend
  If (MM_rs.EOF) Then 
    MM_offset = MM_index  ' set MM_offset to the last possible record
  End If

End If
%>
<%
' *** Move To Record: if we dont know the record count, check the display range

If (MM_rsCount = -1) Then

  ' walk to the end of the display range for this page
  MM_index = MM_offset
  While (Not MM_rs.EOF And (MM_size < 0 Or MM_index < MM_offset + MM_size))
    MM_rs.MoveNext
    MM_index = MM_index + 1
  Wend

  ' if we walked off the end of the recordset, set MM_rsCount and MM_size
  If (MM_rs.EOF) Then
    MM_rsCount = MM_index
    If (MM_size < 0 Or MM_size > MM_rsCount) Then
      MM_size = MM_rsCount
    End If
  End If
__________________
Fernando Parodi