cart.asp
上传用户:syzzy1975
上传日期:2022-07-17
资源大小:670k
文件大小:4k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <%
  3. %><!--#include file="manage/inc/config.asp"--> 
  4. <!--#include file="inc/conn.asp"--> 
  5. <!--#include file="inc/chk.asp"--> 
  6. <%
  7. dim id,i,iii ,books,bookscount,product
  8. id=request("id")
  9. if id="" then
  10. call MsgBox("你的购物篮内没有任何商品!","Back","None")
  11. response.end
  12. end if
  13. %>
  14. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  18. <title>406网络书店</title>
  19. <link href="style.css" rel="stylesheet" type="text/css">
  20. </head>
  21. <body>
  22. <!--#include file="head.htm"-->
  23. <table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  24.   <tr>
  25.     <td width="219" align="left" valign="top"><!--#include file="left.asp"--></td>
  26.     <td width="561" align="left" valign="top">
  27.       <br>      <br>      <form name="form1" method="post" action="">
  28.         <table width="98%" border="0" align="center" cellpadding="0" cellspacing="1">
  29.           
  30.           <tr align="center">
  31.             <td align="left">商品名称</td>
  32.             <td width="9%">市场价</td>
  33.             <td width="9%"> 会员价</td>
  34.             <td width="9%">折扣</td>
  35.             <td width="10%">VIP会员价</td>
  36.             <td width="9%"> 数量</td>
  37.             <td width="12%"> 小计</td>
  38.             <td width="10%">修改数量</td>
  39.           </tr>
  40.           <%
  41. set rs=server.CreateObject("adodb.recordset")
  42. rs.open "select id,name,price1,price2,vipprice,discount from product where id in ("&id&") order by id",conn,1,1
  43.   iii=0
  44.   bookscount=request.QueryString("id").count
  45.   do while not rs.eof
  46. dim quatity 
  47.  Quatity = CInt( Request( "shop"&rs("id")) )
  48. If Quatity <=0 Then Quatity = 1
  49. %>
  50.           <tr align="center">
  51.             <td style='PADDING-LEFT: 5px' align="left"><%=trim(rs("name"))%>
  52.                 <input type=hidden name=name value=<%=trim(rs("name"))%>>
  53.             </td>
  54.             <td ><%=rs("price1")%>元</td>
  55.             <input type=hidden name=price2 value=<%=rs("price2")%>>
  56.             <td><%=rs("price2")%>元</td>
  57.             <td><%=rs("discount")*100&"%"%></td>
  58.             <td><%=rs("vipprice")%>元</td>
  59.             <td><input name="<%="shop"& rs("id")%>" type="text" size="3" value="<%=Quatity%>" onKeyPress= "return regInput(this, /^[0-9]*$/, String.fromCharCode(event.keyCode))"onpaste = "return regInput(this,/^[0-9]*$/, window.clipboardData.getData('Text'))"ondrop= "return regInput(this,/^[0-9]*$/,event.dataTransfer.getData('Text'))">
  60.             </td>
  61.             <td>
  62.               <%
  63. Dim rsvip,strvip,strdeposit,txtvip
  64. set rsvip=server.CreateObject("adodb.recordset")
  65. rsvip.open "select vip from [user] where username='"&request.cookies(cookieName)("username")&"' ",conn,1,1
  66. strvip = rsvip("vip")
  67. if  strvip = true then 
  68. txtvip = "VIP会员"
  69. if Quatity<=1 then
  70.   response.write rs("vipprice")*1&"元"
  71.   else
  72.   response.write rs("vipprice")*Quatity&"元"
  73.   end if   
  74.   iii=rs("vipprice")*Quatity+iii
  75. else
  76. txtvip = "普通会员"
  77. if Quatity<=1 then
  78.   response.write rs("price2")*1&"元"
  79.   else
  80.   response.write rs("price2")*Quatity&"元"
  81.   end if   
  82.   iii=rs("price2")*Quatity+iii
  83.   end if
  84.   %></td>
  85.             <td WIDTH="12%" align="center"><input type="submit" name="Submit" value="修改"  onClick="this.form.action='cart.asp?action=modify';this.form.submit()">
  86.             </td>
  87.           </tr>
  88.           <%if bookscount=1 then books=rs("id")
  89. rs.movenext
  90. loop
  91. rs.close
  92.   set rs=nothing%>
  93.           <tr height="20">
  94.             <td colspan="4" align="center">你是 <font color="#FF0000">
  95.               <% = txtvip %>
  96.             </font> 会员</td>
  97.             <td colspan="4" align="right"><font color="#FF0000">总计:<%=iii%>元&nbsp;&nbsp;&nbsp;&nbsp;</font></td>
  98.           </tr>
  99.           <tr>
  100.             <td height="32" colspan="8" align="center"><input type="submit" name="Submit2" value="下一步" onClick="this.form.action='checkout.asp';this.form.submit()" >
  101.               <input name="id" type="hidden" id="id" value="<%=id%>">
  102.   </td>
  103.           </tr>
  104.           
  105.       </table>
  106.     </form></td>
  107.   </tr>
  108. </table>
  109. <!--#include file="foot.htm"-->
  110. </body>
  111. </html>