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

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

开发平台:

DOS

  1. <!--#include file="conn.asp"-->
  2. <!--#include file="config.asp"-->
  3. <html><head><title>网软天下购物系统,网络购物系统,asp购物系统,免费购物系统,网上商城购物系统。--我的收藏</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  5. <link href="skin/skin<%=skinid%>/css.css" rel="stylesheet" type="text/css">
  6. </head>
  7. <body leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
  8. <%
  9. if request.cookies("Cnhww")("username")="" then
  10. response.write "<script language=javascript>alert('对不起,您还没有登陆!');window.close();</script>"
  11. response.End
  12. end if
  13. dim bookid,username,action
  14. action=request.QueryString("action")
  15. username=trim(request.cookies("Cnhww")("username"))
  16. bookid=request.QueryString("id")
  17. if InStr(action,"'")>0 then
  18. response.write"<script>alert(""非法访问!"");window.close();</script>"
  19. response.end
  20. end if
  21. if bookid<>"" then
  22. if not isnumeric(bookid) then 
  23. response.write"<script>alert(""非法访问!"");window.close();</script>"
  24. response.end
  25. else
  26. if not isinteger(bookid) then
  27. response.write"<script>alert(""非法访问!"");window.close();</script>"
  28. end if
  29. end if
  30. end if
  31. select case action
  32. case "del"
  33. conn.execute "delete from orders where actionid="&request.QueryString("actionid")
  34. if request.QueryString("ll")=1 then
  35. response.redirect "user.asp?action=shoucang"
  36. else
  37. response.redirect "stow.asp?action=show"
  38. end if
  39. response.End
  40. case "add"
  41. set rs=server.CreateObject("adodb.recordset")
  42. rs.open "select bookid,username from orders where username='"&username&"' and bookid="&bookid&" and zhuangtai=6",conn,1,1
  43. if not rs.eof and not rs.bof then
  44. response.write "<script language=javascript>alert('对不起,此商品已存在于您的收藏架中,不可以重复添加!');window.location.href='stow.asp?action=show';</script>"
  45. response.end
  46. rs.close
  47. set rs=nothing
  48. else
  49. if rs.recordcount=10 then
  50. response.write "<script language=javascript>alert('对不起,您最多只能收藏10件商品!');window.location.href='stow.asp?action=show';</script>"
  51. response.end
  52. else
  53. rs.close
  54. set rs=nothing
  55. set rs=server.CreateObject("adodb.recordset")
  56. rs.open "select bookid,username,zhuangtai,zonger from orders",conn,1,3
  57. rs.addnew
  58. rs("bookid")=bookid
  59. rs("username")=username
  60. rs("zhuangtai")=6
  61. rs("zonger")=0
  62. rs.update
  63. end if
  64. rs.close
  65. response.Redirect "stow.asp?action=show"
  66. set rs=nothing
  67. end if
  68. case "show"
  69. response.write "<table width=96% border=0 align=center cellpadding=2 cellspacing=2><tr><td width=60% >"
  70. response.write "</td><td width=40% valign=baseline><div align=right>您最多只能收藏十种商品</div></td></tr></table>"
  71. set rs=server.CreateObject("adodb.recordset")
  72. rs.open "select orders.actionid,orders.bookid,products.bookname,products.shichangjia,products.huiyuanjia,products.dazhe from products inner join  orders on products.bookid=orders.bookid where orders.username='"&request.cookies("Cnhww")("username")&"' and orders.zhuangtai=6",conn,1,1 
  73. %>
  74. <table width=96% border=0 align=center cellpadding=2 cellspacing=1 bgcolor=#cccccc>
  75. <form name='form1' method='post' action="stowcart.asp">
  76. <%
  77. response.write "<tr align=center><td width=8% bgcolor=#f1f1f1>选择</td>"
  78. response.Write "<td width=42% bgcolor=#f1f1f1>商品名称</td>"
  79. response.Write "<td width=14% bgcolor=#f1f1f1>市场价</td>"
  80. response.Write "<td width=14% bgcolor=#f1f1f1>会员价</td>"
  81. response.Write "<td width=8% bgcolor=#f1f1f1>删 除</td></tr>"
  82. do while not rs.eof
  83. response.write "<tr><td bgcolor=#ffffff><div align=center><input name=bookid type=checkbox checked value="&rs("bookid")&" ></div></td>"
  84. response.write "<td bgcolor=#ffffff STYLE='PADDING-LEFT: 5px'><div align=left><a href=products.aspid="&rs("bookid")&" >"&rs("bookname")&"</a></div></td>"   
  85. response.write "<td bgcolor=#ffffff><div align=center>"&formatnum(rs("shichangjia"),2)&"元</div></td>"
  86. response.write "<td bgcolor=#ffffff><div align=center><font color=#dd6600>"&formatnum(rs("huiyuanjia"),2)&"元</font></div></td>"
  87. response.write "<td bgcolor=#ffffff><div align=center>"
  88. response.Write "<a href=stow.asp?action=del&actionid="&rs("actionid")&">"
  89. response.Write "<img src=images/trash.gif border=0></a></div></td></tr>"
  90. rs.movenext
  91. loop
  92. rs.close
  93. set rs=nothing
  94. %>
  95. <tr>
  96. <td height=36 colspan=6 bgcolor=#ffffff align=center> 
  97. <input class="go-wenbenkuang" onFocus="this.blur()" type="submit" name="submit" value=" 去收银台 ">
  98. <input class="go-wenbenkuang" onFocus="this.blur()" onClick="javascript:window.close();" type=reset name="button" value=" 继续购物 ">
  99. </td></tr></form></table>
  100. <%end select%>
  101. </body>
  102. </html>