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

📄 user.jsp

📁 spring+hibernate+struts开发的校务oa系统
💻 JSP
字号:
<%@ page contentType="text/html; charset=GBK" pageEncoding="GBK"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="/WEB-INF/ajaxtags.tld" prefix="ajaxtags"%>
<%@ taglib uri="/WEB-INF/displaytag.tld" prefix="displaytag"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ include file="/common/common.inc"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<link rel="stylesheet" href="<%=path%>/resources/img/emx_nav_left.css"
			type="text/css" />
		<link rel="stylesheet"
			href="<%=path%>/resources/css/validation/style.css" type="text/css" />

<script type="text/javascript">		
	var comma=',';
	var usergroupArr=new Array();
	function getLeftValue(){
		var arr=new Array();
						
		for(var i=0;i<$('in_usergroup').length;i++){
			if($('in_usergroup').options[i].selected){
				var op_value=$('in_usergroup')[i].value;
				var op_text=$('in_usergroup').options[i].text;
				$('out_usergroup').add(new Option(op_text,op_value));
			}
		}
		for(var j=0;j<$('in_usergroup').length;j++){
				if($('in_usergroup').options[j].selected){
				alert($('in_usergroup').options[j].text);
				$('in_usergroup').options[$('in_usergroup').options.selectedIndex] = null;
			}
		}
	}
	function dbRigthValue(){
		var op_text=$('out_usergroup').options[$('out_usergroup').options.selectedIndex].text
		var op_value=$('out_usergroup').options[$('out_usergroup').options.selectedIndex].value
		$('in_usergroup').add(new Option(op_text,op_value));
		$('out_usergroup').options[$('out_usergroup').options.selectedIndex] = null;		
	}

	function dbLeftValue(){
		var op_text=$('in_usergroup').options[$('in_usergroup').options.selectedIndex].text
		var op_value=$('in_usergroup').options[$('in_usergroup').options.selectedIndex].value
		
		$('out_usergroup').add(new Option(op_text,op_value));
		$('in_usergroup').options[$('in_usergroup').options.selectedIndex] = null;
	}
	function doSave(url){
		alert($('out_usergroup').length);
		for(var i=0;i<$('out_usergroup').length;i++){
			$('hid_usergroup').value += $('out_usergroup').options[i].value+comma;
		}
		alert($('hid_usergroup').value);
		formUnify.action = url;
		//Validation.validate('formUnify');
  		formUnify.submit();
	}
</script>


<script type="text/javascript">
	cmdSave = '/admin/user/userAction.do';
	cmdCheckUser ='/admin/user/userAction.do';
	function check_value(){return true}
