<%@  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.gradeform.addgradename.value;
 	if(strn.replace(/^\s+|\s+$/g,'')=="")
    {
        alert("请输入等级名称！");
        document.gradeform.addgradename.focus();
        return false;
    }	
}
function isdelo()
{
    var i=confirm("你确定要删除吗?");
    if(i)
    {
        return true ;
    }
    else
    {
        return false;
    }
 }
    </script>

</head>
<%
'添加等级处理^^^^start^^^^^^^^^^^^^

dim addgradename,addisrole,addisshenhe,addg,addroleid

addg=Replace_Text(request.Form("addg"))
addgradename=Replace_Text(request.Form("addgradename"))
addisreg=Replace_Text(request.Form("addisreg"))
addisshenhe=Replace_Text(request.Form("addisshenhe"))
addroleid=Replace_Text(request.Form("addroleid"))
foldersize=Replace_Text(request.Form("foldersize"))
if addg<>"" then 

    if addgradename<>""  and addroleid<>"" then 
    
        if not isnumeric(addroleid) 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
        
        if addisreg<>"" then 
            canreg=1
        else
           canreg=0
        end if
        
        if addisshenhe<>"" then 
            shen=1
        else
            shen=0
        end if
        set rsadd=server.CreateObject("adodb.recordset")
        sqladd="select * from Websen_vipgrade  where gradename='"&addgradename&"'  or roleid="&addroleid&" "
        rsadd.open sqladd,conn,1,3
        if not rsadd.eof then 
            response.Write("<script>alert('对不起！该等级名称或等级ID已经存在！');history.back(-1);</script>")
            response.End()
        else
            rsadd.addnew
            rsadd("gradename")=addgradename
            rsadd("allowreg")=canreg
            rsadd("shenhe")=shen
            rsadd("roleid")=addroleid
            rsadd("reglist")="username,usernameb,pass,passb,pass2,pass2b,email,emailb,comname,comnameb"
            rsadd("foldersize")=foldersize
            rsadd("regcontent")="欢迎你的光临!"
            rsadd.update
            rsadd.close 
        end if
    end if
end if
 
'^^^^^^^^^^^^^^^^^^^^^^^^^^^End ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

'修改游客查看联系信息设置-------------------------------------------
 dim gope,issee
 
 gope=Replace_Text(request.Form("gope"))
 issee=Replace_Text(request.Form("issee"))
 iswrite=Replace_Text(request.Form("iswrite"))
 
    if gope<>"" and issee<>"" and iswrite<>"" then
        if issee="1" then
            conn.execute "update [Websen_worldec_config] set issee=1"
        else
            conn.execute "update [Websen_worldec_config] set issee=0"
        end if
  
        if iswrite="1" then
            conn.execute "update [Websen_worldec_config] set iswrite=1"
        else
            conn.execute "update [Websen_worldec_config] set iswrite=0"
        end if
	
	    if err then
	        msg="修改成功！"
	    else
	        msg="修改失败！"
	    end if

    end if
 '--------------------------------------------------------
