<?php include $this->admin_tpl('meta');?>
<title>添加菜单 - YzmCMS内容管理系统</title>
</head>
<body>
<article class="page-container">
<div class="formdoby_normal"> 
	<form method="post" onsubmit="return dosub(this)">
		<ul>
			 <li>
			 <label>上级菜单：</label>
			 <select  name="parentid" size="1">
				<option value="0">一级菜单</option>
			   <?php echo $select_menus;?>			
			 </select>
			 </li>		
			 <li><label><span class="c-red">*</span>菜单名称：</label><input type="text" class="input" placeholder="菜单名称" name="name" value=""></li>	
			 <li><label><span class="c-red">*</span>模块名：</label><input type="text" class="input" placeholder="模块名" name="m" value=""></li>	
			 <li><label><span class="c-red">*</span>类名：</label><input type="text" class="input" placeholder="类名" name="c" value=""></li>	
			 <li><label><span class="c-red">*</span>方法名：</label><input type="text" class="input" placeholder="方法名" name="a" value=""></li>	
			 <li><label>附加参数：</label><input type="text" class="input" placeholder="为一级菜单时，填写图标字体，子菜单时填写如：id=1&mid=2" name="data"></li>
			 <li><label>是否显示菜单：</label>
			 <span class="span_input">
			 	<label class="label_radio"><input name="display" type="radio" value="1" checked> 显示</label>
			 	<label class="label_radio"><input name="display" type="radio" value="0" > 隐藏</label>
			 </span>
			 </li>
			<li>
				<input type="hidden" name="dosubmit" value="1">
			 	<input class="dosubmit w_120 btn-primary radius" name="dosubmit" type="submit" value="提交">
			 	<input class="btn w_120 btn-default radius h35" 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.name.value==''){
			 layer.msg('菜单名称不能为空！');
			 return false;
		 }
		 if(obj.name.value==''){
			 layer.msg('模块名不能为空！');
			 return false;
		 }
		 if(obj.name.value==''){
			 layer.msg('文件名不能为空！');
			 return false;
		 }
		 if(obj.name.value==''){
			 layer.msg('方法名不能为空！');
			 return false;
		 }
        $.ajax({
            type: 'POST',
            url: '<?php echo U('add');?>', 
            data: $(obj).serialize(),
		    dataType: "json", 
            success: function (msg) {
				if(msg.status == 1){
					parent.location.reload();       
			    }else{
					layer.msg(msg.message);
				}
            }
        })		 
		return false;			 
	}
</script> 

</body>
</html>