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

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="Server">
    <!--[if gt IE 5.5]>
	<link rel="stylesheet" type="text/css" href="../css/ProgressforIE.css" />
 <![endif]-->

    <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>
        $(function () {
            $('#ctl00_BodyContentPH_txt_WeekdayWorkHrs').datetimepicker({ format: 'HH:mm' }
            );
        });

    </script>

    <div class="content-header">
        <h1 style="background-image: url('../dist/img/category.png'); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lbl_Header" runat="server"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">
        <div class="inr-ftr">
            <div class="row">
                <div class="col-sm-12">
                    <div class="pull-right">
                        <h6>
                            <span><span style="color: Red">|</span><span style="padding-left: 10px; padding-right: 10px"><asp:Label
                                ID="lbl_IndicatesMandatoryFields" runat="server"></asp:Label>
                                (3 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>
        </asp:UpdatePanel>
        <div class="emp-filter">
            <div class="form-horizontal">
                <div class="row">
                    <div class="col-md-12">
                        <div class="row form-group">
                            <div class="col-md-4">
                                <asp:Label ID="lbl_Category" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtCategory" runat="server" CssClass="form-control man-dat"
                                    MaxLength="50" onkeyup="return chkMaxLen(event,this,50,MaxLength);"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtCategory"
                                    ErrorMessage="Enter Category" SetFocusOnError="True" Display="None" ValidationGroup="CategoryAdd">*</asp:RequiredFieldValidator>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-4">
                                <asp:Label ID="lbl_MonToSatWorkHrs" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_MonToSatWorkHrs" runat="server" CssClass="form-control man-dat"
                                    AutoPostBack="false" MaxLength="4" onkeypress="return fun_AllowOnlyAmountAndDot(event,this.id);"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txt_MonToSatWorkHrs"
                                        ErrorMessage="Enter Minimum Mandatory Cumulative Work Hrs Per Week" SetFocusOnError="True"
                                        Display="None" ValidationGroup="CategoryAdd">*</asp:RequiredFieldValidator>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-4">
                                <asp:Label ID="lbl_WeekdayWorkHrs" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_WeekdayWorkHrs" runat="server" CssClass="form-control man-dat"
                                    MaxLength="5" onDrop="return false;" onpaste="return false;" onkeypress="return number_colon(event,this);"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txt_WeekdayWorkHrs"
                                    ErrorMessage="Enter Daily Minimum Working Hrs" Display="None" ValidationGroup="CategoryAdd">*</asp:RequiredFieldValidator>
                            </div>
                        </div>
                        <div class="row" style="display: none">
                            <div class="col-md-12">
                                <asp:Label ID="lblFlexibleTimings" runat="server"></asp:Label><font color="#FF0000">*
                                </font>
                            </div>
                            <div class="col-md-12">
                                <asp:RadioButton ID="rbtnFlexibleYes" runat="server" GroupName="Flexible" />
                                <asp:RadioButton ID="rbtnFlexibleNo" runat="server" GroupName="Flexible" Checked="true" />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-4">
                            </div>
                            <div class="col-md-3">
                                <div class="pull-right-button">
                                    <asp:LinkButton ID="btn_save" runat="server" CssClass="btn save-btn fa-floppy-o"
                                        OnClick="btn_save_Click" Text="Save" ValidationGroup="CategoryAdd" />
                                    <asp:LinkButton ID="btn_Cancel" runat="server" CausesValidation="false" CssClass="btn save-btn fa-angle-left"
                                        OnClick="btn_Cancel_Click" />
                                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="true"
                                        ValidationGroup="CategoryAdd" ShowSummary="false" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <script type="text/javascript">
            var MaxLength = "Maximum length is ";
            function MaxLengthh(maxLength) {
                MaxLength = maxLength;
            }
            function AcceptDecimal(e, ctrl) {
                var keycode;
                if (window.event) keycode = window.event.keyCode;
                else if (e) keycode = e.which;
                else return true;

                if (keycode >= 0 && keycode <= 254) {
                    if ((keycode >= 48 && keycode <= 57) || (keycode == 46) || (keycode == 0 || keycode == 8))
                        return true;
                }
                else
                    return true;

                return false;
            }

            function CheckValidation() {
                var MonToSatWorkHrs = document.getElementById('<%= txt_MonToSatWorkHrs.ClientID %>').value.replace('0.0', '0');
           var WeekdayWorkHrs = document.getElementById('<%= txt_WeekdayWorkHrs.ClientID %>').value.replace('0.0', '0');

           if (MonToSatWorkHrs == '0' || (MonToSatWorkHrs * 1) >= 100) {
               alert(MonToSatWorkHrs == '0' ? "Work hrs can't be zero" : "Work hrs not greater than or eaqual to 100");
               document.getElementById('<%= txt_MonToSatWorkHrs.ClientID %>').focus();
                return false;
            }

            if (WeekdayWorkHrs == '0' || (WeekdayWorkHrs * 1) >= 100) {
                alert(WeekdayWorkHrs == '0' ? "Work hrs can't be zero" : "Work hrs not greater than or eaqual to 100");
                document.getElementById('<%= txt_WeekdayWorkHrs.ClientID %>').focus();
                return false;
            }

            if (Page_ClientValidate())
                return confirm('Are you sure, to Save?');
            return false;
        }
        //          function DynamicTimePicker(txtBoxId)
        //        {
        //         try
        //           {
        //               var rangeDemoFormat ="HH:mm";
        //               var rangeDemoConv = new AnyTime.Converter({format:rangeDemoFormat});
        //               $("#" + txtBoxId).AnyTime_picker({format:rangeDemoFormat});
        //           }
        //           catch(err)
        //           {
        //           
        //           }
        //        }
        function cleartext() {
            document.getElementById("ctl00_BodyContentPH_txt_WeekdayWorkHrs").value = "";
            return false;
        }
        </script>

    </div>
</asp:Content>
