<%@ page language="C#" autoeventwireup="true" maintainscrollpositiononpostback="true" inherits="Transactions_TA_UI_Transactions_GroupLeavePolicy_Popup, App_Web_2srrmuu0" %>

<%--<%@ Register TagPrefix="dxGridview" Namespace="DevExpress.Web" Assembly="DevExpress.Web.v8.2" %>--%>
<%@ Register Src="../UserControls/TA_uc_OrgLevelFilter_Updated.ascx" TagName="TA_uc_OrgLevel_Filter"
    TagPrefix="uc1" %>
<html xmlns="http://www.w3.org/1999/xhtml" runat="server" id="htmlSelectpop">
<head>
    <title>TimeCheck</title>
    <link id="stylebootstrap" rel="stylesheet" runat="server" type="text/css" />
    <link id="stylefontawesome" rel="stylesheet" runat="server" type="text/css" />
    <link id="styleAdminLTE" rel="stylesheet" runat="server" type="text/css" />
    <link id="stylecustom" rel="stylesheet" runat="server" type="text/css" />
    <link id="stylefonts" rel="stylesheet" runat="server" type="text/css" />
    <link id="styleAutocomp" rel="stylesheet" runat="server" type="text/css" />
    <link id="styleselect2" rel="stylesheet" runat="server" type="text/css" />
    <link href="../css/ProgressBar.css" rel="stylesheet" type="text/css" />
    <link href="../bootstrap/font-awesome/css/build.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../js/jquery-1.2.min.js"></script>
    <script language="javascript" src="../js/jquery.min.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="../js/chkbox_delete.js"></script>
    <script language="javascript" type="text/javascript" src="../js/lockkeys.js"></script>
    <script language="javascript" type="text/javascript" src="../js/maxLength.js"></script>
    <script language="javascript" src="../js/jquery.autocomplete.js" type="text/javascript"></script>
    <script type="text/javascript" src="../bootstrap/js/1.4.3/jquery.min.js"></script>
    <script src="../bootstrap/js/1.8.5/jquery-ui.min.js" type="text/javascript"></script>
    <script src="../plugins/jQuery/jQuery-2.1.4.min.js" type="text/javascript"></script>
    <script src="../plugins/select2/select2.full.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#<%= txtEmpCodeID.ClientID %>").autocomplete({
                source: function (request, response) {
                    $.getJSON("../AutoCompleteByEmployeeId.ashx?EmpAutoid=" + '<%= Convert.ToString(Session["EmpAutoID"]) %>', {
                        term: extractLast(request.term)
                    }, response);
                },
                search: function () {
                    // custom minLength
                    var term = extractLast(this.value);
                    if (term.length < 1) {
                        return false;
                    }
                },
                focus: function () {
                    // prevent value inserted on focus
                    return false;
                },
                select: function (event, ui) {
                    var terms = split(this.value);
                    // remove the current input
                    terms.pop();
                    // add the selected item
                    terms.push(ui.item.value);
                    // add placeholder to get the comma-and-space at the end
                    terms.push("");
                    this.value = terms.join(",");
                    return false;
                }
            });
            function split(val) {
                return val.split(/,\s*/);
            }
            function extractLast(term) {
                return split(term).pop();
            }
        });
            $(function () {
                $("#<%= txtEmployeeName.ClientID %>").autocomplete({
                    source: function (request, response) {
                        $.getJSON("../AutoCompleteByName.ashx?EmpAutoid=" + '<%= Convert.ToString(Session["EmpAutoID"]) %>', {
                            term: extractLast(request.term)
                        }, response);
                    },
                    search: function () {
                        // custom minLength
                        var term = extractLast(this.value);
                        if (term.length < 1) {
                            return false;
                        }
                    },
                    focus: function () {
                        // prevent value inserted on focus
                        return false;
                    },
                    select: function (event, ui) {
                        var terms = split(this.value);
                        // remove the current input
                        terms.pop();
                        // add the selected item
                        terms.push(ui.item.value);
                        // add placeholder to get the comma-and-space at the end
                        terms.push("");
                        this.value = terms.join(",");
                        return false;
                    }
                });
                function split(val) {
                    return val.split(/,\s*/);
                }
                function extractLast(term) {
                    return split(term).pop();
                }
            });
    </script>
    <script type="text/javascript" language="javascript">
        var MaxLength = "Maximum length is ";
        function MaxLengthh(maxLength) {
            MaxLength = maxLength;
        }
        var LeavePolicy = "Select Leave Policy";
        function SelectLeavePolicy(Leavepolicy) {
            LeavePolicy = Leavepolicy;
        }
        function SelectLeavePolicys() {
            if (document.getElementById('ddlLeavePolicy').value == '0') {
                alert(LeavePolicy);
                return false;
            }
        }
    </script>
