<!--#include file="conn.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%if strUserName="" then
Conn.Close
Set Conn = Nothing
response.write "<script language=javascript>alert('对不起，请先注册或登录！');history.go(-1);</script>"
response.End
end if%>
<!--#include file="buy2buysys.asp"-->
<title><%=webname%>--订单详细资料</title>
<%dim goods,YourPrice
goods=SafeRequest("dan",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,product.code,orders.OtherProperty from product inner join orders on product.id=orders.id where orders.username='"&strUserName&"' and 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
%>
<style type="text/css">
<!--
.style1 {
	color: #FF0000;
	font-weight: bold;
}
-->
</style>
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#f2f2f2">
  <tr> 
    <td height="20" colspan="2" align="center">订单号为：<%=goods%> 　　　　
	<input type="button" class="input_bot" onClick="javascript:window.print()" value="打 印 订 单"></td>
  </tr>
  <tr> 
    <td width="13%" align="right" valign="middle" bgcolor="#f7f7f7">相关信息：</td>
    <td bgcolor="#FFFFFF" ><br>
      <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#f2f2f2">
        <tr align="center" bgcolor="#F7F7F7"> 
          <td width="28%" height="25">商品名称</td>
          <td width="17%">编号</td>
          <td width="7%" height="25">数量</td>
          <td width="10%" height="25">市场价</td>
          <td width="10%" height="25">会员价</td>
          <td width="9%" height="25">结算价</td>
          <td width="6%" height="25">积分</td>
          <td width="13%" height="25">商品金额</td>
        </tr>
        <%dim sum1,sums1
		do while not rs.eof 
		YourPrice =  Round(rs("" & LstPrice & ""),2)
		%>
        <tr bgcolor="#FFFFFF"> 
          <td height="25" style='PADDING-LEFT: 5px'><a href=b2b_cpinfo.asp?id=<%=rs("id")%> target=_blank><%response.write trim(rs("name"))&"("&trim(rs("OtherProperty"))&")"%></a></td>
          <td height="25" style='PADDING-LEFT: 5px'><%=rs("code")%></td>
          <td height="25" align="center"><%=rs("productnum")%></td>
          <td height="25" align="center"><%=rs("price1")%>元</td>
          <td height="25" align="center"><%=rs("price2")%>元</td>
          <td height="25" align="center"><%=Round(YourPrice,2) %>元</td>
          <td height="25" align="center"><%=rs("score")%>分</td>
          <td height="25" align="center"><%=Round(rs("paid"),2)%>元</td>
        </tr>
        <%sum1=rs("paid")+sum1
		sums1=sums1+rs("score")*rs("productnum")
		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>
            <%dim rs2,LngFee
              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 "此方式已经被删除"
				A="此方式已经被删除"
              	'response.write "&nbsp;附加费用：0元"
				B="0元"
				C="0%"
			  	'response.write "&nbsp;&nbsp;金额总计："&sum1&" 元，获得积分"&sums1&"分"
				D=sum1
				E=sums1
             else
				Sum1 = Sum1*(1+rs2("payfee")/100)
		  		IF webbj5 = 0 Then
		  			LngFee = rs2("fee")
		  		Else
		  			If Sum1>=Webbj5 Then
					LngFee = 0
					Else
					LngFee = rs2("fee")
					End If
		  		End IF
              	'response.Write trim(rs2("subject"))
				A=trim(rs2("subject"))
				B=LngFee&"元"
				C=rs2("payfee")&"%"
				D=Round((sum1+LngFee),2)&"元"
				E=sums1&"分"
              	'response.write "&nbsp;附加邮费：<font color=red>"&LngFee&"</font>元，方式加收<font color=red>"&rs2("payfee")&"%</font>"
		  		'response.write "&nbsp;&nbsp;金额总计：<font color=red>"&Round((sum1+LngFee),2)&"</font>&nbsp;元，获得积分&nbsp;<font color=red>"&sums1&"</font>&nbsp;分"
		  	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 bgcolor="#FFFFFF">
          <td height="25" colspan="5" align="right"><% IF webbj5 <> 0 Then
		  		response.write "<br>购物满&nbsp;<font color=red>"&webbj5&"</font>&nbsp;元免附加邮费。"
		    End IF%></td>
        </tr>
      </table>
      <br></td>
  </tr>
  <tr> 
    <td height="25" align="right" bgcolor="#f7f7f7" style='PADDING-LEFT: 6px'>收货人姓名：</td>
    <td height="25" bgcolor="#FFFFFF" >&nbsp;<%=trim(rs("receipt"))%><% 
		   if trim(rs("UserSex")) = 0 then
    response.Write "&nbsp;(先生)"
    else
    response.Write "&nbsp;(女士)"
    end if%></td>
  </tr>
  <tr> 
    <td height="25" align="right" bgcolor="#f7f7f7" style='PADDING-LEFT: 6px'>收货地址：</td>
    <td height="25" bgcolor="#FFFFFF" >&nbsp;<%=trim(rs("address"))%></td>
  </tr>
  <tr> 
    <td height="25" align="right" bgcolor="#f7f7f7" style='PADDING-LEFT: 6px'>邮　　编：</td>
    <td height="25" bgcolor="#FFFFFF" >&nbsp;<%=trim(rs("postcode"))%></td>
  </tr>
  <tr> 
    <td height="25" align="right" bgcolor="#f7f7f7" style='PADDING-LEFT: 6px'>联系电话：</td>
    <td height="25" bgcolor="#FFFFFF" >&nbsp;<%=trim(rs("usertel"))%></td>
  </tr>
  <tr> 
    <td height="25" align="right" bgcolor="#f7f7f7" style='PADDING-LEFT: 6px'>电子邮件：</td>
    <td height="25" bgcolor="#FFFFFF" >&nbsp;<%=trim(rs("useremail"))%></td>
  </tr>
  <tr> 
    <td height="25" align="right" bgcolor="#f7f7f7" style='PADDING-LEFT: 6px'>送货方式：</td>
    <td height="25" bgcolor="#FFFFFF" >&nbsp;<%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 height="25" align="right" bgcolor="#f7f7f7" style='PADDING-LEFT: 6px'>支付方式：</td>
    <td height="25" bgcolor="#FFFFFF" >&nbsp;<%
    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 height="25" align="right" bgcolor="#f7f7f7" style='PADDING-LEFT: 6px'>下单日期：</td>
    <td height="25" bgcolor="#FFFFFF" >&nbsp;<%=rs("actiondate")%></td>
  </tr>
  <tr> 
    <td height="25" colspan="2" align="center"> <%if rs("state")=2 then%> <!--<a href="save.asp?action=del&dan=<%=goods%>">删除订单</a>-->
      <%end if%> 
    &nbsp;<a href="JavaScript:onClick=window.opener.location.href = window.opener.location.href; window.close();">关闭窗口</a></td>
  </tr>
</table>
