<%@ Page Language="C#" MasterPageFile="~/MasterFile/TimeCheck.master" AutoEventWireup="true" EnableEventValidation="false"
    CodeFile="TA_UI_LeavePermissionDailyReport.aspx.cs" Inherits="Reports_TA_UI_LeavePermissionDailyReport" %>

<%@ Register Src="../UserControls/TA_uc_OrgLevelFilter_Updated.ascx" TagName="TA_uc_OrgLevel_Filter"
    TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="Server">
  

    <script type="text/javascript" src="../bootstrap/js/1.4.3/jquery.min.js"></script>

    <script src="../bootstrap/js/1.8.5/jquery-ui.min.js" type="text/javascript"></script>

    <script src="../plugins/datepicker/jquery-1.11.1.min.js" type="text/javascript"></script>

    <script language="javascript" src="../js/jquery.autocomplete.js" type="text/javascript"></script>

    <script src="../plugins/datepicker/bootstrap-datepicker.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(function () {
            $('#ctl00_BodyContentPH_txtFromDate').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value }
            );
        });
        $(function () {
            $('#ctl00_BodyContentPH_txtToDate').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value }
            );

        });

    </script>

    <div class="content-header" id="conHeader" runat="server">
        <h1 style="background-image: url(../dist/img/swipe-icon.png); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lblShiftReport" runat="server" Text="Leave 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-2">
                    <div class="inr-fil-text">
                        <asp:Label ID="lblFilter" runat="server" Text="Filters"></asp:Label>
                        <asp:HiddenField ID="Hidden1" runat="server" />
                        <asp:HiddenField ID="hdnReportFilters" runat="server" />
                        <asp:HiddenField ID="hdnReportType1" runat="server" />
                        <asp:HiddenField ID="hdnCompanyId1" runat="server" />
                        <input id="Hidden2" type="hidden" value='<% Response.Write(Session["IDateFormat"].ToString()); %>' />
                    </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-2">
                            <asp:Label ID="lblTimePeriod" Text="Date" runat="server"></asp:Label>
                        </div>
                        <div class="col-md-3">
                            <asp:TextBox onpaste="return true" ID="txtFromDate" runat="server" Width="150px"
                                CssClass="form-control" onCut="return false" onDrop="return false" MaxLength="11"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="reqFromDate" runat="server" ControlToValidate="txtFromDate"
                                Display="None" EnableClientScript="False" ErrorMessage="Please select FromDate"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="row">
                        <div class="row">
                            <div class="line16">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <asp:PlaceHolder ID="PlaceHolderShift" runat="server">
                                <uc1:TA_uc_OrgLevel_Filter ID="TA_uc_OrgLevel_Filter1" runat="server"></uc1:TA_uc_OrgLevel_Filter>
                            </asp:PlaceHolder>
                            <asp:Button ID="IDTest1" runat="server" OnClick="IDTest1_Click" />
                        </div>
                    </div>
                    <div class="row form-group" id="trStatus">
                        <div class="col-md-2">
                            <asp:Label ID="lbl_ReportingTo" runat="server" Text="Reporting"></asp:Label>
                        </div>
                        <div class="col-md-3">
                            <%--  <asp:DropDownList ID="ddl_ReportingTo"  CssClass="form-control" runat="server" AppendDataBoundItems="True">
                                <asp:ListItem>-Select-</asp:ListItem>
                            </asp:DropDownList>--%>
                            <asp:DropDownList ID="ddl_ReportingToNew" CssClass="form-control select2" runat="server" AppendDataBoundItems="True">
                                <asp:ListItem>-Select-</asp:ListItem>
                            </asp:DropDownList>

                        </div>
                        <div class="col-md-1">
                        </div>
                        <div class="col-md-2">
                            <asp:Label ID="lbl_LeaveSanctioninguthority" runat="server" Text="Sanctioning"></asp:Label>
                        </div>
                        <div class="col-md-3">
                            <%--  <asp:DropDownList ID="ddl_LeaveSancAuthority" runat="server" AppendDataBoundItems="true"
                                 CssClass="form-control">
                                <asp:ListItem>-Select-</asp:ListItem>
                            </asp:DropDownList>--%>
                            <asp:DropDownList ID="ddl_LeaveSancAuthorityNew" runat="server" AppendDataBoundItems="true"
                                CssClass="form-control select2">
                                <asp:ListItem>-Select-</asp:ListItem>
                            </asp:DropDownList>
                        </div>
                    </div>

                    <div class="row form-group">
                        <div class="col-md-5"></div>
                        <div class="col-md-6">
                            <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()" />
                                <asp:Button ID="btnSave" Visible="false" Text="SAVE" CssClass="but" runat="server"
                                    OnClick="btnSave_Click" />
                                <asp:Button ID="btnBack" Visible="false" Text="BACK" CssClass="but" runat="server"
                                    OnClick="btnBack_Click" />

                                <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="false"
                                    ShowSummary="true" />
                            </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 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>
