@extends('layouts.app')
@section('title', 'SMS AI Reports')
@section('content')
 

        <link rel="stylesheet" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css">

  
       <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
    <script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>

     
<section class="content">
  <div class="row">       
    <div class="col-lg-12 col-12">
        <div class="box">                        
                <div class="box-body"><!--bg-lightest-->
                    <h4 class="box-title text-info mb-0"id="show"><i class="icon-Add-user"><span class="path1"></span><span class="path2"></span></i> SMS AI Reports</h4>

                    <hr class="my-15">
             
                           
            
             

                        <div class="table-responsive">
                   
                                       <table id="smsReportTable" class="table mt-0 table-hover no-wrap">
    <thead>
        <tr>
            <th>#</th>
            <th>Number</th>
            <th>CLI</th>
            <th>Message</th>
            <th>Type</th>
            <th>SMS Type</th>
            <th>Created At</th>
            <th>Action</th>
        </tr>
    </thead>
    <tbody></tbody>
</table>
 
                                 
                        </div>
                                                
                    

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

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

    

  </section>




<script>
$(document).ready(function() {
  $('#smsReportTable').DataTable({
    processing: true,
    serverSide: false,
    ajax: "{{ url('sms-ai-report') }}", // replace with your route
    columns: [
        { data: 'DT_RowIndex', name: 'DT_RowIndex', orderable: false, searchable: false }, // index column
        { data: 'number', name: 'number',searchable: true },
        { data: 'cli', name: 'cli',searchable: true },
        { data: 'message', name: 'message',searchable: true },
        { data: 'type', name: 'type', orderable: false, searchable: false },
        { data: 'sms_type', name: 'sms_type', orderable: false, searchable: false },
        { data: 'created_at', name: 'created_at' },
        { data: 'action', name: 'action', orderable: false, searchable: false }
    ],
language: {
    processing: `
        <span style="display:flex; align-items:center; justify-content:center; gap:8px;">
            <img src="https://i.gifer.com/ZZ5H.gif"
                 alt="Loading..." style="width:20px; height:20px;">
            Processing...
        </span>
    `
}

  });
});
</script>

    <script>
      $(".openLeadDelete").click(function () {
            var delete_id = $(this).data('id');
            $("#delete").modal('show');
            $("#lead_id").val(delete_id);
        });
        $(document).on("click", ".deleteLead", function () {
            var lead_id = $('#lead_id').val();
            $.ajax({
                url: 'deleteLead/' + lead_id,
                type: 'get',
                success: function (response) {
                    window.location.reload(1);
                }
            });
        });


</script>






@endsection

