<?php include $this->admin_tpl('meta');?>
<title>编辑TAG - YzmCMS内容管理系统</title>
</head>
<body>
<article class="page-container">
<div class="formdoby_normal"> 
	<form method="post" onsubmit="return dosub(this)">
		<ul>
			<li><label><span class="c-red">*</span>TAG：</label><input type="text" class="input" value="<?php echo $data['tag']?>" name="tag"></li>						 
			<li><label><span class="c-red">*</span>文档数：</label><input type="text" class="input" value="<?php echo $data['total']?>" name="total" readonly="readonly"></li>	
			<li><label>描述：</label><textarea name="remarks" class="textarea" style="width:388px"><?php echo $data['remarks']?></textarea></li>			
			<li>
				<input type="hidden" name="id" value="<?php echo $data['id']?>">
				<input type="hidden" name="dosubmit" value="1">
				<input class="dosubmit w_120 btn-primary radius" type="submit" value="提交">
				<input class="btn w_120 btn-default radius" type="button" value="取消" onclick="yzmcms_close()">
			</li>
		</ul>
	</form>
</div>
</article>
<?php include $this->admin_tpl('footer');?>

<script type="text/javascript">
	function dosub(obj){	
		if(obj.tag.value==''){
		 layer.msg('TAG名称不能为空！', {icon:2});
		 return false;
		}
		if(isNaN(obj.total.value) || obj.total.value<0){
			 layer.msg('文档数只能为数字且大于0的值！', {icon:2});
			 return false;
		}
        $.ajax({
            type: 'POST',
            url: '<?php echo U('edit');?>', 
            data: $(obj).serialize(),
		    dataType: "json", 
            success: function (msg) {
				if(msg.status == 1){
					parent.location.reload();       
			    }else{
					layer.msg(msg.message, {icon:2});
				}
            }
        })		 
		return false;			 
	}
</script> 

</body>
</html>