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

📄 tjbb2fx.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("year1fx"))&"-"&trim(Request.Form("month1fx"))&"-"&trim(Request.Form("day1fx"))
day2=trim(Request.Form("year2fx"))&"-"&trim(Request.Form("month2fx"))&"-"&trim(Request.Form("day2fx"))

year1=trim(Request.Form("year1fx"))
month1=trim(Request.Form("month1fx"))
year2=trim(Request.Form("year2fx"))
month2=trim(Request.Form("month2fx"))
'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="0" cellspacing="0">
  <tr> 
<%
    ddzhl=0
	pjddl=0
	pjddje=0
    ddl=0
	dde=0
	ddqrl=0
	
    set rs=server.createobject("adodb.recordset")
	sql="select datediff(d,'"&day1&"','"&day2&"')"
	rs.open sql,conn,1,1
	daynum=rs(0)+1  '取得两时间段之间的天数
	sql="SELECT sum(1),sum(isnull(zonger,0)),sum(CASE WHEN zhuangtai<4 THEN 0 ELSE 1 END) FROM shop_action WHERE (datediff(d,fhsj,'"&day2&"')>=0) AND (datediff(d,'"&day1&"',fhsj)>=0)"
	if rs.state=1 then rs.close
	rs.open sql,conn,1,1
	if not rs.eof then
	    ddl=rs(0)      '定单量
		dde=rs(1)      '定单金额
	    pjddl=rs(0)/daynum   '客户平均定单量
		pjddje=rs(1)/daynum  '客户平均定单金额
		if rs(0)=0 then ddzhl=0 else ddzhl=rs(2)*100/rs(0) end if '定单转化率
        ddqrl=rs(2)         '定单确认量
	end if
    
    sql="select count(userid) from shop_user"
	if rs.state=1 then rs.close
	rs.open sql,conn,1,1
	hyl=rs(0)  '会员总数

	sql="SELECT count(distinct username) FROM shop_action WHERE (datediff(d,fhsj,'"&day2&"')>=0) AND (datediff(d,'"&day1&"',fhsj)>=0) and zhuangtai>=4"
	if rs.state=1 then rs.close
	rs.open sql,conn,1,1
	gmhyl=rs(0)  '购买的会员总数

	if hyl=0 then hygml=0 else hygml=gmhyl*100/hyl end if '会员购买率
	if hyl=0 then pjhyddl=0 else pjhyddl=ddl/hyl end if    '平均会员定单量
	if hyl=0 then pjhydde=0 else pjhydde=dde/hyl end if    '平均会员定单额
	if gmhyl=0 then pjhyddlgm=0 else pjhyddlgm=ddl/gmhyl end if    '平均会员定单量(参加购买的)
	if gmhyl=0 then pjhyddegm=0 else pjhyddegm=dde/gmhyl end if    '平均会员定单额(参加购买的)


	



%>
    <td height="32" bgcolor="#FFFFFF"><div align="center"><font color="#000000"><span id="title">统计分析 日期范围:<%=day1&"至"&day2%>
            <input type="button" class="go-wenbenkuang" name="Submit4" value="打 印" onClick="javascript:window.print()">
    </span></font> </div></td>
  </tr>
</table>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#9DB2D4">
  <tr align="center" bgcolor="#F0F3F8" >
    <td width="20%">客户平均订单数量</td>
    <td width="30%"><%=pjddl%></td>
    <td width="20%">客户平均订单金额</td>
    <td width="30%"><%=pjddje%></td>
  </tr>
  <tr align="center" bgcolor="#F0F3F8" >
    <td width="20%">订单转化率</td>
    <td width="30%"><%=ddzhl%>%</td>
    <td width="20%">注册会员购买率</td>
    <td width="30%"><%=hygml%>%</td>
  </tr>
  <tr align="center" bgcolor="#F0F3F8" >
    <td width="20%">平均所有会员订单量</td>
    <td width="30%"><%=pjhyddl%></td>
    <td width="20%">平均所有会员订单金额</td>
    <td width="30%"><%=pjhydde%></td>
  </tr>
  <tr align="center" bgcolor="#F0F3F8" >
    <td width="20%">平均购买会员订单量</td>
    <td width="30%"><%=pjhyddlgm%></td>
    <td width="20%">平均购买会员订单金额</td>
    <td width="30%"><%=pjhyddegm%></td>
  </tr>
  <tr align="center" bgcolor="#F0F3F8" >
    <td colspan="4" align="right"><span id="xsfx" ></span>&nbsp;
        <input type="button" name="Submit" class="go-wenbenkuang" value="导入EXCEL" onClick="javascript:openexcel('<%=pjddl&","&pjddje&","&ddzhl&","&hygml&","&pjhyddl&","&pjhydde&","&pjhyddlgm&","&pjhyddegm&","%>');"></td>
  </tr>
</table>
<%
recordshow=Request.Form("recordcountfx")
pmfx=Request.Form("pmfx")
%>
<%
if pmfx="0" or pmfx="1" then
    sqlhydd="SELECT top "&recordshow&" username,count(*) num FROM shop_action WHERE (datediff(d,fhsj,'"&day2&"')>=0) AND (datediff(d,'"&day1&"',fhsj)>=0) GROUP BY username ORDER BY num DESC"
	if rs.state=1 then rs.close
	rs.open sqlhydd,conn,1,1
%>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="22" align="center">会员订单量排名</td>
  </tr>
</table>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#9DB2D4">
  <tr align="center" bgcolor="#C7D3E6">
    <td width="50%">用户名</td>
    <td width="50%">订单量</td>
  </tr>
  <%
    while not rs.eof
%>
  <tr align="center" bgcolor="#F0F3F8">
    <td width="50%"><a href="listuser.asp?username=<%=rs(0)%>"><%=rs(0)%></a></td>
    <td width="50%"><%=rs(1)%></td>
  </tr>
  <%
	    rs.movenext
	wend
%>
  <tr align="center" bgcolor="#F0F3F8" >
    <td colspan="2" align="right"><span id="hydd" ></span>&nbsp;
        <input type="button" name="Submit" class="go-wenbenkuang" value="导入EXCEL" onClick="javascript:openhydd();"></td>
  </tr>
</table>
<%
end if
%>
<%
if pmfx="0" or pmfx="2" then
    sqlhygwe="SELECT top "&recordshow&" username,sum(isnull(zonger,0)) num FROM shop_action WHERE (datediff(d,fhsj,'"&day2&"')>=0) AND (datediff(d,'"&day1&"',fhsj)>=0) GROUP BY username ORDER BY num DESC"
	if rs.state=1 then rs.close
	rs.open sqlhygwe,conn,1,1
%>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="22" align="center">会员购物额排名</td>
  </tr>
</table>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#9DB2D4">
  <tr align="center" bgcolor="#C7D3E6">
    <td width="50%">用户名</td>
    <td width="50%">购物额</td>
  </tr>
  <%
    while not rs.eof
%>
  <tr align="center" bgcolor="#F0F3F8">
    <td width="50%"><a href="listuser.asp?username=<%=rs(0)%>"><%=rs(0)%></a></td>
    <td width="50%"><%=round(rs(1),2)%></td>
  </tr>
  <%
	    rs.movenext
	wend
%>
  <tr align="center" bgcolor="#F0F3F8" >
    <td colspan="2" align="right"><span id="hygwe" ></span>&nbsp;
        <input type="button" name="Submit" class="go-wenbenkuang" value="导入EXCEL" onClick="javascript:openhygwe();"></td>
  </tr>
</table>
<%
end if
%>
<%
if pmfx="0" or pmfx="3" then
    sqlfwcs="SELECT top "&recordshow&" shopname, isnull(liulancount,0) num FROM shop_snsn  ORDER BY num DESC"
	if rs.state=1 then rs.close
	rs.open sqlfwcs,conn,1,1
%>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="22" align="center">商品访问次数排名</td>
  </tr>
</table>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#9DB2D4">
  <tr align="center" bgcolor="#C7D3E6">
    <td width="50%">商品名称</td>
    <td width="50%">访问次数</td>
  </tr>
  <%
    while not rs.eof
%>
  <tr align="center" bgcolor="#F0F3F8">
    <td width="50%"><%=rs(0)%></td>
    <td width="50%"><%=round(rs(1),2)%></td>
  </tr>
  <%
	    rs.movenext
	wend
%>
  <tr align="center" bgcolor="#F0F3F8" >
    <td colspan="2" align="right"><span id="fwcs" ></span>&nbsp;
        <input type="button" name="Submit" class="go-wenbenkuang" value="导入EXCEL" onClick="javascript:openfwcs();"></td>
  </tr>
</table>
<%
end if
%>
<%
if pmfx="0" or pmfx="4" then
'    sqlfwcs="SELECT top "&recordshow&" shopname, isnull(liulancount,0) num FROM shop_snsn  ORDER BY num DESC"
	sqlcsdb="SELECT top "&recordshow&" shop_snsn.shopname, isnull(liulancount,0) num,sum(isnull(zonger,0)) sumnum FROM shop_snsn Left Outer Join  shop_action on shop_action.shopid=shop_snsn.shopid and (datediff(d,fhsj,'"&day2&"')>=0) AND (datediff(d,'"&day1&"',fhsj)>=0) group by shop_snsn.shopname,shop_snsn.liulancount ORDER BY num DESC"
	sqljedb="SELECT top "&recordshow&" shop_snsn.shopname, isnull(liulancount,0) num,sum(isnull(zonger,0)) sumnum FROM shop_snsn Left Outer Join  shop_action on shop_action.shopid=shop_snsn.shopid and (datediff(d,fhsj,'"&day2&"')>=0) AND (datediff(d,'"&day1&"',fhsj)>=0) group by shop_snsn.shopname,shop_snsn.liulancount ORDER BY sumnum DESC"
	set rsxs=server.createobject("adodb.recordset")

	if rs.state=1 then rs.close
	rs.open sqlcsdb,conn,1,1
	rsxs.open sqljedb,conn,1,1
%>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="22" align="center">商品访问次数与购买次数排名对比</td>
  </tr>
</table>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#9DB2D4">
  <tr align="center" bgcolor="#f1f1f1">
    <td width="25%" bgcolor="#C7D3E6">商品名称(按访问次数排名)</td>
    <td width="25%" bgcolor="#C7D3E6">访问次数/销售额</td>
    <td width="25%" bgcolor="#C7D3E6">商品名称(按销售额排名)</td>
    <td width="25%" bgcolor="#C7D3E6">销售额/访问次数</td>
  </tr>
  <%
    while not rs.eof
%>
  <tr align="center" bgcolor="#F0F3F8">
    <td width="25%"><%=rs(0)%></td>
    <td width="25%" bgcolor="#F0F3F8"><%=rs(1)%> / <%=round(rs(2),2)%></td>
    <%
		  if not rsxs.eof then
		  %>
    <td width="25%" bgcolor="#F0F3F8"><%=rsxs(0)%></td>
    <td width="25%" bgcolor="#F0F3F8"><%=round(rsxs(2),2)%> / <%=rsxs(1)%></td>
    <%
		      rsxs.movenext   
		  else
		  %>
    <td width="25%" bgcolor="#F0F3F8"></td>
    <td width="25%" bgcolor="#F0F3F8"></td>
    <%
		  end if
		  %>
  </tr>
  <%
	    rs.movenext
	wend
%>
  <tr align="center" >
    <td bgcolor="#F0F3F8" colspan="4" align="right"><span id="csdb" ></span>&nbsp;
        <input type="button" name="Submit" class="go-wenbenkuang" value="导入EXCEL" onClick="javascript:opencsdb();"></td>
  </tr>
</table>
<%
end if
%>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <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)">
        <font color="red"><span id="excelfile" ></span></font> </div></td>
  </tr>
</table>
<br>
<!--#include file="copyright.asp"-->
</body>
</html>
<script>
function openexcel(avalue){
    window.open("toexcelfx.asp?flag=XSFX&sql="+avalue);
}

function openhydd(){
    window.open("toexcelfx.asp?flag=HYDD&sql=<%=sqlhydd%>");
}
function openhygwe(){
    window.open("toexcelfx.asp?flag=HYGWE&sql=<%=sqlhygwe%>");
}
function openfwcs(){
    window.open("toexcelfx.asp?flag=FWCS&sql=<%=sqlfwcs%>");
}
function opencsdb(){
    window.open("toexcelfx.asp?flag=CSDB&sql=<%=sqlcsdb%>&sql1=<%=sqljedb%>");
}





</script>

⌨️ 快捷键说明

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