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

<%@ 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]-->
    <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 style="color: Red">|</span><span style="padding-left: 10px; padding-right: 10px"><asp:Label
                                ID="lbl_IndicatesMandatoryFields" runat="server"></asp:Label>
                            </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 Mon To Sat"
                                        SetFocusOnError="True" Display="None" ValidationGroup="CategoryAdd">*</asp:RequiredFieldValidator>
                            </div>
                        </div>
                        <div class="row form-group" id="divSatWorkHrs" runat="server">
                            <div class="col-md-4">
                                <asp:Label ID="lbl_SatWorkHrs" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_SatWorkHrs" runat="server" CssClass="form-control man-dat" MaxLength="4"
                                    AutoPostBack="false" onkeypress="return AcceptDecimal(event,this);"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txt_SatWorkHrs"
                                    Display="None" ValidationGroup="CategoryAdd" ErrorMessage="Every Saturday Minimum Working Hrs"
                                    SetFocusOnError="True">*</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 fun_AllowOnlyAmountAndDot(event,this.id);"></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 form-group" id="divArmisHrs" runat="server">
                            <div class="col-md-4">
                                <asp:Label ID="lblArmisHrs" runat="server" Text="ARMIS Minimum Work Hrs"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_ArmisHrs" runat="server" CssClass="form-control man-dat" AutoPostBack="false"
                                    MaxLength="4" onkeypress="return AcceptDecimal(event,this);"></asp:TextBox><asp:RequiredFieldValidator
                                        ID="RequiredFieldValidator5" runat="server" ControlToValidate="txt_ArmisHrs"
                                        Display="None" ErrorMessage="Enter ARMIS Minimum Work Hrs" SetFocusOnError="True">*</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" align="right">
                            </div>
                            <div class="col-md-3" align="right">
                                <asp:LinkButton ID="btn_save" runat="server" CssClass="btn save-btn fa-floppy-o"
                                    OnClientClick="if(Page_ClientValidate()) return CheckValidation();return false;"
                                    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" EnableClientScript="true" ShowMessageBox="true"
                                    ShowSummary="false" runat="server" ValidationGroup="CategoryAdd" />
                            </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');
             var SatWorkHrs = document.getElementById('<%= txt_SatWorkHrs.ClientID %>').value.replace('0.0','0');
            var ArmisHrs = document.getElementById('<%= txt_ArmisHrs.ClientID %>').value.replace('0.0','0');
            if(MonToSatWorkHrs == '0' || (MonToSatWorkHrs * 1) >= 100 )
            {
                alert(MonToSatWorkHrs == '0' ? "Minimum Mandatory Cumulative Work Hrs Per Week can't be zero":"Minimum Mandatory Cumulative Work Hrs Per Week Mon To Sat is not greater than or eaqual to 100");
                document.getElementById('<%= txt_MonToSatWorkHrs.ClientID %>').focus();
                return false;
            }
           if((SatWorkHrs * 1) >= 100 )
            {
                alert("Every Saturday Minimum Working Hrs is not greater than or eaqual to 100");
                document.getElementById('<%= txt_SatWorkHrs.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(ArmisHrs == '0' || (ArmisHrs * 1) >= 100 )
            {
                alert(ArmisHrs == '0' ? "ARMIS Minimum Work Hrs can't be zero":"ARMIS Minimum Work Hrs not greater than or eaqual to 100");
                document.getElementById('<%= txt_ArmisHrs.ClientID %>').focus();
                return false;
            }
            return confirm('Are you sure, to Save?');  
        }
        function cleartext()
        {
            document.getElementById("ctl00_BodyContentPH_txt_WeekdayWorkHrs").value="";
            return false;
        }
        </script>

    </div>
</asp:Content>
