<%@ page title="" language="C#" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" autoeventwireup="true" inherits="Pages_Communication_AssignmentView, App_Web_nljof4qm" 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">
        .volU {
            color: green !important;
            font-size: large;
        }

        .volM {
            color: red !important;
            font-size: large;
        }
    </style>
    <asp:UpdatePanel ID="AssignmentUpdatePanel" runat="server">
        <ContentTemplate>
            <div id="divContentPage" class="divcontentpagemargin">
                <div class="dashBoardLeftCont">
                    <div class="himssuHeader3WireBox">
                        <table>
                            <tr>
                                <td>
                                    <div class="himsBoxContent">
                                        <div class="leftUlMenu">
                                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="114"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <div class="contentHolder">
                        <div class="himssuHeader1WireBox card card-box">
                            <div class="himsBoxHeader card-head" id="Div4" runat="server" visible="True">
                                <div class="leftdiv">
                                </div>
                                <div class="himsBoxTitle">
                                    <div class="headerText fLeft">
                                        <header>
                                            <i class="fas fa-tasks"></i>
                                            <asp:Label ID="Label4" Text="Assignment View" runat="server" />
                                        </header>
                                    </div>
                                </div>
                                <div class="fRight mt-27">
                                    <asp:Button ID="BackButton" runat="Server" OnClick="BackButton_Click" SkinID="0" class="btn btn-back fas" Text="&#xf30a; Back" />
                                </div>
                            </div>
                            <div class="himsBoxContent card-body">
                                <asp:Panel ID="DetailPanel" runat="Server">
                                    <div class="contentHolder">
                                        <div class="outerBox11 pTop5 col-md-12">
                                            <div class="fLeft pRight5">
                                                <table>
                                                    <tr class="table-bordered">
                                                        <td class="etestreview">
                                                            <asp:Label ID="TitleLabel" Font-Size="Small" runat="server" Text="Name" Width="120px" Font-Bold="true"></asp:Label></td>
                                                        <td style="padding: 4px" class="">
                                                            <asp:Label ID="DisplayTitleLabel" Font-Size="Small" runat="server" Width="500px"></asp:Label></td>
                                                    </tr>
                                                    <tr class="table-bordered">
                                                        <td class="etestreview">
                                                            <asp:Label ID="SubjectNameLabel" Font-Size="Small" runat="server" Text="Subject Name" Width="120px" Font-Bold="true"></asp:Label></td>
                                                        <td class="" style="padding: 4px">
                                                            <asp:Label ID="DisplaySubjectNameLabel" runat="server" Font-Size="Small" Width="500px"></asp:Label></td>
                                                    </tr>
                                                    <tr class="table-bordered">
                                                        <td class="etestreview" style="vertical-align: top">
                                                            <asp:Label ID="RemarkLabel" runat="server" Font-Size="Small" Text="Remark" Width="120px" Font-Bold="true"></asp:Label></td>
                                                        <td class="" style="padding: 4px">
                                                            <asp:Label ID="DisplayRemarkLabel" runat="server" Width="500px" Font-Size="Small"></asp:Label>                                                           
                                                            <input type="button" onclick="TextToSpeech(this);" style="background: transparent; border: transparent; position: absolute" id="RemarkSpeakButton" class="fas fa-volume-mute volM" value="&#xf6a9;" runat="server" />
                                                            <input type="button" onclick="StopSpeech(this);" style="background: transparent; border: transparent; position: absolute; display: none" id="RemarkMuteButton" class="fas fa-volume-up volU" value="&#xf028;" runat="server" />
                                                            <asp:HiddenField ID="RemarkLanguageHiddenField" runat="server" />
                                                        </td>
                                                    </tr>
                                                    <tr class="table-bordered">
                                                        <td class="etestreview">
                                                            <asp:Label ID="StartDateLabel" runat="server" Text="Start Date" Width="120px" Font-Size="Small" Font-Bold="true"></asp:Label></td>
                                                        <td class="" style="padding: 4px">
                                                            <asp:Label ID="DisplayStartDateLabel" runat="server" Width="500px" Font-Size="Small"></asp:Label></td>
                                                    </tr>
                                                    <tr class="table-bordered">
                                                        <td class="etestreview">
                                                            <asp:Label ID="EndDateLabel" Font-Size="Small" runat="server" Text="End Date" Width="120px" Font-Bold="true"></asp:Label></td>
                                                        <td class="" style="padding: 4px">
                                                            <asp:Label ID="DisplayEndDateLabel" Font-Size="Small" runat="server" Width="500px"></asp:Label></td>
                                                    </tr>
                                                    <tr class="table-bordered">
                                                        <td class="etestreview">
                                                            <asp:Label ID="CreatedUserNameLabel" runat="server" Font-Size="Small" Text="Created User Name" Width="120px" Font-Bold="true"></asp:Label></td>
                                                        <td class="" style="padding: 4px">
                                                            <asp:Label ID="DisplayCreatedUserNameLabel" runat="server" Width="500px" Font-Size="Small"></asp:Label></td>
                                                    </tr>
                                                    <tr class="table-bordered">
                                                        <td class="etestreview" style="vertical-align: top">
                                                            <asp:Label ID="AssignmentAttachmentLabel" runat="server" Font-Size="Small" Text="List of Attachment" Width="120px" Font-Bold="true"></asp:Label></td>
                                                        <td class="" style="padding: 4px">
                                                            <asp:Table ID="AssignmentAttachmentGridViewTable" runat="server" Font-Size="Small" Width="100%" visible="false"></asp:Table>
                                                            <div id ="AssignmentFileGridViewDiv" runat="server" visible="false">
                                                                <asp:GridView ID="AssignmentFileGridView" runat="server" class="himssuHeader7WireBox col-md-12 table-responsive" AutoGenerateColumns="False"
                                                                        CssClass="table" ShowHeader="false" PagerSettings-Visible="false" EmptyDataText="No Files Uploaded">
                                                                        <Columns>
                                                                            <asp:TemplateField ItemStyle-Width="80%" 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>
                                                        </td>
                                                    </tr>
                                                    <tr class="" id="RevertRemarkDiv" runat="server">
                                                        <td class="etestreview" style="vertical-align: top">
                                                            <asp:Label ID="AssignmentRevertRemarkLabel" runat="server" Font-Size="Small" Text="Remark" Width="120px" Font-Bold="true"></asp:Label></td>
                                                        <td class="" style="padding: 4px">
                                                            <asp:TextBox ID="RevertRemarkTextBox" TextMode="MultiLine" runat="server" Font-Size="Small" Width="100%"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                            <asp:HiddenField ID="AssignmentIdHiddenField" runat="server" />
                                            <%--Source File Upload--%>
                                            <div id="AssignmentDocumentUploadDiv" runat="server" visible="false">
                                                <div class="alignCenter pTop5 col-md-12">
                                                    <div class="controlLabelWidth">
                                                        <a href="javascript:;" onclick="OpenFileUpload();" class="btn btn-browser">
                                                            <i class="fa fa-arrow-down"></i>Browse</a>
                                                        <asp:HiddenField ID="GUIDHiddenField" runat="server" />
                                                        <asp:HiddenField ID="UploadConfigurationHiddenField" runat="server" />
                                                        <asp:HiddenField ID="UserSourceTypeHiddenField" runat="server" />
                                                        <asp:HiddenField ID="UserSourceIdHiddenField" runat="server" />
                                                        <asp:HiddenField ID="DocumentIdHiddenField" runat="server" />
                                                        <asp:HiddenField ID="AttachmentSizeHiddenField" runat="server" />
                                                        <asp:FileUpload ID="flUpload" runat="server" onChange="readURL(this);" ClientIDMode="Static" Style="display: none;" AllowMultiple="true" />

                                                        <asp:Button runat="server" ID="RefreshButton" Text="&#xf2f9; Refresh" OnClick="RefreshButton_Click" SkinID="0" CssClass="btn btn-refresh fas" style="display:none" />
                                                    </div>
                                                    <asp:Label ID="Label2" runat="server"></asp:Label>
                                                </div>

                                                <div id="Div11" class="himssuHeader6WireBox col-md-12" runat="server" style="width: 100%; margin-right: 5px;">
                                                    <div id="UploadDiv" visible="True" runat="server">

                                                        <div class="himsBoxHeader" id="HeaderDiv" visible="False" runat="server">
                                                            <div class="leftdiv">
                                                            </div>
                                                            <div class="himsBoxTitle" style="width: 99%">
                                                                <div class="headerText">
                                                                    <div class="fLeft">
                                                                        <asp:Label ID="Label7" Text="File List" runat="server" Font-Bold="True" />
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="himsBoxContent card-body">
                                                            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                                                <ContentTemplate>
                                                                    <div id="GridViewDiv" runat="server" visible="false">
                                                                        <asp:GridView ID="FileGridView" runat="server" class="himssuHeader7WireBox col-md-12 table-responsive" AutoGenerateColumns="False"
                                                                            CssClass="table table-striped table-bordered" 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>
                                                                                <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"
                                                                                            ToolTip="Delete" ImageUrl="~/Images/Del.png" />
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                            </Columns>
                                                                        </asp:GridView>
                                                                    </div>
                                                                </ContentTemplate>
                                                            </asp:UpdatePanel>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </asp:Panel>
                            </div>
                        </div>
                    </div>

                </div>
                </tr>
                    </table>
            </div>
            </div>
            
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--  <script data-main="../../JavaScript/rjs/encrypt/assignment-view-encrypt" src="../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/assignment-view")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
    <script type="text/javascript">
        var flag = 0;
        var myTimeout;
        window.speechSynthesis.cancel();
        function TextToSpeech(obj) {
            let utter = new SpeechSynthesisUtterance();
            if (flag > 0) {
                if ($(obj).next().next()[0].value == "hindi")
                    myTimeout = setTimeout(myTimer, 10000);
                window.speechSynthesis.resume();
                $(obj).next().show()
                $(obj).hide()
                document.getElementById($(obj).next()[0].id).style.display = 'inline'
            }
            else {
                utter.text = $(obj).prev()[0].innerText
                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'
            }

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

        //FileUpload        
    </script>
</asp:Content>
