<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Admin/MasterPage.master" Inherits="Kesion.NET.WebSite.Course.Admin.Course.KS_CsLearnSchedule" Codebehind="KS.CosLearnRecord.aspx.cs" %>
<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Kesion.Course" %>
<%@ Import Namespace="Kesion.BLL" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" runat="Server">
    <script>
		function showDetail(uid,cid) {
			parent.openWin('学员课程完成情况', 'Course/KS.CosLearnRecordDetail.aspx?userid='+uid+'&courseid='+cid, 900,1120);
		}
		function savestatus(i) {
			if (i == 0) { $("#showstatus").html("<span style='color:blue' onclick=\"savestatus(1)\">已审核</span>"); $("#status").val(1); };
			if (i == 1) { $("#showstatus").html("<span style='color:red' onclick=\"savestatus(0)\">未审核</span>"); $("#status").val(0); };
		}
    </script>
    
        <asp:Panel ID="ListPanel" runat="server" Width="100%">
            <%if (istop == 0)
              { %>
            <div class="listedit">
                <ul>
                    <a href="javascript:;" onclick="location.href='KS.CosList.aspx';" class="button">返回课程列表</a>
                    <a href="?action=exportexcel&<%=UtilsQueryParam.Get("action") %>" class="button">导出Excel</a>
                    <asp:LinkButton ID="delclassbutton" runat="server" OnClick="delclassbutton_Click" OnClientClick="return(GetIDS('del'));" CssClass="button">清空进度</asp:LinkButton>
                </ul>
            </div>
            
			
            <!--当前课程信息-->
            <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
            <div class="content-area">
                <div class="tabs_header">
                    
                    <div class="tabButton">
                        <%if (Course.GetIsPeriod(CourseId) == 1)
                          { %>
                        <%if (CosType == 1)
                          { %>
                        <a class="noLeftBorder" href="KS.CosPeriod.Aspx?CourseId=<%=CourseId %>&teacherid=<%=teacherid%>">课时</a>
                        <%}
                          else if (CosType == 3)
                          {%>
    
                        <a class="noLeftBorder" href="KS.CosLivePeriod.Aspx?CourseId=<%=CourseId %>&teacherid=<%=teacherid%>">课时</a>
    
                        <% }%>
                        <%} %>
                        <a href="KS.CsTeacher.aspx?CosType=<%=CosType %>&teacherid=<%=teacherid%>&CourseId=<%=CourseId %>">教师</a>
                        <a href="KS.CsZLInfo.aspx?type=<%=CosType==2?"1":CosType==1?"0":"5"%>&CourseId=<%=CourseId %>&teacherid=<%=teacherid%>">资料</a>
                        <%if (CosType == 1)
                          { %>
                        <a href="KS.CosExamlist.aspx?CourseId=<%=CourseId %>&teacherid=<%=teacherid%>">试卷</a>
                        <% }%>
                        <%if (CosType == 1 || CosType == 3)
                          { %>
                        <a class="on" href="KS.CosLearnRecord.aspx?CosType=<%=CosType %>&courseid=<%=CourseId %>&teacherid=<%=teacherid%>">学员</a>
                        <% }%>
                        <a href="KS.CosPJ.aspx?CosType=<%=CosType %>&courseid=<%=CourseId %>&teacherid=<%=teacherid%>">评价</a>
    
                    </div>
                    <ul class="tabs">
                        <li <%=KSCMS.S("Type")==""?" class='active'":KSCMS.S("Type")=="0"?" class='active'":"" %>><a href="?Type=0&courseid=<%=CourseId %>&CosType=<%=CosType %>&teacherid=<%=teacherid%>"><span>所有列表</span></a></li>
                        <li <%=KSCMS.S("Type")=="1"?" class='active'":string.Empty %>><a href="?Type=1&courseid=<%=CourseId %>&CosType=<%=CosType %>&teacherid=<%=teacherid%>"><span>已学完</span></a></li>
                        <li <%=KSCMS.S("Type")=="2"?" class='active'":string.Empty %>><a href="?Type=2&courseid=<%=CourseId %>&CosType=<%=CosType %>&teacherid=<%=teacherid%>"><span>未学完</span></a></li>
    
                    </ul>
                </div>
                <div class="quickSearch clearfix">
                    <div class="fr grayFont Lheight36">
                        <asp:Label ID="LabNav" Visible="false" runat="server"></asp:Label>
                        <span class="ml20">总课时：<asp:Label ID="totalperiod" runat="server" Text="0"></asp:Label></span>
                        <span class="ml20">购买人数：<asp:Label ID="totallearn" runat="server" Text="0"></asp:Label></span>
                        <span class="ml20">观看人数：<asp:Label ID="totalview" runat="server" Text="0"></asp:Label></span>
                        <span class="ml20">完成课时学习数：<asp:Label ID="totalfinish" runat="server" Text="0"></asp:Label></span>
                    </div>
                    <div class="SearchBox fl">
                        学员名称：<input type="text" name="keyword" id="keyword" class="search" />
                        <input type="hidden" name="courseid" value="<%=CourseId %>" class="search" />
                        <input type="button" value="开始搜索" class="button" id="btnsearch" />
                    </div>
                </div>
                <%} %>
                <KS:KSGV ID="List" runat="server" AutoGenerateColumns="False" EmptyDataText="暂无学员进度信息" PagerType="CustomNumeric" Width="99%" CssClass="CTable" GridLines="None" OnRowDataBound="List_RowDataBound" OnRowCommand="List_RowCommand" OnRowCreated="List_RowCreated">
                    <Columns>
                        <asp:TemplateField HeaderText="&lt;input type='checkbox' name='chkall' id='chkall' onClick='CheckAll(this.form);'/&gt;">
                            <ItemStyle HorizontalAlign="Center" Width="30px" />
                            <ItemTemplate>
                                <input type="checkbox" name="ids" id="ids" value="<%#Eval("userid") %>" />
                            </ItemTemplate>
                        </asp:TemplateField>
    
                        <asp:TemplateField HeaderText="学员名称">
                            <ItemStyle Width="" HorizontalAlign="Center" />
                            <ItemTemplate>
                                <div class="textLeft size14"><%#Eval("username") %></div>
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="真实名称">
                            <ItemStyle Width="" HorizontalAlign="Center" />
                            <ItemTemplate>
                                <div class="textLeft size14"><%# UserManage.GetUserInfo( Eval("UserID").ToString()).RealName %></div>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="联系方式">
                            <ItemStyle Width="" HorizontalAlign="Center" />
                            <ItemTemplate>
                                <div class="textLeft size14"><%# UserManage.GetUserInfo( Eval("UserID").ToString()).Mobile %></div>
                            </ItemTemplate>
                        </asp:TemplateField>
    
                        <asp:TemplateField HeaderText="学习进度">
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <%# GetLearnProcess(Utils.StrToInt(Eval("UserID").ToString())) %>
                            </ItemTemplate>
                        </asp:TemplateField>
    
                        <asp:TemplateField HeaderText="完成日期">
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <span class="gray2"><%# GetFinishTime(Utils.StrToInt(Eval("userId"))) %></span>
                            </ItemTemplate>
                        </asp:TemplateField>
                       <asp:TemplateField HeaderText="IP地址">
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <span class="gray2"><%# Eval("LastLearnIP") %></span>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="学习设备">
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <span class="gray2"><%# Utils.OrderDeviceName(Utils.StrToInt(Eval("LastLearnDevice").ToString())) %></span>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="查看详情">
                            <ItemStyle Width="60" HorizontalAlign="Center" />
                            <ItemTemplate>
                               <input type="button" value="查看" onclick="showDetail(<%# Eval("userid")%>,<%#Eval("courseid")%>)" class="button">
                            </ItemTemplate>
                        </asp:TemplateField>
    
                        <asp:TemplateField HeaderText="清空">
                            <ItemStyle HorizontalAlign="Center" Width="50" />
                            <ItemTemplate>
                                <asp:LinkButton runat="server" CssClass="delete" ID="delet" CommandArgument='<%# Eval("userid") %>' CommandName="del">清空</asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
    
                    </Columns>
                    <HeaderStyle CssClass="CTitle" />
                    <EmptyDataRowStyle CssClass="emptycss" />
                </KS:KSGV>
                <script type="text/javascript">
					showtips('<span class="state"><strong>操作说明：</strong><br /></span>清空进度不是删除进度，只是把学员学过的课程标记清除<br /> ');
				</script>
                <KS:Page ID="Page1" runat="server" />
			</div>
            <script>
                $(function () {
                    //获取进度百分比
                    $(".schedule").each(function () {
                        var a = $(this).find(".linebg").text() / $(this).find("em").text() * 100;
                        $(this).find(".linebg").animate({ width: "" + a + "%" }, 300);
                    });
                });
            </script>
        </asp:Panel>
        <asp:Panel runat="server" ID="showPannel" Visible="false">
            <!--<KS:TopNav ID="top1" Text="查看评价详情" runat="server" />-->
            <div class="content-area">
                <div class="myTitle">查看评价详情</div>
                <KS:Foot ID="Foot1" runat="server" OnSubmit="Foot1_Submit" />
            </div>
        </asp:Panel>
    </div>
</asp:Content>


