<!-- Modal ADD loan -->
@php($unique_id = "add_loan")
<div class="modal fade" id="md_add_loan" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  {{ Form::open(array('route' => 'loan.store', 'class' => 'cls_form','id'=>'form_add_loan','enctype' => 'multipart/form-data')) }}
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Add Loan</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true"></span>
        </button>
      </div>
      <div class="modal-body ">
        <div class = "card">
          <div class ="card-body form-fieldset">
          <div class="row">


          <div class="col-sm-12">
              <label class="label-color"> Select Employee : <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first('employee',":message") }}</small>

            <div class="input-group mb-3">
              <select name="employee" class="form-control form-control-sm cls_selection employee_list">
                  <option value="{{Crypt::encrypt(0)}}">Select Employee</option>

                 @foreach($employee_list as $rows)
                 <option value="{{Crypt::encrypt($rows->user->id)}}">{{$rows->user->name}}
                 </option>
                 @endforeach
                </select>
            </div>
          </div>


         

          


          <div class="col-sm-4">
              <label class="label-color"> Amount : <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first('amount',":message") }}</small>

            <div class="input-group mb-3">
              {{Form::number('amount', '', ['class' => 'form-control form-control-sm cls_required amount_'.$unique_id.' ', 'placeholder' => 'Amount' ,'id' => 'amount' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default', 'onkeyup'=>'netAmount(event,"'.$unique_id.'")'])}}
            </div>
          </div>
          
          <div class="col-sm-8">
              <label class="label-color"> Amount In Words : </label>
            <small class="form-errors pull-right" value="">{{ $errors->first('amount_in_words',":message") }}</small>

            <div class="input-group mb-3">
              {{Form::Text('amount_in_words', '', ['class' => 'form-control form-control-sm amount_in_words_'.$unique_id.' ', 'placeholder' => ' Amount In Words' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','readonly' => 'true'])}}
            </div>
          </div>

            <div class="col-sm-12">
                <label class="label-color"> Interest Rate : <i style = "color:red;">*</i></label>
              <small class="form-errors pull-right req" value="*">{{ $errors->first('interest_rate',":message") }}</small>

              <div class="input-group mb-3">
                {{Form::number('interest_rate', '', ['class' => 'form-control form-control-sm cls_required interest_'.$unique_id.' ', 'placeholder' => 'Interest Rate In Percentage [1 - 100]' , 'id' => 'interest' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','onChange' => 'netAmount(event,"'.$unique_id.'")'])}}
              </div>
            </div>
          
            <div class="col-sm-4">
              <label class="label-color"> Net Amount : <i style = "color:red;"></i></label>
            <small class="form-errors pull-right " value="">{{ $errors->first('net_amount',":message") }}</small>

            <div class="input-group mb-3">
              {{Form::number('net_amount', '', ['class' => 'form-control form-control-sm net_amount_'.$unique_id.' ', 'placeholder' => 'Net Amount' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default', 'readonly' => 'true'])}}
            </div>
          </div>

           <div class="col-sm-8">
              <label class="label-color"> Net Amount In Words : </label>
            <small class="form-errors pull-right" value="">{{ $errors->first('net_amount_in_words',":message") }}</small>

            <div class="input-group mb-3">
              {{Form::Text('net_amount_in_words', '', ['class' => 'form-control form-control-sm net_amount_in_words_'.$unique_id.'', 'placeholder' => 'Net Amount In Words' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','readonly' => 'true'])}}
            </div>
          </div>

          
          <div class="col-sm-12">
              <label class="label-color"> Number Of Months : <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first('no_of_months',":message") }}</small>

            <div class="input-group mb-3">
              {{Form::number('no_of_months', '', ['class' => 'form-control form-control-sm cls_required number_'.$unique_id.' ', 'placeholder' => 'Range [1 - 50]' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','onChange' => 'netAmount(event,"'.$unique_id.'")'])}}
            </div>
          </div>


          <div class="col-sm-4">
              <label class="label-color"> Installment Amount: <i style = "color:red;"></i></label>
            <small class="form-errors pull-right " value="">{{ $errors->first('installment',":message") }}</small>

            <div class="input-group mb-3">
              {{Form::number('installment', '', ['class' => 'form-control form-control-sm installment_amount_'.$unique_id.' ', 'placeholder' => 'Installment Amount' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','readonly' => 'true'])}}
            </div>
          </div>

           <div class="col-sm-8">
              <label class="label-color"> Installment Amount In Words : </label>
            <small class="form-errors pull-right" value="">{{ $errors->first('net_amount_in_words',":message") }}</small>

            <div class="input-group mb-3">
              {{Form::Text('installment_amount_in_words', '', ['class' => 'form-control form-control-sm installment_amount_in_words_'.$unique_id.' ', 'placeholder' => 'Installment Amount In Words' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','readonly' => 'true'])}}
            </div>
          </div>

                           <div class="col-md-12">
                            <label class="label-color">Upload Document:</label>
                               <small class="form-errors pull-right " value="">{{ $errors->first('loan_form',":message") }}</small>
                               <div class="input-group mb-3">
                                 <div class="input-group-prepend">
                                   <span class="input-group-text" id="inputGroup-sizing-default">
                                     <i class="fa fa-file "></i>
                                   </span>
                                 </div>
                                 <input type="file" name="loan_form" class="form-control form-control-sm btn-xsm" required>
                                <div class="input-group-prepend">
                                   <span class="input-group-text" id="inputGroup-sizing-default">
                                     <i class ="userimage" >PDF,DOC,DOCX,XLS</i>
                                   </span>
                                 </div>

                               </div>
                             </div>

          
         </div>

          </div>
        </div>
       
   
         

      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="submit"  class="btn btn-primary cls_submit" content="add loan">Add Loan</button>
      </div>
    </div>
  </div>
  {{ Form::close() }}
</div>
<!-- END MODAL ADD BANK -->