level 1
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="conn.asp"-->
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
</head>
<body>
<form action="chaxun.asp" name="form" method="post">
<table border="1" cellspacing="1" cellpadding="1" width=90%>
<tr>
<input type="button" value="新建" onclick ="window.location.href='tianjia.asp'" />
</tr>
</table>
<table border="1" cellspacing="1" cellpadding="1" width=90%>
<tr border ="1" cellspacing="1" cellpadding="1" >
<td width="5%" align="center">检索:</td>
<td height="24%" width="20%">姓名:<input type="text" name="namee" size=24 /> </td>
<td width="20%">婚姻状况:<input type="text" name="jiehunn">
</td>
<td width="20%"> 政治面貌:<input type="text" name="zhengzhii">
</td>
<td width="20%"> <input type="submit" value="查询" /></td>
</td>
</tr>
</table>
<br/>
<table border="1" cellspacing="1" cellpadding="1" width=90%>
<tr>
<td align="center">姓名</td>
<td align="center">民族</td>
<td align="center">性别</td>
<td align="center">出生日期</td>
<td align="center">身份证号</td>
<td align="center">健康状况</td>
<td align="center">婚姻状况</td>
<td align="center">政治面貌</td>
<td align="center">入党(团)时间</td>
<td align="center">操作</td>
</tr>
<%
Set rs=Server.CreateObject("ADODB.Recordset") //创建记录集
sql="select * from renyuan " //查看人员表
'response.write(sql)
rs.PageSize=5
rs.CursorLocation=3
rs.open sql,Conn,1,1
pre=true
last=true
page = trim(Request.QueryString("page"))
if len(page)=0 then
intpage=1
pre=false
Else
if cint(page)<=1 then
intpage=1
pre=false
Else
if cint(page)=rs.PageCount Then
intpage=rs.PageCount
last=false
Else
intpage=Cint(page)
end if
end if
end if
if not rs.eof then
rs.AbsolutePage=intpage
End if
count=rs.PageSize
do while not rs.EOF and count>0
%>
<tr>
<td align="center" > <a href="chakan.asp?id=<%=rs("id")%>"><%=rs("name")%></a></td>
<td align="center"><%=rs("minzu")%></td>
<td align="center"><%=rs("sex")%></td>
<td align="center"><%=rs("borntime")%></td>
<td align="center"><%=rs("idard")%></td>
<td align="center"><%=rs("health")%></td>
<td align="center"><%=rs("jiehun")%></td>
<td align="center"><%=rs("zhengzhi")%></td>
<td align="center"><%=rs("rudangtime")%></td>
<td><a href="shanchu.asp?id=<%=rs("id")%>">删除</a></td>
</tr>
<%
rs.movenext
count=count-1
loop
%>
<tr>
<% if rs.pagecount >0 Then%>
<td colspan="10"align="center">
第<font color="red"><% =intpage%></font>页 共<%=rs.Recordcount%>条
每页<%=rs.PageSize%>条
<%
Else Response.Write("没有数据")
%>
<td width="36%" align="left">当前页0/0</td>
<%End if%>
<a href="main.asp?page=1">首页</a>
<% if pre then%>
<a href="main.asp?page=<%=intpage-1%>">上页</a>
<%end if%>
<% if last then%>
<a href="main.asp?page=<%=intpage+1%>">下页</a>
<%end if%>
<a href="main.asp?page=<%=rs.PageCount%>">尾页</a>
</td>
</tr>
<%
rs.close '关闭记录集
Set rs=nothing '释放内存中记录及rs所占的资源
conn.close '关闭数据库连接
Set con=nothing '释放内存中Connect对象con所占的资源
%>
</form>
</body>
</html>
2017年03月21日 07点03分
