<!-- Modal ADD Branch -->
@php($convention = "subhead")
@php($key_element = "abcd")
<div class="modal fade" id="md_account_report" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  {{ Form::open(array('route' => 'report.account', 'class' => 'cls_form','target' => '_blank')) }}
  <div class="modal-dialog modal-md" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Account Report</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-6">
              <label class="label-color">From:</label>
            <small class="form-errors pull-right" value="">{{ $errors->first('date',":message") }}</small>

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

              {{Form::Date('from_date', '', ['class' => 'form-control form-control-sm  cls_date', 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])}}
            </div>
          </div>

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

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

              {{Form::Date('to_date', '', ['class' => 'form-control form-control-sm  cls_date', 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])}}
            </div>
          </div>



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


            <div class="input-group mb-3">
              <select onchange="getSubheadByHead(this,'{{$key_element}}','{{$convention}}')" name="head" class="form-control form-control-sm">
                <option value="{{Crypt::encrypt(0)}}">Select Head</option>
                @foreach($head_list as $rows)
                  <option value="{{Crypt::encrypt($rows->id)}}">{{ucfirst($rows->name)}}
                  </option>
                @endforeach
              </select>
            </div>
          </div>
                 <div class="col-sm-6">
            <label class="label-color"> Select SubHead:</label>
            <small class="form-errors pull-right" value="">{{ $errors->first('subhead',":message") }}</small>
            <div class="input-group mb-3">
              <select id="{{$convention}}_subhead_{{$key_element}}" name="subhead" class="form-control form-control-sm ">
                                <option value="{{Crypt::encrypt(0)}}">Select Subhead</option>

                              </select>

            </div>
          </div>

          <div class="col-sm-12">
            <label class="label-color"> Select Nature:</label>
            <small class="form-errors pull-right" value="">{{ $errors->first('nature',":message") }}</small>
            <div class="input-group mb-3">
              <select name="nature" class="form-control form-control-sm">
                <option value="{{Crypt::encrypt(0)}}">Select Nature</option>
                @foreach(EF::getNatureList() as $rows)
                  <option value="{{Crypt::encrypt($rows)}}">{{ucfirst($rows)}}
                  </option>
                @endforeach
              </select>
            </div>
          </div>
            <div class="col-sm-6">
            <label class="label-color"> Select User Type:</label>
            <small class="form-errors pull-right" value="">{{ $errors->first('head',":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' => 'getUserByDealer(this,"'.$key_element.'")'))}}

            </div>
          </div>

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

            <div class="input-group mb-3">
            <select id="user_{{$key_element}}" name="user" class="form-control form-control-sm ">
                                <option value="{{Crypt::encrypt(0)}}">Select User</option>

                              </select>

            </div>
          </div>

          <div class="col-sm-12">
            <label class="label-color"> Select {{ucwords(str_replace('_',' ',$branch_labels['module']))}}:</label>
            <small class="form-errors pull-right" value="">{{ $errors->first($branch_labels['module'],":message") }}</small>
            <div class="input-group mb-3">
              <select id="branch_{{$key_element}}" onchange="getBookingList(this,'{{$key_element}}','{{Crypt::encrypt(0)}}')" name="{{$branch_labels['module']}}" class="form-control form-control-sm">
                <option value="{{Crypt::encrypt(0)}}">Select {{ucwords($branch_labels['module'])}}</option>
                @foreach($branch_list as $rows)
                  <option value="{{Crypt::encrypt($rows->id)}}">{{ucfirst($rows->name)}}
                  </option>
                @endforeach
              </select>
            </div>
          </div>
                  <div class="col-sm-6">
            <label class="label-color"> Select Booking:</label>
            <small class="form-errors pull-right" value="">{{ $errors->first('category',":message") }}</small>
            <div class="input-group mb-3">
              <select id="booking_{{$key_element}}" name="booking" class="form-control form-control-sm">
                <option value="{{Crypt::encrypt(0)}}">Select Booking</option>
               {{-- @foreach($booking_list as $rows)
                  <option value="{{Crypt::encrypt($rows->id)}}">{{ucfirst($rows->plot->plot_id)}} {{ucfirst($rows->plot->block_name)}}
                  </option>
                @endforeach
                --}}
              </select>
            </div>
          </div>
        <div class="col-sm-6">
            <label class="label-color"> Select Status:</label>
            <small class="form-errors pull-right" value="">{{ $errors->first('status',":message") }}</small>
            <div class="input-group mb-3">
              <select name="status" class="form-control form-control-sm">
                <option value="{{Crypt::encrypt(0)}}">Account Status</option>
                @foreach($account_status_list as $rows)
                  @if($rows->status != "Unapprove")
                    <option value="{{Crypt::encrypt($rows->status)}}">
                  @if($rows->status == "Approve")
                <span class="badge badge-success">{{EF::getstatus($rows->status)}}</span>
              @else
                <span class="badge badge-warning"> {{$rows->status}}</span>
              @endif
              @endif
                @endforeach
              </select>
            </div>
          </div>

           <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('mode',":message") }}</small>

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

                  @php($mode_list = ['0' => 'Select Payment Mode'])

                  @foreach(EF::getPaymentMode() as $rows)
                    @php($mode_list += [$rows => $rows])
                  @endforeach

                 {{Form::select('mode', $mode_list, '' , array('class' => 'form-control form-control-sm  form-control form-control-sm -sm  cls_selection','onChange' => 'checkPaymentMode(this,"bank_payment_section")'))}}
                </div>
            </div>

          <div class="col-sm-12">
            <label class="label-color"> Select Format:</label>
            <small class="form-errors pull-right" value="">{{ $errors->first('format',":message") }}</small>
            <div class="input-group mb-3">
              <select name="format" class="form-control form-control-sm">
                <option value="0">PDF</option> 
                <option value="1">EXCEL</option>
              </select>
            </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" content="generate account report">Generate</button>
      </div>
    </div>
  </div>
  {{ Form::close() }}
</div>
<!-- END MODAL ADD BRANCH -->
