📄 emplist.asp
字号:
<!--#include file="../../Conndb.asp"-->
<!--#include file="../isAdmin.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>员工管理</title>
<link href="../../style.css" rel="stylesheet">
<script language="javascript">
function newView(url) {
var oth="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=200,top=200";
oth = oth+",width=530,height=480";
var newView=window.open(url,"newView",oth);
newView.focus();
return false;
}
function newView1(url) {
var oth="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=200,top=200";
oth = oth+",width=200,height=100";
var newView1=window.open(url,"newView1",oth);
newView1.focus();
return false;
}
</script>
</head>
<body link="#000080" vlink="#080080">
<form id="form1" name="form1" method="POST">
<p align="center"><font color="#000080"><b><font style="font-size: 12pt">员 工 管 理</font></b></font></p>
<table align=center border="1" cellspacing="0" width="100%" bordercolorlight="#000080" bordercolordark="#FFFFFF">
<tr>
<td width="16%" align="center" bgcolor="#C1E0FF"><strong>姓名</strong></td>
<td width="8%" align="center" bgcolor="#C1E0FF"><strong>性别</strong></td>
<td width="18%" align="center" bgcolor="#C1E0FF"><strong>职务</strong></td>
<td width="14%" align="center" bgcolor="#C1E0FF"><strong>入职时间</strong></td>
<td width="14%" align="center" bgcolor="#C1E0FF"><strong>办公电话</strong></td>
<td width="14%" align="center" bgcolor="#C1E0FF"><strong>手机</strong></td>
<td width="16%" align="center" bgcolor="#C1E0FF"><strong>操作</strong></td>
</tr>
<%
Dim rs,did
did = Request.QueryString("did")
If IsEmpty(did) Then
did = "0"
End If
Set rs = Server.CreateObject("ADODB.RecordSet")
'读取数据到记录集rs中
sql = "SELECT * FROM Employees WHERE DepId=" & did & " ORDER BY EmpId"
rs.Open sql,conn,1,1
'在表格中显示员工信息
If rs.Eof Then
Response.Write "<tr><td colspan=7 align=center>目前还没有员工信息。</td></tr></table>"
Else
Do While Not rs.EOF
%>
<tr>
<td><%=rs("EmpName")%></td>
<td align="center"><%=rs("Sex")%> </td>
<td align="center"><%=rs("Title")%> </td>
<td align="center"><%=rs("HireDate")%> </td>
<td align="center"><%=rs("Office_phone")%> </td>
<td align="center"><%=rs("Mobile")%> </td>
<td align="center">
<%'只有人事专员才可以看到
If isAdmin=1 Then %>
<a href="EmpEdit.asp?action=edit&eid=<%=rs("EmpId")%>&did=<%=did%>" onClick="return newView(this.href)">修改</a>
<a href="EmpDelt.asp?eid=<%=rs("EmpId")%>" onClick="if(confirm('确定要删除记录吗?')){return newView1(this.href);}return false;">删除</a><%End If%> </td>
</tr>
<%
rs.MoveNext()
Loop
%>
</table>
<%End If%>
<%If isAdmin=1 Then '只有人事专员才可以看到%>
<p align="center">
<input type="button" value="添加员工信息" onclick="newView('EmpAdd.asp?action=add&did=<%=did%>')" name=add></p>
<%End If%>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -