<%response.ContentType ="application/vnd.ms-excel"%>
<% Response.AddHeader "Content-Disposition", "attachment; filename=奖金发放列表"%>
<!-- #include file="include/adovbs.inc" -->
<!-- #include file="include/dataconn.asp" -->
<!-- #include file="include/checksession.asp" -->
<!-- #include file="include/168soft_SqlIn.Asp" -->
<%
Response.Buffer =false
Response.Expires=-1
'thistoday =year(now)&"-"&month(now)&"-"&day(now)
ComputeWeek=trim(Request("ComputeWeek"))

set HyRs=server.CreateObject("adodb.recordset")
sql = "SELECT sum(allmoney) as MyAllMoney FROM HyMoneyLog where ComputeWeek=" & ComputeWeek
HyRs.Open sql,conn
MyAllMoney=0
if HyRs.recordcount>0 then
	if len(HyRs("MyAllMoney"))>0 then
		MyAllMoney=HyRs("MyAllMoney")
	end if
end if


set HyRs=nothing
set HyRs=server.CreateObject("adodb.recordset")


sql = "SELECT HyMoneyLog.*,Hy.HyName,Hy.HyOpenBankNo,Hy.HyOpenBank,Hy.HyOpenBankName,HyClub.HyID,HyClub.HyBuyCount FROM HyClub,HyMoneyLog,Hy where HyMoneyLog.HyNumber = HyClub.Hynumber and Hy.ID =HyClub.HyID"
sql =sql & " and HyMoneyLog.ComputeWeek=" & ComputeWeek &" and HyMoneyLog.AllMoney>0"
'Response.Write sql
'Response.End 
	HyRs.Open sql,conn
	j=HyRs.RecordCount 
%>
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<META http-equiv=Content-Type content="text/html; charset=gb2312">
</head>
<body leftmargin="10" topmargin="10" marginwidth="0" marginheight="0">

<%
    if j>0 then
	    i=1
%>

<table border="1" cellpadding="0" cellspacing="0" width="98%" bordercolordark="#FFFFFF" bordercolorlight="#AAAAAA">
  <tr bgcolor="#FFFFCC" class="td3"> 
    <td width="4%"> <div align="center"><font color="#000000">行</font></div></td>
    <td width="6%"> <div align="center"><font color="#000000">姓名</font></div></td>
    <td width="8%"> <div align="center"><font color="#000000">卡号</font></div></td>
    <td width="12%"> <div align="center"><font color="#000000">开户银行</font></div></td>
    <td width="12%"> <div align="center"><font color="#000000">银行卡号</font></div></td>
    <td width="6%"> <div align="center"><font color="#000000">户名</font></div></td>	
    <td width="8%"> <div align="center"><font color="#000000">本次奖金</font></div></td>
    <td width="6%"> <div align="center"><font color="#000000">时间</font></div></td>
  </tr>
  <%
    while (not HyRs.eof)
 %>
  <tr height="25"> 
    <td> <div align="center"> 
        <% =i%>
      </div></td>
    <td><div align="center"><%=HyRs("HyName")%>&nbsp;&nbsp;</div></td>
    <td><div align="center"><%=HyRs("HyNumber")%>&nbsp;</div></td>
    <td> <div align="center"> 
        <% =HyRs("HyOpenBank")%>
        &nbsp;</div></td>
    <td> <div align="center"> 
        <% =HyRs("HyOpenBankNo")%>
        &nbsp;</div></td>
    <td> <div align="center"> 
        <% =HyRs("HyOpenBankName")%>
        &nbsp;</div></td>		
    <td> <div align="center"><% =HyRs("AllMoney")%></div></td>
    <td> <div align="center"> 
        <% =HyRs("ComputeTime")%>
        &nbsp;</div></td>
    <%
	HyRs.movenext
	i=i+1
	x=x+1
	wend %>
  </tr>
  <tr height="25"> 
    <td colspan="8"><div align="right">奖金合计：<%=MyAllMoney%> &nbsp;&nbsp;&nbsp;&nbsp;</div></td>
  </tr>
  <%
  else
	Response.Write "当前期数没有拿奖会员或者奖金还没有计算！<a href='javascript:history.back()'>返回</a>"
 end if%>
</table>
</body>
</html>
