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

<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DatePickerControl" TagPrefix="Date" %>
<%@ 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/EmployeeSearch/EmployeeSearch.ascx" TagName="EmployeeSearchControl" TagPrefix="hims" %>
<%@ Register Src="~/UserControls/Common/IncomeTax/IncomeTaxLabelControl.ascx" TagName="ITaxControl" TagPrefix="ITax" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="ResonMasterUpdatePanel" runat="server" UpdateMode="Always">
        <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="234"
                                                            Visible="true" runat="server" />
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                            <div class="whiteboxpaddingleft row">
                                <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 class="fRight mt-27">
                                                    <asp:Button ID="AddNewButtonID" runat="server" OnClick="AddNewButton_Click" SkinID="0" class="btn btn-add fas" Text="&#xf067; Add" Visible="false" />
                                                </div>
                                            </div>
                                        </asp:Panel>
                                    </div>
                                    <div class="himsBoxContent card-body">
                                        <asp:Panel ID="DetailPanel" runat="Server">
                                            <div class="contentHolder">
                                                <asp:Panel ID="SearchCriteriaPanel" runat="Server">
                                                    <div class="outerBox pTop5 col-md-3" style="display: none;">
                                                        <div class="controlLabelWidth">
                                                            <asp:Label ID="Label4" runat="server" Text="Organization" SkinID="MandatoryLabel"></asp:Label>
                                                        </div>
                                                        <div class="fLeft pRight5">
                                                            <asp:HiddenField ID="IdHiddenField" runat="server" />
                                                            <asp:HiddenField ID="MaxRowHiddenField" runat="server" />
                                                            <asp:DropDownList runat="server" ID="OrganizationSearchDropDownList" SkinID="CustomWidthDropDownList"
                                                                AutoPostBack="true" OnSelectedIndexChanged="OrganizationDropDownListSelectedIndexChanged" onmouseleave="showHideTooltip()" CssClass="form-control" onmouseenter="showHideTooltip()">
                                                            </asp:DropDownList>
                                                        </div>
                                                    </div>
                                                    <div class="outerBox pTop5 col-md-4" style="float: right">
                                                        <div class="col-md-9">
                                                            <div class="controlLabelWidth">
                                                                <asp:Label ID="AttendedLabel" runat="server" Text="Payroll"></asp:Label>
                                                            </div>
                                                            <div class="fLeft pRight5">
                                                                <asp:DropDownList ID="StatusDropDownList" runat="server" Visible="false" SkinID="CustomWidthDropDownList" onmouseleave="showHideTooltip()" CssClass="form-control" onmouseenter="showHideTooltip()">
                                                                    <asp:ListItem Value="0">- Select -</asp:ListItem>
                                                                    <asp:ListItem Value="58">Loan</asp:ListItem>
                                                                    <asp:ListItem Value="63">Salary Advance</asp:ListItem>
                                                                </asp:DropDownList>
                                                            </div>
                                                        </div>
                                                        <div >
                                                            <div class="controlLabelWidth">
                                                                <asp:Label ID="Label1" runat="server" Text=" "></asp:Label>
                                                            </div>
                                                            <div class="fLeft pRight5">
                                                                <asp:Button ID="ApplyButton" runat="server" Visible="false" SkinID="0" OnClick="ApplyButton_Click" Text="Apply All" CssClass="btn btn-assign" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                    
                                                </asp:Panel>
                                                <div id="Div1" class="himssuHeader7WireBox col-md-12" runat="server">
                                                    <div id="ReasonMasterDetailDiv" visible="true" runat="server">
                                                       
                                                        <%--<div class="himsBoxHeader card-head inner" id="PatientRelationDiv" visible="True" runat="server">
                                                            <div class="leftdiv">
                                                            </div>
                                                            <div class="himsBoxTitle" style="width: 99%">
                                                            </div>
                                                            <div class="gridHeaderText">
                                                            <header>
                                                            <asp:Label ID="AssignRouteLabel" runat="server" Text="Loan Payroll Mapping"></asp:Label>
                                                            </header>
                                                            </div>
                                                        </div>--%>
                                                        <div class="himsBoxContent card-body pTop10">
                                                            <div id="GridViewMessageDiv" class="himsBoxContentMsg" runat="server" visible="true">
                                                            </div>
                                                            <asp:UpdatePanel ID="MenuPlanDetailUpdatePanel" runat="server" UpdateMode="Always">
                                                                <ContentTemplate>
                                                                    <div id="Div5" runat="server" visible="false" class="table-responsive">
                                                                        <asp:GridView ID="GridViewDetails" runat="server" AutoGenerateColumns="False"
                                                                            OnRowDataBound="GridViewDetails_RowDataBound" SkinID="" ShowHeader="True" PagerSettings-Visible="false"
                                                                            DataKeyNames="LoanTypeId" EmptyDataText="No Records Found !!!"
                                                                            CssClass="table table-striped table-bordered table-hover">
                                                                            <Columns>
                                                                                <asp:TemplateField HeaderText="Select" HeaderStyle-HorizontalAlign="Center" ItemStyle-Wrap="true">
                                                                                    <HeaderTemplate>
                                                                                        <label class="rt-chkbox rt-chkbox-outline">
                                                                                        <asp:CheckBox ID="HeaderSelectCheckBox" runat="server"  OnCheckedChanged="HeaderSelectCheckBox_checked" AutoPostBack="true" />
                                                                                             <%--onclick="checkAll(this);"--%>
                                                                                            <span></span>
                                                                                        </label>
                                                                                    </HeaderTemplate>
                                                                                    <ItemStyle HorizontalAlign="Center" CssClass="align-baseline"/>
                                                                                    <ItemTemplate>
                                                                                        <label class="rt-chkbox rt-chkbox-outline">
                                                                                        <asp:CheckBox ID="SelectCheckBox" runat="server" Checked='<%# Bind("Checked") %>' />
                                                                                            <span></span>
                                                                                        </label>
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                                <asp:TemplateField HeaderText="Sr No." ItemStyle-Width="5%" HeaderStyle-HorizontalAlign="Center" ItemStyle-Wrap="true">
                                                                                    <ItemTemplate>
                                                                                        <asp:HiddenField ID="LoanTypeIdHiddenField" runat="server" Value='<%# Bind("LoanTypeId") %>'></asp:HiddenField>
                                                                                        <asp:HiddenField ID="PayElementIdHiddenField" runat="server" Value='<%# Bind("PayElementId") %>'></asp:HiddenField>
                                                                                        <asp:HiddenField ID="StatusLabelHiddenField" runat="server" Value='<%# Bind("PayElementId") %>'></asp:HiddenField>
                                                                                        <%# Container.DataItemIndex + 1 %>
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                                <asp:TemplateField HeaderText="Loan Code" ItemStyle-Width="30%" SortExpression="Code" HeaderStyle-HorizontalAlign="Left"
                                                                                    ItemStyle-Wrap="true">
                                                                                    <ItemTemplate>
                                                                                        <asp:Label ID="CodeLabel" runat="server" Text='<%# Bind("Code") %>'></asp:Label>
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                                <asp:TemplateField HeaderText="Loan Name" ItemStyle-Width="50%" SortExpression="Title" HeaderStyle-HorizontalAlign="Left"
                                                                                    ItemStyle-Wrap="true">
                                                                                    <ItemTemplate>
                                                                                        <asp:Label ID="TitleLabel" runat="server" Text='<%# Bind("Title") %>'></asp:Label>
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                                <asp:TemplateField Visible="false" HeaderText="Mapping Status" ItemStyle-Width="10%" SortExpression="RowID" HeaderStyle-HorizontalAlign="Center"
                                                                                    ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Center">
                                                                                    <ItemTemplate>
                                                                                        <asp:Label ID="StatusLabel" runat="server" Text='<%# Bind("Status") %>'></asp:Label>
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                                <asp:TemplateField HeaderText="Payroll Element" ItemStyle-Width="20%" SortExpression="Total" HeaderStyle-HorizontalAlign="Left"
                                                                                    ItemStyle-Wrap="true">
                                                                                    <ItemTemplate>
                                                                                        <asp:DropDownList ID="StatusDropDownList" runat="server" SkinID="CustomWidthDropDownList" onmouseleave="showHideTooltip()" CssClass="form-control" onmouseenter="showHideTooltip()">
                                                                                            <asp:ListItem Value="0">- Select -</asp:ListItem>
                                                                                            <asp:ListItem Value="58">Loan</asp:ListItem>
                                                                                            <asp:ListItem Value="63">Salary Advance</asp:ListItem>
                                                                                        </asp:DropDownList>
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                            </Columns>
                                                                        </asp:GridView>
                                                                    </div>
                                                                </ContentTemplate>
                                                            </asp:UpdatePanel>
                                                        </div>
                                                        <div class="alert alert-info display-block">                                                          
                                                            <div class="width-100" style="height:15px;margin-top:8px">                                                                
                                                                <asp:Label ID="NoteLabel1" runat="server" Text="Note : Loan payroll applicable after loan type."></asp:Label>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </asp:Panel>
                                    </div>
                                </div>
                                <div class="himssuHeader1WireBox card card-box" id="DetailDiv" runat="server" visible="false">
                                    <div class="himsBoxHeader card-head">
                                        <div class="leftdiv">
                                        </div>
                                        <div class="himsBoxTitle">
                                            <div class="headerText">
                                                <header>
                                                    <i class="fas fa-cog"></i>
                                                <asp:Label ID="AccountingYearMasterDetailLabel" runat="server" Text="Maintenance"></asp:Label>
                                                </header>
                                            </div>
                                        </div>
                                        <div class="fRight mt-27 pagination display-flex">
                                            <table>
                                                <tr>
                                                    <td class="formLabel">
                                                        <div id="NumberOfRecordDiv" class="display-flex" runat="server" visible="true">
                                                            <asp:LinkButton AlternateText="First page" ToolTip="First page" ID="FirstRecordImageButton"
                                                                runat="server" ImageUrl="~/Images/arrowLlast.gif" CommandName="Page" CommandArgument="First"
                                                                OnClick="FirstRecordImageButton_Click" CssClass="btn btn-default gridviewpagerbuttonpadding">
                                                                <i class="fa fa-fast-backward"></i>
                                                            </asp:LinkButton>
                                                            <asp:LinkButton AlternateText="Previous page" ToolTip="Previous page" ID="PreviousImageButton"
                                                                runat="server" ImageUrl="~/Images/arrowLeft.gif" CommandName="Page" CommandArgument="Prev"
                                                                OnClick="PreviousImageButton_Click" CssClass="btn btn-default gridviewpagerbuttonpadding">
                                                                <i class="fa fa-play fa-rotate-180"></i>
                                                            </asp:LinkButton>
                                                            &nbsp; &nbsp;
                                                            <asp:Label ID="LabelPage" runat="server" Text="Record " AssociatedControlID="ReCordNumber" />
                                                            <asp:Label ID="ReCordNumber" Font-Bold="true" SkinID="Dummy" runat="server"></asp:Label>
                                                            <asp:Label ID="ofLabel" Text="of" runat="server" />
                                                            <asp:Label ID="TotalRecord" runat="server" />
                                                            &nbsp; &nbsp;
                                                            <asp:LinkButton AlternateText="Next page" ToolTip="Next page" ID="NextImageButtom"
                                                                runat="server" ImageUrl="~/Images/arrowRight.gif" CommandName="Page" CommandArgument="Next"
                                                                OnClick="NextImageButton_Click" CssClass="btn btn-default gridviewpagerbuttonpadding">
                                                                <i class="fa fa-play"></i>
                                                            </asp:LinkButton>
                                                            <asp:LinkButton AlternateText="Last page" ToolTip="Last page" ID="LastRecordImageButton"
                                                                runat="server" ImageUrl="~/Images/arrowRLast.gif" CommandName="Page" CommandArgument="Last"
                                                                OnClick="LastRecordImageButton_Click" CssClass="btn btn-default gridviewpagerbuttonpadding">
                                                                <i class="fa fa-fast-forward"></i>
                                                            </asp:LinkButton>
                                                        </div>
                                                    </td>
                                                    <td>
                                                        &nbsp; &nbsp; <asp:Button ID="BackButton" runat="Server" OnClick="BackButton_Click" SkinID="0" class="btn btn-back fas" Text="&#xf30a;  Back" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </tr>
                    </table>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <script type="text/javascript">
        function Check_Click(objRef) {
            var row = objRef.parentNode.parentNode; var GridView = row.parentNode; var inputList = GridView.getElementsByTagName("input");
            for (var i = 0; i < inputList.length; i++) {
                var headerCheckBox = inputList[0]; var checked = true;
                if (inputList[i].type == "checkbox" && inputList[i] != headerCheckBox) { if (!inputList[i].disabled) { if (!inputList[i].checked) { checked = false; break; } } }
            } headerCheckBox.checked = checked;

        }

        function checkAll(objRef) {
            var GridView = objRef.parentNode.parentNode.parentNode;
            var inputList = GridView.getElementsByTagName("input");
            for (var i = 0; i < inputList.length; i++) {
                var row = inputList[i].parentNode.parentNode;
                if (inputList[i].type == "checkbox" && objRef != inputList[i]) {
                    if (objRef.checked) { if (!inputList[i].disabled) { inputList[i].checked = true; } } else { inputList[i].checked = false; }
                }
            }
        }
    </script>
    <%--<script data-main="../../../JavaScript/rjs/encrypt/payrollyear-master-encrypt" src="../../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/payrollyear-master")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
</asp:Content>
