?? scoreprintstep3_2.asp
字號:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="StudentConn.asp" -->
<%
Dim strStudentNum, strName, strGrade, strClass
strSubject=Trim(Request("Subject"))
strStudentNum= Request("StudentNum")
strName=Request("Name")
strClass=Request("ClassID")
intPageSize=Request("PageSize")
if intPageSize="" then intPageSize=3
Dim Recordset1__MMColParam
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_StudentConn_STRING
if (strStudentNum <> "") then
Recordset1__MMColParam =strStudentNum
Recordset1.Source = "SELECT StudentNum,Name FROM StudentInfo WHERE StudentNum like '%" & Recordset1__MMColParam & "%' ORDER BY StudentNum"
elseif (strName<>"") then
Recordset1__MMColParam =strName
Recordset1.Source = "SELECT StudentNum,Name FROM StudentInfo WHERE StudentNum like '%" & Recordset1__MMColParam & "%' ORDER BY StudentNum"
else
if strClass="All" then strClass=""
Recordset1__MMColParam =strClass
Recordset1.Source = "SELECT StudentNum,Name,ClassName FROM StudentInfo WHERE ClassName like '" & Recordset1__MMColParam & "%' ORDER BY StudentNum"
end if
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
Dim Recordset1_total
Dim Recordset1_first
Dim Recordset1_last
' set the record count
Recordset1_total = Recordset1.RecordCount
' set the number of rows displayed on this page
If (Recordset1_numRows < 0) Then
Recordset1_numRows = Recordset1_total
Elseif (Recordset1_numRows = 0) Then
Recordset1_numRows = 1
End If
' set the first and last displayed record
Recordset1_first = 1
Recordset1_last = Recordset1_first + Recordset1_numRows - 1
' if we have the correct record count, check the other stats
If (Recordset1_total <> -1) Then
If (Recordset1_first > Recordset1_total) Then
Recordset1_first = Recordset1_total
End If
If (Recordset1_last > Recordset1_total) Then
Recordset1_last = Recordset1_total
End If
If (Recordset1_numRows > Recordset1_total) Then
Recordset1_numRows = Recordset1_total
End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (Recordset1_total = -1) Then
' count the total records by iterating through the recordset
Recordset1_total=0
While (Not Recordset1.EOF)
Recordset1_total = Recordset1_total + 1
Recordset1.MoveNext
Wend
' reset the cursor to the beginning
If (Recordset1.CursorType > 0) Then
Recordset1.MoveFirst
Else
Recordset1.Requery
End If
' set the number of rows displayed on this page
If (Recordset1_numRows < 0 Or Recordset1_numRows > Recordset1_total) Then
Recordset1_numRows = Recordset1_total
End If
' set the first and last displayed record
Recordset1_first = 1
Recordset1_last = Recordset1_first + Recordset1_numRows - 1
If (Recordset1_first > Recordset1_total) Then
Recordset1_first = Recordset1_total
End If
If (Recordset1_last > Recordset1_total) Then
Recordset1_last = Recordset1_total
End If
End If
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>員工工資查詢</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2600.0" Name=GENERATOR>
<style type="text/css">
<!--
TABLE {
font-size: 12px;
text-decoration: none;
}
-->
</style>
</HEAD>
<BODY text=#000000 bgColor=#f7f7ff leftMargin=5 topMargin=5>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TR>
<TD align="center" valign="top">
<%
if Request("StudentNum")<>"" then
strTitle = "編號中含有“" & strStudentNum & "”"
elseif strName<>"" then
strTitle = "姓名中含有“" & strName & "”"
else
if strClass<>"" then strTitle = strClass
end if
strTitle = strTitle & strSubject
dim arrSheetName
dim strSheetName
dim rsSubjects()
dim ArrPass(),ArrExcel(),ArrAttain(),ArrBeyond()
strTemp = Request("chkbox")
arrSheetName = split(strTemp,",")
ReDim ArrPass(UBound(arrSheetName)+1)
Redim ArrExcel(UBound(arrSheetName)+1)
Redim ArrAttain(UBound(arrSheetName)+1)
Redim ArrBeyond(UBound(arrSheetName)+1)
Redim rsSubjects(Ubound(arrSheetName)+1)
For i = LBound(arrSheetName) To UBound(arrSheetName)
ArrPass(i)=0
ArrExcel(i)=0
ArrAttain(i)=0
ArrBeyond(i)=0
next
If Not Recordset1.EOF Or Not Recordset1.BOF Then
Recordset1.MoveFirst
While Not Recordset1.EOF
response.Write "<font size='6'><b>" & strTitle & "</b></font><br>"
Repeat1__numRows = intPageSize
%>
<table cellspacing=0 border=1 cellpadding="0" bordercolor="#000000" style="border-collapse:collapse">
<tr style="border:none">
<%
For i = LBound(arrSheetName) To UBound(arrSheetName)
strSheetName=trim(cstr(arrSheetName(i)))
Dim rsTestName__MMColParam
rsTestName__MMColParam=strSheetName
set rsTestName = Server.CreateObject("ADODB.Recordset")
rsTestName.ActiveConnection = MM_StudentConn_STRING
rsTestName.Source = "SELECT SheetName, TestName FROM TestName WHERE SheetName = '" + Replace(rsTestName__MMColParam, "'", "''") + "'"
rsTestName.CursorType = 0
rsTestName.CursorLocation = 2
rsTestName.LockType = 3
rsTestName.Open()
rsTestName_numRows = 0
strTestName=rsTestName.Fields.Item("TestName")
response.write "<td height='20' colspan='99' align='center'><font color='#000000'>" & strTestName & "</font></td>"
next
%>
</tr>
<tr align="center" valign="middle">
<td width="60"><font color="#000000">編 號</font></td>
<td width="50"><font color="#000000">姓 名</font></td>
<td width="50"><font color="#000000">科 室</font></td>
<%
For i = LBound(arrSheetName) To UBound(arrSheetName)
response.write "<td height='20'><font color='#000000'>" & strSubject & "</font></td>"
next
%>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<%
For i = LBound(arrSheetName) To UBound(arrSheetName)
strSheetName=trim(cstr(arrSheetName(i)))
set rsSubjects(i) = Server.CreateObject("ADODB.Recordset")
rsSubjects(i).ActiveConnection = MM_StudentConn_STRING
rsSubjects__MMColParam =CStr(Recordset1.Fields.Item("StudentNum"))
rsSubjects(i).Source = "SELECT " & strSubject & " FROM " & strSheetName & " WHERE StudentNum = '" + Replace(rsSubjects__MMColParam,"'","''") + "'"
rsSubjects(i).CursorType = 0
rsSubjects(i).CursorLocation = 2
rsSubjects(i).LockType = 3
rsSubjects(i).Open()
next
%>
<tr align="center" valign="middle">
<td height="20" nowrap><%=(Recordset1.Fields.Item("StudentNum").Value)%></td>
<td height="20" nowrap><%=(Recordset1.Fields.Item("Name").Value)%></td>
<td height="20"><%=(Recordset1.Fields.Item("ClassName").Value)%></td>
<%
For i = LBound(arrSheetName) To UBound(arrSheetName)
if rsSubjects(i).bof or rsSubjects(i).eof then
strScore=0
else
strScore=rsSubjects(i).Fields.Item(strSubject).Value
if IsNull(strScore) then strScore=0
end if
response.write "<td height='20'>" & strScore & "</td>"
next
%>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
if Recordset1.EOF then
%>
<% End if %>
</table><br>
<%
Wend
else
Response.Write "<br><br><br>找不到符合條件的記錄!<br><br><br>"
end if
%>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
<%
Recordset1.Close()
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -