
<style>
    .red {
        color: #eb4034;
    }

    .uppercase {
        text-transform: uppercase
    }

    @if(isset($isExcel))
    #tb td, #tb th {
        border: 1px solid #000000;
    }
    td {
        text-align: center;
    }

    th {
        text-align: center;
    }
    @endif
</style>
<table class="table table-striped table-bordered table-hover" id="tb">
    <tr>
        <th colspan="6" class="uppercase">Báo cáo chi tiết hiện trạng thuê</th>
    </tr>
    <tr>
        <th>STT</th>
        <th>Nhà</th>
        <th>Phòng</th>
        <th>Số chỗ</th>
        <th>Đang ở</th>
        <th>Hiện trạng</th>
    </tr>
    <tr>
        <td><strong>I</strong></td>
        <td><strong>Tất cả</strong></td>
        <td><strong>Tất cả</strong></td>
        <td>{{ $numberRoom }}</td>
        <td>{{ $numberRenterRoom }}</td>
        <td></td>

    </tr>

    @foreach($hostels as $hostel)
        @php $cnt= App\Components\Functions::getNumberRoomsHostel2($hostel); @endphp
        <tr>
            <td><strong>{{ App\Components\Functions::numberToRomanRepresentation($loop->index + 2) }}</strong></td>
            <td rowspan="{{ $hostel->rooms->count() + 1 }}">
                <strong>{{ $hostel->name }}</strong></td>
            <td><strong>Tất cả</strong></td>

            <td><strong>{{ $cnt['number_rooms'] }}</strong></td>
            <td><strong>{{ $cnt['number_used_rooms'] }}</strong></td>
            <td></td>
        </tr>
        @foreach($hostel->rooms as $room)
            @php $cnt2= App\Components\Functions::getNumberRooms($room); @endphp
            <tr>
                <td>{{ $loop->index + 1 }}</td>
                @if(isset($isExcel))
                    <td></td>
                    @endif
                <td>{{ $room->name }}</td>
                <td>{{ $room->max_renters }}</td>
                <td>{{ $cnt2['used'] }}</td>
                <td>
                    @if($hostel->type_rent == App\Models\Hostel::TYPE_RENT_EVERY)
@if($cnt2['used'] == $room->max_renters)
    Đã thuê
    @else
    Còn giường
    @endif
                        @else
                        @if($cnt2['used'] != 0)
                            Đã thuê
                        @else
                            Còn trống
                        @endif
                    @endif

                </td>
            </tr>
        @endforeach
    @endforeach
</table>