<!--#include file="conn.asp"-->
<%if request.cookies("snsn")("username")="" then
response.write "<script language=javascript>alert('对不起，您还没有登陆！');history.go(-1);</script>"
response.End
end if%>
<!--#include file="webconfig.asp"-->
<html>
<head>
<title><%=webname%>--订单详细资料</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<body leftmargin="0" rightmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<link href="images/css.css" rel="stylesheet">
<%dim dingdan
dingdan=request.QueryString("dan")
set rs=server.CreateObject("adodb.recordset")
rs.open "select shop_snsn.shopid,shop_snsn.shopname,shop_snsn.shichangjia,shop_snsn.huiyuanjia,shop_action.actiondate,shop_action.shousex,shop_action.danjia,shop_action.feiyong,shop_action.fapiao,shop_action.quyu,shop_action.baojia,shop_action.userzhenshiname,shop_action.shouhuoname,shop_action.dingdan,shop_action.youbian,shop_action.liuyan,shop_action.zhifufangshi,shop_action.songhuofangshi,shop_action.zhifufangshi,shop_action.songhuofangshi,shop_action.zhuangtai,shop_action.zonger,shop_action.useremail,shop_action.usertel,shop_action.shouhuodizhi,shop_action.shopcount from shop_snsn inner join shop_action on shop_snsn.shopid=shop_action.shopid where shop_action.username='"&request.Cookies("snsn")("username")&"' and dingdan='"&dingdan&"' ",conn,1,1
if rs.eof and rs.bof then
response.write "<center>此订单中有商品已被管理员删除，无法进行正确计算。<br>订单取消，请通知管理员或重新下订单！</center>"
response.End
end if
%>
<br>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr bgcolor="#FFFFFF"> 
    <td height="32" colspan="2"  style='PADDING-LEFT: 10px'><font 
                  color=#ff6600><b><img src="images/o.gif" width="15" height="15"> 
      </b></font><b><strong>订单号为：<%=dingdan%> ，详细资料如下：</strong></b> </td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td height="23"  style='PADDING-LEFT: 10px'>订单状态：</td>
    <td width="83%" height="23"  > <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <form name="form1" method="post" action="savedingdan.asp?dan=<%=dingdan%>&action=save">
            <td > 
              <%zhuang()%>
              <%if rs("zhuangtai")<>5 then %>
              <input name="Submit" type="submit" class="go-wenbenkuang" value="修改订单状态"> 
              <%else
									  response.write "<font color=red><b>订单工作流程全部完成</b></font>"
									  end if%>
            </td>
          </form>
        </tr>
      </table></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td width="17%" height="23"  style='PADDING-LEFT: 10px'>商品列表：</td>
    <td height="23"  > <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td><IMG height=5 src="images/block.gif" width=1></td>
        </tr>
      </table>
      <table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" class="table-zuoshang">
        <tr bgcolor="f1f1f1"  class="a1"> 
          <td height="22"  > <div align="center">商品名称</div></td>
          <td height="22"  > <div align="center">订购数量</div></td>
          <td height="22"  > <div align="center">会员价格</div></td>
          <td height="22"  > <div align="center">金额小计</div></td>
        </tr>
        <%zongji=0
		do while not rs.eof%>
        <tr bgcolor="#FFFFFF"> 
          <td style='PADDING-LEFT: 5px' height="22"  ><a href=list.asp?id=<%=rs("shopid")%> target=_blank><%=trim(rs("shopname"))%></a></td>
          <td height="22"  > <div align="center"><%=rs("shopcount")%></div></td>
          <td height="22"  > <div align="center"><%=rs("danjia")&"元"%></div></td>
          <td height="22"  > <div align="center"><%=rs("zonger")&"元"%></div></td>
        </tr>
        <%
	    zongji=rs("zonger")+zongji 
		feiyong=rs("feiyong")															  
		rs.movenext
		loop
		rs.movefirst%>
        <tr bgcolor="#FFFFFF"> 
          <td colspan="4" height="22"  > <div align="right">订单总额：<%=zongji%>元＋费用：<%=feiyong%>元 
              　　共计：<%=zongji+feiyong%>元 &nbsp;&nbsp;&nbsp;&nbsp;</div></td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td><IMG height=5 src="images/block.gif" width=1></td>
        </tr>
      </table></td>
  </tr>
  <%set snsn=server.CreateObject("adodb.recordset")
	snsn.open "select * from shop_action_jp where username='"&request.cookies("snsn")("username")&"' and dingdan='"&dingdan&"'",conn,1,1
	if snsn.recordcount>0 then%>
  <tr bgcolor="#FFFFFF"> 
    <td width="17%" height="23"  style='PADDING-LEFT: 10px'>奖品列表：</td>
    <td height="23"  > <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="table-zuoshang">
        <tr  class="a1"> 
          <td height="22"  > <div align="center">奖品名称</div></td>
          <td height="22"  > <div align="center">所用积分</div></td>
        </tr>
        <%
	while not snsn.eof%>
        <tr bgcolor="#FFFFFF"> 
          <td height="22"  > 
            <%
	set snsn1=server.CreateObject("adodb.recordset")
	snsn1.open "select * from shop_jiangpin where shopid="&snsn("shopid"),conn,1,1
	if snsn1.recordcount=1 then
	response.write snsn1("shopname")
	end if
	snsn1.close
	set snsn1=nothing%>
          </td>
          <td align="center" height="22"  ><%=snsn("jifen")%></td>
        </tr>
        <%
	snsn.movenext
	wend%>
      </table></td>
  </tr>
  <%end if
