<?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 class="mt-20">
			 <li>
			 	<label><span class="c-red">*</span>分类名称：</label>
			 	<input type="text" class="input" name="name" value="" style="width:200px">
			 </li> 
		</ul>
		<div class="footer_btn">
			<input type="hidden" name="dosubmit" value="1">
			<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','admin');?> 
<script type="text/javascript">

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

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