<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Attend.aspx.cs" Inherits="MTCUN.Mobile.Class.Attend"
    Title="上课点名-教务" %>

<%@ Register Src="../../UserCol/Progress.ascx" TagName="Progress" TagPrefix="uc1" %>
<%@ Import Namespace="MTCUN" %>
<%@ Register Src="../User_Col/col_Header.ascx" TagName="col_Header" TagPrefix="uc2" %>
<%@ Register Src="../User_Col/col_ClassControlPanel.ascx" TagName="col_ClassControlPanel" TagPrefix="uc3" %>
<%@ Register Src="../../UserCol/ReportServer.ascx" TagName="ReportServer" TagPrefix="uc4" %>
<!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 id="Head1" runat="server">
    <link id="mobileCss" runat="server" href="../themes/mobile.css" rel="stylesheet"
        type="text/css" />
    <script type="text/javascript">
        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(lid) {
            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/SendHighToStudent.aspx?app=true&action=attend&LessonDegreeID=" + lid;
                document.formStudent.submit();
            }
        }
    </script>

    <script type="text/javascript">
        function OpenClass() {
            if (setContent2.style.display == 'none') {
                setContent2.style.display = 'block';
                setControl2.innerHTML = '▲课题与作业';
                __mt__setClassCookie(1);
            }
            else {
                setContent2.style.display = 'none';
                setControl2.innerHTML = '▼课题与作业';
                __mt__setClassCookie(0);
            }
        }

        function defaultClassState() {
            var num = __mt__getClassCookie();
            if (num == 1) {
                setContent2.style.display = 'block';
                setControl2.innerHTML = '▲课题与作业';
            }
            else {
                setContent2.style.display = 'none';
                setControl2.innerHTML = '▼课题与作业';
            }
        }
    </script>
