{include file='public/meta'}
<link rel="stylesheet" href="__LIB__/layui/css/layui.css" media="all">
<body>
<article class="page-container">
	<form class="form form-horizontal" id="form-admin-add">
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>用户名</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text"  placeholder="" id="uname" name="uname" value="<?php echo $row['uname'];?>" style="width:350px;" >
		</div>
	</div>

	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>手机号</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text"  placeholder="" id="phone" name="phone" value="<?php echo $row['phone'];?>"  style="width:350px;">
		</div>
	</div>


	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>密码<?php if($row){ ?>(不填写表示不修改)<?php }?></label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text"  placeholder="" id="password" name="password" style="width:350px;" >
		</div>
	</div>


	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3">用户组</label>
		<div class="formControls col-xs-8 col-sm-9">
			<span class="select-box" style="width:350px;">
				<select name="user_group_id" class="select" id='user_group_id' >
	            <option value="0">一般会员</option>
	            {volist name="$groups" id="vo"}
	            <option value="{$vo.id}" <?php if($vo['id']==$user_group_id) echo 'selected';?> ><?php echo $vo['name'];?></option>
	            {/volist}
	          </select>
			</span>
		</div>
	</div>
	<?php if(input('param.uid/d')>0){?>
	<input type="hidden" name="uid" value="<?php echo input('param.uid/d');?>">
	<?php }?>

	
	<div class="row cl">
		<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
			<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
		</div>
	</div>

	</form>
</article>

{include file='public/pfooter'}

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__LIB__/layui/layui.js"></script>
<script type="text/javascript" src="__LIB__/laydate/laydate.js"></script>
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-admin-add").validate({
		rules:{
			uname:{
				required:true,
			},
			phone:{
				required:true,
			},
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			$(form).ajaxSubmit({
				type: 'post',
				url: "{$action}" ,
				success: function(data){
					console.log(data);
					layer.msg(data.msg,{icon:1,time:1000});
					if(0==data.error){
						setTimeout(function(){
							var index = parent.layer.getFrameIndex(window.name);
							parent.location.reload();
							parent.layer.close(index);
						},1000)
					}
				},
                error: function(XmlHttpRequest, textStatus, errorThrown){
					layer.msg('服务器端错误',{icon:1,time:1000});
				}
			});
		}
	});
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>