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

📄 check.asp

📁 大家好
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="ADOVBS.INC"-->
<!--#include file="util.asp" -->
<%
DbPath = SERVER.MapPath("bookshop.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DbPath

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

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

sql = "Select * From book"
sql = sql & " Where bookbm In (" & ProductList & ")"
sql = sql & " Order By bookbm"
Set rs = conn.Execute( sql )
%>
<html>

<head>
<title>购书清单</title>
</head>

<body bgcolor="#ffffff">

<form Action="Check.asp" Method="POST" name=form1>
  <input type="hidden" name="cmdShow" value="Yes">
    
  <table Border="1" align="center" cellspacing="0">
    <tr bgcolor="#FFFFCC"> 
      <td colspan="8" align="center"><font color="#990066" size="6">购商品清单</font></td>
    </tr>
    <tr align="center" bgcolor="#495E5F"> 
      <td><font color="#FFFFFF">取消</font></td>
      <td bgcolor="#495E5F"><font color="#FFFFFF">商品名称</font></td>
      <td><font color="#FFFFFF">生产厂家</font></td>
      <td bgcolor="#495E5F"><font color="#FFFFFF">型号</font></td>
      <td><font color="#FFFFFF">售价</font></td>
      <td bgcolor="#495E5F"><font color="#FFFFFF">单位</font></td>
      <td bgcolor="#495E5F"><font color="#FFFFFF">数量</font></td>
      <td><font color="#FFFFFF">总价</font></td>
    </tr>
    <%
   Sum = 0
   While Not rs.EOF
     Quatity = CInt( Request( "Q_" & rs("bookbm")) )
     If Quatity <= 0 Then 
        Quatity = CInt( Session(rs("bookbm")) )
        If Quatity <= 0 Then Quatity = 1
     End If
     Session(rs("bookbm")) = Quatity
     Sum = Sum + csng(rs("yhj")) * Quatity
     Sum=FormatNumber(Sum,2) 
%> 
    <tr align="center" bgcolor="#D0E1D0"> 
      <td> 
        <input Type="CheckBox" Name="bookbm" Value="<%=rs("bookbm")%>" Checked>
      </td>
      <td align="left" bgcolor="#D0E1D0"><%=rs("bookname")%></td>
      <td><%=rs("Author")%></td>
      <td><%=rs("cd")%></td>
      <td bgcolor="#D0E1D0"><%=rs("yhj")%></td>
      <td><%=rs("dw") %></td>
      <td bgcolor="#D0E1D0"> 
        <input Type="Text" Name="<%="Q_" & rs("bookbm")%>" Value="<%=Quatity%>" Size="3">
      </td>
      <td><%=FormatNumber(csng(rs("yhj"))*Quatity,2)%></td>
    </tr>
    <%
     rs.MoveNext
     Wend
%> 
    <tr> 
      <td Align="right" ColSpan="9"><font Color="Red">总价格=<%=Sum%></font></td>
    </tr>
    <tr bgcolor="#3A766F"> 
      <td Align="left" ColSpan="6" bgcolor="#3A766F"><font color="#FFFFFF">1.您可以取消某项商品,或更改其数量,再点击&quot;购买确认&quot;按钮.</font></td>
      <td align="right" colspan="3"> 
        <input Type="submit" Value=" 购买确认">
      </td>
    </tr>
    <tr bgcolor="#3A766F"> 
      <td Align="left" ColSpan="9"><font color="#FFFFFF">2.在完成购物前请用浏览器的打印功能(选择“仅打印选定框架”)打印出订购单。</font></td>
    </tr>
    <tr bgcolor="#3A766F"> 
      <td Align="left" ColSpan="9"><font color="#FFFFFF">3.完成后请点击页面上方的图标&quot;确认购物&quot; 
        </font></td>
    </tr>
  </table>
    
  </form>
</body>
</html>

⌨️ 快捷键说明

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