</head>
<body onload="defaultClassState()">
    <form id="form1" runat="server">
        <uc2:col_Header ID="col_Header1" runat="server" />
        <uc4:ReportServer ID="ReportServer1" runat="server" />

        <div id="web_page_contents">

            <div class="biao_zhun_suo_jin">
                <uc3:col_ClassControlPanel ID="col_ClassControlPanel1" runat="server" />

                <div class="dianmingcol" style="margin-bottom: 5px">
                    <ul class="dianmingtool">
                        <li>
                            <div id="setControl2" onclick="OpenClass()">
                                ▼课题与作业
                            </div>
                        </li>
                    </ul>
                    <div id="setContent2" style="display: none">
                        <div class="kuai_show1">
                            <h1 style="text-align: center">上课主题</h1>
                            <table cellpadding="5" cellspacing="0" class="table_simple_kuan">
                                <tr>
                                    <td style="width: 76px">上课日期：
                                    </td>
                                    <td>
                                        <asp:Label ID="labDateAndTime" runat="server"></asp:Label>
                                        <asp:Label ID="labLessonType" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>本课课题：
                                    </td>
                                    <td>
                                        <asp:TextBox ID="tbxSubject" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>家庭作业：
                                    </td>
                                    <td>
                                        <div id="msg" style="color: #676767">
                                        </div>
                                        <asp:TextBox ID="tbxCourseRemark" runat="server" Height="48px" TextMode="MultiLine"></asp:TextBox>
                                        <br />
                                        <label class="lab_button_kuan">
                                            <asp:Button ID="btnSave" runat="server" Text="更新" OnClick="btnSave_Click" />
                                        </label>
                                    </td>
                                </tr>
                            </table>

                        </div>
                    </div>
                </div>

                <div class="kuai_show">
                    <h1 style="text-align: center">考勤控制</h1>
                    <table cellpadding="0" cellspacing="0" class="table_simple_kuan">
                        <tr>
                            <td style="width: 76px">选择学员：</td>
                            <td>
                                <div class="striking">
                                    <asp:CheckBoxList ID="cblStudents" runat="server" CssClass="font16" RepeatColumns="2" RepeatDirection="Horizontal">
                                    </asp:CheckBoxList>



                                    <table class="table_simple_kuan gbtn_width">
                                        <tr>
                                            <td>
                                                <label class="lab_button">
                                                    <asp:CheckBox ID="cbxShowAll" runat="server" Text="显示全部" AutoPostBack="True" OnCheckedChanged="cbxShowAll_CheckedChanged" />
                                                </label>
                                            </td>
                                            <td>
                                                <label class="lab_button">
                                                    <asp:CheckBox ID="cbxAll" runat="server" Text="全选" AutoPostBack="True" OnCheckedChanged="cbxAll_CheckedChanged" />
                                                </label>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>考勤类型：</td>
                            <td>

                                <div class="striking">

                                    <asp:RadioButtonList ID="rblAtStateID" runat="server" RepeatDirection="Horizontal">
                                        <asp:ListItem Value="1" Text="正常" Selected="True"></asp:ListItem>
                                        <asp:ListItem Value="2" Text="迟到"></asp:ListItem>
                                        <%--<asp:ListItem Value="3" Text="早退"></asp:ListItem>--%>
                                        <asp:ListItem Value="4" Text="旷课"></asp:ListItem>
                                        <asp:ListItem Value="5" Text="请假"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>备注：
                            </td>
                            <td>
                                <asp:TextBox ID="tbxRemark" runat="server" CssClass="width50"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>
                                <label class="lab_button_kuan">
                                    <asp:Button
                                        ID="btnExe" runat="server" Text="执行考勤" OnClick="btnExe_Click" /></label>
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </div>

                <div class="main">
                    <asp:Repeater ID="repBlock" runat="server" OnItemCommand="repBlock_ItemCommand"
                        OnItemDataBound="repBlock_ItemDataBound">
                        <ItemTemplate>

                            <asp:Panel ID="plItem" runat="server" CssClass="kuai">

                                <h1 class="auto_length_title">
                                    <input type="checkbox" id="id" value='<%#Eval("StuClassID")%>' />
                                    <%#Eval("StudentName")%></h1>

                                <table class="table" cellspacing="0" border="0" style="table-layout: fixed; word-break: break-all; word-wrap: break-word">
                                    <tr>
                                        <td style="width: 80px">学号：</td>
                                        <td style="width: auto"><%#Eval("StudentID")%></td>
                                    </tr>
                                    <tr>
                                        <td style="width: auto">选班状态：</td>
                                        <td style="width: auto">
                                            <%# Rs.Items.GetScState(Eval("ScStateID")) %></td>
                                    </tr>
                                    <tr>
                                        <td style="width: auto">课时：</td>
                                        <td style="width: auto">
                                            <%#Eval("CurrentLessons") %>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: auto">出勤状态：</td>
                                        <td style="width: auto">
                                            <%# Rs.Items.GetAtState2(Eval("AtStateID"))%></td>
                                    </tr>
                                    <tr>
                                        <td style="width: auto">签到时间：</td>
                                        <td style="width: auto">
                                            <%#Eval("SignOn","{0:HH:mm}")%></td>
                                    </tr>
                                    <tr>
                                        <td style="width: auto">签退时间：</td>
                                        <td style="width: auto">
                                            <%#Eval("SignOut","{0:HH:mm}")%></td>
                                    </tr>
                                    <tr>
                                        <td style="width: auto">课堂表现：</td>
                                        <td style="width: auto">
                                            <%#Eval("Remark")%></td>
                                    </tr>
                                    <tr>
                                        <td>课时进度：</td>
                                        <td>
                                            <uc1:Progress ID="Progress1" runat="server" MaxNum='<%#Eval("Lessons") %>' MinNum='<%#Eval("CourseProgress") %>' StartDate='<%#Eval("DateAndTime") %>' ExpiryDate='<%#Eval("ExpiryDate") %>'
                                                ProgressParentWidth="60%" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="height: 25px">打印：</td>
                                        <td>
                                            <asp:HyperLink ID="hlkPrint" runat="server" NavigateUrl='<%#string.Format("javascript:Print({0});void(0);",Eval("AttendID")) %>'
                                                ImageUrl='<%# accTheme("print.gif")%>' CssClass="noborder"></asp:HyperLink>
                                            <%--<span class="inline_block">次数：<%# (int)Eval("PrintCount")%></span>--%> 

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

                                <table style="width: 100%;" cellpadding="0" cellspacing="2">
                                    <tr>
                                        <td>
                                            <div class="lab_button" id="divDelete" runat="server">
                                                <asp:LinkButton ID="lbnDelete" runat="server" Text="删除" CommandName="Delete" CommandArgument='<%#Eval("AttendID")%>'
                                                    OnClientClick="<%# Rs.Messages.确定删除%>"></asp:LinkButton>
                                            </div>
                                        </td>
                                        <td>
                                            <div class="lab_button" id="divEdit" runat="server">
                                                <asp:LinkButton runat="server" ID="lbnEdit" CommandArgument='<%# Eval("AttendID")%>'
                                                    CommandName="Edit" Text="编辑"></asp:LinkButton>
                                            </div>
                                        </td>
                                    </tr>
                                </table>


                            </asp:Panel>
                            <asp:Panel ID="plEdit" runat="server" CssClass="kuai edit_kuai">
                                <h1 class="auto_length_title">学号：                                   
                                <%#Eval("StudentID")%></h1>

                                <table class="table" cellspacing="0" border="0" style="table-layout: fixed; word-break: break-all; word-wrap: break-word">
                                    <tr>
                                        <td style="width: 80px">姓名：</td>
                                        <td style="width: auto"><%#Eval("StudentName")%></td>
                                    </tr>
                                    <tr>
                                        <td style="width: auto">选班状态：</td>
                                        <td style="width: auto">
                                            <%# Rs.Items.GetScState(Eval("ScStateID")) %></td>
                                    </tr>
                                    <tr>
                                        <td style="width: auto">课时：</td>
                                        <td style="width: auto">
                                            <asp:DropDownList ID="ddlLessons" runat="server">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: auto">出勤状态：</td>
                                        <td style="width: auto">
                                            <asp:DropDownList ID="ddlAtStateID" runat="server">
                                                <asp:ListItem Value="1" Text="正常"></asp:ListItem>
                                                <asp:ListItem Value="2" Text="迟到"></asp:ListItem>
                                                <asp:ListItem Value="3" Text="早退"></asp:ListItem>
                                                <asp:ListItem Value="4" Text="旷课"></asp:ListItem>
                                                <asp:ListItem Value="5" Text="请假"></asp:ListItem>
                                            </asp:DropDownList></td>
                                    </tr>
                                    <tr>
                                        <td style="width: auto">签到时间：</td>
                                        <td style="width: auto">
                                            <%#Eval("SignOn","{0:HH:mm}")%></td>
                                    </tr>
                                    <tr>
                                        <td style="width: auto">签退时间：</td>
                                        <td style="width: auto">
                                            <%#Eval("SignOut","{0:HH:mm}")%></td>
                                    </tr>
                                    <tr>
                                        <td style="width: auto">课堂表现：</td>
                                        <td style="width: auto">
                                            <asp:TextBox ID="tbxRemark" Text='<%#Eval("Remark")%>' runat="server" TextMode="SingleLine"
                                                Rows="2" Columns="30"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td>课时进度：</td>
                                        <td>
                                            <uc1:Progress ID="Progress2" runat="server" MaxNum='<%#Eval("Lessons") %>' MinNum='<%#Eval("CourseProgress") %>' StartDate='<%#Eval("DateAndTime") %>' ExpiryDate='<%#Eval("ExpiryDate") %>'
                                                ProgressParentWidth="60%" />
                                        </td>
                                    </tr>
                                </table>

                                <table style="width: 100%;" cellpadding="0" cellspacing="2">
                                    <tr>
                                        <td>
                                            <div class="lab_button">
                                                <asp:LinkButton runat="server" ID="lbnUpdate" CommandArgument='<%# Eval("AttendID")%>'
                                                    CommandName="Update" Text="更新"></asp:LinkButton>
                                            </div>
                                        </td>
                                        <td>
                                            <div class="lab_button">
                                                <asp:LinkButton runat="server" ID="lbnCancel" CommandArgument='<%# Eval("AttendID")%>'
                                                    CommandName="Cancel" Text="取消"></asp:LinkButton>
                                            </div>
                                        </td>
                                    </tr>
                                </table>

                            </asp:Panel>

                        </ItemTemplate>
                    </asp:Repeater>
                </div>

                <div class=" striking">
                    <table cellpadding="0" cellspacing="2">
                        <tr>
                            <td>
                                <input onclick="Checks(this)" type="checkbox">
                            </td>
                            <td>全选
                            </td>
                            <td></td>
                            <td class="orangebutton" onmouseover="__mt_NavMouseover(this,'orangebutton')" onmouseout="__mt_NavMouseout(this,'orangebutton')">
                                <asp:HyperLink ID="hlkSMS" runat="server" NavigateUrl='<%#string.Format("javascript:Send("+Request["LessonDegreeID"]+");void(0);") %>'
                                    Text="发消息" />
                            </td>
                        </tr>
                    </table>
                </div>

                <div class="pager_button">
                    <asp:Literal ID="litPagerButton" runat="server"></asp:Literal>
                </div>

                <div class="backpanel">
                    <label class="lab_button_kuan" id="__mt_labBack" runat="server">
                        <input id="Button1" causesvalidation="false" type="button" runat="server" onclick="back(this)"
                            value="返回" />
                    </label>
                    <label class="lab_button_kuan">
                        <input id="btnTop" causesvalidation="false" type="button" onclick="window.location='LessonDegree.aspx?ClassID=<%=Request.QueryString["ClassID"] %>    '"
                            value="返回列表" />
                    </label>
                </div>
                <%--                <div class="divremark">
                    <b>注意事项：</b><br />
                    1、选班日期在上课日期之后的学员不会出现在名单簿上。<br />
                    2、考勤方法：先选中左边学员（可多选）,然后选择考勤类型，点击“执行考勤”即可。<br />
                    3、选择显示全部，将出现课时已上完的学员姓名及选班日期在本次上课日期之后的学员。<br />
                    4、当勾选“显示全部”，学员名单簿姓名后面的数字表示剩余课时，负数表示已上超的课时数。<br />
                </div>--%>
            </div>
        </div>

    </form>
    <!--短信Post传递参数代码S-->
    <div class="printWeb">
        <form id="formStudent" name="formStudent" method="post">
            <input id="StuClassID" name="StuClassID" type="hidden" value="" />
        </form>
    </div>
    <!--短信Post传递参数代码E-->
</body>
</html>
