<!-- #include file="include/adovbs.inc" -->
<!-- #include file="include/dataconn.asp" -->
<!-- #include file="include/checkhy.asp" -->
<%
Response.Buffer =false
Response.Expires=-1


if session("secondpassword")="" then
	Response.Redirect "InputPassword.asp?pageID=HyPickupMoney.asp"
end if

HyNumber=session("HyNumber")
set HyRs=server.CreateObject("adodb.recordset")


	sql = "select HyPickupMoneyLog.*,HyMoneyAccount.HyMoneyAccount from HyPickupMoneyLog "
	sql =sql & " left join HyMoneyAccount on HyMoneyAccount.Hynumber=HyPickupMoneyLog.HyNumber"
	sql =sql & "  where HyPickupMoneyLog.HyNumber='"& HyNumber &"' order by HyPickupMoneyLog.id desc" 
	HyRs.Open sql,conn
	j=HyRs.RecordCount 
	
set Hy1Rs=nothing
set Hy1Rs=server.CreateObject("adodb.recordset")
sql="select HyMoneyAccount from HyMoneyAccount where HyNumber='" & HyNumber & "'"
'response.write sql
Hy1Rs.open sql,conn
if Hy1Rs.recordcount>0 then
	HyMoneyAccount=Hy1Rs("HyMoneyAccount")
else
	HyMoneyAccount=0
end if

