coverexcel.asp
上传用户:btntkt
上传日期:2021-04-16
资源大小:5296k
文件大小:3k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

DOS

  1. <!--#include file="conn.asp"-->
  2. <%
  3. dim cls
  4. if session("admin")="" then
  5. Response.Redirect("admin.asp")
  6. else
  7. if session("flag")<>"0" then
  8. cls = Instr(session("flag"), "excel")
  9. if cls <= 0 then
  10. %>
  11. <script language="javascript">
  12. if (confirm("您的操作权限不够,系统拒绝你的访问,请点确定返回,或者点取消退出重新登录"))
  13.   location.href="login.asp";
  14. else
  15.   location.href="index.asp";
  16. </script>
  17. <%
  18. end if
  19. end if
  20. end if
  21. %>
  22. <html>
  23. <head>
  24. <title></title>
  25. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  26. <link href="Images/style.css" rel="stylesheet" type="text/css">
  27. </head>
  28. <body>
  29. <%
  30. set rs=server.createobject("adodb.recordset")
  31. sql="select bookid,bookname,pingpai,bookchuban,yeshu,isbn,bookpic,shichangjia,huiyuanjia,vipjia,bestbook,tejiabook,newsbook,kucun,adddate,grade,chima,yanse from  products order by adddate desc "
  32. rs.open sql,conn,1,1
  33. %>
  34. <br>
  35. <td height="107" bgcolor="#DEE7FF"> 
  36. <table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#6396D6">
  37.     <tr align="center" bgcolor="#C7D3E6"> 
  38.       <td width="11%" bgcolor="#7B9AE7" height="25"><font color="#FFFFFF">商品ID</font></td>
  39.       <td width="20%" bgcolor="#7B9AE7"><font color="#FFFFFF">商品名称</font></td>
  40.       <td width="21%" bgcolor="#7B9AE7"><font color="#FFFFFF">所属品牌</font></td>
  41.       <%
  42. if not rs.eof then
  43. %>
  44.       <td width="17%" bgcolor="#7B9AE7"><font color="#FFFFFF">商品编号</font></td>
  45.       <%
  46. else
  47. %>
  48.       <td width="17%" bgcolor="#7B9AE7"><font color="#FFFFFF">商品单位</font></td>
  49.       <%
  50. end if
  51. %>
  52.       <td width="14%" bgcolor="#7B9AE7"><font color="#FFFFFF">添加日期</font></td>
  53.     </tr>
  54.     <%
  55. while not rs.eof
  56. %>
  57.     <tr bgcolor="#FFFFFF"> 
  58.       <td width="11%" align="center" bgcolor="#DEE7FF"><%=rs(0)%></td>
  59.       <td width="20%" height="22" bgcolor="#DEE7FF"><a href="editproduct.asp?id=<%=rs(0)%>"><%=rs(1)%></a></td>
  60.       <td width="21%" height="22" align="center" bgcolor="#DEE7FF"><%=rs(2)%></td>
  61.       <td width="17%" align="center" bgcolor="#DEE7FF"><%=rs(15)%></td>
  62.       <td width="14%" align="center" bgcolor="#DEE7FF"><%=rs(14)%></td>
  63.     </tr>
  64.     <%
  65. rs.movenext
  66. wend
  67. set rs=nothing
  68. %>
  69.     <tr bgcolor="#FFFFFF"> 
  70.       <td height="22" colspan="6" bgcolor="#DEE7FF"> <div align="center"> 
  71.           <input type="button" name="Submit4" value="打 印" onClick="javascript:window.print()">
  72.           <input type="button" name="Submit" value="导入EXCEL" onClick="javascript:openexcel();">
  73.           <font color="red"><span id="excelfile" ></span></font></div></td>
  74.     </tr>
  75.   </table>
  76. </td>
  77. </tr>
  78. </table>
  79. <br>
  80. </body>
  81. </html>
  82. <script>
  83. function openexcel(){
  84.     window.open("toexcel.asp?sql=<%=sql%>");
  85. }
  86. </script>