- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
toexcel.asp
资源名称:shop2.rar [点击查看]
上传用户:btntkt
上传日期:2021-04-16
资源大小:5296k
文件大小:2k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
DOS
- <!--#include file="conn.asp"-->
- <%
- dim cls
- if session("admin")="" then
- Response.Redirect("admin.asp")
- else
- if session("flag")<>"0" then
- cls = Instr(session("flag"), "excel")
- if cls <= 0 then
- %>
- <script language="javascript">
- if (confirm("您的操作权限不够,系统拒绝你的访问,请点确定返回,或者点取消退出重新登录"))
- location.href="login.asp";
- else
- location.href="index.asp";
- </script>
- <%
- end if
- end if
- end if
- %>
- <%
- set rs=server.createobject("adodb.recordset")
- sql=request("sql")
- rs.open sql,conn,1,1
- curpath=Server.mappath("excel")
- Set fs = CreateObject("Scripting.FileSystemObject")
- if not fs.FolderExists(curpath) then fs.CreateFolder(curpath)
- Randomize
- sRand=rnd
- sRand=year(now)&month(now)&hour(now)&minute(now)&second(now)&sRand&".CSV"
- Set excelfile = fs.CreateTextFile(curpath&""&sRand, True)
- if not rs.eof then
- excelfile.WriteLine("商品ID,商品名称,所属品牌,商品单位,商品积分,商品规格,商品图片,市场价,会员价,VIP价,是否热销,是否特价,是否新品,库存数量,添加日期,商品编号,商品尺码,商品颜色")
- else
- excelfile.WriteLine("商品ID,商品名称,所属品牌,商品单位,商品积分,商品规格,商品图片,市场价,会员价,VIP价,是否热销,是否特价,是否新品,库存数量,添加日期,商品编号,商品尺码,商品颜色")
- end if
- while not rs.eof
- if rs(10)=1 then
- k="是"
- else k="否"
- end if
- if rs(11)=1 then
- t="是"
- else t="否"
- end if
- if rs(12)=1 then
- v="是"
- else v="否"
- end if
- excelfile.WriteLine(rs(0)&","&rs(1)&","&rs(2)&","&rs(3)&","&rs(4)&","&rs(5)&","&rs(6)&","&rs(7)&"元,"&rs(8)&"元,"&rs(9)&"元,"&k&","&t&","&v&","&rs(13)&","&rs(14)&","&rs(15)&","&rs(16)&","&rs(17))
- rs.movenext
- wend
- excelfile.close
- set fs=nothing
- %>
- <script>
- opener.document.all.excelfile.innerHTML="<a href='excel/<%=sRand%>' target=_blank><%=sRand%></a>";
- window.close();
- </script>