<%@ Page language="c#" Codebehind="MySubOperation.aspx.cs" AutoEventWireup="true" Inherits="XpShop.WebUI.MySubOperation" %>
<%@ Register TagPrefix="uc1" TagName="MemberMenu" Src="Modules/MemberMenu.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="MemberHelper" Src="Modules/MemberHelper.ascx" %>
<%@ Register TagPrefix="uc1" TagName="memberfooter" Src="Modules/memberfooter.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
	<HEAD>
		<!--#include file="../../inc/encoding.inc"-->
		<title><%=GetResourceString("SubOperator")%>,<%=config.SiteTitle%></title>
		<!--#include file="../../inc/head.inc"-->
		<script src="inc/ui.datepicker.cn.js" type="text/javascript"></script>
		<link type="text/css" rel="stylesheet" href="inc/ui.datepicker.css" />
		<link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/member.css" type="text/css" rel="stylesheet" />
        <script type="text/javascript">
			$(document).ready(function(){
				$("#txtDateFrom").datepicker();
				$("#txtDateTo").datepicker();	   
			});
		</script>
	</HEAD>
	<body>
        <uc1:Header id="Header1" runat="server"></uc1:Header>
        <div class="xp-qgw clear">
            <!--位置导航开始-->
            <div class="path">
                <a href="<%=webSite %><%if(config.html==""){%>default.aspx<%}else{%>Index.<%=config.html%><%}%>"> <%=GetResourceString("Home")%> </a> &nbsp;&gt;&nbsp;<a href="<%=webSite %>Center.<%=config.html %>"><%=GetResourceString("MemberCenter")%></a>&nbsp;&gt;&nbsp;<%=GetResourceString("SubOperator")%>
            </div>
            <!--位置导航结束-->
            <div class="member_left">
                <!--会员中心导航开始-->
                <uc1:MemberMenu id="MemberMenu1" runat="server"></uc1:MemberMenu>
                <!--会员中心导航结束-->
            </div>
            <div class="member_middle_right">
                <!--内容开始-->
                <div class="mframe">
                    <div class="tl"></div>
                    <div class="tr"></div>
                    <div class="tm"><%=GetResourceString("SubOperator")%></div>
                    <div class="ml"></div>
                    <div class="mr"></div>
                    <div class="mm">
                        <form id="Form1" method="post" runat="server">
                            <div class="topright"><span><%=GetResourceString("PreMonthOrdersCount")%>：<%=GetSubTotalOrdersSum("PreMonth")%><%=GetResourceString("Unit")%></span><span> <%=GetResourceString("PaymentOrdersMoneyCount")%>：<%=GetSubTotalMoney("PreMonth")%><%=GetResourceString("Yuan")%></span></div>
                            <div class="topright"><span><%=GetResourceString("ThisMonthOrdersCount")%>：<%=GetSubTotalOrdersSum("ThisMonth")%><%=GetResourceString("Unit")%></span><span> <%=GetResourceString("PaymentOrdersMoneyCount")%>：<%=GetSubTotalMoney("ThisMonth")%><%=GetResourceString("Yuan")%></span></div>
                            <div class="topright">
                                <%=GetResourceString("Time")%>：<%=GetResourceString("From")%>
                                <asp:TextBox ID="txtDateFrom" runat="server" ReadOnly="true" Width="100px"></asp:TextBox>
                                <%=GetResourceString("To")%>
                                <asp:TextBox ID="txtDateTo" runat="server" ReadOnly="true" Width="100px"></asp:TextBox>
                                <asp:Button ID="btnSearch" OnClick="btnSearch_Click" runat="server" Text="查看"></asp:Button>
                                <%=GetResourceString("OrdersCount")%>：<%=GetSubTotalOrdersSum("")%><%=GetResourceString("Unit")%>
                                <%=GetResourceString("PaymentOrdersMoneyCount")%>：<%=GetSubTotalMoney("")%><%=GetResourceString("Yuan")%>
                                
                            </div>
                            <asp:DataGrid ID="dgOrderList" CssClass="dgborder" runat="server" AutoGenerateColumns="False" DataKeyField="OrderID"
                                Width="100%" HorizontalAlign="Center" BorderWidth="1" BorderColor="#d6d6d6">
                                <HeaderStyle BackColor="#fff7d3" Height="20px"></HeaderStyle>
                                <ItemStyle BackColor="White"></ItemStyle>
                                <Columns>
                                    <asp:TemplateColumn HeaderText="订单编号">
                                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                        <ItemStyle HorizontalAlign="Left" Height="20px" Width="8%"></ItemStyle>
                                        <ItemTemplate>
                                            <a href="#" onclick='printOrder(<%# DataBinder.Eval(Container.DataItem, "OrderID") %>)'>
                                                <%# DataBinder.Eval(Container.DataItem, "OrderNo") %>
                                            </a>
                                        </ItemTemplate>
                                    </asp:TemplateColumn>
                                    <asp:BoundColumn DataField="OrderTime" HeaderText="下订时间" DataFormatString="{0:yyyy-MM-dd}">
                                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                        <ItemStyle HorizontalAlign="Center" Width="15%"></ItemStyle>
                                    </asp:BoundColumn>
                                    <asp:TemplateColumn HeaderText="TotalPrice">
                                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                        <ItemStyle HorizontalAlign="Center" Width="10%"></ItemStyle>
                                        <ItemTemplate>
                                            <%# DataBinder.Eval(Container.DataItem, "TotalPrice","{0:f}") %>
                                        </ItemTemplate>
                                    </asp:TemplateColumn>
                                    <asp:TemplateColumn HeaderText="支付金额">
                                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                        <ItemStyle HorizontalAlign="Center" Width="13%"></ItemStyle>
                                        <ItemTemplate>
                                            <font color="Tomato">
                                                <%# GetPay(DataBinder.Eval(Container.DataItem, "TotalPrice").ToString(),DataBinder.Eval(Container.DataItem, "AdvancePayment").ToString())%>
                                            </font>
                                        </ItemTemplate>
                                    </asp:TemplateColumn>
                                    <asp:TemplateColumn HeaderText="代理员编号">
                                        <HeaderStyle HorizontalAlign="Center" Wrap="false"></HeaderStyle>
                                        <ItemStyle HorizontalAlign="Center" Wrap="false"></ItemStyle>
                                        <ItemTemplate>
                                            <%# DataBinder.Eval(Container.DataItem, "Code")%>
                                        </ItemTemplate>
                                    </asp:TemplateColumn>
                                    <asp:TemplateColumn HeaderText="订单状态">
                                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                        <ItemStyle HorizontalAlign="Center" Width="30%"></ItemStyle>
                                        <ItemTemplate>
                                            <%# GetStatus(DataBinder.Eval(Container.DataItem, "OrderID").ToString()).Replace("立即支付","").Replace("-","")%>
                                        </ItemTemplate>
                                    </asp:TemplateColumn>
                                    <asp:TemplateColumn HeaderText="操作">
                                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                        <ItemStyle HorizontalAlign="Center" Width="20%"></ItemStyle>
                                        <ItemTemplate>
                                            <a href="#" onclick='printOrder(<%# DataBinder.Eval(Container.DataItem, "OrderID") %>)'>
                                                <%=GetResourceString("ViewOrder")%>
                                            </a>
                                        </ItemTemplate>
                                    </asp:TemplateColumn>
                                </Columns>
                            </asp:DataGrid>
                            

                            <script type="text/javascript">
                            function printOrder(oid)
                            {
	                            temp=window.open('<%=webSite %>OrderPrint.aspx?OrderID='+oid,'shopcat','width=700,height=850,scrollbars=yes,resizable=yes');
	                            temp.focus();
                            }
                            </script>
                        </form>
                    </div>
                    <div class="bl"></div>
                    <div class="br"></div>
                    <div class="bm"></div>
                </div>
                <!--内容结束-->
            </div>
        </div>    
        <uc1:MemberHelper id="Helper1" runat="server"></uc1:MemberHelper>
        <uc1:memberfooter id="Footer1" runat="server"></uc1:memberfooter>
	</body>
</HTML>