%>
<body>
    <form name="peoplesee" method="post" action="grademanage.asp">
    <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>
                <font color="#666666">温馨提示:①.<font color="red">等级ID</font>是会员直属某类等级的直接<font color="red">关联值</font>，
                    关系整个系统的所有会员的一切信息，请不要随意更改，否则将造成严重后果！
                    <br />
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ②.等级ID值不能有重复，如有，后果自负！ </font>
            </td>
        </tr>
        <tr>
            <td height="1" bgcolor="#CCCCCC">
            </td>
        </tr>
        <tr>
            <td height="20">
                <%
    set rspe=server.CreateObject("adodb.recordset")
    sqlpe="select top 1 issee,iswrite from Websen_worldec_config"
    rspe.open sqlpe,conn,1,3
    if not rspe.eof then
                %>
                <font color="red">※</font> <font color="#0099FF">游客：①是否可以查看联系信息:</font>
                <input type="radio" name="issee" value="1" <% if   rspe("issee")=1 then response.Write("checked") end if %> />允许&nbsp;
                <input type="radio" name="issee" value="0" <% if   rspe("issee")=0 then response.Write("checked") end if %> />禁止&nbsp;
                &nbsp; <font color="#0099FF">②是否可以在会员模板网站留言:</font>
                <input type="radio" name="iswrite" value="1" <% if rspe("iswrite")=1 then response.Write("checked") end if %> />允许&nbsp;
                <input type="radio" name="iswrite" value="0" <% if rspe("iswrite")=0 then response.Write("checked") end if %> />禁止&nbsp;
                <input type="submit" name="gope" value="修改" />&nbsp;<font color="red"><%=msg%></font>
            </td>
        </tr>
        <%
    rspe.close
    end if
        %>
    </table>
    </form>
    <table border="1" cellpadding="0" bordercolor="#ADE0FD" cellspacing="0" width="98%"
        align="center">
        <tr>
            <td>
                <table border="0" cellpadding="0" bordercolor="#0099CC" cellspacing="0" width="100%"
                    align="center">
                    <tr bgcolor="#6188D7" height="25" style="color: #FFFFFF; font-weight: bold">
                        <td colspan="2" align="center">
                            等级ID值
                        </td>
                        <td width="13%">
                            等级名称                        </td>
                        <td width="12%">
                            是否允许注册                        </td>
                        <td width="12%">
                            是否需审核开通                        </td>
                        <td width="15%">
                            注册时默认分配空间                        </td>
                        <td width="10%">
                            注册表单设置                        </td>
                        <td width="10%">
                            权限功能设置                        </td>
                        <td width="7%">
                            会员标志                        </td>
                        <td colspan="2">
                            删除
                        </td>
                    </tr>
                    <form method="post" action="" name="gradeform" onsubmit="return ischeckg();">
                    <tr bgcolor="#F2F2F2" height="25">
                        <td width="4%">
                            <font color="red">添加→</font></td>
                        <td width="3%">
                            <input type="text" value="0" maxlength="5" name="addroleid" size="5" onblur="if(/[^0-9]/g.test(this.value)){alert('请输入整型数字！');this.value=0}" />
                      </td>
                        <td>
                            <input type="text" name="addgradename" maxlength="20" size="15" onblur="this.value=this.value.replace(/\s/g,'');" /></td>
                        <td>
                            <input type="checkbox" name="addisreg" value="1" />允许</td>
                        <td>
                            <input type="checkbox" name="addisshenhe" value="1" />需审核</td>
                        <td>
                            <input type="text" name="foldersize" value="500" onblur="if(/[^0-9]/g.test(this.value)){alert('请输入整型数字！');this.value=500}"
                                maxlength="10" size="6">KB
                        </td>
                        <td>
                            <img src="../../images/editg.gif" /></td>
                        <td>
                            <img src="../../images/editg.gif" />
                        </td>
                        <td>
                            <img src="../../images/editg.gif" />
                        </td>
                        <td width="7%">
                            <font color="blue"><b>×</b></font>
                        </td>
                        <td width="7%">
                            <input type="submit" name="addg" value="添加" /></td>
                    </tr>
                    <tr>
                        <td colspan="10" height="2" bgcolor="#0099CC">
                        </td>
                    </tr>
                    </form>
                    <%
set rs=server.CreateObject("adodb.recordset")
sql="select * from Websen_vipgrade order by roleid "
rs.open sql,conn,1,1
msg_per_page=15  '定义每页显示记录条数

if not rs.eof then 
   		
                    %>
                    <!--#include file="../../inc/headpage.asp"-->
                    <%
j=1
 
    do while not rs.eof and rowcount > 0 
                    %>
                    <tr height="30" <%if j mod 2=0 then response.Write("bgcolor=#EEF0F2 onMouseOut=""this.style.backgroundColor='#EEF0F2'"" onMouseOver=""this.style.backgroundColor='#D7E3F3'""") else response.Write("bgcolor=#ffffff  onMouseOut=""this.style.backgroundColor='#ffffff'"" onMouseOver=""this.style.backgroundColor='#D7E3F3'""") end if%>>
                        <td colspan="2" align="center">
                            <font color="#666666">【</font><font color="#0099CC"><b><%=rs("roleid")%></b></font><font
                                color="#666666">】</font></td>
                        <td>
                            <%=rs("gradename")%>
                        </td>
                        <td>
                            <%if rs("allowreg")=1 then response.Write("<font color=red>√</font>") else response.Write("×") end if%>允许</td>
                        <td>
                            <%if rs("shenhe")=1 then response.Write("<font color=red>√</font>需") else response.Write("×不需") end if%>审核</td>
                        <td>
                            <%=rs("foldersize")%></td>
                        <td>
                            <a href="gradeform.asp?fid=<%=rs("id")%>">
                                <img src="../../images/editg.gif" border="0" /></a></td>
                        <td>
                            <a href="graderole.asp?rid=<%=rs("id")%>">
                                <img src="../../images/editg.gif" border="0" /></a>
                        </td>
                        <td>
                            <a href="gradefile.asp?rid=<%=rs("id")%>">
                                <img src="../../images/editg.gif" border="0" /></a>
                        </td>
                        <td width="7%">
                            <a href="gradedel.asp?gid=<%=rs("id")%>&roleid=<%=rs("roleid")%>&gaction=del&page=<%=request("page")%>"
                                onclick="return isdelo();"><font color="blue"><b>×</b></font></a>
                        </td>
                        <td colspan="2">
                            <a href="grademodi.asp?gid=<%=rs("id")%>">修改</a>
                        </td>
                    </tr>
                    <%
    rowcount=rowcount-1
    rs.movenext
    j=j+1
    loop
    end if 
                    %>
                    <tr>
                        <td colspan="9" align="center">
                            <%=listPages("grademanage.asp")%>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</body>
</html>
