@extends('layouts.appmin')

@section('tajuk')
Ulasan Penolong Pegawai Kesihatan
@endsection

@section('css')

    <!-- Select2 -->
    <link rel="stylesheet" href="{{ asset('plugins/select2/css/select2.min.css') }}">
    <link rel="stylesheet" href="{{ asset('plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css') }}">
<link href="{{ asset('css/jsapi-template-main.css') }}" rel="stylesheet" type="text/css"/>
<link href="https://js.arcgis.com/4.25/esri/css/main.css" rel="stylesheet" type="text/css" />
<style>
#viewDiv {
  padding: 0;
  margin: 0;
  height: 500px;
  width: 100%;
}
</style>
@endsection


@section('breadcrumb')
<ul class="breadcrumbs mb-3">
    <li class="nav-home">
        <a href="#">
        <i class="icon-home"></i>
        </a>
    </li>
    <li class="separator">
        <i class="icon-arrow-right"></i>
    </li>
    <li class="nav-item">
        <a href="#">Penjaja</a>
    </li>
    <li class="separator">
        <i class="icon-arrow-right"></i>
    </li>
    <li class="nav-item">
        <a href="#">Pemeriksaan Tapak</a>
    </li>
    <li class="separator">
        <i class="icon-arrow-right"></i>
    </li>
    <li class="nav-item">
        <a href="#">Papar Permohonan</a>
    </li>
</ul>
@endsection

@section('content')

    @if (session('success'))
        <div class="alert alert-success" role="alert">
            {{ session('success') }}
        </div>
    @endif  
    <div class="row mb-3">
        <div class="col-md-12">
            <a href="{{route('ik.papar-pemeriksaan', [$permohonan->id])}}" class="btn btn-primary mx-2">Permohonan</a><a href="{{route('ik.papar-pemeriksaan-map', [$permohonan->id])}}" class="btn btn-primary mx-2">Peta Lokasi</a><a href="{{route('ik.papar-pemeriksaan-ulasan', [$permohonan->id])}}" class="btn btn-primary mx-2">Borang Ulasan</a>
        </div>
    </div>
    
<form action="{{route('ik.simpan-ulasan')}}" method="post">
    @csrf
    <input type="hidden" name="permohonan_id" value="{{$permohonan->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">Ulasan</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', $permohonan?->ulasanIk?->dt_periksa) }}" autofocus autocomplete="dt_periksa"/>
                            </div>
                        </div> 
                    </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($permohonan?->ulasanIk?->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($permohonan?->ulasanIk?->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', $permohonan?->ulasanIk?->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($permohonan?->ulasanIk?->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($permohonan?->ulasanIk?->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($permohonan?->ulasanIk?->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($permohonan?->ulasanIk?->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', $permohonan?->ulasanIk?->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 for="latitude">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($permohonan?->ulasanIk?->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($permohonan?->ulasanIk?->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><input class="form-check-input" type="checkbox" id="pemprosesan_makanan_memasak" name="pemprosesan_makanan_memasak" value="1"
                                                    @if($permohonan?->ulasanIk?->pemprosesan_makanan_memasak == '1')
                                                        {{'checked'}}
                                                    @endif>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Merebus makanan</td>
                                                <td><input class="form-check-input" type="checkbox" id="pemprosesan_makanan_merebus" name="pemprosesan_makanan_merebus" value="1"
                                                    @if($permohonan?->ulasanIk?->pemprosesan_makanan_merebus == '1')
                                                        {{'checked'}}
                                                    @endif>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Menggoreng makanan</td>
                                                <td><input class="form-check-input" type="checkbox" id="pemprosesan_makanan_menggoreng" name="pemprosesan_makanan_menggoreng" value="1"
                                                    @if($permohonan?->ulasanIk?->pemprosesan_makanan_menggoreng == '1')
                                                        {{'checked'}}
                                                    @endif>
                                                </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', $permohonan?->ulasanIk?->pemprosesan_makanan_lain_txt) }}" />
                                                </td>
                                                <td><input class="form-check-input" type="checkbox" id="pemprosesan_makanan_lain" name="pemprosesan_makanan_lain" value="1"
                                                    @if($permohonan?->ulasanIk?->pemprosesan_makanan_lain == '1')
                                                        {{'checked'}}
                                                    @endif>
                                                </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($permohonan?->ulasanIk?->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($permohonan?->ulasanIk?->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><input class="form-check-input" type="radio" id="jika_guna_kenderaan_moto" name="jika_guna_kenderaan" value="motosikal"
                                                    @if($permohonan?->ulasanIk?->jika_guna_kenderaan == 'motosikal')
                                                        {{'checked'}}
                                                    @endif></td>
                                            </tr>
                                            <tr>
                                                <td>Kereta/Van</td>
                                                <td><input class="form-check-input" type="radio" id="jika_guna_kenderaan_kereta" name="jika_guna_kenderaan" value="kereta/van"
                                                    @if($permohonan?->ulasanIk?->jika_guna_kenderaan == 'kereta/van')
                                                        {{'checked'}}
                                                    @endif></td>
                                            </tr>
                                            <tr>
                                                <td>Lori</td>
                                                <td><input class="form-check-input" type="radio" id="jika_guna_kenderaan_lori" name="jika_guna_kenderaan" value="lori"
                                                    @if($permohonan?->ulasanIk?->jika_guna_kenderaan == 'lori')
                                                        {{'checked'}}
                                                    @endif></td>
                                            </tr>
                                            <tr>
                                                <td>Basikal</td>
                                                <td><input class="form-check-input" type="radio" id="jika_guna_kenderaan_basikal" name="jika_guna_kenderaan" value="basikal"
                                                    @if($permohonan?->ulasanIk?->jika_guna_kenderaan == 'basikal')
                                                        {{'checked'}}
                                                    @endif></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', $permohonan?->ulasanIk?->jenis_kenderaan_lain) }}" />
                                                     </td>
                                                <td><input class="form-check-input" type="radio" id="jika_guna_kenderaan_lain" name="jika_guna_kenderaan" value="lain-lain"
                                                    @if($permohonan?->ulasanIk?->jika_guna_kenderaan == 'lain-lain')
                                                        {{'checked'}}
                                                    @endif></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', $permohonan?->ulasanIk?->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', $permohonan?->ulasanIk?->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', $permohonan?->ulasanIk?->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($permohonan?->ulasanIk?->kebersihan_diri == 'memuaskan')
                                                        {{'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($permohonan?->ulasanIk?->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($permohonan?->ulasanIk?->kebersihan_makanan == 'memuaskan')
                                                        {{'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($permohonan?->ulasanIk?->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($permohonan?->ulasanIk?->kebersihan_kawasan == 'memuaskan')
                                                        {{'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($permohonan?->ulasanIk?->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', $permohonan?->ulasanIk?->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">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($permohonan?->ulasanIk?->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', $permohonan?->ulasanIk?->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($permohonan?->ulasanIk?->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($permohonan?->ulasanIk?->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', $permohonan?->ulasanIk?->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($permohonan?->ulasanIk?->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', $permohonan?->ulasanIk?->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($permohonan?->ulasanIk?->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>
@endsection

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