@if(Auth::user()->hasAnyPermission(['All','Update Subhead']))    
@php($unique_element = "update")
<!-- Modal ADD Branch -->
<div class="modal fade" id="md_update_subhead" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  {{ Form::open(array('route' => 'subhead.update', 'class' => 'cls_form','id'=>'form_update_subhead')) }}
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Update SubHead</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-header">
          <div class = "col-md-5">
    <strong class="strong-margin">ACCOUNT INFORMATION</strong>
     </div>
              <div class = "col-md-6">
               
   
     </div>
             <div class = "col-md-1">
           <img src = "{{asset('assets/images/icons/accountinformation.png')}}"/>
               
   
     </div>
          </div>
          <div class = "card-body form-fieldset">
                  <div class="row">
              @if($head->nature === "Current Assets")
                <div class="col-sm-12">
                  <label class="label-color"> 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">

                  <select onchange="verifyBank(event,this,'{{$unique_element}}')" name="type" class="form-control form-control-sm cls_selection">
                  @foreach(EF::getAccountsTypeList() as $rows)

                     @if($rows === "Cash" || $rows === "Bank")
                       <option value="{{$rows}}">{{$rows}}</option>
                     @endif
                                  
                  @endforeach
                  </select>
         
                </div>
            </div>
            @else
              <input type="hidden" name="type" value="General">
            @endif

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

            <div class="input-group mb-3">
              <select onchange="setBank(event,this,'{{$unique_element}}')" class="form-control-sm form-control {{$unique_element}}_bank_list" name="bank" >
                  <option selected="true" value="{{Crypt::encrypt(0)}}">Select Bank</option>
                  @foreach($bank_list as $rows)
                    <option value="{{Crypt::encrypt($rows->id)}}">{{ucwords($rows->branch_code)}} | {{ucwords($rows->bank_name)}} | {{ucwords($rows->location)}}</option>
                  @endforeach
              </select>
              

          
             <div id="view_add_button" class="input-group-prepend">  
              </div>
            </div>
          </div>

            <div class="col-sm-6">
                <label class="label-color"> Code: <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first('code',":message") }}</small>
            <div class="input-group mb-3">
          
              {{Form::Text('code','', ['class' => 'form-control form-control-sm', 'placeholder' => 'Code #' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default', 'readonly' => 'series'])}}
            </div>
          </div>

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

            <div class="input-group mb-3">
      
              {{Form::Text('name', '', ['class' => 'form-control form-control-sm cls_required  '.$unique_element.'_subhead_name ', 'placeholder' => 'Name' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default', 'id' => 'bank'])}}
            </div>
           </div>

            
          

        <input type="hidden" name="head_id" value="{{Crypt::encrypt($head_id)}}">
   
          
       </div>
          </div>
        </div>
  
      </div>
      <div class="modal-footer">
        <input type="hidden" name="subhead_id" >
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-primary cls_submit" content="update subhead">Update SubHead</button>
      </div>
    </div>
  </div>
  {{ Form::close() }}
</div>
<!-- END MODAL ADD BRANCH -->

@endif