{js:kindeditor}
{js:artTemplate}
{js:areaSelect}

<div class="headbar">
	<div class="position"><span>会员</span><span>></span><span>会员管理</span><span>></span><span>编辑会员</span></div>
</div>
<div class="content_box">
	<div class="content form_content">
		<form action="{url:/member/member_save}" method="post" name="memberForm">
			<input name="user_id" value="" type="hidden" />
			<table class="form_table">
				<col width="150px" />
				<col />
				<tbody>
					<tr>
						<th>用户名：</th>
						<td><input class="normal" name="username" type="text" value="" pattern="required" alt="用户名不能为空" /><label>* 用户名称（必填）</label></td>
					</tr>
					<tr>
						<th>邮箱：</th>
						<td><input type="text" class="normal" name="email" pattern="email" alt="邮箱错误" empty /><label>邮箱</label></td>
					</tr>
					<tr>
						<th>密码：</th><td><input class="normal" name="password" type="password" /><label>登录密码</label></td>
					</tr>
					<tr>
						<th>确认密码：</th><td><input class="normal" name="repassword" type="password" /><label>确认密码</label></td>
					</tr>
					<tr>
						<th>会员组：</th>
						<td>
							<select class="normal" name="group_id">
								<option value=''>请选择</option>
								{query:name=user_group}
								<option value="{$item['id']}">{$item['group_name']}</option>
								{/query}
							</select>
						</td>
					</tr>
					<tr>
						<th>真实姓名：</th>
						<td><input class="normal" name="true_name" type="text" value=""  pattern="^[\u4e00-\u9fa5]{2,20}$" alt="填写2-20个中文汉字"/>
							<label>* 真实姓名（必填）</label>
						</td>
					</tr>

					<!-- add by Scott Chen on 2017-11-03  -->
					<!-- id_type beg -->
					<tr>
						<th>证件类型：</th>
						<td>
							<select  class="normal" name="id_type">
								<option value="1" selected>身份证</option>
								<option value="2">其它</option>
							</select>
						</td>
					</tr>
					<tr>
						<th>证件号码：</th>
						<td>
							<!--<input class="input_text" name='id_code' type="text" pattern="^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$" alt="填写合法身份证号码">-->
							<input class="normal" name="id_code" type="text" pattern="id_ex_18" alt="填写合法身份证号码">
							<label>* 证件号码（必填）</label>
						</td>>
					</tr>
					<!-- id_type end -->

					<tr>
						<th>性别：</th>
						<td>
							<label><input name="sex" type="radio" value="1" checked="checked" />男</label>
							<label><input name="sex" type="radio" value="2" />女</label>
						</td>
					</tr>
					<tr>
						<th>电话：</th><td><input class="normal" name="telephone" type="text" value="" empty pattern="phone" alt="格式不正确 格式：（地区号-）用户号（-分机号）如010-66668888-123" /><label>格式：（地区号-）用户号（-分机号）如010-66668888-123</label></td>
					</tr>
					<tr>
						<th>手机：</th><td><input class="normal" name="mobile" type="text" value="" empty pattern="mobi" alt="格式不正确" /><label>手机号码</label></td>
					</tr>
					<tr>
						<th>地区：</th>
						<td>
							<select name="province" child="city,area"></select>
							<select name="city" child="area"></select>
							<select name="area"></select>
						</td>
					</tr>
					<tr>
						<th>地址：</th><td><input class="normal" name="contact_addr" type="text" value="" /><label>联系地址</label></td>
					</tr>
					<tr>
						<th>邮编：</th><td><input class="normal" name="zip" type="text" value="" empty pattern="zip" alt="格式不正确（6位数字）" /><label>邮政编码</label></td>
					</tr>
					<tr>
						<th>QQ：</th><td><input class="normal" name="qq" type="text" value="" empty pattern="qq" alt="格式不正确" /><label>QQ号码</label></td>
					</tr>
					<tr>
						<th>经验值：</th><td><input class="normal" name="exp" type="text" value="" /></td>
					</tr>
					<tr>
						<th>积分：</th><td><input class="normal" name="point" type="text" value="" /></td>
					</tr>
					<tr>
						<th>状态：</th>
						<td>
							<select name="status">
								<option value="1">正常</option>
								<option value="2">删除</option>
								<option value="3">锁定</option>
							</select>
						</td>
					</tr>
					<tr>
						<td></td><td><button class="submit" type="submit"><span>确 定</span></button></td>
					</tr>
				</tbody>
			</table>
		</form>
	</div>
</div>
<script language="javascript">
//DOM加载完毕
$(function(){
	var areaInstance = new areaSelect('province');

	//修改模式
	var formObj = new Form('memberForm');
	formObj.init({echo:JSON::encode($this->userInfo)});

	//地区初始化
	{if:$this->userInfo && $this->userInfo['area']}
	{set:$area = explode(',',trim($this->userInfo['area'],','))}
	areaInstance.init({"province":"{$area[0]}","city":"{$area[1]}","area":"{$area[2]}"});
	{else:}
	areaInstance.init();
	{/if}
});
</script>
