<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<title><%=webname%>--订单详细资料</title>
<LINK 
href="img/code43.css" type=text/css rel=stylesheet>
<%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
%>
<table width="98%" border="0" cellspacing="0" cellpadding="1" bordercolor=<%=bgclr1%> align="center">
  <tr bgcolor=<%=bgclr3%>> 
    <td height="20" colspan="2" align="center">订单号为：<%=goods%> ，详细资料如下：</td>
  </tr>
  <tr bgcolor=<%=bgclr3%>> 
    <td width="13%" valign="top">商品列表：</td>
    <td><table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="<% = bgclr1 %>">
        <tr bgcolor=<%=bgclr1%> align="center"> 
          <td><font color="#FFFFFF">商品名称</font></td>
          <td width="10%"><font color="#FFFFFF">订购数量</font></td>
          <td width="10%"><font color="#FFFFFF">市场价</font></td>
          <td width="5%"><font color="#FFFFFF">会员价</font></td>
          <td width="12%"><font color="#FFFFFF">您的价格</font></td>
		  <td width="5%"><font color="#FFFFFF">邮费</font></td>
          <td width="8%"><font color="#FFFFFF">积分</font></td>
          <td width="14%"><font color="#FFFFFF">金额小计</font></td>
        </tr>
        <%dim sum1,sums1
		do while not rs.eof 
		YourPrice =  Round(rs("" & LstPrice & ""),2)
		%>
        <tr bgcolor=#FFFFFF> 
          <td style='PADDING-LEFT: 5px'><a href=product.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"><%=Round(rs("vipprice"),2) %>元</td>
          <td align="center"><%=rs("score")%>分</td>
          <td align="center"><%=Round(rs("paid"),2)%>元</td>
        </tr>
        <%sum1=rs("paid")+sum1
		sums1=sums1+rs("score")*rs("productnum")
		rs.movenext
		loop
		rs.movefirst%>
        <tr bgcolor= #FFFFFF> 
          <td colspan="8" height="19" align="left">您的送货方式是： 
            <%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 "此方式已经被删除"
              response.write "&nbsp;附加费用：0元"
			  response.write "&nbsp;&nbsp;金额总计："&sum1&" 元，获得积分"&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"))
              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
		 IF webbj5 <> 0 Then
		  	response.write "<br>购物满&nbsp;<font color=red>"&webbj5&"</font>&nbsp;元免附加邮费。"
		    End IF
		  %>
          </td>
        </tr>
      </table> </td>
  </tr>
  <tr bgcolor=<%=bgclr3%>> 
    <td valign="top">订单状态：</td>
    <td><table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="<% = bgclr1 %>">
        <form name="form1" method="post" action="save.asp?dan=<%=goods%>&score=<% = sums1 %>&action=save">
          <tr> 
            <td bgcolor="#FFFFFF">
              <%  grade() %>&nbsp;<input type="submit" name="Submit" value="修改订单状态"> 
            </td>
          </tr>
        </form>
      </table></td>
  </tr>
  <tr bgcolor=<%=bgclr3%>> 
    <td style='PADDING-LEFT: 6px'>订货人姓名：</td>
    <td><%=trim(rs("realname"))%></td>
  </tr>
  <tr bgcolor=<%=bgclr3%>> 
    <td style='PADDING-LEFT: 6px'>收货人姓名：</td>
    <td><%=trim(rs("receipt"))%><% 
		   if trim(rs("UserSex")) = 0 then
    response.Write "&nbsp;(先生)"
    else
    response.Write "&nbsp;(女士)"
    end if%></td>
  </tr>
  <tr bgcolor=<%=bgclr3%>> 
    <td style='PADDING-LEFT: 6px'>收货地址：</td>
    <td><%=trim(rs("address"))%></td>
  </tr>
  <tr bgcolor=<%=bgclr3%>> 
    <td style='PADDING-LEFT: 6px'>邮　　编：</td>
    <td><%=trim(rs("postcode"))%></td>
  </tr>
  <tr bgcolor=<%=bgclr3%>> 
    <td style='PADDING-LEFT: 6px'>联系电话：</td>
    <td><%=trim(rs("usertel"))%></td>
  </tr>
  <tr bgcolor=<%=bgclr3%>> 
    <td style='PADDING-LEFT: 6px'>电子邮件：</td>
    <td><%=trim(rs("useremail"))%></td>
  </tr>
  <tr bgcolor=<%=bgclr3%>> 
    <td style='PADDING-LEFT: 6px'>送货方式：</td>
    <td> <%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 bgcolor=<%=bgclr3%>> 
    <td style='PADDING-LEFT: 6px'>支付方式：</td>
    <td> <%
    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 bgcolor=<%=bgclr3%>> 
    <td style='PADDING-LEFT: 6px'>您的留言：</td>
    <td><%=trim(rs("comments"))%></td>
  </tr>
  <tr bgcolor=<%=bgclr3%>> 
    <td style='PADDING-LEFT: 6px'>下单日期：</td>
    <td><%=rs("actiondate")%></td>
  </tr>
  <tr bgcolor=<%=bgclr3%>> 
    <td colspan="2" align="center"><a href="JavaScript:onClick=window.opener.location.href = window.opener.location.href; window.close();">关闭窗口</a> 
    </td>
  </tr>
</table>
<%sub grade()
select case rs("state")
case "1"%> 
<input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>未作任何处理<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox2" value="checkbox" DISABLED>服务商已收到款<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox3" value="checkbox" DISABLED>服务商已发货<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox4" value="checkbox" DISABLED>用户已经收到货
 <%case "2"%> 
<input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>未作任何处理<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox2" value="checkbox" DISABLED>服务商已收到款<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox3" value="checkbox" DISABLED>服务商已发货<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox4" value="checkbox" DISABLED>用户已经收到货 
<%case "3"%> 
<input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>未作任何处理<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox2" value="checkbox" checked DISABLED>服务商已收到款<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox3" value="checkbox" DISABLED>服务商已发货<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox4" value="checkbox" DISABLED>用户已经收到货 
<%case "4"%> 
<input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>未作任何处理<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox2" value="checkbox" checked DISABLED>服务商已收到款<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox3" value="checkbox" checked DISABLED>服务商已发货<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="state" value="5" >用户已经收到货 
<%case "5"%> 
<input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>未作任何处理<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox2" value="checkbox" checked DISABLED>服务商已收到款<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox3" value="checkbox" checked DISABLED>服务商已发货<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="state" value="5"  checked DISABLED>用户已经收到货 
<%end select
end sub%>
