<%@ page language="C#" masterpagefile="MyShopMasterPage.master" autoeventwireup="true" inherits="Member_Shop_BuyOrder, mallz" enableeventvalidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript" src="../Js/MAllZAjax.js" ></script>
<div class="pageTitle">
    <%=OrderTitleName %>订单
    编号：<asp:Literal ID="TxtOrderFormNum" runat="server" />
</div>
<div id="order_content">
   <table class="ShopOrderStyle">
        <caption><%=OrderTitleName %>订单状态信息</caption>
        <tr>
            <td><b>买家：</b><asp:HyperLink ID="BuyerLink" runat="server" Target="_blank" /></td>
            <td><b>卖家：</b><asp:HyperLink ID="SalerLink" runat="server" Target="_blank"/></td>          
            <td>&nbsp;</td>
            <td><b>下单时间：</b><asp:literal runat="server" ID="Order_InputTime"/></td>
            <td>&nbsp;&nbsp;</td>
        </tr>
        <tr>
            <td><asp:CheckBox ID="CheckNeedInvoice" runat="server" Enabled="False" Text="需要发票" /></td>
            <td><asp:CheckBox ID="CheckInvoied" runat="server" Enabled="False" Text="已开发票" /></td>
            <td><b>订单状态：</b><asp:Literal ID="OrderStatus" runat="server" /></td>    
            <td><b>付款状态：</b><asp:Literal ID="PayStatus" runat="server" /></td>
            <td><b>物流状态：</b><asp:Literal ID="DeliverStatus" runat="server" /></td>
        </tr>
    </table>
   <br />
    <table class="ShopOrderStyle">
        <caption><%=OrderTitleName %>订单联系信息</caption>
        <tr>
            <td class="OrderTitle">收货人姓名：</td>
            <td  width="30%"><asp:Literal ID="Contacter_Name" runat="server" /></td>
            <td class="OrderTitle">联系电话：</td>
            <td  width="30%"><asp:Literal ID="Contacter_Phone" runat="server" /></td>
        </tr>
        <tr>
            <td class="OrderTitle">收货人地址：</td>
            <td><asp:Literal ID="Contacter_Address" runat="server" /></td>
            <td class="OrderTitle">邮政编码：</td>
            <td><asp:Literal ID="Contacter_ZipCode" runat="server" /></td>
        </tr>
        <tr>
            <td class="OrderTitle">收货人邮箱：</td>
            <td><asp:Literal ID="Contacter_Email" runat="server" /></td>
            <td class="OrderTitle">收货人手机：</td>
            <td><asp:Literal ID="Contacter_Mobile" runat="server" /></td>
        </tr>
        <tr>
            <td class="OrderTitle">发票信息：</td>
            <td><asp:Literal ID="Need_Invoiced" runat="server" /></td>
            <td class="OrderTitle">送货方式：</td>
            <td><asp:Literal ID="Deliver_ChargePaymentType" runat="server" /></td>
        </tr>
        <tr>
            <td class="OrderTitle">备注/留言：</td>
            <td colspan="3" ><asp:Literal ID="Order_Remark" runat="server" /></td>
        </tr>
    </table>
    <br />
    <table class="ShopOrderStyle">
            <caption><%=OrderTitleName %>商品信息</caption>
            <tr>
                <th class="OrderTitle">商品名称</th>
                <th class="OrderTitle">数量/单位</th>
                <th class="OrderTitle">商品原价</th>
                <th class="OrderTitle">商品单价</th>
                <th class="OrderTitle">需开发票</th>
                <th class="OrderTitle">发票税率</th>
                <th class="OrderTitle">小结</th>
            </tr>
    <asp:Repeater ID="Repeater1" runat="server">
        <ItemTemplate>
            <tr class="ShopProductOrderStyle">
                <td><asp:HyperLink ID="Pd_Name" NavigateUrl='<%# "../ShowProduct.aspx?ProductID="+Eval("ProductID") %>' runat="server" Text='<%# Eval("ProductName") %>' Target="_blank"/></td>
                <td><asp:Literal ID="Pd_Quantity" runat="server" Text='<%# Eval("Quantity") %>' /></td>
                <td><span style="color:red"><asp:Literal ID="Literal1" runat="server" Text='<%# StandPrice %>' /></span></td>
                <td><span style="color:green"><asp:Literal ID="Pd_TruePrice" runat="server" Text='<%# Eval("Price") %>' /></span></td>
                <td><asp:Literal runat="server" ID="ni" Text='<%# (Eval("NeedInvoice").ToString()=="1")?"是":"否" %>' /> </td>
                <td><asp:Literal runat="server" ID="ir" Text='<%# Eval("InvoiceRate") %>' /> %</td>
                <td><asp:Literal runat="server" ID="Pd_Total" Text='<%# "￥"+Eval("totalPrice") %>' /></td>
            </tr>
        </ItemTemplate>
    </asp:Repeater>
            <tr>
                <td align="right" colspan="5" >
                    </td>
                <td align="left" colspan="2" >
                    <b>合&nbsp;&nbsp;&nbsp;&nbsp;计：</b>￥<asp:Literal ID="LabTotalPrice" runat="server" />
                </td>
            </tr>
            <tr>
               <td colspan="3">
                    运费总额：￥<asp:Literal ID="LabDeliver_TotalPrice" runat="server" />
                    &nbsp; &nbsp;
                    发票税额：￥<asp:Literal ID="LabInvoice_TotalPrice" runat="server"/>
                   <br />
                   商品总额：￥<asp:Literal ID="LabMoneyGoods" runat="server" />
                   &nbsp; &nbsp;
                   订单总计：￥<asp:Literal ID="CountMoneyTotal" runat="server" />
                 <br />
                    
                </td>
                <td colspan="2">           
                   <b>实际金额：</b>￥<asp:Literal ID="LabMoneyTotal" runat="server" />
                </td>            
                <td colspan="2">
                   <b>已付款：</b>￥<asp:Literal ID="Pd_ReceiveMoney" runat="server" /><br />
                   <b style="color:Green">尚欠款：</b>￥<asp:Literal ID="Pd_OwnMoney" runat="server" />
                </td>                 
            </tr>
        </table>
    <br />
</div>
<div style="text-align:center">
    <asp:PlaceHolder ID="BuyerControl" runat="server">
            <asp:Button ID="Pay_Money" runat="server" Text=" 付 款 " OnCommand="PayMoney"/>&nbsp;
            <asp:Button ID="ButReturn" runat="server" Text=" 退 货 " OnClick="ButReturn_Click" Visible="false" />&nbsp;
            <asp:Button ID="ButCusReceive" runat="server" Text=" 签 收 " OnClientClick="return confirm('系统将把支付款打给卖家帐户，确定签收吗？')" OnClick="ButCusReceive_Click"/>&nbsp;
    </asp:PlaceHolder>
    <asp:PlaceHolder ID="SalerControl" runat="server" Visible="false">
            <asp:Button ID="ButConfirm" Text=" 确 认 " OnClientClick="document.getElementById('SureDiv').style.display='block';return false;" runat="server" />&nbsp;
            <asp:Button ID="Butdel" runat="server"  Text=" 删 除 " OnClick="Butdel_Click" OnClientClick="return confirm('确认删除吗？')"/>&nbsp;
            <asp:Button ID="Re_Money" runat="server" Text=" 收 款 " OnCommand="PayMoney"/>&nbsp;
            <asp:Button ID="ButOpenInvoice" runat="server" Text=" 开发票 " OnClick="ButOpenInvoice_Click" />&nbsp;
            <asp:Button ID="ButSend" runat="server" Text=" 发 货 " OnClick="ButSend_Click" />&nbsp;
    </asp:PlaceHolder><input type="button" value=" 打 印 " onclick="return PrintOrder()" /> 
    <input type="button" value=" 返 回 " onclick="history.back()" /> 
</div>
    <br />
    <div class="ShopOrderTips"><div style="padding:5px;">
    <b>注：</b><br />
