<%@ control language="C#" autoeventwireup="true" inherits="UserControls_TA_uc_ReportFilter, App_Web_udv3ebeg" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<script language="javascript" src="../js/jquery.autocomplete.js" type="text/javascript"></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:';


//var MaxLength = "Maximum length is ";
//var FromDate = "Enter Valid From Date";
//var ToDate = "Enter Valid To Date";

//function SetAlertMessages(fromdate,enterToDate)
//{
// 
// FromDate= fromdate;
//  ToDate=enterToDate;
//  
// 
//}

//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;
//}
$(document).ready(function() {
         $("#<%=txtEmpId.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>

<script language="javascript" type="text/javascript">
            
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>

<table border="0" align="center" cellpadding="2" cellspacing="1" width="650">
    <tr>
        <td colspan="4" style="padding-left: 0px; padding-bottom: 0px; padding-top: 0px;
            padding-right: 0px">
            <%--<input id="Hidden1" type="hidden" value='<% Response.Write(Convert.ToString(Session["IDateFormat"])); %>' />--%>
            <asp:HiddenField ID="Hidden1" runat="server" />
            <div id="divEmployeeDetails" runat="server">
                <table cellspacing="1" width="650px" style="margin-right: -2; margin-left: -1;">
                    <tr style="display: none;">
                        <td class="td">
                            <asp:Label ID="lblEmpSwipe" runat="server"></asp:Label>
                        </td>
                        <td class="td" colspan="3">
                            <asp:TextBox onpaste="return true" ID="txtSwipeCard" MaxLength="20" runat="server"
                                CssClass="textbox_4" onkeypress="return acceptCharsNum_MaxLength(event,this,20,MaxLength);"></asp:TextBox>
                            <cc1:AutoCompleteExtender ID="acSwipeCardNo" runat="server" CompletionSetCount="10"
                                CompletionListItemCssClass="item" CompletionListHighlightedItemCssClass="AutocompleteCSS"
                                CompletionInterval="10" Enabled="true" MinimumPrefixLength="1" TargetControlID="txtSwipeCard"
                                ServicePath="../WebServices/AutoCompleteExtender.asmx" ServiceMethod="GetCardNoForReports"
                                CompletionListCssClass="autocomplete_completionListElement" FirstRowSelected="true">
                            </cc1:AutoCompleteExtender>
                        </td>
                    </tr>
                    <tr id="trEmployeenameId" runat="server">
                        <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" Style="border:#c5c5c5 1px solid;"
                                Width="182px" TextMode="multiLine" Height="35px"></asp:TextBox>
                            <%--MaxLength="50" onkeypress="return employeename_singlequotes_maxlength(event,this,50,MaxLength);"--%>
                        </td>
                        <td class="td">
                            <asp:Label ID="lblEmployeeId" runat="server"></asp:Label></td>
                        <td class="td">
                            <asp:TextBox onpaste="return true" ID="txtEmpId" runat="server" CssClass="multitext" Style="border:#c5c5c5 1px solid;"
                                Width="182px" TextMode="multiLine" Height="35px"></asp:TextBox>
                            <%--MaxLength="250" onkeypress="return acceptCharsNum_MaxLength(event,this,250,MaxLength);"--%>
                        </td>
                    </tr>
                    <%--Added by Manjula.P on 25-Aug-2014 for employee category and employee type--%>
                    <tr id="trEmployeeCategoryType" runat="server">
                        <td class="td">
                            <asp:Label ID="lblEmpCategory" runat="server"></asp:Label></td>
                        <td class="td">
                            <asp:DropDownList ID="ddlEmpCatagory" runat="server" CssClass="dlist" AppendDataBoundItems="true"
                                Width="185px">
                                <asp:ListItem Value="0" Selected="True" Text="-Select-"></asp:ListItem>
                            </asp:DropDownList></td>
                        <td class="td">
                            <asp:Label ID="lblEmpType" runat="server"></asp:Label></td>
                        <td class="td">
                            <asp:DropDownList ID="ddlEmpType" runat="server" CssClass="dlist" AppendDataBoundItems="true"
                                Width="185px">
                                <asp:ListItem Value="0" Selected="True" Text="-Select-"></asp:ListItem>
                            </asp:DropDownList></td>
                    </tr>
                    <tr id="trEmployeeDesGender" runat="server">
                        <td class="td">
                            <asp:Label ID="lblDesignation" runat="server" Text="Designation"></asp:Label></td>
                        <td class="td">
                            <asp:DropDownList ID="ddlDesignation" runat="server" CssClass="dlist" AppendDataBoundItems="true"
                                Width="185px">
                                <asp:ListItem Value="0" Selected="True" Text="All"></asp:ListItem>
                            </asp:DropDownList></td>
                        <td class="td">
                            <asp:Label ID="lblGender" runat="server" Text="Gender"></asp:Label></td>
                        <td class="td">
                            <asp:DropDownList ID="ddlGender" runat="server" CssClass="dlist" Width="185px">
                                <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></td>
                    </tr>
                    <tr>
                        <td class="td">
                            <asp:Label ID="lblFrom" runat="server"></asp:Label></td>
                        <td class="td">
                            <asp:TextBox onpaste="return true" ID="txtFromDate" runat="server" CssClass="textbox_4"
                                Width="182px" onCut="return false" onDrop="return false" MaxLength="11"></asp:TextBox>

                            <script type="text/javascript">
  
                            var rangeDemoFormat = document.getElementById('ctl00_BodyContentPH_ucupRptFilters_Hidden1').value;
                            var rangeDemoConv = new AnyTime.Converter({format:rangeDemoFormat});if(rangeDemoFormat =='DD-MMM-YYYY'){var Earlier="01-Jan-1900";var Final="31-Dec-9999";}else{var Earlier="01/01/1900";var Final="12/31/9999";}    
                            $("#ctl00_BodyContentPH_ucupRptFilters_txtFromDate").AnyTime_picker({earliest:Earlier,format:rangeDemoFormat,latest:Final});
                            </script>

                            <asp:CustomValidator ID="cus_FromDate" runat="server" EnableClientScript="False"
                                OnServerValidate="ValidateFromDate" 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">
                            <asp:Label ID="lblTo" runat="server"></asp:Label></td>
                        <td class="td">
                            <asp:TextBox onpaste="return true" ID="txtToDate" runat="server" CssClass="textbox_4"
                                Width="182px" onCut="return false" onDrop="return false" MaxLength="11"></asp:TextBox>

                            <script type="text/javascript">
  
                            var rangeDemoFormat = document.getElementById('ctl00_BodyContentPH_ucupRptFilters_Hidden1').value;
                            var rangeDemoConv = new AnyTime.Converter({format:rangeDemoFormat});if(rangeDemoFormat =='DD-MMM-YYYY'){var Earlier="01-Jan-1900";var Final="31-Dec-9999";}else{var Earlier="01/01/1900";var Final="12/31/9999";}    
                            $("#ctl00_BodyContentPH_ucupRptFilters_txtToDate").AnyTime_picker({earliest:Earlier,format:rangeDemoFormat,latest:Final});
                            </script>

                            <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 colspan="4" style="height:4px;"></td>
                    </tr>
                  <%--  <tr>
                        <td colspan="4">--%>
                            <asp:Panel ID="pnlLevel" runat="server">
                            </asp:Panel>
                       <%-- </td>
                    </tr>--%>
                </table>
            </div>
        </td>
    </tr>
</table>
