📄 search.asp
字号:
<!--#include file="conn.asp"-->
<%dim searchid,searchkey
searchid=FormatSQL(request.form("searchid"))
searchkey=FormatSQL(Request.form("searchkey"))
mohu=Request.form("mohu")
if searchid="" then searchid=session("searchid")
if searchkey="" then searchkey=session("searchkey")
%>
<HEAD><TITLE>学生信息查询结果</TITLE>
<META http-equiv=Content-Language content=zh-cn>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="images/style.css" type=text/css rel=stylesheet>
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkk()
{
if (document.form1.searchkey.value.length ==0) {
alert("请输入查询关键字!");
return false;
}
document.form1.submit();
}
//-->
</script>
</HEAD>
<BODY bgColor=#2f66bf >
<DIV align=center>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 cellSpacing=0
cellPadding=0 width=763 border=0>
<TBODY>
<TR>
<TD width="100%"><!--#include file="head.asp"--></TD></TR></TBODY></TABLE>
<TABLE dir=ltr cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD vAlign=top>
<DIV align=center>
<TABLE height=830 cellSpacing=0 cellPadding=0 width=763 border=0>
<TBODY>
<TR>
<TD width=763 background=images/head_13.jpg height=15></TD></TR>
<TR>
<TD vAlign=top align=middle width=763
background=images/head_14.jpg height=49>
<TABLE id=AutoNumber3 style="BORDER-COLLAPSE: collapse"
borderColor=#111111 cellSpacing=0 cellPadding=0 width=763
border=0><TBODY>
<TR>
<TD width=11 rowSpan=4> </TD>
<TD width=741></TD>
<TD width=11 rowSpan=4> </TD></TR>
<TR>
<TD width=741></TD></TR>
<TR>
<TD width=741> </TD></TR>
<TR>
<TD width=741></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD width=763 background=images/head_16.jpg height=11></TD></TR>
<TR>
<TD width=763 background=images/head_11.jpg height=726>
<DIV align=center>
<TABLE id=table8 height="101%" cellSpacing=0 cellPadding=0
width="100%" border=0>
<TBODY>
<TR>
<TD vAlign=top align=middle width=187>
<!--#include file ="left.asp"-->
</TD>
<TD vAlign=top>
<TABLE id=table9 height=30 cellSpacing=0 cellPadding=0
width=571 border=0>
<TBODY>
<TR>
<TD width=12 background=images/sousuo_1.jpg> </TD>
<TD width=115 background=images/sousuo_2.jpg>
<TABLE id=table12 height=18 cellSpacing=0 cellPadding=0
width="100%" border=0>
<TBODY>
<TR>
<TD vAlign=top><FONT color=#ffffff><SPAN
style="FONT-SIZE: 12px"> 学 生 搜
索</SPAN></FONT></TD></TR></TBODY></TABLE></TD>
<TD background=images/sousuo_2.jpg> </TD>
<TD vAlign=top width=133
background=images/sousuo_2.jpg>
<FORM style="MARGIN: 0px" name="form1" action="search.asp" method="post">
<TABLE cellSpacing=0 cellPadding=0 width=390 border=0>
<TBODY>
<TR>
<TD width=56></TD>
<TD vAlign=top width=144><SPAN lang=zh-cn>
<SELECT class=smallSel size=1 name="searchid">
<OPTION value="Userid" selected name="typeid">=按登陆学号=</OPTION>
<OPTION value="UserName" name="typeid">=按学生姓名=</OPTION>
<OPTION value="Sex" name="typeid">=按学生性别=</OPTION>
<OPTION value="Birthday" name="typeid">=按出生年月=</OPTION>
<OPTION value="Banji" name="typeid">=按学生班级=</OPTION>
</SELECT></SPAN>
</TD>
<TD vAlign=top width=113>
<input name="searchkey" type="text" onfocus="this.value=''" size="10" maxlength="10" value=关键字>
</TD>
<TD width=77><DIV align=center>
<INPUT type=image src="images/sousuo_4.jpg" border=0 name=Submit value="开始查找" onclick="return checkk();"></DIV></TD></TR></TBODY></TABLE></FORM></TD></TD>
<TD width=15
background=images/sousuo_5.jpg> </TD></TR></TBODY></TABLE>
<TABLE id=table15 height=131 cellSpacing=0 cellPadding=0
width=568 border=0>
<TBODY>
<TR>
<TD width=146 background=images/bjbg_1.jpg height=35>
<TABLE id=table16 height=20 cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD align=middle><FONT style="FONT-SIZE: 12px"
color=#ff0000>学生信息查询结果</FONT></TD></TR></TBODY>
</TABLE></TD>
<TD width=422 height=35><IMG height=35 src="images/bjbg_2.jpg" width=422 border=0></TD></TR>
<TR>
<TD align=middle width=568 background=images/bjbg_3.jpg colSpan=2>
<table id=table28 height=8 align="center" cellSpacing=0 cellPadding=0 width=557 border=0>
<tr><td>
<% select case searchid
case "Userid"
sea="登陆学号"
case "UserName"
sea="学生姓名"
case "Sex"
sea="学生性别"
case "Birthday"
sea="出生年月"
case "Banji"
sea="所在班级"
end select
if searchkey="" then
response.write "<center>对不起,请您输入查询关键字</center>"
response.End
else
if mohu<>1 then
response.write "<center>您查询的条件是:<font color=red>"&sea&" </font>"
else response.write "<center><font color=green>支持模糊查询</font>"
end if
response.write "您查询的关健字是:<font color=red>"&searchkey&" </font></center>"
end if
%>
</td></tr></TABLE>
<%
'开始分页
Const MaxPerPage=10
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
set rs=server.CreateObject("adodb.recordset")
if Mohu<>1 then '//普通查询
select case searchid
case "Userid"
rs.open "select Userid,UserName,Sex,Birthday,Banji from [user] where Userid like '%"&searchkey&"%' ",conn,1,1
case "UserName"
rs.open "select Userid,UserName,Sex,Birthday,Banji from [user] where UserName like '%"&searchkey&"%' ",conn,1,1
case "Sex"
if searchkey="男" then
searchkey ="1"
rs.open "select Userid,UserName,Sex,Birthday,Banji from [user] where Sex like '%"&searchkey&"%' ",conn,1,1
elseif searchkey="女" then
searchkey="0"
rs.open "select Userid,UserName,Sex,Birthday,Banji from [user] where Sex like '%"&searchkey&"%' ",conn,1,1
else response.Write"输入错误!"
response.End()
end if
case "Birthday"
rs.open "select Userid,UserName,Sex,Birthday,Banji from [user] where Birthday like '%"&searchkey&"%' ",conn,1,1
case "Banji"
rs.open "select Userid,UserName,Sex,Birthday,Banji from [user] where Banji like '%"&searchkey&"%' ",conn,1,1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -