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

<%--<%@ Register Src="../UserControls/TA_uc_OrgLevel_Filter.ascx" TagName="TA_uc_OrgLevel_Filter"
    TagPrefix="uc4" %>--%>
<%@ Register Src="../UserControls/TA_uc_OrgLevelFilter_Updated.ascx" TagName="TA_uc_OrgLevel_Filter"
    TagPrefix="uc4" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="ConPermissionSanction" ContentPlaceHolderID="BodyContentPH" 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 language="javascript" src="../js/DateTimeValidation.js" type="text/javascript"></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:';
    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 EnterFromDate = "Enter From Date";
    var EnterToDate = "Enter To Date";
    var SelectStatus = "Select Status";
    function SetAlertMessages(enterFromDate, enterToDate, selectStatus) 
    {
        EnterFromDate = enterFromDate;
        EnterToDate = enterToDate;
        SelectStatus = selectStatus;
    }
    function CheckStatus()
    {                        
        if(document.aspnetForm.ctl00_BodyContentPH_txtFromDate.value=='' && document.aspnetForm.ctl00_BodyContentPH_txtToDate.value!='')
        {
            alert(EnterFromDate);
            return false;
        }
        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))
            {
            }
            else
            {
                return false;
            }
        }
        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;
            }
        }
        if(document.aspnetForm.ctl00_BodyContentPH_txtFromDate.value!='' && document.aspnetForm.ctl00_BodyContentPH_txtToDate.value=='')
        {
            alert(EnterToDate);
            return false;
        }
        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;
            }
        }
    }
    </script>

    <link href="../css/ProgressBar.css" rel="stylesheet" type="text/css" />

    <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 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">
        <h1 style="background-image: url('../dist/img/lve-san.png'); background-repeat: no-repeat;padding-left: 35px">
            <asp:Label ID="lbl_Header" 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 pull-left">
                        <asp:Label ID="lblFilter" runat="server" Text="Filter"></asp:Label>
                        <asp:HiddenField ID="Hidden1" runat="server" />
                    </div>
                    <div class="pull-right">
                        <h6>
                            <span style="color: Red">|</span><span style="padding-left: 5px; padding-right: 10px"><asp:Label
                                ID="lbl_IndicatesMandatoryFields" runat="server"></asp:Label>
                                (1 No.)</span>
                        </h6>
                    </div>
                </div>
                <div class="clearfix">
                </div>
            </div>
        </div>
        <div id="collapseOne">
            <div class="emp-filter">
                <div class="row">
                    <div class="form-horizontal">
                        <div class="col-md-12">
                            <div class="form-group" id="trEmployeeDetails" runat="server">
                                <div class="col-md-2">
                                    <asp:Label ID="lbl_EmployeeName" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onpaste="return true" ID="txt_EmpName" runat="server" CssClass="form-control"
                                        MaxLength="50" onkeypress="return employeename_singlequotes_maxlength(event,this,50,MaxLength);"></asp:TextBox>
                                    <cc1:AutoCompleteExtender ID="acEmpName" runat="server" CompletionInterval="10" CompletionSetCount="10"
                                        CompletionListItemCssClass="item" CompletionListHighlightedItemCssClass="AutocompleteCSS"
                                        Enabled="true" FirstRowSelected="true" MinimumPrefixLength="1" ServicePath="../WebServices/AutoCompleteExtender.asmx"
                                        ServiceMethod="GetEmployeeName" CompletionListCssClass="autocomplete_completionListElement"
                                        TargetControlID="txt_EmpName">
                                    </cc1:AutoCompleteExtender>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-2">
                                    <asp:Label ID="lbl_EmployeeId" 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="GetEmployeeId"
                                        CompletionListCssClass="autocomplete_completionListElement" FirstRowSelected="true">
                                    </cc1:AutoCompleteExtender>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-md-2">
                                    <asp:Label ID="lbl_From" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onpaste="return true" ID="txtFromDate" runat="server" CssClass="form-control"
                                        EnableViewState="False" MaxLength="25" onCut="return false" onDrop="return false"></asp:TextBox>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-2">
                                    <asp:Label ID="lbl_To" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onpaste="return true" ID="txtToDate" runat="server" CssClass="form-control"
                                        EnableViewState="False" MaxLength="25" onCut="return false" onDrop="return false"></asp:TextBox>
                                    <asp:CustomValidator ID="cus_ComDate" runat="server" Display="None" EnableClientScript="False"
                                        OnServerValidate="CompareDate"></asp:CustomValidator>
                                </div>
                            </div>
                            <div class="form-group" id="trSwipeCardNo" runat="server">
                                <div class="col-md-2" style="display: none;">
                                    <asp:Label ID="lblEmpSwipe" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3" style="display: none;">
                                    <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="GetCardNo"
                                        CompletionListCssClass="autocomplete_completionListElement" FirstRowSelected="true">
                                    </cc1:AutoCompleteExtender>
                                    
                                </div>
                            <div class="col-md-12">
                                            <asp:Label ID="lbl_Status" runat="server"></asp:Label>
                                            <asp:DropDownList runat="server" ID="ddlStatus" style="display:none;"> </asp:DropDownList>
                                        </div>
                            </div>
                            <div class="form-group" style="padding-left:8px;">
                                   
                            <div class="col-md-1">  <asp:CheckBox ID="cbAll" runat="server" Text="All" onclick="CheckSelectAll(this.checked);"  CssClass="checkboxShift checkboxShift-primary"/> </div>
                            <div class="col-md-2"> <asp:CheckBox ID="CbApproved" runat="server" Text="Approved" onclick="CheckSelect();"  CssClass="checkboxShift checkboxShift-primary"/> </div>
                             <div class="col-md-2"><asp:CheckBox ID="CBForwarded" runat="server" Text="Forwarded" onclick="CheckSelect();"  CssClass="checkboxShift checkboxShift-primary"/> </div>
                             <div class="col-md-2"><asp:CheckBox ID="CBPending" runat="server" Text="Pending" onclick="CheckSelect();"  CssClass="checkboxShift checkboxShift-primary"/> </div>
                             <div class="col-md-2"><asp:CheckBox ID="CBRejected" runat="server" Text="Rejected" onclick="CheckSelect();"  CssClass="checkboxShift checkboxShift-primary"/> </div>
                             <div class="col-md-2"><asp:CheckBox ID="CBResend" runat="server" Text="Resend" onclick="CheckSelect();"  CssClass="checkboxShift checkboxShift-primary"/> </div>
                            <div class="col-md-1"> <asp:CheckBox ID="CBReply" runat="server" Text="Reply" onclick="CheckSelect();"  CssClass="checkboxShift checkboxShift-primary"/> </div>
                       </div>
                        </div>
                        <div class="clearfix">
                        </div>
                        <div class="row">
                            <div class="line16">
                            </div>
                        </div>
                        <div class="col-md-12">
                            <div class="row">
                                <div class="col-md-12">
                                    <uc4:TA_uc_OrgLevel_Filter ID="TA_UC_Organisation" runat="server"></uc4:TA_uc_OrgLevel_Filter>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-12">
                            <div class="row">
                                <div class="col-md-5">
                                </div>
                                <div class="col-md-6" align="right">
                                    <asp:LinkButton ID="btn_View" CssClass="btn view-btn fa-eye" runat="server" OnClick="btn_View_Click"
                                        OnClientClick="return CheckStatus();" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <script language="javascript">
        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;                
            }
            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;                
            }
        }
        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("<%=cbAll.ClientID%>").checked=false;   
                    }
                    else
                    {
                        document.getElementById("<%=cbAll.ClientID%>").checked=true;
                    }
        }
    </script>
</asp:Content>
