<!--#include file="conn.asp"-->
<%if session("bjxadmin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
else
if session("flag")=2 then
response.Write "<p align=center><font color=red>您没有此项目管理权限！</font></p>"
response.End
end if
end if
%>
<html><head><title>匿名订单信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<%dim dingdan,username
dingdan=request.QueryString("dan")
if not isnumeric(dingdan) 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 BJX_goods.bookid,BJX_goods.bookname,BJX_goods.shichangjia,BJX_goods.huiyuanjia,bjx_action.actiondate,bjx_action.shousex,bjx_action.userzhenshiname,BJX_goods.shjiaid,bjx_action.shouhuoname,bjx_action.dingdan,bjx_action.youbian,bjx_action.liuyan,bjx_action.zhifufangshi,bjx_action.songhuofangshi,bjx_action.zhuangtai,bjx_action.zonger,bjx_action.useremail,bjx_action.usertel,bjx_action.shouhuodizhi,bjx_action.bookcount,bjx_action.danjia,bjx_action.fapiao,bjx_action.feiyong from BJX_goods inner join bjx_action on BJX_goods.bookid=bjx_action.bookid where bjx_action.username='"&username&"' and dingdan='"&dingdan&"' ",conn,1,1
if rs.eof and rs.bof then
response.write "<p align=center><font color=red>此订单中有商品已被管理员删除，无法进行正确计算。<br>订单操作取消，请手动删除此订单！</font></p>"
response.write "<input type=button name=Submit3 value=删除订单 onClick=""location.href='savedingdan.asp?action=del&dan="&dingdan&"&username="&username&"'""> </center>"
response.End
end if
shjiaid=rs("shjiaid")
%>
<table class="tableBorder" width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#6a7f9a">
<tr> 
<td colspan="4" align="center" background="../images/admin_bg_1.gif"><b><font color="#ffffff">修改商品订单</font></b></td>
</tr>
                          <tr bgcolor="#EFF5FE"> 
                            <td colspan="2" align="center"> 
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td width="89%" align="center">
订单号为：<%=dingdan%> ，详细资料如下：
                                    </td>
                                    <td width="11%" align="center">
									<input type="button" name="Submit4" value="打 印" onClick="javascript:window.print()">
                                    </td>
                                  </tr>
                                </table>
                            </td>
                          </tr>
                          <tr> 
                            <td width="20%" bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'>订单状态：</td>
                            <td width="80%" bgcolor="#EFF5FE"> 
                              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr> 
                                  <form name="form1" method="post" action="savedingdan.asp?dan=<%=dingdan%>&action=save&username=<%=username%>">
                                    <td > 
                                      <%zhuang()%><br>
									  <input type="submit" name="Submit" value="修改订单状态">
									  <font color="#FF0000">这里只有前台用户先选择&quot;用户已经划出款&quot;后，管理员才可以进行后边的操作！</font></td>
                                  </form>
                                </tr>
                              </table>
                            </td>
                          </tr>
                          <tr> 
                            <td width="13%" bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'>商品列表：</td>
                            <td bgcolor="#EFF5FE"> 
                              <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
                                <tr> 
                                  <td bgcolor="#EFF5FE" align="center">商品名称</td>
                                  <td bgcolor="#EFF5FE" align="center">订购数量</td>
                                  <td bgcolor="#EFF5FE" align="center">价 格</td>
                                  <td bgcolor="#EFF5FE" align="center">金额小计</td>
                                </tr>
                                <%zongji=0
								do while not rs.eof%>
                                <tr> 
                                  <td bgcolor="#EFF5FE" style='PADDING-LEFT: 5px'><a href=../goodsview.asp?bjxGid=<%=rs("bookid")%> ><%=trim(rs("bookname"))%></a></td>
                                  <td bgcolor="#EFF5FE"> 
                                    <div align="center"><%=rs("bookcount")%></div>
                                  </td>
                                  <td bgcolor="#EFF5FE"> 
                                    <div align="center"><%=rs("danjia")&"元"%></div>
                                  </td>
                                  <td bgcolor="#EFF5FE"> 
                                    <div align="center"><%=rs("zonger")&"元"%></div>
                                  </td>
                                </tr>
                                <%zongji=rs("zonger")+zongji
								feiyong=rs("feiyong")
		rs.movenext
		loop
		rs.movefirst%>
                                <tr> 
                                  <td colspan="4" bgcolor="#EFF5FE"> 
                                    <div align="right">订单总额：<%=zongji%>元＋费用：<%=feiyong%>元　　共计：<%=zongji+feiyong%>元 
                                      &nbsp;&nbsp;&nbsp;&nbsp;</div>
                                  </td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                          <%set snsn=server.CreateObject("adodb.recordset")
	snsn.open "select * from BJX_action_jp where username='"&username&"' and dingdan='"&dingdan&"'",conn,1,1
	if snsn.recordcount>0 then%>
                          <tr bgcolor="#6a7f9a"> 
                            <td width="13%" style='PADDING-LEFT: 10px' bgcolor="#EFF5FE">奖品列表：</td>
                            <td bgcolor="#EFF5FE"> 
                              <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" >
                                <tr> 
                                <td align="center">奖品名称</td>
                                <td align="center">所用积分</td>
                                </tr>
	<%
	while not snsn.eof%>
                                <tr> 
                                  <td bgcolor="#EFF5FE"> 
                                    <div align="center">
                                      <%
	set snsn1=server.CreateObject("adodb.recordset")
	snsn1.open "select * from BJX_jiangpin where bookid="&snsn("bookid"),conn,1,1
	if snsn1.recordcount=1 then
	response.write snsn1("bookname")
	end if
	rs_sh.close
	set rs_sh=nothing
	snsn1.close
	set snsn1=nothing%>
                                    </div></td>
                                  <td align="center" bgcolor="#EFF5FE"><%=snsn("jifen")%></td>
                                </tr>
	<%
	snsn.movenext
	wend%>
                              </table>
                            </td>
                          </tr>
                          <%end if
snsn.close
set snsn=nothing%>
                          <tr> 
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'>收货人姓名：</td>
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'><%=trim(rs("userzhenshiname"))%></td>
                          </tr>
                          <tr> 
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'>收货地址：</td>
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'><%=trim(rs("shouhuodizhi"))%></td>
                          </tr>
                          <tr> 
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'>邮 编：</td>
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'><%=trim(rs("youbian"))%></td>
                          </tr>
                          <tr> 
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'>联系电话：</td>
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'><%=trim(rs("usertel"))%></td>
                          </tr>
                          <tr> 
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'>电子邮件：</td>
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'><%=trim(rs("useremail"))%></td>
                          </tr>
                          <tr> 
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'>送货方式：</td>
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'><%
          '///送货方式
          set rs2=server.CreateObject("adodb.recordset")
          rs2.Open "select * from Iheeo_Delivery where SongKey="&int(rs("songhuofangshi")),conn,1,1
		  if rs2.eof and rs2.bof then
		  response.write "方式已被删除"
		  else
          response.Write trim(rs2("SongName"))
          end if
		  rs2.close
          set rs2=nothing%></td>
                          </tr>
                          <tr> 
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'>支付方式：</td>
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'><%dim rs2
          '///支付方式
          set rs2=server.CreateObject("adodb.recordset")
          rs2.open "select * from Iheeo_Pay where PayKey="&int(rs("zhifufangshi")),conn,1,1
		  if rs2.eof and rs2.bof then
		  response.write "方式已被删除"
		  else
          response.Write trim(rs2("PayName"))
          end if
		  rs2.Close
          set rs2=nothing
          %></td>
                          </tr>
                          <tr> 
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'>是否开发票：</td>
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'><%if rs("fapiao")=1 then %><font color=red>需要发票</font><%else%>不需要发票<%end if%></td>
                          </tr>
                          <tr> 
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'>用户留言：</td>
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'><%=trim(rs("liuyan"))%></td>
                          </tr>
                          <tr> 
                            <td height="20" bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'>下单日期：</td>
                            <td height="20" bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'><%=rs("actiondate")%></td>
                          </tr>
                          <tr>
						  <td height="30" bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'></td>
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'>
							<input type="button" name="Submit3" value="删除订单" onClick="if(confirm('您确定要删除吗?')) location.href='savedingdan.asp?action=del&dan=<%=dingdan%>&username=<%=username%>';else return;">
							&nbsp;
							<input type="button" name="Submit2" value="关闭窗口" onClick=javascript:window.close()>
                            </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="zhuangtai" value="5" >用户已经收到货
<%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%>
