<table id="example" class="table table-striped table-bordered dt-responsive nowrap" style="width:100%">
    <thead>
        <tr>
        <th>#</th>
            <th>Mrd. No</th>
            <th>Patient Name</th>
            <th>Phone</th>
            <th>Appointment Date</th>
            <th>Appointment TIme</th>
            <th>ReferFor</th>
            <th>Consultant</th>
            <th>Action</th>
        </tr>
    </thead>
    <tbody>
        @php $i=1;@endphp
        @foreach($data as $result)
        <tr>
        {{-- <td><a href="javascript:void(0)" onclick="sendMessage({{$result->id}})"><i class="ion ion-logo-whatsapp" style="color: #0fc30f;font-size: 22px;"></i></a></td> --}}
             <td>{{$i}}</td>
        <td>{{$result->MrdNo}}</td>
             <td>{{$result->PatientName}}</td>
             <td>{{$result->Phone}}</td>
             <td>{{date("d/m/Y", strtotime(str_replace('-', '/',$result->AppDate)))}}</td>
          
             <td>{{$result->AppTime}}</td>
            
             <td>{{$result->ReferFor}}</td>
             <td>{{$result->Consultant}}</td>
             
            <td>
             <a data-id="{{$result->id}}" href='javascript:void(0);' data-toggle="tooltip" data-placement="top" title="Delete" data-original-title="Delete" class="delete" id="bootbox-confirm"><i class="lnr lnr-trash text-danger"></i></a>
            </td>
            
        </tr>
        @php $i++;@endphp
        @endforeach
    </tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
    $('#example').DataTable({
      "scrollX": true,
        dom: 'Bfrtip',
        buttons: [
            'excelHtml5'
        ]
    });
});

function sendMessage(id){
    window.open(
                    '/{{projectUrl()}}sendMessage/' + id, 'name',
                    'toolbar=1, scrollbars=1, location=1,statusbar=0, menubar=1, resizable=1, width=1500, height=1000'
                );
}
</script>