@extends('Dashboard.layouts.main')

@section('title', 'Edit Kuisioner Kepuasan Pelanggan')

@section('content')
<div class="content">
    <div class="container-fluid">
        <div class="row">
            <div class="col-12">
                <div class="page-title-box">
                    <div class="page-title-right">
                        <ol class="breadcrumb m-0">
                            <li class="breadcrumb-item"><a href="{{ route('dashboard') }}">Dashboard</a></li>
                            <li class="breadcrumb-item"><a href="{{ route('satisfactions.index') }}">Penilaian Kepuasan</a></li>
                            <li class="breadcrumb-item active">Edit Kuisioner</li>
                        </ol>
                    </div>
                    <h4 class="page-title">Edit Kuisioner Kepuasan Pelanggan</h4>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-12">
                <div class="card">
                    <div class="card-header bg-primary text-white">
                        <h5 class="card-title mb-0 text-white">Edit Penilaian Kuisioner</h5>
                    </div>
                    <div class="card-body">
                        <p class="text-muted">
                            Tujuan dari pengisian kuisioner ini adalah untuk mengukur tingkat kepuasan pelanggan terhadap layanan yang kami berikan. 
                            Mohon kesediaannya untuk mengisi kuisioner ini dengan jujur.
                        </p>
                        <p><strong>Keterangan Penilaian:</strong></p>
                        <ul class="mb-4">
                            <li><span class="badge badge-danger">1</span> = Sangat Tidak Setuju / Sangat Tidak Puas</li>
                            <li><span class="badge badge-warning">2</span> = Tidak Setuju / Tidak Puas</li>
                            <li><span class="badge badge-secondary">3</span> = Netral / Cukup</li>
                            <li><span class="badge badge-info">4</span> = Setuju / Puas</li>
                            <li><span class="badge badge-success">5</span> = Sangat Setuju / Sangat Puas</li>
                        </ul>

                        <form action="{{ route('satisfactions.update', $satisfaction->id) }}" method="POST">
                            @csrf
                            @method('PUT')
                            
                            @if ($errors->any())
                            <div class="alert alert-danger">
                                <ul>
                                    @foreach ($errors->all() as $error)
                                        <li>{{ $error }}</li>
                                    @endforeach
                                </ul>
                            </div>
                            @endif

                            <div class="table-responsive">
                                <table class="table table-bordered table-striped">
                                    <thead class="thead-light">
                                        <tr>
                                            <th width="5%">No</th>
                                            <th width="55%">ASPEK PELAYANAN YANG DINILAI</th>
                                            <th width="40%" class="text-center" colspan="5">PENILAIAN</th>
                                        </tr>
                                        <tr>
                                            <th colspan="2"></th>
                                            <th width="8%" class="text-center">1</th>
                                            <th width="8%" class="text-center">2</th>
                                            <th width="8%" class="text-center">3</th>
                                            <th width="8%" class="text-center">4</th>
                                            <th width="8%" class="text-center">5</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td>1</td>
                                            <td>Bagaimana Pendapat Saudara tentang kesesuaian persyarataran pelayanan dengan jenis pelayanan.</td>
                                            <td class="text-center"><input type="radio" name="q1" value="1" required {{ $satisfaction->q1 == 1 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q1" value="2" {{ $satisfaction->q1 == 2 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q1" value="3" {{ $satisfaction->q1 == 3 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q1" value="4" {{ $satisfaction->q1 == 4 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q1" value="5" {{ $satisfaction->q1 == 5 ? 'checked' : '' }}></td>
                                        </tr>
                                        <tr>
                                            <td>2</td>
                                            <td>Bagaimana Pendapat Saudara tentang kejelasan persyaratan administrasi yang dibutuhkan</td>
                                            <td class="text-center"><input type="radio" name="q2" value="1" required {{ $satisfaction->q2 == 1 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q2" value="2" {{ $satisfaction->q2 == 2 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q2" value="3" {{ $satisfaction->q2 == 3 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q2" value="4" {{ $satisfaction->q2 == 4 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q2" value="5" {{ $satisfaction->q2 == 5 ? 'checked' : '' }}></td>
                                        </tr>
                                        <tr>
                                            <td>3</td>
                                            <td>Bagaimana Pendapat Saudara tentang kemudahan prosedur mendapatkan pelayanan di unit ini?</td>
                                            <td class="text-center"><input type="radio" name="q3" value="1" required {{ $satisfaction->q3 == 1 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q3" value="2" {{ $satisfaction->q3 == 2 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q3" value="3" {{ $satisfaction->q3 == 3 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q3" value="4" {{ $satisfaction->q3 == 4 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q3" value="5" {{ $satisfaction->q3 == 5 ? 'checked' : '' }}></td>
                                        </tr>
                                        <tr>
                                            <td>4</td>
                                            <td>Bagaimana pendapat saudara tentang kecepatan waktu dalam memberikan pelayanan?</td>
                                            <td class="text-center"><input type="radio" name="q4" value="1" required {{ $satisfaction->q4 == 1 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q4" value="2" {{ $satisfaction->q4 == 2 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q4" value="3" {{ $satisfaction->q4 == 3 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q4" value="4" {{ $satisfaction->q4 == 4 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q4" value="5" {{ $satisfaction->q4 == 5 ? 'checked' : '' }}></td>
                                        </tr>
                                        <tr>
                                            <td>5</td>
                                            <td>Apakah jam buka pelayanan sudah tepat waktu sesuai standart pelayanan yang dijanjikan?</td>
                                            <td class="text-center"><input type="radio" name="q5" value="1" required {{ $satisfaction->q5 == 1 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q5" value="2" {{ $satisfaction->q5 == 2 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q5" value="3" {{ $satisfaction->q5 == 3 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q5" value="4" {{ $satisfaction->q5 == 4 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q5" value="5" {{ $satisfaction->q5 == 5 ? 'checked' : '' }}></td>
                                        </tr>
                                        <tr>
                                            <td>6</td>
                                            <td>Bagaimana pendapat saudara tentang kewajaran biaya/tarif dalam pelayanan?</td>
                                            <td class="text-center"><input type="radio" name="q6" value="1" required {{ $satisfaction->q6 == 1 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q6" value="2" {{ $satisfaction->q6 == 2 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q6" value="3" {{ $satisfaction->q6 == 3 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q6" value="4" {{ $satisfaction->q6 == 4 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q6" value="5" {{ $satisfaction->q6 == 5 ? 'checked' : '' }}></td>
                                        </tr>
                                        <tr>
                                            <td>7</td>
                                            <td>Bagaimana pendapat saudara tentang kesesuaian produk hasil pelayanan dengan standar pelayanan?</td>
                                            <td class="text-center"><input type="radio" name="q7" value="1" required {{ $satisfaction->q7 == 1 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q7" value="2" {{ $satisfaction->q7 == 2 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q7" value="3" {{ $satisfaction->q7 == 3 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q7" value="4" {{ $satisfaction->q7 == 4 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q7" value="5" {{ $satisfaction->q7 == 5 ? 'checked' : '' }}></td>
                                        </tr>
                                        <tr>
                                            <td>8</td>
                                            <td>Bagiamana pendapat saudara tentang kompetensi/kemampuan petugas dalam pelayanan?</td>
                                            <td class="text-center"><input type="radio" name="q8" value="1" required {{ $satisfaction->q8 == 1 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q8" value="2" {{ $satisfaction->q8 == 2 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q8" value="3" {{ $satisfaction->q8 == 3 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q8" value="4" {{ $satisfaction->q8 == 4 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q8" value="5" {{ $satisfaction->q8 == 5 ? 'checked' : '' }}></td>
                                        </tr>
                                        <tr>
                                            <td>9</td>
                                            <td>Bagaimana pendapat saudara, kesopanan dan keramahan petugas dalam memberikan pelayanan?</td>
                                            <td class="text-center"><input type="radio" name="q9" value="1" required {{ $satisfaction->q9 == 1 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q9" value="2" {{ $satisfaction->q9 == 2 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q9" value="3" {{ $satisfaction->q9 == 3 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q9" value="4" {{ $satisfaction->q9 == 4 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q9" value="5" {{ $satisfaction->q9 == 5 ? 'checked' : '' }}></td>
                                        </tr>
                                        <tr>
                                            <td>10</td>
                                            <td>Bagaimana pendapat saudara tentang kualitas sarana dan prasarana pelayanan?</td>
                                            <td class="text-center"><input type="radio" name="q10" value="1" required {{ $satisfaction->q10 == 1 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q10" value="2" {{ $satisfaction->q10 == 2 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q10" value="3" {{ $satisfaction->q10 == 3 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q10" value="4" {{ $satisfaction->q10 == 4 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q10" value="5" {{ $satisfaction->q10 == 5 ? 'checked' : '' }}></td>
                                        </tr>
                                        <tr>
                                            <td>11</td>
                                            <td>Apakah ruang pelayanan bersih dan nyaman?</td>
                                            <td class="text-center"><input type="radio" name="q11" value="1" required {{ $satisfaction->q11 == 1 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q11" value="2" {{ $satisfaction->q11 == 2 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q11" value="3" {{ $satisfaction->q11 == 3 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q11" value="4" {{ $satisfaction->q11 == 4 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q11" value="5" {{ $satisfaction->q11 == 5 ? 'checked' : '' }}></td>
                                        </tr>
                                        <tr>
                                            <td>12</td>
                                            <td>Apakah kamar mandi atau toilet yang tersedia sudah bersih?</td>
                                            <td class="text-center"><input type="radio" name="q12" value="1" required {{ $satisfaction->q12 == 1 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q12" value="2" {{ $satisfaction->q12 == 2 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q12" value="3" {{ $satisfaction->q12 == 3 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q12" value="4" {{ $satisfaction->q12 == 4 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q12" value="5" {{ $satisfaction->q12 == 5 ? 'checked' : '' }}></td>
                                        </tr>
                                        <tr>
                                            <td>13</td>
                                            <td>Apakah tempat parkir sudah cukup luas, nyaman dan aman</td>
                                            <td class="text-center"><input type="radio" name="q13" value="1" required {{ $satisfaction->q13 == 1 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q13" value="2" {{ $satisfaction->q13 == 2 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q13" value="3" {{ $satisfaction->q13 == 3 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q13" value="4" {{ $satisfaction->q13 == 4 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q13" value="5" {{ $satisfaction->q13 == 5 ? 'checked' : '' }}></td>
                                        </tr>
                                        <tr>
                                            <td>14</td>
                                            <td>Bagaimana pendapat saudara tentang penanganan saran dan pengaduan pengguna layanan</td>
                                            <td class="text-center"><input type="radio" name="q14" value="1" required {{ $satisfaction->q14 == 1 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q14" value="2" {{ $satisfaction->q14 == 2 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q14" value="3" {{ $satisfaction->q14 == 3 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q14" value="4" {{ $satisfaction->q14 == 4 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q14" value="5" {{ $satisfaction->q14 == 5 ? 'checked' : '' }}></td>
                                        </tr>
                                        <tr>
                                            <td>15</td>
                                            <td>Apakah sarana pengaduan (komplain) berupa kotak saran dari pengaduan/telepon/email mudah diakses?</td>
                                            <td class="text-center"><input type="radio" name="q15" value="1" required {{ $satisfaction->q15 == 1 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q15" value="2" {{ $satisfaction->q15 == 2 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q15" value="3" {{ $satisfaction->q15 == 3 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q15" value="4" {{ $satisfaction->q15 == 4 ? 'checked' : '' }}></td>
                                            <td class="text-center"><input type="radio" name="q15" value="5" {{ $satisfaction->q15 == 5 ? 'checked' : '' }}></td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>

                            <div class="form-group mt-4">
                                <label for="kritik_saran">Kritik dan Saran</label>
                                <textarea class="form-control" id="kritik_saran" name="kritik_saran" rows="4">{{ $satisfaction->kritik_saran }}</textarea>
                                <small class="form-text text-muted">Silakan berikan kritik dan saran Anda untuk perbaikan layanan kami.</small>
                            </div>

                            <div class="mt-4 text-right">
                                <a href="{{ route('satisfactions.index') }}" class="btn btn-secondary mr-2">Batal</a>
                                <button type="submit" class="btn btn-primary">Perbarui Penilaian</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection 