@extends('admin.layouts.master') @section('title', $title) @section('contents')

{{ trans('Title') }}: {{ $project->title }}

{{ trans('Description') }}: {{ $project->description }}

{{ trans('Category') }}: {{ optional($project->category)->name ?? trans('N/A') }}

{{ __('Skills') }}:

@if($project->skills && $project->skills->count() > 0)
@foreach($project->skills as $skill) {{ $skill->name_ar ?? $skill->name_en ?? $skill->name ?? __('Skill') }} @endforeach
@else

@endif

{{ __('front.Payment Method') }}: {{ $project->size ? getTrans($project->size->details, 'ar') : '' }}

{{ trans('Project Time') }}: @if($project->delivery_days) {{ $project->delivery_days }} {{ trans('Day') }} @elseif($project->time) {{ $project->time->name }} @else - @endif

{{ trans('Budget Type') }}: {{ $project->budget_type == \App\Models\Project::BUDGET_TYPE_FIXED ? trans('Fixed') : trans('Hourly') }}

{{ trans('Budget') }}: @if($project->budget_type == \App\Models\Project::BUDGET_TYPE_FIXED) {{ $project->price }} @else {{ $project->price_from }} - {{ $project->price_to }} @endif

{{ trans('Payment Type') }}: {{ $project->payment_type == \App\Models\Project::PAYMENT_TYPE_FREE ? trans('Free') : trans('Paid') }}

{{ trans('Invited Freelancers') }}: {{ $project->invitations->count() }}

{{ trans('Private Project') }}: {{ $project->is_private ? trans('Yes') : trans('No') }} @if($project->is_private && !empty($project->message_to_freelancer)) {{ trans('Message') }}: {!! nl2br(e($project->message_to_freelancer)) !!} @endif

{{ trans('Direct Contract') }}: {{ $project->is_direct ? trans('Yes') : trans('No') }}

{{ trans('Status') }}: {{ $project->getCurrentStatus() }}

@if($project->status == \App\Models\Project::REJECTED)

{{ trans('Reject Reason') }}: @if($project->reject_reason) {{ $project->reject_reason }} @else @endif

@endif

{{ trans('Created At') }}: {{ $project->created_at->format('Y-m-d H:i') }}

@php $ownerRatesFreelancer = $project->ownerToFreelancerRating; $freelancerRatesOwner = $project->freelancerToOwnerRating; $hasProjectRatings = ($ownerRatesFreelancer && (int) $ownerRatesFreelancer->rating > 0) || ($freelancerRatesOwner && (int) $freelancerRatesOwner->rating > 0); @endphp @if($hasProjectRatings)

{{ __('dash.Project ratings') }}

{{ __('dash.Owner to freelancer rating') }}
@include('admin.components.rating_stars', ['rating' => optional($ownerRatesFreelancer)->rating]) @if($ownerRatesFreelancer && (int) $ownerRatesFreelancer->rating > 0)

{{ __('dash.Rated by') }}: {{ $ownerRatesFreelancer->ratedBy->name ?? '—' }}

{{ __('dash.Rating comment') }}: @if($ownerRatesFreelancer->comment) {{ $ownerRatesFreelancer->comment }} @else @endif

{{ optional($ownerRatesFreelancer->created_at)->format('Y-m-d H:i') }}

@endif
{{ __('dash.Freelancer to owner rating') }}
@include('admin.components.rating_stars', ['rating' => optional($freelancerRatesOwner)->rating]) @if($freelancerRatesOwner && (int) $freelancerRatesOwner->rating > 0)

{{ __('dash.Rated by') }}: {{ $freelancerRatesOwner->ratedBy->name ?? '—' }}

{{ __('dash.Rating comment') }}: @if($freelancerRatesOwner->comment) {{ $freelancerRatesOwner->comment }} @else @endif

{{ optional($freelancerRatesOwner->created_at)->format('Y-m-d H:i') }}

@endif
@endif @php $projectAttachments = $project->getMedia('projects'); @endphp @if($projectAttachments->isNotEmpty())

{{ __('Attachments') }}

@foreach($projectAttachments as $media) @php $mime = (string) $media->mime_type; $isPdf = str_contains($mime, 'pdf'); $isImage = str_contains($mime, 'image'); $url = asset($media->getUrl()); @endphp
@if($isPdf) {{ $media->file_name }} @elseif($isImage) {{ $media->file_name }} @else {{ $media->file_name }} @endif
@endforeach
@endif @if($project->questions->count() > 0)

