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

<%@ Register TagPrefix="dxwgv" Namespace="DevExpress.Web" Assembly="DevExpress.Web.v14.2" %>
<%--<%@ Register TagPrefix="dxwgv" Namespace="DevExpress.Web.Data" Assembly="DevExpress.Web.ASPxGridView.v8.2" %>--%>

<%@ Register Assembly="DevExpress.Web.v14.2" Namespace="DevExpress.Web"
    TagPrefix="devEditors" %>
<%--<%@ 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" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="Server">
    <!--[if gt IE 5.5]>
	<link rel="stylesheet" type="text/css" href="../css/anytimeIE.css" />
 <![endif]-->

    <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 }
            );
        });
        window.onload = function () {
            PageOnloadDate();
        };
    </script>

    <script language="javascript" type="text/javascript">
        function UpdateCustomizationWindowValue() {
            var element = document.getElementById("btnCustWindow");
            if (element == null) return;
            element.value = (movementsentryASPxGridView.IsCustomizationWindowVisible() ? "Hide" : "Show") + " Customization Window";
        }
        function ShowHideCustomizationWindow() {
            if (movementsentryASPxGridView.IsCustomizationWindowVisible())
                movementsentryASPxGridView.HideCustomizationWindow();
            else movementsentryASPxGridView.ShowCustomizationWindow();
            UpdateCustomizationWindowValue();
        }

        //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:';

        var MaxLength = "Maximum length is ";


        function MaxLengthh(maxLength) {

            MaxLength = maxLength;
        }


        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 EnterFromDate = "Enter From Date";
        var EnterToDate = "Enter To Date";


        function SetAlertMessages(enterFromDate, enterToDate) {
            EnterFromDate = enterFromDate;
            EnterToDate = enterToDate;
        }

        function DateEntryValidation() {
            var rangeDemoFormat = document.getElementById('ctl00_BodyContentPH_Hidden1').value;

            if (document.aspnetForm.ctl00_BodyContentPH_txtFromDate.value != '') {
                var weekDay = document.aspnetForm.ctl00_BodyContentPH_txtFromDate;
                var DateFormat = document.getElementById('ctl00_BodyContentPH_Hidden1').value;

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

                        if (checkDate(weekDay, DateFormat, Monthfourdigit, Datefourdigit, Invalidyearentry, Invalidmonthentry, Invaliddateentry, DateformatDDMONYYYY, Entertime, Valueforhours, Invalidvalueforminutes, Invalidtimeformat, EntervalidDateandTime, ValiddatemonthMMDDYYHHMM, ValiddatemonthMMDDYYHHMMTT, EntervalidDateandTime, Invalidvalueforhours, Invalidvalueforminites)) {
                        }
                        else {
                            return false;
                        }
                    } else {
                        alert(EnterToDate);
                        return false;
                    }
                }
                else {
                    return false;
                }
            }
            else {
                alert(EnterFromDate);
                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="lblEmployeeDetailsReport" runat="server" Text="All Swipes Details"></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-12">
                    <div class="inr-fil-text">
                        <asp:Label ID="lblFilter" runat="server" Text="Filters"></asp:Label>
                    </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 id="divEmployeeDetails" runat="server" style="display: none;">
                                <div class="row form-group">
                                    <div class="col-md-2">
                                        <asp:Label ID="lblShift" runat="server" Text="Shift"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:DropDownList ID="ddlShift" runat="server">
                                        </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlShift"
                                            Display="None" ErrorMessage="Select Shift"></asp:RequiredFieldValidator>
                                    </div>
                                    <div class="col-md-2">
                                        <asp:HiddenField ID="Hidden2" runat="server" />
                                        <asp:Label ID="lblEmpSwipeCard" runat="server" Text="Card No"></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>
                                        <asp:HiddenField ID="Hidden1" runat="server" />
                                    </div>
                                </div>
                                <div class="row form-group">
                                    <div class="col-md-2">
                                        <asp:Label ID="lblStatus" runat="server" Text="Employee Status"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:DropDownList ID="ddlStatus" runat="server" CssClass="form-control select2">
                                            <asp:ListItem Selected="True" Value="All" Text="All"></asp:ListItem>
                                            <asp:ListItem Value="Active" Text="Active"></asp:ListItem>
                                            <asp:ListItem Value="InActive" Text="InActive"></asp:ListItem>
                                        </asp:DropDownList>
                                    </div>
                                    <div class="col-md-1">
                                    </div>
                                    <div class="col-md-2">
                                        <asp:Label ID="lblEmpSwipe" runat="server" Text="Card No"> </asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:DropDownList ID="ddlSwipeOpt" runat="server">
                                            <asp:ListItem Value="Select" Text="-Select-"></asp:ListItem>
                                            <asp:ListItem Value="All" Text="All"></asp:ListItem>
                                            <asp:ListItem Value="Exists" Text="Exists"></asp:ListItem>
                                            <asp:ListItem Value="Not Exists" Text="Not Exists"></asp:ListItem>
                                        </asp:DropDownList>
                                    </div>
                                </div>
                                <div class="row form-group">
                                    <div class="col-md-23">
                                        <asp:Label ID="lblEmployeeName" runat="server" Text="Employee Name"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox onpaste="return true" ID="txtEmployeeName" runat="server" CssClass="form-control"
                                            MaxLength="50" onkeypress="return employeename_singlequotes_maxlength(event,this,50,MaxLength);"></asp:TextBox>
                                    </div>
                                    <div class="col-md-1">
                                    </div>
                                    <div class="col-md-2">
                                        <asp:Label ID="lblEmployeeId" runat="server" Text="Employee Id"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox onpaste="return true" ID="txtEmployeeId" runat="server" CssClass="form-control"
                                            MaxLength="15" onkeypress="return acceptCharsNum_MaxLength(event,this,15,MaxLength);"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="row form-group">
                                    <div class="col-md-2">
                                        <asp:Label ID="lblEmpCategory" runat="server" Text="Employee Category"></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" Text="Employee Type"></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>
                            <div class="row form-group">
                                <div class="col-md-2">
                                    <asp:Label ID="lblDateFilter" runat="server" Text="Date Filter"></asp:Label>
                                </div>
                                <div class="Pad-left-7px">
                                    <div class="col-md-2 Session-padLeftrtp">
                                        <asp:RadioButton ID="rbCustom" runat="server" Text="Custom" CssClass="radioLeave radioLeave-primary"
                                            GroupName="rpt" onchange="ajaxGetDate(3);" Checked="true" />
                                    </div>
                                    <div class="col-md-2">
                                        <asp:RadioButton ID="rbpreviousweek" runat="server" Text="Previous Week" CssClass="radioLeave radioLeave-primary"
                                            GroupName="rpt" onchange="ajaxGetDate(1);" />
                                    </div>
                                    <div class="col-md-2">
                                        <asp:RadioButton ID="rbThisweek" runat="server" Text="This Week" CssClass="radioLeave radioLeave-primary"
                                            GroupName="rpt" onchange="ajaxGetDate(0);" />
                                    </div>
                                    <div class="col-md-2">
                                        <asp:RadioButton ID="rbpreviousMonth" runat="server" Text="Previous Month" CssClass="radioLeave radioLeave-primary"
                                            GroupName="rpt" onchange="ajaxGetDate(5);" />
                                    </div>
                                    <div class="col-md-2">
                                        <asp:RadioButton ID="rbThisMonth" runat="server" Text="This Month" CssClass="radioLeave radioLeave-primary"
                                            GroupName="rpt" onchange="ajaxGetDate(4);" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-2">
                                    <asp:Label ID="lblTimePeriod" runat="server" Text="Time Period"></asp:Label>
                                    -
                                    <asp:Label ID="lblFrom" runat="server" Text="From"></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" Display="None"></asp:CustomValidator>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-2">
                                    <asp:Label ID="lblTo" runat="server" Text="To"> </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" Display="None"></asp:CustomValidator>
                                    <asp:CustomValidator ID="cus_ComToDate" runat="server" EnableClientScript="False"
                                        OnServerValidate="CompareDate" Display="None"></asp:CustomValidator>&nbsp;
                                </div>
                            </div>
                            <div class="row form-group">
                                <div class="col-md-2">
                                    <asp:Label ID="lblFromTime" runat="server">From Time</asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onpaste="return true" ID="txtFromTime" runat="server" CssClass="form-control"
                                        MaxLength="8" ondrop="return false;" onkeypress="return number_colon_Space_AM_PM(event,this);"></asp:TextBox>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-2">
                                    <asp:Label ID="lblToTime" runat="server">To Time</asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onpaste="return true" ID="txtToTime" runat="server" CssClass="form-control"
                                        MaxLength="8" ondrop="return false;" onkeypress="return number_colon_Space_AM_PM(event,this);"></asp:TextBox>
                                </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">
                                                <uc:OrganizationLevel 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" style="padding-bottom: 10px">
                                    <div class="pull-right-button">
                                        <asp:LinkButton ID="btn_View" CssClass="btn save-btn fa-eye" runat="server" OnClick="btn_View_Click"
                                            OnClientClick="return DateEntryValidation()" Text="&nbsp;&nbsp;View" />
                                        <asp:ValidationSummary ID="ValidationSummary1" ShowMessageBox="false" ShowSummary="true"
                                            runat="server" />
                                    </div>
                                </div>
                            </div>
                            <div class="row form-group">
                                <div class="col-md-12" style="overflow: auto; overflow-y: hidden;">
                                    <dxwgv:ASPxGridView ID="movementsentryASPxGridView1" runat="server" AutoGenerateColumns="False"
                                        Settings-ShowTitlePanel="true" ClientInstanceName="movementsentryASPxGridView"
                                        Settings-ShowFilterRow="true" Width="1000px" OnCustomColumnSort="movementsentryASPxGridView1_CustomColumnSort">
                                        <%--  <Templates>
                                            <TitlePanel>
                                                <asp:Label ID="lblTitle" runat="server" Text="Movements Entry Details"></asp:Label>
                                            </TitlePanel>
                                        </Templates>--%>
                                        <Columns>
                                            <dxwgv:GridViewDataTextColumn Caption="Card No" FieldName="CardNo" VisibleIndex="0">
                                            </dxwgv:GridViewDataTextColumn>
                                            <dxwgv:GridViewDataTextColumn Caption="Employee Name" FieldName="Employee Name" VisibleIndex="2">
                                            </dxwgv:GridViewDataTextColumn>
                                            <dxwgv:GridViewDataTextColumn Caption="Designation" FieldName="Designation" VisibleIndex="1">
                                            </dxwgv:GridViewDataTextColumn>
                                            <dxwgv:GridViewDataTextColumn Caption="Level Name" FieldName="Level Name" VisibleIndex="3">
                                            </dxwgv:GridViewDataTextColumn>
                                            <dxwgv:GridViewDataTextColumn Caption="In Reader Id" FieldName="InReaderID" VisibleIndex="4">
                                            </dxwgv:GridViewDataTextColumn>
                                            <dxwgv:GridViewDataTextColumn Caption="In Terminal Name" FieldName="InTerminalName"
                                                VisibleIndex="8">
                                            </dxwgv:GridViewDataTextColumn>
                                            <dxwgv:GridViewDataDateColumn Caption="In Date" FieldName="InDate" VisibleIndex="5">
                                                <PropertiesDateEdit DisplayFormatString="">
                                                    <Style BackColor="#D3DBE7"></Style>
                                                </PropertiesDateEdit>
                                            </dxwgv:GridViewDataDateColumn>
                                            <dxwgv:GridViewDataTextColumn Caption="In Time" FieldName="InTime" VisibleIndex="6">
                                            </dxwgv:GridViewDataTextColumn>
                                            <dxwgv:GridViewDataTextColumn Caption="Out Reader Id" FieldName="OutReaderID" VisibleIndex="7">
                                            </dxwgv:GridViewDataTextColumn>
                                            <dxwgv:GridViewDataTextColumn Caption="Out Terminal Name" FieldName="OutTerminalName"
                                                VisibleIndex="9">
                                            </dxwgv:GridViewDataTextColumn>
                                            <dxwgv:GridViewDataDateColumn Caption="Out Date" FieldName="OutDate" VisibleIndex="10">
                                                <PropertiesDateEdit DisplayFormatString="">
                                                    <Style BackColor="#D3DBE7"></Style>
                                                </PropertiesDateEdit>
                                            </dxwgv:GridViewDataDateColumn>
                                            <dxwgv:GridViewDataTextColumn Caption="Out Time" FieldName="OutTime" VisibleIndex="11">
                                            </dxwgv:GridViewDataTextColumn>
                                            <dxwgv:GridViewDataDateColumn Caption="Clock Date" FieldName="ClockDate" VisibleIndex="12">
                                                <PropertiesDateEdit DisplayFormatString="">
                                                    <Style BackColor="#D3DBE7"></Style>
                                                </PropertiesDateEdit>
                                            </dxwgv:GridViewDataDateColumn>
                                            <dxwgv:GridViewDataTextColumn Caption="Shift Short Name" FieldName="Shift_ShortName"
                                                VisibleIndex="14">
                                            </dxwgv:GridViewDataTextColumn>
                                            <dxwgv:GridViewDataTextColumn Caption="Gender" FieldName="Gender" VisibleIndex="13">
                                            </dxwgv:GridViewDataTextColumn>
                                        </Columns>
                                        <ClientSideEvents CustomizationWindowCloseUp="function(s, e) { UpdateCustomizationWindowValue(); }" />
                                        <SettingsCustomizationWindow Enabled="True" />
                                        <SettingsBehavior AutoExpandAllGroups="True" ColumnResizeMode="Control" />
                                        <SettingsPager AlwaysShowPager="True">
                                        </SettingsPager>
                                        <Settings ShowGroupPanel="True" ShowFilterRow="True" ShowFooter="True" ShowGroupedColumns="True"
                                            ShowVerticalScrollBar="true" ShowGroupFooter="VisibleIfExpanded" ShowTitlePanel="True" />
                                        <Styles AlternatingRow-CssClass="table-bg"
                                            Cell-CssClass="MinWidth" Header-CssClass="MinWidth">
                                        </Styles>
                                    </dxwgv:ASPxGridView>
                                </div>
                                <style>
                                    .MinWidth {
                                        width: 100px;
                                    }
                                </style>
                            </div>
                            <div class="row">
                                <div class="col-md-2">
                                    <asp:Label ID="lblExportPrinting" runat="server" Text="Export Printing Mode: "></asp:Label>
                                </div>
                                <div class="col-md-6" style="padding-left: 0px;">
                                    <div class="col-md-3">
                                        <asp:RadioButton ID="rbtnPortrait" runat="server" Text="Portrait" Checked="true"
                                            CssClass="radio radio-primary" GroupName="PrintOptions" />
                                    </div>
                                    <div class="col-md-3">
                                        <asp:RadioButton ID="rbtnLandscape" runat="server" Text="Landscape" CssClass="radio radio-primary"
                                            GroupName="PrintOptions" />
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="panel-footer">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="pull-right-button">
                                        <asp:LinkButton ID="btnCustWindow" runat="server" CssClass="btn save-btn fa-folder-open-o"
                                            Text="&nbsp;&nbsp;Show Customization Window" OnClientClick="ShowHideCustomizationWindow();"></asp:LinkButton>
                                        <%--<input id="btnCustWindow" type="button" runat="server" class="btn btn-primary fa fa-clone" value="Show Customization Window"
                        onclick="ShowHideCustomizationWindow();" />--%>
                                        <asp:LinkButton ID="btnExportToResponse" runat="server" Text="&nbsp;&nbsp;Export To PDF"
                                            OnClick="btnExportToResponse_Click" CssClass="btn save-btn fa-file-pdf-o" />
                                        <asp:LinkButton ID="btnExportToExcel" runat="server" Text="&nbsp;&nbsp;Export To XLS"
                                            OnClick="btnExportToExcel_Click" CssClass="btn save-btn fa-file-excel-o" />
                                        <asp:LinkButton Style="display: none" ID="butBack" Text="&nbsp;&nbsp;Back" runat="server"
                                            OnClick="butBack_Click" CssClass="btn save-btn fa-angle-left" />
                                        <dxwgv:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="movementsentryASPxGridView1">
                                        </dxwgv:ASPxGridViewExporter>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script language="javascript" type="text/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:';
        var EnterToDate = "Enter To Date";
        var EnterFromDate = "Enter From Date";
        var EnterToTime = "Enter To Time";
        var EnterFromTime = "Enter From Time";


        function SetAlertCheckDate(monthfourdigit, datefourdigit, invalidyearentry, invalidmonthentry, invaliddateentry, dateformatDDMONYYYY, entertime, valueforhours, invalidvalueforminutes, invalidtimeformat, entervalidDateandTime, validdatemonthMMDDYYHHMM, validdatemonthMMDDYYHHMMTT, entervalidDateandTime, invalidvalueforhours, invalidvalueforminites, enterToDate, enterFromDate, enterToTime, enterFromTime) {
            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;
            EnterToDate = enterToDate;
            EnterFromDate = enterFromDate;
            EnterToTime = enterToTime;
            EnterFromTime = enterFromTime;
        }
        function DateEntryValidation() {

            var rangeDemoFormat = document.getElementById('ctl00_BodyContentPH_Hidden1').value;

            var rangeTimeFormat = document.getElementById('ctl00_BodyContentPH_Hidden2').value;


            if (document.aspnetForm.ctl00_BodyContentPH_txtFromDate.value != '') {
                var weekDay = document.aspnetForm.ctl00_BodyContentPH_txtFromDate;
                var DateFormat = document.getElementById('ctl00_BodyContentPH_Hidden1').value;

                if (checkDate(weekDay, DateFormat, Monthfourdigit, Datefourdigit, Invalidyearentry, Invalidmonthentry, Invaliddateentry, DateformatDDMONYYYY, Entertime, Valueforhours, Invalidvalueforminutes, Invalidtimeformat, EntervalidDateandTime, ValiddatemonthMMDDYYHHMM, ValiddatemonthMMDDYYHHMMTT, EntervalidDateandTime, Invalidvalueforhours, Invalidvalueforminites)

         ) {
                    if (document.aspnetForm.ctl00_BodyContentPH_txtToDate.value != '') {
                        var weekDay = document.aspnetForm.ctl00_BodyContentPH_txtToDate;
                        var DateFormat = document.getElementById('ctl00_BodyContentPH_Hidden1').value;

                        if (checkDate(weekDay, DateFormat, Monthfourdigit, Datefourdigit, Invalidyearentry, Invalidmonthentry, Invaliddateentry, DateformatDDMONYYYY, Entertime, Valueforhours, Invalidvalueforminutes, Invalidtimeformat, EntervalidDateandTime, ValiddatemonthMMDDYYHHMM, ValiddatemonthMMDDYYHHMMTT, EntervalidDateandTime, Invalidvalueforhours, Invalidvalueforminites)

         ) {
                        }
                        else {
                            return false;
                        }
                    }
                    else {
                        alert(EnterToDate);
                        return false;
                    }

                }
                else {
                    return false;
                }
            }
            else {
                alert(EnterFromDate);
                return false;
            }
            var Invalidtimeformat = 'Invalid time format';

            var blnValidTime = true;

            if (trim(document.aspnetForm.ctl00_BodyContentPH_txtFromTime.value) != "") {

                //alert(document.getElementById('ctl00_BodyContentPH_Hidden1').value);
                blnValidTime = checkTimeValueOfShift(document.aspnetForm.ctl00_BodyContentPH_txtFromTime, document.getElementById('ctl00_BodyContentPH_Hidden2').value, Invalidtimeformat);


                document.aspnetForm.ctl00_BodyContentPH_txtFromTime.focus();

                if (blnValidTime == false) {
                    return false;
                }
                if (trim(document.aspnetForm.ctl00_BodyContentPH_txtToTime.value) == "") {
                    alert(EnterToTime);
                    return false;
                }

            }

            if (trim(document.aspnetForm.ctl00_BodyContentPH_txtToTime.value) != "") {
                //alert(document.getElementById('ctl00_BodyContentPH_Hidden1').value);
                blnValidTime = checkTimeValueOfShift(document.aspnetForm.ctl00_BodyContentPH_txtToTime, document.getElementById('ctl00_BodyContentPH_Hidden2').value, Invalidtimeformat);

                //alert(EnterShiftName);
                document.aspnetForm.ctl00_BodyContentPH_txtToTime.focus();

                if (blnValidTime == false) {
                    return false;
                }

                if (trim(document.aspnetForm.ctl00_BodyContentPH_txtFromTime.value) == "") {
                    alert(EnterFromTime);
                    return false;
                }
            }

        }
        function checkTimeValueOfShift(field1, format, Invalidtimeformat) {
            var field = RemoveSpaces(field1);
            // alert(field);
            var TimeFormat = format;
            var errorMsg = "";
            var Invalidvalueforhours = "Invalid hours Value";
            var Invalidvalueforminites = "Invalid minutes Value";
            // regular expression to match required time format 
            var re = '';
            if (TimeFormat == "HH:mm") {

                //re = /^(\d{1,2}):(\d{2})(:00)?([AP]M)?$/;            
                re = /^([0-1][0-9]|[2][0-3]):([0-5][0-9])$/;

            }

            if (TimeFormat == "LT") {
                re = /^(\d{1,2}):(\d{2})(:00)? ((AM|am|PM|pm|Am|aM|Pm|pM))?$/;
                // re = /^([1-9]|1[0-2]|0[1-9]){1}(:[0-5][0-9][aApP][mM]){1}$/;
                //re= /^(1[012]|[1-9]):[0-5][0-9](\\s)?(?i)(am|pm)$/;
            }
            regs = field.split(':');
            //re = /^(\d{1,2}):(\d{2})(:00)? ((AM|am|PM|pm))?$/;  
            // alert(re.test(field.value))
            if (re.test(field)) {

                if (TimeFormat == "LT") {
                    // 12-hour time format with am/pm 
                    if (regs[0] < 1 || regs[0] > 12) {
                        errorMsg = Invalidvalueforhours;
                    }
                }
                if (TimeFormat == "HH:mm") {
                    // 24-hour time format 
                    if (regs[0] > 23) {
                        errorMsg = Invalidvalueforhours;
                    }
                }
                var SplitAmAndPm = regs[1].split(" ");
                if (!errorMsg && SplitAmAndPm[0] > 59) {
                    errorMsg = Invalidvalueforminites;
                }
            }
            else {
                errorMsg = Invalidtimeformat;
            }


            if (errorMsg != "") {
                alert(errorMsg);
                //field.focus(); 
                return false;
            }
            return true;
        }

    </script>

</asp:Content>
