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

<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 = "";
                        }
                    }
                }
            </script>
            <div class="main-panel">
                <div class="row">
                    <div class="col-md-12">
                        <section class="panel">
                    <header class="panel-heading">
                        Currencies Setups
                        <div class ="pull-right">
                            <asp:Button ID="btn_save" runat="server" CssClass="btn btn-info" Text="Save" ValidationGroup="save" 
                                onclick="btn_save_Click" />
                            <asp:Button ID="btn_cncl" runat="server" CssClass="btn btn-info" Text="Back" 
                                onclick="btn_cncl_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">
                                    <label class="control-label col-md-3">Currency Code</label>
                                        <div class="col-md-1">
                                            <asp:TextBox ID="txt_currency_code" runat="server" CssClass="form-control"  ></asp:TextBox>
                                            <asp:RequiredFieldValidator runat="server" ValidationGroup="save" id="req_curr_code" controltovalidate="txt_currency_code" errormessage="Currency Code Required!" />
                                        </div>

                                         <label class="col-md-2 control-label">Currency Name</label>
                                        <div class="col-md-2">
                                            <asp:TextBox ID="txt_name" CssClass="form-control" runat="server"></asp:TextBox>
                                            <asp:RequiredFieldValidator runat="server" ValidationGroup="save" id="req_cur_name" controltovalidate="txt_name" errormessage="Currency Name Required!" />
                                        </div>
                                </div>

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

                                <div class="row" style="padding-top:10px">
                                    <label class="col-md-3 control-label">Issuing Territory</label>
                                    <div class="col-md-3">
                                        <asp:HiddenField runat="server" ID="hid_issuing_territory" />
                                            <asp:DropDownList ID="ddl_issuing_territory" CssClass="form-control select2" runat="server"></asp:DropDownList>
                                        </div>

                                        <label class="col-md-1 control-label">Symbol</label>
                                        <div class="col-md-1">
                                            <asp:TextBox ID="txt_symbol" CssClass="form-control" runat="server"></asp:TextBox>
                                        </div>
                                </div>
                                <hr />
                                
                                <div class="row" style="padding-top:10px">
                                        <label class="col-md-3 control-label">Precision</label>
                                        <div class="col-md-2">
                                            <asp:TextBox ID="txt_precision" CssClass="form-control" runat="server"></asp:TextBox>
                                        </div>

                                        <label class="col-md-2 control-label">Extended Precision</label>
                                        <div class="col-md-2">
                                            <asp:TextBox ID="txt_extended_precision" CssClass="form-control" runat="server"></asp:TextBox>
                                        </div>
                                </div>


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

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



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

                                        <label class="col-md-3  control-label">Enabled</label>
                                        <div class="col-md-2">
                                           <asp:CheckBox ID="chkbox_enable" CssClass="checkbox" runat="server" />
                                        </div>
                                </div>
                                <hr />

                                <div class="row" style="padding-top:10px">
                                    <label class="col-md-3  control-label">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="reqfrom" ValidationGroup="save" controltovalidate="txt_from" errormessage="Date Required!" />
                                           <asp:RegularExpressionValidator ID="regexpName" runat="server"     
                                ErrorMessage="Date format is invalid please Enter (dd-MM-yyyy)." 
                                ControlToValidate="txt_from" ValidationGroup="save"   
                                ValidationExpression="(0[1-9]|[12][0-9]|3[01])[-](0[1-9]|1[012])[-]\d{4}" />
                                        </div>

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

                                             <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"     
                                ErrorMessage="Date format is invalid please Enter (dd-MM-yyyy)." 
                                ControlToValidate="txt_to"  ValidationGroup="save"   
                                ValidationExpression="(0[1-9]|[12][0-9]|3[01])[-](0[1-9]|1[012])[-]\d{4}" />
                                        </div>
                                </div>

                                <div class="row" style="padding-top:10px">
                                    
                                </div>

                                    <asp:Repeater ID="add_info" runat="server">
                                        <HeaderTemplate><header class="panel-heading">Addtional Information</header><br /></HeaderTemplate>
                                        <ItemTemplate>
                                            <div class="row">
                                                <asp:Label ID="r_lbl" runat="server" CssClass="col-md-2  col-md-offset-1 control-label" 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>
        $('.select2').select2();
    </script>
</asp:Content>
