<%@ page language="C#" autoeventwireup="true" maintainscrollpositiononpostback="true" inherits="Transactions_PopUp_EmployeeOTCompOffSanction, App_Web_cqjeffom" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" id="htmlEmpOTcomp" runat="server">
<head runat="server">
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
        name="viewport" />

    <link id="stylebootstrap" rel="stylesheet" runat="server" type="text/css" />
    <link id="stylefontawesome" rel="stylesheet" runat="server" type="text/css" />
    <link id="styleAdminLTE" rel="stylesheet" runat="server" type="text/css" />
    <link id="stylecustom" rel="stylesheet" runat="server" type="text/css" />
    <link id="styledatepicker3" rel="stylesheet" runat="server" type="text/css" />
    <link id="styledaterangepicker" rel="stylesheet" runat="server" type="text/css" />
    <link id="stylefonts" rel="stylesheet" type="text/css" />

    <title>TimeCheck</title>

    <script language="javascript" type="text/javascript" src="../js/Popup.js"></script>

    <script language="javascript" type="text/javascript" src="../js/chkbox_delete.js"></script>

    <script src="../plugins/datepicker/jquery-1.11.1.min.js"></script>

    <script src="../plugins/jQuery/jQuery-2.1.4.min.js" type="text/javascript"></script>

    <script src="../plugins/jquery-ui.min.js" type="text/javascript"></script>

    <script language="javascript" src="../js/jquery.autocomplete.js" type="text/javascript"></script>

    <script src="../plugins/datepicker/bootstrap-datepicker.js"></script>

    <script src="../plugins/daterangepicker/moment.js" type="text/javascript"></script>

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

    <script src="../plugins/datepicker/jquery-1.11.1.min.js"></script>

    <script language="javascript" src="../js/jquery.autocomplete.js" type="text/javascript"></script>

    <script src="../plugins/datepicker/bootstrap-datepicker.js"></script>

    <script src="../plugins/input-mask/jquery.inputmask.js"></script>

    <script src="../plugins/input-mask/jquery.inputmask.date.extensions.js"></script>

    <script src="../plugins/input-mask/jquery.inputmask.extensions.js"></script>

    <script>
        function DynamicDatePicker(txtBoxId) {
            $("#" + txtBoxId).datetimepicker({ format: "HH:mm" });
        }
        function DynamicDatePickerForTime(txtBoxId) {
            $("#" + txtBoxId).datetimepicker({ format: "HH:mm" });
        }
    </script>

    <script type="text/javascript">


        var SelectOTCompOff = "Select either OT or Comp Off";

        function SetAlert(OTCompOff) {
            SelectOTCompOff = OTCompOff;
        }

        function CheckOTCompOff(Id) {
            if (Id != null && Id != '') {
                var Ctrl = document.getElementById(Id);
                var chkOT = document.getElementById(Id.replace('chkCompOffSelection', 'chkOTSelection'));
                var chkCompOff = document.getElementById(Id.replace('chkOTSelection', 'chkCompOffSelection'));
                if ((chkOT != null && chkOT != '') && (chkCompOff != null && chkCompOff != '')) {
                    //                    var hdnChecked = document.getElementById(chkOT.id.replace('chkOTSelection', 'hdnChecked'));
                    if ((Id == chkOT.id && chkCompOff.checked) || (Id == chkCompOff.id && chkOT.checked)) {
                        if (chkCompOff.disabled) {
                            chkCompOff.checked = false;
                            return true;
                        }
                        Ctrl.checked = false;
                        alert(SelectOTCompOff);
                        return false;
                    }
                    //                    hdnChecked.value = (!chkCompOff.checked && !chkOT.checked);
                }
            }
        }
    </script>

</head>
<body>
    <form id="aspnetForm" runat="server">
        <div id="dvSanction" runat="server">
            <div class="content">
                <div class="inr-ftr">
                    <div class="row" style="padding-left: 15px; padding-right: 15px">
                        <div class="col-sm-6">
                            <h5>
                                <span>
                                    <asp:Label ID="lblheader" Text="OverTime/CompOff Approval" runat="server"></asp:Label></span></h5>
                        </div>
                        <div class="col-sm-6">
                            <div class="pull-right">
                                <h6>
                                    <span></h6>
                            </div>
                        </div>
                        <div class="clearfix">
                        </div>
                    </div>
                </div>
                <div class="emp-filter">
                    <div class="form-horizontal">
                        <div class="row form-group">
                            <div class="col-md-12">
                                <div class="table-responsive">
                                    <asp:GridView ID="grv_EmployeeOverTimeDetails" Width="100%" runat="server" DataKeyNames="Employee_Code_Id"
                                        AllowPaging="true" AllowSorting="false" AutoGenerateColumns="false" PageSize="10"
                                        CssClass="table das-table1" OnPageIndexChanging="grv_EmployeeOverTimeDetails_PageIndexChanging"
                                        OnSorting="grv_EmployeeOverTimeDetails_Sorting" BorderWidth="1px" OnRowCancelingEdit="grv_EmployeeOverTimeDetails_RowCancelingEdit"
                                        OnRowEditing="grv_EmployeeOverTimeDetails_RowEditing" OnRowUpdating="grv_EmployeeOverTimeDetails_RowUpdating">
                                        <Columns>
                                            <asp:TemplateField HeaderStyle-CssClass="empheader">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkChecked" runat="server" Enabled='<%# !Convert.ToString(Eval("OverTimeStatus")).Contains("Approved") %>'></asp:CheckBox>
                                                </ItemTemplate>
                                                <ItemStyle HorizontalAlign="Center" Width="6%" BorderColor="White" BorderStyle="Solid"
                                                    BorderWidth="1px" />
                                                <HeaderStyle HorizontalAlign="Center" BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Process Record ID" Visible="False" HeaderStyle-CssClass="empheader">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblProc_RecordId" runat="server" Text='<%#Eval("Process_Rec_ID") %>'></asp:Label>
                                                </ItemTemplate>
                                                <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Date" SortExpression="Date" HeaderStyle-CssClass="empheader">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblOTDate" Text='<%#Eval("Date") %>' runat="server"></asp:Label>
                                                </ItemTemplate>
                                                <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Employee Id" SortExpression="Employee_Code_Id" HeaderStyle-CssClass="empheader">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblEmployeeCodeId" runat="server" Text='<%# Eval("Employee_Code_Id") %>'></asp:Label>
                                                </ItemTemplate>
                                                <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Employee Name" SortExpression="Employee_Firstname"
                                                HeaderStyle-CssClass="empheader">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblEmployeeName" runat="server" Text='<%# Eval("Employee_Firstname") %>'></asp:Label>
                                                </ItemTemplate>
                                                <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Level Name" SortExpression="Level Name" HeaderStyle-CssClass="empheader">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblLevelName" runat="server" Text='<%# Eval("Level Name") %>'></asp:Label>
                                                </ItemTemplate>
                                                <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Extra Worked Hrs" SortExpression="ActHrsOT" HeaderStyle-CssClass="empheader">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblHoursOT" runat="server" Text='<%# Eval("ActHrsExtra") %>' ToolTip='<%# Eval("HrsExtraIn") %>'></asp:Label>
                                                </ItemTemplate>
                                                <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Act Extra Hours Worked" SortExpression="HrsExtra"
                                                HeaderStyle-CssClass="empheader">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="txtHoursOT" runat="server" Text='<%# Eval("HrsExtra") %>' CssClass="form-control" placeholder="HH:MM" data-inputmask="'alias':'hh:mm'" data-mask
                                                        Width="50px" MaxLength="5" onDrop="return false;" onpaste="return false;" onkeypress="return number_colon(event,this);"></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblHoursOT1" runat="server" Text='<%# Eval("HrsExtra") %>'></asp:Label>
                                                </ItemTemplate>
                                                <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="OT Selection" ItemStyle-HorizontalAlign="Center" HeaderStyle-CssClass="empheader">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkOTSelection" runat="server" Enabled='<%# Convert.ToBoolean(Eval("OTEligible")) %>'
                                                        Checked='<%# Convert.ToBoolean(Eval("OTChecked")) %>' onClick="javascript:return CheckOTCompOff(this.id);" />
                                                </ItemTemplate>
                                                <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Comp Off Selection" ItemStyle-HorizontalAlign="Center"
                                                HeaderStyle-CssClass="empheader">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkCompOffSelection" runat="server" Enabled='<%# Convert.ToBoolean(Eval("CompOffEligible")) %>'
                                                        Checked='<%# Convert.ToBoolean(Eval("CompOffChecked")) %>' onClick="javascript:return CheckOTCompOff(this.id);" />
                                                </ItemTemplate>
                                                <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Status" SortExpression="OverTimeStatus" HeaderStyle-CssClass="empheader">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblOTStatus" runat="server" Text='<%# Eval("OverTimeStatus") %>'></asp:Label>
                                                </ItemTemplate>
                                                <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Edit" ShowHeader="False" HeaderStyle-CssClass="empheader"
                                                ItemStyle-CssClass="table-icons">
                                                <EditItemTemplate>
                                                    <asp:LinkButton ID="lnkUpdate" runat="server" CausesValidation="True" CommandName="Update"
                                                        Text="Update" OnClientClick="return validate();"></asp:LinkButton>
                                                    <asp:LinkButton ID="lnkCancel" runat="server" CausesValidation="False" CommandName="Cancel"
                                                        Text="Cancel"></asp:LinkButton>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="lnkEdit" runat="server" CausesValidation="false" CommandName="Edit"
                                                        Text="Edit"></asp:LinkButton>
                                                </ItemTemplate>
                                                <HeaderStyle HorizontalAlign="Left" />
                                            </asp:TemplateField>
                                        </Columns>
                                        <HeaderStyle CssClass="td" />
                                        <EmptyDataTemplate>
                                            <asp:Label ID="lblNoRecords" runat="server" OnLoad="GetEmptyText"></asp:Label>
                                        </EmptyDataTemplate>
                                        <RowStyle Height="10px" />
                                        <RowStyle Height="30px" CssClass="table-bg" BorderColor="#C5DFFC" />
                                        <PagerStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" VerticalAlign="Bottom"
                                            Font-Overline="False" HorizontalAlign="Right" CssClass="GridPager" Font-Size="Smaller" />
                                        <PagerSettings Mode="NumericFirstLast" FirstPageText="First" LastPageText="Last"
                                            NextPageText="Next" PreviousPageText="&lt;" />
                                        <AlternatingRowStyle BackColor="white" />
                                    </asp:GridView>
                                </div>
                            </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"
                                        OnClick="btn_Approved_Click" />
                                    <asp:LinkButton ID="btn_Reject" runat="server" CssClass="btn save-btn  fa-thumbs-o-down"
                                        OnClick="btn_Reject_Click" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script>

            $("[data-mask]").inputmask();

    </script>
    </form>

</body>
</html>
