@php $age = ''; if (isset($visitor)) { $get_age = Util::age($visitor->birth_date); $year = $get_age['year']; $month = $get_age['month']; $day = $get_age['day']; $age = $year . ' Year, ' . $month . ' Month, ' . $day . ' Day'; } $visitor_id = isset($visitor) ? $visitor->id : ''; // Comment: MCU note from visitor MCU record instead of employee // $mcu_note = isset($visitor_mcu) ? $visitor_mcu->note : ''; $redirect_url = route('gate-in.visitor.detail', ['id' => encrypt($visitor_id)]); // Comment: Generate MCU number for visitor - need controller support // $mcu_number = isset($visitor_mcu) && $visitor_mcu->mcu_number != null ? $visitor_mcu->mcu_number : $generate_code_mcu; // Comment: Grid column logic - need visitor MCU data structure // $grid_column = !empty($visitor_mcu->mcu_result) && $visitor_mcu->mcu_result == 'Fit' ? 'is-12' : 'is-6'; // hitung umur visitor $dob = new DateTime($visitor->birth_date); $now = new DateTime(); $umur = $now->diff($dob)->y; // ambil selisih tahun // Comment: Query visitor MCU data - need visitor_mcu table structure // $sqlMcu = DB::table('visitor_mcu') // ->where('visitor_id', '=', $visitor->id) // ->first(); // Check if visitor is approved (MCU FIT and Status Approved) $isApproved = isset($isApproved) ? $isApproved : false; @endphp @push("styles") @endpush
{{-- Comment: Need visitor_mcu_id field when visitor_mcu table is ready --}} {{-- --}}

@lang('app.medical_checkup') - Visitor

{{-- Auto-generated MCU number for testing --}} {{-- --}}
{{-- Comment: Visitor MCU files section - need visitor_mcu_files table --}}
@include('components.util.show-file', [ 'file' => $visitor->health_certificate, 'file_name' => 'Health Certificate', 'employee_name' => $visitor->name, 'employee_id' => $visitor->id, 'note_mcu' => '', 'valid_until' => null, 'approved' => null, 'nomor' => '', "file_id" => null, 'sub_folder' => 'health-certificate', 'size' => 'small', 'created_at' => null, 'statusMcu' => null, ])
Framingham Risk Score (FRS) - Visitor Assessment
@php $total_cholesterol = $visitor->cholesterol_value ?? ''; // ganti koma jadi titik $total_cholesterol = str_replace(',', '.', $total_cholesterol); // ubah ke float $kadar_cholesterol = (float) $total_cholesterol; // buang .00 kalau desimalnya nol if (fmod($kadar_cholesterol, 1) == 0) { $cholesterol = (int) $kadar_cholesterol; // 534 } else { $cholesterol = $kadar_cholesterol; // 534.25 } @endphp {{-- Comment: Default cholesterol value - need visitor MCU data --}}
@php $total_hdl = $visitor->hdl_value ?? ''; // ganti koma jadi titik $total_hdl = str_replace(',', '.', $total_hdl); // ubah ke float $kadar_hdl = (float) $total_hdl; // buang .00 kalau desimalnya nol if (fmod($kadar_hdl, 1) == 0) { $hdl = (int) $kadar_hdl; // 534 } else { $hdl = $kadar_hdl; // 534.25 } @endphp {{-- Comment: Default HDL value - need visitor MCU data --}}
@php $total_systolic = $visitor->systolic_value ?? ''; // ganti koma jadi titik $total_systolic = str_replace(',', '.', $total_systolic); // ubah ke float $kadar_systolic = (float) $total_systolic; // buang .00 kalau desimalnya nol if (fmod($kadar_systolic, 1) == 0) { $systolic = (int) $kadar_systolic; // 534 } else { $systolic = $kadar_systolic; // 534.25 } @endphp {{-- Comment: Default systolic value - need visitor MCU data --}}

@php $valueMcuResult = [ 'Fit', 'Fit With Note', 'Fit With Recommendation', 'Currently Unfit', 'Unfit', ]; @endphp
@include('components.button.card-button-next-prev', [ 'prev' => false, 'next' => false, 'save' => true, 'id' => 'visitor_medical_checkup', ])
@include('components.modal.modal-alert-save', [ 'id' => 'modal-alert-save-visitor-mcu', 'title' => __('app.alert_save_title'), 'subtitle' => 'Please ensure that the visitor MCU data you have entered is accurate and valid?', 'btn_submit' => 'btn_submit_visitor_mcu_modal', ]) @push('styles') @endpush @push('scripts') @endpush