<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  <% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="11"
	dir="../err.asp" 
  %>
  <!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!--#include file="../rolecheck.asp"-->

<!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" />
<title></title>
<LINK href="../css/style.css" rel=stylesheet type=text/css>
<script language="javascript">
function ischeckg()
{
var strn=document.modiform.gradename.value;
 	if(strn.replace(/^\s+|\s+$/g,'')=="")
  {
   alert("请输入等级名称！");
   document.modiform.gradename.focus();
   return false;
  }	
}

</script>
   </head>
   
   <%
   moidbtn=Replace_Text(request("moidbtn"))
   gradename=Replace_Text(request("gradename"))
   isreg=Replace_Text(request("isreg"))
   isshenhe=Replace_Text(request("isshenhe"))
   isshenhe1=Replace_Text(request("isshenhe1"))
   regcontent=request("content")
   modiid=Replace_Text(request("modiid"))
   roleid=Replace_Text(request("roleid"))
   oldroleid=Replace_Text(request("oldroleid"))
   foldersize=Replace_Text(request("foldersize"))
   Restrictions=Replace_Text(request("Restrictions"))
   Article=Replace_Text(request("Article"))
   if isreg<>"" then 
   canreg=1
   else
   canreg=0
   end if
   if isshenhe<>"" then 
   shen=1 
   else
   shen=0
   end if
   if isshenhe1<>"" then 
   yxsh=1 
   else
   yxsh=0
   end if
   if  moidbtn<>"" then 
    if gradename<>"" and modiid<>""  and roleid<>""  then 
     if not isnumeric(roleid) then 
   response.Write("<script >alert('请输入等级ID值为整型数字！');history.back(-1);</script>")
   response.End()
  end if  
     if not isnumeric(foldersize) then 
   response.Write("<script >alert('请输入空间大小为整型数字！');history.back(-1);</script>")
   response.End()
  end if
    set rsmm=server.CreateObject("adodb.recordset")
  sqlmm="select   * from Websen_vipgrade where (gradename='"&gradename&"'  or roleid="&roleid&") and id<>"&modiid&""
  rsmm.open sqlmm,conn,1,3
  if not rsmm.eof then 
  resultmss="修改失败！<font color=blue>原因</font>：该等级名称或等级ID值已经存在！"
  else
     conn.execute "update Websen_vipgrade  set gradename='"&gradename&"',allowreg="&canreg&",shenhe="&shen&",regcontent='"&regcontent&"',roleid="&roleid&",foldersize="&foldersize&",yxsh="&yxsh&",Restrictions="&Restrictions&",[number]="&Article&"  where id="&modiid
  conn.execute "update Websen_corporation set gradeid="&roleid&" where gradeid="&oldroleid&""
    resultmss="修改成功！&nbsp;&nbsp;&nbsp;<a href='grademanage.asp'><font color=blue>返回等级列表</font>"&Article&"</a>"
	end if
   end if
   end if
   %>
 <body>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align=center class="tableBorder">
<tr> 
<th width="100%" height=25 class="tableHeaderText">会员等级信息修改管理</th>
</tr>
<tr>
<td class="forumRowHighlight"> <B>注意： </B><BR> ①.<font color="red">等级ID</font>是会员直属某类等级的直接<font color=red>关联值</font>，关系整个系统的所有会员的一切信息，请不要随意更改，否则将造成严重后果！ 
<br />②.等级ID值不能有重复，如有，后果自负！ 
</td>
</tr>
<tr>
<td class="forumRowHighlight">★<a href="grademanage.asp">等级列表</a>
</td>
</tr>
</table>
<table border="1" cellpadding="0"  bordercolor="#ADE0FD"  cellspacing="0" width="98%" align="center">
<tr>
  <td>
  <%
gid=Replace_Text(request("gid"))
if gid="" then 
 response.Write("<script >alert('参数传递错误!');history.back(-1);</script>")
response.End()
 else
set rsm=server.CreateObject("adodb.recordset")
sqlm="select *  from Websen_vipgrade where id="&gid
rsm.open sqlm,conn,1,3
if not rsm.eof then 
 %>
  <table width="98%" border="0" align="center" cellpadding="0"  cellspacing="0" bgcolor="#FFFFFF">
   <tr><td colspan="2"   align="center" height="25">&nbsp;&nbsp;<a href="gradeform.asp?fid=<%=rsm("id")%>">表单设置</a>&nbsp;&nbsp;<a href="graderole.asp?rid=<%=rsm("id")%>">权限设置</a>&nbsp;&nbsp;<font color="red"><%=resultmss%></font></td></tr>
