<div class="no-break" >
    <table
        style="width: 100%; border: 1px solid #000; border-collapse: collapse; ">

        <tr>
            <td></td>
            <td style="text-align: center; margin-top: 5px; ">
                <h2 style=" text-transform: uppercase; text-align: center; margin: 0;">
                    ANalisa Tanah
                </h2>
            </td>
        </tr>
    </table>

    <table style="width: 100%">
        <tr>
            @php

                $cekLuas =
                    old('luas_tanah_radio') ??
                    (isset($forminspeksi['tanah']['luas_tanah']['tidak sesuai']) ? 'tidak sesuai' : 'sesuai');

                $luasSesuai = $forminspeksi['tanah']['luas_tanah']['sesuai'] ?? null;
                $luasTidakSesuai = $forminspeksi['tanah']['luas_tanah']['tidak sesuai'] ?? null;
            @endphp
            <td width="25%" style="vertical-align: top;">Luas Tanah</td>
            <td width="1%" style="vertical-align: top;">:</td>
            <td width="" style="text-align: left">
                <table>
                    <tr>
                        <td>
                            <label>
                                <input type="radio" name="luas_tanah_radio" value="sesuai"
                                    {{ $cekLuas == 'sesuai' ? 'checked' : '' }}>
                                Sesuai {{ $luasSesuai ? '- ' . $luasSesuai . ' m²' : '' }}
                            </label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label>
                                <input type="radio" name="luas_tanah_radio" value="tidak sesuai"
                                    {{ $cekLuas == 'tidak sesuai' ? 'checked' : '' }}>
                                Tidak Sesuai {{ $luasTidakSesuai ? '- ' . $luasTidakSesuai . ' m² (luas fisik)' : '' }}
                            </label>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>

        <tr>
            <td>Hadap mata Angin</td>
            <td width="1%" style="vertical-align: top;">:</td>
            <td>
                <label>
                    <input type="radio" name="tusuk_sate" value="Ya"
                        {{ isset($forminspeksi['tanah']['hadap_mata_angin']['sesuai']) && $forminspeksi['tanah']['hadap_mata_angin']['sesuai'] ? 'checked' : '' }}>
                    sesuai

                </label>
                <label>
                    <input type="radio" name="hadap_mata_angin" value="tidak sesuai"
                        {{ isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai']) && $forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'] ? 'checked' : '' }}>
                    Tidak

                    @if (isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai']) &&
                            $forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai']
                    )
                        {{ isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai']) ? ' (' . $forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'] . ')' : '' }}
                    @endif
                </label>
            </td>
        </tr>

        <!-- Bentuk Tanah -->
        <tr>
            <td style="vertical-align: top;">Bentuk Tanah</td>
            <td width="1%" style="vertical-align: top;">:</td>
            <td>
                @if (isset($basicData['bentukTanah']))
                    <table class="checkbox-list">
                        <tr>
                            @foreach ($basicData['bentukTanah'] as $index => $item)
                                @if ($index % 3 == 0 && $index > 0)
                        </tr>
                        <tr>
                @endif
            <td class="checkbox-item">
                <label class="checkbox-label">
                    <input type="checkbox"
                        {{ isset($forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']) && in_array($item->name, $forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']) ? 'checked' : '' }}>
                    {{ $item->name }}

                    @if ($item->name == 'Lainnya')
                    {{ isset($forminspeksi['tanah']['bentuk_tanah']['lainnya']) ? ' (' . $forminspeksi['tanah']['bentuk_tanah']['lainnya'] . ')' : '' }}
                @endif
                </label>

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


    <!-- Kontur Tanah -->
    <tr>
        <td style="vertical-align: top;">Kontur Tanah</td>
        <td width="1%" style="vertical-align: top;">:</td>
        <td>
            @if (isset($basicData['konturTanah']))
                <table class="checkbox-list">
                    <tr>
                        @foreach ($basicData['konturTanah'] as $index => $item)
                            @if ($index % 3 == 0 && $index > 0)
                    </tr>
                    <tr>
            @endif
        <td class="checkbox-item">
            <label class="checkbox-label">
                <input type="checkbox"
                    {{ isset($forminspeksi['tanah']['kontur_tanah']) && in_array($item->name, $forminspeksi['tanah']['kontur_tanah']) ? 'checked' : '' }}>
                {{ $item->name }}
            </label>
        </td>
        @endforeach
    </tr>
    </table>
    @endif
    </td>
    </tr>


    <!-- Ketinggian Tanah -->
    <tr>
        <td style="vertical-align: top;">Beda Ketinggian Dengan Jalan</td>
        <td width="1%" style="vertical-align: top;">:</td>
        <td>
            @if (isset($basicData['ketinggianTanah']))
                <table class="checkbox-list">
                    <tr>
                        @foreach ($basicData['ketinggianTanah'] as $index => $item)
                            @if ($index % 3 == 0 && $index > 0)
                    </tr>
                    <tr>
            @endif
        <td class="checkbox-item">
            <label class="checkbox-label">
                <input type="checkbox"
                    {{ isset($forminspeksi['tanah']['ketinggian_tanah']['ketinggian']) && in_array($item->name, $forminspeksi['tanah']['ketinggian_tanah']['ketinggian']) ? 'checked' : '' }}>
                {{ $item->name }}

                @if ($item->name == 'Lebih Tinggi')
                    {{ isset($forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi']) ? ' (' . $forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi'] . ')' : '' }}
                @endif
                @if ($item->name == 'Lebih Rendah')
                    {{ isset($forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah']) ? ' (' . $forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah'] . ')' : '' }}
                @endif
            </label>
        </td>
        @endforeach
    </tr>
    </table>
    @endif
    </td>
    </tr>

    <tr>
        <td style="vertical-align: top;">Kontur Jalan Depan Objek</td>
        <td width="1%" style="vertical-align: top;">:</td>
        <td>
            <table>
                <tr>
                    <td>
                        <label class="form-label flex items-center gap-2.5 text-nowrap">
                            <input type="radio" class="radio" name="kontur_jalan" value="menurun"
                                {{ old('kontur_jalan', isset($forminspeksi['tanah']['kontur_jalan']) ? $forminspeksi['tanah']['kontur_jalan'] : '') == 'menurun' ? 'checked' : '' }}>
                            <span class="ml-2">Menurun</span>
                        </label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="form-label flex items-center gap-2.5 text-nowrap">
                            <input type="radio" class="radio" name="kontur_jalan" value="rata"
                                {{ old('kontur_jalan', isset($forminspeksi['tanah']['kontur_jalan']) ? $forminspeksi['tanah']['kontur_jalan'] : '') == 'rata' ? 'checked' : '' }}>
                            <span class="ml-2">Rata</span>
                        </label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="form-label flex items-center gap-2.5 text-nowrap">
                            <input type="radio" class="radio" name="kontur_jalan" value="Menanjak"
                                {{ old('kontur_jalan', isset($forminspeksi['tanah']['kontur_jalan']) ? $forminspeksi['tanah']['kontur_jalan'] : '') == 'Menanjak' ? 'checked' : '' }}>
                            <span class="ml-2">Menanjak</span>
                        </label>
                    </td>
                </tr>
            </table>

        </td>
    </tr>


    <tr>
        <td style="vertical-align: top;">Posisi Kavling</td>
        <td width="1%" style="vertical-align: top;">:</td>
        <td>
            @if (isset($basicData['posisiKavling']))
                <table class="checkbox-list">
                    <tr>
                        @foreach ($basicData['posisiKavling'] as $index => $item)
                            @if ($index % 3 == 0 && $index > 0)
                    </tr>
                    <tr>
            @endif
        <td class="checkbox-item">
            <label class="checkbox-label">
                <input type="checkbox"
                    {{ isset($forminspeksi['tanah']['posisi_kavling']['posisi_kavling']) && in_array($item->name, $forminspeksi['tanah']['posisi_kavling']['posisi_kavling']) ? 'checked' : '' }}>
                {{ $item->name }}

                @if ($item->name == 'Lainnya')
                {{ isset($forminspeksi['tanah']['posisi_kavling']['lainnya']) ? ' (' . $forminspeksi['tanah']['posisi_kavling']['lainnya'] . ')' : '' }}
            @endif
            </label>
        </td>
        @endforeach
    </tr>
    </table>
    @endif
    </td>
    </tr>

    <!-- Kondisi Fisik Tanah -->


    <tr>
        <td style="vertical-align: top;">Tusuk Sate</td>
        <td width="1%" style="vertical-align: top;">:</td>
        <td>
            <table>
                <tr>
                    <td>
                        <label>
                            <input type="radio" name="tusuk_sate" value="Ya"
                                {{ isset($forminspeksi['tanah']['tusuk_sate']['Ya']) && $forminspeksi['tanah']['tusuk_sate']['Ya'] ? 'checked' : '' }}>
                            Ya
                            @if (isset($forminspeksi['tanah']['tusuk_sate']['Ya']) && $forminspeksi['tanah']['tusuk_sate']['Ya'])
                                {{ isset($forminspeksi['tanah']['tusuk_sate']['Ya']) ? ' (' . $forminspeksi['tanah']['tusuk_sate']['Ya'] . ')' : '' }}
                            @endif
                        </label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label>
                            <input type="radio" name="tusuk_sate" value="Tidak"
                                {{ isset($forminspeksi['tanah']['tusuk_sate']['Tidak']) && $forminspeksi['tanah']['tusuk_sate']['Tidak'] ? 'checked' : '' }}>
                            Tidak
                        </label>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td style="vertical-align: top;">Lockland</td>
        <td width="1%" style="vertical-align: top;">:</td>
        <td>
            <table>
                <tr>
                    <td>
                        <label>
                            <input type="radio" name="lockland" value="yes"
                                {{ isset($forminspeksi['tanah']['lockland']) && $forminspeksi['tanah']['lockland'] == 'yes' ? 'checked' : '' }}>
                            Ya
                        </label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label>
                            <input type="radio" name="lockland" value="no"
                                {{ isset($forminspeksi['tanah']['lockland']) && $forminspeksi['tanah']['lockland'] == 'no' ? 'checked' : '' }}>
                            Tidak
                        </label>
                    </td>
                </tr>

            </table>


        </td>
    </tr>

    <tr>
        <td style="vertical-align: top;">Kondisi Fisik Tanah</td>
        <td width="1%" style="vertical-align: top;">:</td>
        <td>
            @if (isset($basicData['kondisiFisikTanah']))
                <table class="checkbox-list">
                    <tr>
                        @foreach ($basicData['kondisiFisikTanah'] as $index => $item)
                            @if ($index % 3 == 0 && $index > 0)
                    </tr>
                    <tr>
            @endif
        <td class="checkbox-item">
            <label class="checkbox-label">
                <input type="checkbox"
                    {{ isset($forminspeksi['tanah']['kondisi_fisik_tanah']['kondisi_fisik_tanah']) && in_array($item->name, $forminspeksi['tanah']['kondisi_fisik_tanah']['kondisi_fisik_tanah']) ? 'checked' : '' }}>
                {{ $item->name }}
            </label>
        </td>
        @endforeach
    </tr>
    </table>
    @endif
    </td>
    </tr>
    </table>
</div>
