📄 scorequery1_1.asp
字号:
<tr>
<td align="center" valign="top"> <b><font color="#0066cc" size="5"><br>
学生成绩查询</font></b> </td>
</tr>
<tr>
<td bgcolor=#3399ff height=1></td>
</tr>
<tr>
<td valign=top><b><font color="#FF0000"><br>
<font color="#0066cc">考试名称:</font></font></b> <%=(Recordset2.Fields.Item("TestName").Value)%><font color="#FF0000"><b><font color="#0066cc"> </font></b></font><font color="#FF0000"><b> 查询条件:</b></font>
<%
if Request("StudentNum")<>"" then
response.write "学号中含有“" & strStudentNum & "”"
elseif strName<>"" then
response.write "姓名中含有“" & strName & "”"
else
if strClass<>"" then strClass=strClass & "班"
response.write "高" & strGrade+1 & "级" & strClass
end if
%> <% If Not Recordset3.EOF Or Not Recordset3.BOF Then %> <br> <br>
共找到 <font color="#FF0000"><%=(Recordset3_total)%></font> 条记录!
<table cellspacing=0 border=1 cellpadding="0" bordercolor="#FFCC00">
<tr align="center" valign="middle" bordercolor="#FFCC00">
<td width="60" rowspan="2"><font color="#000000">学 号</font></td>
<td width="50" rowspan="2"><font color="#000000">姓 名</font></td>
<%
strTemp = Request("chkbox")
dim ArrSubject,strSubject
dim ArrPass(),ArrExcel(),ArrAttain(),ArrBeyond()
ArrSubject = split(strTemp,",")
ReDim ArrPass(UBound(ArrSubject)+1)
Redim ArrExcel(UBound(ArrSubject)+1)
Redim ArrAttain(UBound(ArrSubject)+1)
Redim ArrBeyond(UBound(ArrSubject)+1)
For i = LBound(ArrSubject) To UBound(ArrSubject)
strSubject=trim(cstr(ArrSubject(i)))
response.write "<td height='20' colspan='2'><font color='#000000'>" & strSubject & "</font></td>"
ArrPass(i)=0
ArrExcel(i)=0
ArrAttain(i)=0
ArrBeyond(i)=0
next
%>
</tr>
<tr align="center" valign="middle" bordercolor="#FFCC00">
<%
For i = LBound(ArrSubject) To UBound(ArrSubject)
strSubject=trim(cstr(ArrSubject(i)))
if strSubject<>"全级排名" and strSubject<>"班级排名" then
response.write "<td height='20' width='30'><font color='#000000'>成绩</font></td><td height='20' width='30'><font color='#000000'>目标</font></td>"
else
response.write "<td height='20' width='30'><font color='#000000'>名次</font></td><td height='20' width='30'><font color='#000000'>目标</font></td>"
end if
next
%>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset3.EOF))
%>
<%
Recordset1__MMColParam = CStr(Recordset3.Fields.Item("StudentNum").Value)
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_StudentConn_STRING
Recordset1.Source = "SELECT StudentNum, Name FROM StudentInfo WHERE StudentNum = '" + Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
if not recordset1.bof or not recordset1.eof then
strName=cstr(Recordset1.Fields.Item("Name").Value)
else
strName=" "
end if
%>
<%
Recordset5__MMColParam = CStr(Recordset3.Fields.Item("StudentNum").Value)
set Recordset5 = Server.CreateObject("ADODB.Recordset")
Recordset5.ActiveConnection = MM_StudentConn_STRING
Recordset5.Source = "SELECT * FROM TargetScore WHERE StudentNum = '" + Replace(Recordset5__MMColParam, "'", "''") + "'"
Recordset5.CursorType = 0
Recordset5.CursorLocation = 2
Recordset5.LockType = 3
Recordset5.Open()
Recordset5_numRows = 0
%>
<tr align="center" valign="middle">
<td height="20" nowrap><%=(Recordset3.Fields.Item("StudentNum").Value)%></td>
<td height="20" nowrap><%=strName%></td>
<%
For i = LBound(ArrSubject) To UBound(ArrSubject)
strSubject=trim(cstr(ArrSubject(i)))
strScore=Recordset3.Fields.Item(strSubject).Value
if IsNull(strScore) then strScore=0
if recordset5.bof or recordset5.eof then
strTarget=0
else
strTarget=Recordset5.Fields.Item(strSubject).Value
if IsNull(strTarget) then strTarget=0
end if
if strScore<60 then
if strScore>=strTarget then '达标
ArrAttain(i)=ArrAttain(i)+1
strTarget="<font color='#999999'>" & strTarget & "</font>"
else '不达标
strTarget="<font color='#ff0000'>" & strTarget & "</font>"
end if
strScore = "<font color='#ff0000'>" & strScore & "</font>"
elseif strScore>=60 and strScore<80 then
ArrPass(i)=ArrPass(i)+1
if strScore>=strTarget then
if strTarget<60 then '跳格
ArrBeyond(i)=ArrBeyond(i)+1
strTarget="<font color='#009900'>" & strTarget & "</font>"
else '达标
ArrAttain(i)=ArrAttain(i)+1
strTarget="<font color='#999999'>" & strTarget & "</font>"
end if
else '不达标
strTarget="<font color='#ff0000'>" & strTarget & "</font>"
end if
elseif strScore>=80 then
ArrPass(i)=ArrPass(i)+1
ArrExcel(i)=ArrExcel(i)+1
if strScore>=strTarget then
if strTarget<80 then '跳格
ArrBeyond(i)=Arrbeyond(i)+1
strTarget="<font color='#009900'>" & strTarget & "</font>"
else '达标
ArrAttain(i)=ArrAttain(i)+1
strTarget="<font color='#999999'>" & strTarget & "</font>"
end if
else '不达标
strTarget="<font color='#ff0000'>" & strTarget & "</font>"
end if
strScore = "<font color='#009900'>" & strScore & "</font>"
end if
response.write "<td height='20'>" & strScore & "</td>"
response.write "<td height='20'>" & strTarget & "</td>"
next
%>
</tr>
<%
Recordset1.Close()
%>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset3.MoveNext()
Wend
%>
<tr align="center" valign="middle">
<td colspan="2" hight="20" align="right">合格人数/达标人数:</td>
<%
For i = LBound(ArrSubject) To UBound(ArrSubject)
response.write "<td height='20'>" & ArrPass(i) & "</td><td height='20'>" & ArrAttain(i) & "</td>"
next
%>
</tr>
<tr align="center" valign="middle">
<td colspan="2" hight="20" align="right">合格率/达标率:</td>
<%
For i = LBound(ArrSubject) To UBound(ArrSubject)
response.write "<td height='20'>" & round(ArrPass(i)/(Recordset3_total)*100,1) & "%</td><td height='20'>" & round(ArrAttain(i)/(Recordset3_total)*100,1) & "%</td>"
next
%>
</tr>
<tr align="center" valign="middle">
<td colspan="2" hight="20" align="right">优秀人数/跳格人数:</td>
<%
For i = LBound(ArrSubject) To UBound(ArrSubject)
response.write "<td height='20'>" & ArrExcel(i) & "</td><td height='20'>" & ArrBeyond(i) & "</td>"
next
%>
</tr>
<tr align="center" valign="middle">
<td colspan="2" hight="20" align="right">优秀率/跳格率:</td>
<%
For i = LBound(ArrSubject) To UBound(ArrSubject)
response.write "<td height='20'>" & round(ArrExcel(i)/(Recordset3_total)*100,1) & "%</td><td height='20'>" & round(ArrBeyond(i)/(Recordset3_total)*100,1) & "%</td>"
next
%>
</tr>
<tr align="center" valign="middle">
<td colspan="2" hight="20" align="right">两率和:</td>
<%
For i = LBound(ArrSubject) To UBound(ArrSubject)
response.write "<td height='20'>" & round((ArrPass(i)+ArrExcel(i))/(Recordset3_total)*100,1) & "%</td><td height='20'>" & round((ArrAttain(i)+ArrBeyond(i))/(Recordset3_total)*100,1) & "%</td>"
next
%>
</tr>
</table>
<font color="#000000"><strong>说明:</strong><br>
成绩表示方法:60分以下用<font color="#FF0000">红色</font>表示,60--79分用<font color="#0000FF">蓝色</font>表示,80分及以上用<font color="#009900">绿色</font>表示。<br>
达标表示方法:不达标用<font color="#FF0000">红色</font>表示,达标用</font><font color="#999999">灰色</font><font color="#000000">表示,跳格用<font color="#009900">绿色</font>表示。</font>
<% else %> <br> <br> <br>
找不到符合条件的记录!<br> <br> <br> <% end if %> </td>
</tr>
</table>
</TD>
</TR>
</TABLE>
<!--#include file="CopyRight.asp"-->
</BODY>
</HTML>
<%
Recordset2.Close()
%>
<%
Recordset3.Close()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -