新微赢技术网
标题:
显示出错!
[打印本页]
作者:
秋风扫落叶
时间:
2010-1-14 08:56
标题:
显示出错!
<!--#include file="..\inc\conn.asp"-->
<!--#include file="..\inc\SessionCheck.asp"-->
<%
Call DBConnBegin()
dim course ,tid
tid=session("teacher")
course=Request.Form("course")
IF course<>"" Then
Session("course")=course
Else
course=Session("course")
End IF
%>
<html><head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>数字实验室——选课查询</title>
<link rel="stylesheet" href="..\inc\style.css" type="text/css">
</head>
<body topmargin="0" leftmargin="0">
<!--#include file="pagehead.asp"-->
<table width="789" border="0" align="center">
<tr><td width="783" align=left>
<table width="776" height="35" cellspacing="0" cellpadding="0">
<td background="../images/top_1.jpg">
</table>
<div align="center">
<center><form method="POST" action="CourseExamine.asp">
<table border="0" width="700" cellspacing="0" cellpadding="0">
<tr><td align="right">课程选择:<select size="1" name="course"><%
sSql="select * from CourseInfo where TID='"&tid&"'"
oRs.open sSql,oConn,3,2
do while not oRs.eof%><option value="<%=oRs("CID")%>" <%if course=oRs("CID") then Response.write "selected" end if%>><%=oRs("CName")%></option>
<%oRs.movenext
loop
oRs.close%></select> <input type="submit" value="查询" name="B1"></td></tr></table></form>
<table border="0" width="700" cellspacing="0" cellpadding="0">
<% '需要修改!!!!
sSql="select StuInfo.StuName,CourseSelectedInfo.* from CourseSelectedInfo Left Join StuInfo ON StuInfo.StuID= CourseSelectedInfo.StuID where CourseSelectedInfo.StuID in (select StuID from CourseSelectedInfo where CID='"&course&"')"
oRs.open sSql,oConn,1,1
if Not(oRs.bof and oRs.eof) then'判别数据表中是否为空记录
dim NumRecord,NumPage,NoncePage,i
NumRecord=oRs.recordcount
oRs.pagesize=10
NumPage=oRs.Pagecount
if request("page")=empty then
NoncePage=1
else
if Cint(request("page"))<1 then
NoncePage=1
else
NoncePage=request("page")
end if
if Cint(Trim(request("page")))>Cint(NumPage) then NoncePage=NumPage
end if
else
NumRecord=0
NumPage=0
NoncePage=0
end if
%>
<table border="1" width="700" bordercolorlight="#000000" cellspacing="0" cellpadding="5" bordercolordark="#FFFFFF">
<tr><td align="center" colspan="6">选择该实验课的学生列表</td></tr>
<tr>
<td width="71" bgcolor="#EBE9FE" align="center">学号</td>
<td width="78" bgcolor="#EBE9FE" align="center">姓名</td>
<td width="71" bgcolor="#EBE9FE" align="center">考核结果</td>
<td width="71" bgcolor="#EBE9FE" align="center">修改考核</td>
<td width="71" bgcolor="#EBE9FE" align="center">删除考核</td>
</tr>
<%if Not(oRs.bof and oRs.eof) then
oRs.move (Cint(NoncePage)-1)*10,1
for i=1 to oRs.pagesize
%>
<tr>
<td width="71" align="center"><%=oRs("StuID")%></td>
<td width="78" align="center"><%=oRs("StuName")%></td>
<td width="71" align="center"><%if Trim(oRs("EResult"))<>"" then%><%=Trim(oRs("EResult"))%><%else%><a href="toexamine.asp?id=<%=oRs("ID")%>"><font color="red">未考核</font></a><%end if%></td>
<td width="71" align="center"><%if Trim(oRs("EResult"))<>"" then%><a href="toexamine.asp?id=<%=oRs("ID")%> "><font color="blue">修改</font></a><%else%> <%end if%></td>
<td width="71" align="center"><%if Trim(oRs("EResult"))<>"" then%><a href="delexamine.asp?id=<%=oRs("ID")%> " class="link">删除</a><%else%> <%end if%></td>
</tr>
<% oRs.movenext
if oRs.eof then exit for
next
else
response.write "<tr><td colspan=13><marquee scrolldelay=120 behavior=alternate>没有找到任何记录!!!</marquee></td></tr>"
end if
oRs.close
%>
</table>
</table>
<table width="783" border="0">
<tr><td width="748" height="17">
<div align="right">
<input type="hidden" name="page" value="<%=NoncePage%>">
<%
if NoncePage>1 then
response.write "|<a href=CourseExamine.asp?page=1>首 页</a>| |<a href=CourseExamine.asp?page="&NoncePage-1&">上一页</a>| "
else
response.write "|首 页| |上一页| "
end if
if Cint(Trim(NoncePage))<Cint(Trim(NumPage)) then
response.write "|<a href=CourseExamine.asp?page="&NoncePage+1&">下一页</a>| |<a href=CourseExamine.asp?page="&NumPage&">尾 页</a>|"
else
response.write "|下一页| |尾 页|"
end if
%>
页次:<font color="#0033CC"><%=NoncePage%></font>/<font color="#0033CC"><%=NumPage%></font>
共<font color="#0033CC"><%=NumRecord%></font>条记录 </div>
</td></tr>
</table>
</center></div>
</td></tr></table>
<div align="center">
<%Call DBConnEnd()%>
<!--#include file="pagefoot.asp"-->
</div>
</body>
</html>
在人数超过10以后显示就不按我选的查询条件来显示!不知道出错在哪!!
欢迎光临 新微赢技术网 (http://bbs.weiying.cn/)
Powered by Discuz! X3.2