<%@ page title="" language="C#" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" autoeventwireup="true" inherits="Pages_Assessment_MarkEntry, App_Web_jhtb3opx" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Src="~/UserControls/GridViewPager/GridViewPager.ascx" TagName="GridViewPager"
    TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl"
    TagPrefix="ScreenGroup" %>
<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DatePickerControl"
    TagPrefix="Date" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <style type="text/css">
        input:disabled + input[type=image], input:read-only + a {
            pointer-events: visible;
            cursor: pointer !important;
        }
    </style>
    <asp:UpdatePanel ID="OTQueueListingUpdatePanel" runat="server">
        <ContentTemplate>
            <div id="divContentPage" class="divcontentpagemargin">
                <!-- ContentPlaceHolder Box Starts -->

                <div class="dashBoardLeftCont">
                    <div class="himssuHeader3WireBox">

                        <table>
                            <tr>
                                <td>
                                    <div class="himsBoxContent">
                                        <div class="leftUlMenu">
                                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="105"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <div class="himssuHeader1WireBox card card-box">
                        <div class="himsBoxHeader card-head">
                            <div class="leftdiv">
                            </div>
                            <div class="himsBoxTitle">
                                <div class="headerText">
                                    <header>
                                        <i class="fas fa-edit"></i>
                                        <asp:Label ID="Label1" runat="server" Text="Mark Entry"></asp:Label>
                                    </header>
                                </div>
                            </div>
                        </div>
                        <div class="himsBoxContent card-body">
                            <asp:Panel ID="DetailPanel" runat="Server">
                                <div class="contentHolder">
                                        
                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="DepartmentLabel" runat="server" Text="Department" SkinID="MandatoryLabel"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:DropDownList runat="server" ID="DepartmentDropDownList" SkinID="CustomWidthDropDownList"
                                                AutoPostBack="true" onmouseleave="showHideTooltip()" CssClass="form-control" onmouseenter="showHideTooltip()"
                                                OnSelectedIndexChanged="DepartmentDropDownList_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </div>
                                    </div>

                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="ClassLabel" Text="Class" runat="server" SkinID="MandatoryLabel"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:DropDownList runat="server" ID="ClassDropDownList" SkinID="CustomWidthDropDownList"
                                                CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                AutoPostBack="true" OnSelectedIndexChanged="ClassDropDownList_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </div>
                                    </div>
                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="DivisionLabel" Text="Division" runat="server" SkinID="MandatoryLabel"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:DropDownList runat="server" ID="DivisionDropDownList" SkinID="CustomWidthDropDownList"
                                                CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                AutoPostBack="True" OnSelectedIndexChanged="DivisionDropDownList_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </div>
                                    </div>

                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="ExamGroupLabel" Text="Exam Group" runat="server"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:DropDownList runat="server" ID="ExamGroupDropDownList" SkinID="CustomWidthDropDownList"
                                                CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                AutoPostBack="True" OnSelectedIndexChanged="ExamGroupDropDownList_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </div>
                                    </div>

                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="ExamLabel" Text="Exam" runat="server" SkinID="MandatoryLabel"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:DropDownList runat="server" ID="ExamDropDownList" SkinID="CustomWidthDropDownList"
                                                CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                AutoPostBack="True" OnSelectedIndexChanged="ExamDropDownList_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </div>
                                    </div>

                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="SubjectLabel" Text="Subject" runat="server" SkinID="MandatoryLabel"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:DropDownList runat="server" ID="SubjectDropDownList" SkinID="CustomWidthDropDownList"
                                                CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                AutoPostBack="True" OnSelectedIndexChanged="SubjectDropDownList_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </div>
                                    </div>

                                    <div class="outerBox pTop15 col-md-3" runat="server" id="MarkEntrySingleSubjectAttendanceDiv">
                                        <div class="controlLabelWidth">
                                            <asp:CheckBox ID="IsPresentSkipCheckBox" runat="server" Text="Present Skip" OnCheckedChanged="IsPresentSkipCheckBox_CheckedChanged" AutoPostBack="true" />
                                            <%--       <asp:Label ID="IsPresentSkipLabel" runat="server" Text="Present Skip" class="pLeft5"></asp:Label>--%>
                                        </div>
                                    </div>

                                    <div class="outerBox pTop15 col-md-3">
                                        <asp:CheckBox ID="ShowWithPhotoCheckBox" runat="server" Text="Show With Photo" AutoPostBack="true" class="pLeft5" OnCheckedChanged="ShowWithPhotoCheckBox_CheckedChanged" />
                                        <%--      <asp:Label ID="ShowWithPhotoLabel" runat="server" Text="Show With Photo"></asp:Label>--%>
                                    </div>
                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="AttendanceDateLabel" runat="server" Text="Attendance Date" SkinID="MandatoryLabel"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <Date:DatePickerControl DisplayDatePicker="true" ID="AttendanceDatePickerControl" runat="server" />
                                        </div>
                                    </div>
                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="AttendanceTypeLabel" runat="server" Text="Attendance Type" SkinID="MandatoryLabel"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:DropDownList runat="server" ID="AttendanceTypeDropDownList" SkinID="CustomWidthDropDownList"
                                                CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                            </asp:DropDownList>
                                        </div>
                                    </div>
                                    <div class="outerBox pTop5 col-md-3" runat="server" id="MarkEntrySingleSubjectAttendanceButton">
                                        <asp:Button ID="AutoAssignAbsentButton" Text="Auto Assign Absent" runat="Server" OnClick="AutoAssignAbsentButton_Click" SkinID="0" CssClass="fas btn btn-assign " />
                                     </div>
                                    <div id="info" class="outerBox col-md-12" runat="server" visible="false">
                                        <div class="alert alert-info">
                                            <i class="material-icons">info</i>
                                            <asp:Label ID="Label3" runat="server"></asp:Label>
                                        </div>
                                    </div>
                                    <div class="text-center col-md-12 pTop5">
                                        <asp:Button ID="ExportButton" runat="server" Text="&#xf093; Export" OnClick="ExportButton_Click" CssClass="fas btn btn-examcommon" SkinID="0" />
                                        <a href="javascript:;" onclick="OpenFileUpload();" class="btn btn-browser">
                                                    <i class="fas fa-arrow-down"></i>Browse</a>
                                                <asp:FileUpload ID="flUpload" runat="server" onChange="readURL(this);" ClientIDMode="Static" Style="display: none;" />

                                        <asp:Button ID="ImportFromExcelButton" runat="server" Text="&#xf019; Import From Excel"
                                            SkinID="0" CssClass="fas btn btn-examcommon" OnClick="ImportFromExcelButton_Click" />
                                        <asp:Label ID="UploadMessage" Text="" runat="server" Font-Bold="true" />
                                    </div>
                                    <div>
                                        <asp:HiddenField ID="DetailHiddenField" runat="server" />
                                        <asp:HiddenField ID="MarkInDecimalHiddenField" runat="server" />
                                        <asp:HiddenField ID="IsMarkNegativeHiddenField" runat="server" />
                                    </div>

                                    <div id="Div1" class="himssuHeader6WireBox col-md-12 pTop15" runat="server" visible="true" style="width: 100%; height: 100%" >
                                        <div class="himsBoxHeader" id="GridViewPagerDiv" runat="server" visible="True">
                                            <div class="leftdiv">
                                            </div>
                                            <div class="himsBoxTitle">
                                                <div class="headerText">
                                                    <header>
                                                        <asp:Label ID="ExamTopicLabel" Text="" runat="server" Font-Bold="true" />
                                                    </header>
                                                    <%--<header>
                                                        <asp:Label ID="GridViewLabel" Text="Student List For Mark Entry" runat="server" />
                                                    </header>--%>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="himsBoxContent width-100">
                                            <%-- <div id="DivHeader" style="vertical-align: top; width: 100%;">
                                                            <asp:Table ID="ExamDetailTable" runat="server" CellPadding="0" CellSpacing="0"
                                                                BackColor="#E8E8E8" ForeColor="Black" Width="100%" GridLines="Both" CssClass="GridViewTableRow">
                                                            </asp:Table>
                                                        </div>  --%>
                                            <div id="GridViewMessageDiv" class="himsBoxContentMsg" runat="server" visible="False">
                                            </div>
                                            <%--          <div id="DivData" class="Container" style="vertical-align: top; height: 250px; width: 99.6%;">  --%>
                                            <div id="Div5" runat="server" visible="true" class="table-responsive">
                                                <asp:GridView ID="MarkEntryGridView" runat="server" AutoGenerateColumns="False"
                                                    EmptyDataText="No Records Found !!" AllowPaging="false" ShowHeader="true" DataKeyNames="ResultId,ResultDetailId,AcademicId,ExamDetailId"
                                                    OnRowDataBound="MarkEntryGridView_RowDataBound" CssClass="table table-striped table-bordered table-hover">
                                                    <Columns>
                                                        <asp:BoundField DataField="ResultId" HeaderText="ResultId" Visible="false"></asp:BoundField>
                                                        <asp:BoundField DataField="ResultDetailId" HeaderText="ResultDetailId" Visible="false"></asp:BoundField>
                                                       <%-- <asp:BoundField DataField="AcademicId" HeaderText="AcademicId" Visible="false"></asp:BoundField>--%>
                                                        <asp:TemplateField HeaderText="AcademicId" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left" Visible="false">
                                                            <ItemTemplate>
                                                                <asp:Label ID="AcademicIdLabel" runat="server" Text='<%# Bind("AcademicId") %>'>' </asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="ExamDetailId" HeaderText="ExamDetailId" Visible="false"></asp:BoundField>
                                                        <asp:TemplateField HeaderText="RollNo" ItemStyle-Width="10%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                            <ItemTemplate>
                                                                <asp:Label ID="RollNoLabel" runat="server" Width="130px" Text='<%# Bind("RollNo") %>'>' </asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="ID No." ItemStyle-Width="12%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                            <ItemTemplate>
                                                                <asp:Label ID="GRNoLabel" runat="server" Width="130px" Text='<%# Bind("Code") %>'>' </asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Name" ItemStyle-Width="20%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                            <ItemTemplate>
                                                                <asp:Label ID="StudentNameLabel" runat="server" Width="280px" Text='<%# Bind("StudentName") %>'>' </asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>


                                                        <asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="7%">
                                                            <HeaderTemplate>
                                                                <itemstyle horizontalalign="Left" />
                                                                <itemtemplate>
                                                              <label class="rt-chkbox rt-chkbox-single rt-chkbox-outline">        
                                                                  <asp:CheckBox ID="HeaderPresentCheckBox"   SkinID="CustomWidthCheckBox"   OnCheckedChanged = "HeaderPresentCheckBox_OnCheckedChanged"   runat="server"  AutoPostBack="True"/>
                                                                         <span></span>
                                                                  Present
                                                                </label>
                                                                         </itemtemplate>
                                                            </HeaderTemplate>
                                                            <ItemStyle HorizontalAlign="Center" />
                                                            <ItemTemplate>
                                                                <label class="rt-chkbox rt-chkbox-single rt-chkbox-outline">
                                                                    <asp:CheckBox ID="PresentCheckBox" runat="server" SkinID="CustomWidthCheckBox"
                                                                        OnCheckedChanged="PresentCheckBox_Checked" Checked='<%# Eval("IsPresent") %>'
                                                                        AutoPostBack="true" />
                                                                    <span></span>
                                                                </label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Obtain" ItemStyle-Width="7%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                            <ItemTemplate>
                                                                <asp:TextBox ID="ObtainTextBox" SkinID="CustomWidthTextBox" runat="server" Width="80px" onchange="calobtain1(this);"
                                                                    MaxLength="100"
                                                                    Text='<%# DataBinder.Eval(Container.DataItem,"Obtain").ToString()=="0"? "":Eval("Obtain") %>'></asp:TextBox>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>

                                                        <asp:TemplateField HeaderText="Maximum Mark" ItemStyle-Width="8%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                            <ItemTemplate>
                                                                <asp:Label ID="MaximumMarkLabel" runat="server" Width="50px" Text='<%# Bind("MaximumMark") %>'>' </asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>

                                                        <asp:TemplateField HeaderText="Photo" ItemStyle-Width="190px" HeaderStyle-HorizontalAlign="Center" Visible="false"
                                                            ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true">
                                                            <ItemTemplate>
                                                                <asp:Image ID="StudentPhoto" Height="60px" Width="60px" runat="server" ImageUrl='<%# Eval("StudentPhoto")%>' />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>

                                                        <asp:TemplateField HeaderText="Absent Remark" ItemStyle-Width="8%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                            <ItemTemplate>
                                                                <asp:TextBox ID="AbsentRemarkTextBox" SkinID="CustomWidthTextBox" runat="server" Width="80px" onchange="AbsentRemarkTextBox_OnTextChange(this)"
                                                                    MaxLength="100"
                                                                    Text='<%# Eval("AbsentRemark") %>'></asp:TextBox>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>

                                                    </Columns>
                                                    <PagerSettings Visible="False" />
                                                </asp:GridView>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </asp:Panel>
                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--  <script data-main="../../../JavaScript/rjs/encrypt/mark-entry-encrypt" src="../../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/mark-entry")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>

    <script type="text/javascript">
        function calobtain1(obj) {
            var txtval = $(obj).val();            
            var hdnval = $('#ctl00_CP_MarkEntryGridView_ctl02_MaximumMarkLabel').text();
            if (parseFloat(txtval) > parseFloat(hdnval)) {
                alert('Obtain Marks can not be greater than max marks');
                $(obj).val('');
                $(obj).focus();
            }
        }        
        function ConfirmExecute(obj) {
            alert(obj);
        }
        function validate(obj,e) {
            var r = e.charCode ? e.charCode : e.keyCode;
            if (r == 45) {
                obj.text = "";
                return false;
            }
            else
                return true;
        }
        function AbsentRemarkTextBox_OnTextChange(obj) {
            var txtval = $(obj).val();
            var TextValidation = new RegExp('^[A-Za-z]{0,4}$');
            if (TextValidation.test(txtval) != true) {
                alert('Only alphabets up to four characters are allowed.');
                $(obj).val('');
                $(obj).focus();
            }
        }

    </script>

    <script type="text/javascript">
        function ConfirmExecute(obj) {
            alert(obj);
        }
    </script>
</asp:Content>
