<%@ page language="C#" autoeventwireup="true" inherits="Transactions_PayrollReprocessPopup, App_Web_cqjeffom" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" id="htmlprocessPop" runat="server">
<head id="Head1" runat="server">
    <title>TimeCheck</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
        name="viewport" />
    <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="styleselect2" rel="stylesheet" runat="server" type="text/css" />
    <link id="styleGrid" rel="stylesheet" runat="server" type="text/css" />
    <link id="styleAutocomp" rel="stylesheet" runat="server" type="text/css" />

    <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 type="text/javascript">
        $(function () {

            $("#<%= txtEmployeeId.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 language="javascript" type="text/javascript" src="../js/Popup.js"></script>

    <script language="javascript" type="text/javascript" src="../js/chkbox_delete.js"></script>

    <script language="javascript" src="../js/jquery.min.js" type="text/javascript"></script>

    <%--<script language="javascript" src="../js/anytime.js" type="text/javascript"></script>--%>

    <script language="javascript" src="../js/fancydropdown.js" type="text/javascript"></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 type="text/javascript">
        $(function () {

            $("#<%= txtEmployeeId.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>

</head>
<body>
    <form id="aspnetForm" runat="server">
        <div class="content">
            <div class="inr-ftr">
            </div>
            <div class="emp-filter">
                <div class="form-horizontal">
                    <div class="row form-group">
                        <div class="col-md-2">
                            <asp:Label ID="lblId" runat="server" Text="Employee ID"></asp:Label>
                        </div>
                        <div class="col-md-3">
                            <asp:TextBox onpaste="return true" ID="txtEmployeeId" runat="server" MaxLength="10"
                                CssClass="form-control"></asp:TextBox>
                        </div>
                        <div class="col-md-1">
                        </div>
                        <div class="col-md-2">
                            <asp:Label ID="lblName" runat="server" Text="Employee Name"></asp:Label>
                        </div>
                        <div class="col-md-3">
                            <asp:TextBox onpaste="return true" ID="txtEmployeeName" runat="server" MaxLength="25"
                                CssClass="form-control"></asp:TextBox>
                        </div>
                    </div>
                    <div class="row form-group">
                        <div class="col-md-5">
                        </div>
                        <div class="col-md-6">
                            <div class="pull-right-button">
                                <asp:LinkButton ID="btnSearch" runat="server" Text="Search" CssClass="btn save-btn fa-search"
                                    OnClick="btnSearch_Click" />
                                <asp:LinkButton ID="btnClear" runat="server" Text="Clear" CssClass="btn clr-btn fa-refresh"
                                    OnClick="btnClear_Click" />
                            </div>
                        </div>
                    </div>
                    <div class="row form-group">
                        <div class="col-md-12">
                            <asp:GridView ID="grv_Employee" runat="server" AllowPaging="True" AllowSorting="true"
                                AutoGenerateColumns="False" PageSize="10" OnPageIndexChanging="grv_Employee_PageIndexChanging"
                                OnRowDataBound="grv_Employee_RowDataBound" CssClass="table das-table1" OnSorting="grv_Employee_Sorting"
                                EmptyDataText="No Records">
                                <Columns>
                                    <asp:TemplateField>
                                        <HeaderTemplate>
                                            <asp:Label ID="lblCheckAll" 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" Width="5%" />
                                        <HeaderStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Employee Id" SortExpression="Employee_Code_Id">
                                        <ItemTemplate>
                                            &nbsp;&nbsp;
                                            <asp:Label ID="lbl_EmpId" Text='<%# Eval("Employee_Code_Id")%>' runat="server"></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle Width="15%" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Employee Name" SortExpression="Employee Name">
                                        <ItemTemplate>
                                            &nbsp;&nbsp;
                                            <asp:Label ID="lbl_EmpName" Text='<%# Eval("Employee Name")%>' runat="server"></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle Width="30%" />
                                    </asp:TemplateField>
                                </Columns>
                                <PagerStyle BorderColor="#FFFFFF" BorderStyle="solid" BorderWidth="1px" Font-Overline="False"
                                    Font-Size="Smaller" HorizontalAlign="Right" VerticalAlign="Bottom" />
                                <PagerSettings FirstPageText="First" LastPageText="Last" Mode="NumericFirstLast"
                                    NextPageText="Next" PreviousPageText="&lt;" />
                                <RowStyle Height="30px" CssClass="table-bg" BorderColor="#C5DFFC" />
                                <HeaderStyle CssClass="empheader" />
                            </asp:GridView>
                            <br />
                            <asp:Label ID="lblStatus" runat="server" Style="color: Blue;" Font-Bold="True"></asp:Label>
                        </div>
                        <div class="col-md-12">
                            <div class="pull-right-button">
                                <br />
                                <asp:LinkButton ID="btn_Reprocess" CssClass="btn save-btn  fa-retweet" runat="server"
                                    CausesValidation="False" OnClick="btn_Reprocess_Click" />
                                <asp:LinkButton ID="btn_Back" runat="server" CssClass="btn save-btn  fa-hand-o-left"
                                    Style="display: none;" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
