<div class="opwindow">
	<form name="theform2" id="theform2" method="post" action="{echo \befen\get_url()}">
	<div class="layui-form layui-row">
		<div class="layui-form-item">
			<div class="layui-col layui-col-md4">
				<label>代理名称</label>
				<input type="text" name="agent_name" id="agent_name" class="layui-input layui-input-wdith" value="{$value[agent_name]}" placeholder="请输入代理名称">
			</div>
			<div class="layui-col layui-col-md4">
				<label>代理类型</label>
				<div class="layui-input-inline layui-input-wdith">
					<select name="agent_type" id="agent_type" class="layui-select">
						<!--{loop model('Agent')->get_type() $key $val}-->
						<option value="{$val}" <!--{if $val == $value['agent_type']}-->selected<!--{/if}-->>{$val}</option>
						<!--{/loop}-->
					</select>
				</div>
			</div>
			<div class="layui-col layui-col-md4">
				<label>代理级别</label>
				<div class="layui-input-inline layui-input-wdith">
					<select name="level_id" id="level_id" class="layui-select">
						<!--{loop $this->AgentLevel $key $val}-->
						<option value="{$val[level_id]}" <!--{if $val['level_id'] == $value['level_id']}-->selected<!--{/if}-->>{$val[level_name]}</option>
						<!--{/loop}-->
					</select>
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-col layui-col-md4">
				<label>联系人</label>
				<input type="text" name="per_name" id="per_name" class="layui-input layui-input-wdith" value="{$value[per_name]}" placeholder="请输入联系人">
			</div>
			<div class="layui-col layui-col-md4">
				<label>联系电话</label>
				<input type="text" name="per_phone" id="per_phone" class="layui-input layui-input-wdith" value="{$value[per_phone]}" placeholder="请输入联系电话">
			</div>
			<div class="layui-col layui-col-md4">
				<label>电子邮箱</label>
				<input type="text" name="per_email" id="per_email" class="layui-input layui-input-wdith" value="{$value[per_email]}" placeholder="请输入电子邮箱">
			</div>
		</div>
		<div class="layui-form-item" id="area-picker">
			<div class="layui-col layui-col-md4">
				<label>所属省级</label>
				<div class="layui-input-inline layui-input-wdith">
					<select name="province" id="province" class="province-selector" data-value="{$value[province]}"><option value="">--选择省--</option></select>
				</div>
			</div>
			<div class="layui-col layui-col-md4">
				<label>所属市级</label>
				<div class="layui-input-inline layui-input-wdith">
					<select name="city" id="city" class="city-selector" data-value="{$value[city]}"><option value="">--选择市--</option></select>
				</div>
			</div>
			<div class="layui-col layui-col-md4">
				<label>所属区级</label>
				<div class="layui-input-inline layui-input-wdith">
					<select name="county" id="county" class="county-selector" data-value="{$value[county]}"><option value="">--选择区--</option></select>
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-col layui-col-md4">
				<label>详细地址</label>
				<input type="text" name="address" id="address" class="layui-input layui-input-wdith" value="{$value[address]}" placeholder="请输入详细地址">
			</div>
			<div class="layui-col layui-col-md8">
				<label>备注信息</label>
				<input type="text" name="remarks" id="remarks" class="layui-input layui-input-wdith" value="{$value[remarks]}">
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-col layui-col-md4">
				<label>结算信息-开户银行</label>
				<input type="text" name="account_bank" id="account_bank" class="layui-input layui-input-wdith" value="{$value[account_bank]}" placeholder="请输入开户银行">
			</div>
			<div class="layui-col layui-col-md4">
				<label>结算信息-账户名称</label>
				<input type="text" name="account_name" id="account_name" class="layui-input layui-input-wdith" value="{$value[account_name]}" placeholder="请输入账号名称">
			</div>
			<div class="layui-col layui-col-md4">
				<label>结算信息-账户卡号</label>
				<input type="text" name="account_number" id="account_number" class="layui-input layui-input-wdith" value="{$value[account_number]}" placeholder="请输入银行卡号">
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-col layui-col-md12" style="text-align:right;">
				<button type="button" id="cancel2" class="layui-btn layui-btn-primary" style="display:none">取消</button>
				<button type="button" id="modify2" class="layui-btn layui-btn-normal">编辑</button>
				<button type="submit" name="submit2" value="submit2" id="submit2" class="layui-btn" style="display:none">提交</button>
			</div>
		</div>
	</div>
	</form>
</div>
<script type="text/javascript">
init_Form();
init_Layarea("#area-picker");
$("#theform2").find("select,input,textarea").attr("disabled", "disabled").addClass("layui-disabled");
init_Form();
$("#cancel2").click(function(){
	$("#modify2").show();
	$("#submit2, #cancel2").hide();
	$("#theform2").find("select,input,textarea").attr("disabled", "disabled").addClass("layui-disabled");
	init_Form();
});
$("#modify2").click(function(){
	$("#modify2").hide();
	$("#submit2, #cancel2").show();
	$("#theform2").find("select,input,textarea").removeAttr("disabled").removeClass("layui-disabled");
	init_Form();
});
$("#submit2").click(function(){
	if(checkAgent("#theform2") == false) {
		return false;
	}
	ajaxSubmit(this, "", "#theform2");
});
</script>
