<?php include $this->admin_tpl('meta', 'admin');?>
<title>添加轮播分类 - YzmCMS内容管理系统</title>
</head>
<body>
<article class="page-container">
<div class="formdoby_normal"> 
	<form method="post" onsubmit="return checkall(this)">
		<ul>
			 <li><label>分类名称：</label><input type="text" class="input" name="name" value=""></li> 
			 <li>&nbsp;</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','admin');?> 
<script type="text/javascript">

function checkall(obj){
		if($("input[name='name']").val()==''){
			layer.msg('分类名称不能为空！');
			return false;
		}
        $.ajax({
            type: 'POST',
            url: '<?php echo U('cat_add');?>', 
            data: $(obj).serialize(),
		    dataType: "json", 
            success: function (msg) {
				if(msg.status == 1){
					parent.$('#typeid').append(msg.html);
					parent.layer.close(parent.layer.getFrameIndex(window.name));
			    }else{
					layer.msg(msg.message);
				}
            }
        })		 
		return false;

}
</script>
</body>
</html>