<?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" placeholder="请填写TAG名称" ></li>						 
			<!-- <li><label><span class="c-red">*</span>文档数：</label><input type="text" class="input" value="<?php echo $data['total']?>" name="total" readonly="readonly" placeholder="请填写文档数"></li>	 -->
			<li><label>绑定栏目：</label><?php echo select_category('catid', $data['catid'], '≡ 全站通用 ≡', 0, 'style="width:auto"'); ?></li>	
			<li><label>描述：</label><textarea name="remarks" class="textarea" style="width:388px" placeholder="根据Tag搜索时，会展示到网站描述."><?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){
					layer.msg(msg.message, {icon:1, time:800}, function(){
						parent.location.reload();
					});
			    }else{
					layer.msg(msg.message, {icon:2});
				}
            }
        })		 
		return false;			 
	}
</script> 

</body>
</html>