<%@ Page language="c#" Codebehind="SubAchievements.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.SubAchievements" %>
<!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/head.inc"-->
		<title>AgencyDrawing</title>
		<script type="text/javascript">
		    function advsearch()
		    {
			    if(document.Form1.cbAddToAdvSearch.checked)
			    {
				    eval("AdvSearch" + ".style.display=\"\";");
				    eval("document.Form1.chkChoice.checked=false");
			    }
			    else
			    {
				    eval("AdvSearch" + ".style.display=\"none\";");
			    }
		    }
            function printOrder(oid)
            {
                temp=window.open('/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>OrderPrint.aspx?OrderID='+oid,'shopcat','width=700,height=850,scrollbars=yes,resizable=yes');
                temp.focus();
            }
        </script>
        <script type="text/javascript" src="../inc/calendar.js"></script>
	</head>
	<body>
	    <div class="container">
		<div class="sub_container">
		<div class="sub_container_title"><a href="<%=AdminDefault%>" target="_top">桌面</a><img src="images/admin_title.jpg" height=9px width=8px align="absmiddle" /><asp:label id="lblTitleInfo" Runat="server" CssClass="tableHeaderText">代销员业绩查看</asp:label></div>
		<div class="sub_container_content">
		<form id="Form1" method="post" runat="server">
		    <div class="frame">
		        <div class="frame_title"><asp:Label id="lblAction" runat="server" CssClass="tableHeaderText">代销员业绩查看</asp:Label></div>
		        <div class="frame_content">
			        <table class="tableBorder" cellspacing="0" cellpadding="0" width="98%" align="center" border="0">
				        <tr>
                            <td>
                                <div><span><%=GetResourceString("PreMonthOrdersCount")%>：<%=GetSubTotalOrdersSum("PreMonth")%><%=GetResourceString("Unit")%></span><span> <%=GetResourceString("PaymentOrdersMoneyCount")%>：<%=GetSubTotalMoney("PreMonth")%><%=GetResourceString("Yuan")%></span></div>
                                <div style="float: left;"><span><%=GetResourceString("ThisMonthOrdersCount")%>：<%=GetSubTotalOrdersSum("ThisMonth")%><%=GetResourceString("Unit")%></span><span> <%=GetResourceString("PaymentOrdersMoneyCount")%>：<%=GetSubTotalMoney("ThisMonth")%><%=GetResourceString("Yuan")%></span></div>
                                <div  style="float: left; width:100px;"></div>
                                <div style="float: left;"><%=GetResourceString("SubAgentsCount")%>：<span style="color: Blue;"><%=GetTotalSubAgent()%></span></div>
                            </td>
                        </tr>
				        <tr>
					        <td height="23" class="forumRowHighlight">
						        <asp:DataGrid ID="dgOrderList" runat="server" AutoGenerateColumns="False" DataKeyField="OrderID"
                                    Width="100%" HorizontalAlign="Center" BorderWidth="1" BorderColor="#CCCCCC">
                                    <ItemStyle BackColor="White"></ItemStyle>
                                    <HeaderStyle BackColor="#E4E3E1"></HeaderStyle>
                                    <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="总金额">
                                            <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="220px"></ItemStyle>
                                            <ItemTemplate>
                                                <%# GetStatus(DataBinder.Eval(Container.DataItem, "OrderID").ToString())%>
                                            </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>
					        </td>
				        </tr>
				        <tr>
                            <td>
                                <div style="float: left; vertical-align:middle; height:30px;">
                                    <%=GetResourceString("Time")%>：<%=GetResourceString("From")%>
                                    <asp:TextBox ID="txtDateFrom" runat="server" onmouseover="window.status='Date Picker';return true;"
                                        onmouseout="window.status='';return true;" onClick="javascript:show_calendar('Form1.txtDateFrom');"
                                        Width="100px"></asp:TextBox>
                                    <%=GetResourceString("To")%>
                                    <asp:TextBox ID="txtDateTo" runat="server" onmouseover="window.status='Date Picker';return true;"
                                        onmouseout="window.status='';return true;" onClick="javascript:show_calendar('Form1.txtDateTo');"
                                        Width="100px"></asp:TextBox>
                                    <asp:Button ID="btnSearch" OnClick="btnSearch_Click" runat="server" Text="查看" CssClass="inputbtn"></asp:Button>
                                    <%=GetResourceString("OrdersCount")%>：<%=GetSubTotalOrdersSum("")%><%=GetResourceString("Unit")%>
                                    <%=GetResourceString("PaymentOrdersMoneyCount")%>：<%=GetSubTotalMoney("")%><%=GetResourceString("Yuan")%>                            
                                </div>
                            </td>
                        </tr>
			        </table>
		        </div>
	        </div>
		</form>
		</div>
		</div>
		</div>
	</body>
</html>
