@foreach($item_leave->pertanyaans->where('prodeskel_categorie_id', '14') as $pertanyaan)
@php
$data = $pertanyaan->responden(1)->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', $pertanyaan->id)->where('prodeskel_tahun_id', 1)->get();
$default = \App\Models\ProdeskelHasDefault::where('prodeskel_responden_id', $prodeskelResponden->id)
->where('prodeskel_question_id', $pertanyaan->id)->where('prodeskel_tahun_id', '1')->get();
}
@endphp
-
{{ $item_leave->urutan .'.'. $pertanyaan->urutan }}. {{ $pertanyaan->isi }}
@if(!$empty)
@if($pertanyaan->prodeskel_type_id === 1)
@if( !is_null($data->jawaban))
{{ $data->jawaban }} {{ $pertanyaan->default_jawaban }}
@endif
Ubah jawaban
@elseif($pertanyaan->prodeskel_type_id === 2 )
@if( !is_null($multiple) && $multiple->count() > 0 )
@foreach($multiple as $item_multiple)
{{ $item_multiple->prodeskelAnswerChoice->isi }}
@endforeach
@endif
Ubah jawaban
@elseif($pertanyaan->prodeskel_type_id === 3 || $pertanyaan->prodeskel_type_id === 4)
@if( !is_null($multiple) && $multiple->count() > 0 )
@foreach($multiple as $item_multiple)
@if( !is_null($default) && $default->count() > 0 )
{{ $item_multiple->prodeskelAnswerChoice->isi }}
@foreach($default as $item_default)
@if($item_multiple->id == $item_default->prodeskel_has_answer_id)
-
{{ $item_default->prodeskelDefaultChoice->isi }}
@if($pertanyaan->prodeskel_type_id === 4)
: {{ $item_default->jawaban }} {{ $pertanyaan->default_jawaban }}
@endif
@endif
@endforeach
@endif
@endforeach
@endif
Ubah jawaban
@elseif($pertanyaan->prodeskel_type_id === 5 || $pertanyaan->prodeskel_type_id === 6)
@if( !is_null($multiple) && $multiple->count() > 0 )
@foreach($multiple as $item_multiple)
-
{{ $item_multiple->prodeskelAnswerChoice->isi ?? null }} @if($pertanyaan->prodeskel_type_id == 5) : @endif {{ $item_multiple->jawaban }} {{ $pertanyaan->default_jawaban }}
@endforeach
@endif
Ubah jawaban
@else
@endif
@else
Tidak ada jawaban.
Ubah jawaban
@endif
@endforeach