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

📄 userlist.jsp

📁 辅助办公系统,具有发布公告、站内邮箱、日程安排、日志查看等功能
💻 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%">
						&nbsp;
					</td>
					<td width="98%">
						&nbsp;
					</td>
					<td nowrap="nowrap" width="1%">
					<form name="searchfrm" method="post" action="<%=Constants.C_EMPLOYEES_JAVA %>">
						搜索员工&nbsp;
						<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,''));}">
						&nbsp;
						<input value="&nbsp;搜索&nbsp;" class="btn"
						 onclick="if (Trim(keyword.value)==''||Trim(keyword.value)=='请输入关键字!'){alert('请输入关键字!')}else searchfrm.submit();" type="button">
					</form>
					</td>
					<td class="border" width="1">
						&nbsp;
					</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">
							&nbsp;
							<input class="btn" value="添加员工" onclick="location.href='<%=Constants.C_USERADD_JSP %>'"	type="button">
							&nbsp;
							<input class="btn" value="所有员工" onclick="location.href='<%=Constants.C_EMPLOYEES_JAVA %>?action=allUserQuery'" type="button">
						</td>
						<td align="right" nowrap="nowrap" width="1%">
							共&nbsp;<b><font color="#3399FF"><%=recordCount==null?0:recordCount%></font></b>&nbsp;个员工
						</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%">
								&lt;
								<%=userInfo.getEmployeeID()%>
								&gt;
							</td>
							<td width="4%">
								<%=userInfo.getName()%>
							</td>
							<td width="2%">
								<%="M".equals(userInfo.getSex()) ? "男" : "女"%>
							</td>
							<td width="6%">
								&nbsp;<%=userInfo.getDepartment()%>
							</td>
							<td width="3%">
								&nbsp;<%=userInfo.getLeader()%>
							</td>
							<td width="3%">
								<%=userInfo.getAdmin() ? "是" : "否"%>
							</td>
							<td width="3%">
								<%=userInfo.getSalary()%>
							</td>
							<td width="5%">
								&nbsp;<%=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%">&nbsp;</td>
								<td><b><a href="javascript:pageFrm.showPage.value='1';pageFrm.submit();">首&nbsp;页</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();">尾&nbsp;页</a></b></td>
								<td width="35%" align="right">
								第&nbsp;<font color="#3399FF"><b><%=showPage %></b></font>&nbsp;页&nbsp;&nbsp;&nbsp;共&nbsp;<font color="#3399FF"><b><%=pageCount %></b></font>&nbsp;页&nbsp;&nbsp;&nbsp;
								</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 + -