<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true"
    CodeBehind="GL_Periods.aspx.cs" Inherits="HRMS.GL.Accounting_Calender.GL_Periods" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ScriptManager ID="scriptManager" runat="server">
    </asp:ScriptManager>

     <asp:UpdatePanel runat="server" ID="upMain" UpdateMode="Conditional" ChildrenAsTriggers="true">
        <ContentTemplate>


<script type="text/javascript">
    function clearTextBox() {
        var elements = document.getElementsByTagName("input");
        for (var ii = 0; ii < elements.length; ii++) {
            if (elements[ii].type == "text") {
                elements[ii].value = "";
            }
        }
        document.getElementById('<%=hid_period.ClientID %>').value = "";

    }
</script>

    <div class="main-panel">
        <div class="row">
            <div class="col-md-12">
                <section class="panel">
                     <header class="panel-heading" style="padding-bottom:30px">
                           <span class="label label-primary">Accounting Calender</span>
                        
                            <div class="pull-right">
                                <asp:Button ID="btn_save" CssClass="btn btn-info" Text="Save" runat="server" 
                                    onclick="btn_save_Click"/>
                                <asp:button ID="btn_cancel" text="Back" CssClass="btn btn-info"  ValidationGroup="save"
                                    runat="server" onclick="btn_cancel_Click" />

                                     <input type="button" value="Clear" class="btn btn-info" onclick="clearTextBox()" />
                            </div>
                    </header>
                        <div class="panel-body">
                            <div class="span6">
                                <div id="divmessage" runat="server" visible="false" class="alert alert-info alert-dismissable">
                                    <asp:label text="" ID="lbl_msg" CssClass="msg" runat="server"></asp:label>
                                </div>
                            </div>

                            <div class="span6">
                                <div id="diverrmessage" runat="server" visible="false" class="alert alert-info alert-dismissable">
                                    <asp:label text="" id="lbl_err_msg" CssClass="msg" runat="server"></asp:label>
                                </div>
                            </div>


                             <div class="row">   
                            <asp:HiddenField ID="hid_period" runat="server" />
                                    <label class="control-label col-md-2">Name</label>
                                            <div class="col-md-2">
                                                    <asp:TextBox ID="txt_period_name" CssClass="form-control" runat="server"></asp:TextBox> 
                                                    <asp:RequiredFieldValidator runat="server" SetFocusOnError="true" id="req_period_name" controltovalidate="txt_period_name" errormessage="Period Name Required!" />
                                            </div>

                                     <label class="control-label col-md-1">Type</label>   
                                    <div class="col-md-2">
                                        <asp:DropDownList ID="ddl_type" CssClass="form-control" runat="server"></asp:DropDownList>
                                    </div> 

                                       <%--<asp:label ID="Label2" text="Adjusting" CssClass="control-label col-md-1" runat="server" />--%>
                                     <div class="col-md-2 col-md-offset-1">
                                        <asp:CheckBox ID="chkbox_adjsmnt_period_flg" CssClass="checkbox" Text="Adjusting" runat="server" />
                                     </div>

                             </div>
                           <div class="row">   
                                <label class="control-label col-md-2">Year</label>
                                   <div class="col-md-2">
                                        <asp:TextBox ID="txt_year" CssClass="form-control" runat="server"></asp:TextBox>
                                        <asp:RequiredFieldValidator runat="server" id="req_year" SetFocusOnError="true" controltovalidate="txt_year" errormessage="Period Year Required!" />
                                   </div>

                                   <label class="control-label col-md-1">Quater</label>
                                            <div class="col-md-2">
                                                <asp:TextBox ID="txt_qtr" CssClass="form-control" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator runat="server" id="req_qtr" SetFocusOnError="true" controltovalidate="txt_qtr" errormessage="Period Quater Required!" />
                                            </div>
                                                <label class="control-label col-md-1">Number</label>
                                                    <div class="col-md-2">
                                                        <asp:TextBox ID="txt_period_num" CssClass="form-control" runat="server"></asp:TextBox>
                                                        <asp:RequiredFieldValidator runat="server" id="req_period_num" SetFocusOnError="true" controltovalidate="txt_period_num" errormessage="Period Number Required!" />
                                                    </div>
                            </div>

                            <hr />

                           <div class="row">   
                                    <label class="control-label col-md-2 col-md-offset-1">Date From</label>
                                            <div class="col-md-2">
                                                    <asp:TextBox ID="txt_from" CssClass="form-control form_datetime" runat="server"></asp:TextBox>
                                                    <asp:RequiredFieldValidator runat="server" id="req_from" SetFocusOnError="true" controltovalidate="txt_from" ValidationGroup="save" errormessage="Date Required!" />
                                            </div>
                                                   <label class="control-label col-md-1">Date To</label>
                                                        <div class="col-md-2">
                                                            <asp:TextBox ID="txt_to" CssClass="form-control form_datetime" runat="server"></asp:TextBox>
                                                        </div>
                           </div>
                               
                  </div>
            </div>
        </div>
        </section>
    </div>
    
</ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btn_save" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
