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

📄 mbseek_result.asp

📁 一个超级漂亮的班级主页asp代码
💻 ASP
字号:
<!--插入html头部分以及数据库接口-->
<!--#include file="in_conn.asp"-->


<body>
<!--插入网站置顶-->
<% if u_name="" then
	Response.Redirect "log_err.asp"
else
%>
<!--#include file="in_topmb.asp"-->
<% end if %>

<%
'判断用户权限
IF u_power=0 THEN
	Response.Redirect "resp.asp?cmd=id_wait"
END IF

dim sqlseek_mb,seek_mb

sqlseek_mb=""
seek_mb=""
IF Trim(Cstr(Request.QueryString("seekowner")))<>"" THEN
	seek_mb=Trim(Cstr(Request.QueryString("seekowner")))
	sqlseek_mb="WHERE name LIKE '%"&stryin(seek_mb)&"%'"
ELSEIF Trim(Cstr(Request.Form("txtowner")))="" THEN
	Response.Redirect("resp.asp?cmd=seeknotkey")
ELSE
	seek_mb=Trim(Cstr(Request.Form("txtowner")))
	sqlseek_mb="WHERE name LIKE '%"&stryin(seek_mb)&"%'"
END IF
%>

<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" class="rdbar"><tr>
	<td width="48%" height="100%">
		&nbsp;<a href="index.asp">[首页]</a>-<a href="txbook.asp">[通 讯 簿]</a>-<font class="ft1">[搜索成员][结果]</font>
	</td>
	<td align="right">
		<a href="mbseek.asp"><img src="img/seek.gif" border="0" hspace="0" vspace="0" align="absmiddle"></a>&nbsp;
	</td>
</tr></table>

<%
'分页的统计
dim rdcount,pgcount,pgsize
pgsize=15
rdcount=conn.Execute("SELECT COUNT(ID) FROM tblmates "&sqlseek_mb,0,1)(0)
pgcount=Abs(Int(rdcount/pgsize*(-1)))

'获取传值
dim curpage
curpage=Request.QueryString("page")

IF isNumeric(Request.QueryString("page")) THEN
	curpage=CLng(curpage)
	if curpage<1 OR curpage>pgcount then
		curpage=1
	end if
ELSE
	curpage=1
END IF

%>

<%
dim colnum,colmid,pg_i
'定义显示快捷页个数
colnum=5
colmid=colnum\2
'生成快捷页的函数
Sub PageQuick()
%>

<% if rdcount>0 then %>
<a href="mbseek_result.asp?seekowner=<% =seek_mb %>&page=1"><font face="webdings" title="头页">9</font></a>
<% else %>
<font face="webdings" title="头页">9</font>
<% end if %>

<% If curpage>1 Then %>
<a href="mbseek_result.asp?seekowner=<% =seek_mb %>&page=<% =curpage-1 %>"><font face="webdings" title="上页">7</font></a>
<% Else %>
<font face="webdings" title="上页">7</font>
<% End if %>

<%
'前省略号的使用
if pgcount>colnum AND curpage-colmid>1 then
	Response.Write "…"
end if

IF pgcount<colnum THEN
	for pg_i=1 to pgcount
		if pg_i<>curpage then
			response.write "<a href=mbseek_result.asp?seekowner="&seek_mb&"&page="&pg_i&">["&pg_i&"]</a>"
		else
			response.Write "["&pg_i&"]"
		end if
	next
ELSEIF curpage-1>=colmid AND pgcount-curpage>=colmid THEN
	for pg_i=curpage-colmid to curpage+colmid
		if pg_i<>curpage then
			response.write "<a href=mbseek_result.asp?seekowner="&seek_mb&"&page="&pg_i&">["&pg_i&"]</a>"
		else
			response.Write "["&pg_i&"]"
		end if
	next
ELSEIF curpage-1>=colmid AND pgcount-curpage<colmid THEN
	for pg_i=pgcount-colnum+1 to pgcount
		if pg_i<>curpage then
			response.write "<a href=mbseek_result.asp?seekowner="&seek_mb&"&page="&pg_i&">["&pg_i&"]</a>"
		else
			response.Write "["&pg_i&"]"
		end if
	next
ELSE
	for pg_i=1 to 5
		if pg_i<>curpage then
			response.write "<a href=mbseek_result.asp?seekowner="&seek_mb&"&page="&pg_i&">["&pg_i&"]</a>"
		else
			response.Write "["&pg_i&"]"
		end if
	next
END IF

'后省略号的使用
if pgcount>colnum AND curpage+colmid<pgcount then
	Response.Write "…"
end if
%>

<% If curpage<pgcount Then %>
<a href="mbseek_result.asp?seekowner=<% =seek_mb %>&page=<% =curpage+1 %>"><font face="webdings" title="下页">8</font></a>
<% Else %>
<font face="webdings" title="下页">8</font>
<% End if %>

<% if rdcount>0 then %>
<a href="mbseek_result.asp?seekowner=<% =seek_mb %>&page=<% =pgcount %>"><font face="webdings" title="尾页">:</font></a>
<% else %>
<font face="webdings" title="尾页">:</font>
<% end if %>

