www.gusucode.com > asp+SQLServer网上书店系统设计(源代码+论文) > asp+SQLServer网上书店系统设计(源代码+论文)\网上书店asp+SQLServer\网上书店\admin\check_sale.asp
<!--#include file="conn.asp"--> <% if session("admin")="" then Response.redirect "backlogin.asp?msg=对不起你还没有登录,请先登录!" else name=session("admin") set rs=server.createobject("adodb.recordset") sqltext="select * from admin where name='"&name&"'" rs.open sqltext,cn,1,1 if rs("ad_level")>3 then Response.redirect "backlogin1.asp?msg=对不起你不能查看交易额!" end if rs.close end if %> <% Dim mon(13) , num(13) Dim i for i=1 to 12 mon(i)=0 next flag="已经发货" set rs=server.createobject("adodb.recordset") sqltext="select * from orderlist where flag='"&flag&"' order by order_date desc" rs.open sqltext,cn,1,1 while not rs.eof i=month(rs("order_date")) mon(i)=mon(i)+cint(rs("order_sum")) num(i)=num(i)+1 rs.movenext wend %> <html> <head> <title>查看交易额</title> </head> <body text="#000000" bgcolor="#d3d0e5"> <br> <div align="center"> <center> <table cellspacing=1 cellpadding=4 width=100% bgcolor=#000000> <tbody> <tr valign=top bgcolor=#BECFF1> <td class=main1 width="662" height="10" bgcolor="#8CAAE7"></td> </tr> <tr valign=top bgcolor=#BECFF1> <td class=main1 width="662" height="18">今年每月交易情况--</td> </tr> <tr valign=top bgcolor=#BECFF1> <td class=main1 width="662" height="15"> <table border="1" cellpadding="0" cellspacing="0" width="100%" bordercolorlight="#BECFF1" bordercolordark="#BECFF1"> <tr class=main1 bgcolor="#8CAAE7"> <td width="11%" height="35" align="center">月份</td> <td width="15%" height="35" align="center">定单数</td> <td width="30%" height="35" align="center">交易总额</td> </tr> <% for i=1 to 12 if mon(i)<>0 then %> <tr class=main1 bgcolor="#8CAAE7"> <td width="11%" align="center"><%=i%></td> <td width="15%" align="center"><%=num(i)%></td> <td width="30%" align="center"><%=mon(i)%></td> </td> </tr> <% end if next %> </table> </td> </tr> <tr bgcolor=#BECFF1> <td class=main1 width="662" height="28" bgcolor="#BECFF1"> <p> </td> </tr> <tr bgcolor=#BECFF1> <td class=main1 width="662" height="4" bgcolor="#8CAAE7"></td> </tr> </tbody> </table> <br> <% rs.close cn.close %> </center> </div> </body> </html>