<!--#include file="../inc/DAL.asp"-->
<!--#include file="Check.asp"-->
<%
Dim ConfigRS
Set ConfigRS=Server.CreateObject( "ADODB.Recordset" )
if request.QueryString("Method")="Del" then 
    DB_CONN.EXECUTE("delete from [i_User_Class] where [i_User_Class_ID]="&request.QueryString("id"))
    RW "<script>location.href='SetPower.asp';</script>"
end if
if request.form("Method")="SetPower" then
    ConfigRS.OPEN "select top 1 * from [i_User_Class]" , DB_CONN , 1 , 3
    ConfigRS.addnew()
    ConfigRS("i_User_Class_Name")=request.form("i_User_Class_Name")
    ConfigRS("i_User_Class_Style")=request.form("i_User_Class_Style")
    ConfigRS("i_User_Class_SortValue")=request.form("i_User_Class_SortValue")
    ConfigRS("i_User_Class_Sort")=request.form("i_User_Class_Sort")
    'ConfigRS("i_User_Class_DisKick")=request.form("i_User_Class_DisKick")
    'ConfigRS("i_User_Class_AlwaysEnterRoom")=request.form("i_User_Class_AlwaysEnterRoom")
    'ConfigRS("i_User_Class_FreeSpeaker")=request.form("i_User_Class_FreeSpeaker")
    ConfigRS.update()
    ConfigRS.close()
    RW "<script>alert('修改成功!');location.href='SetPower.asp';</script>"
else
    Set ConfigRS=DB_CONN.EXECUTE("select * from [i_User_Class] order by [i_User_Class_Sort] desc")
end if
%>
<!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>
<title>ImChat v1.5 Manage System</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="styles/layoutContent.css" rel="stylesheet" type="text/css" />
<link href="themes/blue/styles.css" rel="stylesheet" type="text/css" />
<link href="/i/v2/css/level.css" rel="stylesheet" type="text/css" />
<style>
.JSTB{border:#ccc solid 1px;border-right:none;border-bottom:none;margin-top:20px;}
.JSTB th,.JSTB td{border-bottom:#ccc solid 1px; border-right:#ccc solid 1px;}
</style>
</head>
<body>
<div class="contentcontainer">
    <div class="headings alt">
        <h2>角色权限设置&nbsp;&nbsp;&nbsp;<a href="Pay_Level_Manage.asp" style="text-decoration:none;">消费等级管理</a>&nbsp;&nbsp;&nbsp;<a href="Income_Level_Manage.asp" style="text-decoration:none;">收入等级管理</a>&nbsp;&nbsp;&nbsp;<a href="javascript:\\;" onclick="location.reload();" style="text-decoration:none;">刷新</a></h2>
    </div>
    <div class="contentbox">
        <table class="JSTB" width="100%" cellpadding="0" cellspacing="0" border="0">
            <th colspan="16">角色列表</th>
            <tr>
                <td>角色名</td>
                <td>角色样式</td>
                <td>角色权重</td>
                <td>排序</td>
                <td>操作</td>
            </tr>
            <% while not ConfigRS.eof %>
            <tr>
                <td>&nbsp;<%=ConfigRS("i_User_Class_Name")%></td>
                <td>&nbsp;<img class="<%=ConfigRS("i_User_Class_Style")%> userLevelSmall" src="/images/pixel.gif"></td>
                <td>&nbsp;<%=ConfigRS("i_User_Class_SortValue")%></td>
                <td>&nbsp;<%=ConfigRS("i_User_Class_Sort")%></td>
                <td>&nbsp;<a href="EditPower.asp?PowerID=<%=ConfigRS("i_User_Class_ID")%>">编辑</a>&nbsp;&nbsp;<a href="?Method=Del&ID=<%=ConfigRS("i_User_Class_ID")%>">删除</a>&nbsp;&nbsp;<a href="User_Manage.asp?t=p&PowerID=<%=ConfigRS("i_User_Class_ID")%>">用户列表</a></td>
            </tr>
            <%
            ConfigRS.MoveNext
            wend
            %>
        </table>
        
        <form action="#" method="post" >
            <label for="i_User_Class_Name"><strong>角色名称:</strong></label>
            <input type="text" id="i_User_Class_Name" name="i_User_Class_Name" class="inputbox" value=""/>
            <br>
            <label for="i_User_Class_Style"><strong>样式:</strong></label>
            <input type="text" id="i_User_Class_Style" name="i_User_Class_Style" class="inputbox" value=""/>
            <br>
            <label for="i_User_Class_SortValue"><strong>权重(数字):</strong></label>
            <input type="text" id="i_User_Class_SortValue" name="i_User_Class_SortValue" class="inputbox" value=""/>
            <br>
            <label for="i_User_Class_Sort"><strong>排序(数字):</strong></label>
            <input type="text" id="i_User_Class_Sort" name="i_User_Class_Sort" class="inputbox" value=""/>
            <br>
            <input type="hidden" value="SetPower" name="Method"/>
            <input type="submit" value="提交" class="btn" />
        </form>
    </div>
</div>
</body>
</html>
