📄 search.asp
字号:
<!--#include file="conn.asp" -->
<%
if session("pwd")<>"pass" then
response.Redirect "../admin_login.asp"
response.end
end if
%>
<%
bo_Class=request("Class")
bo_name=request("name")
set rs=server.createobject("adodb.recordset")
sqltext="select * from worker "
if bo_class="按员工编号" then
sqltext=sqltext &" where number like '%"& request("name") &"%' order by number asc "
elseif bo_class="按员工姓名" then
sqltext=sqltext &" where username like '%"& request("name") &"%' order by number asc "
elseif bo_class="按所属组织" then
sqltext=sqltext &" where zhuzhi like '%"& request("name") &"%' order by number asc "
elseif bo_class="按职务" then
sqltext=sqltext &" where task like '%"& request("name") &"%' order by number asc "
end if
rs.open sqltext,conn,1,1
If rs.eof and rs.bof then
response.write"<script language=javascript>alert('对不起!没有检索到相关的员工信息,请重试!');"
response.write"javascript:history.go(-1)</script>"
End if
if not isnumeric(request("page")) or isempty(request("page")) then
page=1
else
page=int(abs(request("page")))
end if
rs.pagesize=3
total=rs.recordcount
mypagesize=rs.pagesize
rs.absolutepage=page
if rs.bof and rs.eof then
response.write "<center>当前还没有任何情况登记</center>" '先不使用这种方式
response.end
end if
%>
<html>
<head>
<link href="../../appMain.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>公司员工信息</title>
</head>
<body>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" bgcolor="#00CC99">
<tr>
<td height="21" background="../../image/titlebg.gif" >
<form name="form1" method="post" action="search.asp">
员工信息检索:
<select name='Class' size='1' style="font-size: 9pt" tabindex='0'>
<option value="按员工编号">按员工编号</option>
<option value="按员工姓名">按员工姓名</option>
<option value="按所属组织">按所属组织</option>
<option value="按职务">按职务</option>
</select>
<input name='Name' type='text' style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height:18px;background-color:#f3f3f3;border:1 solid black" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''" value="--请输入查寻关键字--" size='20'onfocus="if (value =='--请输入查寻关键字--'){value =''}"onblur="if (value ==''){value='--请输入查寻关键字--'}" >
<input type='submit' value='查询' name='Submit' style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height:20px;background-color:#D4D0C8;" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#D4D0C8'">
</form></td>
</tr>
</table>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolordark="#ffffff" bordercolorlight="#000000">
<tr class="tabback" >
<td width="8%"> <div align="center"><font color="#FF0000">员工编号</font></div></td>
<td width="12%"> <div align="center"><font color="#FF0000">姓 名</font></div></td>
<td width="6%"> <div align="center"><font color="#FF0000">性 别</font></div></td>
<td width="12%"> <div align="center"><font color="#FF0000">所属组织</font></div></td>
<td width="12%"> <div align="center"><font color="#FF0000">职 务</font></div></td>
<td width="9%"> <div align="center"><font color="#FF0000">在职状态</font></div></td>
<td width="15%"> <div align="center"><font color="#FF0000">出生日期</font></div></td>
<td width="14%"><div align="center"><font color="#FF0000">手机号码</font></div></td>
<td width="6%"> <div align="center"><font color="#FF0000">修 改</font></div></td>
<td width="6%"> <div align="center"><font color="#FF0000">删 除</font></div></td>
</tr>
<% dim i
i=1
do while not rs.eof and mypagesize>0 %>
<tr>
<td height="21"> <div align="center"><%=rs("number")%></div></td>
<td> <div align="center"><a href=javascript:winopen('yuangon1.asp?id=<%=rs("id")%>')><%= rs("username") %></a></div></td>
<td> <div align="center"><%= rs("sex") %></div></td>
<td> <div align="center"><%= rs("zhuzhi") %></div></td>
<td> <div align="center"><%=rs("task") %></div></td>
<td> <div align="center"><%= rs("work") %></div></td>
<td> <div align="center"><%= rs("born_date") %></div></td>
<td><div align="center"><%= rs("cellphone") %></div></td>
<td> <div align="center"><a href="../../modify/yuangonmodify.asp?ID=<%=rs("ID")%>" onclick="return confirm('你真的要修改此信息吗!')">修改</a></div></td>
<td ><div align="center"><a href="../../del/yungondel.asp?ID=<%=rs("ID")%>" onclick="return confirm('你真的要删除此信息吗!')">删除</a></div></td>
</tr>
<% mypagesize=mypagesize-1
i=i+1
rs.movenext
loop
%>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20"><div align="center">
<p align="left" >页数:
<%
if page>1 then%>
<a href='search.asp?page=<%=page-1%>'>上一页</a>
<%
end if
%>
<%
if rs.pagecount <= 8 then
for j=1 to rs.pagecount
response.write "[<a href='search.asp?page="&j&"'>"&j&"</a>]"'--------------暂时先用这吧
next
else
for j=1 to 8
response.write "[<a href='search.asp?page="&j&"'>"&j&"</a>] "
next
response.write "[<a href='search.asp?page="&rs.pagecount&"' title='最后一页'>>></a>]"
end if
%>
<%
if page<rs.pagecount then%>
<a href='search.asp?page=<%=page+1%>'>下一页</a>
<%
end if
%>
总记录数:<%=total%>条 </div></td>
<td><div align="right">
<%
response.write "<input type='text' name='page' size=4 maxlength=4 value="&page&"> "
response.write "<input class=buttonface type='submit' value='转到' name='cndok' style='background-color: #e1f0ff'></span> "
%>
<% rs.close
set rs=nothing
conn.close
set conn=nothing
%> </div></td>
</tr>
</table>
</body>
</html>
<script language="javascript">
function winopen(url)
{
window.open(url,"search","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=280,height=448,top=0,left=0");
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -