欢迎来到安信科技官方网站!【www.anxin66.com】
18112005550
工作时间: 8:30-21:30
新闻中心
News Center

【解决方案】安信多用户商城按日期导出订单的实现代码

资讯分类: 二次开发  浏览: 2015年11月26日

1.表单提交文件的写法:anxinMall.ordertoExcel.asp

 <!--#include file="common.asp"-->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>订单导入报表Excel</title>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
-->
</style></head>
 
<body>
<form action="dingdanExcel.asp" method="get" name="form1" target="_blank">
<br>
  <table width="680" height="360" border="0" align="center">
    <tr>
      <td>
        <fieldset style="border : 1px solid #217fbb;">
        <legend>订单导入报表Excel</legend>
<br><br><br>
        <table width="400" border="0" align="center">
 <tr>
            <td width="158" height="13" align="right">选择导出日期:</td>
            <td width="232">
<select name="riqi" style="position:relative;left:0px;top:0px;font-size:14px;width:120px;line-height:14px;border:#ccc solid 1px;">
<base target=Right>
<option value="0">请选择日期</option>
<%
set rs=anxinMall.db("select distinct(format(addtime,'yyyy-mm-dd')) as temp from [anxinMall_dingdan] order by format(addtime,'yyyy-mm-dd') desc",3)
do while not rs.eof
response.write"<option value='"&rs("temp")&"'>"&rs("temp")&"</option>"
rs.movenext
loop
rs.close
set rs=nothing
%>
</select>
</td>
 </tr>
 
          <tr align="center">
            <td height="54" colspan="2"><input type="submit" name="Submit" value="导出Excel">
                         </td>
          </tr>
        </table>
<br><br><br>
      </fieldset></td>
    </tr>
  </table>
</form>
</body>
</html>
 
2.订单下载页的写法:订单.asp
 
<%
 
function getDingdanZongerByid(dingdanhao)'根据订单dingdanhao获得订单总额
getDingdanZongerByid = anxinMall.db("select sum(zonger) from [anxinMall_dingdan_prodlist] where dingdanhao='"&dingdanhao&"'",2)(0)
end function
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
-->
</style></head>
 
<body>
<%response.ContentType="application/vnd.ms-excel"%>
<table width="" height="41" border="1" align="center">
<tr>
<td width="60" height="28" align="center"><span class="style4">日期</span></td><!-- addtime -->
<td width="150" height="28" align="center"><span class="style4">订单号</span></td><!-- dingdanhao -->
<td width="140" height="28" align="center"><span class="style4">订单金额</span></td><!-- getDingdanZongerByid(dingdanhao) -->
<td width="100" height="28" align="center"><span class="style4">订单状态</span></td><!-- zhuangtai -->
</tr>
<%
dim riqi : riqi =request("riqi")
if request("riqi")=0 then
call anxinMall.alert("请选择导出日期","back")
end if
set rs=anxinMall.db("select * from [anxinMall_dingdan] where addtime=#"&riqi&"#",3)
do while not rs.eof
%>
<tr>
<td height="28" align="center"><span class="style4"><%=rs("addtime")%></span></td><!-- userid -->
<td height="28" align="center"><span class="style4">'<%=rs("dingdanhao")%></span></td><!-- 订单号 -->
<td height="28" align="center"><span class="style4"><%=getDingdanZongerByid(rs("dingdanhao"))%></span></td><!-- 订单总额 -->
<td height="28" align="center"><span class="style4"><%select case rs("zhuangtai")
case 1:response.write"未作任何处理"
case 2:response.write"买家已经付款"
case 3:response.write"商家已确认收款"
case 4:response.write"商家已经发货"
case 5:response.write"<font color=#008750>买家已收到货</font>"
end select%></span></td><!-- zhuangtai -->
</tr>
<%
rs.movenext
loop
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</table>
</body>
</html>
 

 

Copyright © 2007-2022 安信科技(十五周年纪念版) All Rights Reserved  备案号:苏ICP备15047094号-3 
网站首页 |  新闻资讯 |  服务项目 |  软件产品 |  试用下载 |  需求提交 |  模版建站 |  关于安信 |  产品授权 |  联系我们 |  定制开发 | 
服务热线:181-1200-5550  客服QQ: 120094883  | 邮箱:120094883#qq.com(#改@)