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

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

    <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>

    <script type="text/javascript">
        var Year = "Select Year";
        var MaxLength = "Maximum length is ";


        function MaxLengthh(maxLength) {

            MaxLength = maxLength;
        }
        function SetAlertMessages(year) {

            Year = year;

        }
        function validateDropDown() {

            var LTypeIndex = document.aspnetForm.ctl00_BodyContentPH_ddlYear.selectedIndex;

            if (LTypeIndex == -1) {
                alert(Year);

                return false;
            }
            var ClosureYear = document.aspnetForm.ctl00_BodyContentPH_ddlYear.options[LTypeIndex].value;
            if (ClosureYear == "-Select-") {

                alert(Year);

                return false;
            }
        }
    </script>

    <div class="content-header">
        <h1 style="background-image: url(../dist/img/swipe-icon.png); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lblYearClosureReport" runat="server"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">
        <div class="inr-ftr">
            <div class="row">
                <div class="col-sm-2">
                    <div class="inr-fil-text">
                        <asp:Label ID="lblFilter" runat="server" Text="Filters"></asp:Label>
                    </div>
                </div>
                <div class="col-sm-2 col-sm-offset-8">
                    <div class="pull-right">
                        <h6>
                            <span style="color: Red">|</span><span style="padding-left: 10px; padding-right: 10px">
                                <asp:Label ID="lbl_Mandatory" runat="server" Text="Mandatory"></asp:Label>
                                (1 No.)</span>
                        </h6>
                    </div>
                </div>
                <div class="clearfix">
                </div>
            </div>
        </div>
        <div id="collapseOne">
            <div class="emp-filter">
                <div class="form-horizontal">
                    <div class="row form-group">
                        <div class="col-md-12">
                            <div class="row">
                                <div class="col-md-3" style="display: none">
                                    <asp:Label ID="lblEmpSwipe" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3" style="display: none">
                                    <asp:TextBox onpaste="return true" ID="txtSwipeCard" MaxLength="20" runat="server"
                                        CssClass="textbox_4" 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="GetCardNoForReports"
                                        CompletionListCssClass="autocomplete_completionListElement" FirstRowSelected="true">
                                    </cc1:AutoCompleteExtender>
                                </div>
                            </div>
                            <div id="divEmployeeDetails" runat="server">
                                <div class="row form-group">
                                    <div class="col-md-2">
                                        <asp:HiddenField ID="Hidden1" runat="server" />
                                        <asp:HiddenField ID="Hidden2" runat="server" />
                                        <asp:HiddenField ID="hdnReportFilters" runat="server" />
                                        <asp:HiddenField ID="hdnReportType1" runat="server" />
                                        <asp:HiddenField ID="hdnCompanyId1" runat="server" />
                                        <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"
                                            Style="resize: none;" TextMode="multiLine"></asp:TextBox>
                                    </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"
                                            Style="resize: none;" TextMode="multiLine"></asp:TextBox>
                                    </div>
                                </div>
                                <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">
                                    <div class="col-md-2">
                                        <asp:Label ID="lblDesignation" runat="server" Text="Designation"></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 class="col-md-1">
                                    </div>
                                    <div class="col-md-2">
                                        <asp:Label ID="lblGender" runat="server" Text="Gender"></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>
                            </div>
                            <!-- This line add Karthick -->
                            <div class="row form-group">
                                <div class="col-md-2">
                                    <asp:Label ID="lblYear" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddlYear" runat="server" CssClass="form-control select2 Man-dat">
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <!-- End -->
                            <div class="clearfix">
                            </div>
                            <div class="row">
                                <div class="row">
                                    <div class="line16">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <asp:UpdatePanel ID="upOrgLevel" runat="server" UpdateMode="Conditional">
                                        <ContentTemplate>
                                            <asp:PlaceHolder ID="PlaceHolderYearClosure" runat="server">
                                                <uc:OrganizationLevel ID="ucOrganizationLevel" runat="server" />
                                            </asp:PlaceHolder>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                </div>
                            </div>
                            <div class="row" style="display: none">
                                <div class="col-md-5">
                                </div>
                                <div class="col-md-6">
                                    <asp:RadioButton ID="rbtNormalReport" runat="server" Checked="True" GroupName="ReportType"
                                        Text="Normal Report" />
                                    <asp:RadioButton ID="rbtGraphReport" runat="server" Text="Graph Report" GroupName="ReportType" />
                                </div>
                            </div>
                            <div class="row" id="trView">
                                <div class="col-md-5">
                                </div>
                                <div class="col-md-6">
                                    <div class="pull-right-button">
                                        <asp:LinkButton ID="btn_View" CssClass="btn save-btn fa-eye" runat="server" OnClick="btn_View_Click"
                                            OnClientClick="return validateDropDown();" />
                                        <asp:ValidationSummary ID="ValidationSummary1" ShowMessageBox="false" ShowSummary="false"
                                            runat="server" />
                                        <asp:Button ID="IDTest1" runat="server" Visible="false" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
