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

📄 order_list.asp

📁 用ASP写的电子购物系统
💻 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 %>&nbsp;&nbsp;&nbsp;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">&nbsp;&nbsp;<b>规格</b>(<%=trim(cstr(rstOrder("Product_type")))%>)</p>
				        	</td>
				          </tr>	
                         <%end if
                         end if%>
		                      <% rstOrder.MoveNext%>
		                <% next %>

		                <tr>
							<td width="100">&nbsp;</td>
		                    <td width="200">&nbsp;</td> 
		                    <td bgColor=<%=tdleft4%> width="100">合计</td>
							<td bgColor=<%=tdleft4%> width="200"><%=pay_flag%><% =subtotal_price %></td> 
						</tr>
		                <tr>
							<td width="100">&nbsp;</td>
		                    <td width="200">&nbsp;</td> 
		                    <td bgColor=<%=tdleft4%> width="100">运费</td>
							<td bgColor=<%=tdleft4%> width="200"><%=pay_flag%><% =ship_fee %></td> 
						</tr>
		                <tr>
							<td width="100">&nbsp;</td>
		                    <td width="200">&nbsp;</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 + -