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

<%@ Register Src="~/UserControls/TA_uc_OrgLevelFilter_Updated.ascx" TagName="TA_uc_OrgLevel_Filter"
    TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="Server">

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

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

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

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

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

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

    <%--<script language="javascript" src="../js/anytime.js" type="text/javascript"></script>--%>

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



    <script>
        $(function () {
            $('#ctl00_BodyContentPH_txtFromDate').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_hdnDateFormat').value }
            );
        });

        function navi(loc) {
            document.getElementById('ctl00_BodyContentPH_iframePopup').src = loc;
            return false;
        }
    </script>


    <script type="text/javascript">

        var EntertheEmployeeID = "Enter the Employee ID";
        var SelectDutyDate = "Select Duty Date";
        var WorkedHoursShouldnotbeempty = "Worked Hours Should not be empty";
        var WorkedHoursShouldnotbe0hrs = "Worked Hours Should not be 00:00 hrs";
        var EnterReason = "Enter Reason";
        var ConfirmSave = "Are you sure to, Save?";

        function SetAlertMessages(entertheEmployeeID, selectDutyDate, workedHoursShouldnotbeempty, workedHoursShouldnotbe0hrs, enterReason, confirmSave) {
            EntertheEmployeeID = entertheEmployeeID;
            SelectDutyDate = selectDutyDate;
            WorkedHoursShouldnotbeempty = workedHoursShouldnotbeempty;
            WorkedHoursShouldnotbe0hrs = workedHoursShouldnotbe0hrs;
            EnterReason = enterReason;
            ConfirmSave = confirmSave;
        }
        var MaxLength = "Maximum length is ";
        function MaxLengthh(maxLength) {
            MaxLength = maxLength;
        }
        function validate() {
            var Id = document.getElementById('ctl00_BodyContentPH_txt_EmployeeId');
            var Fromdate = document.getElementById('ctl00_BodyContentPH_txtFromDate');
            var Reason = document.getElementById('ctl00_BodyContentPH_txtReason');
            var DateFormat = document.getElementById('ctl00_BodyContentPH_hdnDateFormat').value;
            var workHrs = document.getElementById('ctl00_BodyContentPH_lbl_TotalWorkedHrs').value;
            var isValidDate = "N";
            var sessionValue = "<%=Session["UserGroupName"] %>";
            var sessionIndividual = "<%=Session["intIndividualUser"]%>";
            if (sessionValue != "IndividualUsers" || sessionIndividual != 1) {
                if (Id != null) {
                    if (Id.value == "") {
                        alert(EntertheEmployeeID);
                        document.getElementById('ctl00_BodyContentPH_txt_EmployeeId').focus();
                        return false;
                    }
                }
            }
            if (Fromdate.value.length == 0) {
                alert(SelectDutyDate);
                document.getElementById('ctl00_BodyContentPH_txtFromDate').focus();
                return false;
            }
            if (checkDate(Fromdate, DateFormat)) {
                isValidDate = "Y";
            }
            if (workHrs == '') {
                alert(WorkedHoursShouldnotbeempty);
                return false;
            }
            if (workHrs == '00:00') {
                alert(WorkedHoursShouldnotbe0hrs);
                return false;
            }
            if (Reason.value.trim() == "") {
                alert(EnterReason);
                document.getElementById('ctl00_BodyContentPH_txtReason').focus();
                return false;
            }
            if (isValidDate == "Y") {
                return confirm(ConfirmSave);
            }
            else {
                document.aspnetForm.ctl00_BodyContentPH_txtFromDate.focus();
                return false;
            }

        }

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

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

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

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

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

    <script type="text/javascript" src="../js/EmployeeNameAjax.js"></script>
    <div class="content-header">
        <asp:HiddenField ID="hdfStartTime" runat="server" />
        <asp:HiddenField ID="hdfStartEnd" runat="server" />
        <h1 style="background-image: url('../dist/img/onduty-icons.png'); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lblHeaderLeaveApplication" runat="server" Text="C/Off Credit Application">
            </asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
        <input id="hdnEmployeeId" type="hidden" runat="server" />
        <input id="hdnTxtLeaveTypeId" runat="server" type="hidden" />
        <input id="hdnNumberofDaysApplied" runat="server" type="hidden" />
        <asp:HiddenField ID="hdnDayCompStatus" runat="server" />
        <asp:HiddenField ID="hdnLeavePolicyStatus" runat="server" />
    </div>
    <div class="content">

        <div class="inr-ftr">
            <div class="row">
                <div class="col-sm-2">
                </div>
                <div class="col-sm-2 col-sm-offset-8">
                    <div class="pull-right">
                        <h6>
                            <span style="color: Red">|</span><span style="padding-left: 10px; padding-right: 10px"><asp:Label ID="lblIndicatesMandatoryFields" runat="server" Text="Mandatory">
                            </asp:Label>
                                (<asp:Label ID="lblManCount" runat="server" Text="2"></asp:Label>
                                No.)</span>
                            <asp:HiddenField ID="hdnDateFormat" runat="server" />
                            <asp:HiddenField ID="hdnEmployeeName" runat="server" />
                            <asp:Label ID="lblError" runat="server" Style="color: #ff0000" Visible="false">
                            </asp:Label>
                        </h6>
                    </div>
                </div>
                <div class="clearfix">
                </div>
            </div>
        </div>
        <div id="myModal" class="modal modal-default fade" role="dialog">
            <div class="modal-dialog" style="min-width: 85%;">
                <!-- Modal content-->
                <div class="modal-content" style="margin-top: 100px">
                    <div class="modal-header">
                        <button type="button" id="closemodal" class="close" data-dismiss="modal" style="border-radius: 50px;">
                            &times;</button>
                        <h4 class="modal-title" style="padding-bottom: 10px">
                            <asp:Label ID="lblSelectEmployee" runat="server" Text="Select Employee(s)"></asp:Label>
                        </h4>
                    </div>
                    <div class="modal-body">
                        <iframe id="iframePopup" runat="server" scrolling="auto" width="100%" height="500px"
                            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="row">
                <div class="form-horizontal">
                    <div class="col-md-12 form-group">
                        <div class="col-md-12">
                            <div class="row form-group" id="divAdmin" runat="server">
                                <div class="col-md-2">
                                    <asp:Label ID="lblEmployeeIDLabel" Text="Employee ID" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <div class="input-group input-group-sm">
                                        <asp:TextBox ID="txt_EmployeeId" runat="server" CssClass="form-control mandatory"
                                            MaxLength="15" OnTextChanged="txt_EmployeeId_TextChanged" AutoPostBack="true"
                                            onblur="EmpName('CompOff');"
                                            onkeypress="return acceptCharsNum_MaxLength(event,this,15,MaxLength);"></asp:TextBox>
                                        <span class="input-group-btn">
                                            <asp:LinkButton ID="btn_Search" data-toggle="modal" data-target="#myModal" CssClass="btn src-btn fa-search"
                                                runat="server" OnClientClick="return OpenWindowShiftExchange('txt_EmployeeId','CompOff');" />
                                        </span>
                                    </div>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-2">
                                    <asp:Label ID="lblEmployeeNameLabel" Text="Employee Name" runat="server"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onCut="return false" onDrop="return false" onpaste="javascript:return OnpasteText(event, this);"
                                        ID="txt_Name" runat="server" CssClass="form-control" ReadOnly="True"></asp:TextBox>
                                </div>
                            </div>
                            <div class="row form-group" id="divEmployees" runat="server">
                                <div class="col-md-2">
                                    <asp:Label ID="lblEmployeeIDLabel1" runat="server" Text="Employee ID"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:Label ID="lblEmployeeIdData" runat="server" CssClass="form-control"></asp:Label>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-2">
                                    <asp:Label ID="lblEmployeeNameLabel1" runat="server" Text="Employee Name"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:Label ID="lblEmployeeNameData" runat="server" CssClass="form-control"></asp:Label>
                                </div>
                            </div>
                            <div class="row form-group">
                                <div class="col-md-2">
                                    <asp:Label ID="lblLeaveApplicationDate" runat="server" Text="Application Date"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:Label ID="lblLeaveApplicationDateData" runat="server" CssClass="form-control"></asp:Label>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-2">
                                    <asp:Label ID="lblFromDate" runat="server" Text="Duty Date"></asp:Label>
                                </div>







                                <div class="col-md-3">
                                    <asp:TextBox onCut="return false" onDrop="return false" onpaste="javascript:return OnpasteText(event, this);"
                                        ID="txtFromDate" runat="server" CssClass="form-control mandatory" EnableViewState="False"
                                        onblur="EmpNameForCompensationEntry('date',document.getElementById('ctl00_BodyContentPH_hdnDateFormat').value);"
                                        MaxLength="11"></asp:TextBox>
                                   <%-- <asp:CustomValidator ID="CustomValidator1" runat="server" Display="none" EnableClientScript="False"
                                        ErrorMessage="Select Valid Fromdate" OnServerValidate="CompareCurrentdate">
                                    </asp:CustomValidator>--%>
                                </div>
                            </div>








                            <div style="display: none;">
                                <div>
                                    <asp:Label ID="lblToDate" runat="server" Text="Type"></asp:Label><asp:Label
                                        ID="Label4" runat="server" ForeColor="Red" Text="*"></asp:Label>
                                </div>
                                <div>
                                    <asp:Label ID="lblType" runat="server" Text="Full Day"></asp:Label>
                                </div>
                            </div>
                            <div class="row form-group">
                                <div class="col-md-2">
                                    <asp:Label ID="lbl_InTime" runat="server" Text="In Time"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onCut="return false" onDrop="return false" onpaste="javascript:return OnpasteText(event, this);"
                                        ID="lbl_InPunchTime" runat="server" CssClass="form-control" ReadOnly="true"></asp:TextBox>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-2">
                                    <asp:Label ID="lbl_outTime" runat="server" Text="Out Time"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onCut="return false" onDrop="return false" onpaste="javascript:return OnpasteText(event, this);"
                                        ID="lbl_outPunchTime" runat="server" CssClass="form-control" ReadOnly="true"></asp:TextBox>
                                    <asp:HiddenField ID="hdfInPunchTime" runat="server" />
                                    <asp:HiddenField ID="hdfDayWorked" runat="server" />
                                    <asp:HiddenField ID="hdfoutPunchTime" runat="server" />
                                    <asp:HiddenField ID="hdfTotalWorkedHrs" runat="server" />

                                    <asp:HiddenField ID="hdfProcess_Rec_ID" runat="server" />
                                    <asp:HiddenField ID="hdfEmployee_Id" runat="server" />
                                    <asp:HiddenField ID="hdfLevelName" runat="server" />
                                    <asp:HiddenField ID="hdfOverTimeStatus" runat="server" />
                                    <asp:HiddenField ID="hdfTopLevelID" runat="server" />
                                    <asp:HiddenField ID="hdfExtraMins" runat="server" />
                                </div>
                            </div>

                            <div class="row form-group">
                                <div class="col-md-2">
                                    <asp:Label ID="lbl_DayWorked" runat="server" Text="Day Worked"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onCut="return false" onDrop="return false" onpaste="javascript:return OnpasteText(event, this);"
                                        ID="Txt_OTType" runat="server" CssClass="form-control" ReadOnly="true"></asp:TextBox>
                                </div>
                                <div class="col-md-1">
                                </div>
                                <div class="col-md-2">
                                    <asp:Label ID="lbl_WorkedHrs" runat="server" Text="Worked Hours"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onCut="return false" onDrop="return false" onpaste="javascript:return OnpasteText(event, this);"
                                        ID="lbl_TotalWorkedHrs" runat="server" CssClass="form-control" ReadOnly="true"></asp:TextBox>
                                </div>
                            </div>
                            <div class="row form-group">
                                <div class="col-md-2">
                                    <asp:Label ID="lblReason" runat="server" Text="Reason"></asp:Label>
                                </div>
                                <div class="col-md-3">
                                    <asp:TextBox onCut="return false" onDrop="return false" onpaste="javascript:return OnpasteMultiText(event, this,250);"
                                        ID="txtReason" runat="server" Style="resize: none"
                                        Height="50px" MaxLength="250" onkeypress="return chkMaxLen(event,this,250,MaxLength);" CssClass="form-control mandatory"
                                        TextMode="MultiLine">
                                    </asp:TextBox>
                                </div>
                            </div>
                            <div class="row form-group">
                                <div class="col-md-5">
                                </div>
                                <div class="col-md-6">
                                    <div class="pull-right-button">
                                        <asp:LinkButton ID="btnAdd" CssClass="btn save-btn fa-floppy-o" runat="server" OnClientClick="return validate();"
                                            Text="SAVE" OnClick="btnAdd_Click" />
                                        <asp:LinkButton ID="btnCancel" CssClass="btn save-btn fa-angle-left" runat="server" CausesValidation="False"
                                            Text="BACK" OnClick="btnCancel_Click" />
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="../js/EmployeeNameAjax.js"></script>
    
</asp:Content>
