<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.*" %>
<%@ page import="net.sz600.tool.*" %>
<%@ page import="net.sz600.database.*" %>
<%@ page import="net.sz600.database.other.*" %>
<%@ page import="net.sz600.system.SzProperties" %>
<%@ page import="net.sz600.system.SzPageHelp" %>
<%@ page import="net.sz600.assess.*" %>
<%@ include file="/sessionInfo.jsp"%>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../../share/js/commonTool.js"></script>
</head>
<%
    //获取提交的参数
    String sPage = SzConvert.toZeroStr(request.getParameter("page"));
    String sSearch = SzConvert.strWriteData(request.getParameter("txtSearch"));
    String sNumber = SzConvert.strWriteData(request.getParameter("txtNumber"));
    String sName = SzConvert.strWriteData(request.getParameter("txtName"));
    String sState = SzConvert.strWriteData(request.getParameter("txtState"));
    String sKEY = SzConvert.toZeroStr(request.getParameter("KEY"));

    String sSortField = SzConvert.toSpaceStr(request.getParameter("txtSortField")); 
    int iSortOrder    = Integer.parseInt(SzConvert.toZeroStr(request.getParameter("txtSortOrder"))); 
   
    int iColumnCount = 26;
    String sTable = "ecs_order_info";
	  String sField = "order_sn,order_status,consignee,mobile,address,from_unixtime(add_time),pay_name,from_unixtime(pay_time)"	//8
	  							+ ",shipping_name,from_unixtime(shipping_time),invoice_no,referer"	//4
	  							+ ",postscript,to_buyer"	//2
	  							+ ",consignee,email,address,zipcode,tel,mobile" //6
	  							+ ",goods_amount,money_paid,surplus,integral_money,bonus,order_amount"; //6
	  String sCond = "order_id=" + sKEY;
	  //goods_amount,order_amount,order_status
	  SzDataReaderEcs dr = new SzDataReaderEcs();
		
		String str[] = dr.readInfoArray(1, sTable, sField, sCond, iColumnCount);
    int i = 0;
    
    String s_id[] = {"","0","1","2","3","4"};
    String s_name[] = {"全部","未确认","确认","已取消","无效","退货"};
    

%>
<!-----上面的工具栏------>
<form name="formUpdate" method="post">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="txtNumber" value="<%=sNumber%>">
  <input type="hidden" name="txtName" value="<%=sName%>">
  <input type="hidden" name="txtState" value="<%=sState%>">
  <input type="hidden" name="KEY" value="<%=sKEY%>"> 
<table width="100%">
  <tr>
    <td>
    	<%
				out.println( SzPageHelp.backButton() );
      %>         
    </td>
  </tr>
</table>

<table width="600" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0">
<tr>
 <td class="trClassTitle_c" colspan=4>基本信息</td>
</tr>
<tr>
 <td class="tdClassTitle">订单号</td>
 <td><%=str[0] %></td>
 <td class="tdClassTitle">订单状态</td>
 <td><%=str[1] %></td> 
</tr>

<tr>
 <td class="tdClassTitle">购货人</td>
 <td><%=str[2] %>[TEL:<%=str[3]%>]<BR><%=str[4]%></td>
 <td class="tdClassTitle">下单时间</td>
 <td><%=str[5] %></td> 
</tr>


<tr>
 <td class="tdClassTitle">支付方式</td>
 <td><%=str[6] %></td>
 <td class="tdClassTitle">付款时间</td>
 <td><%if (!str[7].startsWith("1970-01-01")) { out.println(str[7]);} %></td> 
</tr>


<tr>
 <td class="tdClassTitle">配送方式</td>
 <td><%=str[8] %></td>
 <td class="tdClassTitle">发货时间</td>
 <td><%if (!str[9].startsWith("1970-01-01")) { out.println(str[7]);} %></td> 
</tr>


<tr>
 <td class="tdClassTitle">发货单号</td>
 <td><%=str[10] %></td>
 <td class="tdClassTitle">订单来源</td>
 <td><%=str[11] %></td> 
</tr>

<tr>
 <td class="trClassTitle_c" colspan=4>其他信息</td>
</tr>
<tr>
 <td class="tdClassTitle">客户给供应商的留言</td>
 <td colspan="3"><%=str[12] %></td>
