⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tjbb2_fhy.asp

📁 购物系统(本版为正式商业版
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="adminset.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='login.asp';</script>"
response.End
end if
if session("flag")>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限!</b></font></div>"
response.End
end if
if qx3<>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限!</b></font></div>"
response.End
end if

day1=trim(Request.Form("year1"))&"-"&trim(Request.Form("month1"))&"-"&trim(Request.Form("day1"))
day2=trim(Request.Form("year2"))&"-"&trim(Request.Form("month2"))&"-"&trim(Request.Form("day2"))

year1=trim(Request.Form("year1"))
month1=trim(Request.Form("month1"))
year2=trim(Request.Form("year2"))
month2=trim(Request.Form("month2"))
totaltype=Request.Form("totaltype")
totalanclass=Request.Form("totalanclass")
totalnclass=Request.Form("totalnclass")

'day1="#"&trim(Request.Form("month1"))&"-"&trim(Request.Form("day1"))&"-"&trim(Request.Form("year1"))&"#"
'day2="#"&trim(Request.Form("month2"))&"-"&trim(Request.Form("day2"))&"-"&trim(Request.Form("year2"))&"#"
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/right_top2.gif">
  <tr>
    <td width="1%">&nbsp;</td>
    <td width="99%"><table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr>
          <td width="30%" height="32" style="font-size:14px;color:#000000">&nbsp;<strong><font color="#000000">非会员统计报表</font></strong></td>
          <td width="70%" align="right">&nbsp;</td>
        </tr>
    </table></td>
  </tr>
</table>
<br>
<table width="95%" border="0" align="center"cellpadding="3" cellspacing="1" bgcolor="#9DB2D4">

  <tr> 
    <td height="22" bgcolor="f1f1f1"> 
      <div align="center"><font color="#000000"><span id="title"></span></font></div>
    </td>
  </tr>
  <tr> 
<%
year1=trim(Request.Form("year1"))
month1=trim(Request.Form("month1"))
year2=trim(Request.Form("year2"))
month2=trim(Request.Form("month2"))
totaltype=Request.Form("totaltype")
totalanclass=Request.Form("totalanclass")
totalnclass=Request.Form("totalnclass")
if Request.Form("reporttype")="销售报表" then '销售报表
    set rs=server.createobject("adodb.recordset")
	if totaltype="1" then  '普通报表
	    sql="SELECT top "&Request.Form("recordcount")&" shop_snsn.shopid,shop_snsn.shopname,shop_snsn.shopchuban,shop_snsn.jj,sum(isnull(shopcount,0)),sum(isnull(zonger,0)) FROM shop_snsn,shop_action_FHY WHERE shop_action_FHY.shopid=shop_snsn.shopid and (datediff(d,fhsj,'"&day2&"')>=0) AND (datediff(d,'"&day1&"',fhsj)>=0) "
		msg=Request.Form("reporttype")&" [日期范围:"&day1&"至"&day2
    elseif totaltype="2" then  '日报表
	    sql="SELECT top "&Request.Form("recordcount")&" shop_snsn.shopid,shop_snsn.shopname,shop_snsn.shopchuban,shop_snsn.jj,sum(isnull(shopcount,0)),sum(isnull(zonger,0)) FROM shop_snsn,shop_action_FHY WHERE shop_action_FHY.shopid=shop_snsn.shopid and (datediff(d,fhsj,'"&day2&"')=0) "
		msg=Request.Form("reporttype")&" [统计日期:"&day2
	elseif totaltype="3" then  '月报表
	    sql="SELECT top "&Request.Form("recordcount")&" shop_snsn.shopid,shop_snsn.shopname,shop_snsn.shopchuban,shop_snsn.jj,sum(isnull(shopcount,0)),sum(isnull(zonger,0)) FROM shop_snsn,shop_action_FHY WHERE shop_action_FHY.shopid=shop_snsn.shopid and (datediff(m,fhsj,'"&day2&"')=0) "
		msg=Request.Form("reporttype")&" [统计月份:"&year2&"-"&month2
	elseif totaltype="4" then  '年报表
	    sql="SELECT top "&Request.Form("recordcount")&" shop_snsn.shopid,shop_snsn.shopname,shop_snsn.shopchuban,shop_snsn.jj,sum(isnull(shopcount,0)),sum(isnull(zonger,0)) FROM shop_snsn,shop_action_FHY WHERE shop_action_FHY.shopid=shop_snsn.shopid and (datediff(yy,fhsj,'"&day2&"')=0) "
		msg=Request.Form("reporttype")&" [统计年份:"&year2
	end if
	if totalanclass<>"0" then 
	    sql=sql&" and shop_snsn.anclassid="&totalanclass  '大类
		msg=msg&" 大类:"&Request.Form("anclass")
	end if
	if totalnclass<>"0" then 
	    sql=sql&" and shop_snsn.nclassid="&totalnclass '小类
		msg=msg&" 小类:"&Request.Form("nclass")
	end if
	msg=msg&"]"
	sql=sql&" GROUP BY shop_snsn.shopid,shop_snsn.shopname,shop_snsn.shopchuban,shop_snsn.jj  ORDER BY shop_snsn.shopid "
	rs.open sql,conn,1,1
%><input type="button" class="go-wenbenkuang" name="Submit4" value="打 印" onClick="javascript:window.print()"><br><br>
    <td height="107" bgcolor="#FFFFFF"> 
      <table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#9DB2D4">
        <tr align="center" bgcolor="#C7D3E6"> 
          <td width="11%">商品ID</td>
          <td width="41%">商品名称</td>
<%
    if not rs.eof then
%>
          <td width="17%"><%=rs(3)%></td>
<%
    else
%>
          <td width="17%">商品单位</td>
<%
    end if
%>
          <td width="14%">销售数量</td>
          <td width="17%">销售额</td>
        </tr>
<%
    while not rs.eof
%>
        <tr bgcolor="#FFFFFF"> 
          <td align="center" width="11%"><%=rs(0)%></td>
          <td width="41%" height="22"><a href="editsn.asp?id=<%=rs(0)%>"><%=rs(1)%></a></td>
          <td width="17%" align="center"><%=rs(2)%></td>
          <td align="center" width="14%"><%=rs(4)%></td>
          <td align="center" width="17%"><%=rs(5)%></td>
        </tr>
<%
        rs.movenext
    wend
    set rs=nothing
%>
<%
elseif Request.Form("reporttype")="库存报表" then '库存报表
%>
<%
    set rs=server.createobject("adodb.recordset")

	if totaltype="1" then  '普通报表
	    sql="SELECT top "&Request.Form("recordcount")&" shop_snsn.shopid,shop_snsn.shopname,shop_snsn.shopchuban,shop_snsn.jj,shop_snsn.kucun FROM shop_snsn WHERE (datediff(d,adddate,'"&day2&"')>=0) AND (datediff(d,'"&day1&"',adddate)>=0) "
		msg=Request.Form("reporttype")&" [日期范围:"&day1&"至"&day2
    elseif totaltype="2" then  '日报表
	    sql="SELECT top "&Request.Form("recordcount")&" shop_snsn.shopid,shop_snsn.shopname,shop_snsn.shopchuban,shop_snsn.jj,shop_snsn.kucun FROM shop_snsn WHERE (datediff(d,adddate,'"&day2&"')=0) "
		msg=Request.Form("reporttype")&" [统计日期:"&day2
	elseif totaltype="3" then  '月报表
	    sql="SELECT top "&Request.Form("recordcount")&" shop_snsn.shopid,shop_snsn.shopname,shop_snsn.shopchuban,shop_snsn.jj,shop_snsn.kucun FROM shop_snsn WHERE (datediff(m,adddate,'"&day2&"')=0) "
		msg=Request.Form("reporttype")&" [统计月份:"&year2&"-"&month2
	elseif totaltype="4" then  '年报表
	    sql="SELECT top "&Request.Form("recordcount")&" shop_snsn.shopid,shop_snsn.shopname,shop_snsn.shopchuban,shop_snsn.jj,shop_snsn.kucun FROM shop_snsn WHERE (datediff(yy,adddate,'"&day2&"')=0) "
		msg=Request.Form("reporttype")&" [统计年份:"&year2
	end if
	if totalanclass<>"0" then 
	    sql=sql&" and shop_snsn.anclassid="&totalanclass  '大类
		msg=msg&" 大类:"&Request.Form("anclass")
	end if
	if totalnclass<>"0" then 
	    sql=sql&" and shop_snsn.nclassid="&totalnclass '小类
		msg=msg&" 小类:"&Request.Form("nclass")
	end if
	msg=msg&"]"
	sql=sql&" ORDER BY shop_snsn.shopid "


	rs.open sql,conn,1,1
%><input type="button" class="go-wenbenkuang" name="Submit4" value="打 印" onClick="javascript:window.print()"><br><br>
    <td height="107" bgcolor="#FFFFFF"> 
      <table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#9DB2D4">
        <tr align="center" bgcolor="#C7D3E6"> 
          <td width="11%">商品ID</td>
          <td width="41%">商品名称</td>
<%
    if not rs.eof then
%>
          <td width="17%"><%=rs(3)%></td>
<%
    else
%>
          <td width="17%">商品单位</td>
<%
    end if
%>
          <td width="14%">库存量</td>
        </tr>
<%
    while not rs.eof
%>
        <tr bgcolor="#FFFFFF"> 
          <td align="center" width="11%"><%=rs(0)%></td>
          <td width="41%" height="22"><a href="editsn.asp?id=<%=rs(0)%>"><%=rs(1)%></a></td>
          <td width="17%" align="center"><%=rs(2)%></td>
          <td align="center" width="14%"><%=rs(4)%></td>
        </tr>
<%
        rs.movenext
    wend
    set rs=nothing
%>
<%
end if
%>
        <tr bgcolor="#FFFFFF"> 
          <td height="22" colspan="5"> 
            <div align="center"> 
              <input type="button" name="Submit" class="go-wenbenkuang" value="返回" onClick="javascript:history.go(-1)">
			   <input type="button" name="Submit" class="go-wenbenkuang" value="导入EXCEL" onClick="javascript:openexcel();">
			   <font color="red"><span id="excelfile" ></span></font>
            </div>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<br>
<!--#include file="copyright.asp"-->
</body>
</html>
<script>
    document.all.title.innerHTML="<%=msg%>";

function openexcel(){
    window.open("toexcel.asp?report=<%=Request.Form("reporttype")%>&sql=<%=sql%>");
}
</script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -