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

📄 update.jsp

📁 07年做得人力资源管理系统
💻 JSP
字号:
<%@ page language="java" import="com.buat.hr.users.User,com.buat.hr.users.UserDao,com.buat.hr.share.ProcessChange" pageEncoding="GB18030"%>
<%
	String strId=null;
	int id=0;
	
	strId=request.getParameter("id");
	try{
		if(!strId.equals(null)){
			id=Integer.parseInt(strId);
		} 	
	}catch(Exception e){}
	
	UserDao udao=new UserDao();
	User user=null;
	
	if(id>0){
		user=udao.queryUserById(id);
		session.setAttribute("user",user);
		session.setAttribute("id",String.valueOf(user.getId()));
	}else{
		user=(User)session.getAttribute("user");
		
	}	
%>

<html>
  <head>
      <script type="text/javascript" src="..\\meizzDate.js"></script>
      <script type="text/javascript">
		function test(){
			var newpw=update.newpw.value;
			var repw=update.repw.value;
			if(newpw!=repw){
				window.alert("两次输入的密码不一致!!!");
				return false;
			}
			if(document.update.newpw.value!="" && document.update.repw.value!=""){
				if(document.update.newpw.value.length>8 || document.update.repw.value.length>8){
			 			window.alert("密码最大长度为8!!!");
			 			return false;
			 		}
			 		if(document.update.newpw.value.length<3 || document.update.repw.value.length<3){
			 			window.alert("密码最小长度为3!!!");
			 			return false;
			 		}
			 }		
			document.update.action="ProcessUpdate.jsp";
	 		document.update.submit();
		}
	</script>
  </head>
  
  <body background="../bg.jpg">
  		<form  name="update" action="Update.jsp" ENCTYPE="multipart/form-data" method="post">
  			<table border="1" width="100%" align="center">
  				<tr>
  					<td colspan="2"><font color="red">修改用户记录</font></td>
  				</tr>
  				<tr>
  					<th>用户名称:</th>
  					<td><input type="text" name="username" value=<%=user.getUsername() %> readonly></td>
  				</tr>
  				<tr>
  					<th>原密码:</th>
  					<td><input type="password" name="oldpw" value=<%=user.getPasswords() %> readonly></td>
  				</tr>
  				<tr>
  					<th>新密码:</th>
  					<td><input type="password" name="newpw" value=""></td>
  				</tr>
  				<tr>
  					<th>确认密码:</th>
  					<td><input type="password" name="repw" value=""></td>
  				</tr>
  				<tr>
  					<th>用户性别:</th>
				<%
					if(user.getGender().equals("male")){
				%>
  					<td><input type="radio" name="gender" value="male" checked>男
  						<input type="radio" name="gender" value="female">女</td>
  				<%
  					}else{
  				%>	
  					<td><input type="radio" name="gender" value="male">男
  						<input type="radio" name="gender" value="female" checked>女</td>
  				<%
  					}
  				%>
  				</tr>
  				<tr>
  					<th>出生日期:</th>
  					<td><input type="text" name="birthday" onClick="setday(this)" readonly value=<%= user.getBirthday() %>></td>
  				</tr>
  				<tr>
  					<th>用户创建日期:</th>
  					<td><input type="text" name="createtime" value=<%=user.getCreatetime() %> disabled></td>
  				</tr>
  				<tr>
  					<th>用户级别:</th>
  					<td><select name="isadmin">
  				<%
  					String[] admin={"超级管理员","招聘管理员","培训管理员","奖惩管理员","薪金管理员","员工管理员","部门管理员","普通用户"};
  					String[] value={"superAdmin","interviewerAdmin","educateAdmin","institutionAdmin","stipendAdmin","employeeAdmin","departAdmin","commonAdmin"};
  					String[] adminhelp=new  String[admin.length];
  					
  					for(int i=0;i<admin.length;i++){
  						adminhelp[i]="";
  					}
  					for(int i=0;i<admin.length;i++){
  						if(user.getIsadmin().equals(value[i])){
  							adminhelp[i]="selected";
  						}
  				 %>	
    						<option value=<%=value[i] %> <%=adminhelp[i] %>><%=admin[i] %>
    			<%
    				}
    			%>			
    					</select></td>
  				</tr>
  				<tr>
    				<th>用户照片: </th>
    				<td><input type="file" name="pic" value=<%=user.getPic() %>></td>
    			</tr>
    			<tr>
    				<th>用户简介: </th>
    				<td><textarea name="introduce" rows="5" cols="30"><%=user.getIntroduce() %></textarea></td>
    			</tr> 
  				<tr>
    				<th colspan="2" align="center"><input type="button" value="提交" onclick="test()">&nbsp;&nbsp;&nbsp;
    					         &nbsp;&nbsp;&nbsp;<input type="reset" value="重置"></th>
    			</tr>
  			</table>
  		</form>
  </body>
</html>

⌨️ 快捷键说明

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