<div class="no-break">
    <table style="width: 100%;  border: 1px solid #000; border-collapse: collapse; ">
        <tr>
             <td style="text-align: center; margin-top: 5px;">
                <h2 style=" text-transform: uppercase; text-align: center; margin: 0;">
                Analisa Lingkungan
            </td>
        </tr>
    </table>
    <table>
        <tr>
            <td>
                <table>
                    <tr>
                        <td width="25%">Jarak Jalan Utama</td>
                        <td width="1%" style="vertical-align: top;">:</td>
                        <td>{{ $forminspeksi['lingkungan']['jarak_jalan_utama'] ?? '' }}  {{ $forminspeksi['lingkungan']['jalan_linkungan'] ?? '' }}</td>
                    </tr>

                    <tr>
                        <td>Jarak CBD Point</td>
                        <td width="1%" style="vertical-align: top;">:</td>
                        <td>{{ $forminspeksi['lingkungan']['jarak_cbd_point'] ?? '' }} {{ $forminspeksi['lingkungan']['nama_cbd_point'] ?? '' }}</td>
                    </tr>
                    <tr>
                        <td>Lebar Perkerasan Jalan</td>
                        <td width="1%" style="vertical-align: top;">:</td>
                        <td>{{ $forminspeksi['lingkungan']['lebar_perkerasan_jalan'] ?? '' }}</td>
                    </tr>

                    <tr>
                        <td style="vertical-align: top;">Perkerasan Jalan</td>
                        <td width="1%" style="vertical-align: top;">:</td>
                        <td>
                            @if (isset($basicData['perkerasanJalan']))
                                <table class="checkbox-list">
                                    <tr>
                                        @foreach ($basicData['perkerasanJalan'] as $index => $item)
                                            @if ($index % 3 == 0 && $index > 0)
                                                </tr><tr>
                                            @endif
                                            <td class="checkbox-item">
                                                <label class="checkbox-label">
                                                    <input type="checkbox"
                                                        @checked(isset($forminspeksi['lingkungan']['perkerasan_jalan']['perkerasan_jalan']) &&
                                                                in_array($item->name, $forminspeksi['lingkungan']['perkerasan_jalan']['perkerasan_jalan']))
                                                    >
                                                    {{ $item->name }}
                                                    @if ($item->name == 'Lainnya' && !empty($forminspeksi['lingkungan']['perkerasan_jalan']['lainnya']))
                                                        ({{ $forminspeksi['lingkungan']['perkerasan_jalan']['lainnya'] }})
                                                    @endif
                                                </label>
                                            </td>
                                        @endforeach
                                    </tr>
                                </table>
                            @endif
                        </td>
                    </tr>

        <tr>
            <td style="vertical-align: top;">Lalu Lintas Depan Lokasi</td>
            <td width="1%" style="vertical-align: top;">:</td>
            <td>
                @if (isset($basicData['laluLintasLokasi']))
                    <table class="checkbox-list">
                        <tr>
                            @foreach ($basicData['laluLintasLokasi'] as $index => $item)
                                @if ($index % 3 == 0 && $index > 0)
                                    </tr><tr>
                                @endif
                                <td class="checkbox-item">
                                    <label class="checkbox-label">
                                        <input type="checkbox"
                                            @checked(isset($forminspeksi['lingkungan']['lalu_lintas'])
                                                && is_array($forminspeksi['lingkungan']['lalu_lintas'])
                                                && in_array($item->name, $forminspeksi['lingkungan']['lalu_lintas']))
                                        >
                                        {{ $item->name }}
                                    </label>
                                </td>
                            @endforeach
                        </tr>
                    </table>
                @endif
            </td>
        </tr>
        <tr>
            <td style="vertical-align: top;">Golongan Masyarakat Sekitar</td>
            <td width="1%" style="vertical-align: top;">:</td>
            <td>
                @if (isset($basicData['golMasySekitar']))
                    <table class="checkbox-list">
                        <tr>
                            @foreach ($basicData['golMasySekitar'] as $index => $item)
                                @if ($index % 3 == 0 && $index > 0)
                                    </tr><tr>
                                @endif
                                <td class="checkbox-item">
                                    <label class="checkbox-label">
                                        <input type="checkbox"
                                            @checked(isset($forminspeksi['lingkungan']['gol_mas_sekitar'])
                                                    && is_array($forminspeksi['lingkungan']['gol_mas_sekitar'])
                                                    && in_array($item->name, $forminspeksi['lingkungan']['gol_mas_sekitar']))
                                        >
                                        {{ $item->name }}
                                    </label>
                                </td>
                            @endforeach
                        </tr>
                    </table>
                @endif
            </td>
        </tr>
        <tr>
            <td style="vertical-align: top;">Tingkat Keramaian</td>
            <td width="1%" style="vertical-align: top;">:</td>
            <td>
                @if (isset($basicData['tingkatKeramaian']))
                    <table class="checkbox-list">
                        <tr>
                            @foreach ($basicData['tingkatKeramaian'] as $index => $item)
                                @if ($index % 3 == 0 && $index > 0)
                                    </tr><tr>
                                @endif
                                <td class="checkbox-item">
                                    <label class="checkbox-label">
                                        <input type="checkbox"
                                            @checked(isset($forminspeksi['lingkungan']['tingkat_keramaian']) &&
                                                     is_array($forminspeksi['lingkungan']['tingkat_keramaian']) &&
                                                     in_array($item->name, $forminspeksi['lingkungan']['tingkat_keramaian']))
                                        >
                                        {{ $item->name }}
                                    </label>
                                </td>
                            @endforeach
                        </tr>
                    </table>
                @endif
            </td>
        </tr>
        <tr>
            <td style="vertical-align: top;">Terletak Di Area</td>
            <td width="1%" style="vertical-align: top;">:</td>
            <td>
                @if (isset($basicData['terletakDiArea']))
                    <table class="checkbox-list">
                        <tr>
                            @foreach ($basicData['terletakDiArea'] as $index => $item)
                                @if ($index % 3 == 0 && $index > 0)
                                    </tr><tr>
                                @endif
                                <td class="checkbox-item">
                                    <label class="checkbox-label">
                                        <input type="checkbox"
                                            @checked(isset($forminspeksi['lingkungan']['terletak_diarea']['terletak_diarea']) &&
                                                    in_array($item->name, $forminspeksi['lingkungan']['terletak_diarea']['terletak_diarea'] ?? []))
                                        >
                                        {{ $item->name }}
                                        @if ($item->name == 'Lainnya' && !empty($forminspeksi['lingkungan']['terletak_diarea']['lainnya']))
                                            ({{ $forminspeksi['lingkungan']['terletak_diarea']['lainnya'] }})
                                        @endif
                                    </label>
                                </td>
                            @endforeach
                        </tr>
                    </table>
                @endif
            </td>
        </tr>
        <tr>
            <td style="vertical-align: top;">Disekitar Lokasi</td>
            <td width="1%" style="vertical-align: top;">:</td>
            <td>
                <div class="checkbox-item">
                    <label class="checkbox-label">
                        <input type="radio" name="disekitar_lokasi" value="Telah ada bangunan"
                            {{ ($forminspeksi['lingkungan']['disekitar_lokasi'] ?? '') == 'ya' ? 'checked' : '' }}>
                            Telah ada bangunan
                            @if (($forminspeksi['lingkungan']['disekitar_lokasi'] ?? '') == 'ya')
                                - Kondisi Bangunan:
                                {{ $forminspeksi['lingkungan']['kondisi_bagunan_disekitar_lokasi'] ?? '' }}
                                , Sifat Bangunan:
                                {{ $forminspeksi['lingkungan']['sifat_bagunan_disekitar_lokasi'] ?? '' }}
                            @endif
                    </label>
                    <label class="checkbox-label">
                        <input type="radio" name="disekitar_lokasi" value="Belum ada bangunan"
                            {{ ($forminspeksi['lingkungan']['disekitar_lokasi'] ?? '') == 'tidak' ? 'checked' : '' }}>
                        Belum ada bangunan
                    </label>
                </div>
            </td>
        </tr>

        <tr>
            <td style="vertical-align: top;">Dekat Makam</td>
            <td width="1%" style="vertical-align: top;">:</td>
            <td>
                <div class="checkbox-item">
                    <label class="checkbox-label">
                        <input type="radio" name="disekitar_lokasi" value="ya"
                            {{ ($forminspeksi['lingkungan']['dekat_makam'] ?? '') == 'ya' ? 'checked' : '' }}>
                        Ya
                        @if (($forminspeksi['lingkungan']['dekat_makam'] ?? '') == 'ya')
                            - Nama Makam: {{ $forminspeksi['lingkungan']['nama_makam'] ?? '' }}
                            , Jarak Makam: {{ $forminspeksi['lingkungan']['jarak_makam'] ?? '' }}
                        @endif
                    </label>
                    <label class="checkbox-label">
                        <input type="radio" name="disekitar_lokasi" value="tidak"
                            {{ ($forminspeksi['lingkungan']['dekat_makam'] ?? '') == 'tidak' ? 'checked' : '' }}>
                        Tidak
                    </label>
                </div>
            </td>
        </tr>

        <tr>
            <td style="vertical-align: top;">Dekat TPS</td>
            <td width="1%" style="vertical-align: top;">:</td>
            <td>
                <div class="checkbox-item">
                    <label class="checkbox-label">
                        <input type="radio" name="disekitar_lokasi" value="ya"
                            {{ ($forminspeksi['lingkungan']['dekat_tps'] ?? '') == 'ya' ? 'checked' : '' }}>
                        Ya
                        @if (($forminspeksi['lingkungan']['dekat_tps'] ?? '') == 'ya')
                            - Nama TPS:
                            {{ $forminspeksi['lingkungan']['nama_tps'] ?? '' }}
                            , Jarak TPS:
                            {{ $forminspeksi['lingkungan']['jarak_tps'] ?? '' }}

                        @endif
                    </label>
                    <label class="checkbox-label">
                        <input type="radio" name="disekitar_lokasi" value="tidak"
                            {{ ($forminspeksi['lingkungan']['dekat_tps'] ?? '') == 'tidak' ? 'checked' : '' }}>
                        Tidak
                    </label>
                </div>
            </td>
        </tr>

        <tr>
            <td style="vertical-align: top;">Dekat Lainnya</td>
            <td width="1%" style="vertical-align: top;">:</td>
            <td>{{ $forminspeksi['lingkungan']['dekat_lainnya'] ?? '' }}</td>
        </tr>

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

        <tr>
            <td style="vertical-align: top;">Fasilitas Umum Dekat Lokasi</td>
            <td width="1%" style="vertical-align: top;">:</td>
            <td style="vertical-align: top;">
                @if (isset($basicData['fasilitasObjek']))
                    <table class="checkbox-list">
                        <tr>
                            @foreach ($basicData['fasilitasObjek'] as $index => $item)
                                @if ($index % 3 == 0 && $index > 0)
                                    </tr><tr>
                                @endif
                                <td class="checkbox-item">
                                    <label class="checkbox-label">
                                        <input type="checkbox"
                                            @checked(isset($forminspeksi['lingkungan']['fasilitas_dekat_object_input'][$item->name]) &&
                                                    $forminspeksi['lingkungan']['fasilitas_dekat_object_input'][$item->name]))
                                        >
                                        {{ $item->name }}
                                        @if (!empty($forminspeksi['lingkungan']['fasilitas_dekat_object_input'][$item->name]))
                                            ({{ $forminspeksi['lingkungan']['fasilitas_dekat_object_input'][$item->name] }})
                                        @endif
                                    </label>
                                </td>
                            @endforeach
                        </tr>
                    </table>
                @endif
            </td>
        </tr>
    </table>
</div>
