@if(Request::segment(1) == 'klik') @php $data = $prodeskelQuestion->responden($tahun->id)->wherePivot('prodeskel_responden_id', $prodeskelResponden->id)->first(); $jawaban = null; $default = null; $multiple = null; if(empty($data) || is_null($data)){ $empty = true; }else{ $empty = false; $data = $data->pivot; $multiple = \App\Models\ProdeskelHasAnswer::where('prodeskel_responden_id', $prodeskelResponden->id) ->where('prodeskel_question_id', $prodeskelQuestion->id)->where('prodeskel_tahun_id', $tahun->id)->get(); $default = \App\Models\ProdeskelHasDefault::where('prodeskel_responden_id', $prodeskelResponden->id) ->where('prodeskel_question_id', $prodeskelQuestion->id)->where('prodeskel_tahun_id', $tahun->id)->get(); } @endphp
Jawaban.
@if(!$empty) @if($prodeskelQuestion->prodeskel_type_id === 1) @if( !is_null($data->jawaban)) (Hapus) {{ $data->jawaban }} {{ $prodeskelQuestion->default_jawaban }} @endif @elseif($prodeskelQuestion->prodeskel_type_id === 2 ) @if( !is_null($multiple) && $multiple->count() > 0 ) @foreach($multiple as $item_multiple) (Hapus) {{ $item_multiple->prodeskelAnswerChoice->isi }} @endforeach @endif @elseif($prodeskelQuestion->prodeskel_type_id === 3 || $prodeskelQuestion->prodeskel_type_id === 4) @if( !is_null($multiple) && $multiple->count() > 0 ) @foreach($multiple as $item_multiple) @if( !is_null($default) && $default->count() > 0 ) (Hapus){{ $item_multiple->prodeskelAnswerChoice->isi }} @endif
@endforeach @endif @elseif($prodeskelQuestion->prodeskel_type_id === 5 || $prodeskelQuestion->prodeskel_type_id === 6) @if( !is_null($multiple) && $multiple->count() > 0 ) @endif @else Tidak ada jawaban. @endif @else Tidak ada jawaban. @endif
@endif @if($prodeskelQuestion->prodeskel_categorie_id == '14')
@if($prodeskelQuestion->prodeskel_type_id == '1') @include('prodeskel.formulir.essay') @elseif($prodeskelQuestion->prodeskel_type_id == '2') @include('prodeskel.formulir.pilihan') @elseif($prodeskelQuestion->prodeskel_type_id == '3') @include('prodeskel.formulir.multiple') @elseif($prodeskelQuestion->prodeskel_type_id == '4') @include('prodeskel.formulir.multiple-essay') @elseif($prodeskelQuestion->prodeskel_type_id == '5') @include('prodeskel.formulir.pilihan-essay') @elseif($prodeskelQuestion->prodeskel_type_id == '6') @include('prodeskel.formulir.pilihan-multiple') @else {{ $prodeskelQuestion->jenisPertanyaan->nama ?? "-" }} @endif
{{-- {!! Form::submit('Simpan', ['class' => 'btn btn-success mr-1']) !!} --}} @endif {!! Form::submit('Simpan', ['class' => 'btn btn-success mr-1 btn-sm']) !!}