<!--#include file="../inc/DAL.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/page.asp"-->
<!--#include file="Check.asp"-->
<%
Dim ConfigRS
Set ConfigRS=Server.CreateObject( "ADODB.Recordset" )
if request.QueryString("Method")="1" then 
	DB_CONN.EXECUTE("update [i_User_Extraction] set [i_User_Extraction_Status]=1 where [i_User_Extraction_ID]="&request.QueryString("ID"))
    RW "<script>location.href='Extraction_Manage.asp?t="&request.QueryString("t")&"';</script>":response.end()
elseif request.QueryString("Method")="-1" then 
	DB_CONN.EXECUTE("update [i_User_Extraction] set [i_User_Extraction_Status]=-1 where [i_User_Extraction_ID]="&request.QueryString("ID"))
	DB_CONN.EXECUTE("update [i_User_Info] set [i_User_ExtractionNum]=[i_User_ExtractionNum]-"&request.QueryString("c")&" where [i_User_ID]="&request.QueryString("UID"))
    RW "<script>location.href='Extraction_Manage.asp?t="&request.QueryString("t")&"';</script>":response.end()
elseif request.QueryString("Method")="2" then 
	DB_CONN.EXECUTE("update [i_User_Extraction] set [i_User_Extraction_Status]=2 where [i_User_Extraction_ID]="&request.QueryString("ID"))
    RW "<script>location.href='Extraction_Manage.asp?t="&request.QueryString("t")&"';</script>":response.end()
end if

if request.QueryString("t")="0" then
    Set ConfigRS=DB_CONN.EXECUTE("select * from [i_User_Extraction] join [i_User_Info] on [i_User_Extraction_UID]=[i_User_ID] where [i_User_Extraction_Status]=0 order by [i_User_Extraction_Date] desc")
elseif request.QueryString("t")="1" then
    Set ConfigRS=DB_CONN.EXECUTE("select * from [i_User_Extraction] join [i_User_Info] on [i_User_Extraction_UID]=[i_User_ID] where [i_User_Extraction_Status]=1 order by [i_User_Extraction_Date] desc")
elseif request.QueryString("t")="-1" then
    Set ConfigRS=DB_CONN.EXECUTE("select * from [i_User_Extraction] join [i_User_Info] on [i_User_Extraction_UID]=[i_User_ID] where [i_User_Extraction_Status]=-1 order by [i_User_Extraction_Date] desc")
elseif request.QueryString("t")="2" then
    Set ConfigRS=DB_CONN.EXECUTE("select * from [i_User_Extraction] join [i_User_Info] on [i_User_Extraction_UID]=[i_User_ID] where [i_User_Extraction_Status]=2 order by [i_User_Extraction_Date] desc")
else
    Set ConfigRS=DB_CONN.EXECUTE("select * from [i_User_Extraction] join [i_User_Info] on [i_User_Extraction_UID]=[i_User_ID] order by [i_User_Extraction_Date] desc")
end if
ConfigRS.pagesize=20
if isempty(request("page")) or request("page")="" then curpage=1 else curpage=Cint(request("page")) end if
if not ConfigRS.eof then ConfigRS.absolutepage = curpage

%>
<!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/v1/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="javascript:\\;" onclick="location.reload();" style="text-decoration:none;">刷新</a>&nbsp;&nbsp;&nbsp;<a href="Extraction_Manage.asp?t=1" style="text-decoration:none;">已受理未打款</a>&nbsp;&nbsp;&nbsp;<a href="Extraction_Manage.asp?t=2" style="text-decoration:none;">已打款</a>&nbsp;&nbsp;&nbsp;<a href="Extraction_Manage.asp" style="text-decoration:none;">所有</a></h2>
    </div>
    <div class="contentbox">
        <table class="JSTB" width="100%" cellpadding="0" cellspacing="0" border="0">
            <th colspan="10">提现列表</th>
            <tr>
                <td>ID</td>
                <td>用户名</td>
                <td>提现金额</td>
                <td>折合人民币</td>
                <td>时间</td>
				<td>状态</td>
                <td>操作</td>
            </tr>
            <%
            dim iPage 
            while (not ConfigRS.eof and iPage<ConfigRS.pagesize )
            %>
            <tr>
                <td>&nbsp;<%=ConfigRS("i_User_Extraction_ID")%></td>
                <td>&nbsp;<a href="EditUser.asp?UID=<%=ConfigRS("i_User_Extraction_UID")%>"><%=vbsUnEscape(ConfigRS("i_User_NickName"))%></a></td>
                <td>&nbsp;<%=ConfigRS("i_User_Extraction_MoneyNum")%></td>
                <td>&nbsp;<%=ConfigRS("i_User_Extraction_RMB")%></td>
                <td>&nbsp;<%=ConfigRS("i_User_Extraction_Date")%></td>
                <td>&nbsp;
					<%if ConfigRS("i_User_Extraction_Status")=0 then 
					RW "未受理" 
					elseif ConfigRS("i_User_Extraction_Status")=1 then 
					RW "已受理未打款" 
					elseif ConfigRS("i_User_Extraction_Status")=2 then 
					RW "已打款" 
					elseif ConfigRS("i_User_Extraction_Status")=-1 then 
					RW "已拒绝" 
					end if%>
				</td>
                <td>&nbsp;<a href="?Method=1&t=<%=request.QueryString("t")%>&ID=<%=ConfigRS("i_User_Extraction_ID")%>">受理</a>&nbsp;&nbsp;<a href="?Method=2&t=<%=request.QueryString("t")%>&ID=<%=ConfigRS("i_User_Extraction_ID")%>">已打款</a>&nbsp;&nbsp;<a href="EditUser.asp?UID=<%=ConfigRS("i_User_Extraction_UID")%>">查看账号</a>
                </td>
            </tr>
            <%
            iPage=iPage+1
            ConfigRS.MoveNext
            wend
            %>
            <tr>
                <td colspan="10"><%=ExportPageInfo(ConfigRS,curpage,iPage,"Extraction_Manage.asp?1=1"&replace(Request.QueryString,"page","1")&"&")%></td>
            </tr>
        </table>
        
    </div>
</div>
</body>
</html>
