<!--#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_InComeLevel] where [i_User_InComeLevel_ID]="&request.QueryString("id"))
    RW "<script>location.href='Pay_Level_Manage.asp';</script>"
end if

if request.form("Method")="AddLevel" then
    ConfigRS.OPEN "select top 1 * from [i_User_InComeLevel]" , DB_CONN , 1 , 3
    ConfigRS.addnew()
    ConfigRS("i_User_InComeLevel_Name")=request.form("i_User_InComeLevel_Name")
    ConfigRS("i_User_InComeLevel_Style")=request.form("i_User_InComeLevel_Style")
    ConfigRS("i_User_InComeLevel_MinNum")=request.form("i_User_InComeLevel_MinNum")
    ConfigRS("i_User_InComeLevel_MaxNum")=request.form("i_User_InComeLevel_MaxNum")
    ConfigRS("i_User_InComeLevel_Sort")=request.form("i_User_InComeLevel_Sort")
    ConfigRS.update()
    ConfigRS.close()
    RW "<script>alert('修改成功!');location.href='Income_Level_Manage.asp';</script>"
else
    Set ConfigRS=DB_CONN.EXECUTE("select * from [i_User_InComeLevel] order by [i_User_InComeLevel_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="SetPower.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 width="90">等级样式</td>
                <td>最低收入值</td>
                <td>最高收入值</td>
                <td>排序</td>
                <td>操作</td>
            </tr>
            <% while not ConfigRS.eof %>
            <tr>
                <td>&nbsp;<%=ConfigRS("i_User_InComeLevel_Name")%></td>
                <td>&nbsp;<img class="<%=ConfigRS("i_User_InComeLevel_Style")%>" src="/images/pixel.gif"></td>
                <td>&nbsp;<%=ConfigRS("i_User_InComeLevel_MinNum")%></td>
                <td>&nbsp;<%=ConfigRS("i_User_InComeLevel_MaxNum")%></td>
                <td>&nbsp;<%=ConfigRS("i_User_InComeLevel_Sort")%></td>
                <td>&nbsp;<a href="EditIncomeLevel.asp?LevelID=<%=ConfigRS("i_User_InComeLevel_ID")%>">编辑</a>&nbsp;&nbsp;<a href="?Method=Del&ID=<%=ConfigRS("i_User_InComeLevel_ID")%>">删除</a></td>
            </tr>
            <%
            ConfigRS.MoveNext
            wend
            %>
        </table>
        
        <form action="#" method="post" >
            <label for="i_User_InComeLevel_Name"><strong>等级名称:</strong></label>
            <input type="text" id="i_User_InComeLevel_Name" name="i_User_InComeLevel_Name" class="inputbox" value=""/>
            <br>
            <label for="i_User_InComeLevel_Style"><strong>等级Css样式:</strong></label>
            <input type="text" id="i_User_InComeLevel_Style" name="i_User_InComeLevel_Style" class="inputbox" value=""/>
            <br>
            <label for="i_User_InComeLevel_MinNum"><strong>最低收入值(整数):</strong></label>
            <input type="text" id="i_User_InComeLevel_MinNum" name="i_User_InComeLevel_MinNum" class="inputbox" value="0"/>
            <br>
            <label for="i_User_InComeLevel_MaxNum"><strong>最高收入值(整数):</strong></label>
            <input type="text" id="i_User_InComeLevel_MaxNum" name="i_User_InComeLevel_MaxNum" class="inputbox" value="0"/>
            <br>
            <label for="i_User_InComeLevel_Sort"><strong>排序(数字):</strong></label>
            <input type="text" id="i_User_InComeLevel_Sort" name="i_User_InComeLevel_Sort" class="inputbox" value="0"/>
            <br>
            <input type="hidden" value="AddLevel" name="Method"/>
            <input type="submit" value="提交" class="btn" />
        </form>
    </div>
</div>
</body>
</html>
