<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ClassStudents.aspx.cs"
    Inherits="SWTraining.Class.ClassStudents" Title="教务管理-班级学员列表" %>

<%@ Register Src="../UserCol/Progress.ascx" TagName="Progress" TagPrefix="uc1" %>
<%@ Import Namespace="SWTraining" %>
<!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 runat="server">
    <title></title>
    <link id="linkStyle" runat="server" href="../Themes/Orange/css.css" rel="stylesheet"
        type="text/css" />

    <script type="text/javascript">
        function Print(ClassID, templet) {
            document.frames.PrintWeb.location = "../Report/Print.aspx?DocType=3&ClassID=" + ClassID + "&Templet=" + templet;
        }

        function Prints() {
            var StuClassID = "";
            for (var i = 0; i < document.forms[0].elements.length; i++) {
                var e = document.forms[0].elements[i];
                if (e.type == "checkbox" && e.id == "id") {
                    if (e.checked) {
                        StuClassID += "," + e.value;
                    }
                }
            }

            if (StuClassID.length > 0) {
                StuClassID = StuClassID.substring(1, StuClassID.length);

                if (document.forms[0].inCourseCard.checked) {
                    document.frames.PrintWeb.location = "../Report/Print.aspx?DocType=3&StuClassID=" + StuClassID + "&Templet=sys_CourseCard.xsl";
                }

                if (document.forms[0].inScore.checked) {
                    document.frames.PrintWeb.location = "../Report/Print.aspx?DocType=3&StuClassID=" + StuClassID + "&Templet=sys_StudentScore.xsl";
                }
            }
        }

        function Checks(checkbox) {
            for (var i = 0; i < document.forms[0].elements.length; i++) {
                var e = document.forms[0].elements[i];
                if (e.type == "checkbox" && e.id == "id") {
                    e.checked = checkbox.checked;
                }
            }
        }


        function Send() {
            var StuClassID = "";
            for (var i = 0; i < document.forms[0].elements.length; i++) {
                var e = document.forms[0].elements[i];
                if (e.type == "checkbox" && e.id == "id") {
                    if (e.checked) {
                        StuClassID += "," + e.value;
                    }
                }
            }

            if (StuClassID.length > 0) {
                StuClassID = StuClassID.substring(1, StuClassID.length);
                document.getElementById("StuClassID").value = StuClassID;
                document.formStudent.action = "../SMS/SendToStudent.aspx";
                document.formStudent.submit();
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div class="divpanel" style="text-align: left">
        <div style="float: left">
            <fieldset style="width: auto; padding-bottom: 5px">
                <legend style="font-size: 10px">控制面板</legend>
                <ul class="grouptools">
                    <li style="float: left">
                        <input onclick="Checks(this)" type="checkbox">
                    </li>
                    <li style="float: left">全选 </li>
                    <li style="float: left" class="ico_sms"></li>
                    <li style="float: left">
                        <asp:HyperLink ID="hlkSMS" runat="server" NavigateUrl='<%#string.Format("javascript:Send();void(0);") %>'
                            Text="发短信" /></li>
                    <li style="float: left">
                        <input id="inCourseCard" name="group" type="radio" checked="checked" />听课证</li>
                    <li style="float: left">
                        <input id="inScore" name="group" type="radio" />成绩单</li>
                    <li style="float: left">
                        <asp:HyperLink ID="hlkPrint" runat="server" NavigateUrl='<%#string.Format("javascript:Prints();void(0);") %>'
                            ImageUrl='<%# accTheme("print.gif")%>'></asp:HyperLink></li>
                    <li style="float: left">
                        <asp:CheckBox ID="cbxAll" runat="server" Text="显示全部学员(包含转班等学员)" AutoPostBack="True"
                            OnCheckedChanged="cbxAll_CheckedChanged" /></li>
                </ul>
            </fieldset>
        </div>
        <div style="clear: both">
        </div>
    </div>
    <div class="divpanel">
        <asp:GridView ID="GridView1" runat="server" CssClass="gridview" AutoGenerateColumns="False"
            DataKeyNames="StuClassID" OnRowDataBound="GridView1_RowDataBound">
            <Columns>
                <asp:TemplateField HeaderText="学号" ItemStyle-Width="120">
                    <ItemTemplate>
                        <input type="checkbox" id="id" value='<%#Eval("StuClassID")%>' />
                        <%#Eval("StudentID")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="姓名">
                    <ItemTemplate>
                        <asp:HyperLink ID="hlkStudentName" Text='<%#Eval("StudentName")%>' runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="选班状态">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="ScStateID" Text='<%# Rs.Items.GetScState(Eval("ScStateID")) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="续报">
                    <ItemTemplate>
                        <%#Rs.Items.GetYN(Eval("ContinueReg"))%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="选班日期">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="labDateAndTime" Text='<%# Eval("DateAndTime") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="课时进度">
                    <ItemTemplate>
                        <uc1:Progress ID="Progress1" runat="server" MaxNum='<%#Eval("Lessons") %>' MinNum='<%#Eval("CourseProgress") %>'
                            Width="90%" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="成绩">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="labScore" Text='<%#Eval("Score")%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="评价">
                    <ItemTemplate>
                        <asp:HyperLink runat="server" ID="hlkOpinion" Text="评价" NavigateUrl='<%# string.Format("../Affairs/PostOpinion.aspx?StuClassID={0}&GetURL={1}",Eval("StuClassID"),swq.Web.PathAndQuery()) %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="控制面板">
                    <ItemTemplate>
                        <asp:HyperLink ID="hlkStudent" NavigateUrl='<%# string.Format("../Affairs/StudentFrame.aspx?StudentID={0}&pageIndex=4&GetURL={1}",Eval("StudentID"),swq.Web.PathAndQuery()) %>'
                            Text="控制面板" runat="server">
                        </asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    <div class="divpanel">
        <asp:Literal ID="litPagerButton" runat="server"></asp:Literal>
    </div>
    <div class="backpanel">
        <input id="Button1" causesvalidation="false" type="button" runat="server" onclick="back()"
            value="返回" />
    </div>
    </form>
    <iframe id="PrintWeb" width="0" height="0"></iframe>
    <form id="formStudent" name="formStudent" method="post">
    <input id="StuClassID" name="StuClassID" type="hidden" value="" />
    </form>
</body>
</html>