{{ trans('Project Questions') }}

    @foreach($project->questions as $question)
  • {{ $question->question }}
  • @endforeach
@endif

{{ trans('Project invitation recipients') }} {{ $project->invitations->count() }}

@if(in_array($project->status, [\App\Models\Project::PENDING, \App\Models\Project::APPROVED, \App\Models\Project::RUNNING], true) && $project->category_id && ($project->invitations->count() > 0 || !$project->is_private))
@csrf
@endif
@if($project->invitations->count() > 0)
@foreach($project->invitations as $index => $invitation) @endforeach
# {{ trans('Freelancer') }} {{ trans('Freelancer speciality') }} {{ trans('Email') }} {{ trans('Invitation send status') }} {{ trans('Invitation response status') }} {{ trans('Sent at') }}
{{ $index + 1 }} @if($invitation->freelancer) {{ $invitation->freelancer->name }} @else {{ trans('User not found') }} (ID: {{ $invitation->freelancer_id }}) @endif {{ optional(optional($invitation->freelancer)->category)->name ?? '—' }} {{ optional($invitation->freelancer)->email ?? '—' }} @if($invitation->is_sent) {{ trans('Invitation sent') }} @else {{ trans('Invitation pending send') }} @endif @php $hasOffer = isset($offersByUserId) && $offersByUserId->has((int) $invitation->freelancer_id); @endphp @if($hasOffer) {{ trans('Offer submitted') }} @else {{ trans('No offer yet') }} @endif @if($invitation->sent_at) {{ $invitation->sent_at->format('Y-m-d H:i') }} @else @endif
@else

{{ trans('No project invitations for this project') }}

@endif
@if($project->offers->count() > 0)

{{ trans('Project Offers') }} {{ $project->offers->count() }}

@foreach($project->offers as $offer) @php $statusColorMap = [ 'accepted' => 'success', 'running' => 'primary', 'completed' => 'success', 'rejected' => 'danger', 'cancelled' => 'danger', 'closed' => 'secondary', 'pending' => 'warning', ]; $statusColor = $statusColorMap[$offer->status] ?? 'warning'; @endphp
#{{ $offer->id }} {{ $offer->user->name }} {{ $offer->user->email }} {{ $offer->user->galleries_count ?? 0 }} {{ trans('Works') }}
{{ $offer->getCurrentStatus() }} {{ $offer->created_at->diffForHumans() }}
{{-- Payment Info --}}

{{ trans('Payment Type') }}: {{ $offer->payment_type == 'full' ? trans('Full Payment') : trans('Installments') }}

{{ trans('Total Amount') }}: {{ $offer->total }}

@if($offer->service_fees)

{{ trans('Service Fees') }}: {{ $offer->service_fees }}

@endif
{{-- Hourly Info --}}
@if($offer->hours_number)

{{ trans('Hours Number') }}: {{ $offer->hours_number }}

@endif @if($offer->hour_cost)

{{ trans('Hour Cost') }}: {{ $offer->hour_cost }}

@endif

{{ trans('Delivery Time') }}: @if($offer->delivery_days) {{ $offer->delivery_days }} {{ trans('Day') }} @elseif($offer->time) {{ $offer->time->name }} @else - @endif

{{-- Timestamps --}}
@if($offer->approved_at)

{{ trans('Approved At') }}: {{ \Carbon\Carbon::parse($offer->approved_at)->format('Y-m-d H:i') }}

@endif @if($offer->rejected_at)

{{ trans('Rejected At') }}: {{ \Carbon\Carbon::parse($offer->rejected_at)->format('Y-m-d H:i') }}

@endif @if($offer->completed_at)

{{ trans('Completed At') }}: {{ \Carbon\Carbon::parse($offer->completed_at)->format('Y-m-d H:i') }}

@endif @if($offer->cancelled_at)

{{ trans('Cancelled At') }}: {{ \Carbon\Carbon::parse($offer->cancelled_at)->format('Y-m-d H:i') }}

@endif
{{-- Notes --}} @if($offer->notes)
{{ trans('Notes') }}:

{{ $offer->notes }}

@endif {{-- Answers --}} @if($offer->answers && count($offer->answers) > 0)
{{ trans('Offer Answers') }} ({{ count($offer->answers) }})
    @foreach($offer->answers as $question => $answer)
  • {{ $question }}: {{ $answer }}
  • @endforeach
