<table id="example8" class="table table-striped table-bordered " style="width:100%">
    <thead>
        <tr>
            <th>Sr.No</th>
            <th>Date</th>
            <th>Receipt No</th>
            <th>MrdNo</th>
            <th>PatientName</th>
            <th>Procedure</th>
            <th>Amount</th>
            <th>Payment Mode</th>
            <th>Cheque No</th>
            <th>Cheque Deposite On</th>
            <th>Cheque Credit Date</th>
        </tr>
    </thead>
    <tbody>
        @php $i=1;
        @endphp
        @foreach($data as $result)
        
        <tr>
            <td>{{$i}}</td>
            <td>{{date("d/m/Y", strtotime(str_replace('-', '/',$result->CreatedDate)))}}</td>
            <td>{{$result->ReceiptNo}}</td>
            <td>{{$result->MrdNo}}</td>
            <td>{{$result->PatientName}}</td>
             <td>{{$result->Procedures}}</td>
            <td>&#8377;{{number_format($result->Amount,2)}}</td>
            <td>{{$result->PayMode}}</td>
            <td>{{$result->ChequeNo}}</td>
            <td>
              @if($result->ChqDep == '' || $result->ChqDep == '0000-00-00')
              @else  
            {{date("d/m/Y", strtotime(str_replace('-', '/',$result->ChqDep)))}}
            @endif
            
        </td>
            <td>
            @if($result->ChqDate == '' || $result->ChqDate == '0000-00-00')
              @else  
            {{date("d/m/Y", strtotime(str_replace('-', '/',$result->ChqDate)))}}
            @endif
            </td>
          
        </tr>
        @php $i++;@endphp
        @endforeach
        <tr>
           
             <td>{{$i}}</td>
             <td></td>
             <td></td>
             <td></td>
             <td></td>
             <th>Total </th>
             <th>&#8377;{{number_format($sum,2)}}</th>
             
             <td></td>
             <td></td>
             <td></td>
             <td></td>
           
             
         
           
            
        </tr>
    </tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
    $('#example8').DataTable({
        "scrollX": true,
        dom: 'Bfrtip',
        buttons: [

            'excelHtml5'

        ]
    });
});
</script>