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

📄 sale5.asp

📁 数据库课程设计
💻 ASP
字号:
<%@ LANGUAGE="VBScript" %>
<html>
<head>
<script language="vbscript">
<!--
' 注释:定义删除选购图书的操作过程
   Sub delbook(ISBN)
   ' 注释:请用户确认删除操作
      msg = "是否删除当前的订购图书?请确认..."
      If msgbox(msg, 292, "系统提示") = 7 Then Exit Sub
   ' 注释:处理删除操作
      aISBN = Split(fbag.ISBNs.value, ";")
      atitle = Split(fbag.titles.value, ";")
      anum = Split(fbag.nums.value, ";")
   ' 注释:利用循环语句将删除的信息去掉
      sISBN = "" : stitle = "" : snum = "" 
      For i = 0 To UBound(aISBN)
         If ISBN <> aISBN(i) Then
            If sISBN = "" Then
               sISBN = aISBN(i)
               stitle = atitle(i)
               snum = anum(i)
            Else
               sISBN = sISBN & ";" & aISBN(i)
               stitle = stitle & ";" & atitle(i)
               snum = snum & ";" & anum(i)
            End If
         End If
      Next
   ' 注释:更新保存的选购图书信息
      fbag.ISBNs.value = sISBN
      fbag.titles.value = stitle
      fbag.nums.value = snum
   ' 注释:更新购物袋的显示
      fbag.submit
   End Sub
-->
</script>
</head>
<body bgcolor="#FFFF99">
<font size=5 face=楷体_GB2312 color=red><b>购物袋:</b></font>
<%
' 注释:如果存在选购的图书信息就将他们显示出来
   If Request("ISBNs") <> "" Then
      ISBN = Split(Request("ISBNs"), ";")
      title = Split(Request("titles"), ";")
      num = Split(Request("nums"), ";")
   ' 注释:生成选购图书信息串
      outstr = ""
      For i = 0 To UBound(ISBN)
         If i = 0 Then outstr = "<table>"
         outstr = outstr & _
            "<tr><th>已订购:</th><td>" & _
            "<a href=detail.asp?ISBN=" & ISBN(i) & _
            " target=_blank title=查看该图书的详细信息>" & title(i) & "</a>" & _
            "<td>" & num(i) & "本</td>" & _
            "<td><a href='#' onclick=delbook('" & ISBN(i) & "') " & _
            "onmousemove=window.status='删除' onmouseout=window.status=''" & _ 
            ">删除</a></td></tr>"
      Next
      If outstr <> "" Then outstr = outstr & "</table>"
   Else
      outstr = "<b>您的购物袋还是空的!</b>"
   End If
' 注释:显示相关信息
   Response.Write(outstr)
%>
<form name="fbag" action="sale5.asp" method="post">
   <input name="ISBNs" type="hidden" value=<% =Request("ISBNs") %>>
   <input name="titles" type="hidden" value=<% =Request("titles") %>>
   <input name="nums" type="hidden" value=<% =Request("nums") %>>
</form>
<form name="fpay" action="pay1.asp" method="post" target="_blank">
   <input name="ISBNs" type="hidden">
   <input name="nums" type="hidden">
</form>
</body>
</html>

⌨️ 快捷键说明

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