@extends('admin.layouts.main') @section('title') Kua Agent Detail @endsection @section('content')
@include('admin.common.sidebar')

{{ $kuaAgent->full_name }}

@if ($kuaAgent->status == 'pending') Pending @elseif($kuaAgent->status == 'approved') Approved @elseif($kuaAgent->status == 'rejected') Rejected @endif

Agent Identification & Agreement

{{--

Agent Identification & Agreement

--}}

{{ $kuaAgent->full_name ?? '-' }}

{{ $kuaAgent->nationalIdTypeRelation && $kuaAgent->national_id_type ? $kuaAgent->nationalIdTypeRelation->title : '-' }}

{{ $kuaAgent->national_id_number ?? '-' }}

@php $nationalIdCopyUrl = $kuaAgent->kuaAgentDocuments->firstWhere('type', 'national_id_copy'); $nationalIdCopyUrl = $nationalIdCopyUrl ? $nationalIdCopyUrl->getKuaDocumentUrlAttribute() : null; $nationalIdCopyUrl = $nationalIdCopyUrl ?: asset('storage/' . $kuaAgent->national_id_copy); @endphp @if ($nationalIdCopyUrl) file_download @elseif($kuaAgent->national_id_copy == null) File not found @else - @endif

@php $passportCopyUrl = $kuaAgent->kuaAgentDocuments->firstWhere('type', 'passport_photo'); $passportCopyUrl = $passportCopyUrl ? $passportCopyUrl->getKuaDocumentUrlAttribute() : null; $passportCopyUrl = $passportCopyUrl ?: asset('storage/' . $kuaAgent->passport_photo); @endphp @if ($passportCopyUrl) file_download @elseif($kuaAgent->passport_photo == null) File not found @else - @endif

{{ $kuaAgent->agreement_timestamp }}

{{--

{{ $kuaAgent->signature_type ?? '-' }}

--}}

@if ($kuaAgent->digital_signature) @if (Str::startsWith($kuaAgent->digital_signature, 'data:image')) Signature @else {{ $kuaAgent->digital_signature }} @endif @else - @endif

@php $agentSignedAgreementUrl = $kuaAgent->kuaAgentDocuments->firstWhere('type', 'agent_counsulting_agreement'); $agentSignedAgreementUrl = $agentSignedAgreementUrl ? $agentSignedAgreementUrl->getKuaDocumentUrlAttribute() : null; @endphp @if ($agentSignedAgreementUrl) file_download @elseif($kuaAgent->passport_photo == null) File not found @else - @endif

Experience & Work History

{{ $kuaAgent->worked_as_sales_agent ? 'Yes' : 'No' }}

@php $productsSold = $kuaAgent->products_sold; $productNames = []; if (!empty($productsSold) && is_string($productsSold)) { // Split by comma and trim whitespace $productNames = array_map('trim', explode(',', $productsSold)); } @endphp

{{ !empty($productNames) ? implode(', ', $productNames) : '-' }}

@if (!is_null($kuaAgent->years_of_experience)) {{ $kuaAgent->years_of_experience }} @else - @endif

@php $cvUploadUrl = $kuaAgent->kuaAgentDocuments->firstWhere('type', 'cv_upload'); $cvUploadUrl = $cvUploadUrl ? $cvUploadUrl->getKuaDocumentUrlAttribute() : null; $cvUploadUrl = $cvUploadUrl ?: asset('storage/' . $kuaAgent->cv_upload); @endphp @if ($kuaAgent->cv_upload) file_download @else - @endif

@php $salesPerformanceEvidenceUrl = $kuaAgent->kuaAgentDocuments->firstWhere('type', 'sales_performance_evidence'); $salesPerformanceEvidenceUrl = $salesPerformanceEvidenceUrl ? $salesPerformanceEvidenceUrl->getKuaDocumentUrlAttribute() : null; $salesPerformanceEvidenceUrl = $salesPerformanceEvidenceUrl ?: asset('storage/' . $kuaAgent->sales_performance_evidence); @endphp @if ($kuaAgent->sales_performance_evidence) file_download @else - @endif

Income Declaration & Conflict of Interest

{{ $kuaAgent->has_other_income ? 'Yes' : 'No' }}

@if ($kuaAgent->has_other_income)

{{ $kuaAgent->other_income_sources ?? '-' }}

@endif

{{ $kuaAgent->promoting_other_products ? 'Yes' : 'No' }}

@if ($kuaAgent->promoting_other_products)

{{ $kuaAgent->other_products ?? '-' }}

@endif

{{ $kuaAgent->conflict_of_interest_confirmed ? 'Yes' : 'No' }}

Geographical Availability & Work Preference

{{ $kuaAgent->getRegionsAvailableModelsAttribute()->region_name ?? '-' }}

{{ $kuaAgent->open_to_roaming ? 'Yes' : 'No' }}

{{ $kuaAgent->has_smartphone ? 'Yes' : 'No' }}

{{ $kuaAgent->has_transport ? 'Yes' : 'No' }}

Personal Background

{{ ucfirst($kuaAgent->marital_status) ?? '-' }}

{{ $kuaAgent->has_children ? 'Yes' : 'No' }}

{{ $kuaAgent->number_of_dependents ?? '-' }}

{{ $kuaAgent->is_primary_breadwinner ? 'Yes' : 'No' }}

{{ $kuaAgent->has_health_limitations ? 'Yes' : 'No' }}

@if ($kuaAgent->has_health_limitations)

{{ $kuaAgent->health_limitation_details ?? '-' }}

@endif

Bank Details

{{ $kuaAgent->bank_name ?? '-' }}

{{ $kuaAgent->bank_account_number ?? '-' }}

{{ $kuaAgent->bank_account_name ?? '-' }}

{{ $kuaAgent->bank_code ?? '-' }}

{{ $kuaAgent->tin_number ?? '-' }}

{{-- Add QR Details --}} @if (!empty($qrCode))

QR Code

@if ($qrCode) QR Code @else - @endif

{{ $kuaAgent->notes ?? '-' }}

@endif
@endsection @include('admin.modules.kua_agent.modal') @push('pageJs') @endpush