📄 employee.jsp
字号:
<%--
模块名称:行政管理
模块功能:员工管理
版 本:V1.0
著 作 人:蔡静
著作日期:2001-10-25
使用说明:
主要技术说明:
参考文献:法律事务设计书
修改历史:= = = = = = = = = = = = = = = = = = = = = = = = = =
修改日期:
修 改 人:
修改理由:
修改出处:
= = = = = = = = = = = = = = = = = = = = = = = = = =
--%>
<%@ page contentType= "text/html; charset=gb2312" %>
<%@ page language="java" import="java.sql.*" %>
<%@ page import="system.*" %>
<jsp:useBean id="db" class="dbconnection.DbConnection" scope="page" />
<%
Security auth = new Security();
String employeeid = (String)session.getAttribute("employee_id");
if(employeeid == null || employeeid.equals(""))
{
response.sendRedirect(response.encodeRedirectURL("../index.htm"));
}
String modelid = "Off030";
int authflag = auth.popedom(employeeid, modelid);
if(authflag == 0 || authflag == 2 || authflag == -1)
{
%>
<jsp:forward page="../inc/noauth.jsp" >
</jsp:forward>
<%
}
%>
<%
String num = request.getParameter("pagenum");
int pagenum, pagesize = 10, recordcount, pagecount;
if ((num == null) || (num.equals("")))
pagenum = 1;
else
pagenum = Integer.parseInt(num);
String sql = "select a.employee_id, a.employee_name, b.dept_name from t_employee a";
sql = sql + ",t_dept b where a.dept_id = b.dept_id and active = 1 order by employee_id";
ResultSet rs = db.executeQuery(sql);
if (rs != null) {
rs.last();
recordcount = rs.getRow();
if (recordcount == recordcount/pagesize*pagesize)
pagecount = recordcount/pagesize;
else
pagecount = recordcount/pagesize + 1;
if (pagenum < 1)
pagenum = 1;
if (pagenum > pagecount)
pagenum = pagecount;
rs.absolute((pagenum-1)*pagesize+1);
%>
<html>
<head>
<title>员工管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../inc/law.css" type="text/css">
<%@ include file="../inc/config.jsp" %>
<script language="javascript">
<!--
function view(aa) {
var sPath = aa
strFeatures = "dialogWidth=450px;dialogHeight=500px;dialogleft=70;dialogtop=30;center=yes;help=no";
bb=showModalDialog(sPath,0,strFeatures);
if(bb!="")
window.location.href="Employee.jsp"
return false;
}
//-->
</script>
</head>
<body class=page>
<script language="javascript">
function selectID() {
var a = document.all.item("rel");
var employee_ids = "";
var flag=0;
if (a!=null)
if (a.length!=null)
for (i=0; i<a.length; i++) {
if(a(i).checked) {
if (employee_ids == "")
employee_ids = a(i).value;
else
employee_ids = employee_ids + "," + a(i).value;
flag=1;
}
}
else
{
if(a.checked) {
employee_ids = a.value;
flag=1;
}
}
if (!flag)
{
alert("请选择一项!")
return false;
}
if(!window.confirm("确定要删除选中的项目吗?"))
{
return false;
}
else {
document.thisForm.action="EmployeeDel.jsp";
document.thisForm.employee_ids.value=employee_ids;
document.thisForm.submit();
return true;
}
}
//---------------------
function clrPwd() {
var a = document.all.item("rel");
var employee_ids = "";
var flag=0;
if (a!=null)
if (a.length!=null)
for (i=0; i<a.length; i++) {
if(a(i).checked) {
if (employee_ids == "")
employee_ids = a(i).value;
else
employee_ids = employee_ids + "," + a(i).value;
flag=1;
}
}
else
{
if(a.checked) {
employee_ids = a.value;
flag=1;
}
}
if (!flag)
{
alert("请选择员工!")
return false;
}
if(!window.confirm("确定要清空选中员工的密码?"))
{
return false;
}
else {
document.thisForm.action="EmployeePasswd.jsp";
document.thisForm.employee_ids.value=employee_ids;
document.thisForm.submit();
return true;
}
}
//---------------------
function go() {
document.thisForm.action="Employee.jsp";
document.thisForm.submit();
}
function keygo() {
if(event.keyCode == 13){
document.thisForm.action="Employee.jsp";
document.thisForm.submit();
}
else {
if (event.keyCode<48 || event.keyCode>57) {
alert("请输入数字!");
document.thisForm.pagenum.value="";
event.returnValue=false;
}
}
}
</script>
<!--显示工具条-->
<table width="98%" align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td> <a href="Employee.jsp"><img src="../images/all.gif" height="22" border="0" alt="显示所有内容"></a>
<a href="EmployeeAdd.jsp"><img src="../images/add.gif" alt="增加内容" width="79" height="22" border="0" style="cursor:hand" ></a>
<img src="../images/delete.gif" alt="删除选中的内容" onClick="return selectID();" style="cursor:hand" width="79" height="22">
<img src="../images/clear.gif" alt="清空员工密码" onClick="return clrPwd();" style="cursor:hand" width="88" height="22"></td>
<td width="108" height="30" align="center" background="../images/title_bg.gif">
<script language=JavaScript>
document.write("<span class=\"title\">"+document.title+"</span>");
</script>
</td>
</tr>
</table>
<table width="98%" background="../images/line.gif" border="0" cellspacing="0" cellpadding="0" height="12" align="center">
<tr>
<td> </td>
</tr>
</table>
<!--显示工具条结束-->
<!--显示分页-->
<%@ include file="../inc/page1.jsp" %>
<!--显示分页结束-->
<!--显示内容-->
<form name="thisForm" METHOD="post">
<table width="98%" cellspacing="1" cellpadding="0" height="25" align="center" border="0" class="table_bg">
<tr class="title_bg">
<td height="25" width="10%" align="center">
<input name="chkCheckAll" type="checkbox" enabled onclick="CheckAll();">
</td>
<td width="18%" align="center"> 员工编号</td>
<td width="21%" align="center"> 员工姓名</td>
<td width="16%" align="center"> 所属部门</td>
<td width="13%" align="center"> 操作</td>
</tr>
<%
if (pagecount > 0) {
String employee_id, employee_name, dept_name;
for (int i=1;i<=pagesize;i++) {
employee_id = rs.getString("employee_id");
employee_name = rs.getString("employee_name");
dept_name = rs.getString("dept_name");
if (rs.getRow()!=(rs.getRow()/2*2)) {
%>
<tr class="tr_bg1">
<% }
else {
%>
<tr class="tr_bg2">
<% }
%> <td height="25" width="10%" align="center">
<input name="rel" type="checkbox" enabled value=<%=employee_id%>>
</td>
<td width="18%" align="right"><%=employee_id%></td>
<td width="21%" align="right">
<a href="EmployeeInfo.jsp?employee_id=<%=employee_id%>">
<%=employee_name%>
</a></td>
<td width="16%" align="right"><%=dept_name%></td>
<td width="13%" align="center">
<a href="EmployeeAmend.jsp?employee_id=<%=employee_id%>"><img src="../images/edit.gif" width="18" height="13" border="0" alt="修改" style="cursor:hand" ></a></td>
</tr>
<%
if (!rs.next())
break;
}
}
%>
</table>
<input type="hidden" name="employee_ids">
</form>
<!--显示内容结束-->
</body>
</html>
<%}%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -