⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 order.asp

📁 这是一款网上购物系统
💻 ASP
字号:
<!--#include file="Util.asp" -->

<%
Head="以下是您所选购的物品清单"

ProductList = Session("ProductList")
If Len(ProductList) = 0 Then Response.Redirect "Nothing.asp"

DbPath = SERVER.MapPath("cart.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DbPath

If Request("MySelf") = "Yes" Then
   ProductList = ""
   Products = Split(Request("ProductID"), ", ")
   For I=0 To UBound(Products)
      PutToShopBag Products(I), ProductList
   Next
   Session("ProductList") = ProductList
End If

sql = "Select * From Products"
sql = sql & " Where ProductID In (" & ProductList & ")"
sql = sql & " Order By ProductID"
Set rs = conn.Execute( sql )
%>
<center>
<font size="+3">网上超市</font> 
<TABLE Border=1>
<TR BGCOLOR=#ffeedd>
<TD>商品编号</TD><TD>商品名称</TD><TD>单价</TD><TD>数量</TD><TD>总价</TD><TD>商品简介</TD></TR>
<%
   Sum = 0
   While Not rs.EOF

     Quatity = CInt( Request( "Q_" & rs("ProductID")) )
     If Quatity <= 0 Then 
        Quatity = CInt( Session(rs("ProductID")) )
        If Quatity <= 0 Then Quatity = 1
     End If
     Session(rs("ProductID")) = Quatity
     Sum = Sum + CDbl(rs("Price")) * Quatity
%>
<TR>
<TD><%=rs("ProductID")%></TD>
<TD><%=rs("ProductName")%></TD>
<TD Align=Right><%=rs("Price")%></TD>
<TD><Input Type=Text Name="<%="Q_" & rs("ProductID")%>" Value=<%=Quatity%> Size=3></TD>
<TD Align=Right><%=CDbl(rs("Price"))*Quatity%></TD>
<TD><A HREF=<%=rs("Link")%>><%=rs("Description")%></A></TD>
</TR>
<%
      rs.MoveNext
   Wend
%>
<TR><TD Align=Right ColSpan=7><Font Color=Red>总价格=<%=Sum%></Font></TD></TR>
</TABLE>
</center>
<form action="book.asp" method="post" name="order">
<div align="center"><center>
<table border="0" width="554">
  <tr>
    <td width="580">
    <hr>
    <p>付款人信息</p>
    <hr>
    姓名: <input type="text" name="fname" size="20"> 
    <p>地址: <input type="text" name="faddress" size="20"></p> 
    <p>邮编: <input type="text" name="fzode" size="20"></p> 
    <p>电话: <input type="text" name="ftele" size="20"></p> 
    <p>E_mail:<input type="text" name="fmail" size="20"></p> 
    <hr> 
 
    <font face="标楷体"><big>收货人资料</big></font> 
    <hr> 
    <p> 
    姓名: <input type="text" name="rname" size="20"> 
    <p> 
    地址: <input type="text" name="raddress" size="20"> 
    <p> 
    邮编: <input type="text" name="rzode" size="20"> 
    <p> 
    电话: <input type="text" name="rtele" size="20"><p>E_mail:<input type="text" name="rmail" size="20"><big> 
    <hr> 
    <input type="button" value="准备订购" > 
    <input type="reset" value="清除内容">  
    </big>  
    </td>  
  </tr>  
</table>  
</center></div>  
</form>  
  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -