<div class="row">
 

{{--
<div class="col-sm-6">
         <label class="label-color"> {{ucwords(str_replace('_',' ',EF::branchWhiteLabel()['module']))}}: <i style = "color:red;">*</i></label>

                            <small class="form-errors pull-right req" value="*">{{ $errors->first(EF::branchWhiteLabel()['module'],":message") }}</small>

                            <div class="input-group mb-3">
                            
                              <select id="branch_{{$unique_id}}" onchange="getBookingList(this,'{{$unique_id}}','{{Crypt::encrypt(0)}}')" class="form-control form-control-sm" name="{{EF::branchWhiteLabel()['module']}}">
                                <option value="{{Crypt::encrypt(0)}}">Select {{ucwords(str_replace('_',' ',EF::branchWhiteLabel()['module']))}}</option>
                                  @foreach($branch as $rows)
                                      <option @if(isset($current_branch) && $current_branch === $rows->id) selected @endif value="{{Crypt::encrypt($rows->id)}}">{{$rows->code}} {{$rows->name}}</option>
                                  @endforeach
                              </select>
                     
                            </div>
                        </div>
--}}

@if(!isset($loan_id))


                        <div class="col-sm-4">
                            <label class="label-color"> Select Type: <i style = "color:red;"></i></label>

                            <small class="form-errors pull-right req" value="">{{ $errors->first('type',":message") }}</small>

                            <div class="input-group mb-3">
                            
                              @if(isset($generic_type->id))

                                <input type="hidden" name="generic_type[]" value="{{Crypt::encrypt($generic_type->id)}}">

                                <input readonly="" class="form-control form-control-sm" type="text" name="" value="{{$generic_type->name}}">

                              @else
                                <select id="generic_type_{{$unique_id}}" name="generic_type[]" class="form-control form-control-sm cls_selection" onchange="getGenericPaymentList('{{$unique_id}}','{{Crypt::encrypt(0)}}');">
                                  <option value="{{Crypt::encrypt(0)}}">Select Type</option>
                                  @isset($generic_list)
                                    @foreach($generic_list as $rows)
                                   
                                      <option @if(isset($generic_type) && $generic_type === $rows->id) selected="true"   @endif value="{{Crypt::encrypt($rows->id)}}">{{$rows->name}}</option>
                                    @endforeach
                                  @endisset

                                </select>
                              @endif
                     
                            </div>
                        </div>

      <div class="col-sm-4" id="booking_section_{{$unique_id}}"  @if(!isset($booking->id)) style="display:none;" @endif >
         <label class="label-color"> Booking: <i style = "color:red;"></i></label>

                            <small class="form-errors pull-right req" value="">{{ $errors->first('booking',":message") }}</small>

                            <div class="input-group mb-3">
                              
                              @if(isset($booking->id))
                                <input type="hidden" name="booking[]" value="{{Crypt::encrypt($booking->id)}}">
                                <input readonly="" class="form-control form-control-sm" value="{{$booking->ms}} ({{EF::showPlotFormat($booking->plot)}}">
                              @else
                                <select  id="booking_{{$unique_id}}" name="booking[]" class="form-control form-control-sm cls_selection" onchange="getPaymentList(this,'{{$unique_id}}','{{Crypt::encrypt(0)}}')">
                                  <option value="{{Crypt::encrypt(0)}}">Select Booking</option>
                                  @isset($booking_list)
                                    @foreach($booking_list as $rows)
                                    @if($rows->is_block == 0)
                                      <option @isset($booking->id) @if($booking->id == $rows->id) selected @endif @endisset value="{{Crypt::encrypt($rows->id)}}"> {{$rows->ms}}
                                       
                                         ({{EF::showPlotFormat($rows->plot)}}

                                         @if(ucfirst($rows->plot->category) == "Residential")-R @elseif(ucfirst($rows->plot->category) == "Commercial")-C @endif)
                                      </option>
                                      @endif
                                    @endforeach
                                  @endisset

                                </select>
                              @endif
                     
                            </div>
                        </div>
                          <div class="col-sm-4">
                                   <label class="label-color"> Payment Type: <i style = "color:red;"></i></label>
                            <small class="form-errors pull-right req" value="">{{ $errors->first('payment type',":message") }}</small>

                            <div class="input-group mb-3">
                              
                              <select id="payment_type_{{$unique_id}}" name="payment[]" class="form-control form-control-sm cls_selection" onchange="getPayment(this,'{{$unique_id}}');">

                                <option value="{{Crypt::encrypt(0)}}">Select Payment Type</option>

                                @isset($payment->id)
                                  <option selected value="{{Crypt::encrypt($payment->id)}}">{{$payment->description}}</option>
                                @endisset

                                @isset($payment_list)
                                  @foreach($payment_list as $rows)
                                    <option value="{{Crypt::encrypt($rows->id)}}">{{$rows->description}}</option>
                                  @endforeach
                                @endisset
{{-- @foreach(EF::getPaymentType() as $rows)
<option @if(isset($installment->id) && $rows == "Installment")
  selected @elseif(isset($commission->id) && $rows == "Commission")
  selected @endif value="{{$rows}}">{{$rows}}
</option> 
@endforeach
--}}

                              </select>
                     
                            </div>
                        </div>
{{--
                        <div @if(!isset($commission->id)) style="display: none;"  @endif class="col-sm-6" id="commission_dropdown_{{$unique_id}}">
                                 <label class="label-color"> Description: <i style = "color:red;">*</i></label>
                            <small class="form-errors pull-right req" value="*">{{ $errors->first('commission',":message") }}</small>

                            <div class="input-group mb-3">
                            
                              <select id="commission_{{$unique_id}}"  name="commission[]" class="form-control form-control-sm cls_selection" onchange="getAmountBySelection(this,'{{$unique_id}}','Commission');">
                              <option value="{{Crypt::encrypt(0)}}">Select Commission</option>

                              @isset($commission->id)
                                <option selected value="{{Crypt::encrypt($commission->id)}}"{{$commission->description}}</option>
                              @endisset


                              @isset($commission_list)
                                @foreach($commission_list as $rows)
                                  <option value="{{Crypt::encrypt($rows->id)}}">{{$rows->description}}</option>
                                @endforeach
                              @endisset



                              </select>
                     
                            </div>
                        </div>
                        <div @if(!isset($installment->id)) style="display: none;"  @endif  class="col-sm-6" id="installment_dropdown_{{$unique_id}}">
                                 <label class="label-color"> Description: <i style = "color:red;">*</i></label>
                            <small class="form-errors pull-right req" value="*">{{ $errors->first('installment',":message") }}</small>

                            <div class="input-group mb-3">
                            
                              <select id="installment_{{$unique_id}}" name="installment[]" class="form-control form-control-sm cls_selection" onchange="getAmountBySelection(this,'{{$unique_id}}','Installment');">
                              <option value="{{Crypt::encrypt(0)}}">Select Installment</option>

                              @isset($installment->id)
                              <option selected value="{{Crypt::encrypt($installment->id)}}">{{$installment->description}}</option>
                              @endisset


                              @isset($installment_list)
                                @foreach($installment_list as $rows)
                                  <option value="{{Crypt::encrypt($rows->id)}}">{{$rows->description}}</option>
                                @endforeach
                              @endisset



                              </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">
                             
                              <input @isset($payment->id) readonly @endisset value="@isset($amount) {{$amount}} @endisset" type="text" name="amount[]" id="amount_{{$unique_id}}" placeholder="Amount" class="form-control form-control-sm cls_selection req" aria-label="Default" aria-describedby = "inputGroup-sizing-default" onkeyup = 'numberInWordsValue(this,"amount_in_words')">

                     
                            </div>
                        </div>

                        @else

            <input type = "hidden" name = "payment_type[]" value = "{{Crypt::encrypt(0)}}"/>
            <input type = "hidden" name = "booking[]"      value = "{{Crypt::encrypt(0)}}"/>

                         <div  class="col-sm-6">
                                 <label class="label-color"> Description: </label>
                            <small class="form-errors pull-right" value="">{{ $errors->first('description',":message") }}</small>

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

                              <input type = "text" class = "form-control form-control-sm" name= "description" value ="Loan Amount"  readonly = "true"/>
  
                            </div>
                        </div>
                                <div  class="col-sm-6">
                                 <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">
                             
                              <input @isset($payment->id) readonly @endisset value="@isset($amount) {{$amount}} @endisset" type="text" name="amount[]" id="amount_{{$unique_id}}" placeholder="Amount" class="form-control form-control-sm cls_selection req" aria-label="Default" aria-describedby = "inputGroup-sizing-default" onkeyup = 'numberInWordsValue(this,"amount_in_words')">

                     
                            </div>
                        </div>
                        @endif

          
                      </div>