<?php 
    $i = 0;
    $pegawai_link = ''; 
    $last_periksa_id = $borangulas?->id;
    ?>
    <div class="row">
@foreach($permohonan->ulasanIk as $ulasan)
    <?php 
    $i++;
    $last_periksa_id = $ulasan->id;
    ?> 
        <div class="col-md-6 col-sm-12">
          <div class="card card-round">
            <div class="card-body">
                <div class="row">
                    <div class="col-12">
                        <a href="{{route('admin.papar-pemeriksaan-lepas', ['id'=>$mohon_id, 'borang_ik_id'=>$ulasan->id])}}" class="btn btn-secondary mt-2">Lawatan {{$i}}</a>
                        <a href="{{route('admin.papar-cadangan-pegawai', [$mohon_id, $ulasan->id])}}" class="btn btn-info mt-2">Cadangan Pegawai</a>
                        <a href="{{route('admin.papar-ulasan-cadangan-pengarah', [$mohon_id, $ulasan->id])}}" class="btn btn-info mt-2">Ulasan Pengarah</a>
                    </div>
                </div>
                <div class="row mt-3">
                    <div class="col-auto">
                        <a href="{{route('admin.cetak-pemeriksaan-lepas', ['id'=>$mohon_id, 'borang_ik_id'=>$ulasan->id])}}" class="btn btn-success mtx-2"><i class="fa fa-file-pdf-o"></i> Cetak Lawatan {{$i}}</a>
                        @if(!is_null($ulasan->ulasanPegawai))
                        <a href="{{route('admin.cetak-cadangan-pegawai', [$mohon_id, $ulasan->id])}}" class="btn btn-success mtx-2"><i class="fa fa-file-pdf-o"></i> Cetak Ulasan Pegawai</a>
                        @endif
                    </div>
                </div>
            </div>
          </div>
        </div>

@endforeach
    </div>
