<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
    // 获取当前请求的上下文路径
    String path = request.getContextPath();
    // 构建基础路径，用于后续资源的引用
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<!-- 针对不同的浏览器进行优化显示 -->
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- 视口设置，用于响应式布局 -->
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!-- 收藏夹和快捷方式的图标 -->
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<!-- 对于IE9以下版本的浏览器，引入HTML5shiv和respond.min.js来支持HTML5和响应式特性 -->
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<!-- 引入H-ui框架的CSS样式 -->
<link rel="stylesheet" type="text/css" href="<%=basePath%>static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="<%=basePath%>static/h-ui.admin/css/H-ui.admin.css" />
<!-- 引入图标字体 -->
<link rel="stylesheet" type="text/css" href="<%=basePath%>lib/Hui-iconfont/1.0.8/iconfont.css" />
<!-- 皮肤样式 -->
<link rel="stylesheet" type="text/css" href="<%=basePath%>static/h-ui.admin/skin/default/skin.css" id="skin" />
<!-- 自定义样式 -->
<link rel="stylesheet" type="text/css" href="<%=basePath%>static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<!-- 对于IE6浏览器，使用DD_belatedPNG_0.0.8a-min.js来修复PNG图片的显示问题 -->
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<!--/meta 作为公共模版分离出去-->
<title>添加管理员</title>
</head>
<body>
<article class="page-container">
    <!-- 表单开始 -->
	<form action="<%=basePath%>AddMemberServlet" method="post" class="form form-horizontal" id="form-member-add">
		<!-- 用户名输入框 -->
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>用户名：</label>
			<div class="formControls col-xs-8 col-sm-9" style="width:300px;">
				<input type="text" class="input-text" value="" placeholder="" id="userName" name="userName">
			</div>
		</div>
		<!-- 密码输入框 -->
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>密码：</label>
			<div class="formControls col-xs-8 col-sm-9" style="width:300px;">
				<input type="text" class="input-text" value="" placeholder="" id="password" name="password">
			</div>
		</div>
		<!-- 确认密码输入框 -->
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>确认密码：</label>
			<div class="formControls col-xs-8 col-sm-9" style="width:300px;">
				<input type="text" class="input-text" value="" placeholder="" id="repwd" name="repwd">
			</div>
		</div>
		<!-- 真实姓名输入框 -->
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>真实姓名：</label>
			<div class="formControls col-xs-8 col-sm-9" style="width:300px;">
				<input type="text" class="input-text" value="" placeholder="" id="realName" name="realName">
			</div>
		</div>
		<!-- 性别输入框 -->
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>性别：</label>
			<div class="formControls col-xs-8 col-sm-9" style="width:300px;">
				<input type="text" class="input-text" value="" placeholder="" id="sex" name="sex">
			</div>
		</div>
		<!-- 年龄输入框 -->
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>年龄：</label>
			<div class="formControls col-xs-8 col-sm-9" style="width:300px;">
				<input type="text" class="input-text" value="" placeholder="" id="age" name="age">
			</div>
		</div>
		<!-- 身份证号码输入框 -->
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>身份证号码：</label>
			<div class="formControls col-xs-8 col-sm-9" style="width:300px;">
				<input type="text" class="input-text" value="" placeholder="" id="idCard" name="idCard">
			</div>
		</div>
		<!-- 提交按钮 -->
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去-->
<!-- 引入jQuery库 -->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<!-- 引入layer弹出层插件 -->
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<!-- 引入H-ui框架的JS -->
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script> 
<!-- 引入H-ui.admin框架的JS -->
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本--> 
<!-- 引入My97DatePicker日期选择器 -->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<!-- 引入jQuery validation插件 -->
<script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<!-- 引入jQuery validation插件的验证方法 -->
<script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<!-- 引入jQuery validation插件的中文语言包 -->
<script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
$(function(){
    // 初始化iCheck插件
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	// 初始化表单验证
	$("#form-member-add").validate({
		// 验证规则
		rules:{
			username:{
				required:true,
				minlength:2,
				maxlength:16
			},
			sex:{
				required:true,
			},
			mobile:{
				required:true,
				isMobile:true,
			},
			email:{
				required:true,
				email:true,
			},
			uploadfile:{
				required:true,
			},
			
		},
		// 不在keyup时验证
		onkeyup:false,
		// 清除焦点时的验证状态
		focusCleanup:true,
		// 验证成功时的回调函数
		success:"valid",
		// 提交表单时的回调函数
		submitHandler:function(form){
			// $(form).ajaxSubmit();
			var index = parent.layer.getFrameIndex(window.name);
			//parent.$('.btn-refresh').click();
			parent.layer.close(index);
		}
	});
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>