⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 searchuseract.asp

📁 大家好
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<%
response.buffer=true

if isempty(request("page")) then
  page=1
else
  page=request("page")
end if

set conn=server.createObject("ADODB.Connection")
	dbpath=server.mappath("club.mdb")
	conn.open "driver={Microsoft Access Driver (*.mdb)};dbq="&dbpath
	set rs=server.createobject("ADODB.Recordset")


    if session("sql")="" then
    sql="select username,sex,born,lives,city from user_info"

 	if request("username")<>"" then
    	sql=sql & " where username like '%" & request("username") &"%' "
  	end if
	if request("sex")="先生" then
    	sql=sql & " and sex='先生'"
  	elseif request("sex")="女士" then
   		sql=sql & " and sex='女士'"
  	end if

	if request("born")<>"" then
   	born=request("born")
   	if request("b1")="0" then
    	sql=sql&" and cdate(born)>'"&cdate(born)&"' and not isnull(born) "
   	elseif request("b1")="1" then
    		sql=sql&" and cdate(born)='"&cdate(born)&"' and not isnull(born) "
   		else
    		sql=sql&" and cdate(born)<'"&cdate(born)&"' and not isnull(born) "
  		end if
  	end if
  
 	if request("city")<>"" then
   		sql=sql & " and city='"&request("city")&"' "
 	end if
	if request("lives")="1" then
		sql=sql&" order by lives"
	else
		sql=sql&" order by lives desc"
	end if
	session("sql")=sql
else
	sql=session("sql")
end if


rs.pagesize=30
    rs.open sql,conn,3
if rs.bof and rs.eof then
  	response.write "没找到!<a href='searchuser.asp'>按此返回!</a>"
  	rs.close
  	conn.close
  	set rs=nothing
  	set conn=nothing
  	response.end
else
   rs.absolutepage=page
%>
<html>

<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="club.css">
<script language="javascript">
function check(page)
{
//	alert("mjj"+page+"!");
//	alert(document.forms[0].page.value);
	if(document.forms[0].page.value>page)
	{
	alert("没有此页!请睁开眼睛看一看共几页!\n\n然后再决定跳转的页数!")
	document.forms[0].page.focus();
	return false;
	}
	if(document.forms[1].page.value>page)
	{
	alert("没有此页!请睁开眼睛看一看共几页!\n\n然后再决定跳转的页数!")
	document.forms[1].page.focus();
	return false;
	}
return true;
}
</script>
<style type="text/css">
<!--
.botton {  font-size: 12pt; color: #000000; background-color: #FFFFF8}
-->
</style>
</head>

<body bgcolor="#FFF3D9">
<p align="center">网友查询结果

<form method="POST" action="searchuseract.asp" onsubmit="return check(<%=rs.pagecount%>)">
  <input type="hidden" name="boardid" value="<% =boardid %>"><table border="1"
  borderColorDark="#FFFFFF" borderColorLight="#000000" cellspacing="0" height="22"
  width="87%" align="center">
    <tr bgcolor="#FFEBAD">
      <td height="1" width="691">〖<a href="searchuser.asp">继续查询</a>〗  
<%                                                           
if rs.pagecount>1 then
	if page=1 then
    	Response.Write "<a href='searchuseract.asp?page="&page+1&"'>后页</a> <a href='searchuseract.asp?page="&rs.PageCount &"'>末页</a>"
	end if
	if rs.PageCount=cint(Page) then
    	Response.Write "〖<a href='searchuseract.asp?page=1'>首页</a>〗 〖<a href='searchuseract.asp?page="&page-1&"'>前页</a>〗"
	end if
	if page>1 and page<rs.pagecount then
    	Response.Write "〖<a href='searchuseract.asp?page=1'>首页</a>〗 〖<a href='searchuseract.asp?page="&page-1&"'>前页</a>〗 〖<a href='searchuseract.asp?page="&page+1&"'>后页</a>〗 〖<a href='searchuseract.asp?page="&rs.PageCount&"'>末页</a>〗"
	end if
end if
%>
<%response.write "页次:"&Page&"/"&rs.pagecount&"页! 共 〖"&rs.RecordCount&"〗 条记录 第"%>
        <input type="text" name="page" value="<%=page%>" class="botton" size="2">
         页 
        <input type="submit" value="go" name="B1" class="botton"> 
      </td>
    </tr>
  </table>
</form>

<table width="87%" border="1" align="center" bordercolorlight="#333333"
bordercolordark="#FFFFFF" cellpadding="4" cellspacing="0">
  <tr bgcolor="#D1D3FE">
    <td width="19%" align="center">昵称</td>
    <td width="16%" align="center">性别 </td>
    <td width="19%" align="center">出生 </td>
    <td width="21%" align="center">来自 </td>
    <td width="8%" align="center">积分 </td>
    <td width="17%" align="center">详细资料 </td>
  </tr>
<%for i=1 to 30%>
  <tr bgcolor="#E2E4FE">
    <td width="19%" height="20"><a href="Sendmesg.asp?geter=<%=rs("username")%>"><%=rs("username")%>
</a></td>
    <td width="16%" height="20"><%=rs("sex")%>
</td>
    <td width="19%" height="20"><%
if isnull(rs("born")) then
	response.write "没提供!"
else
	response.write rs("born")
end if
%></td>
    <td width="21%" height="20"><%=rs("city")%></td>
    <td width="8%" height="20"><%=rs("lives")%></td>
    <td width="17%" height="20"><a href="userdet.asp?username=<%=rs("username")%>">详细资料</a></td></tr>
<%
	rs.movenext
	if rs.eof then
		exit for
	end if
  	next
%>
</table>

<form method="POST" action="searchuseract.asp" onsubmit="return check(<%=rs.pagecount%>)">
  <input type="hidden" name="boardid" value="<% =boardid %>"><table border="1"
  borderColorDark="#FFFFFF" borderColorLight="#000000" cellspacing="0" height="22"
  width="87%" align="center">
    <tr bgcolor="#FFEBAD">
      <td height="1" width="691">
〖<a href="searchuser.asp">继续查询</a>〗  
<%                                                           
if rs.pagecount>1 then
	if page=1 then
    	Response.Write "<a href='searchuseract.asp?page="&page+1&"'>后页</a> <a href='searchuseract.asp?page="&rs.PageCount &"'>末页</a>"
	end if
	if rs.PageCount=cint(Page) then
    	Response.Write "〖<a href='searchuseract.asp?page=1'>首页</a>〗 〖<a href='searchuseract.asp?page="&page-1&"'>前页</a>〗"
	end if
	if page>1 and page<rs.pagecount then
    	Response.Write "〖<a href='searchuseract.asp?page=1'>首页</a>〗 〖<a href='searchuseract.asp?page="&page-1&"'>前页</a>〗 〖<a href='searchuseract.asp?page="&page+1&"'>后页</a>〗 〖<a href='searchuseract.asp?page="&rs.PageCount&"'>末页</a>〗"
	end if
end if
%>
<%response.write "页次:"&Page&"/"&rs.pagecount&"页! 共 〖"&rs.RecordCount&"〗 条记录 第"%> 
        <input type="text" name="page" value="<%=page%>" class="botton" size="2">
         页 
        <input type="submit" value="go" name="B1" class="botton">
      </td>
    </tr>
  </table>
</form>
</body>
</html>
<%
  rs.close
  conn.close
  set rs=nothing
  set conn=nothing
  end if
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -