<?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 disabled" 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>SEO标题：</label><input type="text" class="input" value="<?php echo $data['seo_title']?>" name="seo_title"></li>	
			<li><label>SEO关键字：</label><input type="text" class="input" value="<?php echo $data['seo_keywords']?>" name="seo_keywords"></li>	
			<li><label>SEO描述：</label><textarea name="seo_description" class="textarea" style="width:75%"><?php echo $data['seo_description']?></textarea></li>			
		</ul>
		<div class="footer_btn">
			<input type="hidden" name="dosubmit" value="1">
			<input type="hidden" name="id" value="<?php echo $data['id']?>">
			<input class="btn btn-primary radius" type="submit" value="提 交">
			<input class="btn btn-default radius" type="button" value="取 消" onclick="yzmcms_close()">	
		</div>
	</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>