</head>
<body>
    <form id="aspnetForm" runat="server">
        <div class="content">
            <div class="panel-group" id="accordion">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-sm-6">
                                <h4>
                                    <asp:Label ID="lblFilter" runat="server" Text="Filter"></asp:Label>
                                </h4>
                            </div>
                            <div class="col-sm-6">
                                <div class="pull-right">
                                    <h6>
                                        <span><span style="color: Red">|</span><span style="padding-left: 10px; padding-right: 10px">
                                            <asp:Label ID="lbl_IndicatesMandatoryFields" runat="server">
                                            </asp:Label>
                                            (2 No.)</span>
                                    </h6>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="clearfix">
                </div>
                <div class="emp-filter">
                    <div class="row">
                        <div class="form-horizontal">
                            <div class="col-md-12">
                                <div class="row">
                                    <div class="col-md-12">
                                        <uc1:TA_uc_OrgLevel_Filter ID="TA_uc_OrgLevel_Filter1" runat="server" EnableViewState="true" />
                                    </div>
                                </div>
                                <div class="clearfix">
                                </div>
                                <div class="row">
                                    <div class="row">
                                        <div class="line16">
                                        </div>
                                    </div>
                                </div>
                                <div class="row  form-group">
                                    <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="txtEmpCodeID" Style="resize: none;" CssClass="form-control"
                                            autocomplete="off" runat="server" TextMode="MultiLine">
                                        </asp:TextBox>
                                    </div>
                                    <div class="col-md-1">
                                    </div>
                                    <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" TextMode="MultiLine"
                                            OnClientPopulated="dd" CssClass="form-control" Style="resize: none;">
                                        </asp:TextBox>
                                    </div>
                                </div>
                                <div class="row  form-group">
                                    <div class="col-md-2">
                                        <asp:Label ID="lblLeavePolicy" runat="server" Text="Leave Policy"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:DropDownList ID="ddlLeavePolicy" runat="server" CssClass="form-control select2 Man-dat"
                                            AppendDataBoundItems="true">
                                        </asp:DropDownList>
                                    </div>
                                    <div class="col-md-1">
                                    </div>
                                    <div class="col-md-2">
                                        <asp:Label ID="lblDesignation" runat="server"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:DropDownList ID="ddlDesignation" runat="server" CssClass="form-control select2" AppendDataBoundItems="true">
                                            <asp:ListItem Value="0" Selected="True" Text="All"></asp:ListItem>
                                        </asp:DropDownList>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-2">
                                        <asp:Label ID="lblPolicyAllocated" runat="server" Text="Policy"></asp:Label>
                                    </div>
                                    <div class="col-md-1">
                                        <asp:RadioButton ID="rbtnAllocated" runat="server" Text="Allocated" GroupName="PolicyAllocation"
                                            CssClass="radio radio-primary" />
                                    </div>
                                    <div class="col-md-5">
                                        <asp:RadioButton ID="rbtnNotAllocated" runat="server" Text="Not Allocated" Checked="true" GroupName="PolicyAllocation"
                                            CssClass="radio radio-primary" />
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-5">
                                    </div>
                                    <div class="col-md-6">
                                        <div class="pull-left">
                                            <asp:Label ID="lblError" Visible="true" runat="server" Style="color: #ff0000"></asp:Label>
                                        </div>
                                        <div class="pull-right-button">
                                            <asp:LinkButton ID="butGo" CssClass="btn save-btn fa-angle-right" runat="server"
                                                CausesValidation="False" OnClick="butGo_Click" OnClientClick="return SelectLeavePolicys();" />
                                        </div>
                                    </div>
                                </div>
                                <div class="row  form-group">
                                    <div class="col-md-4">
                                        <span style="color: red">Note: Select Company alone here, not all levels</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="border-table new-space" id="divShift" runat="server" visible="false">
                    <div class="table-responsive">
                        <asp:GridView ID="grv_Shift" CssClass="table das-table1" Width="100%" runat="server"
                            PageSize="10" AllowPaging="True" AutoGenerateColumns="False" OnPageIndexChanging="grv_Shift_PageIndexChanging"
                            OnRowDataBound="grv_Shift_RowDataBound" Font-Size="13px">
                            <Columns>
                                <asp:TemplateField HeaderStyle-CssClass="empheader">
                                    <HeaderTemplate>
                                        <%--<asp:Label ID="lblCheckAll" Text="All" runat="server"></asp:Label>--%>
                                        <asp:CheckBox ID="checkall" runat="server" Text="" AutoPostBack="true" OnCheckedChanged="grv_CheckAll_CheckedChanged" />
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="deletethis" runat="server" AutoPostBack="true" OnCheckedChanged="grv_Check_CheckedChanged"></asp:CheckBox>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="center" />
                                    <HeaderStyle HorizontalAlign="center" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Employee Id" HeaderStyle-CssClass="empheader GridColumn50">
                                    <ItemTemplate>
                                        <asp:Label ID="lbl_EmpId" Text='<%# Eval("Employee_Code_Id")%>' runat="server"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Employee Name" HeaderStyle-CssClass="empheader GridColumn50">
                                    <ItemTemplate>
                                        <asp:Label ID="lbl_EmpName" Text='<%# Eval("Employee Name")%>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; cursor: pointer; width: 320px; word-wrap: break-word; display: inline-block;"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Date Of Joining" HeaderStyle-CssClass="empheader GridColumn50">
                                    <ItemTemplate>
                                        <asp:Label ID="lbl_EmpDateOfJoining" Text='<%# Eval("DateOfJoining", "{0:MM/dd/yyyy}") %>'
                                            runat="server"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <RowStyle Height="30px" CssClass="table-bg" BorderColor="#C5DFFC" />
                            <PagerStyle Font-Overline="False" CssClass="GridPager" />
                            <PagerSettings FirstPageText="<<" LastPageText=">>" Mode="NumericFirstLast" NextPageText=">"
                                PreviousPageText="<" />
                            <AlternatingRowStyle BackColor="white" />
                        </asp:GridView>
                    </div>
                    <div class="clearfix">
                    </div>
                    <div class="row page-nos">
                        <div class="col-md-6">
                        </div>
                        <div class="col-md-6 page-button">
                            <%--Add Cancel button Add button here--%>
                            <asp:LinkButton ID="btn_done1" CssClass="btn save-btn fa-check-circle-o" runat="server"
                                CausesValidation="False" OnClick="btn_done1_Click" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script>
            $(".select2").select2();
        </script>
    </form>
</body>
</html>
