?? userlist.jsp
字號:
<%@page contentType="text/html;charset=GBK"
import="com.x3408.office.Constants,com.x3408.employees.UserInfo,java.util.Vector"%>
<html>
<head>
<title>X3408輔助辦公系統</title>
<link rel="stylesheet" type="text/css" href="UserList/all.css">
<script language="JavaScript" src="UserList/all.js"></script>
<script language="JavaScript">
function numberOnly(type){
if(type.selectedIndex==1){
if (!((event.keyCode>=48)&&(event.keyCode<=57))||(event.keyCode==8)||(event.keyCode==10)||(event.keyCode==13))
event.returnValue=false
if((event.shiftKey)&&((event.keyCode>=48)&&(event.keyCode<=57))) event.returnValue=false
}
}
</script>
<%
Vector<UserInfo> userList = (Vector) request.getAttribute("userList");
UserInfo userInfo = null;
String msg = (String) request.getAttribute("msg");
String keyword=(String)request.getParameter("keyword");
String type=(String)request.getParameter("type");
int showPage=request.getAttribute("showPage")==null?1:Integer.parseInt((String)request.getAttribute("showPage"));
String recordCount=(String)request.getAttribute("recordCount");
String pageCount=(String)request.getAttribute("pageCount");
String employeeID = (String) request.getSession().getAttribute("employeeID");
if (msg != null) {
%>
<script language="javascript">
alert("<%=msg%>");
</script>
<%
}
%>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
<jsp:include page="<%=Constants.S_INDEXHEADER_JSP%>" />
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0" class="tb1" height="60%">
<tr>
<td valign="top" height="100%">
<table class="tabtitle" bgcolor="#eff7ff" border="0" cellpadding="0"
cellspacing="0" width="100%">
<tbody>
<tr>
<td nowrap="nowrap" width="1%">
</td>
<td width="98%">
</td>
<td nowrap="nowrap" width="1%">
<form name="searchfrm" method="post" action="<%=Constants.C_EMPLOYEES_JAVA %>">
搜索員工
<SELECT name=type onchange="if(this.selectedIndex==1&&searchfrm.keyword.value!='請輸入關鍵字!')searchfrm.keyword.value=''">
<OPTION value=name >姓名</OPTION>
<OPTION value=employeeID <%="employeeID".equals(type)?"selected":"" %>>員工號</OPTION>
</SELECT>
<input name="action" value="userSearch" type="hidden">
<input onFocus="this.value=''" value=<%=keyword==null?"請輸入關鍵字!":keyword %> name=keyword class="txt" type="text"
onKeyPress="numberOnly(searchfrm.type)" onkeyup="if(searchfrm.type.selectedIndex==1)value=value.replace(/[^\d]/g,'');" onbeforepaste="if(searchfrm.type.selectedIndex==1){clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''));}">
<input value=" 搜索 " class="btn"
onclick="if (Trim(keyword.value)==''||Trim(keyword.value)=='請輸入關鍵字!'){alert('請輸入關鍵字!')}else searchfrm.submit();" type="button">
</form>
</td>
<td class="border" width="1">
</td>
</tr>
</tbody>
</table>
<form name="frm" method="post" action="<%=Constants.C_EMPLOYEES_JAVA %>" style="margin: 0pt; padding: 0pt;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td height="10"></td>
</tr>
<tr>
<td align="left" nowrap="nowrap" width="99%">
<input name="action" value="userDelete" type="hidden">
<input class="btn" value="刪除員工" onclick="if (!CheckAddrSelected()){alert('請選擇要刪除的員工');return false;}else{return confirm('你確實要刪除選中的員工嗎');}" type="submit">
<input class="btn" value="添加員工" onclick="location.href='<%=Constants.C_USERADD_JSP %>'" type="button">
<input class="btn" value="所有員工" onclick="location.href='<%=Constants.C_EMPLOYEES_JAVA %>?action=allUserQuery'" type="button">
</td>
<td align="right" nowrap="nowrap" width="1%">
共 <b><font color="#3399FF"><%=recordCount==null?0:recordCount%></font></b> 個員工
</td>
</tr>
<tr>
<td height="10"></td>
</tr>
</tbody>
</table>
<table class="contactlist" border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
<tbody>
<tr bgcolor="#eff7ff" align="center">
<td width="4%">
<a href="javascript:SelectAll(true)">全部</a> -
<a href="javascript:SelectAll(false)">無</a>
</td>
<td width="4%">
<b>員工號</b>
</td>
<td width="4%">
<b>員工姓名</b>
</td>
<td width="2%">
<b>性別</b>
</td>
<td width="6%">
<b>部門</b>
</td>
<td width="3%">
<b>領導</b>
</td>
<td width="3%">
<b>管理員</b>
</td>
<td width="3%">
<b>工資</b>
</td>
<td width="5%">
<b>職位</b>
</td>
<td width="3%">
<b>修改</b>
</td>
<td width="3%">
<b>刪除</b>
</td>
</tr>
</tbody>
</table>
<%if(userList==null){%>
<div style="BACKGROUND: #f5f7fb; LINE-HEIGHT: 70px; HEIGHT: 70px; TEXT-ALIGN: center"><b>沒有符合條件的員工</b></div>
<%
}else{
for (int i = 0;i < userList.size(); i++) {
userInfo = (UserInfo) userList.elementAt(i);
if (userInfo.getEmployeeID().equals(employeeID)) {
userList.setElementAt(userList.elementAt(0), i);
userList.setElementAt(userInfo, 0);
break;
}
}
for (int i = 0;i < userList.size(); i++) {
userInfo = (UserInfo) userList.elementAt(i);
%>
<table class="contactlist" border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
<tbody>
<tr align="center">
<td nowrap="nowrap" width="4%">
<%
if (i==0&&userInfo.getEmployeeID().equals(employeeID)) {
%>
<font color="#ff0000">*</font>
<%
} else {
%>
<input name="employeeID" value="<%=userInfo.getEmployeeID()%>" type="checkbox">
</td>
<%
}
%>
<td style="" width="4%">
<
<%=userInfo.getEmployeeID()%>
>
</td>
<td width="4%">
<%=userInfo.getName()%>
</td>
<td width="2%">
<%="M".equals(userInfo.getSex()) ? "男" : "女"%>
</td>
<td width="6%">
<%=userInfo.getDepartment()%>
</td>
<td width="3%">
<%=userInfo.getLeader()%>
</td>
<td width="3%">
<%=userInfo.getAdmin() ? "是" : "否"%>
</td>
<td width="3%">
<%=userInfo.getSalary()%>
</td>
<td width="5%">
<%=userInfo.getPosition()%>
</td>
<td width="3%">
<a
href="<%=Constants.C_EMPLOYEES_JAVA + "?employeeID="+ userInfo.getEmployeeID()%>&action=userQuery"
class="a1"><img src="UserList/Alter.gif" width="16"
height="16">
</a>
</td>
<td width="3%" align="center">
<a onclick="return confirm('你確定要刪除員工號為<<%=userInfo.getEmployeeID() %>>的員工嗎?');"
href="<%=Constants.C_EMPLOYEES_JAVA + "?employeeID="+ userInfo.getEmployeeID()%>&action=userDelete" class="a1"><img src="UserList/Del.gif">
</a>
</td>
</tr>
</tbody>
</table>
<%
}
}
%>
</form>
</td>
</tr>
<tr><td>
<%if(userList!=null){ %>
<form name="pageFrm" action="<%=Constants.C_EMPLOYEES_JAVA %>" method="post" >
<input name="action" value="allUserQuery" type="hidden">
<input name="showPage" value="" type="hidden">
</form>
<table class="contactlist" border="0" cellpadding="0" cellspacing="0" width="100%" align="center" valign="bottom">
<tr bgcolor="#eff7ff" align="center">
<td width="35%"> </td>
<td><b><a href="javascript:pageFrm.showPage.value='1';pageFrm.submit();">首 頁</a></b></td>
<td><b><a href="javascript:pageFrm.showPage.value='<%=showPage-1 %>';pageFrm.submit();">上一頁</a></b></td>
<td><b><a href="javascript:pageFrm.showPage.value='<%=showPage+1%>';pageFrm.submit();">下一頁</a></b></td>
<td><b><a href="javascript:pageFrm.showPage.value='<%=pageCount%>';pageFrm.submit();">尾 頁</a></b></td>
<td width="35%" align="right">
第 <font color="#3399FF"><b><%=showPage %></b></font> 頁 共 <font color="#3399FF"><b><%=pageCount %></b></font> 頁
</td>
</tr>
</table>
<%} %>
</td></tr>
</table>
<jsp:include page="<%=Constants.S_INDEXFOOTER_JSP%>" />
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -