<!-- Modal ADD Commission -->
<div class="modal fade" id="md_add_commission" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">

  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Add Charges</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true"></span>
        </button>
      </div>

      <div class="modal-body">

                    <!-- Nav tabs -->
  <ul class="nav nav-tabs justify-content-center" role = "tablist">
                        <li  class=" nav-item" style = "border-bottom: 0px !important; border: 1px solid;"><a class = "nav-link active" style = "    font-size: 13px;"  href="#addcommission"  aria-controls="uploadTab" role="tab" data-toggle="tab">Add Commission</a>

                        </li>
                        <li class = "nav-item" style = "border-bottom: 0px !important; border: 1px solid; padding-top: 0rem;"><a href="#extracharges" class = "nav-link " aria-controls="browseTab" role="tab"     style = "font-size: 13px;" data-toggle="tab">Add Document / Miscellaneous Charges</a>

                        </li>
                    </ul>

                    <!-- Tab panes -->
                    <div class="tab-content">
                        <div role="tabpanel" class="tab-pane container active" id="addcommission">
            {{ Form::open(array('route' => 'commission.store','id' => 'form_add_commission',  'class' => 'cls_form')) }}
                          <div class ="card">
          <div class ="card-body form-fieldset">
                    <div class="row">

          <div class="col-sm-6">
            <label class="label-color">Type: <i style = "color:red;">*</i></label>
           <small class="form-errors pull-right req" value="*">{{ $errors->first('user_type',":message") }}</small>
            <div class="input-group mb-3">

              @php($type_list = [Crypt::encrypt('0')=>'Select User Type '])

              @foreach(EF::getUserTypeWithRole() as $rows)
                @php($type_list += [Crypt::encrypt($rows->id)=> $rows->name])
              @endforeach

             {{Form::select('user_type', $type_list, '' , array('class' => 'form-control form-control-sm cls_required cls_selection','onChange' => 'getUserList(event,this)'))}}

            </div>
          </div>


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

            <div class="input-group mb-3">

              @php($user_list = [Crypt::encrypt(0) => 'Select User'])



             {{Form::select('user_id', $user_list, '' , array('class' => 'form-control form-control-sm  cls_selection user_list'))}}
             <div id="view_add_button" class="input-group-prepend">
              </div>
            </div>
          </div>
                   <div class="col-sm-12">
                    <label class="label-color">Description: <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first('description',":message") }}</small>

            <div class="input-group mb-3">

                 {{Form::text('description', '', ['class' => 'form-control form-control-sm  cls_required', 'placeholder' => 'Description' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])}}
            </div>
          </div>



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

            <div class="input-group mb-3">
 
              {{Form::text('percentage', '', ['class' => 'form-control form-control-sm  cls_required  percentage', 'placeholder' => 'Commission Percentage [1 - 100]' , 'aria-label' => 'Default', 'onChange' => "getCommissionAmount(event,'.percentage','.add_amount','.amount_into_words',true)" , 'aria-describedby' => 'inputGroup-sizing-default'])}}
            </div>
          </div>

            <div class="col-sm-6">
              <label class="label-color">Amount: <i style = "color:red;">*</i></label>

            <div class="input-group mb-3">

              {{Form::text('amount', '', ['class' => 'form-control form-control-sm  add_amount', 'placeholder' => 'Amount' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default', 'onChange' => "getCommissionAmount(event,'.percentage','.add_amount','.amount_into_words',false)"])}}
            </div>
          </div>
              <div class="col-sm-12">
                     <label class="label-color">Amount In Words  </label>
                  <small class="form-errors pull-right req" value="">{{ $errors->first('amount_in_words',":message") }}</small>
                   <div class="input-group mb-3">

              <input placeholder="Amount In  Words" type="text" name= "amount_in_words" readonly="" class="form-control-sm form-control amount_into_words" >
            </div>
                </div>



        </div>
        </div>
           <input type = "hidden" name="booking_id" value = "{{Crypt::encrypt($booking->id)}}" />
         <button type="submit" class="btn btn-primary cls_submit" content="add this payment">Add Commission</button>

      </div>
         {{ Form::close() }}

                        </div>
                        <div role="tabpanel" class="tab-pane fade" id="extracharges">
              {{ Form::open(array('route' => 'extracharges.store','id' => 'form_add_charges',  'class' => 'cls_form')) }}
                                       <div class ="card">
          <div class ="card-body form-fieldset">
                    <div class="row">

          <div class="col-sm-6">
            <label class="label-color">Charges Type: <i style = "color:red;">*</i></label>
           <small class="form-errors pull-right req" value="*">{{ $errors->first('charges_type',":message") }}</small>
            <div class="input-group mb-3">


              <select name="charges_type" class="form-control form-control-sm charge_type cls_selection" onChange = "ChargesAmount(event,this)">
                 <option value="0">Select Charge Type</option>
                @if($document_charges_count == 0)
                 <option value="Document Charges">Document Charges</option>
                 @endif
                 <option value="Miscellaneous Charges">Miscellaneous Charges</option>

              </select>
            </div>
          </div>
           <div class="col-sm-6">
              <label class="label-color">Amount: <i style = "color:red;">*</i></label>

            <div class="input-group mb-3">

              {{Form::text('amount', '', ['class' => 'form-control form-control-sm  charges_amount', 'placeholder' => 'Amount' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','onkeyup' => 'numberInWordsValue(this,"amount_in_words")'])}}
            </div>
          </div>
              <div class="col-sm-12">
                     <label class="label-color">Amount In Words  </label>
                  <small class="form-errors pull-right req" value="">{{ $errors->first('amount_in_words',":message") }}</small>
                   <div class="input-group mb-3">

              <input placeholder="Amount In  Words" type="text" name= "amount_in_words" readonly="" class="form-control-sm form-control amount_in_words" >
            </div>
          </div>


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

            <div class="input-group mb-3">

                 {{Form::text('description', '', ['class' => 'form-control form-control-sm  cls_required', 'placeholder' => 'Description' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])}}
            </div>
          </div>

        </div>


 </div>
 <input type = "hidden" name="booking_id" value = "{{Crypt::encrypt($booking->id)}}" />
         <button type="submit" class="btn btn-primary cls_submit" content="add this payment">Add Charges</button>
      </div>
      {{ Form::close() }}
                        </div>
                    </div>

              </div>


    </div>
  </div>

</div>
<!-- END MODAL ADD BRANCH -->
