<%@ page language="C#" masterpagefile="~/Pages/Common/MasterPages/MobileViewMasterPage.master" autoeventwireup="true" title="My Digital Form" inherits="Pages_Hrm_Employee_MMyDigitalForm, App_Web_pb4jm5fs" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DatePickerControl" TagPrefix="dpc" %>
<%@ Register Src="~/UserControls/AutoComplete/AutoCompleteTextBoxForGridView.ascx" TagName="AutoCompleteControl" TagPrefix="acc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <style>
        th {
            text-align: center;
        }

        @media only screen and (max-width: 767px) {
            input:not([type]), input[type=text]:not(.browser-default), input[type=password]:not(.browser-default), input[type=email]:not(.browser-default), input[type=url]:not(.browser-default), input[type=time]:not(.browser-default), input[type=date]:not(.browser-default), input[type=datetime]:not(.browser-default), input[type=datetime-local]:not(.browser-default), input[type=tel]:not(.browser-default), input[type=number]:not(.browser-default), input[type=search]:not(.browser-default), textarea.materialize-textarea {
                width: 100px !important;
            }

            div#divContentPage {
                overflow: auto;
            }

            .table-grid-view {
                margin-top: 30px;
            }
        }
    </style>
    <asp:UpdatePanel ID="ResonMasterUpdatePanel" runat="server" UpdateMode="Always">
        <ContentTemplate>
            <div id="divContentPage" class="padding-top-header">
                <div class="alert alert-warning" runat="server" id="MessageBox" visible="false">
                    <strong>
                        <asp:Label ID="MessageBoxLabel" runat="server"></asp:Label></strong>
                </div>
                <div style="width: 100%; padding: 2px; margin: 2px">
                    <table width="100%" border="0" style="vertical-align: top; border-collapse: collapse;" cellpadding="0" cellspacing="0" class="table-grid-view">
                        <tr>
                            <td style="vertical-align: top; width: 100%;" class="whiteboxpaddingleft">
                                <div class="himssuHeader5WireBox whitebox">
                                    <div class="himsBoxHeader note note1 box box-danger">
                                        <asp:Panel ID="SearchHeaderPanel" runat="server" meta:resourcekey="SearchHeaderPanelResource1">
                                            <div class="leftdiv">
                                            </div>
                                            <div class="himsBoxTitle">
                                                <div class="headerText">
                                                    <asp:Label ID="SearchHeaderLabel" runat="server" Text="My Digital Form"></asp:Label>
                                                </div>
                                            </div>
                                        </asp:Panel>
                                    </div>
                                    <asp:Panel ID="SearchDetailPanel" runat="server" meta:resourcekey="SearchDetailPanelResource1">
                                        <div class="himsBoxContent">
                                            <div class="contentHolder">
                                                <div id="EmployeeProfileGridViewDiv" runat="server">
                                                    <div class="spacer">
                                                        <asp:Image ID="Image6" runat="server" ImageUrl="~/Images/spacer.gif" meta:resourcekey="Image6Resource1" />
                                                    </div>
                                                    <div class="himssuHeader7WireBox  box-body box-solid gridviewfontbigger">
                                                        <asp:HiddenField ID="IdHiddenField" runat="server" />
                                                        <asp:HiddenField ID="AcademicIdHiddenField" runat="server" />
                                                        <asp:HiddenField ID="OrgGroupIdHiddenField" runat="server" />
                                                        <asp:HiddenField ID="OrgGroupBatchIdHiddenField" runat="server" />
                                                        <asp:HiddenField ID="OrgIdHiddenField" runat="server" />
                                                        <asp:HiddenField ID="UserIdHiddenField" runat="server" />
                                                        <asp:HiddenField ID="EmployeeIdHiddenField" runat="server" />
                                                        <asp:HiddenField ID="BatchIdHiddenField" runat="server" />

                                                        <asp:HiddenField ID="UserSourceTypeHiddenField" runat="server" />
                                                        <asp:HiddenField ID="UserSourceIdHiddenField" runat="server" />
                                                        <asp:HiddenField ID="DocumentNameHiddenField" runat="server" />
                                                        <asp:HiddenField ID="UploadConfigurationHiddenField" runat="server" />
                                                        <asp:HiddenField ID="ScreenIdHiddenField" runat="server" />
                                                        <asp:HiddenField ID="AttachmentSizeHiddenField" runat="server" />
                                                        <div class="himsBoxContent">
                                                            <asp:GridView runat="server" ID="DigitalFormGridView" AutoGenerateColumns="False" OnRowDataBound="DigitalFormGridView_RowDataBound"
                                                                DataKeyNames="SubFunctionalityName,UpdateFieldId,Field,FieldTypeId,DigitalFormId,EmployeeCode" EmptyDataText="No records available for the seacrh criteria!" AllowPaging="false" ShowHeader="true"
                                                                CssClass="table table-striped table-bordered table-hover more">
                                                                <Columns>
                                                                    <asp:TemplateField>
                                                                        <HeaderTemplate>
                                                                            <label class="rt-chkbox rt-chkbox-outline">
                                                                                <asp:CheckBox ID="HeaderIsSelectCheckBox" onclick="CheckAll(this);" runat="server" />
                                                                                <span></span>
                                                                            </label>
                                                                        </HeaderTemplate>
                                                                        <HeaderStyle HorizontalAlign="Center" />
                                                                        <ItemStyle HorizontalAlign="Center" Width="10%" />
                                                                        <ItemTemplate>
                                                                            <label class="rt-chkbox rt-chkbox-outline">
                                                                                <asp:CheckBox ID="IsSelectCheckBox" runat="server" />
                                                                                <span></span>
                                                                            </label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:BoundField DataField="Field" ItemStyle-Width="25%" HeaderStyle-HorizontalAlign="Left" HeaderText="Field" />
                                                                    <asp:TemplateField ItemStyle-Width="15%" HeaderText="Old Value" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                                        <ItemTemplate>
                                                                            <asp:DropDownList ID="OldValueDropDownList" runat="server" Visible="false" Width="98%" Enabled="false"></asp:DropDownList>
                                                                            <asp:TextBox ID="OldValueTextBox" runat="server" Visible="false" Enabled="false"></asp:TextBox>
                                                                            <asp:Panel ID="OldValueCheckBoxPanel" runat="server" Visible="false">
                                                                                <label class="rt-chkbox rt-chkbox-outline">
                                                                                    <asp:CheckBox ID="OldValueCheckBox" runat="server" Visible="false" Height="50px" Enabled="false"></asp:CheckBox>
                                                                                    <span></span>
                                                                                </label>
                                                                            </asp:Panel>
                                                                            <dpc:DatePickerControl ID="OldValueDatePicker" runat="server" DisplayDatePicker="true" Enabled="false"
                                                                                Visible="false" />
                                                                            <acc:AutoCompleteControl ID="OldValueAutoCompleteControl" runat="server" MinimumPrefixLength="2" Enabled="false"
                                                                                MaxLength="200" DisplayLoadingStatus="true" SkinID="CustomWidthTextBox"
                                                                                Width="154px" ValidateOnTextChanged="false" Visible="false" />
                                                                            <%--<asp:ImageButton ID="OldStudentPhoto" Visible="false" Height="60px" Width="60px" runat="server" />--%>
                                                                            <asp:ImageButton ID="OldEmployeePhoto" Visible="false" Height="60px" Width="60px" runat="server" />
                                                                            <asp:HyperLink ID="OldFileHyperLink" Visible="false" runat="server" Text="" CssClass="UploadedgetHyperLink"
                                                                                Target="_blank"></asp:HyperLink>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField ItemStyle-Width="15%" HeaderText="New Value" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                                        <ItemTemplate>
                                                                            <asp:DropDownList ID="NewValueDropDownList" runat="server" Visible="false" Width="98%"></asp:DropDownList>
                                                                            <asp:TextBox ID="NewValueTextBox" runat="server" Visible="false"></asp:TextBox>
                                                                            <asp:Panel ID="NewValueCheckBoxPanel" runat="server" Visible="false">
                                                                                <label class="rt-chkbox rt-chkbox-outline">
                                                                                    <asp:CheckBox ID="NewValueCheckBox" runat="server" Visible="false" Height="50px"></asp:CheckBox>
                                                                                    <span></span>
                                                                                </label>
                                                                            </asp:Panel>
                                                                            <dpc:DatePickerControl ID="NewValueDatePicker" runat="server" DisplayDatePicker="true"
                                                                                Visible="false" />
                                                                            <acc:AutoCompleteControl ID="NewValueAutoCompleteControl" runat="server" MinimumPrefixLength="2"
                                                                                MaxLength="200" DisplayLoadingStatus="true" SkinID="CustomWidthTextBox"
                                                                                Width="154px" ValidateOnTextChanged="false" Visible="false" />
                                                                            <asp:Panel ID="NewFileUploadPanel" runat="server" Visible="false">
                                                                                <asp:HyperLink ID="NewFileHyperLink" runat="server" Text="" CssClass="UploadedgetHyperLink"
                                                                                    Target="_blank"></asp:HyperLink>
                                                                                <br />
                                                                                <br />
                                                                                <a href="javascript:;" onclick='OpenFileUploadGrid3(<%#Eval("UpdateFieldId")%>);' class="btn btn-browser"><i class="fa fa-arrow-down"></i>Browse</a>
                                                                                <asp:FileUpload ID="DocumentFileUpload" runat="server" onChange="readURLDocument(this);" ClientIDMode="Static" Style="display: none;" AllowMultiple="false" />
                                                                                <asp:Button ID="DocumentFileRefresh" runat="server" OnClick="DocumentRefreshbutton_Click" SkinID="0" Text=" Refresh" class="btn btn-refresh fas" CommandName="Page" CommandArgument="<%#((GridViewRow)Container).RowIndex%>" />
                                                                                <br />
                                                                                <br />
                                                                                <asp:ImageButton ID="DocumentDeleteImageButton" runat="server" ToolTip="Delete" ImageUrl="~/Images/Del.png" OnClick="DocumentDeleteImageButton_Click" CommandName="Page" CommandArgument="<%#((GridViewRow)Container).RowIndex%>" />
                                                                            </asp:Panel>
                                                                            
                                                                            <asp:Panel ID="NewEmployeePhotoPanel" runat="server" Visible="false">
                                                                                <asp:ImageButton ID="NewEmployeePhoto" Height="60px" Width="60px" runat="server" Visible="false" /><div class="cBoth"></div>
                                                                                <a id="Browse" href="javascript:;" onclick="OpenFileUploadEmployee('<%#Eval("EmployeeCode")%>')" class="btn btn-browser"><i class="fa fa-arrow-down"></i>Browse</a>
                                                                                <asp:FileUpload ID="flUpload1" runat="server" onChange="readURLEmployee(this);" ClientIDMode="Static" Style="display: none;" AllowMultiple="false" />
                                                                                <asp:Button ID="RefreshButton" runat="server" ToolTip="Refresh" SkinID="0" Text=" Refresh" class="btn btn-refresh fas" CommandName="Page" CommandArgument="<%#((GridViewRow)Container).RowIndex%>" OnClick="RefreshButton_Click" />
                                                                                <br />
                                                                                <br />
                                                                                <asp:ImageButton ID="DeleteUploadedEmployeePhotoButton" runat="server" ToolTip="Delete" ImageUrl="~/Images/Del.png" OnClick="DeleteUploadedEmployeePhotoButton_Click" />
                                                                            </asp:Panel>

                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField ItemStyle-Width="20%" HeaderText="Remark" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                                        <ItemTemplate>
                                                                            <asp:TextBox ID="RemarkTextBox" runat="server" Text='<%# Bind("Remark") %>'></asp:TextBox>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                </Columns>
                                                                <PagerSettings Visible="False" />
                                                            </asp:GridView>
                                                        </div>
                                                        <div class="alignCenter col-md-12 pTop5 pb5">
                                                            <asp:Button ID="SaveButton" runat="server" Text="Save" OnClick="SaveButton_Click"
                                                                SkinID="0" CssClass="btn-search btn fas" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </asp:Panel>
                                </div>
                                <div class="spacer">
                                    <img src="../../../Images/spacer.gif" />
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--<script data-main="../../../JavaScript/rjs/encrypt/mlinkviewer-encrypt" src="../../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/document")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
    <script>
        function CheckAll(Checkbox) {
            var GridView = Checkbox.parentNode.parentNode.parentNode.parentNode;
            for (i = 1; i < GridView.rows.length; i++) {
                if (!GridView.rows[i].cells[0].getElementsByTagName("INPUT")[0].disabled) {
                    GridView.rows[i].cells[0].getElementsByTagName("INPUT")[0].checked = Checkbox.checked;
                }
            }
        }
    </script>
</asp:Content>
