📄 checkxsph.asp
字号:
<%
set conn=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
conn.open application("dsn")
sel=request("sel")
tj=request("tj")
qname=request("qname")
str=request.Form("year")
if sel=12 then
sdate=str
sdate=sdate&"-"&cstr(sel)&"-"&"1"
edate=cstr(str+1)
edate=edate&"-"&"1-1"
else
sdate=str
sdate=sdate&"-"&cstr(sel)&"-"&"1"
edate=str
edate=edate&"-"&cstr(cint(sel)+1)&"-"&"1"
end if
session("month")=sel
session("sdate")=sdate
session("edate")=edate
session("tj")=tj
session("qname")=qname
%>
<%
'查询条件判断'
if session("qname")="desc" then
sql="select spid,spname,cd,gg,dw,sum(dj*sl) as sumje,sum(sl) as sumsl from V_sell where xsdate between '"&session("sdate")&"' and '"&session("edate")&"' group by spid,spname,cd,gg,dw order by "&session("tj")&" desc"
end if
if session("qname")="asc" then
sql="select spid,spname,cd,gg,dw,sum(dj*sl) as sumje,sum(sl) as sumsl from V_sell where xsdate between '"&session("sdate")&"' and '"&session("edate")&"' group by spid,spname,cd,gg,dw order by "&session("tj")&" "
end if
rs.open sql,conn,1,3
if rs.eof then%>
<script language="JavaScript">
alert("这个月份没有销售记录!")
history.back(1)
</script>
<%response.End()
end if%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="97%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bordercolorlight="#9CA6C6" bordercolordark="#CCE3FF">
<tr bgcolor="#FF9933">
<td height="10" colspan="6" class="word_white">
当前位置:查询统计> 商品销售排行 >>></td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td height="30" colspan="6"><%=session("month")%>月份销售排行表</td>
</tr>
<tr align="center" bgcolor="#C8E3FF">
<td width="94" height="14">
<font color="#333399">商品编号</font></td>
<td width="154" height="14">
<font color="#333399">商品名称</font></td>
<td width="200" height="14">
<font color="#333399">产地</font></td>
<td width="111" height="14">
<font color="#333399">规格</font></td>
<td width="89" height="14">
<font color="#333399">数量</font></td>
<td width="96" height="14">
<font color="#333399">金额</font></td>
</tr>
<% session("totalje") = 0
session("totalsl") = 0
session("spsl") = 0
%>
<%while not rs.eof
session("totalje")=session("totalje")+rs("sumje")
session("totalsl")=session("totalsl")+rs("sumsl")
session("spsl")=session("spsl")+1
%>
<tr align="center" bgcolor="#C8E3FF">
<td height="20">
<%=rs("spid")%>
</td>
<td height="20">
<%=rs("spname")%> </td>
<td height="20">
<%=rs("cd") %> </td>
<td height="20">
<%=rs("gg")%> </td>
<td height="20"><%=rs("sumsl")%>( <%=rs("dw")%>)</td>
<td height="20">
<%=rs("sumje")%> </td>
</tr>
<%rs.movenext
wend%>
</table>
<%if rs.eof then %>
<table width="50%" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td width="26%"> <div align="center"><font color="#336699">商品</font><font color="#336699">数:</font><font color="red">
<%=session("spsl")%> </font></div></td>
<td width="33%"><div align="center"><font color="#336699">总数量:</font><font color="red">
<%=session("totalsl")%> </font></div></td>
<td width="41%"><div align="center"><font color="#336699">总销售额:</font> <font color="red"> <%=session("totalje")%> </font></div></td>
</tr>
</table>
<%end if%>
<div align="right"></div>
<p> </p>
<div align="center"><a href="xsph.asp">[ 返回 ]</a><br>
<!-- #include file="../bottom.asp"-->
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -