<%@ Page language="c#" Codebehind="Achievements.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.Achievements" %>
<!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>Achievements</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" />负责人业绩管理</div>
		<div class="sub_container_content">
	    <form id="Form1" method="post" runat="server">
		    <div class="frame">
		        <div class="frame_title">业绩查看</div>
		        <div class="frame_content">
		            <table class="tableBorder" cellSpacing="1" cellPadding="1" width="640" align="center" border="0" id="Table2">
			            <tr>
                            <td>
                                <div style="float: left;">
                                    会员帐号
                                    ：<span style="color: Blue;"><%=GetAgentNoByMemberID() %></span></div>
                                <div style="float: left; width: 20px;">
                                </div>
                                <div>
                                    <%=GetResourceString("SubMembers")%>
                                    ：<span style="color: Blue;"><a href="#" style="color: Blue;"><%=GetTotalMemberSum()%></a>
                                        <%=GetResourceString("Unit")%>
                                    </span>
                                </div>
                                <div>
                                    <span>
                                        <%=GetResourceString("PreMonthOrdersCount")%>
                                        ：<%=GetTotalOrdersSum("PreMonth")%><%=GetResourceString("Unit")%></span><span>
                                            <%=GetResourceString("PaymentOrdersMoneyCount")%>
                                            ：<%=GetTotalMoney("PreMonth")%><%=GetResourceString("Yuan")%></span></div>
                                <div>
                                    <span>
                                        <%=GetResourceString("ThisMonthOrdersCount")%>
                                        ：<%=GetTotalOrdersSum("ThisMonth")%><%=GetResourceString("Unit")%></span><span>
                                            <%=GetResourceString("PaymentOrdersMoneyCount")%>
                                            ：<%=GetTotalMoney("ThisMonth")%><%=GetResourceString("Yuan")%></span></div>
                                
                            </td>
			            </tr>
			            <tr>
				            <td 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"></HeaderStyle>
                                            <ItemStyle HorizontalAlign="Center" Width="36%"></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>
				            </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")%>
                                    ：<%=GetTotalOrdersSum("")%><%=GetResourceString("Unit")%>
                                    <%=GetResourceString("PaymentOrdersMoneyCount")%>
                                    ：<%=GetTotalMoney("")%><%=GetResourceString("Yuan")%>
                                </div>
			                </td>
			            </tr>
		            </table>
		        </div>
	        </div>
	    </form>
		</div>
		</div>
		</div>
</body>
</html>