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

<%@ Register Src="../UserCol/Progress.ascx" TagName="Progress" TagPrefix="uc1" %>
<%@ Import Namespace="MTCUN" %>
<%@ Register Src="../UserCol/ReportControl.ascx" TagName="ReportControl" TagPrefix="uc2" %>
<%@ Register Src="../UserCol/ReportServer.ascx" TagName="ReportServer" TagPrefix="uc3" %>
<!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/Blue/css.css" rel="stylesheet"
        type="text/css" />
    <script type="text/javascript">
        function __Control_Prints(id) {

            var KeyID = "";
            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) {
                        KeyID += "," + e.value;
                    }
                }
            }

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

            __Control_Print(id, KeyID);
        }

        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;
                }
            }
        }

    </script>
    <script type="text/javascript">
        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?geturl=" + location.href;
                document.formStudent.submit();
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div class="tool_ControlPanel">
            <table cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <input onclick="Checks(this)" type="checkbox">
                    </td>
                    <td>全选
                    </td>
                    <td class="ico_sms"></td>
                    <td>
                        <label class="lab_button">
                            <asp:HyperLink ID="hlkSMS" runat="server" NavigateUrl='<%#string.Format("javascript:Send();void(0);") %>'
                                Text="发短信" /></label>
                    </td>
                    <td>
                        <uc2:ReportControl ID="ReportControl1" runat="server" />
                    </td>
                    <td>筛选：
                    <asp:DropDownList ID="ddlOrderMode" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlOrderMode_SelectedIndexChanged">
                        <asp:ListItem Value="0">默认</asp:ListItem>
                        <asp:ListItem Value="1">显示全部</asp:ListItem>
                        <asp:ListItem Value="2">状态正常</asp:ListItem>
                        <asp:ListItem Value="3">状态异常</asp:ListItem>
                        <asp:ListItem Value="4">课时未完学员</asp:ListItem>
                        <asp:ListItem Value="5">课时上完学员</asp:ListItem>
                    </asp:DropDownList>
                    </td>
                    <td></td>
                    <td>

                        <asp:Button ID="btnAddStudent" runat="server" Text="增加学员"
                            OnClick="btnAddStudent_Click" Visible="false" />

                    </td>
                </tr>
            </table>
        </div>


        <table>
            <tr>
                <td style="padding-left: 2px">
                    <label class="lab_button striking_yellow" id="divToClass" runat="server">
                        <asp:Button ID="btnToClass" runat="server" Text="快捷转班" OnClick="btnToClass_Click" />
                    </label>
                </td>
            </tr>
        </table>

        <div style="clear: both">
        </div>
        <div class="divpanel">
            <asp:GridView ID="GridView1" runat="server" CssClass="gridview" AutoGenerateColumns="False"
                DataKeyNames="StuClassID" OnRowDataBound="GridView1_RowDataBound" EnableViewState="False">
                <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>
                            <%# ShowStudent(Eval("StudentName"), Eval("Byname"), Eval("Sex"), Eval("StudentType"), Eval("SignInID"), Eval("MobileTel"), Eval("SignInSMS"), Eval("FingerState"), Eval("FingerCode"), Eval("LastAppLoginTime"))%>
                        </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.GetStuClassType(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" QuantifiedType='<%#(QuantifiedType)Eval("QuantifiedType") %>' MaxNum='<%#Eval("Lessons") %>' MinNum='<%#Eval("CourseProgress") %>'
                                StartDate='<%#Eval("DateAndTime") %>' ExpiryDate='<%#Eval("ExpiryDate") %>' 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>
                            <div class="lab_button_sub" id="divDelete" runat="server">
                                <asp:HyperLink runat="server" ID="hlkOpinion" Text="评价" NavigateUrl='<%# string.Format("../Affairs/PostOpinion.aspx?StuClassID={0}&GetURL={1}",Eval("StuClassID"),swq.Web.PathAndQuery()) %>'></asp:HyperLink>
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="回访">
                        <ItemTemplate>

                            <span style="color: red">
                                <%#Eval("ReCount")%>
                            </span>
                            次
                            <div class="lab_button_sub" id="divDelete" runat="server">
                                <a href='../Affairs/StuReply.aspx?StudentID=<%#Eval("StudentID")%>&GetURL=<% = swq.Web.PathAndQuery() %>'>回访</a>
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="控制面板">
                        <ItemTemplate>
                            <div class="lab_button_sub" id="divDelete" runat="server">
                                <asp:HyperLink ID="hlkStudent" NavigateUrl='<%# string.Format("../Affairs/StuControlPanel.aspx?StudentID={0}&pageIndex=4&GetURL={1}",Eval("StudentID"),swq.Web.PathAndQuery()) %>'
                                    Text="控制面板" runat="server">
                                </asp:HyperLink>
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
        <div class="divpanel">
            <asp:Literal ID="litPagerButton" runat="server"></asp:Literal>
            <uc3:ReportServer ID="ReportServer1" runat="server" />
        </div>
        <div class="backpanel">
            <label class="lab_button" id="__mt_labBack" runat="server">
                <input id="Button1" causesvalidation="false" type="button" runat="server" onclick="back(this)"
                    value="返回" />
            </label>
        </div>
    </form>
    <!--短信Post传递参数代码S-->
    <form id="formStudent" name="formStudent" method="post">
        <input id="StuClassID" name="StuClassID" type="hidden" value="" />
    </form>
    <!--短信Post传递参数代码E-->
</body>
</html>