</script>
	</head>

	<body>
		<html:form action="/admin/user/userAction.do?METHOD=doSave" method="post"
			styleId="formUnify" styleClass='required-validate'>
			<fieldset>
				<legend>
					增加用户
				</legend>
				<div class="form-row">
					<div class="field-label">
						<label for="field1-t4">
							用户名
						</label>
						:
					</div>
					<div class="field-widget">
						<html:text property="username"
							styleClass="required validate-alphanum" value="${username}"></html:text>
					</div>

					<input type="button"
						onclick="SwitchPage.doExecute('/admin/user/userAction.do','checkUser')"
						value="检测用户名是否可用">

					<font color="green"> 
					<html:errors property="notexist" bundle="msg" />
					</font>
					<font color="red">
					 <html:errors property="isexist" bundle="msg" /> 
					</font>
				</div>

				<div class="form-row">
					<div class="field-label">
						<label for="field2-t4">
							密码
						</label>
						:
					</div>
					<div class="field-label">
						<html:text property="password" styleClass="required validate-alphanum min-length-6"
							value="123456" />

					</div>
				</div>

				<div class="form-row">
					
					<div class="field-label">
						<p>
							<a href="#"
								onclick="$('usergroup-signup').toggle(); return false">加入用户组</a>
						</p>
						<div id="usergroup-signup" class="form-row" style="display:none;">
							<div class="field-label">
						 
							<select id="out_usergroup"
									size="5"
									style="width: 10%;"
									ondblclick="dbRigthValue()">
							</select>
						 <html:hidden property="usergroup" styleId="hid_usergroup"/>
								<input type="button" value="&lt;-" onclick="">
								<input type="button" value="-&gt;">
								<select id="in_usergroup" 
										size="5" 
										ondblclick="dbLeftValue()"
										style="width: 10%; ">
									<c:forEach items="${usergroupList}" var="usergroup">
											<option value="${usergroup.usergroupid}">
												${usergroup.groupname}
											</option>
									</c:forEach>
								</select>
										
									
							</div>
						</div>
					</div>
				</div>
				
				<div class="form-row">
					<div class="field-label">
						<label for="field2-t4">
							权限
						</label>
						:
					</div>
					<div class="field-label">
						<html:select property="popedom">
							<c:forEach items="${popedomList}" var="popedom">
								<html:option value="${popedom.popedomid}">${popedom.name}</html:option>
							</c:forEach>
						</html:select>

					</div>
				</div>
				
				<div class="form-row">
					<div class="field-label">
						<label for="field2-t4">
							状态
						</label>
						:
					</div>
					<div class="field-label">
						<html:radio property="state" value="1">正常</html:radio>
						<html:radio property="state" value="0">禁用</html:radio>
					</div>
				</div>

				<div class="form-row">
					<div class="field-label">
						<label for="field1">
							姓氏
						</label>
						:
					</div>
					<div class="field-widget">
						<html:text property="firstname" styleClass="required" value="你好"></html:text>

					</div>
				</div>

				<div class="form-row">
					<div class="field-label">
						<label for="field2">
							名字
						</label>
						:
					</div>
					<div class="field-widget">
						<html:text property="lastname" styleClass="required" value="你好"></html:text>

					</div>
				</div>
				<div class="form-row">
					<div class="field-label">
						<label for="field2">
							职务
						</label>
						:
					</div>
					<div class="field-widget">
						<html:text property="duty" styleClass="required" value="你好"></html:text>

					</div>
				</div>
				<div class="form-row">
					<div class="field-label">
						<label for="field2">
							公休
						</label>
						:
					</div>
					<div class="field-widget">
						<html:text property="hols" styleClass="required validate-number"
							value="12"></html:text>

					</div>
				</div>
				<p>
					<a href="#" onclick="$('userinfo-signup').toggle(); return false">可选内容</a>
				</p>
				<div id="userinfo-signup" class="form-row" style="display:none;">
					<div class="form-row">
						<div class="field-label">
							<label for="field6">
								性别
							</label>
							:
						</div>
						<div class="field-label">
							<html:radio property="sex" value="M">男</html:radio>
							<html:radio property="sex" value="W">女</html:radio>
						</div>
					</div>
					<div class="form-row">
						<div class="field-label">
							<label for="field2">
								年龄
							</label>
							:
						</div>
						<div class="field-widget">
							<html:text property="age" styleClass="validate-number"></html:text>

						</div>
					</div>
					<div class="form-row">

						<div class="field-label">
							<label for="field2">
								移动电话
							</label>
							:
						</div>
						<div class="field-widget">
							<html:text property="mobiletel" styleClass="validate-alphanum"></html:text>

						</div>
					</div>
					<div class="form-row">
						<div class="field-label">
							<label for="field2">
								家庭电话
							</label>
							:
						</div>
						<div class="field-widget">
							<html:text property="telephone" styleClass="validate-alphanum"></html:text>

						</div>
					</div>
					<div class="form-row">
						<div class="field-label">
							<label for="field2">
								地址
							</label>
							:
						</div>
						<div class="field-widget">
							<html:textarea property="address" styleClass="validate-alphanum"
								rows="5" cols="30">
							</html:textarea>
						</div>
					</div>
				</div>
			</fieldset>
			<input type="button" 
				   onclick="doSave('<%=path%>/admin/user/userAction.do?METHOD=doSave')"
				   value="提交">
		</html:form>
	</body>
</html>

⌨️ 快捷键说明

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