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

<asp:Content ContentPlaceHolderID="BodyContentPH" ID="Report" 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">

        //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:';




        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;
        }
    </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="lblAuditTrailReport" runat="server"></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="Filters"></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 class="row form-group">
                                <div class="col-md-2">
                                    <asp:Label ID="lblPageName" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddlTableName" runat="server" AppendDataBoundItems="True" CssClass="form-control select2">
                                        <asp:ListItem Value="All" Text="All"></asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:HiddenField ID="Hidden1" runat="server" />
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-2">
                                    <asp:Label ID="lblOperation" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddlOperation" runat="server" CssClass="form-control select2">
                                        <asp:ListItem Selected="True" Value="All" Text="All"></asp:ListItem>
                                        <asp:ListItem Value="Insert" Text="Insert"></asp:ListItem>
                                        <asp:ListItem Value="Update" Text="Update"></asp:ListItem>
                                        <asp:ListItem Value="Delete" Text="Delete"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="clearfix">
                            </div>
                            <div class="row">
                                <div class="row">
                                    <div class="line16">
                                    </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 form-group">
                                <div class="col-md-2">
                                    <asp:Label ID="lblTimePeriod" runat="server"></asp:Label>
                                    -
                                    <asp:Label ID="lblFrom" runat="server"></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>
                                    <asp:RequiredFieldValidator ID="reqFromDate" runat="server" ControlToValidate="txtFromDate"
                                        Display="None" EnableClientScript="False"></asp:RequiredFieldValidator>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-2">
                                    <asp:Label ID="lblTo" runat="server"></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>
                                    <asp:RequiredFieldValidator ID="reqToDate" runat="server" ControlToValidate="txtToDate"
                                        Display="None" EnableClientScript="False"></asp:RequiredFieldValidator>
                                </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-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:ValidationSummary ID="ValidationSummary1" ShowMessageBox="false" ShowSummary="false"
                                            runat="server" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script language="javascript" type="text/javascript">
        var SelectFromDate = "Select From Date";
        var SelectToDate = "Select To Date";

        function SetAlertMessages(selectFromDate, selectToDate) {
            SelectFromDate = selectFromDate;
            SelectToDate = selectToDate;
        }

        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(SelectToDate);
                        return false;
                    }

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

        }

    </script>

</asp:Content>
