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

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel ID="main_pnl" runat="server">
        <div class="row">
            <div id="myModal_email" class="modal fade" role="dialog">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal">
                                &times;</button>
                            <h4 class="modal-title">Enter your Email ID and Password:</h4>
                        </div>
                        <div class="modal-body">
                            <div class="row">
                                <div class="col-md-offset-1">
                                </div>
                                <div class="col-md-3">
                                    <label class="control-label col-md-2">
                                        Email</label>
                                </div>
                                <div class="col-md-8">
                                    <asp:TextBox ID="txt_eml" CssClass="form-control" runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="req_eml" ErrorMessage="Email is required" ControlToValidate="txt_eml"
                                        SetFocusOnError="true" ValidationGroup="email" runat="server" />
                                </div>
                                <div class="col-md-3">
                                    <label class="control-label col-md-2">
                                        Password</label>
                                </div>
                                <div class="col-md-8">
                                    <asp:TextBox ID="txt_ps" CssClass="form-control" runat="server" TextMode="Password"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ErrorMessage="Password is required"
                                        ControlToValidate="txt_eml" SetFocusOnError="true" ValidationGroup="email" runat="server" />
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <asp:Button ID="btneml" Text="Send" CssClass="btn btn-info" ValidationGroup="email"
                                OnClick="btneml_Click" runat="server" />
                            <button type="button" class="btn btn-danger" 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" ></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"></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>


            <div class="col-md-12">
                <section class="panel">
               <header class="panel-heading" style="padding-bottom:30px">
                           <span class="label label-primary">Quick Pay</span>
                   
                   
                   <div class="pull-right">
                         <asp:Button ID="btn_run" runat="server" Text="Run Payroll Process"
                                           CssClass="btn btn-default" onclick="btn_run_Click" ValidationGroup="Run"></asp:Button>
                                      
                                             <asp:Button ID="btn_view_result" runat="server" Text="View Results" 
                                           CssClass="btn btn-default" onclick="btn_view_result_Click" ValidationGroup="Run"></asp:Button>

                                          

                                           <a data-toggle="modal" data-target="#myModal_email" class="btn btn-default" id="A1" runat="server" visible="false">Send Email</a>

                                           <asp:Button ID="btn_tax" runat="server" Text="Calculate Tax" ValidationGroup="Run" 
                       CssClass="btn btn-default" onclick="btn_tax_Click"></asp:Button>


                                      <asp:Button ID="btn_add_elem" runat="server" Text="Add Element" ValidationGroup="Run" CssClass="btn btn-default" onclick="btn_add_elem_Click"></asp:Button>
                   </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">
                              <div class="col-md-11 col-xs-10">

                                 <div class ="row">
                                   <div class="col-md-6 col-xs-12">
                                      <label class="control-label col-md-4">Person</label>
                                      <asp:HiddenField ID="hid_assignment_id" runat="server"></asp:HiddenField>
                                      <asp:HiddenField ID="hid_person_id" runat="server"></asp:HiddenField>
                                       <div class="input-group">
                                         <asp:TextBox ID="txt_person_name" CssClass="form-control " runat="server" ></asp:TextBox>
                                    <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator_txt_person_name" ControlToValidate="txt_person_name" ErrorMessage="Person is required. " ValidationGroup="Run" setfocusonerror="true"></asp:RequiredFieldValidator>
                                           
                                           <span class="input-group-btn">
                                              <button id="btn_lov_person" type="button" runat="server" onserverclick="btn_lov_person_Click" class="btn btn-white">
                                               <i class="fa fa-search"></i></button>
                                           </span>

                                        </div>
                                   </div>
                                 </div>
                                 <div class ="row">
                                   <div class="col-md-6 col-xs-12">
                                      <label class="control-label col-md-4 col-xs-12">Period</label>
                                      <asp:HiddenField ID="hid_payroll_id" runat="server"></asp:HiddenField>
                                      <asp:HiddenField ID="hid_period_id" runat="server"></asp:HiddenField>
                                      <asp:HiddenField ID="hid_period_start_date" runat="server"></asp:HiddenField>
                                      <asp:HiddenField ID="hid_period_end_date" runat="server"></asp:HiddenField>
                                      <asp:HiddenField ID="hid_element_type_id" runat="server"></asp:HiddenField>
                                       <asp:HiddenField ID="hid_elem_name" runat="server"></asp:HiddenField>
                                       <asp:HiddenField ID="hid_element_value" runat="server" />
                                      <asp:HiddenField ID="hid_ELEMENT_LINK_ID" runat="server" />
                                       <asp:HiddenField ID="hid_ELEMENT_ENTRY_ID" runat="server" />
                                       <asp:HiddenField ID="hid_eff_start_date" runat="server" />
                                       <asp:HiddenField ID="hid_eff_end_date" runat="server" />
                                       <div class="input-group">
                                         <asp:TextBox ID="txt_period_name"  runat="server"  CssClass="form-control" ></asp:TextBox>
                                    <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator_txt_period_name" ControlToValidate="txt_period_name" ErrorMessage="Period is required. " ValidationGroup="Run" setfocusonerror="true"></asp:RequiredFieldValidator>
                                           <span class="input-group-btn">
                                              <button id="btn_lov_period" type="button" runat="server" onserverclick="btn_lov_period_Click" class="btn btn-white">
                                               <i class="fa fa-search"></i></button>
                                           </span>
                                        </div>
                                   </div>
                                   
                                   </div>


                                  <div class="row">
                                      <div class="col-md-4 col-md-offset-2">
                                          <asp:CheckBox ID="chk_es" runat="server" CssClass="checkbox" Text="End Settlement Process" />
                                      </div>
                                      
                                  </div>
                                 <br />
                                 <br />

                                 
                               <div class="row">
                                <div class="col-md-10 col-md-offset-1">
                                 <asp:Repeater ID="rpt_run_result" runat="server" 
                                         onitemdatabound="rpt_run_result_ItemDataBound" >
                                     <HeaderTemplate>
                                    
                                     <div class="table-responsive">
                                       <table class="table table-hover  table-bordered">
                                           <tr>
                                            <td style="width:25% !important;">
                                              Element Name  
                                            </td>
                                            <td style="width:25% !important;">
                                              Classification
                                            </td>
                                            <td style="width:25% !important;">
                                              Pay Value  
                                            </td>
                                             <td style="width:25% !important;">
                                              <asp:Button ID="btn_rollback" runat="server" Text="Rollback Payroll Process"   CssClass="btn btn-danger" onclick="btn_rollback_Click"></asp:Button>
                                            </td>
                                            
                                           </tr>
                                        </table> 
                                         
                                     </div>
                                     

                                     </HeaderTemplate>
                                     <ItemTemplate >
                                           <asp:HiddenField ID="hid_Element_Type_id" runat="server" Value='<% # Eval("ELEMENT_TYPE_ID") %>'></asp:HiddenField>
                                            <asp:HiddenField ID="HID_ASSIGNMENT_ID" runat="server" Value='<% # Eval("ASSIGNMENT_ID") %>'></asp:HiddenField>
                                       <table class="table table-hover  table-bordered">
                                           <tr>
                                            <td style="width:25% !important;">
                                              <%# Eval("Element") %>  
                                            </td>
                                            <td style="width:25% !important;">
                                              <%# Eval("Class") %>  
                                           </td >
                                            <td style="width:25% !important;text-align:right;">
                                              <%# Eval("Value") %>
                                            </td>
                                            <td style="width:25% !important;">
                                              <a id="dtl_lnk" data-toggle="collapse" href="#<%# Eval("ROW_ID") %>" >Details</a>
                                            </td>
                                           </tr>
                                        </table>
                                            <div class="collapse" id="<%# Eval("ROW_ID") %>">
                                                 <div class="row">
                                                   <div class="col-md-10 col-md-offset-1">
                                                    <asp:GridView ID="grd_run_result_valus" runat="server" AutoGenerateColumns="false" CssClass="table  table-hover" >
                                                     <Columns>
                                                     <asp:BoundField HeaderText="Name" DataField="INPUT_VALUE"/>
                                                     <asp:BoundField HeaderText="VALUE" DataField="VALUE"/>
                                                     </Columns>
                                                    </asp:GridView>
                                                   </div>
                                                 </div>
                                              </div>
                                       
                                              
                                     </ItemTemplate>
                                 </asp:Repeater>
                                </div>                           
                               </div>

                              </div>
                           </div>



                </div>
            
             
            </section>
            </div>
        </div>
    </asp:Panel>
     
</asp:Content>