<form name="modiform" method="post" action="" onSubmit="return ischeckg();">
 <tr align="center" bgcolor="#F3F3F3">
  <td width="27%" height="30" align="right" >
  <font color="#0099CC">等级名称</font>：</td>
  <td align="left"><input type="hidden" name="modiid" value="<%=gid%>" /><input type="text" name="gradename" value="<%=rsm("gradename")%>" maxlength="20"  onblur="this.value=this.value.replace(/\s/g,'');"/>
  &nbsp;&nbsp;<font color="#0099CC">等级ID值</font>：<input type="text"  maxlength="5"  name="roleid" value="<%=rsm("roleid")%>" size="5"  onBlur="if(/[^0-9]/g.test(this.value)){alert('请输入整型数字！');this.value=0}" />
  <input type="hidden" name="oldroleid" value="<%=rsm("roleid")%>" maxlength="5" />
  <font  color="#D13F25">(提示：请不要随意的修改等级名称和等级ID值)</font></td> 
</tr>
<tr><td colspan="2" bgcolor="#E8E8E8"  height="2"></td></tr>
 <tr align="center" >
  <td height="30" align="right">是否允许注册：</td>
  <td align="left"><input type="checkbox" value="<%=rsm("allowreg")%>" <%if rsm("allowreg")=1 then response.Write("checked") end  if%> name="isreg"  />允许</td></tr>
<tr align="center">
  <td height="30" align="right">是否需要审核：</td>
  <td align="left"><input type="checkbox"  value="<%=rsm("shenhe")%>" <%if rsm("shenhe")=1 then response.Write("checked") end  if%>  name="isshenhe"  />需审核</td></tr>
  <tr align="center">
  <td height="30" align="right">是否需要审核：</td>
  <td align="left"><input type="checkbox"  value="<%=rsm("yxsh")%>" <%if rsm("yxsh")=1 then response.Write("checked") end  if%>  name="isshenhe1"  />邮箱自动审核会员</td></tr>
  <tr align="center">
  <td height="30" align="right">分配空间大小：</td>
  <td align="left"><input type="text" name="foldersize" value="<%=rsm("foldersize")%>" onBlur="if(/[^0-9]/g.test(this.value)){alert('请输入整型数字！');this.value=500}"  maxlength="10"   size="6">KB</td></tr>
  <tr>
<td height="30" align="right">限制发布条数：</td>
<td><input type="radio" value="1"   name="Restrictions" id="Restrictions" onclick="Articlek()" <%if rsm("Restrictions")=1 then response.Write("checked") end  if%>/>启动
 <input type="radio" value="0" name="Restrictions" id="Restrictions"  onclick="Articles()" <%if rsm("Restrictions")<>1 then response.Write("checked") end  if%>/>禁用
 <input type="text"  maxlength="5"  name="Article" id="Article" value="<%=rsm("number")%>" size="5"  onBlur="if(/[^0-9]/g.test(this.value)){alert('请输入整型数字！');this.value=0}"  <%if rsm("Restrictions")<>1 then response.Write("style='display:none'") end  if%>/>
 </td>
</tr>

<tr align="center" bgcolor="#F5F5F5">
<td align="right"  height="25">注册协议内容：</td>
<td align="left"></td></tr>
<tr   ><td colspan="2" height="25"    align="center"><textarea name="content" style="display:none"><%=rsm("regcontent")%></textarea><iframe ID="eWebEditor1" src="../../editor/ewebeditor.asp?id=content&style=standard&originalfilename=d_originalfilename&savefilename=d_savefilename &savepathfilename=d_savepathfilename" frameborder="0" scrolling="no" width="650" HEIGHT="450"></iframe></td>
</tr>
<tr bgcolor="#F6F6F6"><td colspan="2" height="25"  align="right"></td>
</tr>
<tr><td colspan="2"  height="45"  align="center"><input name="moidbtn" type="submit" value=" 修 改 " /></td></tr>
</form>
</table>
<%
end if
end if
%>
  </td>
</tr></table>
</body><br />
<script language="javascript">
function Articles()
{
 var Articlea=document.getElementById("Article");
 Articlea.style.display="none";
}
function Articlek()
{
 var Articlea=document.getElementById("Article");
 Articlea.style.display="block";
}
</script>
</html>
