<%@ Page language="c#" Codebehind="OrderStatistics.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Supplier.OrderStatistics" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="SupplierMenu" Src="Modules/SupplierMenu.ascx" %>
<%@	Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox"	%>
<%@ Register TagPrefix="uc1" TagName="Helper" Src="Modules/Helper.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Footer" Src="Modules/Footer.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<!--#include file="inc/head.inc"-->
		<title>商家中心 <%=config.SiteTitle%></title>
        <script type="text/javascript" src="inc/commond.js"></script>
	</head>
	<body>
			<uc1:Header id="Header1" runat="server"></uc1:Header>
			 <!--位置导航开始-->
			 <div class="path"><a href="<%=webSite %>supplier/default.<%=config.html%>">商家桌面</a> > 统计报表 > 订单统计 > 订单统计</div>
			<!--位置导航结束-->
			<div class="xp-w clear">
				<div class="content-left">
					<!--会员中心导航开始-->
					<uc1:SupplierMenu id="SupplierMenu1" runat="server"></uc1:SupplierMenu>
					<!--会员中心导航结束-->
				</div>
				<div class="content-middle">	
					<div class="rframe">
					    <div class="tm">订单统计</div>
					    <div class="mm clear">
					        <form id="Form1" method="post" runat="server" >
                                <table>
                                    <tr>
	                                <td width="100" class="right">统计类型：</td>
	                                <td>
	                                <asp:RadioButtonList id="rdlStatisticsType" runat="server" AutoPostBack="True" 
                                            onselectedindexchanged="rdlStatisticsType_SelectedIndexChanged" RepeatDirection=Horizontal>
                                            <asp:ListItem Selected="True" Value="0">按日统计（最近30天）</asp:ListItem>
                                            <asp:ListItem Value="1">按月统计（最近12月）</asp:ListItem>
                                         </asp:RadioButtonList>
                                    </td>
                                    </tr>
                                </table>
                            </form>
                            <br>
                            说明：<br>
                            <span class="red">1、以下数据只供参考，不做结算使用。</span><br>
                            2、收订、指的是商家收到的所有订单。<br>
                            3、发出、指的是商家实际发出的订单。<br>
                            4、取消、指的是被取消的订单。<br>
                            5、单均、指的是订单总金额与订单总数的比值。<br>
                            <hr class="itemhr" />
                            
    					    <div class="pro_hlist">
							    <asp:DataList id="dlOrderStatistics" CellPadding="4" RepeatColumns="1" 
                                    RepeatDirection="Horizontal" Width="100%" runat="server" 
                                    ForeColor="#333333" GridLines="Both" BorderWidth="1" BorderColor="#c8dcf4">
								    <AlternatingItemStyle BackColor="White" ForeColor="#284775" />
                                    <ItemStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                    <SelectedItemStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                    <ItemStyle CssClass="datagrid-item"></ItemStyle>
								    <HeaderTemplate>								
                                        <ItemTemplate>													
									        <table cellpadding="3" cellspacing="0" width="100%">
										        <tr align="center">
										            <th rowspan="2" width="10%">时间</th>
                                                    <th colspan="3" width="30%">收订</th>
                                                    <th colspan="3" width="30%">发出</th>
                                                    <th colspan="3" width="30%">取消</th>
										        </tr>
										        <tr align="center">
                                                  <th>单数</th>
                                                  <th>金额</th>
                                                  <th>单均</th>
                                                  <th>单数</th>
                                                  <th>金额</th>
                                                  <th>单均</th>
                                                  <th>单数</th>
                                                  <th>金额</th>
                                                  <th>单均</th>
                                                </tr>			    
									        </table>
								        </ItemTemplate>								
								    </HeaderTemplate>
								    <ItemTemplate>													
									    <table cellpadding="3" cellspacing="0" width="100%">
										    <tr align="center">
                                                <td width="10%">
                                                    <%#DataBinder.Eval(Container.DataItem, "OrderTime", "{0:f}")%>
											    </td>
                                                <td width="10%">
                                                    <%# DataBinder.Eval(Container.DataItem, "OrderNum", "{0:f0}") == "0" ? "--" : DataBinder.Eval(Container.DataItem, "OrderNum", "{0:f0}")%>
											    </td>
                                                <td width="10%">
                                                    <%#DataBinder.Eval(Container.DataItem, "OrderAmount", "{0:f2}") == "0.00" ? "--" : DataBinder.Eval(Container.DataItem, "OrderAmount", "{0:f2}")%>
											    </td>
                                                <td width="10%">
                                                    <%# DataBinder.Eval(Container.DataItem, "OrderAvg", "{0:f2}") == "0.00" ? "--" : DataBinder.Eval(Container.DataItem, "OrderAvg", "{0:f}")%>
											    </td>										
                                                <td width="10%">
                                                    <%#DataBinder.Eval(Container.DataItem, "SendNum", "{0:f0}") == "0" ? "--" : DataBinder.Eval(Container.DataItem, "SendNum", "{0:f0}")%>
											    </td>
                                                <td width="10%">
                                                    <%#DataBinder.Eval(Container.DataItem, "SendAmount", "{0:f2}") == "0.00" ? "--" : DataBinder.Eval(Container.DataItem, "SendAmount", "{0:f}")%>
											    </td>
                                                <td width="10%">
                                                    <%#DataBinder.Eval(Container.DataItem, "SendAvg", "{0:f2}") == "0.00" ? "--" : DataBinder.Eval(Container.DataItem, "SendAvg", "{0:f}")%>
											    </td>
	                                            <td width="10%">
                                                    <%#DataBinder.Eval(Container.DataItem, "CancelNum", "{0:f0}") == "0" ? "--" : DataBinder.Eval(Container.DataItem, "CancelNum", "{0:f0}")%>
											    </td>
                                                <td width="10%">
                                                    <%#DataBinder.Eval(Container.DataItem, "CancelAmount", "{0:f2}") == "0.00" ? "--" : DataBinder.Eval(Container.DataItem, "CancelAmount", "{0:f2}")%>
											    </td>
	                                            <td width="10%">
                                                    <%#DataBinder.Eval(Container.DataItem, "CancelAvg", "{0:f2}") == "0.00" ? "--" : DataBinder.Eval(Container.DataItem, "CancelAvg", "{0:f2}")%>
											    </td>
										    </tr>
									    </table>
								    </ItemTemplate>
								    <FooterTemplate>								
                                        <ItemTemplate>													
									        <table cellpadding="3" cellspacing="0" width="100%">
									          <tr align="center">
                                                <td colspan=2 align=center width="10%">
                                                 总计
											    </td>
                                                <td width="10%">
    										        <%=dt.Rows.Count > 0 ? dt.Rows[0]["OrderNums"] : 0%>
    										    </td>
                                                <td width="10%">
    										        <%=dt.Rows.Count >0 ? dt.Rows[0]["OrderAmounts"] : 0%>
											    </td>
                                                <td width="10%">
    										        <%=dt.Rows.Count >0 ? dt.Rows[0]["OrderAvgs"] : 0%>
											    </td>										
                                                <td width="10%">
    										        <%=dt.Rows.Count >0 ? dt.Rows[0]["SendNums"] : 0%>
											    </td>
                                                <td width="10%">
    										        <%=dt.Rows.Count >0 ? dt.Rows[0]["SendAmounts"] : 0%>
											    </td>
											    <td width="10%">
    										        <%=dt.Rows.Count >0 ? dt.Rows[0]["SendAvgs"] : 0%>
											    </td>
                                                <td width="10%">
    										        <%=dt.Rows.Count >0 ? dt.Rows[0]["CancelNums"] : 0%>
											    </td>										
                                                <td width="10%">
    										        <%=dt.Rows.Count >0 ? dt.Rows[0]["CancelAmounts"] : 0%>
											    </td>
                                                <td width="10%">
    										        <%=dt.Rows.Count >0 ? dt.Rows[0]["CancelAvgs"] : 0%>
											    </td>
										    </tr>
									        </table>
								        </ItemTemplate>								
								    </FooterTemplate>
							    </asp:DataList>
						    </div>
					    </div>
					</div>
			    </div>
			</div>
		<uc1:Helper id="Helper" runat="server"></uc1:Helper>
		<uc1:Footer id="Footer" runat="server"></uc1:Footer>
	</body>
</html>