<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterFile/TimeCheck.master"
    CodeFile="TA_UI_Report_LeaveApplication_Angler.aspx.cs" Inherits="Reports_TA_UI_Report_LeaveApplication_Angler" %>

<%--<%@ Register Src="../UserControls/TA_uc_OrgLevelFilter_Updated_WithoutMandatory.ascx" TagName="TA_uc_OrgLevel_Filter"
    TagPrefix="uc1" %>--%>
<%@ Register Src="~/UserControls/TA_uc_OrganizationLevels.ascx" TagName="OrganizationLevel"
    TagPrefix="uc" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ContentPlaceHolderID="BodyContentPH" ID="Report" 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 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"></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 }
            );

        });

    </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="lblLeaveReport" runat="server"></asp:Label>
            <asp:HiddenField ID="Hidden1" runat="server" />
        </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:Label ID="Label2" runat="server" Visible="false"></asp:Label>
                        <input id="Hidden3" type="hidden" value='<% Response.Write(Convert.ToString(Session["IDateFormat"])); %>' />
                    </div>
                </div>
                <div class="clearfix">
                </div>
            </div>
        </div>
        <div id="collapseOne">
            <div class="emp-filter">
                <div class="form-horizontal">
                    <div id="divEmployeeDetails" runat="server">
                        <div id="tblDetails" runat="server">
                            <div class="form-group row" style="display: none;">
                                <div class="col-md-2">
                                    <asp:Label ID="lblEmpSwipe" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onpaste="return true" ID="txtSwipeCard" MaxLength="20" runat="server"
                                        CssClass="form-control" 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>
                                </div>
                                <div class="col-md-1">
                                </div>

                            </div>
                            <div class="form-group row">
                                <div class="col-md-2">
                                    <asp:Label ID="lblEmployeeName" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onpaste="return true" ID="txtEmployeeName" runat="server" CssClass="form-control"
                                        MaxLength="50" onkeypress="return employeename_singlequotes_maxlength(event,this,50,MaxLength);"></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>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-2">
                                    <asp:Label ID="lblEmployeeId" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onpaste="return true" ID="txtEmployeeId" runat="server" CssClass="form-control"
                                        MaxLength="15" onkeypress="return acceptCharsNum_MaxLength(event,this,15,MaxLength);"></asp:TextBox>
                                    <cc1:AutoCompleteExtender ID="acEmployeeId" runat="server" CompletionSetCount="10"
                                        CompletionListItemCssClass="item" CompletionListHighlightedItemCssClass="AutocompleteCSS"
                                        CompletionInterval="10" Enabled="true" MinimumPrefixLength="1" TargetControlID="txtEmployeeId"
                                        ServicePath="../WebServices/AutoCompleteExtender.asmx" ServiceMethod="GetEmployeeIdForReports"
                                        CompletionListCssClass="autocomplete_completionListElement" FirstRowSelected="true">
                                    </cc1:AutoCompleteExtender>
                                </div>
                            </div>
                            <div class="form-group row">
                                <div class="col-md-2">
                                    <asp:Label ID="lblEmpCategory" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddlEmpCatagory" runat="server" CssClass="form-control select2"
                                        AppendDataBoundItems="true">
                                        <asp:ListItem Value="0" Selected="True" Text="-Select-"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-2">
                                    <asp:Label ID="lblEmpType" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddlEmpType" runat="server" CssClass="form-control select2"
                                        AppendDataBoundItems="true">
                                        <asp:ListItem Value="0" Selected="True" Text="-Select-"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="form-group row">
                                <div class="col-md-2">
                                    <asp:Label ID="lblDesignation" runat="server" Text="Designation"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddlDesignation" runat="server" CssClass="form-control select2"
                                        AppendDataBoundItems="true">
                                        <asp:ListItem Value="0" Selected="True" Text="All"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-2">
                                    <asp:Label ID="lblGender" runat="server" Text="Gender"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddlGender" runat="server" CssClass="form-control select2">
                                        <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>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="trTime" runat="server">
                        <div id="divTimePeriod" runat="server">
                            <div id="Table1" runat="server">
                                <div class="form-group row">
                                    <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:RequiredFieldValidator ID="reqFromDate" runat="server" ControlToValidate="txtFromDate"
                                            Display="None" EnableClientScript="False" ErrorMessage="Please select FromDate"></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_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>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="trLeaveType" runat="server">
                        <div id="div1" runat="server">
                            <div id="Table2" runat="server">
                                <div class="form-group row">
                                    <div class="col-md-2">
                                        <asp:Label ID="lblLeaveType" runat="server" Text="Leave Type"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:DropDownList ID="ddlLeaveType" runat="server" CssClass="form-control select2">
                                        </asp:DropDownList>
                                    </div>
                                    <div class="col-md-1">
                                    </div>
                                    <div class="col-md-2">
                                        <asp:Label ID="lblStatus1" runat="server" Text="Status"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:DropDownList ID="ddlLeaveStatus" runat="server" CssClass="form-control select2">
                                            <asp:ListItem Text="All" Value="All"></asp:ListItem>
                                            <asp:ListItem Text="Approved" Value="Approved"></asp:ListItem>
                                            <asp:ListItem Text="Forwarded" Value="Forwarded"></asp:ListItem>
                                            <asp:ListItem Text="Pending" Value="Pending"></asp:ListItem>
                                            <asp:ListItem Text="Rejected" Value="Rejected"></asp:ListItem>
                                            <asp:ListItem Text="Resend" Value="Resend"></asp:ListItem>
                                            <asp:ListItem Text="Reply" Value="Reply"></asp:ListItem>
                                            <asp:ListItem Text="Canceled" Value="Canceled"></asp:ListItem>
                                        </asp:DropDownList>
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <div class="col-md-2">
                                        <asp:Label ID="lblStatus" runat="server"></asp:Label>
                                    </div>
                                </div>
                                <div class="form-group row" id="ckStatus" runat="server">
                                    <div class="col-md-2">
                                        <asp:CheckBox ID="cbAll" runat="server" Text="All" onclick="CheckSelectAll(this.checked);"
                                            CssClass="checkbox checkbox-primary" />
                                        <asp:CheckBox ID="CbApproved" runat="server" Text="Approved" onclick="CheckSelect();"
                                            CssClass="checkbox checkbox-primary" />
                                    </div>
                                    <div class="col-md-3">
                                        <asp:CheckBox ID="CBForwarded" runat="server" Text="Forwarded" onclick="CheckSelect();"
                                            CssClass="checkbox checkbox-primary" />
                                        <asp:CheckBox ID="CBPending" runat="server" Text="Pending" onclick="CheckSelect();"
                                            CssClass="checkbox checkbox-primary" />
                                    </div>
                                    <div class="col-md-1">
                                    </div>
                                    <div class="col-md-2">
                                        <asp:CheckBox ID="CBRejected" runat="server" Text="Rejected" onclick="CheckSelect();"
                                            CssClass="checkbox checkbox-primary" />
                                        <asp:CheckBox ID="CBResend" runat="server" Text="Resend" onclick="CheckSelect();"
                                            CssClass="checkbox checkbox-primary" />
                                    </div>
                                    <div class="col-md-3">
                                        <asp:CheckBox ID="CBReply" runat="server" Text="Reply" onclick="CheckSelect();" CssClass="checkbox checkbox-primary" />
                                        <asp:CheckBox ID="CBCanceled" runat="server" Text="Canceled" onclick="CheckSelect();"
                                            CssClass="checkbox checkbox-primary" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group row">
                        <div class="col-md-2">
                            <asp:Label ID="lblintimationtype" runat="server" Text="Intimation Type" />
                        </div>
                        <div class="col-md-1">
                            <asp:RadioButton ID="rdoall" runat="server" Text="All" Checked="true" GroupName="Intimation"
                                CssClass="radio radio-primary" />
                        </div>
                        <div class="col-md-3">
                            <asp:RadioButton ID="rdounplan" runat="server" Text="Unplanned" GroupName="Intimation"
                                CssClass="radio radio-primary" />
                        </div>
                        <div id="divReportType" runat="server">
                            <div class="col-md-2">
                                <asp:Label ID="lblReportType" runat="server" Text="Report Type"></asp:Label>
                            </div>
                            <div class="col-md-1">
                                <asp:RadioButton ID="rbtnDetails" runat="server" Text="Details" GroupName="ReportType1"
                                    Checked="true" onclick="EnableDateFormat();" CssClass="radio radio-primary" />

                            </div>
                            <div class="col-md-1">
                                <asp:RadioButton ID="rbtnSummary" runat="server" Text="Summary" GroupName="ReportType1"
                                    onclick="EnableDateFormat();" CssClass="radio radio-primary" />
                            </div>
                        </div>
                    </div>
                    <asp:UpdatePanel ID="upOrgLevel" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <asp:PlaceHolder ID="PlaceHolderLeaveApplication" runat="server">
                                <uc:OrganizationLevel ID="ucOrganizationLevel" runat="server" />
                            </asp:PlaceHolder>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <div class="form-group row" style="display: none">
                        <div class="col-md-2">
                        </div>
                        <div class="col-md-3">
                            <asp:RadioButton ID="rbtNormalReport" runat="server" Checked="True" GroupName="ReportType"
                                Text="Normal Report" />
                            <asp:RadioButton ID="rbtGraphReport" runat="server" Text="Graph Report" GroupName="ReportType" />
                        </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 view-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>

    <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 ";


        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 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_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(ToDate);

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

                return false;
            }


        }

        function EnableDateFormat() {
            if (document.aspnetForm.ctl00_BodyContentPH_rbtnSummary.checked == true) {
                document.getElementById('ctl00_BodyContentPH_trTime').style.display = "none";
                //Added by MAnjula.P on 07-Feb-2014 for hiding leave type and status 
                document.getElementById('ctl00_BodyContentPH_trLeaveType').style.display = "none";
            }
            else if (document.aspnetForm.ctl00_BodyContentPH_rbtnDetails.checked == true) {
                document.getElementById('ctl00_BodyContentPH_trTime').style.display = "block";
                //Added by MAnjula.P on 07-Feb-2014 for hiding leave type and status 
                document.getElementById('ctl00_BodyContentPH_trLeaveType').style.display = "";
            }
            //return true;
        }
        //Added by Manjula.P on 08-May-2014 for checkbox list of the status
        function CheckSelectAll(para) {

            if (para) {
                document.getElementById("<%=CbApproved.ClientID%>").checked = true;
                document.getElementById("<%=CBForwarded.ClientID%>").checked = true;
                document.getElementById("<%=CBPending.ClientID%>").checked = true;

                document.getElementById("<%=CBRejected.ClientID%>").checked = true;
                document.getElementById("<%=CBResend.ClientID%>").checked = true;
                document.getElementById("<%=CBReply.ClientID%>").checked = true;
                document.getElementById("<%=CBCanceled.ClientID%>").checked = true;
            }
            else {
                document.getElementById("<%=CbApproved.ClientID%>").checked = false;
                document.getElementById("<%=CBForwarded.ClientID%>").checked = false;
                document.getElementById("<%=CBPending.ClientID%>").checked = false;

                document.getElementById("<%=CBRejected.ClientID%>").checked = false;
                document.getElementById("<%=CBResend.ClientID%>").checked = false;
                document.getElementById("<%=CBReply.ClientID%>").checked = false;
                document.getElementById("<%=CBCanceled.ClientID%>").checked = false;
            }
        }
        function CheckSelect() {
            if (document.getElementById("<%=CbApproved.ClientID%>").checked == false || document.getElementById("<%=CBForwarded.ClientID%>").checked == false ||
                    document.getElementById("<%=CBPending.ClientID%>").checked == false || document.getElementById("<%=CBRejected.ClientID%>").checked == false ||
                        document.getElementById("<%=CBResend.ClientID%>").checked == false || document.getElementById("<%=CBReply.ClientID%>").checked == false || document.getElementById("<%=CBCanceled.ClientID%>").checked == false) {
                document.getElementById("<%=cbAll.ClientID%>").checked = false;
            }
            else {
                document.getElementById("<%=cbAll.ClientID%>").checked = true;
            }
        }

    </script>

</asp:Content>
