@extends('layouts.app') @section('content')
@if(!isset($validated)) ความคืบหน้าการกรอกข้อมูลผลิตภัณฑ์ @else ความคืบหน้าการประเมินคู่มือ @endif
0/5
@if(!isset($validated)) กรุณากรอกข้อมูลผลิตภัณฑ์ให้ครบถ้วน @else กรุณาตอบคำถามการประเมินให้ครบถ้วน @endif
@if(!isset($validated))

{{ __('เพิ่มผลิตภัณฑ์') }}

@csrf
@error('name')
{{ $message }}
@enderror
@error('model')
{{ $message }}
@enderror
@error('log_receive_method')
{{ $message }}
@enderror
@error('product_type')
{{ $message }}
@enderror
{{ __('รองรับไฟล์: JPEG, PNG, JPG, GIF, SVG ขนาดไม่เกิน 2MB') }}
@error('image')
{{ $message }}
@enderror
@error('description')
{{ $message }}
@enderror
{{ __('ยกเลิก') }}
@else

{{ __('แบบประเมินคู่มือ') }}

ข้อมูลผลิตภัณฑ์ที่กรอกไว้

ชื่อ: {{ $validated['name'] }}

รุ่น: {{ $validated['model'] ?? 'ไม่ระบุ' }}

ประเภท: {{ $validated['product_type'] == 'hw_sw_log_server' ? 'Hardware + Software Log Server' : 'Software Log Server' }}

คำแนะนำในการประเมิน

กรุณาอ่านคำถามอย่างละเอียดและตอบตามความจริง เพื่อให้ได้ผลการประเมินที่แม่นยำ

@csrf
@php $globalQuestionNumber = 1; @endphp @foreach($questionGroups as $groupIndex => $group)
@foreach($group->questions as $questionIndex => $question) @if($question->use_in_evaluation && !$question->parent_id && $question->question_type !== null)
{{ $globalQuestionNumber }}
{{ $question->question_text }}
@if($question->question_type == 'yes_no')
@elseif($question->question_type == 'multiple_choice')
@php $choices = $question->choices; if (is_string($choices)) { $choices = json_decode($choices, true); } @endphp @if($choices && is_array($choices) && count($choices) > 0) @foreach($choices as $choiceIndex => $choice)
@endforeach @else
ไม่มีตัวเลือกให้เลือก กรุณาติดต่อผู้ดูแลระบบ @if(config('app.debug'))
Debug: choices = {{ json_encode($question->choices) }} @endif
@endif
@elseif($question->question_type == 'text')
@endif
@php $globalQuestionNumber++; @endphp @elseif(!$question->use_in_evaluation && $question->question_type === null && !$question->parent_id)

@foreach($group->questions->where('parent_id', $question->id) as $childIndex => $child) @if($child->use_in_evaluation && $child->question_type !== null)
{{ $child->question_text }}
@if($child->question_type == 'yes_no')
@elseif($child->question_type == 'multiple_choice')
@php $choices = $child->choices; if (is_string($choices)) { $choices = json_decode($choices, true); } @endphp @if($choices && is_array($choices) && count($choices) > 0) @foreach($choices as $choiceIndex => $choice)
@endforeach @else
ไม่มีตัวเลือกให้เลือก กรุณาติดต่อผู้ดูแลระบบ @if(config('app.debug'))
Debug: choices = {{ json_encode($child->choices) }} @endif
@endif
@elseif($child->question_type == 'text')
@endif
@php $globalQuestionNumber++; @endphp @elseif(!$child->use_in_evaluation && $child->question_type !== null)
{{ $child->question_text }}
@if($child->question_type == 'multiple_choice')
@php $choices = $child->choices; if (is_string($choices)) { $choices = json_decode($choices, true); } @endphp @if($choices && is_array($choices) && count($choices) > 0) @foreach($choices as $choiceIndex => $choice)
@endforeach @else
ไม่มีตัวเลือกให้เลือก กรุณาติดต่อผู้ดูแลระบบ @if(config('app.debug'))
Debug: choices = {{ json_encode($child->choices) }} @endif
@endif
@elseif($child->question_type == 'text')
@endif
@elseif(!$child->use_in_evaluation && $child->question_type === null)

@foreach($group->questions->where('parent_id', $child->id) as $grandChildIndex => $grandChild) @if($grandChild->use_in_evaluation && $grandChild->question_type !== null)
{{ $grandChild->question_text }}
@if($grandChild->question_type == 'yes_no')
@elseif($grandChild->question_type == 'multiple_choice')
@php $choices = $grandChild->choices; if (is_string($choices)) { $choices = json_decode($choices, true); } @endphp @if($choices && is_array($choices) && count($choices) > 0) @foreach($choices as $choiceIndex => $choice)
@endforeach @else
ไม่มีตัวเลือกให้เลือก กรุณาติดต่อผู้ดูแลระบบ @if(config('app.debug'))
Debug: choices = {{ json_encode($grandChild->choices) }} @endif
@endif
@elseif($grandChild->question_type == 'text')
@endif
@php $globalQuestionNumber++; @endphp @elseif(!$grandChild->use_in_evaluation && $grandChild->question_type !== null)
{{ $grandChild->question_text }}
@if($grandChild->question_type == 'multiple_choice')
@php $choices = $grandChild->choices; if (is_string($choices)) { $choices = json_decode($choices, true); } @endphp @if($choices && is_array($choices) && count($choices) > 0) @foreach($choices as $choiceIndex => $choice)
@endforeach @else
ไม่มีตัวเลือกให้เลือก กรุณาติดต่อผู้ดูแลระบบ @if(config('app.debug'))
Debug: choices = {{ json_encode($grandChild->choices) }} @endif
@endif
@elseif($grandChild->question_type == 'text')
@endif
@endif @endforeach
@endif @endforeach
@endif @endforeach
@endforeach
@endif
@endsection