</tr>
<tr>
 <td class="tdClassTitle">供应商给客户的留言</td>
 <td colspan="3"><%=str[13] %></td>
</tr>

<tr>
 <td class="trClassTitle_c" colspan=4>收货人信息</td>
</tr>
<tr>
 <td class="tdClassTitle">收货人</td>
 <td><%=str[14] %></td>
 <td class="tdClassTitle">电子邮件</td>
 <td><%=str[15] %></td> 
</tr>
<tr>
 <td class="tdClassTitle">地址</td>
 <td><%=str[16] %></td>
 <td class="tdClassTitle">邮编</td>
 <td><%=str[17] %></td> 
</tr>
<tr>
 <td class="tdClassTitle">电话</td>
 <td><%=str[18] %></td>
 <td class="tdClassTitle">手机</td>
 <td><%=str[19] %></td> 
</tr>
</table>
<%
  iColumnCount = 6;
	//商品图片A.goods_thumb A1,、商品名称[品牌]、货号、价格、重量（斤）、属性、库存、小计
  sTable = "ecs_goods A,ecs_order_goods B";
  sField = "B.goods_name B2,B.goods_sn B3,B.goods_price B4,B.goods_number B5,B.goods_attr B6,A.goods_number A7";	//7
  sCond = "A.is_delete=0 AND A.goods_id=B.goods_id and B.order_id=" + sKEY;
  //goods_amount,order_amount,order_status
  dr = new SzDataReaderEcs();
  
	ArrayList list = dr.readInfo(100, sTable, sField, sCond, iColumnCount);
%>
<table width="600" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0">
<tr>
 <td class="trClassTitle_c" colspan=7>商品信息</td>
</tr>
<tr>
 <td align="center"><b>商品名称</b></td>
 <td align="center"><b>货号</b></td>
 <td align="center"><b>价格</b></td>
 <td align="center"><b>重量</b></td>
 <td align="center"><b>属性</b></td>
 <td align="center"><b>库存</b></td>
 <td align="center"><b>小计</b></td>
</tr>
<%
	
	  Iterator iter = null;
    if (list != null) {
    	iter = list.iterator();
    }
    double dNumber = 0;
    double dNumber_total = 0;
    
    double dMoney = 0;
    double dMoney_total = 0;
    String str2[]= null;
    while (iter != null && iter.hasNext()) {
    	str2 = (String[])iter.next();
      i++;
      dNumber = SzConvert.toDouble(str2[3]);
      dNumber_total += dNumber;
             
    	dMoney = dNumber *  SzConvert.toDouble(str2[2]);
    	dMoney_total += dMoney;
%>
<tr>
 <td align="center"><%=str2[0]%></td>
 <td align="center"><%=str2[1]%></td>
 <td align="center">￥<%=dMoney%></td>
 <td align="center"><%=dNumber%></td>
 <td align="center"><%=str2[4]%></td>
 <td align="center"><%=str2[5]%></td>
 <td align="center"><%=dMoney%></td>
    
</tr>
<%
    }
%>
<tr>
 <td align="right" colspan="3">商品总重量</td>
 <td align="center"><%=dNumber_total%></td>
 <td align="right" colspan="2">合计</td>
 <td align="center"><%=dMoney_total%></td>    
</tr>
<tr>
 <td class="trClassTitle_c" colspan=7>费用信息</td>
</tr>
<tr>
 <td align="right" colspan="7">商品总金额:<%=str[20] %></td>
</tr>
<tr>
 <td align="right" colspan="7">
 	已付款金额:<%=str[21]%>
  使用余额:<%=str[22]%>  
  使用积分:<%=str[23]%>
  使用优惠卷:<%=str[24]%>
 </td>
</tr>
<tr>
 <td align="right" colspan="7">应付款金额:<%=str[25] %></td>
</tr>
</table>


</form>


<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="txtNumber" value="<%=sNumber%>">
  <input type="hidden" name="txtName" value="<%=sName%>">
  <input type="hidden" name="txtState" value="<%=sState%>">
  <input type="hidden" name="KEY" value="<%=sKEY%>">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>"> 
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>">  
</form>
<script language="javascript">

</script>

