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

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControls/GridViewPager/GridViewPager.ascx" TagName="GridViewPager"
    TagPrefix="uc1" %>
<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl"
    TagPrefix="ScreenGroup" %>
<%@ Register Src="~/UserControls/Common/StudentSearch/StudentSearch.ascx" TagName="StudentSearch"
    TagPrefix="Std" %>
<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DatePickerControl"
    TagPrefix="Date" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <style type="text/css">
        .volU {
            color: green !important;
            font-size: large;
        }

        .volM {
            color: red !important;
            font-size: large;
        }
    </style>
    <asp:UpdatePanel ID="ResonMasterUpdatePanel" runat="server" UpdateMode="Always">
        <ContentTemplate>
            <div id="divContentPage" class="divcontentpagemargin">
                <!-- ContentPlaceHolder Box Starts -->

                <div class="dashBoardLeftCont">
                    <div class="himssuHeader3WireBox">
                        <%-- <div class="himsBoxHeader">
                                        <div class="leftdiv">
                                        </div>
                                        <div class="himsBoxTitle">
                                            <div class="headerText">
                                                <asp:Label runat="server" ID="ScreenGroupNameLabel"></asp:Label>
                                            </div>
                                        </div>
                                    </div>--%>
                        <table>
                            <tr>
                                <td>
                                    <div class="himsBoxContent">
                                        <div class="leftUlMenu">
                                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="172"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <!-- Sub Container2 Box Start -->
                    <div class="himssuHeader5WireBox card card-box" id="SearchDiv" runat="server">
                        <div class="himsBoxHeader card-head">
                            <asp:Panel ID="Panel1" runat="server">
                                <div class="leftdiv">
                                </div>
                                <div class="himsBoxTitle">
                                    <div class="headerText">
                                        <header>
                                            <i class="fas fa-search"></i>
                                            <asp:Label ID="Label3" runat="server" Text="Search"></asp:Label>
                                        </header>
                                    </div>
                                </div>
                            </asp:Panel>
                        </div>
                        <div class="himsBoxContent card-body" style="padding-bottom: 0px">
                            <asp:Panel ID="DetailPanel" runat="Server">
                                <div class="contentHolder">
                                    <asp:Panel ID="SearchCriteriaPanel" runat="Server">
                                        <div class="outerBox pTop5 col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="FromDateLabel" runat="server" Text="From Date"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <Date:DatePickerControl DisplayDatePicker="true" ID="FromDatePickerControl" Width="154Px"
                                                    runat="server" Visible="true" />
                                            </div>
                                        </div>
                                        <div class="outerBox pTop5 col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="ToDateLabel" runat="server" Text="To Date"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <Date:DatePickerControl DisplayDatePicker="true" ID="ToDatePickerControl" Width="154Px"
                                                    runat="server" Visible="true" />
                                            </div>
                                        </div>

                                        <br />
                                        <div class="alignCenter pTop5 col-md-12 center">
                                            <asp:Button ID="SearchButton" Text="&#xf002; Search" runat="Server" OnClick="SearchButton_Click"
                                                SkinID="0" class="btn-search btn fas" />
                                            <asp:Button ID="ResetButton" runat="server" Text="&#xf0e2; Reset" SkinID="0" OnClick="ResetButton_Click" class="btn-reset btn fas" />
                                            <asp:HiddenField ID="MaxRowHiddenField" runat="server" />
                                            <asp:Button ID="RefreshButton" runat="server" OnClick="RefreshButton_Click" Text="&#xf2f9; Refresh"
                                                SkinID="0" CssClass="btn btn-refresh fas" />
                                        </div>
                                    </asp:Panel>
                                    <div id="Div1" class="himssuHeader7WireBox col-md-12"
                                        runat="server" style="width: 100%; margin-right: 5px;">
                                        <div id="SearchNewsDetailDiv" visible="false" runat="server">
                                            <div class="himsBoxContent card-body">
                                                <asp:UpdatePanel ID="MenuPlanDetailUpdatePanel" runat="server" UpdateMode="Conditional">
                                                    <ContentTemplate>
                                                        <div id="SearchDiv5" runat="server" visible="false" class="table-responsive">
                                                            <asp:GridView ID="ClassworkStudentGridView" runat="server" AutoGenerateColumns="False"
                                                                EmptyDataText="No Records Found !!" AllowPaging="false" ShowHeader="true" CssClass="table table-striped table-bordered table-hover"
                                                                DataKeyNames="Id,IsSubmitHomework" OnRowDataBound="ClassworkStudentGridView_RowDataBound">
                                                                <Columns>
                                                                    <asp:BoundField DataField="TeacherName" ItemStyle-Width="10%" HeaderText="Teacher Name"></asp:BoundField>
                                                                    <asp:BoundField DataField="SubjectName" HeaderText="Subject Name" ItemStyle-Width="10%"></asp:BoundField>
                                                                    <asp:TemplateField ItemStyle-Width="15%" ItemStyle-Wrap="true" HeaderText="Class Work">
                                                                        <ItemStyle HorizontalAlign="Left" Wrap="true" />
                                                                        <ItemTemplate>
                                                                            <asp:TextBox ID="ClassWorkLabel" Height="70px" runat="server" TextMode="MultiLine" Text='<%# Bind("Classwork") %>' Style="width: 87% !important"></asp:TextBox>
                                                                            <asp:Label ID="ClassWorkLinkLabel" runat="server" Text='<%# Bind("Classwork") %>' Style="width: 87% !important;overflow-wrap:anywhere"></asp:Label>                                                                                                                                                    
                                                                            <input type="button" onclick="TextToSpeech(this);" style="background: transparent; border: transparent; position: inherit" id="ClassworkSpeakButton" class="fas fa-volume-mute volM" value="&#xf6a9;" runat="server" />
                                                                            <input type="button" onclick="StopSpeech(this);" style="background: transparent; border: transparent; position: inherit; display: none" id="ClassworkMuteButton" class="fas fa-volume-up volU" value="&#xf028;" runat="server" />
                                                                            <asp:HiddenField ID="ClassworkLanguageHiddenField" runat="server" />
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField ItemStyle-Width="15%" ItemStyle-Wrap="true" HeaderText="Home Work">
                                                                        <ItemStyle HorizontalAlign="Left" Wrap="true" />
                                                                        <ItemTemplate>
                                                                            <asp:TextBox ID="HomeWorkLabel" Height="70px" runat="server" TextMode="MultiLine" Text='<%# Bind("Homework") %>' Style="width: 87% !important"></asp:TextBox>
                                                                            <asp:Label ID="HomeWorkLinkLabel" runat="server" Text='<%# Bind("Homework") %>' Style="width: 87% !important;overflow-wrap:anywhere"></asp:Label>                                                                                                                                                    
                                                                            <input type="button" onclick="TextToSpeech(this);" style="background: transparent; border: transparent; position: inherit" id="HomeworkSpeakButton" class="fas fa-volume-mute volM" value="&#xf6a9;" runat="server" />
                                                                            <input type="button" onclick="StopSpeech(this);" style="background: transparent; border: transparent; position: inherit; display: none" id="HomeworkMuteButton" class="fas fa-volume-up volU" value="&#xf028;" runat="server" />
                                                                            <asp:HiddenField ID="HomeworkLanguageHiddenField" runat="server" />
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>

                                                                    <%--<asp:BoundField DataField="Homework" ItemStyle-Width="45%" HeaderText="Home Work"
                                                                                    ItemStyle-HorizontalAlign="Left"></asp:BoundField>--%>
                                                                    <asp:TemplateField HeaderText="Class Work Date" ItemStyle-Width="10%" ItemStyle-Wrap="true">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="ClassWorkDateLabel" runat="server" Text='<%# Bind("ClassWorkDate","{0:dd/MM/yyyy}") %>' Width="100%"></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Work End Date" ItemStyle-Width="10%" ItemStyle-Wrap="true">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="WorkDateLabel" runat="server" Text='<%# Bind("HomeWorkEndDate","{0:dd/MM/yyyy}") %>' Width="100%"></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField ShowHeader="false" ItemStyle-Width="7%">
                                                                        <ItemStyle HorizontalAlign="Center" />
                                                                        <ItemTemplate>
                                                                            <asp:Button ID="UploadGridViewImageButton" Text="&#xf093; Upload Homework" runat="server" CommandArgument='<%# Container.DataItemIndex %>'
                                                                                meta:resourcekey="PrintButtonResource1" SkinID="0" CommandName="Select" CssClass="btn-upload btn fas" OnClick="UploadGridViewImageButton_Click" />
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField ShowHeader="false" ItemStyle-Width="7%">
                                                                        <ItemStyle HorizontalAlign="Center" />
                                                                        <ItemTemplate>
                                                                            <asp:Button ID="ViewUploadedHomeworkImageButton" runat="server" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' SkinID="0" Text="&#Xf06e; View" CssClass="btn btn-edit fas" Enabled="false" OnClick="ViewUploadedHomeworkImageButton_Click" />
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField ShowHeader="false" ItemStyle-Width="5%">
                                                                        <ItemStyle HorizontalAlign="Center" />
                                                                        <ItemTemplate>
                                                                            <%--<asp:ImageButton ID="ViewGridViewImageButton" runat="server" CausesValidation="False"
                                                                                CommandName="Select" ImageUrl="~/Images/view.png" ToolTip="View" OnClick="ViewGridViewImageButton_Click"
                                                                                AutoPostBack="true" Enabled="true" Width="100%" Visible="false" />--%>
                                                                              <asp:LinkButton ID="ViewGridViewImageButton" runat="server" CommandName="Select" OnClick="ViewGridViewImageButton_Click"
                                                                                    Text="View" CausesValidation="false"></asp:LinkButton>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                </Columns>
                                                                <PagerSettings Visible="False" />
                                                            </asp:GridView>
                                                        </div>
                                                    </ContentTemplate>
                                                </asp:UpdatePanel>
                                            </div>
                                            <div id="Div11" class="himssuHeader6WireBox" runat="server">
                                                <div id="UploadDiv" visible="true" runat="server">

                                                    <div class="himsBoxHeader card-head inner" id="HeaderDiv" visible="False" runat="server">
                                                        <div class="leftdiv">
                                                        </div>
                                                        <div class="himsBoxTitle" style="width: 99%">
                                                            <div class="gridHeaderText">
                                                                <header>
                                                                    <asp:Label ID="Label7" Text="File List" runat="server" />
                                                                </header>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="himsBoxContent card-body">
                                                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                                            <ContentTemplate>
                                                                <div id="GridViewDiv" runat="server" visible="false">
                                                                    <asp:GridView ID="FileGridView" runat="server" Width="100%" CssClass="table table-striped table-bordered"
                                                                        AutoGenerateColumns="False" ShowHeader="true" PagerSettings-Visible="false" EmptyDataText="No Files Uploaded">
                                                                        <Columns>
                                                                            <asp:TemplateField HeaderText="File Name" ItemStyle-Width="90%" HeaderStyle-HorizontalAlign="Left"
                                                                                ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">
                                                                                <ItemTemplate>
                                                                                    <asp:HyperLink ID="FileNameHyperLink" runat="server" Text='<%# Eval("FileName") %>'
                                                                                        NavigateUrl='<%# Eval("FilePath") %>' Target="_blank"></asp:HyperLink>
                                                                                </ItemTemplate>
                                                                            </asp:TemplateField>
                                                                        </Columns>
                                                                    </asp:GridView>
                                                                </div>
                                                                <div id="ClassworkGridViewDiv" runat="server" visible="true">
                                                                    <div id="Div4" runat="server" class="table-responsive">
                                                                        <asp:GridView ID="ClassworkGridView" runat="server" CssClass="table table-striped table-bordered table-hover"
                                                                            AutoGenerateColumns="False" ShowHeader="true" DataKeyNames="ClassworkId" PagerSettings-Visible="false" EmptyDataText="No Files Uploaded">
                                                                            <Columns>
                                                                                <asp:TemplateField HeaderText="File Name" ItemStyle-Width="90%" HeaderStyle-HorizontalAlign="Left"
                                                                                    ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">
                                                                                    <ItemTemplate>
                                                                                       <asp:Label ID="FileNameLabel" runat="server" CssClass="boxEllips" ToolTip='<%#Bind("FileName")%>'
                                                                                                                Text='<%#Bind("FileName")%>'></asp:Label>
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                                 <asp:TemplateField HeaderText="" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"
                                                                                    ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">
                                                                                    <ItemTemplate>
                                                                                        <asp:LinkButton ID="DownloadLinkButton" runat="server" CommandName="Download" Text="Download" OnClick="DownloadLinkButton_Click"
                                                                                            CausesValidation="false"></asp:LinkButton>
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                            </Columns>
                                                                        </asp:GridView>
                                                                    </div>

                                                                </div>
                                                            </ContentTemplate>
                                                        </asp:UpdatePanel>
                                                    </div>
                                                </div>
                                            </div>
                                            <div id="Div2" class="himssuHeader6WireBox" runat="server">
                                                <div id="Div3" visible="true" runat="server">

                                                    <div class="himsBoxHeader  card-head inner" id="SubmittedHomeworkHeaderDiv" visible="False" runat="server">
                                                        <div class="leftdiv">
                                                        </div>
                                                        <div class="himsBoxTitle">
                                                            <div class="gridHeaderText">
                                                                <header>
                                                                    <asp:Label ID="Label1" Text="Submitted Homework List" runat="server" />
                                                                </header>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="himsBoxContent pTop5 table-responsive">
                                                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                                            <ContentTemplate>
                                                                <div id="SubmittedHomeworkDiv" runat="server" visible="false">
                                                                    <asp:GridView ID="SubmittedHomeworkGridView" runat="server" CssClass="table table-striped table-bordered table-hover"
                                                                        AutoGenerateColumns="False" ShowHeader="true" PagerSettings-Visible="false" EmptyDataText="No Files Uploaded"
                                                                        DataKeyNames="UniqueText">
                                                                        <Columns>
                                                                            <asp:TemplateField HeaderText="File Name" ItemStyle-Width="90%" HeaderStyle-HorizontalAlign="Left"
                                                                                ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">
                                                                                <ItemTemplate>
                                                                                    <asp:HyperLink ID="FileNameHyperLink" runat="server" Text='<%# Eval("FileName") %>'
                                                                                        NavigateUrl='<%# Eval("FilePath") %>' Target="_blank"></asp:HyperLink>
                                                                                </ItemTemplate>
                                                                            </asp:TemplateField>
                                                                            <asp:TemplateField HeaderText="Delete" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Center"
                                                                                ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true">
                                                                                <ItemTemplate>
                                                                                    <asp:ImageButton ID="DeleteImageButton" runat="server" OnClick="DeleteImageButton_Click"
                                                                                        ImageUrl="~/../Images/icons/icon_delete.gif" ToolTip="Delete" />
                                                                                </ItemTemplate>
                                                                            </asp:TemplateField>
                                                                        </Columns>
                                                                    </asp:GridView>
                                                                </div>
                                                                <div id="SubmittedClassHomeworkGridViewDiv" runat="server" visible="true">
                                                                    <div id="Div5" runat="server" class="table-responsive">
                                                                        <asp:GridView ID="SubmittedClassHomeworkGridView" runat="server" CssClass="table table-striped table-bordered table-hover"
                                                                            AutoGenerateColumns="False" ShowHeader="true" DataKeyNames="ClassworkId" PagerSettings-Visible="false" EmptyDataText="No Files Uploaded">
                                                                            <Columns>
                                                                                <asp:TemplateField HeaderText="File Name" ItemStyle-Width="90%" HeaderStyle-HorizontalAlign="Left"
                                                                                    ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">
                                                                                    <ItemTemplate>
                                                                                        <asp:Label ID="FileNameLabel" runat="server" CssClass="boxEllips" ToolTip='<%#Bind("FileName")%>'
                                                                                                                Text='<%#Bind("FileName")%>'></asp:Label>
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                                    <asp:TemplateField HeaderText="" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"
                                                                                    ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">
                                                                                    <ItemTemplate>
                                                                                        <asp:LinkButton ID="SubmittedClassHomeworkDownloadLinkButton" runat="server" CommandName="Download" Text="Download" OnClick="SubmittedClassHomeworkDownloadLinkButton_Click"
                                                                                            CausesValidation="false"></asp:LinkButton>
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                                <asp:TemplateField HeaderText="Delete" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Center"
                                                                                    ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" >
                                                                                    <ItemTemplate>
                                                                               
                                                                                        <asp:ImageButton ID="SubmittedClassHomeworkDeleteImageButton" runat="server" OnClick="SubmittedClassHomeworkDeleteImageButton_Click"
                                                                                            ImageUrl="~/Images/icons/icon_delete.gif" ToolTip="Delete" />
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                            </Columns>
                                                                        </asp:GridView>
                                                                    </div>

                                                                </div>
                                                            </ContentTemplate>
                                                        </asp:UpdatePanel>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </asp:Panel>
                        </div>
                    </div>
                    <!-- Sub Container2 Box Ends -->
                    <!-- Sub Container1 Box Start -->
                    <!-- Sub Container1 Box Ends -->
                </div>

            </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%-- <script data-main="../../JavaScript/rjs/encrypt/my-classwork-encrypt" src="../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/my-classwork")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
    <script type="text/javascript">
        var flag = 0;
        var PrevId;
        var myTimeout;
        var myTimeout2;
        window.speechSynthesis.cancel();
        function TextToSpeech(obj) {
            let utter = new SpeechSynthesisUtterance();
            if (PrevId == null || PrevId == $(obj)[0].id) {
                PrevId = $(obj)[0].id;
                if (flag > 0) {
                    clearTimeout(myTimeout2);
                    window.speechSynthesis.resume();
                    if ($(obj).next().next()[0].value == "hindi")
                        myTimeout = setTimeout(myTimer, 10000);
                    $(obj).next().show()
                    $(obj).hide()
                    document.getElementById($(obj).next()[0].id).style.display = 'inline'
                }
                else {
                    clearTimeout(myTimeout2);
                    window.speechSynthesis.cancel();
                    utter.text = $(obj).prev().val();
                    if ($(obj).next().next()[0].value == "hindi") {
                        myTimeout = setTimeout(myTimer, 10000);
                        utter.lang = 'hi-Hindi'
                    }
                    window.speechSynthesis.speak(utter);
                    $(obj).next().show()
                    $(obj).hide()
                    document.getElementById($(obj).next()[0].id).style.display = 'inline'
                }
            }
            else {
                clearTimeout(myTimeout);
                clearTimeout(myTimeout2);
                window.speechSynthesis.cancel();
                flag = 0
                PrevId = $(obj)[0].id;
                utter.text = $(obj).prev().val();
                if ($(obj).next().next()[0].value == "hindi") {
                    myTimeout2 = setTimeout(myTimer2, 10000);
                    utter.lang = 'hi-Hindi'
                }
                window.speechSynthesis.speak(utter);
                window.speechSynthesis.pause();
                window.speechSynthesis.resume();
                $(obj).next().show()
                $(obj).hide()
                document.getElementById($(obj).next()[0].id).style.display = 'inline'
            }

            // event after text has been spoken
            utter.onend = function () {
                SpeechEnd(obj);
            }
        }
        function StopSpeech(obj) {
            window.speechSynthesis.pause();
            $(obj).hide();
            $(obj).prev().show()
            document.getElementById($(obj).prev()[0].id).style.display = 'inline'
            clearTimeout(myTimeout);
            clearTimeout(myTimeout2);
            //window.speechSynthesis.cancel();                        
            flag += 1;
        }
        function SpeechEnd(obj) {
            $(obj).show();
            $(obj).next().hide();
            document.getElementById($(obj)[0].id).style.display = 'inline'
            flag = 0;
            clearTimeout(myTimeout);
        }

        function myTimer() {
            window.speechSynthesis.pause();
            window.speechSynthesis.resume();
            myTimeout = setTimeout(myTimer, 10000);
        }

        function myTimer2() {
            window.speechSynthesis.pause();
            window.speechSynthesis.resume();
            myTimeout2 = setTimeout(myTimer2, 10000);
        }

    </script>
</asp:Content>
