<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.Admin.Course.KS_CosFavoriteCount" Codebehind="KS.CosFavoriteCount.aspx.cs" %>
<%@ Import Namespace="Kesion.Publics" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" runat="server">
    <script>
        function viewlist(courseid, showtype, costype) {
            if (showtype == '0') {
                parent.openWin("查看点赞者", "Course/KS.CosFavoriteCount.aspx?action=viewlist&courseid=" + courseid + "&showtype=0&costype=" + costype, false, 820, 450);
            }
            else {
                parent.openWin("查看收藏者", "Course/KS.CosFavoriteCount.aspx?action=viewlist&courseid=" + courseid + "&showtype=1&costype=" + costype, false, 820, 450);
            }
        }
    </script>
 <asp:Panel ID="panelList" runat="server" Width="100%">
<div id="manage_top" class="menu_top_fixed">
    <ul class="titleTab">
      <li ><a href="KS.CosStats.aspx">课程订单统计</a></li>
      <li class="curr"><a href="KS.CosAllStatistics.aspx">课程数据统计</a></li>
      <li><a href="KS.CosClassCount.aspx">分类数据统计</a></li>     
      <li><a href="KS.CosBuyCGCount.aspx">买家采购统计</a></li>
   </ul>
</div>  
<div class="menu_top_fixed_height"></div>
 <div class="content-area">
     <div class="tabs_header clearfix">
        <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click" CssClass="fr button mr20">导出Excel</asp:LinkButton>    
        <ul class="tabs">
           	<li ><a href="KS.CosAllStatistics.aspx"><span>课程总销售统计表</span></a> </li>
            <li class='active'><a href="KS.CosFavoriteCount.aspx">浏览/点赞/收藏</a></li>
        </ul>
      </div> 
        <!--<div class="myTitle">
              
           </div>-->
         <div class="quickSearch clearfix">
             <asp:DropDownList ID="DrpClassID" runat="server" style="margin-right:8px;" OnSelectedIndexChanged="DrpClassID_SelectedIndexChanged" AutoPostBack="true">
                <asp:ListItem Value="0">--按分类查看--</asp:ListItem>
             </asp:DropDownList>
             <asp:DropDownList ID="DrpCosType" runat="server" style="margin-right:8px;" OnSelectedIndexChanged="DrpCosType_SelectedIndexChanged"  AutoPostBack="true">
                <asp:ListItem Value="1">点播</asp:ListItem>
                <asp:ListItem Value="2">直播</asp:ListItem>
                <asp:ListItem Value="3">面授</asp:ListItem> 
             </asp:DropDownList>
             <asp:DropDownList ID="Condition" runat="server" style="margin-right:8px;">
                <asp:ListItem Value="1">课程名称</asp:ListItem>
                <asp:ListItem Value="2">课程ID</asp:ListItem>
             </asp:DropDownList>
             <asp:TextBox  Style="color: #ccc"  CssClass="textbox" ID="KeyWord" runat="server" Width="180px"></asp:TextBox>
             <asp:Button ID="Button4" runat="server" CssClass="button" Text="开始搜索" OnClick="Button4_Click" />
         </div>         
     
          <KS:KSGV ID="list" cssclass="CTable" runat="server" AutoGenerateColumns="False" Width="99%" EmptyDataText="没有任何的数据!" GridLines="None" OnRowDataBound="list_RowDataBound"  EnableTheming="True" AllowPaging="True" OnPageIndexChanging="list_PageIndexChanging" PageSize="20" AllowSorting="True"  OnSorting="list_Sorting" OnRowCreated="list_RowCreated">
        <Columns>
            <asp:TemplateField HeaderText="排名">
                <itemstyle horizontalalign="Center" width="50px" />
                <itemtemplate>
                   <%#Container.DataItemIndex+1 %>
                </itemtemplate>
            </asp:TemplateField>
             <asp:TemplateField HeaderText="课程ID">
                <itemstyle horizontalalign="Center" width="80px" />
                <itemtemplate>
                   <%#Eval("courseid")%>
                </itemtemplate>
            </asp:TemplateField>
             <asp:TemplateField HeaderText="课程名">
                <itemtemplate>
                    <a href="<%#Eval("cosurl") %>" target="_blank"><%# Eval("name") %></a>
                </itemtemplate>
            </asp:TemplateField>
             <asp:TemplateField HeaderText="浏览数" SortExpression="lookcount">
                <itemstyle horizontalalign="Center" width="15%" />
                <itemtemplate>
                    <%#Eval("lookcount") %>
                </itemtemplate>
            </asp:TemplateField>  
             <asp:TemplateField HeaderText="点赞数" SortExpression="zancount">
                <itemstyle horizontalalign="Center" width="15%" />
                <itemtemplate>
                    <a href='javascript:;' onclick="viewlist('<%#Eval("courseid")%>','0','<%#Eval("costype")%>')" class="greenFont"><%# Eval("zancount") %></a>
                </itemtemplate>
            </asp:TemplateField>  

            <asp:TemplateField HeaderText="收藏数" SortExpression="collectioncount">
                <itemstyle horizontalalign="Center" width="15%" />
                <itemtemplate>
                    <a href='javascript:;' onclick="viewlist('<%#Eval("courseid")%>','1','<%#Eval("costype")%>')" class="greenFont"><%# Eval("collectioncount") %></a>
                </itemtemplate>
            </asp:TemplateField>                     
        </Columns>
        <HeaderStyle CssClass="CTitle" />
        <EmptyDataRowStyle CssClass="emptycss" />
         
    </KS:KSGV>

         <KS:Page ID="Page1" runat="server" />
     </div>
     </asp:Panel>
      <asp:Panel ID="panelview" runat="server" Width="100%">
         <script>
             function GetMyIds() {
                 var sid = null;
                 for (var i = 0; i < document.getElementsByName("ids").length; i++) {
                     var KS = document.getElementsByName("ids")[i];
                     if (KS.checked == true) {
                         if (sid == null)
                             sid = KS.value;
                         else
                             sid += "," + KS.value;
                     }
                 }
                 return sid;
             }
            
         </script>
    <KS:KSGV ID="list1" cssclass="CTable" runat="server" AutoGenerateColumns="False" Width="99%" EmptyDataText="没有任何的记录!" GridLines="None" OnRowDataBound="list1_RowDataBound"   AllowPaging="True" OnPageIndexChanging="list1_PageIndexChanging" PageSize="5" >
        <Columns>
            <asp:TemplateField HeaderText="选择">
                <itemstyle horizontalalign="Center" width="50px" />
                <itemtemplate>
                    <input type="checkbox"  name="ids" id="ids" value="<%#Eval("ID") %>" />
                </itemtemplate>
              </asp:TemplateField>
            <asp:TemplateField HeaderText="排名">
                <itemstyle horizontalalign="Center" width="50px" />
                <itemtemplate>
                   <%#Container.DataItemIndex+1 %>
                </itemtemplate>
            </asp:TemplateField>
             <asp:TemplateField HeaderText="用户名">
                <itemstyle horizontalalign="Center"  />
                <itemtemplate>
                   <%#Eval("UserName")%>
                </itemtemplate>
            </asp:TemplateField>
           
             <asp:TemplateField HeaderText="用户类型">
                <itemstyle horizontalalign="Center"  />
                <itemtemplate>
                  <%# Kesion.BLL.DataFactoryUser.Exists("KS_User","username='"+Eval("username")+"'")?"会员":"游客"%>
                </itemtemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="收藏时间">
                <itemstyle horizontalalign="Center"/>
                <itemtemplate>
                    <%# Eval("adddate") %>
                </itemtemplate>
            </asp:TemplateField>   
                            
        </Columns>
        <HeaderStyle CssClass="CTitle" />
        <EmptyDataRowStyle CssClass="emptycss" />
         
    </KS:KSGV>
          <br />
        <input type="checkbox" name="chkall" id="chkall" onclick="CheckAll(this.form);"/><label for="chkall">全部选中</label>
        
         <asp:Button ID="Button1" runat="server" Text="删除选中" OnClientClick="return(confirm('此操作不可逆，确认删除吗？'));" CssClass="button" OnClick="Button1_Click" />
         <asp:Button ID="Button2" runat="server" Text="全部删除" OnClientClick="return(confirm('此操作不可逆，确认删除吗？'));" CssClass="button" OnClick="Button2_Click" />
         <br /><br />
         
         </asp:Panel>

</asp:Content>
