<table class="table table-striped table-bordered dt-responsive nowrap">
<tr>
    <th>Total Patient</th>
    <td>{{$total}}</td>
    <th>Male</th>
    <td>{{$male}}</td>
    <th>Female</th>
    <td>{{$female}}</td>
    <th>New Patient</th>
    <td>{{$new}}</td>
    <th>Old Patient</th>
    <td>{{$old}}</td>
    <th>Appointment</th>
    <td>{{$appointment}}</td>
</tr>
<tr>
    <th>Dialated</th>
    <td>{{$dialted}}</td>
    <th>Free</th>
    <td>{{$free}}</td>
    <th>Paid</th>
    <td>{{$paid}}</td>
    <th>&#8377;150</th>
    <td>{{$paid150}}</td>
    <th>&#8377;400</th>
    <td>{{$paid400}}</td>
    <th>&#8377;600</th>
    <td>{{$paid600}}</td>
</tr>
</table>
<table id="example2" class="table table-striped table-bordered dt-responsive nowrap" style="width:100%">
        <thead>
            <tr>
            <th>Sr.No</th>
           <th>Date</th>
           <th>Amount</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->InDate)))}}</td>
         
            <td>&#8377;{{number_format($result->Amount,2)}}</td>
            
        </tr>
        @php $i++;@endphp
        @endforeach

        <tr>
             <td>{{$i}}</td>
           
          
             <th>Total </th>
         
            <th>&#8377;{{number_format($totsum,2)}}</th>
            
        </tr>
        </tbody>
    </table>
    <script type="text/javascript">
$(document).ready(function() {
    $('#example2').DataTable({
        "scrollX": true,
        dom: 'Bfrtip',
        buttons: [

            'excelHtml5'

        ]
    });
});
</script>