<?php 
	$this->display(tpl('head'));
	$mobile=C('MYDB.mobile_rz_state') ? 'readonly' : '';
	$email=C('MYDB.email_rz_state') ? 'readonly' : '';
	$id_card=C('MYDB.id_rz_state')==1 ? 'readonly' : '';
?>
<style>
	.user{
		line-height: 35px;
	}
</style>
	<form class="layui-form body" method="post">
		<div class="w-100 left bcf ">
			<div class="layui-form-item">
				<label class="layui-form-label">账号</label>
				<div class="layui-input-block">
					<span class="user b"><?php echo C('MYDB.username')?></span>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">新密码</label>
				<div class="layui-input-block">
					<input type="password" placeholder="如果要修改密码，输入此项" class="layui-input  my-input" name="new_password" value="" />
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">重复新密码</label>
				<div class="layui-input-block">
					<input type="password" placeholder="如果要修改密码，重复上面的密码" class="layui-input my-input" name="new_password1" value="" />
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">老密码</label>
				<div class="layui-input-block">
					<input type="password" placeholder="如果要修改密码，必须输入老密码" class="layui-input my-input" name="oldpassword" value="" />
				</div>
			</div>
		</div>
		
		<div class="w-100 left bcf mt10">
			<div class="layui-form-item mt10">
				<label class="layui-form-label">头像</label>
				<div class="layui-input-block">
					<input type="text" class="layui-input  my-input" id="thumb" name="thumb" value="<?php echo C('MYDB.thumb') ?>" />
					<button type="button" class="layui-btn mt10" id="up_thumb">上传头像</button>
				</div>
			</div>
		</div>
		<div class="w-100 left bcf mt10">
			<div class="layui-form-item mt10">
				<label class="layui-form-label">QQ号码</label>
				<div class="layui-input-block">
					<input type="text" class="layui-input my-input" name="qq" value="<?php echo C('MYDB.qq') ?>" />
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">手机号码</label>
				<div class="layui-input-block">
					<input type="text" class="layui-input my-input" <?php echo $mobile; ?> name="mobile" value="<?php echo C('MYDB.mobile') ?>" />
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">Email</label>
				<div class="layui-input-block">
					<input type="email" {{$email}} class="layui-input my-input" name="email" value="<?php echo C('MYDB.email') ?>" />
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">联系地址</label>
				<div class="layui-input-block">
					<input type="text" class="layui-input my-input" name="address" value="<?php echo C('MYDB.address') ?>" />
				</div>
			</div>
		</div>
		<div class="w-100 left bcf mt10">
			<div class="layui-form-item mt10">
				<label class="layui-form-label">性别</label>
				<div class="layui-input-block">
					<?php C('MYDB.sex') ? $sex1 = 'checked' : $sex0 = 'checked'  ;?>
					<input type="radio" name="sex" value="1" title="男"	<?php echo $sex1 ?>>
					<input type="radio" name="sex" value="0" title="女" <?php echo $sex0 ?>>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">主体名称</label>
				<div class="layui-input-block">
					<input type="text" {{$id_card}} class="layui-input my-input" name="real_name" value="<?php echo C('MYDB.real_name') ?>" />
					姓名或者企业名称
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">主体代码</label>
				<div class="layui-input-block">
					<input type="text" {{$id_card}} class="layui-input my-input" name="id_number" value="<?php echo C('MYDB.id_number') ?>" />
					身份证号或者社会统一信用代码
				</div>
			</div>
		</div>
		<div class="w-100 left bcf mt10">
			<div class="layui-form-item mt10 center">
				<input type="hidden" name="step"  value="post" />
				<button class="layui-btn layui-btn-normal">提交</button>
			</div>
		</div>
	</from>
	<script>
		layui.use(['form','upload'], function(){
		  	var form = layui.form;
		  	var $ = layui.jquery,upload = layui.upload;
		  	
		  	var uploadInst = upload.render({
			    elem: '#up_thumb',
			    url: '/user/upfile/up',
			    done: function(res){
				    if(res.code > 0){
				        return layer.msg('上传失败');
				    }else{
				    	$('#thumb').val(res.url);
				    }
      			}
			});
		});
	</script>
<?php 
	$this->display(tpl('foot')); 
?>
