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

<%@ 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 type="text/javascript">
        function ValidateGridControl() {
            var isValid = false;
            var gridView = document.getElementById('<%= grv_EmployeeOTSanction.ClientID %>');
            var isChecked = false;
            for (var i = 1; i < gridView.rows.length; i++) {
                //debugger;
                var inputs = gridView.rows[i].getElementsByTagName("INPUT");
                //alert(i);
                //for (var j = 0; j < inputs.length; j++) {
                //    alert("Type:" + inputs[j].type + " ;ID:" + j);

                //}
                if (inputs != null) {
                    if (inputs[0].type == "checkbox" && inputs[0].checked === true) {
                        isChecked = true;
                        if (inputs[1].type == "text") {
                            if (inputs[1].value != "") {
                                var splittedValue = inputs[1].value.split(":");
                                if (splittedValue.length < 2) {
                                    alert("Enter Valid Time in the following format hh:mm of record " + i);
                                    inputs[1].focus();
                                    gridView.rows[i].style.backgroundColor = "aqua";
                                    return false;
                                }
                                else if (splittedValue[0].length < 2) {
                                    alert("Enter Valid Time in the following format hh:mm of record " + i);
                                    inputs[1].focus();
                                    gridView.rows[i].style.backgroundColor = "aqua";
                                    return false;
                                }
                                else if (splittedValue[1].length < 2) {
                                    alert("Enter Valid Time in the following format hh:mm of record " + i);
                                    inputs[1].focus();
                                    gridView.rows[i].style.backgroundColor = "aqua";
                                    return false;
                                }
                                var HoursToMinutes = splittedValue[0] * 60;
                                HoursToMinutes = parseInt(HoursToMinutes) + parseInt(splittedValue[1]);
                                var label = inputs[1].parentNode.getElementsByTagName("SPAN")[0];
                                var spanValue = label.textContent;
                                var splittedValue1 = spanValue.split(":");
                                var actHoursToMinutes = splittedValue1[0] * 60;
                                actHoursToMinutes = parseInt(actHoursToMinutes) + parseInt(splittedValue1[1]);
                                //alert(HoursToMinutes + " Actual:" + actHoursToMinutes);
                                if (actHoursToMinutes < HoursToMinutes) {
                                    alert("Modified OT Shoud not be greater than Actual OT of record " + i);
                                    inputs[1].focus();
                                    gridView.rows[i].style.backgroundColor = "aqua";

                                    return false;
                                }
                            }
                            else {
                                alert("Enter value in Modified OT field of record " + i);
                                inputs[1].focus();
                                gridView.rows[i].style.backgroundColor = "aqua";
                                return false;
                            }
                        }
                        if (inputs[2].type == "text") {
                            if (inputs[2].value != "") {
                                var splittedValue = inputs[2].value.split(":");
                                if (splittedValue.length < 2) {
                                    alert("Enter Valid Time in the following format hh:mm of record " + i);
                                    inputs[2].focus();
                                    gridView.rows[i].style.backgroundColor = "aqua";
                                    return false;
                                }
                                else if (splittedValue[0].length < 2) {
                                    alert("Enter Valid Time in the following format hh:mm of record " + i);
                                    inputs[2].focus();
                                    gridView.rows[i].style.backgroundColor = "aqua";
                                    return false;
                                }
                                else if (splittedValue[1].length < 2) {
                                    alert("Enter Valid Time in the following format hh:mm of record " + i);
                                    inputs[2].focus();
                                    gridView.rows[i].style.backgroundColor = "aqua";
                                    return false;
                                }
                                var HoursToMinutes = splittedValue[0] * 60;
                                HoursToMinutes = parseInt(HoursToMinutes) + parseInt(splittedValue[1]);
                                var label = inputs[2].parentNode.getElementsByTagName("SPAN")[0];
                                var spanValue = label.textContent;
                                var splittedValue1 = spanValue.split(":");
                                var actHoursToMinutes = splittedValue1[0] * 60;
                                actHoursToMinutes = parseInt(actHoursToMinutes) + parseInt(splittedValue1[1]);
                                //alert(HoursToMinutes + " Actual:" + actHoursToMinutes);
                                if (actHoursToMinutes < HoursToMinutes) {
                                    alert("Modified OT Shoud not be greater than Actual OT of record " + i);
                                    inputs[2].focus();
                                    gridView.rows[i].style.backgroundColor = "aqua";
                                    return false;
                                }
                            }
                            else {
                                alert("Enter value in Modified OT field of record " + i);
                                inputs[2].focus();
                                gridView.rows[i].style.backgroundColor = "aqua";
                                return false;
                            }
                        }
                        if (inputs[3].type == "text") {
                            if (inputs[3].value != "") {
                                var splittedValue = inputs[3].value.split(":");
                                if (splittedValue.length < 2) {
                                    alert("Enter Valid Time in the following format hh:mm of record " + i);
                                    inputs[3].focus();
                                    gridView.rows[i].style.backgroundColor = "aqua";
                                    return false;
                                }
                                else if (splittedValue[0].length < 2) {
                                    alert("Enter Valid Time in the following format hh:mm of record " + i);
                                    inputs[3].focus();
                                    gridView.rows[i].style.backgroundColor = "aqua";
                                    return false;
                                }
                                else if (splittedValue[1].length < 2) {
                                    alert("Enter Valid Time in the following format hh:mm of record " + i);
                                    inputs[3].focus();
                                    gridView.rows[i].style.backgroundColor = "aqua";
                                    return false;
                                }
                                var HoursToMinutes = splittedValue[0] * 60;
                                HoursToMinutes = parseInt(HoursToMinutes) + parseInt(splittedValue[1]);
                                var label = inputs[3].parentNode.getElementsByTagName("SPAN")[0];
                                var spanValue = label.textContent;
                                var splittedValue1 = spanValue.split(":");
                                var actHoursToMinutes = splittedValue1[0] * 60;
                                actHoursToMinutes = parseInt(actHoursToMinutes) + parseInt(splittedValue1[1]);
                                //alert(HoursToMinutes + " Actual:" + actHoursToMinutes);
                                if (actHoursToMinutes < HoursToMinutes) {
                                    alert("Modified OT Shoud not be greater than Actual OT of record " + i);
                                    inputs[3].focus();
                                    gridView.rows[i].style.backgroundColor = "aqua";
                                    return false;
                                }
                            }
                            else {
                                alert("Enter value in Modified OT field of record " + i);
                                inputs[3].focus();
                                gridView.rows[i].style.backgroundColor = "aqua";
                                return false;
                            }
                        }
                        //return true;
                    }
                }
            }
            if (isChecked == false) {
                alert("Please select atleast one record!");
                return false;
            }
            return true;
        }
        function ValidateGridControl1() {
            //Reference the GridView.
            debugger;
            var grid = document.getElementById("<%=grv_EmployeeOTSanction.ClientID %>");

            //Reference all INPUT elements.
            var inputs = grid.getElementsByTagName("INPUT");
            var isChecked = false;
            //Set the Validation Flag to True.
            var isValid = true;
            for (var i = 0; i < inputs.length; i++) {
                //If TextBox.             
                if (inputs[i].type == "checkbox" && inputs[i].checked) {
                    isChecked = true;
                    if (inputs[i].type == "text") {
                        //Reference the Error Label.
                        var label = inputs[i].parentNode.getElementsByTagName("SPAN")[0];

                        var id = inputs[i].id;
                        //If Blank, display Error Label.
                        if (inputs[i].value == "") {
                            alert("Enter valid data");
                            //label.style.display = "block";
                            isValid = false;
                        }
                        else {

                        }
                    }
                }
            }
            if (!isChecked) {
                alert("Please select atleast one record!")
                isValid = false;
            }
            return isValid;
        }
    </script>
    <script>
        function DynamicDatePicker(Format, txtBoxId) {
            $("#" + txtBoxId).datetimepicker({ format: "HH:mm" });
        }
        function DynamicDatePickerForTime(Format, txtBoxId) {
            $("#" + txtBoxId).datetimepicker({ format: "HH:mm" });
        }
        $(function () {
            $('#ctl00_BodyContentPH_txtFromDate').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value }
            );
        });
        $(function () {
            $('#ctl00_BodyContentPH_txtToDate').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value }
            );
        });
        function getFilter() {
            $('#collapseThree').collapse('show');
            var text = document.getElementById('ctl00_BodyContentPH_btn_Show').innerHTML;
            var ss = text.split(" ");
            if (document.getElementById('ctl00_BodyContentPH_trFiller').style.display == "none") {
                document.getElementById('ctl00_BodyContentPH_trFiller').style.display = "";
                document.getElementById('ctl00_BodyContentPH_hdnAdvancedplus').value = 1;
                if (ss.length > 1) {
                    document.getElementById('ctl00_BodyContentPH_btn_Show').innerHTML = "- " + ss[1];
                }
            }
            else {
                document.getElementById('ctl00_BodyContentPH_trFiller').style.display = "none";
                var text = document.getElementById('ctl00_BodyContentPH_btn_Show').innerHTML;
                document.getElementById('ctl00_BodyContentPH_hdnAdvancedplus').value = 0;
                if (ss.length > 1) {
                    document.getElementById('ctl00_BodyContentPH_btn_Show').innerHTML = "+ " + ss[1];
                }
            }
            return false;
        }
    </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;
            }
            //Old one
            //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 + '', '';
            //New One
            document.getElementById('ctl00_BodyContentPH_iframePopup').src = 'PopUp_OTSanction.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">
                    <asp:HiddenField ID="hdnAdvancedplus" runat="server" Value="0" />
                    <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>
        <asp:UpdatePanel ID="upLeave" runat="server">
            <ContentTemplate>
                <asp:Panel ID="pnlProgress" runat="server" Style="display: none;">
                    <asp:Panel ID="pnlLoading" runat="server" HorizontalAlign="center">
                        <div class="InsideProgressBar">
                            <div class="row" style="margin-top: 10px">
                                <img src="../dist/img/logo-Progress.png" />
                            </div>
                            <div class="row" style="min-width: 280px">
                                <img src="../dist/img/default.gif" style="width: 100px" />
                            </div>
                            <div class="row" style="margin-bottom: 10px">
                                <asp:Label ID="lblLoading" runat="server" ForeColor="black" Style="text-align: center"
                                    Text="Please Wait..." Font-Bold="true" Font-Size="12px" Font-Italic="true" Font-Family="Arial"></asp:Label>
                            </div>
                            <div class="clear clearfix">
                            </div>
                        </div>
                    </asp:Panel>
                </asp:Panel>
                <asp:HiddenField ID="hdnProgress" runat="server" />
                <cc1:ModalPopupExtender ID="popupProgress" runat="server" TargetControlID="hdnProgress"
                    BackgroundCssClass="ModalPopup" PopupControlID="pnlProgress" BehaviorID="popupProgress">
                </cc1:ModalPopupExtender>
            </ContentTemplate>
            <Triggers>
                <asp:PostBackTrigger ControlID="btn_Upload" />
                <asp:PostBackTrigger ControlID="btn_Approved" />
                <asp:PostBackTrigger ControlID="btn_Reject" />
                <asp:PostBackTrigger ControlID="btnApprovalAll" />
            </Triggers>
        </asp:UpdatePanel>
        <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="panel-collapse" id="trFiller" runat="server">
                        <div>
                            <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" style="display: none">
                                        <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" runat="server" id="divstatus" style="display: none;">
                                        <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="Pending" Value="Pending" Selected="True"></asp:ListItem>
                                                <asp:ListItem Text="All" Value="All"></asp:ListItem>
                                                <asp:ListItem Text="Approved" Value="Approved"></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>
                    </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-4">
                        <div class="col-md-12">
                            <div class="col-md-6">
                                <asp:RadioButton ID="RadioButton1" runat="server" AutoPostBack="true" Text="Manual" GroupName="SanctionType"
                                    OnCheckedChanged="RadioButton1_CheckedChanged" Checked="true" CssClass="radioLeave radioLeave-primary" />
                            </div>
                            <div class="col-md-6">
                                <asp:RadioButton ID="RadioButton2" runat="server" AutoPostBack="true" Text="Import" GroupName="SanctionType"
                                    OnCheckedChanged="RadioButton1_CheckedChanged" CssClass="radioLeave radioLeave-primary" />
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="pull-right-button">
                            <asp:LinkButton Text="+ Advanced" ID="btn_Show" runat="server" OnClientClick="return getFilter()">
                            </asp:LinkButton>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="pull-right-button">

                            <asp:LinkButton ID="btnView" CssClass="btn view-btn fa-eye" runat="server"
                                OnClick="btnView_Click"
                                ValidationGroup="OTSanction" />
                            <asp:LinkButton Text="&nbsp;&nbsp;Export Excel" ID="lnkbtnExport" CssClass="btn del-btn fa-file-excel-o"
                                OnClientClick="if(validationCompany()) $find('popupProgress').show();else { return false;}" 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" style="display: none">
                        <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="import5" runat="server" style="display: none">
                        <div class="col-md-2">
                            <asp:Label ID="lblCompany" runat="server" Style="padding-left: 1px" Text="Company"></asp:Label>
                        </div>
                        <div class="col-md-4">
                            <asp:DropDownList ID="ddlCompany" runat="server" AppendDataBoundItems="true" CssClass="form-control select2 Man-dat">
                                <asp:ListItem Value="0" Text="-Select-"></asp:ListItem>
                            </asp:DropDownList>
                        </div>
                    </div>
                    <div class="row form-group" id="import1" runat="server" style="display: none">
                        <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" style="display: none">
                        <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" style="display: none">
                        <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 class="row form-group">
                        <div class="col-md-12">
                            <div class="pull-right-button">
                                <asp:LinkButton ID="btn_Approved" runat="server" CssClass="btn save-btn fa-thumbs-o-up"
                                    OnClientClick="if(ValidateGridControl()) $find('popupProgress').show();else return false;"
                                    OnCommand="btn_Approved_Command" CommandName="Single" />
                                <asp:LinkButton ID="btn_Reject" runat="server" CssClass="btn save-btn fa-thumbs-o-down"
                                    OnClientClick="if(ValidateGridControl()) $find('popupProgress').show();else return false;" OnCommand="btn_Approved_Command" CommandName="Rejected" />
                                <asp:LinkButton ID="btnApprovalAll" runat="server" Text="&nbsp;&nbsp;Approve All Levels" CssClass="btn save-btn fa-thumbs-o-up"
                                    OnClientClick="if(ValidateGridControl()) $find('popupProgress').show();else return false;" OnCommand="btn_Approved_Command" CommandName="All" Visible="false" />
                            </div>
                        </div>
                    </div>
                    <div class="row form-group">
                        <div class="col-md-12">
                            <div class="table-responsive" style="height: 400px; width: 100%; overflow-y: auto;">
                                <asp:GridView ID="grv_EmployeeOTSanction" runat="server" DataKeyNames="Employee_Code_Id" Width="100%"
                                    AutoGenerateColumns="false" OnRowDataBound="grv_EmployeeOTSanction_RowDataBound"
                                    CssClass="table das-table1">
                                    <Columns>
                                        <%--1.Checkbox--%>
                                        <asp:TemplateField HeaderStyle-CssClass="empheader" ItemStyle-CssClass="table-icons">
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="checkall" runat="server" AutoPostBack="true" OnCheckedChanged="grv_CheckAll_CheckedChanged" />
                                                <asp:Label ID="lblall" runat="server"></asp:Label>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="deletethis" runat="server" AutoPostBack="true" Checked='<%# (Eval("SelectedRecords").ToString() == "1" ? true : false) %>'
                                                    OnCheckedChanged="grv_Check_CheckedChanged"></asp:CheckBox>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" Width="6%" />
                                        </asp:TemplateField>
                                        <%--2.RecordID--%>
                                        <asp:TemplateField HeaderText="Process Record ID" Visible="False" HeaderStyle-CssClass="empheader"
                                            ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:Label ID="lblProc_RecordId" runat="server" Text='<%#Eval("Process_Rec_ID") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--3.Employeee ID--%>
                                        <asp:TemplateField HeaderText="Employee Id" SortExpression="Employee_Code_Id" HeaderStyle-CssClass="empheader"
                                            ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:Label Width="60px" ID="lblEmployeeCodeId" runat="server" Text='<%# Eval("Employee_Code_Id") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--4.Employee Name--%>
                                        <asp:TemplateField HeaderText="Employee Name" SortExpression="Employee_Firstname"
                                            HeaderStyle-CssClass="empheader" ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:Label Width="100px" ID="lblEmployeeName" runat="server" Text='<%# Eval("Employee_Firstname") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--5.Level Name--%>
                                        <asp:TemplateField HeaderText="Level Name" SortExpression="Level Name" HeaderStyle-CssClass="empheader"
                                            ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:Label Width="100px" ID="lblLevelName" runat="server" Text='<%# Eval("Level Name") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--6.Date--%>
                                        <asp:TemplateField HeaderText="Date" SortExpression="Shiftdate" HeaderStyle-CssClass="empheader"
                                            ItemStyle-CssClass="table-icons" ItemStyle-Width="100px">
                                            <ItemTemplate>
                                                <asp:Label Width="80px" ID="lblOTDate" Text='<%#Eval("Shiftdate") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--7.Day Type--%>
                                        <asp:TemplateField HeaderText="Day Type" SortExpression="Day Type" HeaderStyle-CssClass="empheader"
                                            ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:Label Width="60px" ID="lblDayType" Text='<%#Eval("Day Type") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--8.Actual OT--%>
                                        <asp:TemplateField HeaderText="Actual OT" SortExpression="Actual OT" HeaderStyle-CssClass="empheader"
                                            ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:Label Width="40px" ID="lblHoursOT" runat="server" Text='<%# Eval("Actual OT") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--9.Modified OT--%>
                                        <asp:TemplateField HeaderText="Modified OT" SortExpression="Modified OT"
                                            HeaderStyle-CssClass="empheader" ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtHoursOT" runat="server" Text='<%# Eval("Modified OT") %>' CssClass="form-control"
                                                    Style="width: 60px !important" MaxLength="5" onDrop="return false;" onpaste="return false;" onkeypress="return number_colon(event,this);"></asp:TextBox>
                                                <asp:Label Width="40px" ID="lblActual1" runat="server" Text='<%# Eval("Actual OT") %>' Style="display: none"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--10.Actual Special OT--%>
                                        <asp:TemplateField HeaderText="Actual Special OT1" SortExpression="Actual Special OT1" HeaderStyle-CssClass="empheader"
                                            ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:Label ID="lblSPEC_NormOT1" runat="server" Text='<%# Eval("Actual Special OT1") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--11.Modified Special OT--%>
                                        <asp:TemplateField HeaderText="Modified Special OT1" SortExpression="Modified Special OT1"
                                            HeaderStyle-CssClass="empheader" ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtModified_Spec_NormOTHrs1" runat="server" Text='<%# Eval("Modified Special OT1") %>' CssClass="form-control"
                                                    Style="width: 60px !important" MaxLength="5" onDrop="return false;" onpaste="return false;" onkeypress="return number_colon(event,this);"></asp:TextBox>
                                                <asp:Label ID="lblSPEC_NormOT1Actual" runat="server" Text='<%# Eval("Actual Special OT1") %>' Style="display: none"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--12.Actual Specila OT2--%>
                                        <asp:TemplateField HeaderText="Actual Special OT2" SortExpression="Actual Special OT2" HeaderStyle-CssClass="empheader"
                                            ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:Label Width="40px" ID="lblSPEC_NormOT2" runat="server" Text='<%# Eval("Actual Special OT2") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--13.Modified Specila OT2--%>
                                        <asp:TemplateField HeaderText="Modified Special OT2" SortExpression="Modified Special OT2"
                                            HeaderStyle-CssClass="empheader" ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtModified_Spec_NormOTHrs2" runat="server" Text='<%# Eval("Modified Special OT2") %>' CssClass="form-control"
                                                    Style="width: 60px !important" MaxLength="5" onDrop="return false;" onpaste="return false;" onkeypress="return number_colon(event,this);"></asp:TextBox>
                                                <asp:Label Width="40px" ID="lblSPEC_NormOT2Actual" runat="server" Text='<%# Eval("Actual Special OT2") %>' Style="display: none"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--14.Shift Allowance--%>
                                        <%--Allowances field start--%>
                                        <asp:TemplateField HeaderText="Actual Shift Allowances" SortExpression="Shift_Allow" HeaderStyle-CssClass="empheader"
                                            ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:Label ID="lblShift_Allow" runat="server" Text='<%# Eval("Shift_Allow") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--15.Modified Shift Allowance--%>
                                        <asp:TemplateField HeaderText="Modified Shift Allowances" SortExpression="Modified_Shift_Allow"
                                            HeaderStyle-CssClass="empheader" ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtModified_Shift_Allow" runat="server" Text='<%# Eval("Modified_Shift_Allow") %>' CssClass="form-control"
                                                    Width="60px" MaxLength="5" onDrop="return false;" onpaste="return false;" onkeypress="return number_dot_Without_Dollar(event,this);"
                                                    onchange="return onChangeHalfDay(event,this);"></asp:TextBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--16.Actual Food Allowance--%>
                                        <asp:TemplateField HeaderText="Actual Food Allowances" SortExpression="Food_Allow" HeaderStyle-CssClass="empheader"
                                            ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:Label ID="lblFood_Allow" runat="server" Text='<%# Eval("Food_Allow") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--17.Modified Food Allowance--%>
                                        <asp:TemplateField HeaderText="Modified Food Allowances" SortExpression="Modified_Food_Allow"
                                            HeaderStyle-CssClass="empheader" ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtModified_Food_Allow" runat="server" Text='<%# Eval("Modified_Food_Allow") %>' CssClass="form-control"
                                                    Width="60px" MaxLength="5" onDrop="return false;" onpaste="return false;" onkeypress="return number_dot_Without_Dollar(event,this);"
                                                    onchange="return onChangeHalfDay(event,this);"></asp:TextBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--18.Actual Meal Allowance--%>
                                        <asp:TemplateField HeaderText="Actual Meal Allowances" SortExpression="Meal_Allow" HeaderStyle-CssClass="empheader"
                                            ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:Label ID="lblMeal_Allow" runat="server" Text='<%# Eval("Meal_Allow") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--19.Modified Meal Allowance--%>
                                        <asp:TemplateField HeaderText="Modified Meal Allowances" SortExpression="Modified_Meal_Allow"
                                            HeaderStyle-CssClass="empheader" ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtModified_Meal_Allow" runat="server" Text='<%# Eval("Modified_Meal_Allow") %>' CssClass="form-control"
                                                    MaxLength="5" onDrop="return false;" onpaste="return false;" onkeypress="return number_dot_Without_Dollar(event,this);"
                                                    onchange="return onChangeHalfDay(event,this);"></asp:TextBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--20.Actual SH Allowances--%>
                                        <asp:TemplateField HeaderText="Actual SH Allowances" SortExpression="SH_Allow" HeaderStyle-CssClass="empheader"
                                            ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:Label ID="lblSH_Allow" runat="server" Text='<%# Eval("SH_Allow") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--21.Modified SH Allowance--%>
                                        <asp:TemplateField HeaderText="Modified SH Allowances" SortExpression="Modified_SH_Allow"
                                            HeaderStyle-CssClass="empheader" ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtModified_SH_Allow" runat="server" Text='<%# Eval("Modified_SH_Allow") %>' CssClass="form-control"
                                                    MaxLength="5" onDrop="return false;" onpaste="return false;" onkeypress="return number_dot_Without_Dollar(event,this);"
                                                    onchange="return onChangeHalfDay(event,this);"></asp:TextBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--allowance field end--%>
                                        <%--22.Status--%>
                                        <asp:TemplateField HeaderText="Status" SortExpression="OverTimeStatus" HeaderStyle-CssClass="empheader"
                                            ItemStyle-CssClass="table-icons" ControlStyle-Width="50px">
                                            <ItemTemplate>
                                                <asp:Label ID="lblOTStatus" runat="server" Text='<%# Eval("OverTimeStatus") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Actioned By" HeaderStyle-CssClass="empheader"
                                            ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:Label ID="lblApproverName" runat="server" Text='<%# Eval("LastProcessedBy") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--23.Overtime Mins--%>
                                        <asp:TemplateField HeaderText="Status" Visible="False" HeaderStyle-CssClass="empheader"
                                            ItemStyle-CssClass="table-icons">
                                            <ItemTemplate>
                                                <asp:Label ID="lblOTMins" runat="server" Text='<%# Eval("OTMins") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <EmptyDataTemplate>
                                        <asp:Label ID="lblNoRecords" runat="server" OnLoad="GetEmptyText"></asp:Label>
                                    </EmptyDataTemplate>
                                    <RowStyle Height="30px" CssClass="table-bg" BorderColor="#C5DFFC" />
                                    <PagerStyle Font-Overline="False" HorizontalAlign="Right" CssClass="GridPager" />
                                    <PagerSettings FirstPageText="<<" LastPageText=">>" Mode="NumericFirstLast" NextPageText=">"
                                        PreviousPageText="<" />
                                    <AlternatingRowStyle BackColor="white" />
                                </asp:GridView>
                            </div>
                        </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
            }
        }
        function Validation() {
            var index = document.aspnetForm.ctl00_BodyContentPH_ddlCompany.selectedIndex;
            var company = document.aspnetForm.ctl00_BodyContentPH_ddlCompany.options[index].value;
            if (company == "0") {
                alert("Select Company for import Overtime");
                return false;
            }
        }
    </script>
</asp:Content>

