📄 cxchuli.asp
字号:
<!-- #include file="conn.asp"-->
<%
name=trim(request("name"))
age=request("age")
zhiwu=request("zhiwu")
sex=request("sex")
bumen=request("bumen")
'response.Write(name & age & zhiwu & sex & bumen & "<br>")
sqlstr="select * from 用户表 where "
if name<>"" then
sqlstr=sqlstr & "用户名 like '%"&name&"'"
flag=true
end if
if age<>"" then
if flag=true then
sqlstr=sqlstr & " and " & "年龄 between " & age
flag=true
else
sqlstr=sqlstr & " 年龄 between " & age
flag=true
end if
end if
if zhiwu<>"" then
if flag=true then
sqlstr=sqlstr & " and " & "职务='" & zhiwu & "'"
flag=true
else
sqlstr=sqlstr & " 职务='" & zhiwu & "'"
flag=true
end if
end if
if sex<>"" then
if flag=true then
sqlstr=sqlstr & " and " & "性别='" & sex & "'"
flag=true
else
sqlstr=sqlstr & " 性别='" & sex & "'"
flag=true
end if
end if
if bumen<>"" then
if flag=true then
sqlstr=sqlstr & " and " & "所属部门='" & bumen & "'"
flag=true
else
sqlstr=sqlstr & " 所属部门='" & bumen & "'"
flag=true
end if
end if
'response.write(sqlstr)
%>
<html>
<head>
<title>查询用户信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css">
<!--
body,td,th {
font-size: 9pt;
}
body {
background-image: url(image/bg.gif);
}
a:link {
color: #00FF00;
}
a:visited {
color: #FFFF00;
}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>
</head>
<body>
<div align="center">
<%
my_rs.open sqlstr,my_Conn,1,3
if my_rs.eof and my_rs.bof then
response.Write("<font color=red size=5>未找到符合你的要求的结果!</font>")
else
%>
<table width="95%" border="1" bordercolor="#FF0000" bgcolor="#00FF00">
<tr>
<td width="30" align="center">姓名</td>
<td width="30" align="center">性别</td>
<td width="30" align="center">年龄</td>
<td width="30" align="center">职务</td>
<td width="60" align="center">所属部门</td>
<td width="80" align="center">电子邮件</td>
<td width="60" align="center">联系电话</td>
<td align="center">住址</td>
</tr>
<%
'分页技术
if not isempty(request("page")) then
pagecount=cint(request("page"))
else
pagecount=1
end if
my_rs.pagesize=3
my_rs.absolutepage=pagecount
for i=1 to my_rs.pagesize
If my_rs.EOF or my_rs.bof Then
Exit For
'response.Write("<font color=red size=5>未找到符合你的要求的结果!</font>")
end if
'if not my_rs.eof then
'do while not my_rs.eof%>
<tr>
<td><%=my_rs("用户名")%> </td>
<td><%=my_rs("性别")%> </td>
<td><%=my_rs("年龄")%> </td>
<td><%=my_rs("职务")%> </td>
<td><%=my_rs("所属部门")%> </td>
<td><%=my_rs("电子邮件")%> </td>
<td><%=my_rs("联系电话")%> </td>
<td><%=my_rs("住址")%> </td>
</tr>
<%
'response.Write(my_rs("用户名") & my_rs("年龄") & my_rs("性别") & my_rs("职务") & my_rs("所属部门") & "<br>")
my_rs.movenext
next
'loop
'else response.Write("<font color=red size=5>未找到符合你的要求的结果!</font>")
'end if
%>
</table>
<div align=right class="STYLE4">
<%
if my_rs.PageCount>1 Then
If pagecount<>1 Then
%>
<A HREF='cxchuli.asp?name=<%=name%>&age=<%=age%>&zhiwu=<%=zhiwu%>&sex=<%=sex%>&bumen=<%=bumen%>&Page=1'>首页</A>
<A HREF='cxchuli.asp?name=<%=name%>&age=<%=age%>&zhiwu=<%=zhiwu%>&sex=<%=sex%>&bumen=<%=bumen%>&Page=<%=pagecount-1%>'>前页</A>
<%
End If
If pagecount<>my_rs.PageCount Then
%>
<A HREF='cxchuli.asp?name=<%=name%>&age=<%=age%>&zhiwu=<%=zhiwu%>&sex=<%=sex%>&bumen=<%=bumen%>&Page=<%=pagecount+1%>'>后页</A>
<A HREF='cxchuli.asp?name=<%=name%>&age=<%=age%>&zhiwu=<%=zhiwu%>&sex=<%=sex%>&bumen=<%=bumen%>&Page=<%=my_rs.PageCount%>'>尾页</A>
<%
End If
end if
my_rs.close
%>
</div>
<%end if%>
<form name="form1" method="post" action="">
<label> </label>
<label>
<input name="Submit3" type="button" onClick="MM_callJS('history.back()')" value="返回">
</label>
<label>
<input name="Submit" type="submit" onClick="MM_callJS('self.close()')" value="关闭窗口">
</label>
</form>
<p> </p>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -