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

📄 result.asp

📁 办公系统
💻 ASP
字号:
<!--#include file="../includes/db.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>办公自动化系统</title>
</head>

<body>
<center>
<%
call insureID()
dim User_id
dim Username
dim Dept_id
dim Position_id
User_id=request("Userid")
Username=request("Username")
Dept_id=request("Dept_id")
Position_id=request("Position_id")

if User_id="" and Username="" and Dept_id="" and Position_id="" then
	response.redirect "Browse_Dept.asp"
end if

sql="SELECT Users_info.*, [Position].Position_name AS Position_name, " _
	&"Dept.Dept_name AS Dept_name " _
	&"FROM Users_info INNER JOIN " _
	&"[Position] ON Users_info.POSITION_ID = [Position].POSITION_ID INNER JOIN " _
	&"Dept ON Users_info.Dept_id= Dept.Dept_id " _
	&" WHERE Users_info.Fired=0 "
	
if User_id<>"" then
	sql=sql+"AND Users_info.User_id= "&User_id&" "
end if
if Username<>"" then
	sql=sql+"AND Users_info.Name LIKE '%"&Username&"%' "
end if
if Dept_id<>"" then
	sql=sql+"AND Dept.Dept_id= "&Dept_id&" "
end if
if Position_id<>"" then
	sql=sql+"AND Users_info.Position_id= "&Position_id&" "
end if
call openDB()
rs.open sql,conn,1,1
%>
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="50">
<tr>
 <td width="100%"></td>
</tr>
</table>
<table width="75%" border="0" cellpadding="0" cellspacing="1" bgcolor="#5A8BCE">
 <tr>
  <td height="35" align=left bgcolor="#E6F7FF"><div align="center"><b><font color="#000000">员工查询结果列表</font></b></div></td>
  </tr>
</table>
<table width="75%" border="0" cellpadding="4" cellspacing="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" bgcolor="#5A8BCE">
<tr>
<td width="15%" bgcolor="#FCFCFC">员工ID</td>
<td width="15%" bgcolor="#FCFCFC">姓名</td>
<td width="15%" bgcolor="#FCFCFC">性别</td>
<td width="15%" bgcolor="#FCFCFC">部门</td>
<td width="15%" bgcolor="#FCFCFC">职位</td>
</tr>
<%
Counter=0
'没有找到符合查询要求的信息
if rs.eof then
	response.write "<tr><td colspan=5 align=center bgcolor=""#FCFCFC"">"
	response.write "没有找到符合要求的信息。"
	response.write "</td></tr>"
end if
'找到了就逐一列出
while not rs.eof
	response.write "<tr>"
	response.write "<td width=""15%"">"&rs("User_id")&"</td>"
	response.write "<td width=""15%""><a href=""Read.asp?User_id="&rs("User_id")&""">"&rs("Username")&"</a></td>"
	response.write "<td width=""15%"">"&rs("Sex")&"</td>"
	response.write "<td width=""15%"">"&rs("Dept_name")&"</td>"
	response.write "<td width=""15%"">"&rs("Position_Name")&"</td>"
	response.write "</tr>"
	User_id=rs("User_id")
	rs.movenext
	Counter=Counter+1
wend
%>
<tr>
<td height=50 colspan=5 align=center bgcolor="#EFEFEF">
[<a href="BrowseDeptList.asp">返回</a>]
</tr>
</table>
<%
call closeDB()
'如果只找到一条记录,则直接到员工详细内容
if Counter=1 then
	response.redirect"Read.asp?User_id="&User_id
end if
%>
</center>
</body>
</html>






⌨️ 快捷键说明

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