📄 xsquery1.asp
字号:
<!--#include file="../data/const.asp"-->
<%
que=request.querystring("que")
if que="1" then
str1=session("xsstr")
else
zychk=trim(request.form("zychk"))
njchk=trim(request.form("njchk"))
xmchk=trim(request.form("xmchk"))
xbchk=trim(request.form("xbchk"))
xszy=trim(request.form("zy"))
xm=trim(request.form("xm"))
xb=trim(request.form("xb"))
nj=trim(request.form("nj"))
str2=""
p=InStr(xszy,":")
l=len(xszy)
if p>0 then
xsh=left(xszy,p-1)
str2=str2&" 院系编号='"&xsh&"' and"
end if
if zychk="on" then
zyh=right(xszy,l-p)
str2=str2&" 专业编号='"&zyh&"' and"
end if
if xmchk="on" then
str2=str2&" 姓名 like '"&xm&"%' and"
end if
if xbchk="on" then
str2=str2&" 性别='"&xb&"' and"
end if
if njchk="on" then
str2=str2&" 年级='"&nj&"' and"
end if
str2=trim(str2)
if str2<>"" then
str2=left(str2,len(str2)-3)
end if
if str2="" then
str1="select * from 学生信息表视图 order by 院系编号,专业编号,学号"
else
str1="select * from 学生信息表视图 "
str1=str1&"where "&str2&" order by 院系编号,专业编号,学号"
end if
end if
session("xsstr")=str1
set rs=server.createobject("adodb.recordset")
rs.open str1,dbconn,1,1
if rs.eof or rs.bof then
%>
<script language=vbscript>
msgbox "没有找到学生信息"
history.back
</script>
<%
response.end
end if
rs.movefirst
rs.pagesize=20
if not Isempty(request("Topage")) then
if not isnumeric(request("topage")) then
%>
<script language=vbscript>
msgbox "输入了非法页号"
history.back
</script>
<%
response.end
end if
topage=CLng(request("topage"))
if topage>rs.pagecount then
rs.absolutepage=rs.pagecount
else
if topage<=0 then
rs.absolutepage=1
else
rs.absolutepage=topage
end if
end if
end if
intcurpage=rs.absolutepage
%>
<!--#include virtual="../header.asp" -->
<br>
<table border="0" align="center" width="98%">
<tr>
<td>您当前的位置:学籍->学生信息查询</td>
</tr>
</table>
<table cellspacing="0" bordercolor="#cccccc" bordercolordark="#FFFFFF" align="center" border="1" id="mytable">
<caption><strong>查询结果</strong><br><br>
<%
if intcurpage>1 then
%>
<a href=xsquery1.asp?que=1&topage=<%=1%>>第一页</a>
<a href=xsquery1.asp?que=1&topage=<%=intcurpage-1%>>上一页</a>
<%
end if
if intcurpage<rs.pagecount then
%>
<a href=xsquery1.asp?que=1&topage=<%=intcurpage+1%>>下一页</a>
<a href=xsquery1.asp?que=1&topage=<%=rs.pagecount%>>最后一页</a>
<%
end if
%>
第<font color=red><%=intcurpage%></font >页/共<font color=red><%=rs.pagecount%></font >页(共<%=rs.recordcount%>条记录)
</caption>
<tr>
<th width="6%"><div align="center">年级</div></th>
<th width="12%"><div align="center">学院</div></th>
<th width="12%"><div align="center">系部</div></th>
<th width="16%"><div align="center">专业</div></th>
<th width="16%"><div align="center">班级</div></th>
<th width="10%"><div align="center">学号</div></th>
<th width="12%"><div align="center">姓名</div></th>
<th width="6%"><div align="center">性别</div></th>
<th width="12%"><div align="center">出生日期</div></th>
</tr>
<%
for i=1 to rs.pagesize
if rs.eof then
exit for
end if
%>
<tr>
<td div align="center"><%=rs("年级")%> </td>
<td div align="center"><%=rs("学院")%> </td>
<td div align="center"><%=rs("系部")%> </td>
<td div align="center"><%=rs("专业")%> </td>
<td div align="center"><%=rs("班级")%> </td>
<td div align="center"><%=rs("学号")%> </td>
<td div align="center"><%=rs("姓名")%> </td>
<td div align="center"><%=rs("性别")%> </td>
<td div align="center"><%=rs("出生日期")%> </td>
</tr>
<%
rs.movenext
next
rs.close
set rs=nothing
%>
</table>
<br>
<!--#include virtual="../footer.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -