?? tjbb2_fhy.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%"> </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"> <strong><font color="#000000">非會員統計報表</font></strong></td>
<td width="70%" align="right"> </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 + -