<?php
	!defined('IN_MANAGE') && exit('Access Denied!');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link href="admin/template/images/tm_right.css" type="text/css" rel="stylesheet" />
<link href="statics/ui-jquery/jquery-ui.css" type="text/css" rel="stylesheet" />
<title>网站后台管理</title>
<script language="javascript" src="statics/ui-jquery/jquery-1.8.3.js"></script>
<script language="javascript" src="statics/ui-jquery/jquery-ui.js"></script>
<script language="javascript" src="admin/template/images/tm-core.js"></script>
<script language="javascript">
var i=0,j=0;

function add_member_menu()
{
	var member_menu='<div style="background:#FFFFCC; padding:4px; border:#FFCC00 1px solid; margin-bottom:4px; line-height:22px"><strong>菜单设置：</strong>?mod='+$('#folder').val()+'&amp;file='+$('#folder').val()+'&amp;action=<input type="text" name="info[member-key]['+j+']" class="input-txt-noborder" style="font-weight:normal;" size="6" /> | <input type="text" class="input-txt-noborder" name="info[member-name]['+j+']" size="10" /><br /><strong>权限设置：</strong><?php foreach($memgrade as $k => $_r){?><label title="选中<?php echo $r['name'];?>"><input type="checkbox" value="<?php echo $_r['id'];?>" name="info[member-grade]['+j+'][]" /><?php echo $_r['name'];?></label><?php }?></div>';
	j++;
	$('#mappendhtml').append(member_menu);
}

function add_admin_menu()
{
	var admin_menu='<div style="background:#FFFFCC; padding:4px; border:#FFCC00 1px solid; margin-bottom:4px; line-height:22px"><strong>菜单设置：</strong>?mod='+$('#folder').val()+'&amp;file='+$('#folder').val()+'&amp;action=<input type="text" name="info[admin-key]['+i+']" class="input-txt-noborder" style="font-weight:normal;" size="6" /> | <input type="text" class="input-txt-noborder" name="info[admin-name]['+i+']" size="10" /><br /><strong>权限设置：</strong><?php foreach($admrole as $k => $_r){?><label title="选中<?php echo $r['name'];?>"><input type="checkbox" value="<?php echo $_r['id'];?>" name="info[admin-role]['+i+'][]" /><?php echo $_r['name'];?></label><?php }?></div>';
	i++;
	$('#appendhtml').append(admin_menu);
}
</script>
</head>

<body>
	<div class="top-tips">
		<div class="tips-wrap">
			<div class="title">自定义模块</div>
			在这里可以自定义安装网站功能模块
		</div>
	</div>
	<form action="" method="post" name="myform">
	<input type="hidden" name="do_submit" value="1" />
	<table class="table-wrap" cellpadding="0" cellspacing="0">
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name" width="18%">模块名称<span>*</span></td>
			<td><input type="text"  name="info[name]" title="请输入您的模块名称" class="input-txt" size="45" /></td>
			<td class="tb-tips" >请输入您的模块名称</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF"  class="tb-name">模块文件夹<span>*</span></td>
			<td><input type="text" name="info[folder]" id="folder" title="由2-32位数字、字母、下划线组成" class="input-txt" size="12" /></td>
			<td class="tb-tips">由2-32位数字、字母、下划线组成</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">模块作者<span>*</span></td>
			<td><input type="text" name="info[author]" title="请输入您的模块作者"class="input-txt" size="45" /></td>
			<td class="tb-tips">请输入您的模块作者</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">显示会员中心菜单<span>*</span></td>
			<td><label title="该模块是否允许显示会员中心菜单"><input type="radio" name="info[inmember]" onclick="$('#membody').show();" value="1" />显示</label>&nbsp;&nbsp;<label><input type="radio" name="info[inmember]" onclick="$('#membody').hide();" checked="checked" value="0" />不显示</label></td>
			<td class="tb-tips">是否允许显示会员中心菜单</td>
		</tr>
		<tbody id="membody" style="display:none">
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">适用会员模型<span>*</span></td>
			<td>
			<?php
				foreach($memmodel as $r)
				{
			?>
			<label title="选中<?php echo $r['name'];?>"><input type="checkbox" value="<?php echo $r['id'];?>" name="info[membermodel][]" /><?php echo $r['name'];?></label> &nbsp;&nbsp;
			<?php
				}
			?>
			</td>
			<td class="tb-tips">请选择适用会员模型</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">适用会员等级<span>*</span></td>
			<td>
			<?php
				foreach($memgrade as $r)
				{
			?>
			<label title="选中<?php echo $r['name'];?>"><input type="checkbox" value="<?php echo $r['id'];?>" name="info[membergrade][]" /><?php echo $r['name'];?></label> &nbsp;&nbsp;
			<?php
				}
			?>
			</td>
			<td class="tb-tips">请选择适用会员等级</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">会员管理菜单<span>*</span></td>
			<td><span id="mappendhtml"></span>
			<a href="javascript:void();" onclick="add_member_menu();">添加菜单</a>
			</td>
			<td class="tb-tips">请设置会员管理菜单</td>
		</tr>
		</tbody>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">适用管理员角色<span>*</span></td>
			<td>
			<?php
				foreach($admrole as $r)
				{
			?>
			<label title="选中<?php echo $r['name'];?>"><input type="checkbox" value="<?php echo $r['id'];?>" name="info[adminrole][]" /><?php echo $r['name'];?></label> &nbsp;&nbsp;
			<?php
				}
			?>
			</td>
			<td class="tb-tips">请选择适用管理员角色</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">后台管理菜单<span>*</span></td>
			<td><span id="appendhtml"></span>
			<a href="javascript:void();" onclick="add_admin_menu();">添加菜单</a>
			</td>
			<td class="tb-tips">请设置后台管理菜单</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">数据表名称<span>*</span></td>
			<td><input type="text" name="info[dbtable]" title="请输入模块数据表名称"class="input-txt" size="67" /></td>
			<td class="tb-tips">请输入模块数据表名称</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">使用说明<span>*</span></td>
			<td><textarea cols="65" rows="8" name="info[rules]" class="input-txtarea"></textarea></td>
			<td class="tb-tips">模块使用说明</td>
		</tr>
		<tr>
			<td colspan="3" class="save-td"><input type="submit" name="dosubmit" class="save-btn" value="保存设置" /></td>
		</tr>
	</table>
	</form>
</body>
</html>