@if(auth()->user()->hasRole(['pp kesihatan', 'super'])&&($status_progress == 'lawatan tapak')&&($borangulas?->id == $last_periksa_id))    
<form action="{{route('ik.simpan-ulasan')}}" method="post" enctype="multipart/form-data">
    @csrf
    <input type="hidden" name="permohonan_id" value="{{$mohon_id}}">
    <input type="hidden" name="borang_ik_id" value="{{$borangulas?->id}}">
    <div class="row">
        <div class="col-12">
          <div class="card card-round">
            <div class="card-header">
              <div class="card-head-row card-tools-still-right">
                <h4 class="card-title px-3">Ulasan Pemeriksaan Tapak</h4>
              </div>
            </div> <!-- /.card-header -->
            <div class="card-body">
                    <div class="row">
                        <div class="col-md-3">
                            <div class="mb-3">
                                <label for="dt_periksa">Tarikh Pemeriksaan</label>
                                <input id="dt_periksa" class="form-control" type="date" name="dt_periksa" value="{{ old('dt_periksa', $borangulas?->dt_periksa) }}" autofocus autocomplete="dt_periksa"/>
                            </div>
                        </div> 
                            @if(auth()->user()->role == 'super')
                        <div class="col-md-3">
                                <label for="ik_id">Nama Pemeriksa</label>
                            <select name="ik_id" id="ik_id" class="form-control form-select">
                                <option value="">Pilih Pen Peg Kesihatan</option>
                                @foreach($iks as $ik)
                                    <option value="{{$ik->id}}">{{$ik->name}}</option>
                                @endforeach
                            </select>
                        </div> 
                            @endif
                    </div>
                    <div class="row">
                        <div class="col-md-4 mb-3">
                                <label for="latitude">a&#41; Lokasi Tempat berniaga</label>                                
                                <div class="form-check"> 
                                    <input class="form-check-input" type="radio" id="lokasi_niaga_sesuai" name="kesesuaian_lokasi" value="sesuai" 
                                    @if($borangulas?->kesesuaian_lokasi == 'sesuai')
                                        {{'checked'}}
                                    @endif> 
                                    <label class="form-check-label" for="lokasi_niaga_sesuai">Sesuai</label>      
                                </div>                       
                                <div class="form-check"> 
                                    <input class="form-check-input" type="radio" id="lokasi_niaga_tak_sesuai" name="kesesuaian_lokasi" value="tidak sesuai"
                                    @if($borangulas?->kesesuaian_lokasi == 'tidak sesuai')
                                        {{'checked'}}
                                    @endif> 
                                    <label class="form-check-label" for="lokasi_niaga_tak_sesuai">Tidak sesuai, kerana</label> 
                                    <textarea class="form-control" name="kesesuaian_lokasi_sebab" id="lokasi_niaga_taksesuai_sebab">{{ old('kesesuaian_lokasi_sebab', $borangulas?->kesesuaian_lokasi_sebab) }}</textarea> 
                                </div>
                                
                        </div>
                        <div class="col-md-3 mb-3">
                                <label for="latitude">b&#41; Perniagaan dijalankan oleh</label>                                
                                <div class="form-check"> 
                                    <input class="form-check-input" type="radio" id="dijalankan_oleh" name="dijalankan_oleh" value="pemohon/pelesen"
                                    @if($borangulas?->dijalankan_oleh == 'pemohon/pelesen')
                                        {{'checked'}}
                                    @endif> 
                                    <label class="form-check-label" for="dijalankan_oleh">Pemohon/Pelesen</label>      
                                </div>                       
                                <div class="form-check"> 
                                    <input class="form-check-input" type="radio" id="dijalankan_oleh_oranglain" name="dijalankan_oleh" value="orang lain"
                                    @if($borangulas?->dijalankan_oleh == 'orang lain')
                                        {{'checked'}}
                                    @endif> 
                                    <label class="form-check-label" for="dijalankan_oleh_oranglain">Orang Lain</label> 
                                </div>
                        </div>
                        <div class="col-md-5 mb-3">
                            <label for="latitude">c&#41; Pematuhan syarat</label>                                
                            <div class="form-check"> 
                                <input class="form-check-input" type="radio" id="pematuhan_syarat" name="pematuhan_syarat" value="telah dipatuhi"
                                    @if($borangulas?->pematuhan_syarat == 'telah dipatuhi')
                                        {{'checked'}}
                                    @endif> 
                                <label class="form-check-label" for="pematuhan_syarat">Telah dipatuhi</label>      
                            </div>                       
                            <div class="form-check"> 
                                <input class="form-check-input" type="radio" id="pematuhan_syarat_tak" name="pematuhan_syarat" value="belum dipatuhi"
                                    @if($borangulas?->pematuhan_syarat == 'belum dipatuhi')
                                        {{'checked'}}
                                    @endif> 
                                <label class="form-check-label" for="pematuhan_syarat_tak">Belum dipatuhi</label> <br />
                                Perkara yang perlu dipatuhi :
                                <textarea class="form-control" name="perkara_perlu_dipatuhi" id="perkara_perlu_dipatuhi">{{ old('perkara_perlu_dipatuhi', $borangulas?->perkara_perlu_dipatuhi) }}</textarea> 
                            </div>
                        </div>
                    </div> 
                    <div class="row">
                        <div class="col-md-4 mb-3">
                            <div class="row">
                                <div class="col-md-12">
                                    <label>d&#41; Pemprosesan makanan ditempat berniaga</label>                                
                                    <div class="form-check"> 
                                        <input class="form-check-input" type="radio" id="pemprosesan_makanan" name="pemprosesan_makanan" value="tiada"
                                    @if($borangulas?->pemprosesan_makanan == 'tiada')
                                        {{'checked'}}
                                    @endif > 
                                        <label class="form-check-label" for="pemprosesan_makanan">Tiada (Hanya membungkus/menjual sahaja)</label>      
                                    </div>                       
                                    <div class="form-check"> 
                                        <input class="form-check-input" type="radio" id="pemprosesan_makanan_tak" name="pemprosesan_makanan" value="ada"
                                    @if($borangulas?->pemprosesan_makanan == 'ada')
                                        {{'checked'}}
                                    @endif> 
                                        <label class="form-check-label" for="pemprosesan_makanan_tak">Ada</label> 
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <strong>Jika ada:</strong>
                                    <table class="table mt-1">
                                        <tbody>
                                            <tr>
                                                <td>Memasak makanan</td>
                                                <td>      
                                                    <div class="form-check"> 
                                                        <input class="form-check-input" type="checkbox" id="pemprosesan_makanan_memasak" name="pemprosesan_makanan_memasak" value="1"
                                                        @if($borangulas?->pemprosesan_makanan_memasak == '1')
                                                            {{'checked'}}
                                                        @endif>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Merebus makanan</td>
                                                <td>      
                                                    <div class="form-check"> 
                                                        <input class="form-check-input" type="checkbox" id="pemprosesan_makanan_merebus" name="pemprosesan_makanan_merebus" value="1"
                                                        @if($borangulas?->pemprosesan_makanan_merebus == '1')
                                                            {{'checked'}}
                                                        @endif>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Menggoreng makanan</td>
                                                <td>      
                                                    <div class="form-check"> 
                                                        <input class="form-check-input" type="checkbox" id="pemprosesan_makanan_menggoreng" name="pemprosesan_makanan_menggoreng" value="1"
                                                        @if($borangulas?->pemprosesan_makanan_menggoreng == '1')
                                                            {{'checked'}}
                                                        @endif>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Lain-lain
                                                        <input type="text" class="form-control" id="pemprosesan_makanan_lain_txt" name="pemprosesan_makanan_lain_txt"
                                                        value="{{ old('pemprosesan_makanan_lain_txt', $borangulas?->pemprosesan_makanan_lain_txt) }}" />
                                                </td>
                                                <td>      
                                                    <div class="form-check"> 
                                                        <input class="form-check-input" type="checkbox" id="pemprosesan_makanan_lain" name="pemprosesan_makanan_lain" value="1"
                                                        @if($borangulas?->pemprosesan_makanan_lain == '1')
                                                            {{'checked'}}
                                                        @endif>
                                                    </div>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>    
                            <div class="row">
                                <div class="col-md-12">
                                    <label for="latitude">e&#41; Mendirikan bangunan/warung</label>                                
                                    <div class="form-check"> 
                                        <input class="form-check-input" type="radio" id="mendirikan_bangunan" name="mendirikan_bangunan" value="tiada"
                                                    @if($borangulas?->mendirikan_bangunan == 'tiada')
                                                        {{'checked'}}
                                                    @endif> 
                                        <label class="form-check-label" for="mendirikan_bangunan">Tiada (Hanya payung/meja sahaja)</label>      
                                    </div>                       
                                    <div class="form-check"> 
                                        <input class="form-check-input" type="radio" id="mendirikan_bangunan_tidak" name="mendirikan_bangunan" value="ada"
                                                    @if($borangulas?->mendirikan_bangunan == 'ada')
                                                        {{'checked'}}
                                                    @endif> 
                                        <label class="form-check-label" for="mendirikan_bangunan_tidak">Ada</label> 
                                    </div>
                                </div>
                            </div>                            
                        </div>
                        <div class="col-md-4 mb-3">
                            <div class="row">
                                <div class="col-md-12">
                                    f&#41; Jika menggunakan kenderaan:
                                    <table class="table mt-1">
                                        <tbody>
                                            <tr>
                                                <td>Motosikal</td>
                                                <td>      
                                                    <div class="form-check"> 
                                                        <input class="form-check-input" type="radio" id="jika_guna_kenderaan_moto" name="jika_guna_kenderaan" value="motosikal"
                                                        @if($borangulas?->jika_guna_kenderaan == 'motosikal')
                                                            {{'checked'}}
                                                        @endif>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Kereta/Van</td>
                                                <td>      
                                                    <div class="form-check"> 
                                                        <input class="form-check-input" type="radio" id="jika_guna_kenderaan_kereta" name="jika_guna_kenderaan" value="kereta/van"
                                                        @if($borangulas?->jika_guna_kenderaan == 'kereta/van')
                                                            {{'checked'}}
                                                        @endif>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Lori</td>
                                                <td>      
                                                    <div class="form-check"> 
                                                        <input class="form-check-input" type="radio" id="jika_guna_kenderaan_lori" name="jika_guna_kenderaan" value="lori"
                                                        @if($borangulas?->jika_guna_kenderaan == 'lori')
                                                            {{'checked'}}
                                                        @endif>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Basikal</td>
                                                <td>      
                                                    <div class="form-check"> 
                                                        <input class="form-check-input" type="radio" id="jika_guna_kenderaan_basikal" name="jika_guna_kenderaan" value="basikal"
                                                        @if($borangulas?->jika_guna_kenderaan == 'basikal')
                                                            {{'checked'}}
                                                        @endif>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>                                                   
                                                        Lain-lain
                                                        <input type="text" class="form-control" id="jenis_kenderaan_lain" name="jenis_kenderaan_lain" value="{{ old('jenis_kenderaan_lain', $borangulas?->jenis_kenderaan_lain) }}" />
                                                     </td>
                                                <td>      
                                                    <div class="form-check"> 
                                                        <input class="form-check-input" type="radio" id="jika_guna_kenderaan_lain" name="jika_guna_kenderaan" value="lain-lain"
                                                        @if($borangulas?->jika_guna_kenderaan == 'lain-lain')
                                                            {{'checked'}}
                                                        @endif>
                                                    </div>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    <div class="form-group">
                                        <label for="no_fail_lesen">No. Pendaftaran Kenderaan</label>
                                        <input type="text" class="form-control" id="no_plate_kenderaan" name="no_plate_kenderaan" value="{{ old('no_plate_kenderaan', $borangulas?->no_plate_kenderaan) }}" />
                                    </div>
                                </div>
                            </div>            
                        </div>
                        <div class="col-md-4 mb-3">  
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="no_fail_lesen">g&#41; Tarikh mula berniaga</label>
                                        <input type="date" class="form-control" id="dt_mula_niaga" name="dt_mula_niaga" value="{{ old('dt_mula_niaga', $borangulas?->dt_mula_niaga) }}" />
                                    </div>
                                    <div class="form-group">
                                        <label for="no_fail_lesen">Masa berniaga</label>
                                        <input type="text" class="form-control" id="masa_berniaga_mula" name="masa_berniaga_mula" value="{{ old('masa_berniaga_mula', $borangulas?->masa_berniaga_mula) }}" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    h&#41; Kebersihan semasa berniaga:
                                    <table class="table mt-1">
                                        <tbody>
                                            <tr>
                                                <td>Kebersihan diri</td>
                                                <td>
                                                    <div class="form-check">
                                                        <input class="form-check-input" type="radio" name="kebersihan_diri" id="kebersihan_diri" value="memuaskan"
                                                    @if($borangulas?->kebersihan_diri != 'tidak')
                                                        {{'checked'}}
                                                    @endif />
                                                        <label class="form-check-label" for="kebersihan_diri" >Memuaskan</label>
                                                    </div>
                                                    <div class="form-check">
                                                        <input class="form-check-input" type="radio" name="kebersihan_diri" id="kebersihan_diri_tidak" value="tidak"
                                                    @if($borangulas?->kebersihan_diri == 'tidak')
                                                        {{'checked'}}
                                                    @endif />
                                                        <label class="form-check-label" for="kebersihan_diri_tidak" >Tidak</label>                                                            
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Kebersihan makanan</td>
                                                <td>
                                                    <div class="form-check">
                                                        <input class="form-check-input" type="radio" name="kebersihan_makanan" id="kebersihan_makanan" value="memuaskan"
                                                    @if($borangulas?->kebersihan_makanan != 'tidak')
                                                        {{'checked'}}
                                                    @endif  />
                                                        <label class="form-check-label" for="kebersihan_makanan" >Memuaskan</label>
                                                    </div>
                                                    <div class="form-check">
                                                        <input class="form-check-input" type="radio" name="kebersihan_makanan" id="kebersihan_makanan_tidak" value="tidak"
                                                    @if($borangulas?->kebersihan_makanan == 'tidak')
                                                        {{'checked'}}
                                                    @endif  />
                                                        <label class="form-check-label" for="kebersihan_makanan_tidak" >Tidak</label>                                                            
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Kebersihan kawasan</td>
                                                <td>
                                                    <div class="form-check">
                                                        <input class="form-check-input" type="radio" name="kebersihan_kawasan" id="kebersihan_kawasan" value="memuaskan"
                                                    @if($borangulas?->kebersihan_kawasan != 'tidak')
                                                        {{'checked'}}
                                                    @endif  />
                                                        <label class="form-check-label" for="kebersihan_kawasan" >Memuaskan</label>
                                                    </div>
                                                    <div class="form-check">
                                                        <input class="form-check-input" type="radio" name="kebersihan_kawasan" id="kebersihan_kawasan_tidak" value="tidak"
                                                    @if($borangulas?->kebersihan_kawasan == 'tidak')
                                                        {{'checked'}}
                                                    @endif  />
                                                        <label class="form-check-label" for="kebersihan_kawasan_tidak" >Tidak</label>                                                            
                                                    </div>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div> 
                    <div class="row">
                        <div class="col-md-12 mb-3">
                            <div class="form-group">
                                <label for="no_fail_lesen">i&#41; Laporan kebersihan kawasan/tapak selepas berniaga</label>
                                <textarea class="form-control" id="laporan_kebersihan_selepas_niaga" name="laporan_kebersihan_selepas_niaga" rows="2">{{ old('laporan_kebersihan_selepas_niaga', $borangulas?->laporan_kebersihan_selepas_niaga) }}</textarea>
                            </div>
                        </div>
                    </div> 
            </div>
          </div>
        </div> <!-- /.col -->               
    </div> <!--end::Row-->
    
    <div class="row">
        <div class="col-12">
          <div class="card card-round">
            <div class="card-header">
              <div class="card-head-row card-tools-still-right">
                <h4 class="card-title">Gambar Lokasi Lawatan Tapak</h4>
              </div>
            </div> <!-- /.card-header -->
            <div class="card-body">
                <div class="row">
                    <div class="col-4">
                        <div class="form-group">
                            <label for="gambar1">Gambar 1</label>
                            <input type="file" class="form-control" id="gambar1" name="gambar1"  />
                        </div>
                    </div>
                    <div class="col-4">
                        <div class="form-group">
                            <label for="gambar2">Gambar 2</label>
                            <input type="file" class="form-control" id="gambar2" name="gambar2"  />
                        </div>
                    </div>
                    <div class="col-4">
                        <div class="form-group">
                            <label for="gambar3">Gambar 3</label>
                            <input type="file" class="form-control" id="gambar3" name="gambar3"  />
                        </div>
                    </div>
                </div>

            </div>          
          </div>
        </div> <!-- /.col -->               
    </div> <!--end::Row-->
    <div class="row">
        <div class="col-12">
          <div class="card card-round">
            <div class="card-header">
              <div class="card-head-row card-tools-still-right">
                <h4 class="card-title">Cadangan</h4>
              </div>
            </div> <!-- /.card-header -->
            <div class="card-body">
                <table class="table mt-1">
                    <tbody>
                        <tr>
                            <td>
                                <div class="form-check">
                                    <input class="form-check-input" type="radio" id="cadangan_tiada_halangan" name="cadangan" value="tiada halangan"
                                                    @if($borangulas?->cadangan == 'tiada halangan')
                                                        {{'checked'}}
                                                    @endif >
                                    <label class="form-check-label" for="cadangan_tiada_halangan" ><strong>Tiada halangan</strong> dengan syarat :</label> 
                                    <textarea class="form-control" name="tiada_halangan_syarat" id="tiada_halangan_syarat" rows="2">{{ old('tiada_halangan_syarat', $borangulas?->tiada_halangan_syarat) }}</textarea>
                                </div>
                                <div class="row">
                                    <div class="col-1">&nbsp;</div>
                                    <div class="col-sm-11">
                                        <div class="form-check">
                                            <input class="form-check-input" type="checkbox" name="tiada_halangan_notis_dipatuhi" id="tiada_halangan_notis_dipatuhi" value="1"
                                                    @if($borangulas?->tiada_halangan_notis_dipatuhi == '1')
                                                        {{'checked'}}
                                                    @endif  />
                                            <label class="form-check-label" for="tiada_halangan_notis_dipatuhi" >Notis yang telah dikeluarkan perlu dipatuhi</label>
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="form-check">
                                    <input class="form-check-input" type="radio" id="cadangan_tidak_menyokong" name="cadangan" value="tidak menyokong"
                                                    @if($borangulas?->cadangan == 'tidak menyokong')
                                                        {{'checked'}}
                                                    @endif >
                                    <label class="form-check-label" for="cadangan_tidak_menyokong" ><strong>Tidak menyokong</strong> atas sebab : </label>
                                    <textarea class="form-control" id="tidak_menyokong_atas_sebab" id="tidak_menyokong_atas_sebab" rows="2">{{ old('tidak_menyokong_atas_sebab', $borangulas?->tidak_menyokong_atas_sebab) }}</textarea>
                                </div>
                                <div class="row">
                                    <div class="col-1">&nbsp;</div>
                                    <div class="col-sm-11">
                                        <div class="form-check">
                                            <input class="form-check-input" type="checkbox" name="dirujuk_unit_penguatkuasa" id="dirujuk_unit_penguatkuasa" value="1"
                                                    @if($borangulas?->dirujuk_unit_penguatkuasa == '1')
                                                        {{'checked'}}
                                                    @endif  />
                                            <label class="form-check-label" for="dirujuk_unit_penguatkuasa" >Dirujuk Jabatan Penguatkuasa untuk tindakan : </label>
                                            <textarea class="form-control" id="dirujuk_unit_penguatkuasa_txt" name="dirujuk_unit_penguatkuasa_txt" rows="2">{{ old('dirujuk_unit_penguatkuasa_txt', $borangulas?->dirujuk_unit_penguatkuasa_txt) }}</textarea>
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="form-check">
                                    <input class="form-check-input" type="radio" id="cadangan_tiada_halangan" name="cadangan" value="permohonan / lesen dibatalkan kerana tamat perniagaan"
                                                    @if($borangulas?->cadangan == 'permohonan / lesen dibatalkan kerana tamat perniagaan')
                                                        {{'checked'}}
                                                    @endif >
                                    <label class="form-check-label" for="cadangan_tiada_halangan" ><strong>Permohonan/Lesen dibatalkan</strong> kerana tamat perniagaan</label>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>          
          </div>
        </div> <!-- /.col -->               
    </div> <!--end::Row-->
    <div class="row justify-content-center">
        <div class="col-12">
                <input id="simpan" class="btn btn-secondary" type="submit" name="simpan" value="Simpan"/>
        </div> <!-- /.col -->               
    </div> <!--end::Row-->
