<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.Admin.Course.KS_CosBuyCGCount" Codebehind="KS.CosBuyCGCount.aspx.cs" %>
<%@ Import Namespace="Kesion.Publics" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" runat="server">
<script>
	function keyWordFocus() {
		if (jQuery("#<%=this.KeyWord.ClientID %>").val() == '请输入想要搜索的用户名！') {
				jQuery("#<%=this.KeyWord.ClientID %>").val('');
		}
	}
	function keyWordBlur() {
		if (jQuery("#<%=this.KeyWord.ClientID %>").val() == '') {
			jQuery("#<%=this.KeyWord.ClientID %>").val('请输入想要搜索的用户名！');
		}
	}
</script>
<style>
@media all and (max-width: 1541px) {
	.longquickSearch:after{ content:''; clear:both; display:block;}
}
</style>
<div id="manage_top" class="menu_top_fixed">
    <ul class="titleTab">
      <li ><a href="KS.CosStats.aspx">课程订单统计</a></li>
      <li ><a href="KS.CosAllStatistics.aspx">课程数据统计</a></li>
      <li><a href="KS.CosClassCount.aspx">分类数据统计</a></li>     
      <li class="curr"><a href="KS.CosBuyCGCount.aspx">买家采购统计</a></li>

   </ul>
</div>  
<div class="menu_top_fixed_height"></div>
<div class="content-area">
  	<script src="/admin/images/echarts.js" type="text/javascript"></script>
    <asp:Panel ID="ListPanel" runat="server" Width="100%">
        <div class="myTitle"><asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click" CssClass="fr button mr20">导出Excel</asp:LinkButton>买家采购统计</div>
        
        <div class="quickSearch clearfix">
            <div class="longquickSearch">
                <div class="SearchBox fl">
                    <asp:TextBox ID="KeyWord" CssClass="textbox" runat="server" Style="color:#ccc; width:180px;" onfocus="keyWordFocus();" onblur="keyWordBlur();"  Text="请输入想要搜索的用户名！"></asp:TextBox>
                    <asp:Button ID="Button2" runat="server" Text="开始搜索" CssClass="button" OnClick="Button2_Click"/>
                </div>
            </div>
            <div class="TabTitle fr longliwrap longHeadOperat2">
                <span<%=KSCMS.S("flag")==""?" class='active'":string.Empty %>><a href="KS.CosBuyCGCount.aspx">总采购量排行榜</a></span>
                <span<%=KSCMS.S("flag")=="1"?" class='active'":string.Empty %>><a href="?flag=1">今日</a></span>
                <span<%=KSCMS.S("flag")=="2"?" class='active'":string.Empty %>><a href="?flag=2">昨日</a></span>
                <span<%=KSCMS.S("flag")=="3"?" class='active'":string.Empty %>><a href="?flag=3">最近7日</a></span>
                <span<%=KSCMS.S("flag")=="4"?" class='active'":string.Empty %>><a href="?flag=4">最近30日</a></span>
                <span<%=KSCMS.S("flag")=="5"?" class='active'":string.Empty %>><a href="?flag=5">按时间段</a></span>
                <%if (KSCMS.S("flag") == "5")
                  { %>
                <asp:TextBox CssClass="textbox Wdate ml15" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" Width="160" ID="TxtBeginDate" runat="server"></asp:TextBox>至  
                <asp:TextBox CssClass="textbox Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" Width="160" ID="TxtEndDate" runat="server"></asp:TextBox>
                <asp:Button ID="BtnSearch" runat="server" Text="查询" CssClass="button" OnClick="BtnSearch_Click" />
                <%} %>
            </div>
        </div>           
        <asp:Repeater ID="Repeater1" runat="server">
            <HeaderTemplate>
                <table width="99%" border="0" cellpadding="2" cellspacing="1" class="CTable">
                    <tr align="center" class="CTitle">
                        <td width="50" align="center"><b>序号</b></td>
                        <td width="80" align="center"><b>购买人</b></td>
                        <td align="center"><b>最近购买时间</b></td>
                        <td align="center"><b>累计订单(个)</b></td>
                        <td width="15%" align="center"><b>累计金额(元)</b></td>
                        <td width="15%" align="center"><b>历史详细记录</b></td>

                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr class="tdbg">
                    <td align="center">
                        <%#Container.ItemIndex+1%>
                    </td>
                    <td align="center">
                        <%# Eval("username")%>
                    </td>
                    <td align="center">
                        <%#Eval("buytime") %>
                      
                    </td>

                    <td align="center">
                        <a href="?action=buyorder&username=<%#Eval("username").ToString()%>&itemflag=<%#flag%>"><%#GetOrderCount(Eval("username").ToString(),0) %></a>
                    </td>
                    <td align="center">
                        <a href="?action=buymoney&username=<%#Eval("username").ToString()%>&itemflag=<%#flag%>"><%#Kesion.APPCode.Public.ReturnShopPrice(GetOrderTotalPrice(Eval("username").ToString()))%></a>
                    </td>
                    <td align="center">
                        <a href="?action=buydetail&username=<%#Eval("username").ToString()%>&itemflag=<%#flag%>">查看</a>
                    </td>
                </tr>

            </ItemTemplate>
            <FooterTemplate>

                <tr class="tdbg" style="display: <%# bool.Parse((Repeater1.Items.Count==0).ToString())?"":"none"%>">
                    <td class="Ctd" style="text-align: center" colspan="12">
                        <div class="empty">没有买家采购的数据</div>
                    </td>
                </tr>
                </table>
            </FooterTemplate>
        </asp:Repeater>

        <KS:Page ID="Page1" runat="server" />
    </asp:Panel>
    <asp:Panel ID="Panel1" runat="server">
        <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
    </asp:Panel>
	<script type="text/javascript">
    	showtips('<span class="state"><strong>说明：</strong><br /></span>除了已退款及已关闭的订单和金额小于0不统计!');
    </script>
</div>
</asp:Content>
