<!--#include file="conn.asp"-->
<!--#include file="buy2buysys.asp"-->
<title><%=webname%>--订单详细资料</title>
<%dim goods,YourPrice
goods=SafeRequest("searchkey",1)
set rs=server.CreateObject("adodb.recordset")
rs.open "select product.id,product.name,product.price1,product." & LstPrice & ",product.amount,product.score,product.price2,product.vipprice,orders.actiondate,orders.UserSex,orders.realname,orders.receipt,orders.goods,orders.postcode,orders.comments,orders.paymethord,orders.deliverymethord,orders.state,orders.paid,orders.useremail,orders.usertel,orders.address,orders.productnum from product inner join orders on product.id=orders.id where goods='"&goods&"' ",conn,1,1
if rs.eof and rs.bof then
rs.Close
Set rs = Nothing
Conn.Close
Set Conn = Nothing
response.write "<center>此订单中有商品已被管理员删除，无法处理，请通知管理员或者重下订单！</center>"
response.End
end if
%>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#f2f2f2">
  <tr bgcolor="#f7f7f7"> 
    <td height="25" colspan="2" align="center"><b>订单号为：<%=goods%></b> </td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2" valign="top"><table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#f2f2f2">
      <tr align="center" bgcolor="#F7F7F7">
        <td width="31%"><strong>商品名称</strong></td>
        <td width="10%"><strong>订购数量</strong></td>
        <td width="10%"><strong>市场价</strong></td>
        <td width="9%"><strong>会员价</strong></td>
        <td width="10%"><strong>结算价</strong></td>
        <td width="9%"><strong>积分</strong></td>
        <td width="11%"><strong>商品金额</strong></td>
      </tr>
      <%dim iii,jjj
		do while not rs.eof
		YourPrice =  Round(rs("" & LstPrice & ""),2)
%>
      <tr bgcolor="#FFFFFF">
        <td><a href=b2b_cpinfo.asp?id=<%=rs("id")%> target=_blank><%=trim(rs("name"))%></a></td>
        <td align="center"><%=rs("productnum")%></td>
        <td align="center"><%=rs("price1")%>元</td>
        <td align="center"><%=rs("price2")%>元</td>
        <td align="center"><%=Round(YourPrice,2) %>元</td>
        <td align="center"><%=rs("score")%>分</td>
        <td align="center"><%=Round(rs("paid"),2)%>元</td>
      </tr>
      <%
			  iii=rs("paid")+iii
			  jjj=rs("score")+jjj
		rs.movenext
		loop
		rs.movefirst%>
    </table>
      <br>    <table width="98%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#f2f2f2">
      <tr align="center" bgcolor="#F7F7F7">
        <td height="25">配送方式</td>
        <td height="25">配送费用</td>
        <td height="25">附加费</td>
        <td height="25">金额总计</td>
        <td height="25">获得积分</td>
      </tr>
      <%'
          set rs2=server.CreateObject("adodb.recordset")
          rs2.Open "select * from delivery where deliveryid="&int(rs("deliverymethord")),conn,1,1
		  if rs2.eof and rs2.bof then
		  A="此方式已经被删除"
		  B="0元"
		  C="0%"
		  D=Round(iii,2)
		  E=jjj&"分"
		  else
		  iii = iii*(1+ rs2("payfee")/100)
		  Dim LngFee
		  IF webbj5 = 0 Then
		  LngFee = rs2("fee")
		  Else
		  If iii >=webbj5 then
		  LngFee = 0
		  Else
		   LngFee = rs2("fee")
		  End If
		  End IF
			A=trim(rs2("subject"))
			B=rs2("fee")&"元"
			C=rs2("payfee")&"%"
			D=Round((iii+LngFee),2)&"元"
			E=jjj&"分"		  
		  end if
		  rs2.Close
		  set rs2=nothing
		  %>
      <tr bgcolor="#FFFFFF">
        <td height="25" align="center"><%=A%></td>
        <td height="25" align="center"><%=B%></td>
        <td height="25" align="center"><%=C%></td>
        <td height="25" align="center"><%=D%></td>
        <td height="25" align="center"><%=E%></td>
      </tr>
      <tr align="right" bgcolor="#FFFFFF">
        <td height="25" colspan="5"><%		 	IF webbj5 <> 0 Then
		  		response.write "<br>购物满&nbsp;<font color=red>"&webbj5&"</font>&nbsp;元免附加邮费。"
		    End IF%></td>
      </tr>
    </table></td>
  </tr>
  <tr> 
    <td width="13%" align="right" bgcolor="#F7F7F7">收货人姓名：</td>
    <td bgcolor="#FFFFFF" onmouseover="this.style.backgroundColor='#f2f2f2'; this.style.color='#ff0000' " onmouseout="this.style.backgroundColor='';this.style.color=''"><%=trim(rs("receipt"))%><% 
		   if trim(rs("UserSex")) = 0 then
    response.Write "&nbsp;(先生)"
    else
    response.Write "&nbsp;(女士)"
    end if%></td>
  </tr>
  <tr> 
    <td align="right" bgcolor="#F7F7F7">收货地址：</td>
    <td bgcolor="#FFFFFF" onmouseover="this.style.backgroundColor='#f2f2f2'; this.style.color='#ff0000' " onmouseout="this.style.backgroundColor='';this.style.color=''"><%=trim(rs("address"))%></td>
  </tr>
  <tr> 
    <td align="right" bgcolor="#F7F7F7">邮　　编：</td>
    <td bgcolor="#FFFFFF" onmouseover="this.style.backgroundColor='#f2f2f2'; this.style.color='#ff0000' " onmouseout="this.style.backgroundColor='';this.style.color=''"><%=trim(rs("postcode"))%></td>
  </tr>
  <tr> 
    <td align="right" bgcolor="#F7F7F7">联系电话：</td>
    <td bgcolor="#FFFFFF" onmouseover="this.style.backgroundColor='#f2f2f2'; this.style.color='#ff0000' " onmouseout="this.style.backgroundColor='';this.style.color=''"><%=trim(rs("usertel"))%></td>
  </tr>
  <tr> 
    <td align="right" bgcolor="#F7F7F7">电子邮件：</td>
    <td bgcolor="#FFFFFF" onmouseover="this.style.backgroundColor='#f2f2f2'; this.style.color='#ff0000' " onmouseout="this.style.backgroundColor='';this.style.color=''"><%=trim(rs("useremail"))%></td>
  </tr>
  <tr> 
    <td align="right" bgcolor="#F7F7F7">送货方式：</td>
    <td bgcolor="#FFFFFF" onmouseover="this.style.backgroundColor='#f2f2f2'; this.style.color='#ff0000' " onmouseout="this.style.backgroundColor='';this.style.color=''"> <%set rs2=server.CreateObject("adodb.recordset")
    rs2.Open "select * from delivery where deliveryid="&rs("deliverymethord"),conn,1,1
     if rs2.eof and rs2.bof then
		  response.write "方式已被删除"
		  else
		   response.Write trim(rs2("subject"))&"(送货费用"
	  response.Write (rs2("fee"))&"元，方式加收"
	   response.Write (rs2("payfee"))&"%)"
          end if
    rs2.Close
    %> </td>
  </tr>
  <tr> 
    <td align="right" bgcolor="#F7F7F7">支付方式：</td>
    <td bgcolor="#FFFFFF" onmouseover="this.style.backgroundColor='#f2f2f2'; this.style.color='#ff0000' " onmouseout="this.style.backgroundColor='';this.style.color=''"> <%
    rs2.Open "select * from delivery where deliveryid="&rs("paymethord"),conn,1,1
   if rs2.eof and rs2.bof then
		  response.write "方式已被删除"
	else
		 response.Write trim(rs2("subject"))
    end if
		  
    rs2.close
    set rs2=nothing%> </td>
  </tr>
  <tr> 
    <td align="right" bgcolor="#F7F7F7">您的留言：</td>
    <td bgcolor="#FFFFFF" onmouseover="this.style.backgroundColor='#f2f2f2'; this.style.color='#ff0000' " onmouseout="this.style.backgroundColor='';this.style.color=''"><%=trim(rs("comments"))%></td>
  </tr>
  <tr> 
    <td align="right" bgcolor="#F7F7F7">下单日期：</td>
    <td bgcolor="#FFFFFF" onmouseover="this.style.backgroundColor='#f2f2f2'; this.style.color='#ff0000' " onmouseout="this.style.backgroundColor='';this.style.color=''"><%=rs("actiondate")%></td>
  </tr>
  <tr> 
    <td colspan="2" align="center"><a href="JavaScript:onClick=window.opener.location.href = window.opener.location.href; window.close();">关闭窗口</a> 
    </td>
  </tr>
</table>
