📄 index_order.asp
字号:
<!--#include file="conn.asp" -->
<!--#include file="login_menu.asp" -->
<html>
<head>
<title>25175学生成绩查询管理系统v2.21_(学生成绩查询)_(绩查询管理)</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="25175com_221.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (25175_sub2.psd) -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/index_02.gif"><table width="898" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<!--#include file="top.asp" -->
<table width="898" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="202" valign="top"><%call login()%></td>
<td width="696" valign="top"><table width="695" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/index_15.gif" width="695" height="48" alt=""></td>
</tr>
<tr>
<td><table width="695" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="32"><img src="images/index_17.gif" width="32" height="579" alt=""></td>
<td valign="top" bgcolor="#FFFFFF"><table width="619" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td><table width="619" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="340"> </td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4%"><div align="right"><img src="images/index_19.gif" width="6" height="20" alt=""></div></td>
<td width="93%" bgcolor="#E4E7DB"> <a href="index.asp">首页</a> > <a href="index.asp">管理统计</a> > 排名系统</td>
<td width="3%"><img src="images/index_21.gif" width="7" height="20" alt=""></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="76" valign="bottom"><table width="97%" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><img src="images/index_30.gif" width="6" height="70" alt=""></div></td>
<td width="600" background="images/index_31.gif">
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<form name="form1" method="post" action="?">
<tr>
<td>方式
<select name="orderby" id="orderby">
<option value="1" <%if request("orderby")=1 then response.write"selected"%>>班级单科</option>
<option value="2" <%if request("orderby")=2 then response.write"selected"%>>班级总分</option>
<option value="3" <%if request("orderby")=3 then response.write"selected"%>>院系单科</option>
<option value="4" <%if request("orderby")=4 then response.write"selected"%>>院系总分</option>
</select> </td>
<td>院系
<select name="dep_id" id="dep_id">
<%
set rs=conn.execute("select did,dname from department")
do while not rs.eof
if rs("did")=int(request("dep_id")) then
response.write"<option value='"&rs("did")&"' selected>"&rs("dname")&"</option>"
else
response.write"<option value='"&rs("did")&"'>"&rs("dname")&"</option>"
end if
rs.movenext
loop
set rs=nothing
%>
</select></td>
<td>班级
<select name="cla_id" id="cla_id">
<%
set rs=conn.execute("select cid,cname from class")
do while not rs.eof
if rs("cid")=int(request("cla_id")) then
response.write"<option value='"&rs("cid")&"' selected>"&rs("cname")&"</option>"
else
response.write"<option value='"&rs("cid")&"'>"&rs("cname")&"</option>"
end if
rs.movenext
loop
set rs=nothing
%>
</select></td>
<td>课程
<select name="sub_id" id="select">
<%
set rs=conn.execute("select sid,sname from subject")
do while not rs.eof
if rs("sid")=int(request("sub_id")) then
response.write"<option value='"&rs("sid")&"' selected>"&rs("sname")&"</option>"
else
response.write"<option value='"&rs("sid")&"'>"&rs("sname")&"</option>"
end if
rs.movenext
loop
set rs=nothing
%>
</select></td>
<td>学期
<select name="sterm" id="sterm">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
</select> </td>
<td><input type="submit" name="Submit3" value="显示"></td>
</tr>
<tr>
<td colspan="6">若“方式”选择班级,则忽略院系;若“方式”选择院系,则忽略班级。</td>
</tr>
</form>
</table>
</td>
<td><div align="center"><img src="images/index_34.gif" height="70" alt=""></div></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="419" valign="top"><table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><strong>学号</strong></div></td>
<td><div align="center"><strong>姓名</strong></div></td>
<td><div align="center"><strong>班级</strong></div></td>
<td><div align="center"><strong>学期</strong></div></td>
<td><div align="center"><strong>分数</strong></div></td>
<td><div align="center"><strong>名次</strong></div></td>
</tr>
<%
dim sql,totalstu,page,pages,i,ii,j,cla_id,sub_id,orderby,dep_id,sterm,thesame_res
cla_id=request("cla_id")
sub_id=request("sub_id")
orderby=request("orderby")
dep_id=request("dep_id")
sterm=request("sterm")
select case orderby
case 1
'班级单科
set rs= Server.CreateObject("ADODB.Recordset")
sql="select b.buser,s.sname,c.cname,b.bresult from bbs b,student s,class c,subject ss "&_
"where b.buser=s.suser and b.cla_id=c.cid and b.sub_id=ss.sid and b.cla_id="&cla_id&" and ss.sid="&sub_id&" and ss.sterm="&sterm&" order by b.bresult desc"
case 2
'班级总分
set rs= Server.CreateObject("ADODB.Recordset")
sql="select s.suser,first(s.sname),first(c.cname),sum(b.bresult) as sumbresult "&_
"from bbs b,student s,class c,subject ss "&_
"where ss.sterm ="&sterm&" and s.cla_id ="&cla_id&" and s.suser=b.buser and b.sub_id=ss.sid and b.cla_id = s.cla_id and s.cla_id=c.cid group by s.suser order by sum(b.bresult) desc"
case 3
'院系单科
'取指定ID的课程名,因班级间课程ID不同,所以视同一院系下课程名相同的为同一科
dim sname
set rs=conn.execute("select sname from subject where sid="&sub_id&"")
sname=rs("sname")
set rs= Server.CreateObject("ADODB.Recordset")
sql="select b.buser,s.sname,c.cname,b.bresult from bbs b,student s,class c,subject ss,department d "&_
"where b.buser=s.suser and b.dep_id=d.did and b.sub_id=ss.sid and s.cla_id=c.cid and b.dep_id="&dep_id&" and ss.sname='"&sname&"' and ss.sterm="&sterm&" order by b.bresult desc"
case 4
'院系总分
set rs= Server.CreateObject("ADODB.Recordset")
sql="select s.suser,first(s.sname),first(c.cname),sum(b.bresult) as sumbresult "&_
"from bbs b,student s,class c,subject ss,department d "&_
"where ss.sterm ="&sterm&" and b.dep_id ="&dep_id&" and s.suser=b.buser and b.sub_id=ss.sid and s.cla_id=c.cid and c.dep_id=d.did group by s.suser order by sum(b.bresult) desc"
case else
'为了rs.open sql,conn,1,1能正常运行,随便打开个表,有无数据皆可
set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from bbs where bid=0"
end select
rs.open sql,conn,1,1
if rs.eof and rs.bof then
page=1
pages=1
totalstu=0
response.write"<tr><td width='100%' height='100' align='center' colspan='6'>没有相关的成绩资料,请选择显示条件</td></tr>"
else
totalstu=rs.recordcount '总的条数
rs.pagesize=15 '每页显示的条数
pages=rs.pagecount '总的找到页数
page=request("page") '当前页
if page="" then
page=1
elseif page<1 then
page=1
end if
page=cint(page)
if page>pages then page=pages
rs.absolutepage=page
ii=request("ii")
thesame_res=int(request("thesame_res"))
do while not rs.eof and i<rs.pagesize
i=i+1
'若成绩有并列,则正确判断名次
if rs(3)=thesame_res then
ii=ii
j=j+1
else
ii=ii+j+1
j=0
end if
thesame_res=rs(3)
%>
<tr>
<td><div align="center"><%=rs(0)%></div></td>
<td><div align="center"><%=rs(1)%></div></td>
<td><div align="center"><%=rs(2)%></div></td>
<td><div align="center"><%=sterm%></div></td>
<td><div align="center"><%=rs(3)%></div></td>
<td><div align="center"><font color="#FF0000"><b><%=ii%></b></font></div></td>
</tr>
<%
rs.movenext
loop
end if
set rs=nothing
%>
</table></td>
</tr>
<tr>
<td height="18">
<%
if pages>1 then
response.write"<table align='center' cellspacing='0' cellpadding='0' border='0' width='100%'>"&_
"<form method='POST' action='?'>"&_
"<tr><td height='15' width='50%'>共<font color='red'>"&totalstu&"</font>人 <font color='red'>"&pages&"</font>页 第<font color='red'>"&page&"</font>页 "&_
" <input type='text' name='page' size='5' maxlength='4'> <input type='submit' value='GO' name='B1'></td><td align='right' width='50%' height='15'>"
if page>1 then
response.write"<a href='?page=1'>首页</a> "&_
"<a href='?page="&page-1&"'>上一页</a> "
else
response.write"首页 上一页 "
end if
if page<pages then
response.write"<a href='?page="&page+1&"&orderby="&orderby&"&dep_id="&dep_id&"&cla_id="&cla_id&"&sub_id="&sub_id&"&sterm="&sterm&"&thesame_res="&thesame_res&"&ii="&ii&"'>下一页</a> "&_
"<a href='?page="&pages&"'>尾页</a>"
else
response.write"下一页 尾页"
end if
response.write"</td></tr></form></table>"
end if
%>
</td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><img src="images/index_78.gif" alt="" width="620" height="24"></td>
</tr>
</table></td>
<td width="43"><img src="images/index_22.gif" width="43" height="579" alt=""></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td><!--#include file="bottom.asp" -->
</td>
</tr>
</table></td>
</tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -