<table cellspacing="0" style="border-collapse:collapse;">
    <tbody>
    <tr style="text-align: center">
        <td style="border:1px solid; font-weight: bold; text-align: center; height: 200px; vertical-align:middle; wrap-text: true" colspan="{{ 15 + $fees->count() }}">NHẬP DỮ LIỆU HỢP ĐỒNG</td>
    </tr>
    <tr>
        <td
            style=" border:1px solid #000000; text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true  ">
            <span><span
                        style="color:#000000">Nhà</span></span></td>
        <td
            style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true ">
            <span><span
                        style="color:#000000">Phòng</span></span></td>
        <td
                style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true ">
            <span><span
                        style="color:#000000">Giường</span></span></td>
        <td
            style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true ">
            <span><span style="color:#000000">Ngày khách vào <br>
(ngày/tháng/năm)</span></span>
        </td>
        <td
            style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true">
            <span><span
                        style="color:#000000">Hạn hợp đồng <br>
(ngày/tháng/năm)</span></span></td>
        <td
            style=" border:1px solid #000000; text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true  ">
            <span><span
                        style="color:#000000">Tiền phòng</span></span></td>
        <td
                style=" border:1px solid #000000; text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true  ">
            <span><span
                        style="color:#000000">Tiền cọc</span></span></td>
        <td
                style=" border:1px solid #000000; text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true  ">
            <span><span
                        style="color:#000000">Chu kỳ thanh toán (theo tháng)</span></span></td>
        <td
                style=" border:1px solid #000000; text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true  ">
            <span><span
                        style="color:#000000">Ngày chốt tiền hàng tháng</span></span></td>
        <td
                style=" border:1px solid #000000; text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true  ">
            <span><span
                        style="color:#000000">Đã thu đến ngày<br>(ngày/tháng/năm)</span></span></td>
        <td
                style=" border:1px solid #000000; text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true  ">
            <span><span
                        style="color:#000000">SĐT khách</span></span></td>
        <td
                style=" border:1px solid #000000; text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true  ">
            <span><span
                        style="color:#000000">Họ tên khách</span></span></td>
        <td
                style=" border:1px solid #000000; text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true  ">
            <span><span
                        style="color:#000000">Email</span></span></td>
        <td
                style=" border:1px solid #000000; text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true  ">
            <span><span
                        style="color:#000000">Ngày sinh <br>(ngày/tháng/năm)</span></span></td>
        <td
                style=" border:1px solid #000000; text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true  ">
            <span><span
                        style="color:#000000">CMND</span></span></td>
        <td
                style=" border:1px solid #000000; text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true; ">
            <span><span
                        style="color:#000000">Ngày cấp <br>(ngày/tháng/năm)</span></span></td>
        <td
                style=" border:1px solid #000000; text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true  ">
            <span><span
                        style="color:#000000">Nơi cấp</span></span></td>



        @foreach($fees as $fee)
            @if(in_array($fee->type, [
                App\Models\HostelFee::ELECTRIC_DYNAMIC,
                App\Models\HostelFee::WATER_DYNAMIC,
                App\Models\HostelFee::DYNAMIC,
                App\Models\HostelFee::ELECTRIC_BY_CLOCK,
                App\Models\HostelFee::ELECTRIC,
                App\Models\HostelFee::WATER_BY_CLOCK,
                 App\Models\HostelFee::WATER,
            ]))
            <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true">
                <span><span
                            style="color:#000000">{{ $fee->name }} <br> (Số đầu)</span></span>
            </td>
            @else
                <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 200px; wrap-text: true">
                <span><span
                            style="color:#000000">{{ $fee->name }} <br/> (Số lượng)</span></span>
                </td>
                @endif
        @endforeach
    </tr>
    @for($i=1; $i<=1; $i++)
<tr>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">
        {{ $hostel->name }}
    </td>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">101</td>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">Giường 1</td>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">01/01/2022</td>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">31/12/2022</td>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">3000000</td>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">3000000</td>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">1</td>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">31</td>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">31/01/2022</td>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">0868987355</td>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">Nguyen Van A</td>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">nguyenvana@gmail.com</td>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">01/01/1990</td>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">111222333</td>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">01/01/2005</td>
    <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">Cục cảnh sát</td>
    @foreach($fees as $fee)
        <td style=" border:1px solid #000000;  text-align:center; vertical-align:middle; white-space:normal;height: 50px;">0</td>
        @endforeach

</tr>
        @endfor
    </tbody>
</table>
