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

<%--<%@ Register Src="~/UserControls/TA_uc_OrganizationLevels.ascx" TagName="OrganizationLevel"
    TagPrefix="uc" %>--%>
<%@ Register Src="../UserControls/TA_uc_OrgLevelFilter_Updated.ascx" TagName="TA_uc_OrgLevel_Filter"
    TagPrefix="uc" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="Server">

    <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/bootstrap-datepicker.js"></script>


    <script>

        $(function () {
            $('#ctl00_BodyContentPH_txtFromDate').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value }
            );
        });
        $(function () {
            $('#ctl00_BodyContentPH_txtToDate').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value }
            );



        });

    </script>

    <script type="text/javascript" language="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:';
        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;
        }
        var EnterToDate = "Enter To Date";
        function SetAlertMessages(enterToDate) {
            EnterToDate = enterToDate;
        }
        //On Center Screen
        function popupwindow(url, title, w, h) {
            var left = (screen.width / 2) - (w / 2);
            var top = (screen.height / 2) - (h / 2);
            return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
        }
        function OpenSwipesHandlingWindow() {
            if (WeekdayValidation() == true) {
                return true;
            }
            else {
                return false;
            }
        }

        function WeekdayValidation() {
            var weekDay = document.aspnetForm.ctl00_BodyContentPH_txtFromDate;
            var weekDay2 = document.aspnetForm.ctl00_BodyContentPH_txtToDate;
            var DateFormat = document.getElementById('ctl00_BodyContentPH_Hidden1').value;
            if (weekDay2.value != '') {
                if (checkDate(weekDay2, DateFormat, Monthfourdigit, Datefourdigit, Invalidyearentry, Invalidmonthentry, Invaliddateentry, DateformatDDMONYYYY, Entertime, Valueforhours, Invalidvalueforminutes, Invalidtimeformat, EntervalidDateandTime, ValiddatemonthMMDDYYHHMM, ValiddatemonthMMDDYYHHMMTT, EntervalidDateandTime, Invalidvalueforhours, Invalidvalueforminites)) {

                }
                else {
                    document.aspnetForm.ctl00_BodyContentPH_txtToDate.focus();
                    return false;
                }
            }
            else {
                alert(EnterToDate);
                document.aspnetForm.ctl00_BodyContentPH_txtToDate.focus();
                return false;
            }


            if (weekDay.value != '') {
                if (checkDate(weekDay, DateFormat, Monthfourdigit, Datefourdigit, Invalidyearentry, Invalidmonthentry, Invaliddateentry, DateformatDDMONYYYY, Entertime, Valueforhours, Invalidvalueforminutes, Invalidtimeformat, EntervalidDateandTime, ValiddatemonthMMDDYYHHMM, ValiddatemonthMMDDYYHHMMTT, EntervalidDateandTime, Invalidvalueforhours, Invalidvalueforminites)) {

                }
                else {
                    document.aspnetForm.ctl00_BodyContentPH_txtFromDate.focus();
                    return false;
                }
            }
            else {
            }
            return true;
        }
    </script>


    <div class="content-header">
        <h1 style="background-image: url('../dist/img/flexi.png'); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lblEmployeeDetailsReport" 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="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: 50px">
                    <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="lbl_FlexibleHours" runat="server" Text="Flexible Hours Applicability"></asp:Label></h4>
                    </div>
                    <div class="modal-body" style="padding-top: 0px">
                        <iframe id="iframePopup" runat="server" scrolling="auto" width="100%" height="650px"
                            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="form-horizontal">
                <div class="row">
                    <div class="col-md-12">
                        <div id="divEmployeeDetails" runat="server">
                            <div class="row 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"></asp:TextBox>
                                    <cc1:AutoCompleteExtender ID="acEmployeeName" runat="server" CompletionSetCount="10"
                                        CompletionListItemCssClass="item" CompletionListHighlightedItemCssClass="AutocompleteCSS"
                                        CompletionInterval="10" Enabled="true" MinimumPrefixLength="1" TargetControlID="txtEmployeeName"
                                        ServicePath="../WebServices/AutoCompleteExtender.asmx" ServiceMethod="GetEmployeeName"
                                        CompletionListCssClass="autocomplete_completionListElement" FirstRowSelected="true">
                                    </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"></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>
                            <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>
                        <div class="row form-group">
                            <div class="col-md-2">
                                <asp:HiddenField ID="Hidden1" runat="server" />
                                <asp:Label ID="lblTimePeriod" runat="server"></asp:Label>
                                -
                                <asp:Label ID="lblFrom" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtFromDate" runat="server" CssClass="form-control"
                                    onCut="return false" onDrop="return false" MaxLength="11"></asp:TextBox>
                                <asp:CustomValidator ID="cus_FromDate" runat="server" EnableClientScript="False"
                                    OnServerValidate="ValidateFromDate" ErrorMessage="Select valid From Date" Display="None"></asp:CustomValidator>
                            </div>
                            <div class="col-md-1">
                            </div>
                            <div class="col-md-2">
                                <asp:Label ID="lblTo" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtToDate" runat="server" CssClass="form-control"
                                    onCut="return false" onDrop="return false" MaxLength="11"></asp:TextBox>
                                <asp:CustomValidator ID="cus_ToDate" OnServerValidate="ValidateToDate" runat="server"
                                    EnableClientScript="False" ErrorMessage="Select valid To Date" Display="None"></asp:CustomValidator>
                                <asp:CustomValidator ID="cus_ComToDate" runat="server" EnableClientScript="False"
                                    OnServerValidate="CompareDate" ErrorMessage="Select valid date compare with Fromdate"
                                    Display="None"></asp:CustomValidator>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-2">
                                <asp:Label ID="lblSelect" runat="server" Text="Flexible Timings"></asp:Label>
                            </div>
                            <div class="col-md-3 pad-left-0px">
                                <div class="col-md-4">
                                    <asp:RadioButton ID="rdby2n" runat="server" CssClass="radio radio-primary" Text="Yes"
                                        GroupName="ChangeStatus" />
                                </div>
                                <div class="col-md-4">
                                    <asp:RadioButton ID="rdbn2y" runat="server" CssClass="radio radio-primary" Text="No"
                                        GroupName="ChangeStatus" />
                                </div>
                                <div class="col-md-4">
                                    <asp:RadioButton ID="rdbAll" runat="server" CssClass="radio radio-primary" Text="All"
                                        GroupName="ChangeStatus" Checked="true" />
                                </div>
                            </div>
                        </div>
                        <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="PlaceHolderEmployees" runat="server">
                                            <%-- <uc1:TA_uc_OrgLevel_Filter ID="TA_uc_OrgLevel_Filter1" runat="server" />--%>
                                            <uc:TA_uc_OrgLevel_Filter ID="ucOrganizationLevel" runat="server" />
                                        </asp:PlaceHolder>
                                    <%--</ContentTemplate>
                                </asp:UpdatePanel>--%>
                            </div>
                        </div>
                        <div class="row">
                            <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 OpenSwipesHandlingWindow()" />
                                    <asp:ValidationSummary ID="ValidationSummary1" ShowMessageBox="false" ShowSummary="true"
                                        runat="server" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
