<!--#include file="conn.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');history.go(-1);</script>"
response.End
else
if session("flag")=2 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
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">
<style>
td{font-size:9pt;line-height:120%;color:#353535} 
body{font-size:9pt;line-height:120%} 

a:link          { color: #000000; text-decoration: none }
a:visited       { color: #000000; text-decoration: none }
a:active        { color: #000000; text-decoration: none }
a:hover         { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }
</style>
</head>
<body leftmargin="5" topmargin="5" marginwidth="0" marginheight="0">
<%dim dingdan,username
dingdan=request.QueryString("dan")
username=request.QueryString("username")
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.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.username='"&username&"' and dingdan='"&dingdan&"' ",conn,1,1
if rs.eof and rs.bof then
response.write "<center>此订单中有商品已被管理员删除，无法进行正确计算。<br>订单取消，请手动删除此订单！ "
response.write "<input type=button name=Submit3 value=删除订单 onClick=""location.href='savedingdan.asp?action=del&dan="&dingdan&"&username="&username&"'""> </center>"
response.End
end if
%>
<table width="100%" border="1" cellspacing="0" cellpadding="1" bordercolor="#336699" align="center">
  <tr> 
    <td> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td rowspan="2"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="12v">
              <tr> 
                <td class="12v" > 
                  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber3" height="0" width="100%">
                    <tr> 
                      <td> 
                        <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
                          <tr bgcolor="#EFF5FE"> 
                            <td colspan="2"> 
                              <div align="center"> 
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                  <tr> 
                                    <td width="89%"> 
                                      <div align="center">订单号为：<%=dingdan%> ，详细资料如下：</div>
                                    </td>
                                    <td width="11%"> 
                                      <div align="center"> 
                                        <input type="button" name="Submit4" value="打 印" onClick="javascript:window.print()">
                                      </div>
                                    </td>
                                  </tr>
                                </table>
                              </div>
                            </td>
                          </tr>
                          <tr> 
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'>订单状态：</td>
                            <td width="87%" 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>
                                      &nbsp;&nbsp; 
                                      <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="0" cellspacing="1" bgcolor="#CCCCCC">
                                <tr> 
                                  <td bgcolor="#EFF5FE"> 
                                    <div align="center">商品名称</div>
                                  </td>
                                  <td bgcolor="#EFF5FE"> 
                                    <div align="center">订购数量</div>
                                  </td>
                                  <td bgcolor="#EFF5FE"> 
                                    <div align="center">会员价格</div>
                                  </td>
                                  <td bgcolor="#EFF5FE"> 
                                    <div align="center">金额小计</div>
                                  </td>
                                </tr>
                                <%dim iii
		do while not rs.eof%>
                                <tr> 
                                  <td bgcolor="#EFF5FE" style='PADDING-LEFT: 5px'><a href=../book.asp?id=<%=rs("bookid")%> target=_blank><%=trim(rs("bookname"))%></a></td>
                                  <td bgcolor="#EFF5FE"> 
                                    <div align="center"><%=rs("bookcount")%></div>
                                  </td>
                                  <td bgcolor="#EFF5FE"> 
                                    <div align="center"><%=formatnumber(rs("huiyuanjia"),2)&"元"%></div>
                                  </td>
                                  <td bgcolor="#EFF5FE"> 
                                    <div align="center"><%=formatnumber(rs("huiyuanjia")*rs("bookcount"),2)&"元"%></div>
                                  </td>
                                </tr>
                                <%iii=rs("zonger")+iii
		rs.movenext
		loop
		rs.movefirst%>
                                <tr> 
                                  <td colspan="4" bgcolor="#EFF5FE"> 
                                    <div align="right">用户选择的送货方式是： 
                                      <%'///判断送货方式加收金额
              dim rs2
          set rs2=server.CreateObject("adodb.recordset")
          rs2.Open "select * from shop_songhuo where songid="&int(rs("songhuofangshi")),conn,1,1
		  if rs2.eof and rs2.bof then
		  response.write "方式以被删除"
		  response.write "&nbsp;+"&formatnumber(0,2)&"元"
		  response.write "&nbsp;&nbsp;金额总计："&formatnumber(iii,2)&"元"
		  else
		  response.write trim(rs2("subject"))
		  response.write "&nbsp;+"&formatnumber(rs2("jsmoney"),2)&"元"
		  response.write "&nbsp;&nbsp;金额总计："&formatnumber(iii+rs2("jsmoney"),2)&"元"
		  end if
		  rs2.Close
		  set rs2=nothing
		  %>
                                      &nbsp;&nbsp;&nbsp;&nbsp;</div>
                                  </td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                          <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("shouhuoname"))%></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 shop_songhuo where songid="&int(rs("songhuofangshi")),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 bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'>支付方式：</td>
                            <td bgcolor="#EFF5FE" style='PADDING-LEFT: 10px'> 
                              <%
    '///支付方式
          set rs2=server.CreateObject("adodb.recordset")
          rs2.Open "select * from shop_songhuo where songid="&int(rs("zhifufangshi")),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 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="32" colspan="2" bgcolor="#EFF5FE"> 
                              <div align="center"> 
                                <input type="button" name="Submit3" value="删除订单" onClick="if(confirm('您确定要删除吗?')) location.href='savedingdan.asp?action=del&dan=<%=dingdan%>&username=<%=username%>';else return;">
                                &nbsp;&nbsp; 
                                <input type="button" name="Submit2" value="关闭窗口" onClick=javascript:window.close()>
                              </div>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </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> 
<input name="zhuangtai" type="checkbox" id="checkbox" value="checkbox" DISABLED>用户已经划出款<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox" value="dddd" 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 name="checkbox" type="checkbox" id="checkbox" value="adf" checked DISABLED>用户已经划出款<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="zhuangtai" value="3" >服务商已经收到款<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox" 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 name="checkbox" type="checkbox" id="checkbox" value="checkbox" 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="zhuangtai" value="4" >服务商已经发货<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 name="checkbox" type="checkbox" id="checkbox" 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="checkbox" value="checkbox" DISABLED>用户已经收到货
<%case "5"%>
<input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>未作任何处理<span style='font-family:Wingdings;'>à</span> 
<input name="checkbox" type="checkbox" id="checkbox" 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>用户已经收到货
<%end select
end sub%>