⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 servermodicj.asp

📁 成绩管理代码 采取的研究方法:采用网络编程技术
💻 ASP
字号:
<!--#include file="dataconn.asp"-->
<!--#include file="IsLogin.asp" -->
<%
Response.ContentType = "text/html"
Response.Charset = "GB2312" 
dim subjectcj(25)
stuidh = unescape(Request.querystring("stuidh"))
dbname=session("dbname")
if dbname="历次考试库" then

if isNumeric(stuidh) then
stuidhyear=left(stuidh,4)
else
sql="select stuidh,stuname from stuinfo where stuname='"&stuidh&"'"
set rs=conn.execute(sql)
if rs.eof then 
response.write escape("<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;对不起,如果选择[历次考试库]不能进行模糊查询!!")
response.end
else
stuidh=rs("stuidh")
set rs=nothing
stuidhyear=left(stuidh,4)
end if
end if

sql="select * from testmdb where joinschool='"&stuidhyear&"' order by testid desc"
set rsd=conn.execute(sql)
do while not rsd.eof
testname=rsd("testname")
dbname=rsd("dbname")
sql = "select * from stuinfo,"&dbname&" where stuinfo.stuidh='"&stuidh&"' and stuinfo.stuidh="&dbname&".stuidh"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.OPEN sql,Conn,1,1
if rs.eof and rs.bof then
response.write escape("<br>对不起,没有查询到任何内容!")
else
response.write escape("<table width='85%' border='0' align='center'><tr><td><table width='100%' border='0'><tr><td width='80'>学号</td><td width='110'>姓名</td><td width='81'>年级</td><td width='81'>班级</td>")
set RS1=conn.execute("select * from "&dbname&"")
zdcount1=rs1.fields.count-1
icj=0 
for i=6  to  zdcount1
  response.write  "<td width='105' align='center'>"&escape(rs1.fields(i).name)&"</td>" 
  subjectcj(icj)=rs1.fields(i).name
  icj=icj+1
next
response.write escape("<td width='81'>总 分</td><td width='120'>级部排名</td><td width='120'>班内排名</td>")
set rs1=nothing
do while not rs.eof
stuidh = rs("stuinfo.stuidh").value
stuname = rs("stuname").value
stunj = rs("stunj").value
stubj = rs("stubj").value
stuzf=rs("总分").value
stujm=rs("全级排名").value
stubm=rs("班级排名").value

response.write " </tr><tr><td>"&escape(stuidh)&"</td>"
response.write "<td>"&escape(stuname)&"</td>"
response.write "<td>"&escape(stunj)&"</td>"
response.write "<td>"&escape(stubj)&"</td>"
zdcount=rs.fields.count-1 
for k=25  to  zdcount
subject=rs.fields(k).name
subject=rs(rs.fields(k).name).value
response.write "<td align='center'>"&subject&"</td>"
next
response.write "<td align='center'>"&escape(stuzf)&"</td>"
response.write "<td align='center'>"&escape(stujm)&"</td>"
response.write "<td align='center'>"&escape(stubm)&"</td>"
rs.movenext
loop

response.write "</tr></table>"
rs.close
end if
set rs=nothing
rsd.movenext
loop
rsd.close
set rsd=nothing
'end if

else
'if dbname<>"历次考试库" then

if isNumeric(stuidh) then
sql = "select * from stuinfo,"&dbname&" where stuinfo.stuidh='"&stuidh&"' and stuinfo.stuidh="&dbname&".stuidh"
else
sql = "select * from stuinfo,"&dbname&" where stuinfo.stuname like '%"&stuidh&"%' and stuinfo.stuidh="&dbname&".stuidh"
end if
Set rs = Server.CreateObject("ADODB.Recordset")
rs.OPEN sql,Conn,1,1
if rs.eof and rs.bof then
response.write escape("<br>对不起,没有查询到任何内容!")
else
response.write escape("<table width='85%' border='0' align='center'><tr><td><table width='100%' border='0'><tr><td width='80'>学号</td><td width='110'>姓名</td><td width='81'>年级</td><td width='81'>班级</td>")
set RS1=conn.execute("select * from "&dbname&"")
zdcount1=rs1.fields.count-1
icj=0 
for i=6  to  zdcount1
  response.write  "<td width='105' align='center'>"&escape(rs1.fields(i).name)&"</td>" 
  subjectcj(icj)=rs1.fields(i).name
  icj=icj+1
next
response.write escape("<td width='81'>总 分</td><td width='120'>级部排名</td><td width='120'>班内排名</td>")
set rs1=nothing
do while not rs.eof
stuidh = rs("stuinfo.stuidh").value
stuname = rs("stuname").value
stunj = rs("stunj").value
stubj = rs("stubj").value
stuzf=rs("总分").value
stujm=rs("全级排名").value
stubm=rs("班级排名").value

response.write " </tr><tr><td>"&escape(stuidh)&"</td>"
response.write "<td>"&escape(stuname)&"</td>"
response.write "<td>"&escape(stunj)&"</td>"
response.write "<td>"&escape(stubj)&"</td>"
zdcount=rs.fields.count-1 
for k=25  to  zdcount
subject=rs.fields(k).name
subject=rs(rs.fields(k).name).value
response.write "<td align='center'>"&subject&"</td>"
next
response.write "<td align='center'>"&escape(stuzf)&"</td>"
response.write "<td align='center'>"&escape(stujm)&"</td>"
response.write "<td align='center'>"&escape(stubm)&"</td>"
rs.movenext
loop

response.write "</tr></table>"
rs.close
end if
set rs=nothing
end if
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -