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

<%@ Register Src="../UserControls/TA_uc_OrgLevelFilter_Updated.ascx" TagName="TA_uc_OrgLevel_Filter"
    TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="conBonusLeaveAllocation" ContentPlaceHolderID="BodyContentPH" runat="Server">
    <!--[if gt IE 5.5]>
	<link rel="stylesheet" type="text/css" href="../css/ProgressforIE.css" />    

<![endif]-->
    <link rel="stylesheet" href="../css/ProgressBar.css" type="text/css" media="all" />

    <script type="text/javascript" language="javascript">

        var BonusAndLeave = "Bonus Leave Quota should not be less than Bonus Leave Taken";
        var MaxLength = "Maximum length is ";
        function MaxLengthh(maxLength) {
            MaxLength = maxLength;
        }
        function SetAlertMessages(bonusAndLeave) {
            BonusAndLeave = bonusAndLeave;
        }
        function CompareBonusLeave(txtBonusLeaveQuota) {
            var BonusLeaveQuota;
            var BonusLeaveTaken;
            BonusLeaveQuota = document.getElementById(txtBonusLeaveQuota).value;
            BonusLeaveTaken = document.getElementById(txtBonusLeaveQuota.replace('txt_BonusLeaveQuota', 'hdnBonusLeaveTaken')).value;
            if (parseInt(BonusLeaveQuota) < parseInt(BonusLeaveTaken)) {
                document.getElementById(txtBonusLeaveQuota).focus();
                alert(BonusAndLeave);
            }
        }

    </script>

    <div class="content-header">
        <h1 style="background-image: url('../dist/img/bonus-leave.png'); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lblBonusLeave" runat="server"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">
        <div class="row" style="display: none">
            <div class="col-md-3" style="color: Red">
                <span class="fa fa-asterisk"></span>
                
            </div>
        </div>
        <asp:UpdatePanel ID="upLeave" runat="server">
            <ContentTemplate>
                <asp:Panel ID="pnlProgress" runat="server" Style="display: none;">
                    <asp:Panel ID="pnlLoading" runat="server" HorizontalAlign="center">
                        <div class="InsideProgressBar">
                            <div class="row" style="margin-top: 10px">
                                <img src="../dist/img/logo-Progress.png" />
                            </div>
                            <div class="row" style="min-width: 280px">
                                <img src="../dist/img/default.gif" style="width: 100px" />
                            </div>
                            <div class="row" style="margin-bottom: 10px">
                                <asp:Label ID="lblLoading" runat="server" ForeColor="black" Style="text-align: center"
                                    Text="Please Wait..." Font-Bold="true" Font-Size="12px" Font-Italic="true" Font-Family="Arial"></asp:Label>
                            </div>
                            <div class="clear clearfix">
                            </div>
                        </div>
                    </asp:Panel>
                </asp:Panel>
                <asp:HiddenField ID="hdnProgress" runat="server" />
                <cc1:ModalPopupExtender ID="popupProgress" runat="server" TargetControlID="hdnProgress"
                    BackgroundCssClass="ModalPopup" PopupControlID="pnlProgress" BehaviorID="popupProgress">
                </cc1:ModalPopupExtender>
            </ContentTemplate>
            <Triggers>
                <asp:PostBackTrigger ControlID="btn_Save" />
            </Triggers>
        </asp:UpdatePanel>
        <div class="inr-ftr">
            <div class="row">
                <div class="col-sm-12">
                    <div class="inr-fil-text pull-left">
                        <asp:Label ID="lblFilter" runat="server" Text="Filter"></asp:Label>
                    </div>
                    <div class="pull-right">
                        <h6>
                            <span style="color: Red">|</span><span style="padding-left: 10px; padding-right: 10px">
                                <asp:Label ID="lbl_IndicatesMandatoryFields" runat="server"></asp:Label>
                                (1 No.)</span>
                        </h6>
                    </div>
                </div>
                <div class="clearfix">
                </div>
            </div>
        </div>
        <div class="form-horizontal">
            <div class="emp-filter">
                <div class="row">
                    <div class="col-md-12">
                        <div id="divEmployeeDetails" runat="server">
                            <div class="form-group" style="display: none;">
                                <div class="col-md-2">
                                    <asp:Label ID="lblEmpSwipe" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onpaste="return true" ID="txtSwipeCard" MaxLength="20" runat="server"
                                        CssClass="form-control" 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 class="col-md-3">
                                </div>
                                <div class="col-md-3">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-md-2">
                                    <asp:Label ID="lblEmployeeName" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onpaste="return true" ID="txtEmployeeName" runat="server" CssClass="form-control"
                                        onkeypress="return employeename_singlequotes_maxlength(event,this,50,MaxLength);"
                                        MaxLength="50"></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="txtEmployeeName">
                                    </cc1:AutoCompleteExtender>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-2">
                                    <asp:Label ID="lblEmployeeId" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onpaste="return true" ID="txtEmployeeId" runat="server" CssClass="form-control"
                                        onkeypress="return acceptCharsNum_MaxLength(event,this,15,MaxLength);" MaxLength="15"></asp:TextBox><input
                                            id="Hidden2" type="hidden" value='<% Response.Write(Session["ITimeFormat"].ToString()); %>' />
                                    <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>
                            <div class="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" Text="-Select-" Selected="True"></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" Text="-Select-" Selected="True"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="clearfix">
                    </div>
                    <div class="row">
                        <div class="line16">
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="row">
                            <div class="col-md-12">
                                <asp:PlaceHolder ID="PlaceHolderBonusLeave" runat="server">
                                    <uc1:TA_uc_OrgLevel_Filter ID="TA_uc_OrgLevel_Filter1" runat="server" />
                                </asp:PlaceHolder>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                            </div>
                            <div class="col-md-5">
                                <div class="pull-right-button">
                                    <asp:LinkButton ID="btn_View" CssClass="btn save-btn fa-eye" runat="server" Text="VIEW"
                                        OnClick="btn_View_Click" CausesValidation="false" />
                                    <input id="Hidden1" type="hidden" value='<% Response.Write(Convert.ToString(Session["IDateFormat"])); %>' />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="border-table new-space" id="divEmployeeGrid" runat="server" visible="false">
                <div class="row">
                    <div class="col-md-12">
                        <div class="table-responsive" style="padding-bottom: 15px">
                            <asp:GridView ID="gvEmpBonusLeave" CssClass="table table-responsive table-bordered"
                                runat="server" AllowPaging="true" AllowSorting="true" AutoGenerateColumns="False"
                                OnPageIndexChanged="gvEmpBonusLeave_PageIndexChanged" OnPageIndexChanging="gvEmpBonusLeave_PageIndexChanging"
                                OnSorting="gvEmpBonusLeave_Sorting" Style="margin-top: 15px">
                                <Columns>
                                    <asp:TemplateField HeaderText="EmpAutoId" Visible="false" HeaderStyle-VerticalAlign="Middle"
                                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Names="robotoregular" HeaderStyle-CssClass="empheader">
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_EmpAutoId" Text='<%# Eval("EmpAutoId") %>' runat="server"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Employee Id" SortExpression="EmployeeCodeId" HeaderStyle-VerticalAlign="Middle"
                                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-ForeColor="black" HeaderStyle-Font-Names="robotoregular"
                                        HeaderStyle-CssClass="empheader">
                                        <ItemTemplate>
                                            <asp:Label ID="Label1" Text='<%# Eval("EmployeeCodeId") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                            <asp:Label ID="lbl_EmployeeId" Text='<%# Eval("EmployeeId") %>' runat="server" Visible="false"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Employee Name" SortExpression="EmpName" HeaderStyle-VerticalAlign="Middle"
                                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-ForeColor="black" HeaderStyle-Font-Names="robotoregular"
                                        HeaderStyle-CssClass="empheader">
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_EmpName" Text='<%# Eval("EmpName") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Department" HeaderStyle-ForeColor="black" SortExpression="Department"
                                        HeaderStyle-CssClass="empheader" ItemStyle-CssClass="table-icons">
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_Department" Text='<%# Eval("Department") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Bonus Leave Quota" SortExpression="BonusLeaveQuota"
                                        HeaderStyle-CssClass="empheader" ItemStyle-CssClass="table-icons" HeaderStyle-ForeColor="black">
                                        <ItemTemplate>
                                            <center>
                                                <asp:TextBox onpaste="return true" ID="txt_BonusLeaveQuota" Style="min-width: 30px;max-width:150px" CssClass="form-control"
                                                    Text='<%# Eval("BonusLeaveQuota") %>' runat="server" MaxLength="3" EnableViewState="true"> </asp:TextBox><br />
                                            </center>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Leave Taken" HeaderStyle-ForeColor="black" SortExpression="BonusLeaveTaken"
                                        HeaderStyle-CssClass="empheader" ItemStyle-CssClass="table-icons">
                                        <ItemTemplate>
                                            <center>
                                                <asp:Label ID="lbl_BonusLeaveTaken" Text='<%# Eval("BonusLeaveTaken") %>' runat="server"></asp:Label>
                                            </center>
                                            <asp:HiddenField ID="hdnBonusLeaveTaken" runat="server" Value='<%# Eval("BonusLeaveTaken") %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Leave Available" SortExpression="BonusLeaveAvailable"
                                        HeaderStyle-ForeColor="black" HeaderStyle-CssClass="empheader" ItemStyle-CssClass="table-icons">
                                        <ItemTemplate>
                                            <center>
                                                <asp:Label ID="lbl_BonusLeaveAvailable" Text='<%# Eval("BonusLeaveAvailable") %>'
                                                    runat="server"></asp:Label>
                                            </center>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <EmptyDataTemplate>
                                    <asp:Label ID="lblNoRecords" runat="server" OnLoad="GetEmptyText"></asp:Label>
                                </EmptyDataTemplate>
                                <RowStyle Height="30px" CssClass="table-bg" BorderColor="#C5DFFC" />
                                <PagerStyle Font-Overline="False" HorizontalAlign="Right" CssClass="GridPager" />
                                <PagerSettings FirstPageText="<<" LastPageText=">>" Mode="NumericFirstLast" NextPageText=">"
                                    PreviousPageText="<" />
                                <AlternatingRowStyle BackColor="white" />
                            </asp:GridView>
                            <asp:ValidationSummary ID="vsBonusLeaveSummary" runat="server" ShowMessageBox="True"
                                ShowSummary="false" />
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="pull-right-button">
                            <asp:LinkButton ID="btn_Save" CssClass="btn save-btn fa-floppy-o" runat="server"
                                OnClientClick="$find('popupProgress').show();" OnClick="btn_Save_Click" Style="margin-top: 15px" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
