<!--#include file="conn.asp"-->
<%
	'检查访问的来源是否合法
	call checkPrePage()


strM_ID=Trim(Session("UserID"))
%>

<%
strSQL="Select m_money from member Where id=" & strM_ID
rs.open strSQL,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>电子商务自助建站--您理想的助手</title>
<link href="common/styleMain.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="common/JS_CheckForm.js"></script>
<script language="JavaScript">

function init(){
	SelectValue(Banksearch.year,"<%=year(date)%>");
	SelectValue(Banksearch.month,"<%=month(date)%>");
	SelectValue(Banksearch.day,"<%=day(date)%>");
}
</script>
</head>
<body leftmargin="0" topmargin="0" onLoad="init()">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="0" align="center">
		  <!--#include file="common/top.asp"-->
          </td>
        </tr>
        <tr> 
          <td height="100%" align="center" valign="top">
<TABLE class=table002 cellSpacing=0 cellPadding=0 border=0>
              <TBODY>
                <TR> 
                  <!--左边开始-->
                  <TD width="20%" align=right vAlign=top> <!--#include file="common/left.asp"--> </TD>
                  <!--左边结束-->
                  <TD width="2%" background="images/rowline.gif">&nbsp;</TD>
                  <!--右边开始-->
                  <TD vAlign=top align=center width="78%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td>
						
                            <TABLE width="100%" height="100%" border=0 cellPadding=6 cellSpacing=0>
                              <TBODY>
                                <TR> 
                                  
                                <TD height="320" align=left vAlign=top bgColor=#ffffff><strong><font color="#FF0000">我的财务总账</font></strong><BR> <HR SIZE=1>
                                    <table width="98%" border="0" cellspacing="0" cellpadding="0">
                                      <tr> 
                                        
                                      <td height="22" valign="bottom" bgcolor="#5F8AC5"><font color="#FFFFFF">&nbsp;<strong>财务总账</strong></font> 
                                      </td>
                                      </tr>
                                      <tr> 
                                        <td height="1" bgcolor="#5F8AC5"></td>
                                      </tr>
                                      <tr> 
                                        <td><table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#5F8AC5">
                                            <tr> 
                                              
                                            <td height="220" align="center" bgcolor="#FFFFFF"> 
                                              <table width="98%" border="0" cellspacing="0" cellpadding="3">
                                                <%
												  '财务总账
												  '总付款
												  Dim AllPay
												  strSQL="Select Sum(b_money) as allpay From bank Where b_adminid=" & strM_ID & " And b_type='付费'"
												  Set rsBank=Server.CreateObject("ADODB.RecordSet")
												  rsBank.open strSQL,conn,1,1
												  AllPay=rsBank("allpay")
												  rsBank.close
												  
												  '总扣款
												  Dim AllDeduct
												  strSQL="Select Sum(b_money) as AllDeduct From bank Where m_id=" & strM_ID & " And b_type='扣款'"
												  Set rsBank=Server.CreateObject("ADODB.RecordSet")
												  rsBank.open strSQL,conn,1,1
												  AllDeduct=rsBank("AllDeduct")
												  rsBank.close
												  
												  '总入帐款
												  Dim AllGet
												  strSQL="Select Sum(b_money) as AllGet From bank Where m_id=" & strM_ID & " And b_type='入账'"
												  Set rsBank=Server.CreateObject("ADODB.RecordSet")
												  rsBank.open strSQL,conn,1,1
												  AllGet=rsBank("AllGet")
												  rsBank.close
												  
												  '总退还款
												  Dim AllBack
												  strSQL="Select Sum(b_money) as AllBack From bank Where m_id=" & strM_ID & " And b_type='退款'"
												  Set rsBank=Server.CreateObject("ADODB.RecordSet")
												  rsBank.open strSQL,conn,1,1
												  AllBack=rsBank("AllBack")
												  rsBank.close
												  
												  '最后付款时间
												  Dim LastTime
												  strSQL="Select Top 1 B_CreateTime From bank Where m_id=" & strM_ID & " And b_type='扣款' order by id desc"
												  Set rsBank=Server.CreateObject("ADODB.RecordSet")
												  rsBank.open strSQL,conn,1,1
												  if rsBank.recordcount>0 then
												  	LastTime=rsBank("B_CreateTime")
												   else
												  	LastTime="无记录"
												   end if
												  rsBank.close
												  
												  
												  %>
                                                <tr bgcolor="#F9F9F9">
                                                  <td align="right">&nbsp;</td>
                                                  <td>&nbsp;</td>
                                                </tr>
                                                <tr> 
                                                  <td width="25%" align="right">账号余款：</td>
                                                  <td width="75%"><font color="#FF0000">&nbsp;￥<%=rs("m_money")%></font></td>
                                                </tr>
                                                <tr bgcolor="#F9F9F9"> 
                                                  <td align="right">入帐总额：</td>
                                                  <td>&nbsp;<%=AllGet%></td>
                                                </tr>
                                                <tr> 
                                                  <td align="right" bgcolor="#FFFFFF">扣款总额：</td>
                                                  <td bgcolor="#FFFFFF">&nbsp;<%=AllDeduct%></td>
                                                </tr>
                                                <tr bgcolor="#F9F9F9"> 
                                                  <td align="right">退还总额：</td>
                                                  <td>&nbsp; <%=AllBack%></td>
                                                </tr>
                                                <tr> 
                                                  <td align="right" bgcolor="#FFFFFF">最后缴款时间：</td>
                                                  <td bgcolor="#FFFFFF">&nbsp;<%=LastTime%></td>
                                                </tr>
                                                <tr bgcolor="#F9F9F9"> 
                                                  <td height="35" align="right">&nbsp;</td>
                                                  <td height="35"> <a href="User_BankList.asp"><strong>[查看明细账]</strong></a></td>
                                                </tr>
                                              </table>
                                            </td>
                                            </tr>
                                          </table></td>
                                      </tr>
                                    </table> </TD>
                                </TR>
                              </TBODY>
                            </TABLE>

						 </td>
                      </tr>
                      <tr>
                        <td align="center"> 
                          <form action="User_BankList.asp" method="post" name="Banksearch" id="Banksearch">
                            <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#5F8AC5">
                              <tr> 
                                <td bgcolor="#5F8AC5">&nbsp<strong><font color="#FFFFFF">账单搜索</font></strong></td>
                              </tr>
                              <tr> 
                                <td height="100" align="center" bgcolor="F9F9F9"> 
                                  <table width="98%" border="0" cellspacing="1" cellpadding="3">
                                    <tr> 
                                      <td height="30"> 发生时间： 
                                        <select name="year" id="select2">
                                          <option value="">所有年</option>
                                          <%
											for i=year(date)-3 to year(date) + 5
										   %>
                                          <option value="<%=i%>"><%=i%></option>
                                          <%next%>
                                        </select>
                                        年 
                                        <select name="month" id="select3">
                                          <option value="">所有月</option>
                                          <option value="1">1</option>
                                          <option value="2">2</option>
                                          <option value="3">3</option>
                                          <option value="4">4</option>
                                          <option value="5">5</option>
                                          <option value="6">6</option>
                                          <option value="7">7</option>
                                          <option value="8">8</option>
                                          <option value="9">9</option>
                                          <option value="10">10</option>
                                          <option value="11">11</option>
                                          <option value="12">12</option>
                                        </select>
                                        月 
                                        <select name="day" id="select4">
                                          <option value="">所有日</option>
                                          <option value="1">1</option>
                                          <option value="2">2</option>
                                          <option value="3">3</option>
                                          <option value="4">4</option>
                                          <option value="5">5</option>
                                          <option value="6">6</option>
                                          <option value="7">7</option>
                                          <option value="8">8</option>
                                          <option value="9">9</option>
                                          <option value="10">10</option>
                                          <option value="11">11</option>
                                          <option value="12">12</option>
                                          <option value="13">13</option>
                                          <option value="14">14</option>
                                          <option value="15">15</option>
                                          <option value="16">16</option>
                                          <option value="17">17</option>
                                          <option value="18">18</option>
                                          <option value="19">19</option>
                                          <option value="20">20</option>
                                          <option value="21">21</option>
                                          <option value="22">22</option>
                                          <option value="23">23</option>
                                          <option value="24">24</option>
                                          <option value="25">25</option>
                                          <option value="26">26</option>
                                          <option value="27">27</option>
                                          <option value="28">28</option>
                                          <option value="29">29</option>
                                          <option value="30">30</option>
                                          <option value="31">31</option>
                                        </select>
                                        日 </td>
                                    </tr>
                                    <tr> 
                                      <td height="30"> 账单类型： 
                                        <select name="selType">
                                          <option value="" selected>全部类型</option>
                                          <option value="1">入账款项</option>
                                          <option value="2">被扣款项</option>
                                          <option value="4">退还款项</option>
                                        </select></td>
                                    </tr>
                                    <tr style="display:none"> 
                                      <td height="30"> 操 作 人： 
                                        <select name="selAgent" id="select11">
                                          <option value="">选择对象</option>
                                          <%
													Set rSub=server.CreateObject("ADODB.RecordSet")
													rSub.open "Select id,m_name From member Where m_code>0 Order by m_code Desc",conn,1,1
													for i=1 to rSub.recordcount
														response.Write("<option value=" & rSub("id") & ">" & Trim(rSub("m_name")) & "</option>")
														rSub.movenext
													next
													rSub.close
											%>
                                        </select> </td>
                                    </tr>
                                    <tr> 
                                      <td height="30">关 键 字： 
                                        <input name="txtKey" type="text" id="txtKey2" onClick="this.value='';" size=30 maxlength="50">
                                        　<font color="#FF0000">＊输入用户名，或交易关键字</font> 
                                      </td>
                                    </tr>
                                    <tr> 
                                      <td height="30" align="center"> <input type="submit" name="submit" value=" 查 询 ">
                                        　 
                                        <input type="reset" name="Submit" value=" 取 消 ">
                                        　 
                                        <input type="button" name="Submit2" value=" 帮 助 "></td>
                                    </tr>
                                  </table></td>
                              </tr>
                            </table>
                          </form>
						  </td>
                      </tr>
                    </table> 
                  </TD>
                </TR>
              </TBODY>
            </TABLE></td>
        </tr>
        <tr> 
          <td height="0" align="center">
		  <!--#include file="common/bottom.asp"-->
		  </td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
