<%@ page language="C#" validaterequest="false" autoeventwireup="true" inherits="Reports_TA_UI_Report_TotalHoursList, App_Web_jwtaq1tg" masterpagefile="~/Reports/TA_Page_Template_Rpt.master" %>

<%@ Register Src="../UserControls/TA_uc_OrgLevelFilter_Updated.ascx" TagName="TA_uc_OrgLevel_Filter"
    TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ContentPlaceHolderID="BodyContentPHRpt" ID="Report" runat="server">
    <table border="0" cellspacing="0" cellpadding="0" width="500">
        <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="5" class="ModuleTitle" align="left">
                            <font color="#000080">Total Late Hours List Report</font></td>
                    </tr>
                    <tr>
                        <td colspan="5" style="padding-left: 0px; padding-bottom: 0px; padding-top: 0px; padding-right: 0px">
                            <%--<input id="Hidden1" type="hidden" value='<% Response.Write(Session["IDateFormat"].ToString()); %>'/>--%>
                            <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">Employee Name</td>
                                        <td class="td">
                                            <asp:TextBox ID="txtEmployeeName" runat="server" CssClass="textbox_4" onkeypress="return character_only(event,this)"></asp:TextBox>
                                            <cc1:AutoCompleteExtender ID="acEmployeeName" runat="server" CompletionSetCount="10"
                                                CompletionListItemCssClass="item" CompletionListHighlightedItemCssClass="AutocompleteCSS"
                                                CompletionInterval="10" Enabled="true" MinimumPrefixLength="1" TargetControlID="txtEmployeeName"
                                                ServicePath="../WebServices/AutoCompleteExtender.asmx" ServiceMethod="GetEmployeeNameForReports"
                                                CompletionListCssClass="autocomplete_completionListElement" FirstRowSelected="true">
                                            </cc1:AutoCompleteExtender>
                                        </td>
                                        <td class="td">Employee Id</td>
                                        <td class="td">
                                            <asp:TextBox ID="txtEmpId" runat="server" CssClass="textbox_4" onkeypress="return character_number_nospace(event,this)"></asp:TextBox>
                                            <cc1:AutoCompleteExtender ID="acEmployeeId" runat="server" CompletionSetCount="10"
                                                CompletionListItemCssClass="item" CompletionListHighlightedItemCssClass="AutocompleteCSS"
                                                CompletionInterval="10" Enabled="true" MinimumPrefixLength="1" TargetControlID="txtEmpId"
                                                ServicePath="../WebServices/AutoCompleteExtender.asmx" ServiceMethod="GetEmployeeIdForReports"
                                                CompletionListCssClass="autocomplete_completionListElement" FirstRowSelected="true">
                                            </cc1:AutoCompleteExtender>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="td">
                                            <asp:Label ID="lblEmpCategory" runat="server" Text="Employee Category"></asp:Label></td>
                                        <td class="td">
                                            <asp:DropDownList ID="ddlEmpCatagory" runat="server" CssClass="dlist" AppendDataBoundItems="true">
                                                <asp:ListItem Value="0" Selected="True">-Select-</asp:ListItem>
                                            </asp:DropDownList></td>
                                        <td class="td">
                                            <asp:Label ID="lblEmpType" runat="server" Text="Employee Type"></asp:Label></td>
                                        <td class="td">
                                            <asp:DropDownList ID="ddlEmpType" runat="server" CssClass="dlist" AppendDataBoundItems="true">
                                                <asp:ListItem Value="0" Selected="True">-Select-</asp:ListItem>
                                            </asp:DropDownList></td>
                                    </tr>
                                    <%--Added by Manjula.P on 06-May-2014 for Getting filter option for Gender and designation--%>
                                    <tr>
                                        <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">
                                                <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">
                                                <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>
                                </table>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="td" style="width: 110px">Time Period</td>
                        <td class="td">From</td>
                        <td class="td">
                            <table>
                                <tr>
                                    <td>
                                        <asp:TextBox ID="txtFromDate" onkeypress="return key_press_nokey(this)" onkeydown="return key_press_nokey(this)"
                                            onDrop="return false;" onPaste="return false;" onCut="return false;" runat="server"
                                            CssClass="textbox_4" Width="150px" />
                                    </td>
                                    <td class="datepicker">
                                        <input type="image" src="../Images/dateicon.gif" id="butFromDate" align="middle"
                                            runat="server" style="display: none" />
                                    </td>
                                </tr>
                            </table>

                            <script type="text/javascript">
                                //                                Calendar.setup({
                                //                                    inputField     :    "ctl00_BodyContentPHRpt_txtFromDate",      // id of the input field
                                //                                    ifFormat       :    document.getElementById('ctl00_BodyContentPHRpt_Hidden1').value,       // format of the input field
                                //                                    showsTime      :    false,            // will display a time selector
                                //                                    button         :    "ctl00_BodyContentPHRpt_butFromDate",   // trigger for the calendar (button ID)
                                //                                    singleClick    :    true,           // double-click mode
                                //                                    step           :    1                // show all years in drop-down boxes (instead of every other year as default)
                                //                                });
                                var rangeDemoFormat = document.getElementById('ctl00_BodyContentPHRpt_Hidden1').value;
                                var rangeDemoConv = new AnyTime.Converter({ format: rangeDemoFormat }); if (rangeDemoFormat == '%d-%b-%Y') { var Earlier = "01-Jan-1900"; var Final = "31-Dec-9999"; } else { var Earlier = "01/01/1900"; var Final = "12/31/9999"; }
                                $("#ctl00_BodyContentPHRpt_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">To</td>
                        <td class="td">
                            <table>
                                <tr>
                                    <td>
                                        <asp:TextBox ID="txtToDate" runat="server" onkeypress="return key_press_nokey(this)"
                                            onkeydown="return key_press_nokey(this)" onDrop="return false;" onPaste="return false;"
                                            onCut="return false;" CssClass="textbox_4" Width="150px" />
                                    </td>
                                    <td class="datepicker">
                                        <input type="image" src="../Images/dateicon.gif" id="butToDate" align="middle" runat="server"
                                            style="display: none" />
                                    </td>
                                </tr>
                            </table>

                            <script type="text/javascript">
                                //                                Calendar.setup({
                                //                                    inputField     :    "ctl00_BodyContentPHRpt_txtToDate",      // id of the input field
                                //                                    ifFormat       :    document.getElementById('ctl00_BodyContentPHRpt_Hidden1').value,       // format of the input field
                                //                                    showsTime      :    false,            // will display a time selector
                                //                                    button         :    "ctl00_BodyContentPHRpt_butToDate",   // trigger for the calendar (button ID)
                                //                                    singleClick    :    true,           // double-click mode
                                //                                    step           :    1                // show all years in drop-down boxes (instead of every other year as default)
                                //                                });
                                var rangeDemoFormat = document.getElementById('ctl00_BodyContentPHRpt_Hidden1').value;
                                var rangeDemoConv = new AnyTime.Converter({ format: rangeDemoFormat }); if (rangeDemoFormat == '%d-%b-%Y') { var Earlier = "01-Jan-1900"; var Final = "31-Dec-9999"; } else { var Earlier = "01/01/1900"; var Final = "12/31/9999"; }
                                $("#ctl00_BodyContentPHRpt_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 style="display: none; visibility: hidden;">
                        <td class="td" colspan="4">
                            <asp:Label ID="lblMinimumWorkHours" runat="server" Text="Late Hours (Greater than or Equal to) "></asp:Label></td>
                        <td class="td">
                            <asp:TextBox ID="txtMinWorkHours" runat="server" CssClass="textbox_Short" MaxLength="5"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegExMonthlyWorkingHours" runat="server" ControlToValidate="txtMinWorkHours"
                                Display="None" ErrorMessage="InValid Time Format" ValidationExpression="^((\d+):([0-5][0-9]))$">*</asp:RegularExpressionValidator>
                            HH:mm
                        </td>
                    </tr>
                    <tr style="display: none; visibility: hidden;">
                        <td class="td" colspan="4">
                            <asp:Label ID="lblMinimumLunchHours" runat="server" Text="Break Late Hours (Greater than or Equal to) "></asp:Label></td>
                        <td class="td">
                            <asp:TextBox ID="txtMinLunchHours" runat="server" CssClass="textbox_Short" MaxLength="5"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegExMonthlyLateHours" runat="server" ControlToValidate="txtMinLunchHours"
                                Display="None" ErrorMessage="InValid Time Format" ValidationExpression="^((\d+):([0-5][0-9]))$">*</asp:RegularExpressionValidator>
                            HH:mm
                        </td>
                    </tr>
                    <tr>
                        <td colspan="5" class="td">
                            <asp:PlaceHolder ID="PlaceHolderEmployees" runat="server">
                                <uc1:TA_uc_OrgLevel_Filter ID="TA_uc_OrgLevel_Filter1" runat="server" />
                            </asp:PlaceHolder>
                        </td>
                    </tr>
                    <tr>
                        <td class="td" colspan="3">
                            <asp:Label ID="lblReportType" runat="server" Text="Report Type "></asp:Label>
                            <asp:RadioButton ID="rbtnSummaryReport" GroupName="ReportType" Text="Summary" Checked="true"
                                runat="server" />
                            <asp:RadioButton ID="rbtnDetailedReport" GroupName="ReportType" Text="Detailed" runat="server" />
                        </td>
                        <td class="td" colspan="2">
                            <asp:Label ID="lblLateType" runat="server" Text="Report Type "></asp:Label>
                            <asp:RadioButton ID="rbtnTotalLate" GroupName="LateType" Text="Total Late" Checked="true"
                                runat="server" />
                            <asp:RadioButton ID="rbtnBreakLate" GroupName="LateType" Text="Break Late" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td align="center" valign="bottom" colspan="5" style="height: 65px">
                            <table width="43%" 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="return DateEntryValidation()" /></td>
                                </tr>
                            </table>
                            <asp:ValidationSummary ID="ValidationSummary1" 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 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 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 DateEntryValidation() {
            var rangeDemoFormat = document.getElementById('ctl00_BodyContentPHRpt_Hidden1').value;
            var rangeDemoConv = new AnyTime.Converter({ format: rangeDemoFormat }); if (rangeDemoFormat == '%d-%b-%Y') { var Earlier = "01-Jan-1900"; var Final = "31-Dec-9999"; } else { var Earlier = "01/01/1900"; var Final = "12/31/9999"; }
            $("#ctl00_BodyContentPHRpt_txtFromDate").AnyTime_noPicker();
            $("#ctl00_BodyContentPHRpt_txtFromDate").AnyTime_picker({ earliest: Earlier, format: rangeDemoFormat, latest: Final });
            $("#ctl00_BodyContentPHRpt_txtToDate").AnyTime_noPicker();
            $("#ctl00_BodyContentPHRpt_txtToDate").AnyTime_picker({ earliest: Earlier, format: rangeDemoFormat, latest: Final });
            if (document.aspnetForm.ctl00_BodyContentPHRpt_txtFromDate.value != '') {
                var weekDay = document.aspnetForm.ctl00_BodyContentPHRpt_txtFromDate;
                var DateFormat = document.getElementById('ctl00_BodyContentPHRpt_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_BodyContentPHRpt_txtToDate.value != '') {
                        var weekDay = document.aspnetForm.ctl00_BodyContentPHRpt_txtToDate;
                        var DateFormat = document.getElementById('ctl00_BodyContentPHRpt_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(ToDate);

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

                return false;
            }


        }


    </script>
</asp:Content>
