<table id="example" class="table table-striped table-bordered dt-responsive nowrap" style="width:100%">
    <thead>
        <tr>
            <th>Vendor Name</th>
            <th>IOL Company Namer</th>
            <th>IOL Name</th>
            <th>IOL Type</th>
            <th>Power</th>
            @if($CrDr == 'D')
            <th>Sr No</th>
            <th>Bill No</th>
            <th>Bill Date</th>
            <th>Expiry Date</th>
            @endif
            <th>Quantity</th>
            <th>Amount</th>
            <th>CrDr</th>
            <th>Date</th>
            <th>Action</th>
        </tr>
    </thead>
    <tbody>

        @foreach($data as $result)

        <tr>
            <td>{{$result->VedName}}</td>
            <td>{{$result->IolCompName}}</td>
            <td>{{$result->Cname}}</td>
            <td>{{$result->Model}}</td>
            <td>{{$result->Power}}</td>
            @if($CrDr == 'D')
            <td>{{$result->SrNo}}</td>
            <td>{{$result->BillNo}}</td>
          
            @if($result->BillDate=='0000-00-00' || $result->BillDate=='')
            <td></td>
            @else
            <td>{{date("d/m/Y", strtotime(str_replace('-', '/',$result->BillDate)))}}</td>
            @endif
            <td>{{$result->ExpMonth}}/{{$result->ExpYear}}</td>
            @endif
            <td>{{$result->Quantity}}</td>
            <td>&#8377;{{number_format($result->Amount,2)}}</td>
            @if($result->CrDr == 'C')
            <td><span style='color:green;'>Credit</span></td>
            @else
            <td><span style='color:red;'>Debit</span></td>
            @endif
            <td>{{date("d/m/Y", strtotime(str_replace('-', '/',$result->StockDate)))}}</td>
            <td><a data-id="{{$result->id}}" href='javascript:void(0);' data-toggle="tooltip" data-placement="top" title="Edit" data-original-title="Edit" class="update"><i class="lnr lnr-pencil mr-2"></i></a>&nbsp;&nbsp;
             <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>

        @endforeach
    </tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
    $('#example').DataTable({
        responsive: true
    });
});
</script>