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

📄 shopa_formatorder.asp

📁 本软件可以实现的功能如下:   用户管理
💻 ASP
字号:
<%option explicit%>
<!-- #include file="shop$db.asp" -->
<%
'*****************************************************************
'  call by shopa_displayorders to format an order
'  Display one order
'  April 1, 2000
'*******************************************************************
Dim Orders
Dim Items
Dim strSQL
Dim lngOrderid
Dim lngOcustomerid
Dim datOdate
Dim curOrderamount
Dim strOlastname
Dim strOemail
Dim strOaddress
Dim strOcity
Dim strOpostcode
Dim strOstate
Dim strOcountry
Dim strOphone
Dim strOfax
Dim strOcompany
Dim strOcardtype
Dim strOcardno
Dim strOcardname
Dim strOcardexpires
Dim strOcardaddress
Dim booOprocessed
Dim strOcomment
Dim curOtax
Dim datOpromisedshipdate
Dim datOshippeddate
Dim lngOshipmethod
Dim curOshipcost
Dim strOshipname
Dim strOshipcompany
Dim strOshipemail
Dim strOshipmethodtype
Dim strOshipaddress
Dim strOshiptown
Dim strOshipzip
Dim strOshipstate
Dim strOshipcountry
Dim lngOpaymethod
Dim strOther1
Dim strOther2
Dim Dbc
dim oid
dim rc
AdminPageHeader              ' Normal page header
ShopOpenDatabase dbc            ' Open the database 
oid=request.querystring("OID")
OpenOrder                   ' pen orders and items
FormatDetails
FormatCustomer
AdminPageTrailer             ' Normal Shop page trailer
ShopCloseDatabase   dbc        ' Close the database 
'
Sub OpenOrder
dim sql
strsql = "select * from orders where 订单id=" & oid
Set Orders = Server.CreateObject("ADODB.Recordset")
Orders.open strSQL, dbc, adopenkeyset, adlockoptimistic
if (Orders.BOF and Orders.EOF) then
	WriteInfo  "There are no orders that match your search criteria."
        rc=4
        exit sub
else
      GetOrderData
      strSQL = "select * FROM oitems where 订单id = " & Orders("订单id")
      Set Items = dbc.Execute(strSQL)
      if Items.EOF then
             writeInfo "Order items missing"
      else
       items.movefirst
      end if 
end if
end sub
Sub GetOrderData
lngOrderid = ORDERS("订单id")
		lngOcustomerid = ORDERS("客户id")
		datOdate = ORDERS("日期")
		curOrderamount = ORDERS("总金额")
		strOlastname = ORDERS("姓名")
		strOemail = ORDERS("邮箱")
		strOaddress = ORDERS("地址")
		strOcity = ORDERS("城市")
		strOpostcode = ORDERS("邮政编码")
		strOstate = ORDERS("省份")
		strOcountry = ORDERS("国家")
		strOphone = ORDERS("电话")
		strOfax = ORDERS("传真")
		strOcompany = ORDERS("公司")
		strOcardtype = ORDERS("Ocardtype")
		strOcardno = ORDERS("信用卡号")
		strOcardname = ORDERS("持卡人")
		strOcardexpires = ORDERS("Ocardexpires")
		strOcardaddress = ORDERS("持卡人地址")
		booOprocessed = ORDERS("处理")
		strOcomment = ORDERS("备注")
		curOtax = ORDERS("税金")
		datOpromisedshipdate = ORDERS("承诺送货日期")
		datOshippeddate = ORDERS("实际送货日期")
		lngOshipmethod = ORDERS("货运方式")
		curOshipcost = ORDERS("运费")
		strOshipname = ORDERS("Oshipname")
		strOshipcompany = ORDERS("Oshipcompany")
		strOshipemail = ORDERS("Oshipemail")
		strOshipmethodtype = ORDERS("Oshipmethodtype")
		strOshipaddress = ORDERS("Oshipaddress")
		strOshiptown = ORDERS("Oshiptown")
		strOshipzip = ORDERS("Oshipzip")
		strOshipstate = ORDERS("Oshipstate")
		strOshipcountry = ORDERS("Oshipcountry")
		lngOpaymethod = ORDERS("Opaymethod")
		strOther1 = ORDERS("Other1")
		strOther2 = ORDERS("Other2")
end sub

' Format details

Sub FormatDetails
dim totalprice
dim quantity
dim unitprice
dim mylink
Dim total
Dim isubtotal
dim mycolor
mycolor="#FFFFFF"
if boooprocessed<>0 then
   WriteInfo "This order has been processed"
