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

📄 myhome.asp

📁 个人备忘系统一个不错的备忘软件.专供刚学ASP的人学习. 代码简单易懂 mymanage
💻 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 pagecounts,allcounts
pagecounts=rs.pagecount       '总页数
allcounts=rs.recordcount      '总记录数

if page>pagecounts then page=pagecounts
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;
	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="#8AD4FF">
      <td width="65" height="5"><div align="center" class="style4">姓名</div></td>
      <td width="72" height="5"><div align="center" class="style4">手机</div></td>
      <td width="71" height="5"><div align="center" class="style4">电话</div></td>
      <td width="91" height="5"><div align="center" class="style4">邮箱</div></td>
      <td width="62" height="5"><div align="center" class="style4">QQ号</div></td>
      <td width="129" height="5"><div align="left" class="style4">
        <div align="center">地址</div>
      </div></td>
      <td width="65" height="5"><div align="center" class="style4">生日</div></td>
      <td width="34" height="5"><div align="center" class="style4">组别</div></td>
      <td height="5" colspan="2"><div align="center" class="style4">操作</div></td>
    </tr>
	<%
          dim i
        i=1
	 do 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="deltel.asp?id=<%=rs("姓名")%>"><img src="images/a_delete.gif" width="52" height="16" border="0"></a></td>
    </tr>
	
	<%
       i=i+1
	rs.movenext
	loop
	%>
  </table>
<table width="700" border="0" align="center">
    <tr>
      <td height="18" align="center"><a href="myhome.asp" class="style2 style7">第一页</a></span>
          <a href="myhome.asp?page=<%=page-1%>" class="style2 style7">上一页</a>&nbsp;<a href="myhome.asp?page=<%=page+1%>" class="style2 style7">下一页</a> <a href="myhome.asp?page=<%=pagecounts%>" class="style2 style7">最后一页</a> <span class="style2 style7">共有
          <% =allcounts%>
          条记录,分为<%=pagecounts %>页
      </span></span></td>
    </tr>
  </table>
  <p>&nbsp;</p>
</form>
<%
rs.close
conn.closeset rs=nothing
set conn=nothing
%>
</body>
</html>

⌨️ 快捷键说明

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