<div class="row">


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

    <div class="input-group mb-3">
      <div class="input-group-prepend">
        <span class="input-group-text" id="inputGroup-sizing-default">
          Mode
        </span>
      </div>
      <select {{-- @isset($payment->id) readonly @endisset --}} name="payment_mode[]" id="payment_mode_{{$unique_id}}" class="form-control form-control-sm cls_selection paymentmode_list"   onChange ="checkPaymentMode(this,'bank_section_{{$unique_id}}');">
{{--
        @if(isset($payment->id))
          <option  value="{{$mode}}" selected="">{{$mode}}</option>
        @else
--}}

          @if(isset($payment->id))
             <option value="{{$mode}}">{{$mode}}</option>
          @else
              <!-- <option value="">Payment Mode</option> -->

              @foreach(EF::getPaymentMode() as $rows)
                <option @if(isset($mode) && $mode == $rows) selected @endif value="{{$rows}}">{{$rows}}</option>
              @endforeach
          @endif
         
{{--
        @endif
--}}
       
      
     
      </select>
    </div>
  </div>
   <div class="col-sm-12" style="text-align: right; display: none;">

      <strong >
        @if(isset($payment->id))
          <input readonly="" @if(isset($post_dated) && $post_dated > 1 ) checked  @endif type="checkbox" name="postdated[]" value="@isset($post_dated){{$post_dated}}@endisset" id="postdated_{{$unique_id}}"> 
                   Is Post Dated? 
        @else

         <input @if(isset($post_dated) && $post_dated > 1 ) checked  @endif type="checkbox" name="postdated[]" value="@isset($post_dated){{$post_dated}}@endisset" id="postdated_{{$unique_id}}"> 
         Is Post Dated? 
         @endif
      </strong>
  </div>
 </div>


<div class = "row bank_section_{{$unique_id}}" @if(isset($mode) && $mode == "Cash") style ="display:none;" @elseif(!isset($mode)) style ="display:none;" @endif >
  <div class="col-sm-12 col-md-4">
    <label class="label-color"> Instrument:</label>
    <small class="form-errors pull-right req" value="">{{ $errors->first('insturment',":message") }}</small>
    <div class="input-group mb-3">
      @if(isset($payment->id))
        <input readonly="" {{-- @isset($payment->id) readonly @endisset --}} type="text" name="instrument[]" id="instrument_{{$unique_id}}" class="form-control form-control-sm cls_required" value="@isset($instrument){{$instrument}}@endif"  placeholder="Instrument" aria-label="Default" aria-describedby = "inputGroup-sizing-default"> 
      @else
        <input {{-- @isset($payment->id) readonly @endisset --}} type="text" name="instrument[]" id="instrument_{{$unique_id}}" class="form-control form-control-sm cls_required" value="@isset($instrument){{$instrument}}@endif"  placeholder="Instrument" aria-label="Default" aria-describedby = "inputGroup-sizing-default"> 
      @endif
      

     
    </div>
  </div>

    <div class="col-sm-12 col-md-4">
      <label class="label-color"> Drawn On:</label>
    <small class="form-errors pull-right req" value="">{{ $errors->first('drawn',":message") }}</small>
    <div class="input-group mb-3">
   
      @if(isset($payment->id))
        <input readonly="" {{-- @isset($payment->id) readonly @endisset --}} value="@isset($drawn_on){{$drawn_on}} @endisset" type="text" name="drawn[]" id="drawn_{{$unique_id}}" class="form-control form-control-sm cls_required"  placeholder="Drawn On" aria-label="Default" aria-describedby = "inputGroup-sizing-default"> 
      @else
        <input {{-- @isset($payment->id) readonly @endisset --}} value="@isset($drawn_on){{$drawn_on}} @endisset" type="text" name="drawn[]" id="drawn_{{$unique_id}}" class="form-control form-control-sm cls_required"  placeholder="Drawn On" aria-label="Default" aria-describedby = "inputGroup-sizing-default"> 
      @endif
      


    </div>
    
  </div>



  <div class="col-sm-12 col-md-4">
    <label class="label-color"> Instrument Date:</label>
    <small class="form-errors pull-right req" value="">{{ $errors->first('date',":message") }}</small>
    <div class="input-group mb-3">
        @if(isset($payment->id))
            <input readonly="" {{-- @isset($payment->id) readonly @endisset --}} @isset($instrument_date) value="{{str_replace('1970-01-01',' ',date('Y-m-d',strtotime($instrument_date)))}}"  @endisset type="date" name="instrument_date[]" id="instrument_date_{{$unique_id}}" class="form-control form-control-sm cls_required"  placeholder="Instrument Date" aria-label="Default" aria-describedby = "inputGroup-sizing-default"> 
        @else
            <input {{-- @isset($payment->id) readonly @endisset --}} @isset($instrument_date) value="{{str_replace('1970-01-01',' ',date('Y-m-d',strtotime($instrument_date)))}}"  @endisset type="date" name="instrument_date[]" id="instrument_date_{{$unique_id}}" class="form-control form-control-sm cls_required"  placeholder="Instrument Date" aria-label="Default" aria-describedby = "inputGroup-sizing-default"> 
        @endif
       

      


    </div>
    
  </div>

  <div class="col-sm-12 col-md-6">
    <label class="label-color"> Deposit No:</label>
    <small class="form-errors pull-right req" value="">{{ $errors->first('deposit_no',":message") }}</small>
    <div class="input-group mb-3">
     
        <input {{-- @isset($payment->id) readonly @endisset --}} @isset($deposit_no) value="{{$deposit_no}}"  @endisset type="text" name="deposit_no[]" id="deposit_no_{{$unique_id}}" class="form-control form-control-sm cls_required"  placeholder="Deposit No" aria-label="Default" aria-describedby = "inputGroup-sizing-default"> 

      


    </div>
    
  </div>

  <div class="col-sm-12 col-md-6">
    <label class="label-color"> Deposit Date:</label>
    <small class="form-errors pull-right req" value="">{{ $errors->first('deposit_date',":message") }}</small>
    <div class="input-group mb-3">
     
        <input {{-- @isset($payment->id) readonly @endisset --}} @isset($deposit_date) value="{{str_replace('1970-01-01',' ',date('Y-m-d',strtotime($deposit_date)))}}"  @endisset type="date" name="deposit_date[]" id="deposit_date_{{$unique_id}}" class="form-control form-control-sm cls_required"  placeholder="Deposit Date" aria-label="Default" aria-describedby = "inputGroup-sizing-default"> 

      


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

