@extends('layouts.app') @section('content')

รายงานผลการประเมินผลิตภัณฑ์

ข้อมูลผลิตภัณฑ์
ชื่อผลิตภัณฑ์: {{ $product->name ?? 'ไม่ระบุ' }}
โมเดล/รุ่น: {{ $product->model ?? 'ไม่ระบุ' }}
วิธีรับข้อมูล: {{ $product->log_receive_method ?? 'ไม่ระบุ' }}
ประเภทผลิตภัณฑ์: {{ $product->product_type ?? 'ไม่ระบุ' }}
Email ติดต่อ: {{ $product->user->Email ?? 'ไม่ระบุ' }}
@if($product->image)
รูปภาพผลิตภัณฑ์
@else

ไม่มีรูปภาพ

@endif
หมายเหตุ
= สอดคล้อง
= ไม่สอดคล้อง
N/A = ไม่เกี่ยวข้องกับการประเมิน
ตารางแสดงผลการประเมิน
@if(isset($assessment) && $assessment) @if($assessment->status === 'draft')
ยังเป็นฉบับร่าง

การประเมินนี้ยังเป็นฉบับร่าง กรุณาส่งการประเมินก่อนเพื่อดูผลการประเมิน

@else
การประเมินวันที่: {{ $assessment->DtmIns->format('d/m/Y H:i') }}
@if(isset($answeredQuestions) && $answeredQuestions->count() > 0) @php $questionNumber = 1; @endphp @foreach($answeredQuestions as $question) @php $answer = $question->answer; // ใช้ข้อมูลคำตอบที่อยู่ใน question object // กำหนด CSS class สำหรับ row $rowClass = ''; if ($question->question_type == 'yes_no' && $question->use_in_evaluation) { if ($answer && $answer->answer_text == 'ใช่') { $rowClass = 'table-success'; } elseif ($answer && $answer->answer_text == 'ไม่ใช่') { $rowClass = 'table-danger'; } } elseif ($question->question_type === null && $question->use_in_evaluation) { if ($answer && $answer->answer_text == 'ใช่') { $rowClass = 'table-success'; } elseif ($answer && $answer->answer_text == 'ไม่ใช่') { $rowClass = 'table-danger'; } } elseif ($question->question_type == 'multiple_choice' || $question->question_type == 'text') { $rowClass = 'table-secondary'; } @endphp @endforeach @else @endif
ข้อ ข้อกำหนด คำตอบ ผลการตรวจสอบ คำอธิบาย
@if($question->has_question_number) @php $questionNumber = $question->question_number_only; $level = substr_count($questionNumber, '.'); $indent = $level * 20; // ย่อหน้าตามระดับ @endphp
{{ $questionNumber }}
@else {{ $questionNumber }} @endif
{{ $question->question_content ?? $question->question_text ?? 'ไม่ระบุ' }} @if($question->question_type === null && $question->logic_operator && (strtolower(Auth::user()->Level) === 'admin' || strtolower(Auth::user()->Level) === 'superadmin'))
(Logic: {{ $question->logic_operator }}) @endif @if($question->question_type == 'multiple_choice')
(คำถามแบบตัวเลือก) @elseif($question->question_type == 'text')
(คำถามแบบข้อความ) @endif
@if($question->question_type === null) - @elseif($answer) @if($question->question_type == 'yes_no') @if($answer->comment) {{ $answer->comment }} @else - @endif @elseif($question->question_type == 'multiple_choice') {{ $answer->answer_text }} @elseif($question->question_type == 'text') ข้อความ
{{ Str::limit($answer->answer_text, 100) }}
@else {{ $answer->answer_text ?? 'ไม่ระบุ' }} @endif @else - @endif
@if($question->question_type == 'yes_no') @if($question->use_in_evaluation) @if($answer && $answer->answer_text == 'ใช่') @elseif($answer && $answer->answer_text == 'ไม่ใช่') @else N/A @endif @else N/A @endif @elseif($question->question_type === null) @if($question->use_in_evaluation) @if($answer && $answer->answer_text == 'ใช่') @elseif($answer && $answer->answer_text == 'ไม่ใช่') @else N/A @endif @else N/A @endif @elseif($question->question_type == 'multiple_choice') N/A @elseif($question->question_type == 'text') N/A @endif @if($question->description) {{ $question->description }} @else - @endif
ไม่มีคำถามที่ตอบใน Assessment นี้
@endif @else
ยังไม่มีข้อมูลการประเมิน

ไม่พบผลการประเมินสำหรับผลิตภัณฑ์นี้

@endif
@if(strtolower(Auth::user()->Level) === 'admin' || strtolower(Auth::user()->Level) === 'superadmin') กลับไปหน้า Admin Dashboard @else กลับไปหน้ารายการผลิตภัณฑ์ @endif
@endsection