<%@ Page Language="C#"  MasterPageFile="~/Site1.Master" AutoEventWireup="True" CodeBehind="PAY_ELEMENT_ENTRIES.aspx.cs" Inherits="HRMS.PAY_ELEMENT_ENTRIES" Title="Cloud HR - Element Entries" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  <div class="row">
        <div class="col-lg-12">
            <!--breadcrumbs start -->
            <ul class="breadcrumb">
                <li><a href="#" id="home" runat="server"><i class="fa fa-home"></i>Home</a></li>
                <li><a href="#" id="assgn_url" runat="server">Assignment</a></li>
                <li><a href="#" id="ppl" runat="server">People</a></li>
                <li><a href="#" id="ppl_index" runat="server">Employee List</a></li>
            </ul>
            <!--breadcrumbs end -->
        </div>
    </div>
 <asp:Panel ID="main_pnl" runat="server">


        <div class="row">
         <div class="col-md-12">
               <section class="panel">
                 <header class="panel-heading">Element Entries
                    <div class="pull-right">
                        <asp:Button ID="btnSave" class="btn btn-info" runat="server" Text="Save"  onclick="btnSave_Click" ValidationGroup="save" ></asp:Button>
                        <a href="#" id="aCancel" runat="server" class="btn btn-info">Back</a>
                    </div>
                 
                 </header>
                  <div class="panel-body">
                            <div class="span6">
                                <div id="divMessage" runat="server" visible="false" class="alert alert-info alert-dismissable">
                                    <i class="icon-check-sign"></i>
                                    <asp:Label ID="lblMessage" class="msg" runat="server" Text="" ></asp:Label>
                                </div>
                                <div class="span6">
                                    <div id="diverrorMessage" runat="server" visible="false" class="alert alert-danger alert-dismissable">
                                       <i class="icon-check-sign"></i>
                                       <asp:Label ID="lblerrorMessage" class="msg" runat="server" Text="" ></asp:Label>
                                    </div>
                                </div>
                            </div>



                            <div class="row">
                              <label class="col-md-4 control-label">Period</label>
                              <div class="col-md-4">
                                     <asp:HiddenField ID="hid_period_id" runat="server"></asp:HiddenField>
                                     <asp:TextBox ID="txt_period_name" CssClass="form-control" runat="server" Enabled="false"></asp:TextBox>
                              </div>
                            </div>

                            <hr />

                            <asp:HiddenField ID="hid_ELEMENT_ENTRY_ID" runat="server"></asp:HiddenField>
                            <div class="row">
                                 <div class="col-md-6">
                                   <label class="col-md-4 control-label">Element Name</label>
                                      <div class="col-md-8">
                                            <asp:HiddenField ID="hid_ELEMENT_TYPE_ID" runat="server"></asp:HiddenField>
                                            <asp:HiddenField ID="hid_ELEMENT_LINK_ID" runat="server"></asp:HiddenField>
                                            
                                            
                                                     <div class="input-group">
                                                         <asp:TextBox ID="txt_ELEMENT_TYPE_Name" CssClass="form-control " runat="server" ></asp:TextBox>
                                                         <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator_txt_ELEMENT_TYPE_Name" ControlToValidate="txt_ELEMENT_TYPE_Name" ErrorMessage="Element is required. " ValidationGroup="save" setfocusonerror="true"></asp:RequiredFieldValidator>

                                                         <span class="input-group-btn">
                                                            <button id="btn_lov_Element_Type" type="button" runat="server" onserverclick="btn_lov_Element_Type_Click" class="btn btn-white">
                                                            <i class="fa fa-search"></i></button>
                                                          </span>
                                                      </div>
                                     </div>
                                 </div>
                                 <div class="col-md-6">
                                  <label class="control-label col-md-4">Processed</label>
                                   <div class="col-md-4">
                                      <asp:CheckBox ID="chk_process" runat="server" CssClass="checkbox"  Enabled="false"></asp:CheckBox>
                                   </div>
                                 </div>



                            </div>
                            <div class="row">
                               <div class="col-md-6">
                                 <label class="control-label col-md-4"> Processing Type</label>
                                  <div class="col-md-8">
                                      <asp:TextBox ID="txt_processing_type" CssClass="form-control " runat="server" ></asp:TextBox>
                                  </div>
                                 
                               </div>
                           
                               <div class="col-md-6 ">
                                    <label class="control-label col-md-4">Retroactive</label>
                                    <div class="col-md-4">
                                       <asp:CheckBox ID="chk_retroactive" CssClass="checkbox" runat="server" Enabled="false"></asp:CheckBox>
                                    </div>
                               </div>
                           
                            </div>
                           
                           
                            <div class="row">
                                <div class="col-md-10 col-md-offset-1"> 
                                    <br />
                                    <h5>Effective Dates</h5>
                                    <hr />
 
                                      <div class="col-md-6">
                                        <label class="control-label col-md-4">Date From</label>
                                        <div class="col-md-8">
                                            <asp:TextBox ID="txt_EFFECTIVE_START_DATE" runat="server" CssClass="form-control datetime"></asp:TextBox>
                                             <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="Req_txt_EFFECTIVE_START_DATE" controltovalidate="txt_EFFECTIVE_START_DATE" errormessage="Date is Required!" />
                                        </div>
                                      </div>
                                      <div class="col-md-6">
                                
                                        <label class="control-label col-md-4">To Date</label>
                                        <div class="col-md-8">
                                            <asp:TextBox ID="txt_EFFECTIVE_END_DATE" runat="server"  CssClass="form-control datetime"></asp:TextBox>
                                        </div>
                                
                                      </div>

                                 </div>
                            </div>


                            <br />
                            <br />

                            <div class="row">
                              <div class="col-md-2 col-md-offset-1">
                                  <a href="#" data-target="#inputvalues" data-toggle="modal" id="btn_input_value"   runat="server" class="btn btn-block btn-default">Entry Values</a>
                              </div>
                            </div>


                            <div class="row">
                           <div class="col-md-2 pull-right">
                            <a href="#" data-target="#CostVal" data-toggle="modal" id="btn_CostVal"   runat="server" class="btn btn-block btn-info">Costing Values</a>
                           </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 ID="ddl_r_value" runat="server" CssClass="form-control"></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>

                                  <hr />

                                  <div class="form-group">
                                              <div class="col-lg-1"></div>
                                                <asp:Label ID="Label1" runat="server" class="col-lg-3 col-sm-3 control-label" Text="Balancing Account"></asp:Label>
                                                <div class="col-lg-6">
                                                     <asp:DropDownList ID="ddl_bal_account" runat="server" CssClass="form-control"></asp:DropDownList>

                                                </div>
                                            </div>

                                            <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal" >Save & Close</button>
                                  </div>



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


                  </div>
                </section>
            </div>
        </div>

         <!-- Modal content-->
 <div class="modal fade" id="inputvalues" 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">Input Values:</h4>
      </div>
      <div class="modal-body">
        
          <div class="form-group">
           <asp:Repeater ID="rpt_inputEntries" runat="server">
                         <ItemTemplate>
                         <div class="row">
                           <div class="col-md-10  col-md-offset-1">
                             <asp:Label ID="r_lbl" runat="server" class="col-md-6 control-label" Text='<%# Eval("NAME") %>'></asp:Label>
                             <div class="col-md-6">
                                 <asp:TextBox ID="txt_SCREEN_ENTRY_VALUE" runat="server"  Text='<%# Eval("value") %>' CssClass="form-control"></asp:TextBox>
                                 <asp:HiddenField ID="hid_INPUT_VALUE_ID" runat="server" Value='<%# Eval("INPUT_VALUE_ID") %>' ></asp:HiddenField>
                                 <asp:HiddenField ID="hid_ELEMENT_ENTRY_VALUE_ID" runat="server" Value='<%# Eval("ELEMENT_ENTRY_VALUE_ID") %>' ></asp:HiddenField>

                             </div>
                           </div>
                         </div>
                         </ItemTemplate>
            </asp:Repeater>

          </div>
         
      </div>
      <div class="modal-footer">
        <a data-toggle="modal" data-target="#myModal" id="btn_modal_popup" runat="server" class="btn btn-info">Save</a>
        <asp:Button ID="btn_save_inputvalues" class="btn btn-info" runat="server" Text="Save"  onclick="btn_save_inputvalues_Click"  ></asp:Button>
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
   </div>
</div>

<div id="myModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Choose an option:</h4>
      </div>
      <div class="modal-body">
        
        <div class="row">
           <div class="col-md-4">
               <asp:Button ID="btn_update" class="btn btn-info btn-block" runat="server" Text="Update"  ValidationGroup="save" OnClick="btn_update_Click"></asp:Button>
           </div>
           <label class="control-label">Keep history of existing information</label>
        </div>
        <br />
         <div class="row">
           <div class="col-md-4">
               <asp:Button ID="btn_correct" class="btn btn-info btn-block" runat="server" Text="Correction"  onclick="btn_save_inputvalues_Click" ValidationGroup="save" ></asp:Button>
           </div>
           <label class="control-label">Correct existing information</label>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
      </div>
    </div>

  </div>
</div>


  </asp:Panel>

</asp:Content>