“<font color="blue">商品原价</font>”指商品的原始零售价。<br />
“合计”指订单中商品总额。<br />
“运费总额”指物流总费用。<br />
“发票税额”指需要发票且商品价格未含税时需要买家支付的商品总税额。<br />
“ 订单总计”指“商品总额”+“运费总额”+“发票税额”。<br />
“<font color="green">实际金额</font>”买卖家双方协商指定的订单总额（订单以实际金额为标准）。<br />
   </div></div>
   <div class="FloatDivStyle"  id="SureDiv" >
         <div  class="pageTitle">确认订单</div>
            <asp:CheckBox ID="CheckSendMobileMesToCus" runat="server" Text="同时发送手机短信通知收货人已经确认订单" /><br />
            <asp:CheckBox ID="CheckSendMesMesToCus" runat="server" Checked="True" Text="同时使用站内短信通知会员已经确认订单" /><br />
            <asp:CheckBox ID="CheckSendEmailMesToCus" runat="server" Text="同时使用Email通知收货人已经确认订单" /><br />
         <div style="text-align:center; height:35px; line-height:35px;">
            <asp:Button ID="ConfirmButton" runat="server" OnClick="ConfirmButton_Click" Text=" 确 认 " />
            <input type="button" value=" 关 闭 " onclick="document.getElementById('SureDiv').style.display='none'" />
         </div>      
         <div style=" background:#D3E7F6; color:#448AD0; "> 请仔细检查此订单的所有信息，特别是实际销售价、
                        售后服务期限等信息，确定无误后点“确认”按
                        钮，否则请点击“关闭”按钮。
         </div>    
   </div>
  
  <div id="MainMenu">
	<div class="TabMenu">
		<!--一级导航-->
       <ul id="M1" >
          <li class="active"><a href="javascript:ShowShopOrder('OrderOtherInfo')"  onclick="setButtonActive(0)">付款信息</a></li>
          <li><a href="javascript:ShowShopOrder('ShowInvoiceItem')"  onclick="setButtonActive(1)">发票记录</a></li>
          <li><a href="javascript:ShowShopOrder('ShowDeliverItem')"  onclick="setButtonActive(2)">发退货记录</a></li> 　
       </ul>
    </div>
    <div class="OrderOtherInfoStyle">
        <div id="OrderOtherInfo">
            <asp:Repeater ID="PayInfo" runat="server">
                <HeaderTemplate>
                    <table class="ShopOrderStyle">
                        <tr>
                            <th width="150">时间</th>
                            <th width="100">方式</th>
                            <th width="100">金额</th>
                            <th width="100">状态</th>
                            <th>备注</th>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr class="ShopProductOrderStyle">
                        <td><asp:Literal ID="Paytype" Text='<%#Eval("PayTime") %>' runat="server"/></td>
                        <td><asp:Literal ID="eBankID" runat="server" Text='<%# MallZ.Web.Shop.TextFormat.GetBank(Eval("eBankID").ToString()) %>' /></td>
                        <td><asp:Literal ID="MoneyPay" runat="server" Text='<%#Eval("MoneyPay") %>' /></td>
                        <td><asp:Literal ID="Status" runat="server" Text='<%# MallZ.Web.Shop.TextFormat.GetPay(Eval("Status").ToString()) %>' /></td>
                        <td><asp:Literal ID="Remark" runat="server" Text='<%#Eval("Remark") %>' /></td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </div> 
        <div id="ShowInvoiceItem" style="position:absolute;z-index:1000;width:98%; height:auto; margin:auto; text-align:center; vertical-align:middle; display:none;">
            <asp:Repeater ID="InvoiceItem" runat="server">
                <HeaderTemplate>
                    <table class="ShopOrderStyle">
                        <tr>
                            <th width="150">时间</th>
                            <th width="100">发票标头</th>
                            <th width="100">发票金额</th>
                            <th width="100">经手人</th>
                            <th width="300">发票内容</th>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr class="ShopProductOrderStyle">
                        <td width="150"><asp:Literal ID="InvoiceDate" Text='<%#Eval("InvoiceDate") %>' runat="server"/></td>
                        <td width="100"><asp:Literal ID="InvoiceTitle" runat="server" Text='<%#Eval("InvoiceTitle") %>' /></td>
                        <td width="100"><asp:Literal ID="TotalMoney" runat="server" Text='<%#Eval("TotalMoney") %>' /></td>
                        <td width="100"><asp:Literal ID="Inputer" runat="server" Text='<%#Eval("Inputer") %>' /></td>
                        <td width="100"><asp:Literal ID="InvoiceContent" runat="server" Text='<%#Eval("InvoiceContent") %>' /></td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
       </div> 
       
       <div id="ShowDeliverItem" style="position:absolute;z-index:1000;width:98%; height:auto; margin:auto; text-align:center; vertical-align:middle; display:none;">
            <asp:Repeater ID="DeliverItem" runat="server">
                <HeaderTemplate>
                    <table class="ShopOrderStyle">
                        <tr>
                            <th width="150">时间</th>
                            <th width="100">物流公司</th>
                            <th width="100">物流号</th>
                            <th width="100">经手人</th>
                            <th width="300">备注</th>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr class="ShopProductOrderStyle">
                        <td width="150"><asp:Literal ID="DeliverDate" Text='<%#Eval("DeliverDate") %>' runat="server"/></td>
                        <td width="100"><asp:Literal ID="DeliverCompany" runat="server" Text='<%#Eval("DeliverCompany") %>' /></td>
                        <td width="100"><asp:Literal ID="ExpressNumber" runat="server" Text='<%#Eval("ExpressNumber") %>' /></td>
                        <td width="100"><asp:Literal ID="HandlerName" runat="server" Text='<%#Eval("HandlerName") %>' /></td>
                        <td width="100"><asp:Literal ID="Remark" runat="server" Text='<%#Eval("Remark") %>' /></td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
       </div>
    </div> 
    <br />
  </div>
    
  <br />
  <script type="text/javascript">
  function ShowShopOrder(obj)
  {
    document.getElementById("OrderOtherInfo").style.display="none";
    document.getElementById("ShowInvoiceItem").style.display="none";
    document.getElementById("ShowDeliverItem").style.display="none";
    document.getElementById(obj).style.display="";
    
  }
  
  function PrintOrder()
  {
    window.print();
//    var old_action,old_target;
//    var _form=document.forms["aspnetForm"];
//    old_action=_form.action;
//    old_target=_form.target;
//    _form.action="Shop_PrintOrder.aspx";
//    _form.target="blank";
//    var _printContent=document.getElementById("PrintContent");
//    _printContent.value=document.getElementById("order_content").innerHTML;
//    _form.submit();
//    _form.action=old_action;
//    _form.target=old_target;
//    _printContent.value="";
  }
  </script>
</asp:Content>

