<!--#include file="conn.asp"-->
<%if request.cookies("bjx")("shjianame")="" 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">
<link href="../images/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" rightmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%dim dingdan
dingdan=request.QueryString("dan")
if not isnumeric(dingdan) then 
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
end if
id=request.QueryString("sjid")
if not isnumeric(id) then 
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
end if
username=request.QueryString("username")
if InStr(username,"'")>0 then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select shop_books.bookid,shop_books.bookname,shop_books.shichangjia,shop_books.huiyuanjia,shop_action.actiondate,shop_action.shousex,shop_action.danjia,shop_action.feiyong,shop_action.fapiao,shop_action.userzhenshiname,shop_action.shouhuoname,shop_action.dingdan,shop_action.youbian,shop_action.liuyan,shop_action.zhifufangshi,shop_action.songhuofangshi,shop_action.zhuangtai,shop_action.zonger,shop_action.useremail,shop_action.usertel,shop_action.shouhuodizhi,shop_action.bookcount from shop_books inner join shop_action on shop_books.bookid=shop_action.bookid where shop_action.shjiaid="&id&" and dingdan='"&dingdan&"' ",conn,1,1
if rs.eof and rs.bof then
response.write "<center>此订单中有产品已被管理员删除，无法进行正确计算。<br>订单取消，请通知管理员或重新下订单！</center>"
response.End
end if
%>
<table width="750" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC" align="center">
                          <tr bgcolor="#FFFFFF"> 
                            <td colspan="2" style='PADDING-LEFT: 10px'>订单号为：<font color="#FF6600"><%=dingdan%></font>，详细资料如下：</td>
                          </tr>
                          <tr bgcolor="#FFFFFF"> 
                            <td width="15%" style='PADDING-LEFT: 10px'>订单状态：</td>
                            <td width="85%"> 
                              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr> 
                                  <form name="form1" method="post" action="saveshjdingdan.asp?dan=<%=dingdan%>&action=save&username=<%=username%>">
                                    <td > 
                                      <%zhuang()%>
                                      <br>&nbsp;<input class="go-wenbenkuang" type="submit" name="submit" value=" 修改订单状态 ">
                                      <font color="#FF6600">这里只有前台用户先选择&quot;用户已经划出款&quot;后，管理员才可以进行后边的操作！</font></td>
                                  </form>
                                </tr>
                              </table>
                            </td>
                          </tr>
                          <tr bgcolor="#FFFFFF"> 
                            <td style='PADDING-LEFT: 10px'>产品列表：</td>
                            <td> 
                              <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
                                <tr bgcolor="#F1F1F1" align="center"> 
                                  <td>产品名称</td>
                                  <td>订购数量</td>
                                  <td>会员价格</td>
                                  <td>金额小计</td>
                                </tr>
                                <%zongji=0
								do while not rs.eof%>
                                <tr bgcolor="#FFFFFF"> 
                                  <td style='PADDING-LEFT: 5px'><a href=../list.asp?id=<%=rs("bookid")%> ><%=trim(rs("bookname"))%></a></td>
                                  <td align="center"><%=rs("bookcount")%></td>
                                  <td><%=rs("danjia")&"元"%></td>
                                  <td><%=rs("zonger")&"元"%></td>
                                </tr>
                                <%zongji=rs("zonger")+zongji
								feiyong=rs("feiyong")
		rs.movenext
		loop
		rs.movefirst%>
                                <tr bgcolor="#FFFFFF"> 
                                <td colspan="4" align="right"> 
                                订单总额：<%=zongji%>元 + 费用：<%=feiyong%>元　　共计：<%=zongji+feiyong%>元&nbsp;</div>
                                </td>
                                </tr>
                              </table>
                            </td>
                          </tr>
    <%set Godbook=server.CreateObject("adodb.recordset")
	Godbook.open "select * from shop_action_jp where username='"&request.Cookies("bjx")("username")&"' and dingdan='"&dingdan&"'",conn,1,1
	if Godbook.recordcount>0 then%>
						  <tr bgcolor="#FFFFFF"> 
                            <td style='PADDING-LEFT: 10px'>奖品列表：</td>
                            <td> 
                              <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
                                <tr bgcolor="#F1F1F1" align="center"> 
                                  <td>奖品名称</td>
                                  <td>所用积分</td>
                                </tr>
	<%
	while not Godbook.eof%>
		<tr bgcolor="#FFFFFF"> 
		<td> 
                                    <%
	set Godbook1=server.CreateObject("adodb.recordset")
	Godbook1.open "select * from shop_jiangpin where bookid="&Godbook("bookid"),conn,1,1
	if Godbook1.recordcount=1 then
	response.write Godbook1("bookname")
	end if
	Godbook1.close
	set Godbook1=nothing%>
                                  </td>
                                  <td align="center"><%=Godbook("jifen")%></td>
        </tr>
        <%
	Godbook.movenext
	wend%>
                              </table>
                            </td>
                          </tr>