@endif {{-- Installments --}} @if($offer->payment_type == 'part' && $offer->installments->count() > 0)
{{ trans('Installments') }} ({{ $offer->installments->count() }})
@foreach($offer->installments as $i => $installment) @php $instColorMap = [ 'pending' => 'warning', 'running' => 'primary', 'pending_completed' => 'info', 'completed' => 'success', 'cancelled' => 'danger', ]; $instColor = $instColorMap[$installment->status] ?? 'secondary'; @endphp @endforeach
# {{ trans('Amount') }} {{ trans('Due Date') }} {{ trans('Delivery Days') }} {{ trans('Status') }} {{ trans('Description') }}
{{ $i + 1 }} {{ $installment->amount ?? '-' }} {{ $installment->due_date ?? '-' }} {{ $installment->delivery_days ? $installment->delivery_days . ' ' . trans('Day') : '-' }} {{ trans($installment->status ?? '-') }} {{ $installment->description ?? '-' }}
@endif
@endforeach
@endif

{{ trans('Update Status') }}

@csrf
@if($project->status == \App\Models\Project::REJECTED) {{ trans('No actions available for rejected projects') }} @endif
@if(!in_array($project->status, [\App\Models\Project::REJECTED, \App\Models\Project::CANCELLED, \App\Models\Project::CLOSED, \App\Models\Project::COMPLETED])) @endif

{{ trans('Project Owner') }}

@php $owner = $project->user; @endphp

{{ trans('Name') }}: {{ $owner->name }}

{{ trans('Email') }}: {{ $owner->email }}

التخصص: {{ optional($owner->category)->name ?? '—' }}

{{ trans('Account Type') }}: @if((int) $owner->type === \App\Models\User::TYPE_FREELANCER) {{ trans('Freelancer') }} @elseif((int) $owner->type === \App\Models\User::TYPE_PROJECT_OWNER) أصحاب مشاريع @else — @endif

{{ trans('Country') }}: {{ optional($owner->country)->name ?? '—' }}

@if($project->is_direct || $project->is_private)

{{ trans('Project Recipient') }}

@if($project->is_direct) @php $clientName = trim(($project->client_first_name ?? '') . ' ' . ($project->client_last_name ?? '')); $invitationUrl = $project->invitation_token ? (route('view.register') . '?invitation=' . $project->invitation_token) : null; @endphp

{{ trans('Client name') }}: {{ $clientName !== '' ? $clientName : '—' }}

{{ trans('Client email') }}: {{ $project->client_email ?? '—' }}

{{ trans('Invitation status') }}: {{ $project->invitation_status ?? '—' }}

{{ trans('Invitation link') }}: @if($invitationUrl) {{ trans('Open') }} @else @endif


{{ trans('Invitation sender') }}:

@if($project->freelancer) @php $recipient = $project->freelancer; @endphp

{{ trans('Name') }}: {{ $recipient->name }}

{{ trans('Email') }}: {{ $recipient->email ?? '—' }}

التخصص: {{ optional($recipient->category)->name ?? '—' }}

{{ trans('Account Type') }}: @if((int) $recipient->type === \App\Models\User::TYPE_FREELANCER) {{ trans('Freelancer') }} @elseif((int) $recipient->type === \App\Models\User::TYPE_PROJECT_OWNER) أصحاب مشاريع @else — @endif

{{ trans('Country') }}: {{ optional($recipient->country)->name ?? '—' }}

@elseif($project->freelancer_id)

{{ trans('User not found') }} (ID: {{ $project->freelancer_id }})

@else

@endif @else @if($project->freelancer) @php $recipient = $project->freelancer; @endphp

{{ trans('Name') }}: {{ $recipient->name }}

{{ trans('Email') }}: {{ $recipient->email ?? '—' }}

التخصص: {{ optional($recipient->category)->name ?? '—' }}

{{ trans('Account Type') }}: @if((int) $recipient->type === \App\Models\User::TYPE_FREELANCER) {{ trans('Freelancer') }} @elseif((int) $recipient->type === \App\Models\User::TYPE_PROJECT_OWNER) أصحاب مشاريع @else — @endif

{{ trans('Country') }}: {{ optional($recipient->country)->name ?? '—' }}

@elseif($project->freelancer_id)

{{ trans('User not found') }} (ID: {{ $project->freelancer_id }})

@else

@endif @endif
@endif
@endsection @section('scripts') @include('admin.partials.reject-reason-field-scripts') @endsection