📄 search.asp
字号:
<!--#include file="..\inc\conn.asp"-->
<!--#include file="..\inc\SessionCheck.asp"-->
<%
Call DBConnBegin()
dim sc,scontent
sc=trim(request("sc"))
scontent=trim(request("scontent"))
sSql="select * from stuinfo "
select case sc
case "0"
sSql=sSql
case "1"
sSql=sSql&" where class like '%"&scontent&"%'"
case "2"
sSql=sSql&" where StuName like '%"&scontent&"%'"
end select
sSql=sSql&" order by id desc"
oRs.open sSql,oConn,1,1
%>
<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="..\CommonFile\pagehead.asp"-->
<table width="738" border="0"><tr><td align=left>
<table width="736" height="35" cellspacing="0" cellpadding="0">
<td background="../images/top_1.jpg"> <a href="list.asp" class="link">学生信息列表</a>
| <a href="add.asp" class="link">录入学生信息</a>
| <a href="search.asp" class="link">学生信息查询</a></table>
<div align="center">
<center><form method="POST" action="search.asp">
<table border="0" width="700" cellspacing="0" cellpadding="0">
<tr><td align="right">选择查询条件:<select size="1" name="sc">
<option value="0" selected>全部</option>
<option value="1">班号</option>
<option value="2">学生姓名</option>
</select> 输入查询内容:<input type="text" name="sContent" size="20"> <input type="submit" value="查询" name="B1"></td></tr></table></form>
<table border="0" width="700" cellspacing="0" cellpadding="0">
<%
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 width="71" bgcolor="#EBE9FE" align="center">学号</td>
<td width="78" bgcolor="#EBE9FE" align="center">姓名</td>
<td width="65" bgcolor="#EBE9FE" align="center">性别</td>
<td width="78" bgcolor="#EBE9FE" align="center">班级</td>
<td width="110" 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="65" align="center"><%=oRs("Stusex")%></td>
<td width="78" align="center"><%=oRs("class")%></td>
<td width="110" align="center"><%=oRs("StuBirth")%></td>
<td width="71" align="center"><a href=modify.asp?id=<%=oRs("id")%> class="link">修改</a></td>
<td width="71" align="center"><a href=delete.asp?id=<%=oRs("id")%> class="link">删除</a></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="736" border="0">
<tr><td height="17">
<div align="right">
<input type="hidden" name="page" value="<%=NoncePage%>">
<%
if NoncePage>1 then
response.write "|<a href=list.asp?page=1>首 页</a>| |<a href=list.asp?page="&NoncePage-1&">上一页</a>| "
else
response.write "|首 页| |上一页| "
end if
if Cint(Trim(NoncePage))<Cint(Trim(NumPage)) then
response.write "|<a href=list.asp?page="&NoncePage+1&">下一页</a>| |<a href=list.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>
<!--#include file="..\CommonFile\pagefoot.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -