<?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>绑定栏目：</label><?php echo select_category('catid', 0, '≡ 全站通用 ≡', 0, 'style="width:auto"'); ?></li>	
			 <li><label>添加TAG：</label><span class="span_input"><span style="color:#888;font-size:12px">*支持添加多个，每个tag之间请用逗号分隔</span></span></li>	
			 <li><label>TAG名称：</label>
			 	<span class="span_input"><textarea name="tags" class="textarea" style="width:75%"></textarea></span>
			 </li>					 
			<li>
				<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.tags.value==''){
			 layer.msg('请输入TAG名称！', {icon:2});
			 return false;
		 }
        $.ajax({
            type: 'POST',
            url: '<?php echo U('add');?>', 
            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>