<style type="text/css">
.new-bill {
    width: 95px !important;
    height: auto !important;
    line-height: 1.5 !important;
    padding: 0.275rem 0.5rem !important;
}
</style>
<div class="table-responsive">
    <table id="example" class="table table-bordered align-middle" style="width:100%">
        <thead class="table-light">
            <tr>
                <th class ="thbutton">Sl No.</th>
                <th> Reference No</th>
                <th> Case ID</th>
                <th> Patient Name</th>
                <th> Guardian Name</th>
                <th> Gender</th>
                <th> Death Date</th>
                <th> Death Time</th>
                <th> Report</th>
                <th class ="thbutton"> Edit</th>
                <th class ="thbutton"> Delete</th>
            </tr>
        </thead>
        <tbody>
            @php $i=1;@endphp
            @if($death_registers->count() > 0)
                @foreach($death_registers as $list)
                <tr>
                    <td class="text-center">{{$i++}}</td>
                    <td class="text-left">N/A</td>
                    <td class="text-left">{{$list->ipd_admission_case_id ? $list->ipd_admission_case_id : 'N/A'}}</td>
                    <td class="text-left">{{$list->patient_name ? $list->patient_name : 'N/A'}}</td>
                    <td class="text-left">{{$list->guardian_name ? $list->guardian_name : 'N/A'}}</td>
                    <td class="text-left">{{$list->gender_name ? $list->gender_name : 'N/A'}}</td>
                    <td class="text-left">{{ formatedDate($list->death_date ? $list->death_date : 'N/A')  }}</td>
                    <td class="text-left">{{ formatedTime($list->death_time ? $list->death_time : 'N/A')  }}</td>
                    <td class="text-left">{{$list->death_report ? $list->death_report : 'N/A'}}</td>

                    <td class="thbutton">
                        <a data-id="{{ $list->death_registers_id }}" class="btn btn-warning edit edit_death_register" type="button" data-bs-toggle="modal" data-bs-target="#commonModal" id="edit_death_register">
                            <i class="bi bi-pencil-square text-white"></i>
                        </a>
                    </td>

                    <td class="thbutton">
                        <a data-url="{{ route('death-registers.destroy', $list->death_registers_id) }}" class="btn btn-danger deleteDataCustom" class="text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Delete">
                            <i class="bi bi-trash text-white"></i>
                        </a>
                    </td>

                </tr>
                @endforeach
            @else 
                <tr>
                    <td colspan="10">No Data Found</td>
                </tr> 
            @endif 
</tbody>

    </table>
</div>
<nav class="mt-2 row">
    <div class="col-lg-10 col-md-10 col-10 float-start">
    </div>
    <div class="col-lg-2 col-md-2 col-2 dataTables_length" id="example_length" style="text-align: right;">
        <i class="bi bi-funnel" style=" top: 11px;left: 20px;"></i>
        <select class="form-select sorting sorting-box" id="" name="example_length" aria-controls="example" style="padding-left: 30px;">
            <option value="10">Show: 10</option>
            <option value="30">Show: 30</option>
            <option value="50">Show: 50</option>
        </select>
    </div>
</nav>
</div>