snsn.close
set snsn=nothing%>
  <tr bgcolor="#FFFFFF"> 
    <td height="23"  style='PADDING-LEFT: 10px'>收货人姓名：</td>
    <td height="23"  style='PADDING-LEFT: 10px'><%=trim(rs("userzhenshiname"))%></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td height="23"  style='PADDING-LEFT: 10px'>收货地址：</td>
    <td height="23"  style='PADDING-LEFT: 10px'><%=trim(rs("shouhuodizhi"))%></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td height="23"  style='PADDING-LEFT: 10px'>邮政编码：</td>
    <td height="23"  style='PADDING-LEFT: 10px'><%=trim(rs("youbian"))%></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td height="23"  style='PADDING-LEFT: 10px'>联系电话：</td>
    <td height="23"  style='PADDING-LEFT: 10px'><%=trim(rs("usertel"))%></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td height="23"  style='PADDING-LEFT: 10px'>电子邮件：</td>
    <td height="23"  style='PADDING-LEFT: 10px'><%=trim(rs("useremail"))%></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td height="23"  style='PADDING-LEFT: 10px'>送货方式：</td>
    <td height="23"  style='PADDING-LEFT: 10px'> 
      <%set rs2=server.CreateObject("adodb.recordset")
    rs2.Open "select * from shop_songhuo where songid="&rs("songhuofangshi"),conn,1,1
    response.Write trim(rs2("subject"))
    rs2.Close
    set rs2=nothing%>
    </td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td height="23"  style='PADDING-LEFT: 10px'>支付方式：</td>
    <td height="23"  style='PADDING-LEFT: 10px'> 
      <%set rs2=server.CreateObject("adodb.recordset")
    rs2.Open "select * from shop_songhuo where songid="&rs("zhifufangshi"),conn,1,1
    response.Write trim(rs2("subject"))
    rs2.close
    set rs2=nothing%>
    </td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td height="23"  style='PADDING-LEFT: 10px'>是否要发票：</td>
    <td height="23"  style='PADDING-LEFT: 10px'> 
      <%if rs("fapiao")=1 then %>
      <font color=red>需要</font> 
      <%else%>
      不需要 
      <%end if%>
    </td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td height="23"  style='PADDING-LEFT: 10px'>您的留言：</td>
    <td height="23"  style='PADDING-LEFT: 10px'><%=trim(rs("liuyan"))%></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td height="23"  style='PADDING-LEFT: 10px'>订单日期：</td>
    <td height="23"  style='PADDING-LEFT: 10px'><%=rs("actiondate")%></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td height="32" colspan="2"  > <div align="center"> 
        <%if rs("zhuangtai")=1 then%>
        <input name="Submit2" type="submit" class="go-wenbenkuang" value="删除订单"  onClick="if(confirm('您确定要删除吗?')) location.href='savedingdan.asp?action=del&dan=<%=dingdan%>';else return;">
        <%end if%>
        &nbsp;&nbsp; 
        <input name="Submit22" type="submit" class="go-wenbenkuang" value="关闭窗口"  onClick=javascript:window.close()>
      </div></td>
  </tr>
</table>
<%
sub zhuang()
select case rs("zhuangtai")
case "1"%>
<input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>未作任何处理<span style='font-family:Wingdings;'>à</span> 
<%if rs("zhifufangshi")<>"网上支付" then %>
<input name="zhuangtai" type="checkbox" id="zhuangtai" value="2">用户已经划出款<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>用户已经收到货 
<%else%>
<input name="zhuangtai" type="checkbox" id="zhuangtai" value="3">订单已确认<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox4" value="checkbox" DISABLED>订单已完成 
<%end if%>
<%case "2"%>
<input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>未作任何处理<span style='font-family:Wingdings;'>à</span> 
<input name="checkbox" type="checkbox" id="zhuangtai" value="2" checked DISABLED>用户已经划出款<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> 
<%
if rs("zhifufangshi")<>4 then 
%>
<input name="checkbox" type="checkbox" id="zhuangtai" value="2" checked DISABLED>用户已经划出款<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>用户已经收到货
<%else%>
<input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>订单已完成<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox1" value="checkbox" DISABLED>订单已完成 
<%end if%>
<%case "4"%>
<input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>未作任何处理<span style='font-family:Wingdings;'>à</span> 
<input name="checkbox" type="checkbox" id="zhuangtai" value="2" checked DISABLED>用户已经划出款<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="zhuangtai" value="5" >用户已经收到货
<%case "5"%>
<input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>未作任何处理<span style='font-family:Wingdings;'>à</span> 
<%if rs("zhifufangshi")<>4 then %>
<input name="checkbox" type="checkbox" id="zhuangtai" value="2" checked DISABLED>用户已经划出款<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="checkbox4" value="checkbox" checked DISABLED>用户已经收到货
<%else%>
<input name="checkbox3" type="checkbox" DISABLED value="checkbox" checked>订单已确认<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox4" value="checkbox" checked DISABLED>订单已完成 
<%end if%>
<%end select
end sub%>
</body>
</html>