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

<%@ Register TagPrefix="dxGridview" Namespace="DevExpress.Web" Assembly="DevExpress.Web.v14.2" %>
<%@ Register Src="~/UserControls/TA_uc_OrganizationLevels.ascx" TagName="OrganizationLevel"
    TagPrefix="uc" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="DevExpress.Web.v14.2" Namespace="DevExpress.Web"
    TagPrefix="dxwgv" %>
<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 = (grv_EmpDetails.IsCustomizationWindowVisible() ? "Hide" : "Show") + " Column  Chooser";
        }
        function ShowHideCustomizationWindow() {
            if (grv_EmpDetails.IsCustomizationWindowVisible())
                grv_EmpDetails.HideCustomizationWindow();
            else grv_EmpDetails.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="Employee 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="Filter"></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="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-2">
                                        <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="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="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;">
                                    <dxGridview:ASPxGridView ID="grv_EmpDetails" EnableCallBacks="false" runat="server"
                                        ClientInstanceName="grv_EmpDetails" AutoGenerateColumns="false" Width="1000px">
                                        <Columns>
                                            <dxGridview:GridViewDataTextColumn FieldName="employee_id" VisibleIndex="1">
                                                <DataItemTemplate>
                                                    <asp:Label ID="lblEID" Text='<%# Eval("employee_id") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                            </dxGridview:GridViewDataTextColumn>
                                            <dxGridview:GridViewDataTextColumn Caption="Employee Name" FieldName="empname" VisibleIndex="2">
                                                <Settings AllowDragDrop="false" />
                                                <DataItemTemplate>
                                                    <asp:Label ID="lblEname" Text='<%# Eval("empname") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; cursor: pointer; word-wrap: break-word; display: inline-block;"></asp:Label></a>
                                                </DataItemTemplate>
                                            </dxGridview:GridViewDataTextColumn>
                                            <dxGridview:GridViewDataTextColumn FieldName="status" VisibleIndex="3" Width="80px"
                                                Visible="false">
                                                <DataItemTemplate>
                                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("status") %>'></asp:Label>
                                                </DataItemTemplate>
                                            </dxGridview:GridViewDataTextColumn>
                                            <dxGridview:GridViewDataDateColumn Caption="Date Of Birth" FieldName="dateOfBirth"
                                                VisibleIndex="4">
                                                <PropertiesDateEdit DisplayFormatString="" Style-BackColor="#d3dbe7">
                                                </PropertiesDateEdit>
                                            </dxGridview:GridViewDataDateColumn>
                                            <dxGridview:GridViewDataTextColumn Caption="Nationality" FieldName="Nationality"
                                                VisibleIndex="5">
                                            </dxGridview:GridViewDataTextColumn>
                                            <dxGridview:GridViewDataTextColumn Caption="Title Name" FieldName="TitleName" VisibleIndex="6">
                                            </dxGridview:GridViewDataTextColumn>
                                            <dxGridview:GridViewDataTextColumn Caption="Organization Level" FieldName="name"
                                                VisibleIndex="7">
                                            </dxGridview:GridViewDataTextColumn>
                                            <dxGridview:GridViewDataDateColumn Caption="Date Of Joining" FieldName="dateJoin"
                                                VisibleIndex="8">
                                                <PropertiesDateEdit DisplayFormatString="" Style-BackColor="#d3dbe7">
                                                </PropertiesDateEdit>
                                            </dxGridview:GridViewDataDateColumn>
                                            <dxGridview:GridViewDataTextColumn Caption="Gender" FieldName="Gender" VisibleIndex="9">
                                            </dxGridview:GridViewDataTextColumn>
                                        </Columns>
                                        <Settings ShowFilterRow="True" ShowFooter="True" ShowGroupedColumns="True" ShowGroupFooter="VisibleIfExpanded"
                                            ShowGroupPanel="True" ShowTitlePanel="True" />
                                        <ClientSideEvents CustomizationWindowCloseUp="function(s, e) { UpdateCustomizationWindowValue(); }" />
                                        <SettingsCustomizationWindow Enabled="True" />
                                        <SettingsBehavior AutoExpandAllGroups="True" ColumnResizeMode="Control" />
                                        <Styles AlternatingRow-CssClass="table-bg">
                                        </Styles>
                                    </dxGridview:ASPxGridView>
                                </div>
                            </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" GroupName="PrintOptions"
                                            CssClass="radio radio-primary" />
                                    </div>
                                </div>
                            </div>
                            <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="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=" Export To PDF" OnClick="btnExportToResponse_Click"
                                            CssClass="btn save-btn fa-file-pdf-o" />
                                        <asp:LinkButton ID="btnExportToExcel" runat="server" Text=" Export To XLS" OnClick="btnExportToExcel_Click"
                                            CssClass="btn save-btn fa-file-excel-o" />
                                        <asp:LinkButton Style="display: none" ID="butBack" Text="Back" runat="server" OnClick="butBack_Click"
                                            CssClass="btn save-btn fa-angle-left" />
                                        <dxwgv:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="grv_EmpDetails">
                                        </dxwgv:ASPxGridViewExporter>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
