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

📄 modifyuser.jsp

📁 阳光超市管理系统 阳光超市管理系统(07.6.12
💻 JSP
字号:
<%@ page language="java" pageEncoding="GB2312"%>
<html>
	<head>
		<title>用户信息修改页面</title>
		<style>
td{font-family:Tahoma;font-size:15px;}
a{text-decoration:none;}
a:hover{text-decoration:underline;}
</style>
	<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
	<script langauge="javascript">
	function notNull(fieldname,string){
	if(string.value==""){
	alert(fieldname+"不能为空");
	string.focus();
	return false;
	}
	else
	return true;
	}
	
	function notSelect(fieldname,string){
	if(string.options[0].selected){
	alert(fieldname+"不能为空");
	return false;
	}
	else 
	return true;
	}
	function validform(){
	if(notNull("用户编号",document.modifyform.UserID)
	 &&notNull("用户姓名",document.modifyform.UserName)
	 &&notNull("用户密码",document.modifyform.UserPW)
	 &&notNull("用户权限",document.modifyform.UserStyle))
	{ return true;}
	else
	return false;
	}
	</script>
	<body text="#666666">
	<%!String id, name, pw, privilege;%>
		<%
			id = request.getParameter("UserID");
			name = request.getParameter("UserName");
			pw = request.getParameter("UserPW");
			privilege = request.getParameter("UserStyle");
		%>

		<div align="center">
		<h3>修改用户信息</h3>
		</div>
		<form name="modifyform" method="post" action="UserServlet"
			id="modifyform" onSubmit="return validform()">
			<table width="60%" border="1" cellspacing="1" cellpadding="1" align="center" bordercolor="#DADADA" bordercolordark="EBEBEB" >
				<tr>
					<td width="25%" align="center" bgcolor="#EBEBEB">
						用户编号
					</td>
					<td width="46%">
						&nbsp;
						<%=id%>
						<input type="hidden" name="UserID" value="<%=id%>">
					</td>
				</tr>
				<tr>
					<td width="25%" align="center" bgcolor="#EBEBEB">
						用户姓名
					</td>
					<td width="25%">
						&nbsp;
						<input type="text" name="UserName" value=<%=name%> onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))">
					</td>
				</tr>
				<tr>
					<td width="25%" align="center" bgcolor="#EBEBEB">
						用户密码
					</td>
					<td width="25%">
						&nbsp;
						<input type="password" name="UserPW" value=<%=pw%>>
					</td>
				</tr>
				<tr>
					<td width="25%" align="center" bgcolor="#EBEBEB">
						密码重输
					</td>
					<td width="25%">
						&nbsp;
						<input type="password" name="nUserPW" >
					</td>
				</tr>
				<tr>
					<td width="25%" align="center" bgcolor="#EBEBEB">
						用户权限
					</td>
					<td>
						&nbsp;
						<%
						if (privilege.equals("0")) {
						%>
						<select name="UserStyle" >
							<option value="">
								请选择
							</option>
							<option value="0" selected>
								超级管理员
							</option>
							<option value="1">
								仓库管理员
							</option>
							<option value="2">
								财务管理员
							</option>
							<option value="3">
								收银员
							</option>
						</select>
						<%
							}
							if (privilege.equals("1")) {
						%>
						<select name="UserStyle">
							<option value="">
								请选择
							</option>
							<option value="0">
								超级管理员
							</option>
							<option value="1" selected>
								仓库管理员
							</option>
							<option value="2">
								财务管理员
							</option>
							<option value="3">
								收银员
							</option>
						</select>
						<%
							}
							if (privilege.equals("2")) {
						%>
						<select name="UserStyle">
							<option value="">
								请选择
							</option>
							<option value="0">
								超级管理员
							</option>
							<option value="1">
								仓库管理员
							</option>
							<option value="2" selected>
								财务管理员
							</option>
							<option value="3">
								收银员
							</option>
						</select>
						<%
							}
							if (privilege.equals("3")) {
						%>
						<select name="UserStyle">
							<option value="">
								请选择
							</option>
							<option value="0">
								超级管理员
							</option>
							<option value="1">
								仓库管理员
							</option>
							<option value="2">
								财务管理员
							</option>
							<option value="3" selected>
								收银员
							</option>
						</select>
						<%
						}
						%>
					</td>
				</tr>
				<tr align="center">
					<td colspan="2" align="center">
						<input type="submit" name="Submit" value="修改">
						&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;
						<input type="reset" name="reset" value="取消"
							onClick="history.back()">
					</td>
				</tr>
			</table>
			<input type="hidden" name="action" value="modify">
		</form>
	<%
			String success = (String) request.getAttribute("success");
			if ("password".equals(success)) {
		%>
		<script language="javascript">
			alert("两次输入的密码不一致,请正确输入");
			</script>
		<%
			request.removeAttribute("success");
			}
		%>	
	</body>
</html>

⌨️ 快捷键说明

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