<style>
.modal-body {
  overflow-y: scroll !important; /* Ensures scrolling */
  scrollbar-width: thin; /* For Firefox */
  scrollbar-color: #888 #f0f0f0; /* Scrollbar track and thumb color */
}
</style>
<script>
$(function () {
  'use strict';
    // get sent lists
  $.ajax({
    url: '/detail/stat/drip/'+{{$schedule_stat->id}}+'/summary_sent_lists',
    beforeSend: function( xhr ) {  
      $('#div-sent-lists').html('<div class="spinner-border spinner-border-sm text-dark" role="status"><span class="visually-hidden"></span></div>');
    }
  })
  .done(function( data ) {
    $('#div-sent-lists').html(data);
  });

  // get sent sending servers
  $.ajax({
    url: '/detail/stat/drip/'+{{$schedule_stat->id}}+'/summary_sent_sending_servers',
    beforeSend: function( xhr ) {  
      $('#div-sent-sending-servers').html('<div class="spinner-border spinner-border-sm text-dark" role="status"><span class="visually-hidden"></span></div>');
    }
  })
  .done(function( data ) {
    $('#div-sent-sending-servers').html(data);
  });
    // get sent
  $.ajax({
    url: '/detail/stat/drip/'+{{$schedule_stat->id}}+'/summary_sent',
    beforeSend: function( xhr ) {  
      $('#div-sent').html('<div class="spinner-border spinner-border-sm text-dark" role="status"><span class="visually-hidden"></span></div>');
    }
  })
  .done(function( data ) {
    $('#div-sent').html(data);
  });

    // get opens
  $.ajax({
    url: '/detail/stat/drip/'+{{$schedule_stat->id}}+'/summary_opens',
    beforeSend: function( xhr ) {  
      $('#div-opens').html('<div class="spinner-border spinner-border-sm text-dark" role="status"><span class="visually-hidden"></span></div>');
    }
  })
  .done(function( data ) {
    $('#div-opens').html(data);
  });

  // get clicks
  $.ajax({
    url: '/detail/stat/drip/'+{{$schedule_stat->id}}+'/summary_clicks',
    beforeSend: function( xhr ) {  
      $('#div-clicks').html('<div class="spinner-border spinner-border-sm text-dark" role="status"><span class="visually-hidden"></span></div>');
    }
  })
  .done(function( data ) {
    $('#div-clicks').html(data);
  });

  // get replies
  $.ajax({
    url: '/detail/stat/drip/'+{{$schedule_stat->id}}+'/summary_replies',
    beforeSend: function( xhr ) {  
      $('#div-clicks').html('<div class="spinner-border spinner-border-sm text-dark" role="status"><span class="visually-hidden"></span></div>');
    }
  })
  .done(function( data ) {
    $('#div-replies').html(data);
  });

  // get unsubscribed
  $.ajax({
    url: '/detail/stat/drip/'+{{$schedule_stat->id}}+'/summary_unsubscribed',
    beforeSend: function( xhr ) {  
      $('#div-unsubscribed').html('<div class="spinner-border spinner-border-sm text-dark" role="status"><span class="visually-hidden"></span></div>');
    }
  })
  .done(function( data ) {
    $('#div-unsubscribed').html(data);
  });

  // get bounces
  $.ajax({
    url: '/detail/stat/drip/'+{{$schedule_stat->id}}+'/summary_bounces',
    beforeSend: function( xhr ) {  
      $('#div-bounces').html('<div class="spinner-border spinner-border-sm text-dark" role="status"><span class="visually-hidden"></span></div>');
    }
  })
  .done(function( data ) {
    $('#div-bounces').html(data);
  });

  // get spam
  $.ajax({
    url: '/detail/stat/drip/'+{{$schedule_stat->id}}+'/summary_spam',
    beforeSend: function( xhr ) {  
      $('#div-spam').html('<div class="spinner-border spinner-border-sm text-dark" role="status"><span class="visually-hidden"></span></div>');
    }
  })
  .done(function( data ) {
    $('#div-spam').html(data);
  });
});
</script>
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable modal-lg">
<div class="modal-content">
  <div class="modal-header">
    <h6 class="modal-title">{{ $schedule_stat->drip_schedule_name }}</h6>
    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  </div>
  <div class="modal-body">
    <div class="box-body">
      <div class="col-md-12">
        <div class="row mt-2">
          <label class="col-md-3 form-label text-dark">{{ __('app.drip_group') }}</label>
          <div class="col-md-9">{{ $schedule_stat->drip_group_name}}</div>
        </div>
        <div class="row mt-2">
          <label class="col-md-3 form-label text-dark">{{ __('app.name') }}</label>
          <div class="col-md-9">{{ $schedule_stat->drip_schedule_name}}</div>
        </div>
        <div class="row mt-2">
          <label class="col-md-3 form-label text-dark">{{ __('app.scheduled_by') }}</label>
          <div class="col-md-9">{{ $schedule_stat->schedule_by}}</div>
        </div>
        <div class="row mt-2">
          <label class="col-md-3 form-label text-dark">{{ __('app.created') }}</label>
          <div class="col-md-9">{{ !empty($schedule_stat->created_at) ? \App\Http\Helper\Helper::datetimeDisplay($schedule_stat->created_at) : '---' }}</div>
        </div>
        <div class="row mt-2">
          <label class="col-md-3 form-label text-dark">{{ __('app.lists') }}</label>
          <div class="col-md-9" id="div-sent-lists"></div>
        </div>        
        <div class="row mt-2">
          <label class="col-md-3 form-label text-dark">{{ __('app.delivery_servers') }}</label>
          <div class="col-md-9" id="div-sent-sending-servers"></div>
        </div>
        <div class="row mt-2">
          <label class="col-md-3 form-label text-dark">{{ __('app.sent') }}</label>
          <div class="col-md-9" id="div-sent"></div>
        </div>
        <div class="row mt-2">
          <label class="col-md-3 form-label text-dark">{{ __('app.opens') }}</label>
          <div class="col-md-9" id="div-opens"></div>
        </div>
        <div class="row mt-2">
          <label class="col-md-3 form-label text-dark">{{ __('app.clicks') }}</label>
          <div class="col-md-9" id="div-clicks"></div>
        </div>
        <div class="row mt-2">
          <label class="col-md-3 form-label text-dark">{{ __('app.replies') }}</label>
          <div class="col-md-9" id="div-replies"></div>
        </div>
        <div class="row mt-2">
          <label class="col-md-3 form-label text-dark">{{ __('app.unsubscribed') }}</label>
          <div class="col-md-9" id="div-unsubscribed"></div>
        </div>
        <div class="row mt-2">
          <label class="col-md-3 form-label text-dark">{{ __('app.bounces') }}</label>
          <div class="col-md-9" id="div-bounces"></div>
        </div>
        <div class="row mt-2">
          <label class="col-md-3 form-label text-dark">{{ __('app.spams') }}</label>
          <div class="col-md-9" id="div-spam"></div>
        </div>
      </div>
    </div>
  </div>
  <div class="modal-footer">
    <button type="button" class="btn btn-danger" data-bs-dismiss="modal">{{__('app.close')}}</button>
    <a href="{{route('detail.stat.drip', ['id' => $schedule_stat->id])}}">
      <button type="button" class="btn btn-primary">{{ __('app.detail') }}</button>
    </a>
  </div>
</div>
</div>