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

<%@ Register TagPrefix="dxGridview" Namespace="DevExpress.Web" Assembly="DevExpress.Web.v14.2" %>
<%@ Register Src="~/UserControls/TA_uc_OrgLevelFilter_Updated.ascx" TagName="TA_uc_OrgLevel_Filter"
    TagPrefix="ucl1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="ConOverTimeSanction" 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]-->
    <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 language="javascript" src="../js/DateTimeValidation.js" type="text/javascript"></script>
    <script src="../plugins/datepicker/jquery-1.11.1.min.js"></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>
    <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 SelectFromDate = "Please Select From Date";
        var SelectToDate = "Please Select To Date";
        var SelectStatus = "Select Status";
        var ToDate = "To Date should be greater than From Date";
        function SetAlertMessages(fromDate, selectToDate, selectStatus, toDate) {
            SelectFromDate = fromDate;
            SelectToDate = selectToDate;
            SelectStatus = selectStatus;
            ToDate = toDate;
        }
        function checkMonth(MonthName) {
            if (MonthName == 'Jan')
                return 1;
            if (MonthName == 'Feb')
                return 2;
            if (MonthName == 'Mar')
                return 3;
            if (MonthName == 'Apr')
                return 4;
            if (MonthName == 'May')
                return 5;
            if (MonthName == 'Jun')
                return 6;
            if (MonthName == 'Jul')
                return 7;
            if (MonthName == 'Aug')
                return 8;
            if (MonthName == 'Sep')
                return 9;
            if (MonthName == 'Oct')
                return 10;
            if (MonthName == 'Nov')
                return 11;
            if (MonthName == 'Dec')
                return 12;
        }
        function OpenEmployeeOTSanctionWindow(SelectFromDate, SelectToDate, SelectStatus, toDate) {
            var rangeDemoFormat = document.getElementById('ctl00_BodyContentPH_Hidden1').value;
            if (document.getElementById("<%= txtFromDate.ClientID%>").value == "" && document.getElementById("<%= txtToDate.ClientID%>").value != "") {
                alert(SelectFromDate);
                return false;
            }
            else if (document.getElementById("<%= txtFromDate.ClientID%>").value != "" && document.getElementById("<%= txtToDate.ClientID%>").value == "") {
                alert(SelectToDate);
                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.getElementById("<%= txtToDate.ClientID%>").value != "" && document.getElementById("<%= txtFromDate.ClientID %>").value != "") {
                //validation for MM/dd/YYYY format
                if (document.getElementById('ctl00_BodyContentPH_Hidden1').value == 'MM/DD/YYYY') {
                    var date1 = document.getElementById("<%= txtFromDate.ClientID%>").value;
                    var date1Month = date1.substring(0, 2);
                    var date1Date = date1.substring(3, 5);
                    var date1Year = date1.substring(6, date1.length);
                    var date2 = document.getElementById("<%= txtToDate.ClientID%>").value;
                    var date2Month = date2.substring(0, 2);
                    var date2Date = date2.substring(3, 5);
                    var date2Year = date2.substring(6, date2.length);
                }
                //validation for dd/MM/YYYY format
                if (document.getElementById('ctl00_BodyContentPH_Hidden1').value == 'DD/MM/YYYY') {
                    var date1 = document.getElementById("<%= txtFromDate.ClientID%>").value;
                    var date1Month = date1.substring(3, 5);
                    var date1Date = date1.substring(0, 2);
                    var date1Year = date1.substring(6, date1.length);
                    var date2 = document.getElementById("<%= txtToDate.ClientID%>").value;
                    var date2Month = date2.substring(3, 5);
                    var date2Date = date2.substring(0, 2);
                    var date2Year = date2.substring(6, date2.length);
                }
                //validation for dd-MMM-YYYY format
                if (document.getElementById('ctl00_BodyContentPH_Hidden1').value == 'DD-MMM-YYYY') {
                    var date1 = document.getElementById("<%= txtFromDate.ClientID%>").value;
                    var mon = date1.substring(3, 6);
                    var date1Month = checkMonth(mon);
                    var date1Date = date1.substring(0, 2);
                    var date1Year = date1.substring(7, date1.length);
                    var date2 = document.getElementById("<%= txtToDate.ClientID%>").value;
                    var mon1 = date2.substring(3, 6);
                    var date2Month = checkMonth(mon1);
                    var date2Date = date2.substring(0, 2);
                    var date2Year = date2.substring(7, date2.length);
                }
                if (date1Year >= date2Year) {
                    if (date1Year > date2Year) {
                        alert(toDate);
                        document.getElementById("<%= txtToDate.ClientID%>").focus();
                        return false;
                    }
                    if (date1Year == date2Year) {
                        if (date1Month >= date2Month) {
                            if (date1Month > date2Month) {
                                alert(toDate);
                                document.getElementById("<%= txtToDate.ClientID%>").focus();
                                return false;
                            }
                            if (date1Month == date2Month) {
                                if (date1Date > date2Date) {
                                    alert(toDate);
                                    document.getElementById("<%= txtToDate.ClientID%>").focus();
                                    return false;
                                }

                            }
                        }

                    }
                }
            }
            var Employeeid = document.getElementById('<%=txtEmployeeId.ClientID %>').value;
            var EmployeeName = document.getElementById('<%=txtEmployeeName.ClientID %>').value;
            var EmpCategory = document.getElementById('<%=ddlEmpCatagory.ClientID %>').value;
            var EmpType = document.getElementById('<%=ddlEmpType.ClientID %>').value;
            var FromDate = document.getElementById('<%=txtFromDate.ClientID %>').value;
            var ToDate = document.getElementById('<%=txtToDate.ClientID %>').value;
            var Status = document.getElementById('<%=ddlOTStatus.ClientID %>').value;
            var SwipeCard = document.getElementById('<%=txtSwipeCard.ClientID %>').value;
            var SanctionType = '';
            var rbtnOverTime = document.getElementById('<%=rbtnOverTime.ClientID %>');
            var rbtnCompoff = document.getElementById('<%=rbtnCompoff.ClientID %>');
            var rbtnOTCompOff = document.getElementById('<%=rbtnOTCompOff.ClientID %>');
            if (rbtnOverTime.checked == true) {
                SanctionType = "OverTime";
            }
            else if (rbtnCompoff.checked == true) {
                SanctionType = "compoff";
            }
            else if (rbtnOTCompOff.checked == true) {
                SanctionType = "CompOffAndOT";
                //  popupwindow('PopUp_EmployeeOTCompOffSanction.aspx?EmpId='+Employeeid+ '&SanctionType='+SanctionType+ '&EmpName='+EmployeeName +'&EmpCategory='+EmpCategory +'&EmpType='+EmpType+'&FromDate='+FromDate+'&ToDate='+ToDate+'&Status='+Status+ '&SwipeCard='+ SwipeCard + '','',1100,650);
                document.getElementById('ctl00_BodyContentPH_iframePopup').src = 'PopUp_EmployeeOTCompOffSanction.aspx?EmpId=' + Employeeid + '&SanctionType=' + SanctionType + '&EmpName=' + EmployeeName + '&EmpCategory=' + EmpCategory + '&EmpType=' + EmpType + '&FromDate=' + FromDate + '&ToDate=' + ToDate + '&Status=' + Status + '&SwipeCard=' + SwipeCard + '', '';
                return false;
            }
            document.getElementById('ctl00_BodyContentPH_iframePopup').src = 'PopUp_EmployeeOTSanction.aspx?EmpId=' + Employeeid + '&SanctionType=' + SanctionType + '&EmpName=' + EmployeeName + '&EmpCategory=' + EmpCategory + '&EmpType=' + EmpType + '&FromDate=' + FromDate + '&ToDate=' + ToDate + '&Status=' + Status + '&SwipeCard=' + SwipeCard + '', '';
            // popupwindow('PopUp_EmployeeOTSanction.aspx?EmpId='+Employeeid+ '&SanctionType='+SanctionType+ '&EmpName='+EmployeeName +'&EmpCategory='+EmpCategory +'&EmpType='+EmpType+'&FromDate='+FromDate+'&ToDate='+ToDate+'&Status='+Status+ '&SwipeCard='+ SwipeCard + '','',1100,650);
            //window.open('PopUp_EmployeeOTSanction.aspx?EmpId='+Employeeid+ '&SanctionType='+SanctionType+ '&EmpName='+EmployeeName +'&EmpCategory='+EmpCategory +'&EmpType='+EmpType+'&FromDate='+FromDate+'&ToDate='+ToDate+'&Status='+Status+ '&SwipeCard='+ SwipeCard + '','','left=250px, top=200px, width=800px, height=650px, scrollbars=yes, status=yes, resizable=no');
            return false;
        }
        //On Center Screen
        function popupwindow(url, title, w, h) {
            var left = (screen.width / 2) - (w / 2);
            var top = (screen.height / 2) - (h / 2);
            return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
        }
    </script>
    <div class="content-header">
        <h1 style="background-image: url('../dist/img/overtime-icon.png'); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lblOverTimeSanction" 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>
                    </div>
                    <div class="pull-right">
                        <h6>
                            <span style="color: Red">|</span><span style="padding-left: 10px; padding-right: 10px">
                                <asp:Label ID="lbl_IndicatesMandatoryFields" runat="server"></asp:Label>
                                <asp:HiddenField ID="Hidden1" runat="server" />
                                (2 No.)</span>
                        </h6>
                    </div>
                </div>
                <div class="clearfix">
                </div>
            </div>
        </div>
        <div id="myModal" class="modal modal-default fade" role="dialog">
            <div class="modal-dialog" style="min-width: 90%;">
                <!-- Modal content-->
                <div class="modal-content" style="margin-top: 50px">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" style="border-radius: 50px;">
                            &times;</button>
                        <h4 class="modal-title" style="padding-bottom: 10px">
                            <asp:Label ID="lbl_OT_Comp" runat="server" Text="OT-Comp Off Sanction"></asp:Label></h4>
                    </div>
                    <div class="modal-body" style="padding-top: 0px">
                        <iframe id="iframePopup" runat="server" scrolling="auto" width="100%" height="700px"
                            style="border-style: none"></iframe>
                    </div>
                    <div class="modal-footer" style="display: none">
                        <button type="button" class="btn btn-primary pull-right" data-dismiss="modal">
                            Close</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="emp-filter">
            <div class="form-horizontal">
                <div class="row">
                    <div class="col-md-12">
                        <div id="divEmployeeDetails" runat="server">
                            <div>
                                <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="textbox_4" 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>
                            <div class="form-group">
                                <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="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="txtEmployeeName">
                                    </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="GetEmployeeId"
                                        CompletionListCssClass="autocomplete_completionListElement" FirstRowSelected="true">
                                    </cc1:AutoCompleteExtender>
                                </div>
                            </div>
                            <div class="form-group">
                                <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">
                                <div class="col-md-2">
                                    <asp:Label ID="lblSanctionType" runat="server" Text="Sanction Type"></asp:Label>
                                </div>
                                <div class="col-md-9">
                                    <div class="col-md-2 Pad-left-7px">
                                        <asp:RadioButton ID="rbtnOverTime" runat="server" Text="Over Time" GroupName="SanctionType"
                                            onclick="return Click_Option(1);" Checked="true" CssClass="radioLeave radioLeave-primary" />
                                    </div>
                                    <div class="col-md-2 Pad-left-7px">
                                        <asp:RadioButton ID="rbtnCompoff" runat="server" Text="Comp Off" GroupName="SanctionType"
                                            onclick="return Click_Option(2);" CssClass="radioLeave radioLeave-primary" />
                                    </div>
                                    <div class="col-md-5 Pad-left-7px">
                                        <asp:RadioButton ID="rbtnOTCompOff" runat="server" Text="OT-CompOff" GroupName="SanctionType"
                                            onclick="return Click_Option(3);" CssClass="radioLeave radioLeave-primary" />
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-md-2">
                                    <asp:Label ID="lblStatus" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddlOTStatus" CssClass="form-control select2 Man-dat" runat="server">
                                        <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:DropDownList>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-2">
                                <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">
                                </asp:TextBox>
                                <asp:CustomValidator ID="cvrFromDate" runat="server" EnableClientScript="False" OnServerValidate="ValidateFromDate"
                                    ErrorMessage="Select valid From Date" Display="None" ValidationGroup="OTSanction"></asp:CustomValidator>
                                <asp:RequiredFieldValidator ID="rfvFromDate" runat="server" ControlToValidate="txtFromDate"
                                    Display="None" EnableClientScript="False" ErrorMessage="Please select FromDate" ValidationGroup="OTSanction"></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">
                                </asp:TextBox>
                                <asp:CustomValidator ID="cvrToDate" runat="server" EnableClientScript="False" OnServerValidate="ValidateToDate"
                                    ErrorMessage="Select valid To Date" Display="None" ValidationGroup="OTSanction"></asp:CustomValidator>
                                <asp:CustomValidator ID="cvrComToDate" runat="server" EnableClientScript="False"
                                    OnServerValidate="CompareDate" ErrorMessage="Select valid date compare with Fromdate"
                                    Display="None" ValidationGroup="OTSanction"></asp:CustomValidator>
                                <asp:RequiredFieldValidator ID="rfvToDate" runat="server" ControlToValidate="txtToDate"
                                    Display="None" EnableClientScript="False" ErrorMessage="Please select ToDate" ValidationGroup="OTSanction"></asp:RequiredFieldValidator>
                            </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">
                                <asp:PlaceHolder ID="PhrOverTimeSanction" runat="server">
                                    <ucl1:TA_uc_OrgLevel_Filter ID="TA_uc_OrgLevel_Filter" runat="server" />
                                </asp:PlaceHolder>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-5">
                    </div>
                    <div class="col-md-6">
                        <div class="pull-right-button">
                            <asp:LinkButton ID="btnView" CssClass="btn view-btn fa-eye" runat="server" OnClientClick="return OpenEmployeeOTSanctionWindow(SelectFromDate,SelectToDate,SelectStatus,ToDate)"
                                data-toggle="modal" data-target="#myModal" ValidationGroup="OTSanction" />
                            <asp:LinkButton Text="&nbsp;&nbsp;Export Excel" ID="lnkbtnExport" CssClass="btn del-btn fa-file-excel-o"
                                runat="server" OnClick="lnkbtnExport_Click" />
                            <asp:ValidationSummary ID="vsyOverTime" ShowMessageBox="false" ShowSummary="true"
                                runat="server" ValidationGroup="OTSanction" />
                        </div>
                    </div>
                    <div class="clearfix">
                    </div>
                    <div class="row">
                        <div class="line16">
                        </div>
                    </div>
                    <div class="col-md-12" id="import4" runat="server">
                        <div class="row form-group">
                            <div class="col-md-12">
                                <div class="callout callout-info" style="margin-bottom: 0!important;">
                                    <asp:Label ID="lblImportNote" runat="server" Text="Important Notes :" ForeColor="White" Font-Size="14px"></asp:Label>
                                </div>
                                <br />
                                <ul>
                                    <li>
                                        <asp:Label ID="lblnotes1" runat="server" Text="Don't remove / modify any field in the downloaded template file while importing. 
                                        Otherwise it wont allow you to import."></asp:Label>
                                    </li>
                                    <li>
                                        <asp:Label ID="lblcon" runat="server" Text="Kindly use <B>dd-MMM-yyyy</B> format for all date fields in excel sheet."></asp:Label>
                                    </li>
                                    <li style="color:red">
                                        Dont Modify actual Overtime field values in excel sheet, update only modify field values.Otherwise it wont allow you to import.
                                    </li>
                                    <li>
                                        <asp:Label ID="lblnotes4" runat="server" Text="Save the file as <B>.csv</B> format before import."></asp:Label>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="row form-group" id="import1" runat="server">
                        <div class="col-md-2">
                            <span style="color: Red">|</span>
                            <asp:Label ID="lbl_ImportFilePath" runat="server" Style="padding-left: 1px" Text="Select File"></asp:Label>
                        </div>
                        <div class="col-md-4">
                            <asp:FileUpload ID="fup_ShiftImport" runat="server" CssClass="form-control" />
                        </div>
                    </div>

                    <div class="row form-group" id="import2" runat="server">
                        <div class="col-md-2">
                        </div>
                        <div class="col-md-4">
                            <div class="pull-right-button">
                                <asp:LinkButton ID="btn_Upload" Text="&nbsp;&nbsp;Upload" CssClass="btn save-btn fa-upload" runat="server" OnClick="btn_Upload_Click" />
                                <asp:LinkButton ID="btnClear" Text="&nbsp;&nbsp;Clear" CssClass="btn save-btn" runat="server" OnClick="btnClear_Click" />
                            </div>
                        </div>
                    </div>
                    <div class="row form-group" id="import3" runat="server">
                        <div class="col-md-12">
                            <dxGridview:ASPxGridView ID="grvImportDetails" EnableCallBacks="false" runat="server"
                                ClientInstanceName="grvImportDetails" AutoGenerateColumns="false" Width="100%">
                                <Columns>
                                    <dxGridview:GridViewDataTextColumn Caption="Record Number" FieldName="RecordID"
                                        VisibleIndex="0">
                                        <DataItemTemplate>
                                            <asp:Label ID="lblRecordNumber" Text='<%# Eval("RecordID") %>' runat="server"></asp:Label>
                                        </DataItemTemplate>
                                        <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                    </dxGridview:GridViewDataTextColumn>
                                    <dxGridview:GridViewDataTextColumn Caption="Error Message" FieldName="Err_Msg" VisibleIndex="1">
                                        <DataItemTemplate>
                                            <asp:Label ID="lblError" Text='<%# Eval("Error_Msg") %>' runat="server"></asp:Label>
                                        </DataItemTemplate>
                                        <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                    </dxGridview:GridViewDataTextColumn>
                                </Columns>
                                <SettingsText EmptyDataRow="No Records Found" />
                                <SettingsPager PageSize="1000">
                                </SettingsPager>
                                <SettingsBehavior SortMode="Value" AllowSort="true" AllowDragDrop="false" />
                                <Styles AlternatingRow-CssClass="table-bg">
                                </Styles>
                            </dxGridview:ASPxGridView>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        function Click_Option(val) {
            if (val == 1) {
                $('#ctl00_BodyContentPH_lnkbtnExport').toggle(true); //hides button
            }
            else if (val > 1) {
                $('#ctl00_BodyContentPH_lnkbtnExport').toggle(false); //hides button
            }
        }
    </script>
</asp:Content>