end if 
Response.write "<b>订单号: " & lngOrderid & "</b> on " & adFormatdate(datODate) & "<br>"
%>
<table   <table border="2" cellpadding="0" cellspacing="1" width="80%">
  <tr>
    <td bgcolor="#99CCCC" colspan="8"><font face="Arial, Arial, Helvetica"><font color="#FFFFFF" face="Arial"><strong>Order Details:</strong></font></td>
  </tr>
  <tr>
    <td bgcolor="#CFDFFC"><font face="Arial, Arial, Helvetica">商品</font></td>
    <td bgcolor="#CFDFFC"><font face="Arial, Arial, Helvetica">数量</font></td>
    <td bgcolor="#CFDFFC"><font face="Arial, Arial, Helvetica">单价</font></td>
    <td bgcolor="#CFDFFC"><font face="Arial, Arial, Helvetica">合计</font></td>
  </tr>

<%
	Do While Not Items.EOF
'link to catalog item in database
mylink=" <a href=shopa_editrecord.asp?database=" & Session("db") & "&table=products&idfield=目录id&which=" & items("catalogid") & ">" & Items("ItemName") & "</a>"        
quantity=Items("numitems")
unitprice=Items("UnitPrice")
totalprice=quantity*unitprice
%>
<td width="60%" bgcolor="<%=mycolor%>"><font face="Arial, Arial, Helvetica"><% = mylink%></font></TD>
<td width="10%" bgcolor="<%=mycolor%>"><font face="Arial, Arial, Helvetica"><% = quantity%></font></TD>
<td width="10%" align="right" bgcolor="<%=mycolor%>"><font face="Arial, Arial, Helvetica"><% = formatcurrency(unitprice,2)%></font></TD>
<td width="10%" align="right" bgcolor="<%=mycolor%>"><font face="Arial, Arial, Helvetica"><% = formatcurrency(totalprice,2)%></font></TD>
<TR>
<% 
        isubtotal=isubtotal+totalprice
	Items.MoveNext
	Loop 
        AddOthers isubtotal, total, curoshipcost,curotax,"Format"
end sub

Sub FormatCustomer
%>
<TABLE border=1 cellPadding=1 cellSpacing=1 width=80% bordercolordark="#333399" bordercolorlight="#666699">
<%
  DoHeader "客户资料"
  DoField "姓名", stroLastName 
  DoField  "地址" ,stroAddress
  DoField  "城市/乡镇", stroCity
  DoField  "省份" , stroState
  DoField  "邮政编码",stroPostCode 
  DoField  "国家",strocountry
  DoField   "邮箱",stroemail
  DoField  "电话",strophone
  DoField  "传真",strofax
  DoField  "公司",strocompany
  DoHeader  "Payment Information"
  DoField   "Card Type",strocardtype
  DoField   "Card Name",strocardname
  Dofield   "Card Number",strocardno
  DoField   "Card Expiry",strocardexpires
  DoField   "Card Address",strocardaddress
  Doheader  "Shipping Information"
  DoField   "Shipping Method",stroshipmethodtype
  DoField   "Shipping Price", curoshipcost
  DoField   "Ship To",stroshipname
  Dofield   "Shipping Address",stroshipaddress
  DoField   "Ship 城市/乡镇",stroshiptown
  DoField    "Ship State",stroshipstate 
  Dofield   "Ship Post code",stroshipzip
  Dofield   "Ship Company",stroshipcompany
  DoField    "Ship Country",stroshipcountry
%>
</TABLE>
<font face="Trebuchet MS, Arial, Helvetica"><font face="Arial, Arial, Helvetica">
<%
If Orders("备注") <> "" then
%>
     
<h3>订单备注和特别请求</h3>
     <font face="Arial, Arial, Helvetica"><%=Orders("备注")%><br></font>     
<%end if%>
<%
End Sub
Sub WriteInfo (msg)
%>
<p align="center"><font face="Arial" color="#FF0000"><b><%=msg%></b></font></p>
<%
end sub
Sub DoHeader (mytext)
%>
  <TR>
 <TD align="left" colspan=2 bgColor=darkblue><font face="Trebuchet MS, Arial, Helvetica"><font face="Arial, Arial, Helvetica"><FONT color=white face="" style="BACKGROUND-COLOR: #00008b">
        <STRONG><%=mytext%></STRONG></FONT> </font></font></TD>
 </TR>
<%
end sub
Sub DoField (fieldname,fieldvalue)
%>
 <TR>
 <TD align="left"><font face="Trebuchet MS, Arial, Helvetica" size="2"><%=fieldname%></font></TD>
 <TD align="left"><font face="Trebuchet MS, Arial, Helvetica" size="2"><b><%=fieldvalue%></b></font></TD></TR>
<%
end sub
Function AdFormatDate(indate)
dim monthname
Dim outdate
Dim m
Dim d
dim yyyy
 monthname=array("Jan","Feb","Mar","Apr", _
            "May","Jun","Jul","Aug", _
            "Sep","Oct","Nov","Dec")

m=DatePart("m",indate)
m=M-1
outdate = monthname(m) & " "
d=Datepart("d", indate)
outdate = outdate & d
yyyy=Datepart("yyyy",indate)
outdate = outdate & " " & yyyy
AdFormatdate=outdate
end function

%>

⌨️ 快捷键说明

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