@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
@foreach($questionGroups as $group)

@foreach($group->questions as $questionIndex => $question) @if($question->use_in_evaluation && !$question->parent_id && $question->question_type !== null)
{{ $loop->parent->index + 1 }}.{{ $questionIndex + 1 }}
{{ $question->question_text }}
@if($question->question_type == 'yes_no')
@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')
@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')
@endif
@elseif(!$grandChild->use_in_evaluation && $grandChild->question_type === null)

@foreach($group->questions->where('parent_id', $grandChild->id) as $greatGrandChildIndex => $greatGrandChild) @if($greatGrandChild->use_in_evaluation && $greatGrandChild->question_type !== null)
{{ $greatGrandChild->question_text }}
@if($greatGrandChild->question_type == 'yes_no')
@endif
@elseif(!$greatGrandChild->use_in_evaluation && $greatGrandChild->question_type === null)

@foreach($group->questions->where('parent_id', $greatGrandChild->id) as $greatGreatGrandChildIndex => $greatGreatGrandChild) @if($greatGreatGrandChild->use_in_evaluation && $greatGreatGrandChild->question_type !== null)
{{ $greatGreatGrandChild->question_text }}
@if($greatGreatGrandChild->question_type == 'yes_no')
@endif
@elseif(!$greatGreatGrandChild->use_in_evaluation && $greatGreatGrandChild->question_type === null)

@foreach($group->questions->where('parent_id', $greatGreatGrandChild->id) as $greatGreatGreatGrandChildIndex => $greatGreatGreatGrandChild) @if($greatGreatGreatGrandChild->use_in_evaluation && $greatGreatGreatGrandChild->question_type !== null)
{{ $greatGreatGreatGrandChild->question_text }}
@if($greatGreatGreatGrandChild->question_type == 'yes_no')
@endif
@elseif(!$greatGreatGreatGrandChild->use_in_evaluation && $greatGreatGreatGrandChild->question_type === null)

@foreach($group->questions->where('parent_id', $greatGreatGreatGrandChild->id) as $greatGreatGreatGreatGrandChildIndex => $greatGreatGreatGreatGrandChild) @if($greatGreatGreatGreatGrandChild->use_in_evaluation && $greatGreatGreatGreatGrandChild->question_type !== null)
{{ $greatGreatGreatGreatGrandChild->question_text }}
@if($greatGreatGreatGreatGrandChild->question_type == 'yes_no')
@endif
@elseif(!$greatGreatGreatGreatGrandChild->use_in_evaluation && $greatGreatGreatGreatGrandChild->question_type === null)
{{ $greatGreatGreatGreatGrandChild->question_text }}
คำถามนี้ไม่ใช้ในการประเมิน
@endif @endforeach
@endif @endforeach
@endif @endforeach
@endif @endforeach
@endif @endforeach
@endif @endforeach
@endif @endforeach
@endforeach
@endif
@endsection