<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!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" />
<!--[if lt IE 9]>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/html5.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/respond.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/PIE_IE678.js"></script>
<![endif]-->
<link href="${pageContext.request.contextPath }/common/admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/admin/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/admin/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/admin/lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>添加授权公司</title>
</head>
<body>
<div class="pd-20">
	<form action="${pageContext.request.contextPath }/admin/member/updateLevel" method="post" class="form form-horizontal" id="form-admin-add">
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>等级名称：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="" placeholder="" id="user-name" name="levelName">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>订单返利数量：</label>
			<div class="formControls col-5">
				<input type="text" placeholder="订单返利数量" autocomplete="off" name="levelProportion" id="level-proportion-input" value="" class="input-text">
			</div>
			<div class="col-4"><span class="Validform_checktip Validform_wrong" style="display: none" id="level-proportion-input-error">请输入数字字符,小数最多两位</span> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>升级到此所需积分：</label>
			<div class="formControls col-5">
				<input type="text" placeholder="升级到此所需积分" value="" name="levelNum" id="level-num-input" autocomplete="off" class="input-text" >
			</div>
			<div class="col-4"><span class="Validform_checktip Validform_wrong" style="display: none" id="level-num-input-error">请输入数字字符,小数最多两位</span> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>简介：</label>
			<div class="formControls col-5">
				<textarea name="levelDesc" cols="" rows="" class="textarea"  placeholder="说点什么...100个字符以内" onKeyUp="textarealength(this,100)"></textarea>
				<p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<div class="col-9 col-offset-3">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/Validform/5.3.2/Validform.min.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/layer/1.9.3/layer.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.admin.js"></script> 
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-admin-add").Validform({
		tiptype:2,
		callback:function(form){
			// 返利百分比校验
			var levelProportionInput = $("#level-proportion-input").val();
			if (levelProportionInput.indexOf(".") != -1) {
				// 小数
				if (!(/^(([1-9]\d*)(\.\d{1,})|(0\.[1-9]\d*)|(0\.\d*[1-9]))$/.test(levelProportionInput))) {
					$("#level-proportion-input-error").show();
					return false;
				}
			} else {
				if (levelProportionInput.length > 5) {
					$("#level-proportion-input-error").show();
					return false;
				}
				if (!(/^[0-9]*$/.test(levelProportionInput))) {
					$("#level-proportion-input-error").show();
					return false;
				}
			}
			// 升级所需积分校验
			var levelNumInput = $("#level-num-input").val();
			if (levelNumInput.indexOf(".") != -1) {
				// 小数
				if (!(/^(([1-9]\d*)(\.\d{1,})|(0\.[1-9]\d*)|(0\.\d*[1-9]))$/.test(levelNumInput))) {
					$("#level-num-input-error").show();
					return false;
				}
			} else {
				if (levelNumInput.length > 5) {
					$("#level-num-input-error").show();
					return false;
				}
				if (!(/^[0-9]*$/.test(levelNumInput))) {
					$("#level-num-input-error").show();
					return false;
				}
			}
			
			form[0].submit();
		}
	});
});
</script>
</body>
</html>