<%end if
Godbook.close
set Godbook=nothing%>
                          <tr bgcolor="#FFFFFF"> 
                            <td style='PADDING-LEFT: 10px'>收货人姓名：</td>
                            <td style='PADDING-LEFT: 10px'><%=trim(rs("userzhenshiname"))%></td>
                          </tr>
                          <tr bgcolor="#FFFFFF"> 
                            <td style='PADDING-LEFT: 10px'>收货地址：</td>
                            <td style='PADDING-LEFT: 10px'><%=trim(rs("shouhuodizhi"))%></td>
                          </tr>
                          <tr bgcolor="#FFFFFF"> 
                            <td style='PADDING-LEFT: 10px'>邮编：</td>
                            <td style='PADDING-LEFT: 10px'><%=trim(rs("youbian"))%></td>
                          </tr>
                          <tr bgcolor="#FFFFFF"> 
                            <td style='PADDING-LEFT: 10px'>联系电话：</td>
                            <td style='PADDING-LEFT: 10px'><%=trim(rs("usertel"))%></td>
                          </tr>
                          <tr bgcolor="#FFFFFF"> 
                            <td style='PADDING-LEFT: 10px'>电子邮件：</td>
                            <td style='PADDING-LEFT: 10px'><%=trim(rs("useremail"))%></td>
                          </tr>
                          <tr bgcolor="#FFFFFF"> 
                            <td style='PADDING-LEFT: 10px'>送货方式：</td>
                            <td 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 style='PADDING-LEFT: 10px'>支付方式：</td>
                            <td 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 style='PADDING-LEFT: 10px'>是否要发票：</td>
                            <td style='PADDING-LEFT: 10px'>
                              <%if rs("fapiao")=1 then %>
                              <font color=#FF6600>需要发票</font>
                              <%else%>
                              不需要发票
                              <%end if%>
                            </td>
                          </tr>
                          <tr bgcolor="#FFFFFF"> 
                            <td style='PADDING-LEFT: 10px'>您的留言：</td>
                            <td style='PADDING-LEFT: 10px'><%=trim(rs("liuyan"))%></td>
                          </tr>
                          <tr bgcolor="#FFFFFF"> 
                            <td style='PADDING-LEFT: 10px'>下单日期：</td>
                            <td style='PADDING-LEFT: 10px'><%=rs("actiondate")%></td>
                          </tr>
                          <tr bgcolor="#FFFFFF"> 
                            <td height="32" colspan="2" align="center">
							<input class="go-wenbenkuang" onClick="if(confirm('您确定要删除吗?')) location.href='saveshjdingdan.asp?action=del&dan=<%=dingdan%>&username=<%=username%>';else return;" type="submit" name="submit3" value=" 删除订单 ">
							<input class="go-wenbenkuang" onClick="javascript:window.close()" type="reset" name="submit" value=" 关闭窗口 ">
                            </td>
                          </tr>
</table>
<%sub zhuang()
select case rs("zhuangtai")
case "1"%>
<input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>未作任何处理 → <%if rs("zhifufangshi")<>4 then %>
<input name="checkbox" type="checkbox" id="checkbox" value="checkbox" DISABLED>用户已经划出款 → <input type="checkbox" name="zhuangtai" value="3">服务商已经收到款 → <input type="checkbox" name="checkbox3" value="checkbox" DISABLED>服务商已经发货 → <input type="checkbox" name="checkbox4" value="checkbox" DISABLED>用户已经收到货 
<%else%>
<input name="zhuangtai" type="checkbox" id="zhuangtai" value="3">订单已确认 → <input type="checkbox" name="checkbox4" value="checkbox" DISABLED>订单已完成 
<%end if%>
<%case "2"%>
<input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>未作任何处理 → <input name="checkbox" type="checkbox" id="checkbox" value="adf" checked DISABLED>用户已经划出款 → <input type="checkbox" name="zhuangtai" value="3" >服务商已经收到款 → <input type="checkbox" name="checkbox" value="checkbox" DISABLED>服务商已经发货 → <input type="checkbox" name="checkbox4" value="checkbox" DISABLED>用户已经收到货
<%case "3"%>
<input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>未作任何处理 → <%if rs("zhifufangshi")<>4 then %>
<input name="checkbox" type="checkbox" id="checkbox" value="checkbox" checked DISABLED>用户已经划出款 → <input type="checkbox" name="checkbox2" value="checkbox" checked DISABLED>服务商已经收到款 → <input type="checkbox" name="zhuangtai" value="4" >服务商已经发货 → <input type="checkbox" name="checkbox4" value="checkbox" DISABLED>用户已经收到货
<%else%>
<input name="checkbox" type="checkbox" DISABLED value="checkbox" checked>订单已确认 → <input type="checkbox" name="zhuangtai" id="checkbox" value="5">
订单已完成 
<%end if%>
<%case "4"%>
<input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>未作任何处理 → <input name="checkbox" type="checkbox" id="checkbox" value="2" checked DISABLED>用户已经划出款 → <input type="checkbox" name="checkbox2" value="checkbox" checked DISABLED>服务商已经收到款 → <input type="checkbox" name="checkbox3" value="checkbox" checked DISABLED>服务商已经发货 → <input type="checkbox" name="checkbox" value="checkbox" DISABLED>用户已经收到货
<%case "5"%>
<input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>未作任何处理 → <%if rs("zhifufangshi")<>4 then %>
<input name="checkbox" type="checkbox" id="checkbox" value="2" checked DISABLED>用户已经划出款 → <input type="checkbox" name="checkbox2" value="checkbox" checked DISABLED>服务商已经收到款 → <input type="checkbox" name="checkbox3" value="checkbox" checked DISABLED>服务商已经发货 → <input type="checkbox" name="checkbox4" value="checkbox" checked DISABLED>用户已经收到货
<%else%>
<input name="zhuangtai" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>订单已完成 → <input type="checkbox" name="checkbox4" value="checkbox" checked DISABLED>订单已完成 

<%end if%>
<%end select
end sub%>
</body>
</html>