%>
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<link rel="stylesheet" href="include/e1.css" type="text/css">
</head>
<script>
	function openwin(page,size)
	{
		window.open(page,"newuser","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+ size);
	}
	function makesure()
	{
		return(confirm("你确认要进行此操作吗？"))
	}

	function check()
	{
		if(form2.PickupCount.value=="")
		{
			alert("至少需要输入提款金额！");
			document.form2.PickupCount.focus();
			return false;
		}
		if(form2.PayPal.value=="")
		{
			alert("至少需要输入PAYPAL电子邮箱帐号！");
			document.form2.PayPal.focus();
			return false;
		}		
		else
		{
			return true;
			document.form2.submit();
		}

	}
	
</script>
<body leftmargin="10" topmargin="10" marginwidth="0" marginheight="0">


<p>
 
<br>
      <FORM name=form2 action="AddPickupMoneyLog.asp?HyNumber=<% =HyNumber%>" method=post  onsubmit="return check();" >
  <table align="center" bgcolor="#AAAAAA" border="0" cellpadding="0" cellspacing="0"  width="60%">
    <tr><td>
  <TABLE width=100% border=0 align=center cellpadding="5" cellspacing="1" bordercolorlight="#AAAAAA"  bordercolordark="#FFFFFF">
          <TBODY>
      <TR bgcolor="#FFFFFF"> 
        <TD width="272" height="25" align=middle>
<div align="right"><font color="#000000">帐户余额：</font> </div></TD>
        <TD width="315" height="25" align=middle>
<div align="left"><font color="#000000"><strong><font color="#FF0000"> 
            &nbsp;<% =HyMoneyAccount%>
            </font></strong></font></div></TD>
      </TR>
      <tr  bgcolor="#FFFFFF"> 
        <td height="25"> 
          <div align="right"><font color="#000000"> 提款金额：</font> <font color="#000000"> 
          </div></td>
        <td height="25"> 
          &nbsp;<input name="PickupCount" type="text" size="20"> </td>
      </TR>
    <tr bgcolor="#FFFFFF"> 
        <td height="25"> 
          <div align="right"><font color="#000000"> 银行帐号：</font> <font color="#000000"> 
                </div></td>
        <td height="25">
			&nbsp;<input name="PayPal" type="text" size="20"></td>
    </TR>
    <TR bgcolor="#FFFFFF"> 
      <td colspan="2"> <div align="center"> 
            <input type="submit" class="b02"  name="Submit" value="申请提款">
        </div></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2"></TBODY> 
  </TABLE>
  </td></tr></table>  
      </FORM>
	  <br>
 <%
    if j>0 then
    dim i 
    i=1
    const pagesize=15
           
    HyRs.PageSize = pagesize
    total=HyRs.PageCount 
	pageno=Request("pageno")
	if pageno="" then pageno=1
    if not isnumeric(pageno) and pageno<>"" then
	 %>
  <script>alert("请输入正确的页码");
		window.history.back();</script>
  <%Response.End
	End if
	if (pageno-1)*pagesize>=j then
        if (j mod pagesize)=0 then
            pageno= j \ pagesize
        else
            pageno= j \ pagesize + 1
       end if
    end if		
	if pageno<1 then 
	 %>
  <script>alert("页码数不能小于１");
		window.history.back();</script>
  <%Response.End
	End if	
	if (pageno>65535) then
	%>
  <script>alert("页码数不能大于总数！");
		window.history.back();</script>
  <%Response.End 
	end if
	
	
	if (clng(pageno)>clng(total)) then %>
  <script>alert("页码数不能大于总数！");
		window.history.back();</script>
  <%	
   Response.End 
	end if
    pageno=cint(pageno)	
%>
</p>	    
<table align="center" bgcolor="#AAAAAA" border="0" cellpadding="0" cellspacing="0"  width="100%">
  <tr><td>
<table border="0" cellpadding="5" cellspacing="1" width="100%" bordercolordark="#FFFFFF" bordercolorlight="#AAAAAA">
        <tr class="td3" >
          <td width="6%" height="25" class="smallEmphasis"> 
            <div align="center">行</div></td>
          <td width="10%" height="25" class="smallEmphasis"> 
            <div align="center">提款帐号</div></td>
          <td width="10%" height="25" class="smallEmphasis"> 
            <div align="center">提款金额</div></td>
          <td width="10%" height="25" class="smallEmphasis"> 
            <div align="center">帐号余额</div></td>
          <td width="15%" height="25" class="smallEmphasis"> 
            <div align="center">申请日期</div></td>
          <td width="10%" height="25" class="smallEmphasis"> 
            <div align="center">状态</div></td>
          <td width="6%" height="25" class="smallEmphasis"> 
            <div align="center">处理日期</div></td>
        </tr>
        <%
    HyRs.absolutepage=pageno     
    dim x
	i=1
    x=2
    while (not HyRs.eof) and (i<=pagesize) 
      if x mod 2 then
 %>
        <tr bgcolor="#FFFFFF"> 
          <%
 else
 %>
        <tr bgcolor="#FFFFFF"> 
          <%
 end if
 %>
          <td height="25"> 
            <div align="center"> 
              <% =i%>
            </div></td>
          <td><div align="center"><%=HyRs("HyNumber")%>&nbsp;</div></td>
          <td><div align="center"><%=HyRs("PickupCount")%>&nbsp</div></td>
          <td><div align="center"><%=HyRs("HyMoneyAccount")%>&nbsp</div></td>
          <td> <div align="center"> 
              <% =HyRs("PickupDate")%>
              &nbsp;</div></td>
          <td> <div align="center"> 
              <% if HyRs("PickupStatus")=0 then%>
              <font color="#0000FF">处理中</font> 
              <%elseif HyRs("PickupStatus")=1 then%>
              <font color="#009900">已支付</font> 
              <%elseif HyRs("PickupStatus")=2 then%>
              <font color="#FF0000">拒绝支付</font> 
              <%end if%>
              &nbsp;</div></td>
          <td> <div align="center"> 
              <% =HyRs("ApprovedDate")%>
              &nbsp;</div></td>
          <%
	HyRs.movenext
	i=i+1
	x=x+1
	wend %>
        </tr>
        <%
  else
	Response.Write "没有提款记录！<a href='javascript:history.back()'>返回</a>"
 end if%>
      </table>
  </td></tr></table>  
<p></p>
<%if j>0 then%>
<table align="center">
  <tr> 
    <form name="thisform1" method="Post" action="HyPickupMoney.asp?findcontent=<%=content%>">
      <td>到第 
        <input type="text" name="pageno" value="<% =pageno%>" size="3">
        页<a onclick="javascript:thisform1.submit();">GO</a> </font></td>
    </form>
    <td>第 
      <% =pageno %>页
      /共 
      <% =total%>
      页</font></td>
    <% if pageno<=1 then %>
    <td><font color="#cccccc">首页</font></td>
    <td><font color="#cccccc">上一页</font></td>
    <% else %>
    <td><a href="HyPickupMoney.asp?pageno=1&amp;findcontent=<%=content%>"><font face="Webdings" color="#FFFFFF">9</font>首页</font></a></td>
    <td><a href="HyPickupMoney.asp?pageno=<%=pageno-1%>&amp;findcontent=<%=content%>">上一页</font></a></td>
    <%end if%>
    <% if pageno>=total then %>
    <td><font color="#cccccc">下一页</font></td>
    <td><font color="#cccccc">尾页</font></td>
    <%else%>
    <td><a href="HyPickupMoney.asp?pageno=<%=pageno+1%>&amp;findcontent=<%=content%>">下一页</font></a></td>
    <td><a href="HyPickupMoney.asp?pageno=<%=total%>&amp;findcontent=<%=content%>">尾页</font></a></td>
    <% end if%>
  </tr>
</table>
<%end if%>
</body>
</html>