</form>

@section('js')
  <!-- Select2 -->
    <script src="{{ asset('plugins/select2/js/select2.full.min.js') }}"></script>
@endsection

@else
    <div class="row">
        <div class="col-12">
          <div class="card card-round">
            <div class="card-header">
              <div class="card-head-row card-tools-still-right">
                <h4 class="card-title">Ulasan Pemeriksaan Tapak</h4>
              </div>
            </div> <!-- /.card-header -->
            <div class="card-body">
                    <div class="row">
                        <div class="col-md-3">
                            <div class="mb-3">
                                <label for="dt_periksa">Tarikh Pemeriksaan</label>
                                <input id="dt_periksa" class="form-control" type="date" name="dt_periksa" value="{{ old('dt_periksa', $borangulas?->dt_periksa) }}" autofocus autocomplete="dt_periksa" readonly />
                            </div>
                        </div> 
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="row">
                                <div class="col-md-12 mb-3">
                                    <label for="latitude">a&#41; Lokasi Tempat berniaga</label>  
                                    @if($borangulas?->kesesuaian_lokasi == 'sesuai')
                                        <input class="form-control" type="text" id="lokasi_niaga_sesuai" name="kesesuaian_lokasi" value="{{$borangulas?->kesesuaian_lokasi}}" readonly> 
                                    @else
                                        <textarea class="form-control" name="kesesuaian_lokasi_sebab" id="lokasi_niaga_taksesuai_sebab" readonly>{{$borangulas?->kesesuaian_lokasi}} kerana {{$borangulas?->kesesuaian_lokasi_sebab}}</textarea> 
                                        @endif                                
                                </div>
                                <div class="col-md-12 mb-3">
                                    <label for="latitude">b&#41; Perniagaan dijalankan oleh</label>  
                                    <input class="form-control" type="text" id="dijalankan_oleh" name="dijalankan_oleh" value="{{$borangulas?->dijalankan_oleh}}" readonly>      
                                </div>                           
                            </div>                       
                        </div>
                        <div class="col-md-6 mb-3">
                            <label for="latitude">c&#41; Pematuhan syarat</label>      
                            <input class="form-control" type="text" id="pematuhan_syarat" name="pematuhan_syarat" value="{{$borangulas?->pematuhan_syarat}}" readonly >                       
                            @if($borangulas?->pematuhan_syarat == 'belum dipatuhi')
                                <p class="mt-2">Perkara yang perlu dipatuhi :
                                <textarea class="form-control" name="perkara_perlu_dipatuhi" id="perkara_perlu_dipatuhi" readonly>{{$borangulas?->perkara_perlu_dipatuhi}}</textarea> </p>
                            @endif
                        </div>
                    </div> 
                    <div class="row">
                        <div class="col-md-4 mb-3">
                            <div class="row">
                                <div class="col-md-12">
                                    <label for="latitude">d&#41; Pemprosesan makanan ditempat berniaga</label>                                
                                    <div class="form-group"> 
                                    @if($borangulas?->pemprosesan_makanan == 'tiada')
                                        <input class="form-control" type="text" id="pemprosesan_makanan" name="pemprosesan_makanan" value="Tiada (Hanya membungkus/menjual sahaja)" readonly>  
                                    @else
                                        <input class="form-control" type="text" id="pemprosesan_makanan" name="pemprosesan_makanan" value="Ada" readonly>  
                                    @endif                                            
                                    </div>    
                                </div>
                                    @if($borangulas?->pemprosesan_makanan == 'ada')
                                    <?php
                                                $hijau_memasak = '';
                                                $ikon_memasak = '';          
                                                $hijau_merebus = '';
                                                $ikon_merebus = '';          
                                                $hijau_menggoreng = '';
                                                $ikon_menggoreng = '';          
                                                $hijau_lain = '';
                                                $ikon_lain = '';
                                            if($borangulas?->pemprosesan_makanan_memasak == '1'){
                                                $hijau_memasak = 'class="table-success"';
                                                $ikon_memasak = '<i class="far fa-check-square fa-lg"></i>';
                                            }

                                            if($borangulas?->pemprosesan_makanan_merebus == '1'){ 
                                                $hijau_merebus = 'class="table-success"';
                                                $ikon_merebus = '<i class="far fa-check-square fa-lg"></i>';
                                            }

                                            if($borangulas?->pemprosesan_makanan_menggoreng == '1'){
                                                $hijau_menggoreng = 'class="table-success"';
                                                $ikon_menggoreng = '<i class="far fa-check-square fa-lg"></i>';
                                            }

                                            if($borangulas?->pemprosesan_makanan_lain == '1'){ 
                                                $hijau_lain = 'class="table-success"';
                                                $ikon_lain = '<i class="far fa-check-square fa-lg"></i>';
                                            }
                                    ?>
                                <div class="col-md-12">
                                    <table class="table mt-1">
                                        <tbody>
                                            <tr {!!$hijau_memasak!!}>
                                                <td>Memasak makanan</td>
                                                <td>
                                                    {!!$ikon_memasak!!}
                                                </td>
                                            </tr>
                                            <tr {!!$hijau_merebus!!}>
                                                <td>Merebus makanan</td>
                                                <td>
                                                    {!!$ikon_merebus!!}
                                                </td>
                                            </tr>
                                            <tr {!!$hijau_menggoreng!!}>
                                                <td>Menggoreng makanan</td>
                                                <td>
                                                    {!!$ikon_menggoreng!!}
                                                </td>
                                            </tr>
                                            <tr {!!$hijau_lain!!}>
                                                <td>Lain-lain
                                                        <input type="text" class="form-control" id="pemprosesan_makanan_lain_txt" name="pemprosesan_makanan_lain_txt"
                                                        value="{{ old('pemprosesan_makanan_lain_txt', $borangulas?->ulasan?->pemprosesan_makanan_lain_txt) }}" readonly />
                                                </td>
                                                <td>
                                                    {!!$ikon_lain!!}
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                    @endif                                            
                            </div>    
                            <div class="row">
                                <div class="col-md-12">
                                    <label for="latitude">e&#41; Mendirikan bangunan/warung</label>                                
                                    <div class="form-group"> 
                                        @if($borangulas?->mendirikan_bangunan == 'tiada')                                         
                                            <input class="form-control" type="text" id="mendirikan_bangunan" name="mendirikan_bangunan" value="Tiada (Hanya payung/meja sahaja)" readonly>
                                        @else
                                            <input class="form-control" type="text" id="mendirikan_bangunan" name="mendirikan_bangunan" value="Ada" readonly>
                                        @endif 
                                    </div>  
                                </div>
                            </div>                            
                        </div>
                        <div class="col-md-4 mb-3">
                            <div class="row">
                                <div class="col-md-12">
                                    f&#41; Jika menggunakan kenderaan:
                                    <?php
                                                $hijau_motosikal = '';
                                                $ikon_motosikal = '';          
                                                $hijau_kereta = '';
                                                $ikon_kereta = '';          
                                                $hijau_lori = '';
                                                $ikon_lori = '';          
                                                $hijau_basikal = '';
                                                $ikon_basikal = '';
                                                $hijau_lain = '';
                                                $ikon_lain = '';

                                            if($borangulas?->jika_guna_kenderaan == 'motosikal'){
                                                $hijau_motosikal = 'class="table-success"';
                                                $ikon_motosikal = '<i class="far fa-check-square fa-lg"></i>';
                                            }

                                            if($borangulas?->jika_guna_kenderaan == 'kereta/van'){ 
                                                $hijau_kereta = 'class="table-success"';
                                                $ikon_kereta = '<i class="far fa-check-square fa-lg"></i>';
                                            }

                                            if($borangulas?->jika_guna_kenderaan == 'lori'){
                                                $hijau_lori = 'class="table-success"';
                                                $ikon_lori = '<i class="far fa-check-square fa-lg"></i>';
                                            }

                                            if($borangulas?->jika_guna_kenderaan == 'basikal'){ 
                                                $hijau_basikal = 'class="table-success"';
                                                $ikon_basikal = '<i class="far fa-check-square fa-lg"></i>';
                                            }

                                            if($borangulas?->jika_guna_kenderaan == 'lain-lain'){ 
                                                $hijau_lain = 'class="table-success"';
                                                $ikon_lain = '<i class="far fa-check-square fa-lg"></i>';
                                            }
                                    ?>
                                    <table class="table mt-1">
                                        <tbody>
                                            <tr {!!$hijau_motosikal!!}>
                                                <td>Motosikal</td>
                                                <td>
                                                    {!!$ikon_motosikal!!}
                                                </td>
                                            </tr>
                                            <tr {!!$hijau_kereta!!}>
                                                <td>Kereta/Van</td>
                                                <td>
                                                    {!!$ikon_kereta!!}
                                                </td>
                                            </tr>
                                            <tr {!!$hijau_lori!!}>
                                                <td>Lori</td>
                                                <td>
                                                    {!!$ikon_lori!!}
                                                </td>
                                            </tr>
                                            <tr {!!$hijau_basikal!!}>
                                                <td>Basikal</td>
                                                <td>
                                                    {!!$ikon_basikal!!}
                                                </td>
                                            </tr>
                                            <tr {!!$hijau_lain!!}>
                                                <td>                                                   
                                                        Lain-lain
                                                        <input type="text" class="form-control" id="jenis_kenderaan_lain" name="jenis_kenderaan_lain" value="{{ old('jenis_kenderaan_lain', $borangulas?->jenis_kenderaan_lain) }}" readonly/>
                                                     </td>
                                                <td>{!!$ikon_lain!!}</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    <div class="form-group">
                                        <label for="no_fail_lesen">No. Pendaftaran Kenderaan</label>
                                        <input type="text" class="form-control" id="no_plate_kenderaan" name="no_plate_kenderaan" value="{{ old('no_plate_kenderaan', $borangulas?->no_plate_kenderaan) }}" readonly />
                                    </div>
                                </div>
                            </div>            
                        </div>
                        <div class="col-md-4 mb-3">  
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="no_fail_lesen">g&#41; Tarikh mula berniaga</label>
                                        <input type="date" class="form-control" id="dt_mula_niaga" name="dt_mula_niaga" value="{{ old('dt_mula_niaga', $borangulas?->dt_mula_niaga) }}" readonly />
                                    </div>
                                    <div class="form-group">
                                        <label for="no_fail_lesen">Masa berniaga</label>
                                        <input type="text" class="form-control" id="masa_berniaga_mula" name="masa_berniaga_mula" value="{{ old('masa_berniaga_mula', $borangulas?->masa_berniaga_mula) }}" readonly />
                                    </div>
                                </div>
                            </div>
                                    <?php
                                                $hijau_kebersihan_diri = 'class="table-secondary"';
                                                $ikon_kebersihan_diri = '<i class="far fa-square fa-lg"></i> <label class="form-check-label" for="kebersihan_diri_tidak" > </label>';          
                                                $hijau_kebersihan_makanan = 'class="table-secondary"';
                                                $ikon_kebersihan_makanan = '<i class="far fa-square fa-lg"></i> <label class="form-check-label" for="kebersihan_makanan_tidak" > </label>';          
                                                $hijau_kebersihan_kawasan = 'class="table-secondary"';
                                                $ikon_kebersihan_kawasan = '<i class="far fa-square fa-lg"></i> <label class="form-check-label" for="kebersihan_kawasan_tidak" > </label>';     

                                            if($borangulas?->kebersihan_diri == 'memuaskan'){
                                                $hijau_kebersihan_diri = 'class="table-success"';
                                                $ikon_kebersihan_diri = '<i class="far fa-check-square fa-lg"></i> <label class="form-check-label" for="kebersihan_diri" >Memuaskan</label>';
                                            }
                                            elseif($borangulas?->kebersihan_diri == 'tidak'){
                                                $hijau_kebersihan_diri = 'class="table-danger"';
                                                $ikon_kebersihan_diri = '<i class="far fa-window-close fa-lg"></i> <label class="form-check-label" for="kebersihan_diri_tidak" >Tidak</label>';   
                                            }

                                            if($borangulas?->kebersihan_makanan == 'memuaskan'){ 
                                                $hijau_kebersihan_makanan = 'class="table-success"';
                                                $ikon_kebersihan_makanan = '<i class="far fa-check-square fa-lg"></i> <label class="form-check-label" for="kebersihan_makanan" >Memuaskan</label>';
                                            }
                                            elseif($borangulas?->kebersihan_diri == 'tidak'){
                                                $hijau_kebersihan_makanan = 'class="table-danger"';
                                                $ikon_kebersihan_makanan = '<i class="far fa-window-close fa-lg"></i> <label class="form-check-label" for="kebersihan_makanan_tidak" >Tidak</label>';   
                                            }

                                            if($borangulas?->kebersihan_kawasan == 'memuaskan'){
                                                $hijau_kebersihan_kawasan = 'class="table-success"';
                                                $ikon_kebersihan_kawasan = '<i class="far fa-check-square fa-lg"></i> <label class="form-check-label" for="kebersihan_kawasan" >Memuaskan</label>';
                                            }
                                            elseif($borangulas?->kebersihan_diri == 'tidak'){
                                                $hijau_kebersihan_kawasan = 'class="table-danger"';
                                                $ikon_kebersihan_kawasan = '<i class="far fa-window-close fa-lg"></i> <label class="form-check-label" for="kebersihan_kawasan_tidak" >Tidak</label>';   
                                            }
                                    ?>
                            <div class="row">
                                <div class="col-md-12">
                                    h&#41; Kebersihan semasa berniaga:
                                    <table class="table mt-1">
                                        <tbody>
                                            <tr {!!$hijau_kebersihan_diri!!}>
                                                <td>Kebersihan diri</td>
                                                <td>
                                                    <div class="form-group">  
                                                    {!!$ikon_kebersihan_diri!!}                                                    
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr {!!$hijau_kebersihan_makanan!!}>
                                                <td>Kebersihan makanan</td>
                                                <td>
                                                    <div class="form-group">
                                                    {!!$ikon_kebersihan_makanan!!}                                                         
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr {!!$hijau_kebersihan_kawasan!!}>
                                                <td>Kebersihan kawasan</td>
                                                <td>
                                                    <div class="form-group">
                                                    {!!$ikon_kebersihan_kawasan!!}                                                       
                                                    </div>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div> 
                    <div class="row">
                        <div class="col-md-12 mb-3">
                            <div class="form-group">
                                <label for="no_fail_lesen">i&#41; Laporan kebersihan kawasan/tapak selepas berniaga</label>
                                <div class="form-control-plaintext border p-2" style="white-space:pre-wrap;">{{ $borangulas?->laporan_kebersihan_selepas_niaga }}</div>
                            </div>
                        </div>
                    </div> 
            </div>
          </div>
        </div> <!-- /.col -->               
    </div> <!--end::Row-->
    
    <div class="row">
        <div class="col-12">
          <div class="card card-round">
            <div class="card-header">
              <div class="card-head-row card-tools-still-right">
                <h4 class="card-title">Gambar Lokasi Lawatan Tapak</h4>
              </div>
            </div> <!-- /.card-header -->
            <div class="card-body">
                <div class="row">
                    <div class="col-4">
                        @if(!empty($borangulas?->gambar1))                  
                        <img src="{{ route('ik.stream', [$permohonan?->id, $borangulas?->gambar1]) }}" class="img-fluid" alt="...">
                        @endif
                    </div>
                    <div class="col-4">
                        @if(!empty($borangulas?->gambar2))                 
                        <img src="{{ route('ik.stream', [$permohonan?->id, $borangulas?->gambar2]) }}" class="img-fluid" alt="...">
                        @endif
                    </div>
                    <div class="col-4">
                        @if(!empty($borangulas?->gambar3))               
                        <img src="{{ route('ik.stream', [$permohonan?->id, $borangulas?->gambar3]) }}" class="img-fluid" alt="...">
                        @endif
                    </div>
                </div>

            </div>          
          </div>
        </div> <!-- /.col -->               
    </div> <!--end::Row-->
    <div class="row">
        <div class="col-12">
          <div class="card card-round">
            <div class="card-header">
              <div class="card-head-row card-tools-still-right">
                <h4 class="card-title">Cadangan</h4>
              </div>
            </div> <!-- /.card-header -->
            <div class="card-body">
                <table class="table mt-1">
                    <tbody> 
                        @if($borangulas?->cadangan == 'tiada halangan')
                        <tr class="table-success">
                            <td>
                                <div class="form-check">
                                    <i class="far fa-check-square fa-lg"></i>
                                    <label class="form-check-label" for="cadangan_tiada_halangan" ><strong>Tiada halangan</strong> dengan syarat :</label> 
                                    <div class="form-control-plaintext border p-2" style="white-space:pre-wrap;">{{ $borangulas?->tiada_halangan_syarat }}</div>
                                </div>
                                <div class="row">
                                    <div class="col-1">&nbsp;</div>
                                    <div class="col-sm-11">
                                        <div class="form-group">                                            
                                                    @if($borangulas?->tiada_halangan_notis_dipatuhi == '1')
                                                        <i class="far fa-file-alt fa-lg"></i>
                                                    @endif
                                            <label class="form-check-label" for="tiada_halangan_notis_dipatuhi" >Notis yang telah dikeluarkan perlu dipatuhi</label>
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        @endif
                        @if($borangulas?->cadangan == 'tidak menyokong')
                        <tr class="table-warning">
                            <td>
                                <div class="form-group">
                                    
                                                    @if($borangulas?->cadangan == 'tidak menyokong')
                                                        <i class="far fa-window-close fa-lg"></i>   
                                                    @endif 
                                    <label class="form-check-label" for="cadangan_tidak_menyokong" ><strong>Tidak menyokong</strong> atas sebab : </label>
                                    <div class="form-control-plaintext border p-2" style="white-space:pre-wrap;">{{ $borangulas?->tidak_menyokong_atas_sebab }}</div>
                                </div>
                                <div class="row">
                                    <div class="col-1">&nbsp;</div>
                                    <div class="col-sm-11">
                                        <div class="form-group">
                                                    @if($borangulas?->dirujuk_unit_penguatkuasa == '1')
                                                        <i class="far fa-share-square fa-lg"></i>  
                                                    @endif 
                                            <label class="form-check-label" for="dirujuk_unit_penguatkuasa" >Dirujuk Jabatan Penguatkuasa untuk tindakan : </label>
                                            <div class="form-control-plaintext border p-2" style="white-space:pre-wrap;">{{ $borangulas?->dirujuk_unit_penguatkuasa_txt }}</div>
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        @endif
                        @if($borangulas?->cadangan == 'permohonan / lesen dibatalkan kerana tamat perniagaan')
                        <tr class="table-danger">
                            <td>
                                <div class="form-group">
                                                    @if($borangulas?->cadangan == 'permohonan / lesen dibatalkan kerana tamat perniagaan')
                                                        <i class="far fa-window-close fa-lg"></i>   
                                                    @endif
                                    <label class="form-check-label" for="cadangan_tiada_halangan" ><strong>Permohonan/Lesen dibatalkan</strong> kerana tamat perniagaan</label>
                                </div>
                            </td>
                        </tr>
                        @endif
                    </tbody>
                </table>
            </div>          
          </div>
        </div> <!-- /.col -->               
    </div> <!--end::Row-->
@endif