<%@ page title="" language="C#" masterpagefile="~/MasterFile/TimeCheck.master" autoeventwireup="true" inherits="Masters_TA_UI_Master_LoanEntryList, App_Web_rbbxeul3" %>


<%@ Register TagPrefix="dxGridview" Namespace="DevExpress.Web" Assembly="DevExpress.Web.v14.2" %>
<%@ Register Assembly="DevExpress.Web.v14.2" Namespace="DevExpress.Web" TagPrefix="devxEditors" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControls/TA_uc_OrganizationLevels.ascx" TagName="OrganizationLevel"
    TagPrefix="uc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="Server">

    <link href="../css/ProgressBar.css" rel="stylesheet" type="text/css" />
    <script src="../plugins/datepicker/jquery-1.11.1.min.js"></script>
    <script language="javascript" src="../js/jquery.autocomplete.js" type="text/javascript"></script>
    <script src="../plugins/datepicker/jquery-1.11.1.min.js"></script>
    <script src="../plugins/datepicker/bootstrap-datepicker.js"></script>
    <script>
        $(function () {
            $('#ctl00_BodyContentPH_txtLeaveStartDate').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value }
            );
        });
        $(function () {
            $('#ctl00_BodyContentPH_txtLeaveEndDate').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value }
            );
        });
    </script>
    <script type="text/javascript">
        if (navigator.userAgent.toLowerCase().indexOf('chrome') != -1)
            document.write('<link href="../css/safari.css" rel="stylesheet" type="text/css" />');
    </script>
    <div class="content-header">
        <h1 style="background-image: url('../dist/img/lve-app.png'); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lbl_Header" runat="server"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">
        <!--FILTERS-->
        <div class="inr-ftr">
            <div class="row">
                <div class="col-sm-2">
                    <div class="inr-fil-text">
                        <asp:Label ID="lblFilter" runat="server" Text="Filter"></asp:Label>
                    </div>
                </div>
            </div>
        </div>
        <div id="myModal" class="modal modal-default fade" role="dialog">
            <div class="modal-dialog" style="min-width: 85%;">
                <!-- Modal content-->
                <div class="modal-content" style="margin-top: 100px">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" style="border-radius: 50px;">
                            &times;</button>
                        <h4 class="modal-title" style="padding-bottom: 10px">
                            <asp:Label ID="lblDataView" runat="server" Text="Data View"></asp:Label>
                        </h4>
                    </div>
                    <div class="modal-body">
                        <iframe id="iframePopup" runat="server" scrolling="auto" width="100%" height="450"
                            style="border-style: none"></iframe>
                    </div>
                    <div class="modal-footer" style="display: none">
                        <button type="button" class="btn btn-primary pull-right" data-dismiss="modal">
                            Close</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="emp-filter">
            <div class="row form-group" style="display: none">
                <div class="col-md-3">
                    <asp:Label ID="Label3" runat="server"></asp:Label>
                </div>
                <div class="col-md-3">
                    <asp:DropDownList ID="ddlSwipeOpt" runat="server">
                        <asp:ListItem Text="Select" Value="Select"></asp:ListItem>
                        <asp:ListItem Text="All" Value="All"></asp:ListItem>
                        <asp:ListItem Text="Exists" Value="Exists"></asp:ListItem>
                        <asp:ListItem Text="Not Exists" Value="Not Exists"></asp:ListItem>
                    </asp:DropDownList>
                </div>
            </div>
            <div class="row" id="trOrgLevel" runat="server">
                <div class="col-md-12">
                    <asp:UpdatePanel ID="upOrgLevel" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <asp:PlaceHolder ID="PlaceHolderLateEntry" runat="server">
                                <uc:OrganizationLevel ID="ucOrganizationLevel" runat="server" />
                            </asp:PlaceHolder>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
            </div>
            <div class="clearfix">
            </div>
            <div class="row">
                <div class="row">
                    <div class="line16">
                    </div>
                </div>
            </div>
            <div class="row form-group" id="Div1" runat="server" style="display: none">
                <div class="col-md-3">
                    <asp:Label ID="lblEmpSwipeCard" runat="server"></asp:Label>
                </div>
                <div class="col-md-3">
                    <asp:TextBox onpaste="return true" ID="txtSwipeCard" MaxLength="20" runat="server"
                        CssClass="form-control input-sm" onkeypress="return acceptCharsNum_MaxLength(event,this,20,MaxLength);"></asp:TextBox>
                    <cc1:AutoCompleteExtender ID="acSwipeCardNo" runat="server" CompletionSetCount="10"
                        CompletionListItemCssClass="item" CompletionListHighlightedItemCssClass="AutocompleteCSS"
                        CompletionInterval="10" Enabled="true" MinimumPrefixLength="1" TargetControlID="txtSwipeCard"
                        ServicePath="../WebServices/AutoCompleteExtender.asmx" ServiceMethod="GetCardNo"
                        CompletionListCssClass="autocomplete_completionListElement" FirstRowSelected="true">
                    </cc1:AutoCompleteExtender>
                </div>
            </div>

            <div class="row form-group">

                <div class="col-md-2">
                    <asp:Label ID="lbl_EmployeeName" runat="server"></asp:Label>
                </div>
                <div class="col-md-3">
                    <asp:TextBox onpaste="return true" ID="txt_EmpName" runat="server" CssClass="form-control"
                        MaxLength="50" onkeypress="return employeename_singlequotes_maxlength(event,this,50,MaxLength);">
                    </asp:TextBox>
                    <cc1:AutoCompleteExtender ID="acEmpName" runat="server" CompletionInterval="10" CompletionSetCount="10"
                        CompletionListItemCssClass="item" CompletionListHighlightedItemCssClass="AutocompleteCSS"
                        Enabled="true" FirstRowSelected="true" MinimumPrefixLength="1" ServicePath="../WebServices/AutoCompleteExtender.asmx"
                        ServiceMethod="GetEmployeeName" CompletionListCssClass="autocomplete_completionListElement"
                        TargetControlID="txt_EmpName">
                    </cc1:AutoCompleteExtender>
                </div>
                <div class="col-md-1">
                </div>
                <div class="col-md-2">
                    <asp:Label ID="lbl_EmployeeId" runat="server"></asp:Label>
                </div>
                <div class="col-md-3">
                    <asp:TextBox onpaste="return true" ID="txtEmployeeId" runat="server" CssClass="form-control"
                        MaxLength="15" onkeypress="return acceptCharsNum_MaxLength(event,this,15,MaxLength);">
                    </asp:TextBox>
                    <cc1:AutoCompleteExtender ID="acEmployeeId" runat="server" CompletionSetCount="10"
                        CompletionListItemCssClass="item" CompletionListHighlightedItemCssClass="AutocompleteCSS"
                        CompletionInterval="10" Enabled="true" MinimumPrefixLength="1" TargetControlID="txtEmployeeId"
                        ServicePath="../WebServices/AutoCompleteExtender.asmx" ServiceMethod="GetEmployeeId"
                        CompletionListCssClass="autocomplete_completionListElement" FirstRowSelected="true">
                    </cc1:AutoCompleteExtender>

                </div>
                <div class="col-md-1">
                </div>
            </div>

            <div class="panel-collapse" id="trFiller" runat="server">
                <div>
                    <div class="row">
                        <div class="col-md-12">
                            <div class="row form-group">
                                <div class="col-md-2">
                                    <asp:Label ID="lblEmpCategory" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddlEmpCatagory" runat="server" CssClass="form-control select2"
                                        AppendDataBoundItems="true">
                                        <asp:ListItem Value="0" Selected="True" Text="-Select-"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-2">
                                    <asp:Label ID="lblEmpType" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddlEmpType" runat="server" CssClass="form-control select2"
                                        AppendDataBoundItems="true">
                                        <asp:ListItem Value="0" Selected="True" Text="-Select-"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="row form-group" id="Search3" runat="server">
                                <div class="col-md-2">
                                    <asp:Label ID="lblGender" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddlGender" runat="server" CssClass="form-control select2">
                                        <asp:ListItem Value="Both" Text="Both"></asp:ListItem>
                                        <asp:ListItem Value="Male" Text="Male"></asp:ListItem>
                                        <asp:ListItem Value="Female" Text="Female"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <%-- <div class="col-md-2">
                                    <asp:Label ID="lblAdvanced" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddlAdvanced" runat="server" CssClass="form-control select2">
                                        <asp:ListItem Text="All" Value="0"></asp:ListItem>
                                        <asp:ListItem Text="OT Eligible" Value="1"></asp:ListItem>
                                        <asp:ListItem Text="Compensation Off Eligible" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="OT And Compensation Off Eligible" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="OT And Compensation Off Not Eligible" Value="9"></asp:ListItem>
                                        <asp:ListItem Text="Leave Policy Not Assigned" Value="4"></asp:ListItem>
                                        <asp:ListItem Text="Active Employee(s)" Value="10"></asp:ListItem>
                                        <asp:ListItem Text="In Active Employee(s)" Value="5"></asp:ListItem>
                                        <asp:ListItem Text="Hostel Employee(s)" Value="6"></asp:ListItem>
                                        <asp:ListItem Text="Exclude From Reports - Yes" Value="7"></asp:ListItem>
                                        <asp:ListItem Text="User Group Not Assigned Employee(s)" Value="8"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>--%>
                            </div>
                            <div class="row">
                                <div class="col-md-5 col-sm-4">
                                </div>
                                <div class="col-md-6 col-sm-6">
                                    <div class="pull-right-button">
                                        <%--Add serach button here--%>
                                        <asp:Label ID="lbl_Error" runat="server" ForeColor="Red"></asp:Label>
                                        <asp:LinkButton ID="btn_Search" CssClass="btn src-btn fa-search" runat="server" OnClick="btn_Search_Click"
                                            OnClientClick="return WeekdayValidation();" />
                                        <asp:LinkButton ID="btn_Clear" CssClass="btn clr-btn fa-refresh" runat="server" OnClick="btn_Clear_Click" />
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                    <%-- </div>--%>
                </div>
            </div>

        </div>
        <!--RES TABLE-->
     
        <div class="border-table new-space form-group">
            <div class="row form-group">
              <%--  <div class="col-md-12 page-button col-sm-12">
                    <asp:LinkButton ID="btn_Add" CssClass="btn add-btn fa-plus" runat="server" OnClick="btn_Add_Click" />

                </div>--%>
            </div>
            <div class="table-responsive" style="padding-bottom: 10px">
                <%--Grid Add Here--%>
                <asp:HiddenField ID="hdnSelectRow" runat="server" />
                <asp:HiddenField ID="hdnGetAllid" runat="server" />

                <dxGridview:ASPxGridView ID="grv_LoanRegister" runat="server" ClientInstanceName="grv_LoanRegister"
                    KeyFieldName="Loan_ID" EnableCallBacks="False" AutoGenerateColumns="False"
                    OnHtmlRowCreated="grv_LoanRegister_HtmlRowCreated" Width="100%">
                    <Columns>
                        <dxGridview:GridViewDataColumn VisibleIndex="0" Width="30px" HeaderStyle-VerticalAlign="Middle"
                            HeaderStyle-HorizontalAlign="Center" CellStyle-VerticalAlign="Middle" CellStyle-HorizontalAlign="Center">
                            <Settings AllowAutoFilter="false" />
                            <Settings AllowAutoFilter="false" />
                            <HeaderTemplate>
                                <input id="chkSelectAll" runat="server" type="checkbox" onclick="SelectAllOnThisPage(this)" />
                            </HeaderTemplate>
                            <DataItemTemplate>
                                <input id="chkSelect" runat="server" type="checkbox" onclick="SelectOnRow(this)"
                                    disabled='<%#DataBinder.Eval(Container.DataItem,"flag").ToString()=="0" %>' accesskey='<%# Eval("Loan_ID") %>' />
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                        </dxGridview:GridViewDataColumn>


                        <dxGridview:GridViewDataTextColumn FieldName="Loan_ID" VisibleIndex="1"
                            Visible="False">
                            <DataItemTemplate>
                                <asp:Label ID="AppDate" Text='<%# Eval("Loan_ID") %>'  runat="server"></asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataTextColumn FieldName="Employee Id" VisibleIndex="2" Caption="Employee Id"
                            Width="100px">
                            <Settings AllowDragDrop="False" />
                            <DataItemTemplate>
                                <asp:Label ID="lblempid" runat="server" Text='<%# Bind("Employee_Code_Id") %>' Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataTextColumn FieldName="Employee_FirstName" VisibleIndex="3" 
                            Width="250px">
                            <Settings AllowDragDrop="False" />
                            <DataItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("Employee_FirstName") %>' Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataTextColumn FieldName="Loan_Amount" VisibleIndex="4" Width="150px">
                            <Settings AllowDragDrop="False" />
                            <DataItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# Bind("Loan_Amount") %>' Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataColumn FieldName="Total_DeductionMonth" VisibleIndex="5" Width="140px">
                            <Settings AllowAutoFilter="False" AllowDragDrop="False" />
                            <DataItemTemplate>
                                <asp:Label ID="lbl_Duration" Text='<%# Eval("Total_DeductionMonth") %>' runat="server"></asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                        </dxGridview:GridViewDataColumn>
                        <dxGridview:GridViewDataTextColumn FieldName="Deduction_StartMonth" VisibleIndex="6" Width="220px">
                            <Settings AllowDragDrop="False" />
                            <DataItemTemplate>
                                <asp:Label ID="lbl_LeaveType" Text='<%# Eval("Deduction_StartMonth") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataTextColumn FieldName="Monthly_DeductAmount" VisibleIndex="7" Width="122px">
                            <Settings AllowDragDrop="False" AllowAutoFilter="False" />
                            <DataItemTemplate>
                                <asp:Label ID="lbl_Status" Text='<%# Eval("Monthly_DeductAmount") %>' runat="server"></asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataTextColumn FieldName="Loan_BalanceAmount" VisibleIndex="8" Width="200px">
                            <Settings AllowAutoFilter="False" AllowDragDrop="false" />
                            <DataItemTemplate>
                                <asp:Label ID="lbl_Reason" Text='<%# Eval("Loan_BalanceAmount") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataTextColumn FieldName="Loan_Description" VisibleIndex="9" Width="200px">
                            <Settings AllowAutoFilter="False" AllowDragDrop="false" />
                            <DataItemTemplate>
                                <asp:Label ID="lbl_Remarks" Text='<%# Eval("Loan_Description") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Wrap="True" />

                        </dxGridview:GridViewDataTextColumn>

                        <dxGridview:GridViewDataColumn HeaderStyle-VerticalAlign="Middle" HeaderStyle-HorizontalAlign="Center"
                            CellStyle-VerticalAlign="Middle" CellStyle-HorizontalAlign="Center" Width="32px" VisibleIndex="9">
                            <Settings AllowAutoFilter="false" />
                            <DataItemTemplate>
                                <a data-toggle="modal" title='<%# Session["View"] %>' data-placement="top" data-target="#myModal" onclick="return navi('TA_UI_Master_LoanEntryView.aspx?Loan_Id=<%# Eval("Loan_ID") %>')"
                                    href="#"><span class="btn btn-defalut view-icons"></span></a>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                        </dxGridview:GridViewDataColumn>

                        <dxGridview:GridViewDataColumn HeaderStyle-VerticalAlign="Middle" HeaderStyle-HorizontalAlign="Center"
                            CellStyle-VerticalAlign="Middle" CellStyle-HorizontalAlign="Center" Width="35px">
                            <Settings AllowAutoFilter="false" />
                            <DataItemTemplate>
                                <asp:LinkButton ID="btnEdit" runat="server" ToolTip='<%# Session["Edit"] %>' data-toggle="tooltip"
                                    OnClick="EditLinkButton_Click" CommandName='<%# Eval("Loan_Id") %>' data-placement="top"
                                    CssClass="btn btn-defalut edit-icons" Style="color: #3C8DBC"></asp:LinkButton>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="center" Wrap="true" CssClass="empheader" />
                        </dxGridview:GridViewDataColumn>

                        <dxGridview:GridViewDataColumn HeaderStyle-VerticalAlign="Middle" HeaderStyle-HorizontalAlign="Center"
                            CellStyle-VerticalAlign="Middle" CellStyle-HorizontalAlign="Center" Width="32px" VisibleIndex="10">
                            <Settings AllowAutoFilter="false" />
                            <DataItemTemplate>
                                <asp:LinkButton ID="btnDelete" runat="server" ValidationGroup='<%# Bind("Employee_Id") %>'
                                    ToolTip='<%# Session["Delete"] %>' data-toggle="tooltip" OnClick="btn_delete_Click" CommandName='<%# Eval("Loan_ID") %>'
                                    CommandArgument='<%# Bind("Employee_FirstName") %>' data-placement="top" CssClass="btn btn-defalut del-icons"
                                    Style="color: Red" OnClientClick="return Delete_Conf();"></asp:LinkButton>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                        </dxGridview:GridViewDataColumn>
                    </Columns>
                    <SettingsPager PageSize="10">
                        <PageSizeItemSettings Visible="true" ShowAllItem="true" Items="10,20,50,100,200" />
                    </SettingsPager>
                    <Settings ShowFilterRow="true" ShowFilterRowMenu="true" HorizontalScrollBarMode="Auto" ShowGroupPanel="true" VerticalScrollBarMode="Hidden" VerticalScrollableHeight="400" />
                    <SettingsText EmptyDataRow="No Records Found" />
                    <SettingsCustomizationWindow Enabled="True" />
                    <SettingsBehavior AutoExpandAllGroups="false" ColumnResizeMode="Control" />
                    <SettingsBehavior AllowDragDrop="true" />
                    <Styles AlternatingRow-CssClass="table-bg">
                    </Styles>
                </dxGridview:ASPxGridView>
                <dxGridview:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="grv_LeaveApplication">
                    <PageFooter Right="[Page # of Pages #]">
                    </PageFooter>
                </dxGridview:ASPxGridViewExporter>
            </div>
             <div class="row">
                            <div class="col-md-12">
                                <div class="pull-right-button">
                                    <asp:LinkButton ID="btn_Add" CssClass="btn add-btn fa-plus" runat="server" OnClick="btn_Add_Click" />
                                    <asp:LinkButton ID="btn_Delete" CssClass="but" runat="server" CausesValidation="False"
                                        OnClientClick="return confirmdelete(this.form);" Visible="false" Style="display: none" />
                                    <asp:LinkButton ID="btn_Restore" CssClass="btn btn-primary fa fa-recycle" runat="server"
                                        OnClientClick="return RestoreData();" OnClick="btn_Restore_Click" Visible="false" />
                                    <asp:HiddenField ID="hdnDeletedData" runat="server" />
                                    <asp:LinkButton ID="btn_PermanentDelete" CssClass="btn del-btn fa-trash-o" runat="server"
                                        OnClientClick="return Permanentconfirmdelete(this.form);" OnClick="btn_PermanentDelete_Click" />
                                    <asp:LinkButton ID="btn_Cancel" CssClass="btn btn-primary fa fa-hand-o-left" runat="server"
                                        Visible="false" OnClick="btn_Cancel_Click" />
                                    <%--<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="SelectAllLeavePolicy"
                                        TypeName="LeaveEventData">
                                        <SelectParameters>
                                            <asp:SessionParameter Name="strUserGroupName" SessionField="UserGroupName" Type="String" />
                                        </SelectParameters>
                                    </asp:ObjectDataSource>--%>
                                </div>
                            </div>
                        </div>

            <asp:Timer ID="Timer1" runat="server" Interval="180000"
                OnTick="Timer1_Tick">
            </asp:Timer>
        </div>
        <!--RES TABLE-->
       
    </div>
    <script type="text/javascript">
        function navi(loc) {
            debugger;
            document.getElementById('ctl00_BodyContentPH_iframePopup').src = loc;
            //            window.location=loc;
            return false;
        }
        function navi_Angler(loc) {
            //document.getElementById('ctl00_BodyContentPH_iframePopup').src = loc;
            window.location = loc;
            return false;
        }
        function Delete_Conf() {
            //Alert_AreyousuretoDelete
            return confirm('Are you sure to Delete ?');
        }
        function ShowPopup() {
            $("#btnShowPopup").click();
        }
    </script>
    <script type="text/javascript">
        //values for check date
        var Monthfourdigit = 'Please enter valid date as month, day, and four digit year : Format MM/dd/yyyy.';
        //Adding this line var Datefourdigit='Please enter valid date with correct format dd/MM/yyyy'; as newly
        var Datefourdigit = 'Please enter valid date with correct format dd/MM/yyyy';
        var Invalidyearentry = 'Invalid year entry';
        var Invalidmonthentry = 'Invalid month entry';
        var Invaliddateentry = 'Invalid date entry';
        var DateformatDDMONYYYY = 'Incorrect date format. Enter as DD-MON-YYYY';
        var Entertime = 'Enter time';
        var Valueforhours = 'Invalid value for hours:';
        var Invalidvalueforminutes = 'Invalid value for minutes:';
        var Invalidtimeformat = 'Invalid time format:';
        var EntervalidDateandTime = 'Please enter valid Date and Time';
        var ValiddatemonthMMDDYYHHMM = 'Please enter valid Date and Time MM/dd/yyyy HH:mm';
        var ValiddatemonthMMDDYYHHMMTT = 'Please enter valid Date and Time MM/dd/yyyy hh:mm tt';
        var EntervalidDateandTime = 'Please enter valid Date and Time';
        var Invalidvalueforhours = 'Invalid value for hours:';
        var Invalidvalueforminites = 'Invalid value for minutes:';
        var MaxLength = "Maximum length is ";
        var EnterDetails = 'Please enter any of the above details';
        var FillFromandToDate = 'Please enter both the From and To Date';

        function MaxLengthh(maxLength) {
            MaxLength = maxLength;
        }

        function SetAlertCheckDate(monthfourdigit, datefourdigit, invalidyearentry, invalidmonthentry, invaliddateentry, dateformatDDMONYYYY, entertime, valueforhours, invalidvalueforminutes, invalidtimeformat, entervalidDateandTime, validdatemonthMMDDYYHHMM, validdatemonthMMDDYYHHMMTT, entervalidDateandTime, invalidvalueforhours, invalidvalueforminites) {
            Monthfourdigit = monthfourdigit;
            Datefourdigit = datefourdigit;
            Invalidyearentry = invalidyearentry;
            Invalidmonthentry = invalidmonthentry;
            Invaliddateentry = invaliddateentry;
            DateformatDDMONYYYY = dateformatDDMONYYYY;
            Entertime = Entertime;
            Valueforhours = valueforhours;
            Invalidvalueforminutes = invalidvalueforminutes;
            Invalidtimeformat = invalidtimeformat;
            EntervalidDateandTime = entervalidDateandTime;
            ValiddatemonthMMDDYYHHMM = validdatemonthMMDDYYHHMM;
            ValiddatemonthMMDDYYHHMMTT = validdatemonthMMDDYYHHMMTT;
            EntervalidDateandTime = entervalidDateandTime;
            Invalidvalueforhours = invalidvalueforhours;
            Invalidvalueforminites = invalidvalueforminites;
        }
        function SetAlertMessages(enterDetails, fillFromandToDate) {
            EnterDetails = enterDetails;
            FillFromandToDate = fillFromandToDate;
        }
        function SelectAllOnThisPage(chkSelectAll) {
            var hdnSelectRow = document.getElementById('<%= hdnSelectRow.ClientID %>');
            var hdnSelectAll = document.getElementById('<%= hdnGetAllid.ClientID %>');
            if (chkSelectAll.checked == true) {
                for (var i = 0; i < grv_TaxPolicy.pageRowCount; i++) {
                    if (document.getElementById('ctl00_BodyContentPH_grv_LoanRegister_cell' + (i + grv_TaxPolicy.visibleStartIndex) + '_0_chkSelect').disabled == false) {
                        document.getElementById('ctl00_BodyContentPH_grv_LoanRegister_cell' + (i + grv_TaxPolicy.visibleStartIndex) + '_0_chkSelect').checked = true;
                        var hdnUserId = document.getElementById('ctl00_BodyContentPH_grv_LoanRegister_cell' + (i + grv_TaxPolicy.visibleStartIndex) + '_0_chkSelect').accessKey;
                        var hdnSelectRow = document.getElementById('<%= hdnSelectRow.ClientID %>');
                    var removeId = hdnSelectRow.value.split(",");
                    if (hdnUserId != "" && !Array.contains(removeId, hdnUserId)) {
                        if (hdnSelectRow.value != "")
                            hdnSelectRow.value += ",";
                        hdnSelectRow.value += hdnUserId;
                    }
                }
            }
        }
        else {
            for (var i = 0; i < grv_TaxPolicy.pageRowCount; i++) {
                document.getElementById('ctl00_BodyContentPH_grv_LoanRegister_cell' + (i + grv_TaxPolicy.visibleStartIndex) + '_0_chkSelect').checked = false;
            }
            hdnSelectRow.value = '';
        }
    }
    function WeekdayValidation() {
        var EmpId = document.getElementById('ctl00_BodyContentPH_txtEmployeeId');
        var EmpName = document.getElementById('ctl00_BodyContentPH_txt_EmpName');
        var weekDay = document.aspnetForm.ctl00_BodyContentPH_txtLeaveStartDate;
        var weekDay2 = document.aspnetForm.ctl00_BodyContentPH_txtLeaveEndDate;
        var swipCard = document.getElementById('ctl00_BodyContentPH_txtSwipeCard');
        if (EmpName == null && EmpId == null && weekDay.value == '' && weekDay2.value == '' && swipCard == null) {
            alert(EnterDetails);
            return false;
        }
        else if ((weekDay.value == '' && weekDay2.value != '') || (weekDay.value != '' && weekDay2.value == '')) {
            alert(FillFromandToDate);
            return false;
        }
        var DateFormat = document.getElementById('ctl00_BodyContentPH_Hidden1').value;
        if (weekDay.value != '') {
            if (checkDate(weekDay, DateFormat, Monthfourdigit, Datefourdigit, Invalidyearentry, Invalidmonthentry, Invaliddateentry, DateformatDDMONYYYY, Entertime, Valueforhours, Invalidvalueforminutes, Invalidtimeformat, EntervalidDateandTime, ValiddatemonthMMDDYYHHMM, ValiddatemonthMMDDYYHHMMTT, EntervalidDateandTime, Invalidvalueforhours, Invalidvalueforminites)) {
                if (weekDay2.value != '') {
                    if (checkDate(weekDay2, DateFormat, Monthfourdigit, Datefourdigit, Invalidyearentry, Invalidmonthentry, Invaliddateentry, DateformatDDMONYYYY, Entertime, Valueforhours, Invalidvalueforminutes, Invalidtimeformat, EntervalidDateandTime, ValiddatemonthMMDDYYHHMM, ValiddatemonthMMDDYYHHMMTT, EntervalidDateandTime, Invalidvalueforhours, Invalidvalueforminites)) {
                    }
                    else {
                        return false;
                    }
                }
                else {
                    document.getElementById('ctl00_BodyContentPH_txtLeaveEndDate').focus();
                    return false;
                }
            }
            else {
                return false;
            }
        }
    }
    </script>
</asp:Content>

