?? order_list.asp
字號:
<%@ LANGUAGE = VBScript %>
<!--#INCLUDE FILE="include/shop.asp" -->
<!--#INCLUDE FILE="include/util.asp" -->
<% REM ######################################################################### %>
<% REM %>
<% REM ORDER_LIST.ASP %>
<% REM Epro v1.00 %>
<% REM 列出一條訂單 %>
<% REM Copyright (c) 1996-98 Epro. All rights reserved. %>
<% REM %>
<% REM ######################################################################### %>
<%
dim errorList
shortname=checklength(request("username"),20)
password=checklength(request("userpass"),20)
if (isnull(shortname) or isnull(password)) and (isnull(ShopperID) or isempty(ShopperID)) then
errorList=errorList & "用戶登錄失敗。<br>"
else
if (isnull(ShopperID) or isempty(ShopperID)) then
cmdTemp.CommandText = "SELECT shortname FROM Shopper WHERE shortname = '" & Replace(shortname, "'", "''") & "' and password='" & Replace(password, "'", "''") & "'"
Set rstShopper = Server.CreateObject("ADODB.Recordset")
rstShopper.Open cmdTemp, , adOpenKeyset, adLockReadOnly
if rstShopper.RecordCount =0 then
errorList=errorList & "用戶名或密碼錯誤。<br>"
else
Session("ShopperId") = rstShopper("shortname").value
end if
rstShopper.Close
else
shortname=ShopperID
end if
end if
if errorList<> "" then
%>
<!--#INCLUDE FILE="include/error.asp" -->
<%
else
%>
<%
order_id=checknum(Request("oid"),16)
if isnull(order_id) then
cmdTemp.CommandText = "SELECT * FROM Shop_order WHERE shoppername = '" & Replace(shortname, "'", "''") & "' order by order_id desc"
else
cmdTemp.CommandText = "SELECT * FROM Shop_order WHERE shoppername = '" & Replace(shortname, "'", "''") & "' and order_id=" & order_id
end if
Set rstOrder = Server.CreateObject("ADODB.Recordset")
rstOrder.Open cmdTemp, , adOpenKeyset, adLockReadOnly
if rstOrder.RecordCount>0 then
order_id= rstOrder("order_id")
status=rstOrder("status")
orderdate=rstOrder("date_entered")
ship_to_name=rstOrder("sname")
ship_to_street=rstOrder("sstreet")
ship_to_city=rstOrder("scity")
ship_to_state=rstOrder("sprovince")
ship_to_phone=rstOrder("sphone")
ship_to_email=rstOrder("semail")
ship_to_zip=rstOrder("szip")
bill_to_name=rstOrder("bname")
bill_to_street=rstOrder("bstreet")
bill_to_city=rstOrder("bcity")
bill_to_state=rstOrder("bprovince")
bill_to_method=rstOrder("paymode")
bill_to_phone=rstOrder("bphone")
bill_to_email=rstOrder("bemail")
bill_to_zip=rstOrder("bzip")
description=rstOrder("description")
total_price=rstOrder("total")
ship_fee=rstOrder("ship_fee")
pay_currency=rstOrder("currency")
session("remains")=rstOrder("remain")
rstOrder.Close
if pay_currency="美金" then
pay_flag="$"
else
pay_flag="¥"
end if
select case bill_to_method
case "1"
bill_to_method="國際匯兌"
case "2"
bill_to_method="西聯匯款"
case "3"
bill_to_method="貨到付款"
case "4"
bill_to_method="郵政資費支付卡"
case "5"
bill_to_method="網銀支付"
end select
cmdTemp.CommandText = "SELECT * FROM order_item WHERE order_id = " & order_id
rstOrder.Open cmdTemp, , adOpenKeyset, adLockReadOnly
cmdTemp.CommandText = "SELECT order_id FROM Shop_order WHERE shoppername = '" & Replace(shortname, "'", "''") & "' and order_id>" & order_id & " order by order_id"
Set recordSet = Server.CreateObject("ADODB.Recordset")
recordSet.Open cmdTemp, , adOpenKeyset, adLockReadOnly
if not recordset.EOF then
nextorder_id=recordSet("order_id")
end if
recordSet.Close
cmdTemp.CommandText = "SELECT order_id FROM Shop_order WHERE shoppername = '" & Replace(shortname, "'", "''") & "' and order_id<" & order_id & " order by order_id desc"
recordSet.Open cmdTemp, , adOpenKeyset, adLockReadOnly
if not recordset.EOF then
preorder_id=recordSet("order_id")
end if
recordSet.Close
else
errorList="查不到該訂單"
end if
if errorList<> "" then
%>
<!--#INCLUDE FILE="include/error.asp" -->
<%
else
%>
<html>
<head><title> 訂單顯示</title>
<meta content="text/html; charset=gb2312" http-equiv="Content-Type">
<link REL="stylesheet" HREF="ecom.css" TYPE="text/css">
</head>
<body topmargin="0">
<!--#INCLUDE FILE = "include/toolbar.asp" -->
<center>
<br>
<table border="0" width="720" align="center">
<tr>
<td width="720" >
<table border="0" width="600" align="center">
<tr>
<td width="100" align="left" bgColor=<%=tdcolor4%>>
<% if not isempty(preorder_id) then%>
<a href="order_list.asp?oid=<%=preorder_id%>">上一條</a>
<%end if%>
</td>
<td align="middle" bgColor=<%=tdcolor4%> colSpan=2 width="300" height=25>
<p align="center"><b>訂單顯示</b> (訂單號:<%=order_id%>)(訂單狀態:<%=status%>)</p>
</td>
<td width="200" align="right" bgColor=<%=tdcolor4%>>
<% if not isempty(nextorder_id) then%>
<a href="order_list.asp?oid=<%=nextorder_id%>">下一條</a>
<%end if%>
</td>
</tr>
<tr bgColor=<%=thcolor4%>>
<td width="100"><font color="#000000">名稱</font></td>
<td width="200"><font color="#000000">數量</font></td>
<td width="100"><font color="#000000">單價</font></td>
<td width="200"><font color="#000000">小計</font></td>
</tr>
<% For i = 1 to rstOrder.RecordCount
If rstOrder.EOF then exit for
%>
<tr>
<td bgColor=<%=tdleft4%> width="100"><% =rstOrder("name").value %></td>
<td bgColor=<%=tdleft4%> width="200"><% =rstOrder("quantity").value %></td>
<td bgColor=<%=tdleft4%> width="100"><%=pay_flag%><% =rstOrder("adjusted_price").value %></td>
<%
quantity=rstOrder("quantity").value
adjusted_price=rstOrder("adjusted_price").value
subtotal_price=formatnumber(quantity)*formatnumber(adjusted_price,2)
%>
<td bgColor=<%=tdleft4%> width="200"><%=pay_flag%><% =subtotal_price %> FR:<% =rstOrder("market_name").value %></td>
</tr>
<%if not Isnull(rstOrder("Product_type")) then
if trim(cstr(rstOrder("Product_type")))<>"" then%>
<tr>
<td align="middle" bgColor=<%=tdcolor4%> colSpan=4" width="600" height=25>
<p align="left"> <b>規格</b>(<%=trim(cstr(rstOrder("Product_type")))%>)</p>
</td>
</tr>
<%end if
end if%>
<% rstOrder.MoveNext%>
<% next %>
<tr>
<td width="100"> </td>
<td width="200"> </td>
<td bgColor=<%=tdleft4%> width="100">合計</td>
<td bgColor=<%=tdleft4%> width="200"><%=pay_flag%><% =subtotal_price %></td>
</tr>
<tr>
<td width="100"> </td>
<td width="200"> </td>
<td bgColor=<%=tdleft4%> width="100">運費</td>
<td bgColor=<%=tdleft4%> width="200"><%=pay_flag%><% =ship_fee %></td>
</tr>
<tr>
<td width="100"> </td>
<td width="200"> </td>
<td bgColor=<%=tdleft4%> width="100">總計</td>
<td bgColor=<%=tdleft4%> width="200"><%=pay_flag%><% =total_price %></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="720">
<table width="600" align="center">
<tr>
<td bgColor=<%=tdcolor4%> height="28" width="100"><font color="#0000FF">付款方式:</font></td>
<td bgColor=<%=tdcolor4%> ><font color="#000000" >
<%
if trim(cstr(bill_to_method))="郵政資費支付卡" then
Response.Write "郵政資費支付卡"
if not isnull(session("remains")) then
if clng(session("remains"))=0 then
' Response.Write " (" + clng(tradesum) + ")"
else
Response.Write " (余額不足,剩余貨款 " + cstr(cdbl(session("remains"))) + " 元為貨到付款)"
end if
end if
else
Response.Write bill_to_method
end if
%>
</font></td>
<td bgColor=<%=tdcolor4%> height="28" width="100"><font color="#0000FF">幣種:</font></td>
<td bgColor=<%=tdcolor4%> ><font color="#000000" ><%=pay_currency%></font></td> </tr>
<tr>
<td bgColor=<%=tdleft4%> height="28" width="100"><font color="#0000FF">收件人姓名:</font></td>
<td bgColor=<%=tdleft4%> height="28" width="200"><font color="#000000" ><%=ship_to_name%></font></td>
<td bgColor=<%=tdleft4%> height="28" width="100"><font color="#0000FF">付款人姓名:</font></td>
<td bgColor=<%=tdleft4%> height="28" width="200"><font color="#000000" ><%=bill_to_name%></font></td>
</tr>
<tr>
<td bgColor=<%=tdleft4%> height="28" width="100"><font color="#0000FF">收件人位置:</font></td>
<td bgColor=<%=tdleft4%> height="28" width="200"><font color="#000000" ><%=ship_to_state%></font></td>
<td bgColor=<%=tdleft4%> height="28" width="100"><font color="#0000FF">付款人位置:</font></td>
<td bgColor=<%=tdleft4%> height="28" width="200"><font color="#000000" ><%=bill_to_state%></font></td>
</tr>
<tr>
<td bgColor=<%=tdleft4%> height="28" width="100"><font color="#0000FF">收件人城市:</font></td>
<td bgColor=<%=tdleft4%> height="28" width="200"><font color="#000000" ><%=ship_to_city%></font></td>
<td bgColor=<%=tdleft4%> height="28" width="100"><font color="#0000FF">付款人城市:</font></td>
<td bgColor=<%=tdleft4%> height="28" width="200"><font color="#000000" ><%=bill_to_city%></font></td>
</tr>
<tr>
<td bgColor=<%=tdleft4%> height="28" width="100"><font color="#0000FF">收件人地址:</font></td>
<td bgColor=<%=tdleft4%> height="28" width="200"><font color="#000000" ><%=ship_to_street%></font></td>
<td bgColor=<%=tdleft4%> height="28" width="100"><font color="#0000FF">付款人地址:</font></td>
<td bgColor=<%=tdleft4%> height="28" width="200"><font color="#000000" ><%=bill_to_street%></font></td>
</tr>
<tr>
<td bgColor=<%=tdleft4%> height="28" width="100"><font color="#0000FF">收件人電話:</font></td>
<td bgColor=<%=tdleft4%> height="28" width="200"><font color="#000000" ><%=ship_to_phone%></font></td>
<td bgColor=<%=tdleft4%> height="28" width="100"><font color="#0000FF">付款人電話:</font></td>
<td bgColor=<%=tdleft4%> height="28" width="200"><font color="#000000" ><%=bill_to_phone%></font></td>
</tr>
<tr>
<td bgColor=<%=tdleft4%> height="28" width="100"><font color="#0000FF">收件人郵政編碼:</font></td>
<td bgColor=<%=tdleft4%> height="28" width="200"><font color="#000000" ><%=ship_to_zip%></font></td>
<td bgColor=<%=tdleft4%> height="28" width="100"><font color="#0000FF">付款人郵政編碼:</font></td>
<td bgColor=<%=tdleft4%> height="28" width="200"><font color="#000000" ><%=bill_to_zip%></font></td>
</tr>
<tr>
<td bgColor=<%=tdleft4%> height="28" width="100"><font color="#0000FF">收件人Email:</font></td>
<td bgColor=<%=tdleft4%> height="28" width="200"><font color="#000000" ><%=ship_to_email%></font></td>
<td bgColor=<%=tdleft4%> height="28" width="100"><font color="#0000FF">付款人Email:</font></td>
<td bgColor=<%=tdleft4%> height="28" width="200"><font color="#000000" ><%=bill_to_email%></font></td>
</tr>
</table>
</td>
</tr>
</table>
<!--#INCLUDE FILE = "include/footer.asp" -->
</center>
</body></html>
<%end if
end if%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -