📄 myfriend.asp
字号:
<!--#include file="conn.asp"-->
<%
if session("user")="" or session("group")="" then
response.write("<script>alert('您还没有登陆或登陆超时');window.location.href('index.asp')</script>")
response.end
end if
%>
<%
dim page
page=cint(request.querystring("page"))
if page<1 then
page=1
end if
%>
<%
set rs=server.CreateObject("adodb.recordset")
nam=request.Form("name")
tel=request.Form("tel")
pho=request.Form("pho")
qq=request.Form("QQ")
cmd="select * from tel where 姓名 like '%"&nam&"%' and 手机 like '%"&tel&"%'and 电话 like '%"&pho&"%' and QQ like '%"&qq&"%' and 组别='朋友'"
rs.open cmd,conn,1,1
if rs.eof then
response.write("<script>alert('无任何记录!');window.location.href('addtel.asp')</script>")
response.end
else
rs.pagesize=8
dim pgcount,rcount
pgcount=rs.pagecount
rcount=rs.recordcount
if page>pgcount then page=pgcount
rs.absolutepage=page
end if
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
font-size: 12px;
color: #FFFFFF;
}
.style4 {font-size: 12px}
.style7 {color: #6699CC}
.style9 {color: #6699CC; font-size: 12px; }
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="700" border="0" align="center" bordercolor="#6699CC" bgcolor="#6699CC">
<tr bgcolor="#6699CC">
<th height="3" colspan="4"><div align="left" class="style1">我的通讯录查询</div></th>
</tr>
<tr bgcolor="#FFFFFF">
<td width="96"><div align="center"><span class="style4">姓名</span></div></td>
<td width="216"><label>
<input name="name" type="text" id="name">
</label></td>
<td width="69"><div align="center"><span class="style4">电话</span></div></td>
<td width="301"><label>
<input name="pho" type="text" id="pho">
</label></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><div align="center"><span class="style4">手机</span></div></td>
<td><input name="tel" type="text" id="tel"></td>
<td><div align="center"><span class="style4">QQ</span></div></td>
<td><input type="text" name="textfield4"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="4"><label>
<div align="center">
<input name="Submit" type="submit" class="style4" value=" 立即搜索 ">
</div>
</label></td>
</tr>
</table>
<table width="700" border="0" align="center" bgcolor="#6699CC">
<tr bgcolor="#6699CC">
<td width="65" height="5" bgcolor="#A3B2CC"><div align="center" class="style4">姓名</div></td>
<td width="72" height="5" bgcolor="#B5C1D6"><div align="center" class="style4">手机</div></td>
<td width="71" height="5" bgcolor="#B5C1D6"><div align="center" class="style4">电话</div></td>
<td width="91" height="5" bgcolor="#B5C1D6"><div align="center" class="style4">邮箱</div></td>
<td width="62" height="5" bgcolor="#B5C1D6"><div align="center" class="style4">QQ号</div></td>
<td width="129" height="5" bgcolor="#B5C1D6"><div align="left" class="style4">
<div align="center">地址</div>
</div></td>
<td width="65" height="5" bgcolor="#B5C1D6"><div align="center" class="style4">生日</div></td>
<td width="34" height="5" bgcolor="#B5C1D6"><div align="center" class="style4">组别</div></td>
<td height="5" colspan="2" bgcolor="#B5C1D6"><div align="center" class="style4">操作</div></td>
</tr>
<%
dim i
i=1
while not rs.eof and i<9
%>
<tr bgcolor="#FFFFFF">
<td height="5"><div align="center" class="style4"><% =rs("姓名")%></div></td>
<td height="5"><div align="center" class="style4">
<%
if rs("手机")="" then
response.write "未登记"
else
response.write rs("手机")
end if
%>
</div></td>
<td height="5"><div align="center" class="style4">
<%
if rs("电话")="" then
response.write "未登记"
else
response.write rs("电话")
end if
%>
</div></td>
<td height="5"><div align="center" class="style4">
<%
if rs("email")="" then
response.write "未登记"
else
response.write rs("Email")
end if
%>
</div></td>
<td height="5"><div align="center" class="style4">
<%
if rs("qq")="" then
response.write "未登记"
else
response.write rs("qq")
end if
%>
</div></td>
<td height="5"><div align="center" class="style4">
<%
if rs("地址")="" then
response.write "未登记"
else
response.write rs("地址")
end if
%>
</div></td>
<td height="5"><div align="center" class="style4">
<%
if rs("生日")="" then
response.write "未登记"
else
response.write rs("生日")
end if
%>
</div></td>
<td height="5"><div align="center" class="style4">
<% =rs("组别") %>
</div></td>
<td width="29" height="5"><a href="edttel.asp?id=<%=rs("姓名")%>"><img src="images/edit.gif" width="47" height="18" border="0"></a></td>
<td width="40" height="5"><a href="deltel1.asp?id=<%=rs("姓名")%>"><img src="images/a_delete.gif" width="52" height="16" border="0"></a></td>
</tr>
<%
i=i+1
rs.movenext
wend
%>
</table>
<table width="700" border="0" align="center">
<tr>
<td height="18" align="center"><span class="style9"><a href="myfriend.asp" class="style2 style7">第一页</a></span></span>
<a href="myfriend.asp?page=<%=page-1%>" class="style2 style7 style4">上一页</a> <a href="myfriend.asp?page=<%=page+1%>" class="style2 style7 style4">下一页</a> <a href="myfriend.asp?page=<%=pgcount%>" class="style2 style7 style4">最后一页</a> <span class="style2 style7 style4">共有
<% =rcount%>
条记录,分为<%=pgcount %>页
</span><span class="style4"></span></span></td>
</tr>
</table>
<p> </p>
</form>
</body>
</html>
<%
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -