<div class="breadcrumbs" id="breadcrumbs">
	<ul class="breadcrumb">
		<li>
			<i class="home-icon fa fa-home"></i>
			<a href="#">会员</a>
		</li>
		<li>
			<a href="#">用户组管理</a>
		</li>
		<li class="active">修改用户组</li>
	</ul>
</div>
<div class="content">
	<form action="{url:/member/group_save}" method="post">
		<input type="hidden" name="id" value="" />
		<table class="table form-table">
			<colgroup>
				<col width="130px" />
				<col />
			</colgroup>

			<tr>
				<th>用户组：</th><td><input class="form-control" name="group_name" type="text" value="" pattern="required" placeholder="会员组名称" /></td>
			</tr>
			<tr>
				<th>折扣率：</th><td><input class="form-control w-auto" name="discount" type="text" value="" pattern="float" placeholder="请输入数字" />%<p class="help-block">折扣率，例如：如果输入90，表示该会员组可以以商品原价的90%购买（允许包含小数）。</p></td>
			</tr>
			<tr>
				<th>最小经验：</th><td><input class="form-control" name="minexp" onblur="check_exp();" type="text" value="" pattern="int" placeholder="填写整数值" /><p class="help-block">进入此会员组的经验值下限</p></td>
			</tr>
			<tr>
				<th>最大经验：</th>
				<td>
					<input class="form-control" name="maxexp" onblur="check_exp();" type="text" value="" pattern="int" alt="请填写一个整数值" />
					<p class="help-block">进入此会员组的经验值上限</p>
				</td>
			</tr>
			<tr>
				<td></td><td><button class='btn btn-primary' type="submit">确定</button></td>
			</tr>
		</table>
	</form>
</div>

<script type='text/javascript'>
//表单回填
var formObj = new Form();
formObj.init({echo:JSON::encode($group)});

//检查经验输入
function check_exp()
{
	var minexp = parseInt($('[name="minexp"]').val());
	var maxexp = parseInt($('[name="maxexp"]').val());

	if(maxexp <= minexp)
	{
		alert('最大经验值必须比最小经验值大');
		$('[name="minexp"]').removeClass('valid-text');
		$('[name="maxexp"]').removeClass('valid-text');
		$('[name="minexp"]').addClass('invalid-text');
		$('[name="maxexp"]').addClass('invalid-text');
		return false;
	}
	else
	{
		$('[name="minexp"]').removeClass('invalid-text');
		$('[name="maxexp"]').removeClass('invalid-text');
	}
}
</script>