&nbsp;搜索到<font color="<% =cohover %>"><% =rdcount %></font>位同学&nbsp;分为<font color="<% =cohover %>"><% =pgcount %></font>页&nbsp;每页<font color="<% =cohover %>"><% =pgsize %></font>位&nbsp;第<font color="<% =cohover %>"><% =curpage %></font>页&nbsp;
<%
End Sub
%>

<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" style="background-color:<% =bg3 %>;">
	<tr>
		<td width="120" height="100%">&nbsp;
			
		</td>
		<td align="right">
			<% call PageQuick() %>
		</td>
	</tr>
</table>

<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0">
<tr><td width="100%" height="25">
	<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" class="rdbar">
	<tr>
		<th width="140" height="100%" class="rdr">
			名 字
		</th>
		<th width="110" class="rdr" style="background:<% =bg1 %>">
			<img src="img/icn_qq.gif" border="0" align="absmiddle">QQ号
		</th>
		<th width="120" class="rdr">
			<img src="img/icn_mob.gif" border="0" align="absmiddle">手 机
		</th>
		<th width="120" class="rdr" style="background:<% =bg1 %>">
			<img src="img/icn_sch.gif" border="0" align="absmiddle">单位/学校
		</th>
		<th width="90" class="rdr">
			加入日期
		</th>
		<th style="background:<% =bg1 %>">
			最近登录
		</th>
	</tr>
	</table>
</td></tr>

<%
IF rdcount<1 THEN
%>
<tr><th width="100%" class="rdkuang">
<font class="ft1">抱歉,[通 讯 簿]没有该成员信息!</font>
<br><a href="mbseek.asp">[继续搜索]</a>&nbsp;
</th></tr>

<%
ELSE

sqlstr="SELECT ID,name,sex,power,regdate,lastlog,qq,mobile,nowdo FROM tblmates "&sqlseek_mb&" ORDER BY power DESC,ID"
rs.open sqlstr,conn,1,1

'给分页所需的中间变量赋值
rs.PageSize=pgsize

'当前页转到指定的页码
	rs.AbsolutePage=curpage

'开始读取数据
dim icn_sex,aqq,qmob,ado,await
FOR i=1 to pgsize
		If rs.eof Then
			EXIT FOR
		End If

		'判断身份或者性别
		IF rs("power")>1 THEN
				icn_sex="img/icn_adm1.gif"
		ELSEIF rs("sex")=True THEN
				icn_sex="img/icn_gg.gif"
		ELSE
				icn_sex="img/icn_mm.gif"
		END IF

		'总管判断
		IF rs("name")=DEF_sysadm THEN
			icn_sex="img/icn_admsys.gif"
		END IF

		if rs("power")=0 then
			await="<br>[身份待审]"
		elseif rs("power")=-1 then
			await="<br>[封禁之中]"
		else 
			await=""
		end if
		
		if rs("qq")="" then
			aqq="无"
		else
			aqq="<font class='ft1'>"&unhtml(rs("qq"))&"</font>"
		end if

		if rs("mobile")="" then
			amob="无"
		else
			amob="<font color='"&colight&"'>"&unhtml(rs("mobile"))&"</font>"
		end if

		if rs("nowdo")="" then
			ado="无"
		else
			ado="<font color='#D2691E'>"&unhtml(rs("nowdo"))&"</font>"
		end if
%>

<tr><td width="100%" height="42">
	<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" class="rde">
	<tr>
		<td align="center" width="140" height="100%" class="rdr">
			<img src="<% =icn_sex %>" border="0" align="absmiddle">
			<a href="viewinfo.asp?id=<% =rs("ID") %>" title="点击查看该同学详细资料"><% =rs("name") %></a><% =await %>
		</td>
		<td align="center" width="110" class="rdr" style="background:<% =bg3 %>">
			<% =aqq %>
		</td>
		<td align="center" width="120" class="rdr">
			<% =amob %>
		</td>
		<td align="center" width="120" class="rdr" style="background:<% =bg3 %>">
			<% =ado %>
		</td>
		<td align="center" width="90" class="rdr">
			<% =FormatDateTime(rs("regdate"),2) %>
		</td>
		<td align="center" style="background:<% =bg3 %>">
			<% =FormatDateTime(rs("lastlog"),2) %><br><% =FormatDateTime(rs("lastlog"),4) %>
		</td>
	</tr>
	</table>
</td></tr>

<%
		rs.MoveNext
Next
rs.close

END IF
%>
</table>

<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" style="background-color:<% =bg3 %>;">
	<tr>
		<td width="120" height="100%">&nbsp;
			
		</td>
		<td align="right">
			<% call PageQuick() %>
		</td>
	</tr>
</table>


<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" style="background-color:<% =bg2 %>;">
	<tr>
		<td align="center" width="100%" height="100%">
		<img src="img/icn_admsys.gif" align="absmiddle" vspace="0" hspace="0" border="0">&nbsp;班级总管
		&nbsp;&nbsp;|&nbsp;&nbsp;
		<img src="img/icn_adm1.gif" align="absmiddle" vspace="0" hspace="0" border="0">&nbsp;班级管理员
		</td>
	</tr>
</table>


<!--插入在线统计-->
<!--#include file="in_online.asp"-->
<!--插入网站置底-->
<!--#include file="in_bottom.asp"-->
</body>

</html>

⌨️ 快捷键说明

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