<?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 class="yzm-explain-box">
			 	<label>附加参数：</label>
			 	<input type="text" class="input" placeholder="如：id=1&mid=2" name="data">
			 	<span class="yzm-explain">为一级菜单时，<br>可填写icon图标</span>
			 </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>