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

<%@ Register Src="~/UserControls/TA_uc_OrganizationLevels.ascx" TagName="OrganizationLevel"
    TagPrefix="uc" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ContentPlaceHolderID="BodyContentPH" ID="rptLateInstance" 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"> 
    $(document).ready(function() {
         $("#<%=txtEmployeeId.ClientID%>").autocomplete('../AutoCompleteByEmployeeId.ashx?EmpAutoid=' + '<%= Convert.ToString(Session["EmpAutoID"]) %>', { multiple: true,
             multipleSeparator: ",",         
             width: 180,            
             highlight: false,
             scroll: true,
             scrollHeight: 300,
             delay: 10
         });
         });
    $(document).ready(function() {
  $("#<%=txtEmployeeName.ClientID%>").autocomplete('../AutoCompleteByName.ashx?EmpAutoid=' + '<%= Convert.ToString(Session["EmpAutoID"]) %>', { multiple: true,
             multipleSeparator: " ,",
             width: 200,             
             highlight: false,
             scroll: true,
             scrollHeight: 300,
             delay: 10
         });
         });
    
    
    </script>

    <table border="0" cellspacing="0" cellpadding="0" width="500" style="text-align: left;">
        <tr>
            <td valign="top" width="15">
                <img src="../Images/corner1<%=Session["Direction"] %>.gif" width="15" height="15" /></td>
            <td valign="top" background="../Images/sideline.gif" bgcolor="#EAEAEA" width="365">
                <img src="../Images/spacer.gif" width="1" height="1" /></td>
            <td valign="top" width="11">
                <img src="../Images/corner2<%=Session["Direction"] %>.gif" width="15" height="15" /></td>
        </tr>
        <tr>
            <td background="../Images/line<%=Session["Direction"] %>.gif" width="15">
                &nbsp;</td>
            <td valign="top" bgcolor="#EAEAEA">
                <table border="0" align="center" cellpadding="2" cellspacing="1" width="650">
                    <tr>
                        <td valign="top" colspan="4" class="ModuleTitle">
                            <font color="#000080">
                                <asp:Label ID="lblLateEntryReport" runat="server"></asp:Label></font></td>
                    </tr>
                    <tr>
                        <td colspan="5" style="padding-left: 0px; padding-bottom: 0px; padding-top: 0px;
                            padding-right: 0px">
                            <asp:HiddenField ID="Hidden1" runat="server" />
                            <div id="divEmployeeDetails" runat="server">
                                <table cellspacing="1" width="650px" style="margin-right: -2; margin-left: -1;">
                                    <tr>
                                        <td class="td">
                                            <asp:Label ID="lblEmployeeName" runat="server"></asp:Label></td>
                                        <td class="td">
                                            <asp:TextBox onpaste="return true" ID="txtEmployeeName" runat="server" CssClass="multitext"
                                                TextMode="multiLine" Width="180px" Height="35px">
                                            </asp:TextBox>
                                        </td>
                                        <td class="td">
                                            <asp:Label ID="lblEmployeeId" runat="server"></asp:Label>
                                        </td>
                                        <td class="td">
                                            <asp:TextBox onpaste="return true" ID="txtEmployeeId" runat="server" CssClass="multitext"
                                                TextMode="multiLine" Width="180px" Height="35px">
                                            </asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="td" style="width: 150px">
                            <asp:Label ID="lblTimePeriod" runat="server"></asp:Label>
                            -
                            <asp:Label ID="lblFrom" runat="server"></asp:Label></td>
                        <td class="td" style="width: 196px">
                            <asp:TextBox onpaste="return true" ID="txtFromDate" runat="server" CssClass="textbox_4"
                                onCut="return false" onDrop="return false" MaxLength="11">
                            </asp:TextBox>
                            <asp:CustomValidator ID="cus_FromDate" OnServerValidate="ValidateFromDate" runat="server"
                                EnableClientScript="False" ErrorMessage="Select valid From Date" Display="None">
                            </asp:CustomValidator>
                            <asp:RequiredFieldValidator ID="reqFromDate" runat="server" ControlToValidate="txtFromDate"
                                Display="none" EnableClientScript="false" ErrorMessage="Please select FromDate">
                            </asp:RequiredFieldValidator>
                        </td>
                        <td class="td" style="width: 126px">
                            <asp:Label ID="lblTo" runat="server"></asp:Label></td>
                        <td class="td" style="width: 196px">
                            <asp:TextBox onpaste="return true" ID="txtToDate" runat="server" CssClass="textbox_4"
                                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>
                            <asp:RequiredFieldValidator ID="reqToDate" runat="server" ControlToValidate="txtToDate"
                                Display="None" EnableClientScript="False" ErrorMessage="Please select ToDate">
                            </asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="td" colspan="4">
                            <asp:UpdatePanel ID="upOrgLevel" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <asp:PlaceHolder ID="PlaceHolderLateEntry" runat="server">
                                        <uc:OrganizationLevel ID="ucOrganizationLevel" runat="server" />
                                    </asp:PlaceHolder>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" valign="bottom" colspan="4" style="height: 65px">
                            <table border="0" align="center" cellpadding="5" cellspacing="0">
                                <tr>
                                    <td align="center" valign="middle" style="height: 32px">
                                        <asp:Button ID="btn_View" CssClass="but" runat="server" OnClick="btn_View_Click"
                                            OnClientClick="if(Page_ClientValidate()) return DateEntryValidation();return false;" />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center" valign="middle">
                                        <asp:Button ID="IDTest1" runat="server" />
                                        <asp:HiddenField ID="hdnReportFilters" runat="server" />
                                        <asp:HiddenField ID="hdnReportType1" runat="server" />
                                        <asp:HiddenField ID="hdnCompanyId1" runat="server" />
                                    </td>
                                </tr>
                            </table>
                            <asp:ValidationSummary ID="ValidationSummary1" ShowMessageBox="false" ShowSummary="false"
                                runat="server" />
                        </td>
                    </tr>
                </table>
            </td>
            <td background="../Images/line1<%=Session["Direction"] %>.gif" width="11">
                &nbsp;</td>
        </tr>
        <tr>
            <td valign="bottom" width="15">
                <img src="../Images/corner3<%=Session["Direction"] %>.gif" width="15" height="16" /></td>
            <td valign="bottom" background="../Images/sideline1.gif" bgcolor="#EAEAEA" width="365">
                <img src="../Images/spacer.gif" width="1" height="1" /></td>
            <td valign="bottom" width="11">
                <img src="../Images/corner4<%=Session["Direction"] %>.gif" width="15" height="16" /></td>
        </tr>
    </table>

    <script type="text/javascript">  
         
    var Monthfourdigit='Please enter valid date as month, day, and four digit year : Format MM/dd/yyyy.';
    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>

</asp:Content>
