📄 searchchildren.asp
字号:
<% @language=vbscript%>
<!--#include file="conn.asp"-->
<%
log_name=Request.Cookies("name") '读cookie
if log_name="" then
error_str="你还没登录!"
conn.close
Response.write error_str
Response.End
end if
%>
<%
if Request("idindex")=""then
if (Request("class")="" or Request("key")="" or Request("class")="0") then
response.write"<SCRIPT language=JavaScript>alert('注意: 请正确选择搜索分类,且确保输入的关键字正确 !');</SCRIPT>"
conn.close
set conn=nothing
Response.End
end if
end if
idindex=trim(Request("idindex"))
c_class=trim(Request("class"))
Response.Cookies("class")=c_class
key_word=trim(Request("key"))
if idindex="yes" then
key_word=Request("id")
disp_class="按ID"
sql="select * from children where c_masid="&key_word
end if
key_word=replace(key_word,"'","''")
set rs=Server.CreateObject("ADODB.recordset")
if Request("idindex")<>"yes" then
select case c_class
case 1
disp_class="按姓名"
sql="select * from children where c_name Like '%"&key_word&"%'"
case 2
disp_class="按身份证号"
sql="select * from children where c_id Like '%"&key_word&"%'"
case 3
disp_class="按性别"
sql="select * from children where c_sex Like '%"&key_word&"%'"
case 4
disp_class="按出生"
sql="select * from children where c_born Like '%"&key_word&"%'"
case 5
disp_class="按民族"
sql="select * from children where c_nation Like '%"&key_word&"%'"
case 6
disp_class="按籍贯"
sql="select * from children where c_home Like '%"&key_word&"%'"
case 7
disp_class="按文化程度"
sql="select * from children where c_level Like '%"&key_word&"%'"
case 8
disp_class="婚姻状况"
sql="select * from children where c_double Like '%"&key_word&"%'"
end select
end if
rs.PageSize=1 '设定rs分页参数,最好在此处设定
rs.OPEN sql,Conn,1,1 '必须用此方式打开记录
if not rs.EOF then
'////////////////////////////////////////////////////////////////////////////////////////////////////
page=trim(Request("page")) '接受分页参数page,
if not isnumeric(page) then page=1 end if 'page不为数字时的处理
if page="" then page=1 end if 'page为空时的处理
page=cint(page) '转化
if page<1 then page=1 end if 'page为<1时的处理
if page>rs.PageCount then page=rs.PageCount end if 'page为>总分页数的处理
rs.AbsolutePage=page
%>
<html>
<head>
<title>户口管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p> </p>
<hr width="90%">
<div align="center">你的搜索类别是:【<%=disp_class%>】输入关键字是:【<%=key_word%>】<br>
</div>
<hr width="90%">
<div align="center">共找到 <%=rs.RecordCount%> 条符合条件的记录 <a href=searchmaster.asp?id=<%=rs.Fields("c_masid")%>&idindex=yes target=_blank>查看其父母信息</a><br>
</div>
<%
i=0
do while not rs.eof
i=i+1
if i="2" then exit do
%>
<table width="720" border="1" height="628" align="center">
<tr>
<td width="98" height="54">
<div align="right"></div>
</td>
<td width="546" height="54">
<div align="center"> 子女信息</div>
</td>
</tr>
<tr>
<td width="98" height="54">
<div align="right">姓名:</div>
</td>
<td width="546" height="54">
<div align="center">
<%=rs.Fields("c_name")%>
</div>
</td>
</tr>
<tr>
<td width="98" height="52">
<div align="right">性别:</div>
</td>
<td width="546" height="52">
<div align="center"> <%=rs.Fields("c_sex")%>
</div>
</td>
</tr>
<tr>
<td width="98" height="51">
<div align="right">出生年月:</div>
</td>
<td width="546" height="51">
<div align="center"> <%=rs.Fields("c_born")%>
</div>
</td>
</tr>
<tr>
<td width="98" height="55">
<div align="right">民族:</div>
</td>
<td width="546" height="55">
<div align="center"> <%=rs.Fields("c_nation")%>
</div>
</td>
</tr>
<tr>
<td width="98" height="71">
<div align="right">籍贯:</div>
</td>
<td width="546" height="71">
<div align="center"> <%=rs.Fields("c_home")%>
</div>
</td>
</tr>
<tr>
<td width="98" height="55">
<div align="right">文化程度:</div>
</td>
<td width="546" height="55">
<div align="center"><%=rs.Fields("c_level")%>
</div>
</td>
</tr>
<tr>
<td width="98" height="55">
<div align="right">职业:</div>
</td>
<td width="546" height="55">
<div align="center"> <%=rs.Fields("c_work")%>
</div>
</td>
</tr>
<tr>
<td width="98" height="56">
<div align="right">身份证号:</div>
</td>
<td width="546" height="56">
<div align="center"> <%=rs.Fields("c_id")%>
</div>
</td>
</tr>
<tr>
<td width="98" height="62">
<div align="right">联系方式:</div>
</td>
<td width="546" height="62">
<div align="center"><%=rs.Fields("c_link")%>
</div>
</td>
</tr>
<tr>
<td width="98" height="62">
<div align="right">工作单位:</div>
</td>
<td width="546" height="62">
<div align="center"><%=rs.Fields("c_unit")%>
</div>
</td>
</tr>
</table>
<%
rs.movenext
loop
%>
<form name="form1" method="post" action="searchchildren.asp?class=<%=c_class%>&key=<%=key_word%>&idindex=<%=idindex%>&id=<%=key_word%> ">
<p align="center">共<font color=#000000> <%=rs.RecordCount%> </font>条 | 分<font color=#000000> <%=rs.PageCount%> </font>页 | 第<font color=#000000> <%=page%> </font>个 |
<a href=searchchildren.asp?page=<%=page-1%>&class=<%=c_class%>&key=<%=key_word%>&idindex=<%=idindex%>&id=<%=key_word%> >上一个</a> | <a href=searchchildren.asp?page=<%=page+1%>&class=<%=c_class%>&key=<%=key_word%>&idindex=<%=idindex%>&id=<%=key_word%> >下一个</a> |
<a href=searchchildren.asp?page=1&class=<%=c_class%>&key=<%=key_word%>&idindex=<%=idindex%>&id=<%=key_word%> >首个</a> | <a href=searchchildren.asp?page=<%=rs.PageCount%>&class=<%=c_class%>&key=<%=key_word%>&idindex=<%=idindex%>&id=<%=key_word%> >末个</a> | 跳到:
第
<input type="text" name="page" maxlength=3 style="width:20;background-color:rgb();">
个
<input type="submit" name="Submit1" value="go" style="width:20;background-color:rgb(100,100,245)">
</form>
<p> </p>
<p> </p>
</body>
</html>
<%
else
Response.write "无此记录!"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -