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

<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_acc.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"> GL Code Combination</span>
                   
                     <div class="pull-right">
                            <asp:button text="Save" CssClass="btn btn-info" ID="btn_save" runat="server"  ValidationGroup="save"
                                onclick="btn_save_Click"/>
                            <asp:button text="Back" CssClass="btn btn-info" ID="btn_cancel" 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" style="padding-top:10px">
                                <asp:HiddenField ID="hid_acc" runat="server" />
                                  <label class="control-label col-md-2">Account</label>
                                <div class="col-md-7">
                                 <div class="input-group">
                                 <asp:TextBox  CssClass="form-control" ID="txt_acc" runat="server"></asp:TextBox>
                                 <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_acc" controltovalidate="txt_acc" errormessage="Account Required!" />
                                    <span class="input-group-btn">
                                    <button id="btn_lov_loc" type="button" data-target="#CostVal" data-toggle="modal" runat="server" class="btn btn-white"><i class="fa fa-search"></i></button>
                                    </span>
                            </div>
                                </div>
                            </div>

                            <div class="row" style="padding-top:10px">
                             <label class="control-label col-md-2">Type</label>
                                <div class="col-md-3">
                                    <asp:TextBox CssClass="form-control" ID="txt_type" runat="server"></asp:TextBox>
                                </div>
                            </div>

                            <div class="row" style="padding-top:10px">
                                  <label class="control-label col-md-2">From Date</label>
                                <div class="col-md-3">
                                    <asp:TextBox CssClass="form-control form_datetime" ID="txt_date_from" runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_date_from" controltovalidate="txt_date_from" errormessage="From Date Required!" />
                                </div>

                                  <label class="control-label col-md-1">To Date</label>
                                <div class="col-md-3">
                                    <asp:TextBox CssClass="form-control form_datetime" ID="txt_date_to" runat="server"></asp:TextBox>
                                </div>

                            </div>

                             <div class="row" style="padding-top:10px">
                                <label class="control-label col-md-2">Alternate Account</label>
                                <div class="col-md-7">
                                    <asp:TextBox CssClass="form-control" ID="txt_altrnate_acc" runat="server"></asp:TextBox>
                                </div>
                            </div>

                            <div class="row" style="padding-top:10px">
                                <label class="control-label col-md-2">Account Description</label>
                                <div class="col-md-7">
                                    <asp:TextBox CssClass="form-control" ID="txt_desc" runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_desc" controltovalidate="txt_desc" errormessage="Description Required!" />
                                </div>
                            </div>


                          

                            



                            <div class="modal fade" id="CostVal" role="dialog">
                               <div class="modal-dialog modal-dialog-center" >
                                <div class="modal-content">
                                  <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                                    <h4 class="modal-title">Costing Values :</h4>
                                  </div>
                                  <div class="modal-body">
                                        <asp:Repeater ID="rpt_cost" runat="server" OnItemDataBound="rpt_cost_OnItemDataBound">
                                          <ItemTemplate>
                                            <div class="form-group">
                                              <div class="col-lg-1"></div>
                                                <asp:Label ID="r_lbl" runat="server" class="col-lg-3 col-sm-3 control-label" Text='<%# Eval("PROMPT") %>'></asp:Label>
                                                <div class="col-lg-6">
                                                     <asp:DropDownList Width="320px" ID="ddl_r_value" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                                     <asp:HiddenField ID="hid_field_name" runat="server" Value='<%# Eval("col_name") %>' ></asp:HiddenField>
                                                     <asp:HiddenField ID="hid_vs_name" runat="server" Value='<%# Eval("SEG_VALUE_SET") %>' ></asp:HiddenField>
                                                     <asp:HiddenField ID="hid_value" runat="server" Value='<%# Eval("VALUE") %>' ></asp:HiddenField>

                                                </div>
                                            </div>
                                            
                                           </ItemTemplate>  
                                       </asp:Repeater>
                                  </div>
                                 
                                  <div class="modal-footer">
                                  <asp:Button ID="btn_rpt_load" runat="server" CssClass="btn btn-default" Text="Save & Close" OnClick="btn_rpt_load_Click"></asp:Button>
                                  </div>
                                </div>
                               </div>
                            </div>


                            <asp:Repeater ID="add_info" runat="server">
                                <HeaderTemplate><header class="panel-deading">Additional Information</header><br /></HeaderTemplate>
                                <ItemTemplate>
                                    <div class="row">
                                        <asp:Label CssClass="control-label col-md-2" runat="server" ID="r_lbl" Text='<%#Eval("PROMPT") %>'></asp:Label>
                                        <div class="col-md-4">
                                            <asp:TextBox ID="txt_r_value" runat="server" CssClass="form-control" placeholder='<%#Eval("PROMPT") %>' Text='<%#Eval("Value") %>'></asp:TextBox>
                                            <asp:HiddenField ID="hid_field_name" runat="server" Value='<%#Eval("col_name") %>' />
                                        </div>
                                    </div>
                                </ItemTemplate>
                            </asp:Repeater>

                </div>

            </section>
            </div>
        </div>
    </div>
    </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btn_save" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>

    <script src="../../ThemeScrips/jquery.min.js"></script>
    <link href="../../ThemeScrips/select2.min.css"
        rel="stylesheet" />
    <script src="../../ThemeScrips/select2.min.js"></script>
    <%--<script src="/ThemeScrips/select2.min.js"></script>--%>
    <script>
        $('.select2').select2();
    </script>


</asp:Content>
