<?php $this->display(tpl('head',true)); ?>
<style>
	.layui-form-label {
	    float: left;
	    display: block;
	    padding: 9px 15px;
	    width: 10%;
	    font-weight: 400;
	    text-align: right;
	}
	.layui-input, .layui-textarea {
	    display:  inline;
	    width: 80%;
	    padding-left: 10px;
	}
</style>
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
	  	<legend>客服管理及设置</legend>
	</fieldset>
	<form class="layui-form" action="<?php echo PLUGIN_ACTION ?>kf/add"  method="post">
		<table class="layui-table">
			<tbody>
				<tr>
					<td width="200">本站用户UID：</td>
					<td>
						<input name="uid" value="<?php echo $data[uid] ?>"  placeholder="请输入一个有本站后台管理的管理员UID.此管理员必须绑定微信号" class="layui-input" type="text">
					</td>
				</tr>
				<tr>
					<td width="200">客服账号：</td>
					<td>
						<input name="kf_account" value="<?php echo $data[kf_account] ?>"  placeholder="请输入客服账号" class="layui-input" type="text">
					</td>
				</tr>
				<tr>
					<td width="200">客服工号：</td>
					<td>
						<input name="kf_id" value="<?php echo $data[kf_id] ?>"  placeholder="请输入客服工号" class="layui-input" type="text">
					</td>
				</tr>
				<tr>
					<td width="200">客服名称：</td>
					<td>
						<input name="nickname" value="<?php echo $data[nickname] ?>"  placeholder="请输入客服名称" class="layui-input" type="text">
					</td>
				</tr>
				<tr>
					<td width="200">客服密码：</td> 
					<td>
						<input name="password" value="<?php echo $data[password] ?>"  placeholder="请输入客服密码" class="layui-input" type="text">
					</td>
				</tr>
			</tbody>
		</table>
		<div class="layui-form-item">
			<div class="layui-input-block my_button">
				<input type="hidden" name="step" value="post" />
				<input type="hidden" name="id" id="id" value="<?php echo  $data[id] ?>" />
				<button class="layui-btn">立即设置</button>
			</div>
		</div>
	</form>
	<blockquote class="layui-elem-quote layui-text">
		<li>1、以上都为必填项，必须填写.</li>
		<li>2、客服昵称，最长6个汉字或12个英文字符。</li>
	</blockquote>

<script>
	layui.config({
		version: '<?php echo NOWTIME ?>'
	});
	layui.use(['form','table', 'upload'], function(){
	  	var $ = layui.jquery,table=layui.table;
		var form = layui.form;
		upload = layui.upload;
		upload.render({
		    elem: '#select_pic',
		    url: '/admin/upfile/up',
		    auto: true,
		    exts:'jpg|png',
		    before: function(obj){
		    	files = obj.pushFile(); //将每次选择的文件追加到文件队列
		    	loading = layer.load();
		    },
		    done: function(res, index, upload){
		    	layer.close(loading);
			    if(res.Result==0){
			    	layer.msg(res.content);
			    }else{
			      	$('#pic').val(res.url); 
			    }
			    delete files[index]; //删除对应的文件
		    }
		});
	});
</script>
<?php $this->display(tpl('foot',true)); ?>