@extends('dashboard.layout') @section('content')

Project Overview

Basic project information and status

{{ $project->status }}

{{ $project->name ?? 'Unnamed Project' }}

{{ $project->created_at->format('F d, Y') }}

{{ $project->updated_at->format('F d, Y') }}

{{ $project->id }}

{{ $project->request_id }}

{{ $project->user_id }}

Services

Requested services and their status

@php $services = is_array($project->services) ? $project->services : json_decode($project->services, true) ?? []; $totalServices = count($services); $completedServices = collect($services)->where('status', 'Complete')->count(); $progress = $totalServices > 0 ? round(($completedServices / $totalServices) * 100) : 0; @endphp
{{ $completedServices }}/{{ $totalServices }} Completed
@if ($totalServices > 0)
@foreach ($services as $key => $service)

{{ $service['name'] ?? 'Unknown Service' }}

ID: {{ $service['id'] ?? 'N/A' }}

@if (!empty($service['documents'])) @else

No documents found.

@endif @php $serviceStatus = $service['status'] ?? 'Not Started'; @endphp
{{ $serviceStatus }}
@endforeach
@else

No services found for this project

@endif

Document

Project requirements and documents

@php $documents = is_array($project->documents_data) ? $project->documents_data : json_decode($project->documents_data, true) ?? []; $totalDocs = count($documents); $completedDocs = collect($documents)->where('status', true)->count(); @endphp
{{ $completedDocs }}/{{ $totalDocs }} Submitted
@if ($totalDocs > 0)
@foreach ($documents as $document)

{{ $document['name'] ?? 'Unknown Document' }}

@if ($document['status'] ?? false) Submitted @else Not Submitted @endif @if ($document['type'] == 'file') @endif
@endforeach
@else

No requirements found for this project

@endif

Client Information

Contact details

@php $contactInfo = is_array($project->serviceRequest->contact_info) ? $project->serviceRequest->contact_info : json_decode($project->serviceRequest->contact_info, true) ?? []; @endphp

{{ $contactInfo['name'] ?? ($project->user->name ?? 'N/A') }}

{{ $contactInfo['email'] ?? ($project->user->email ?? 'N/A') }}

{{ $contactInfo['phone'] ?? 'N/A' }}

{{ $contactInfo['company'] ?? 'N/A' }}

Financial Information

Payment details

Total Amount: {{ number_format($project->serviceRequest->total_price ?? 0, 2) }} SR
Amount Paid: {{ number_format($project->amount_paid ?? 0, 2) }} SR
Pending Amount: {{ number_format(($project->serviceRequest->total_price ?? 0) - ($project->amount_paid ?? 0), 2) }} SR
@if (($project->amount_paid ?? 0) >= ($project->serviceRequest->total_price ?? 0)) Fully Paid @elseif(($project->amount_paid ?? 0) > 0) Partially Paid @else Unpaid @endif

Invoices

@foreach ($payents as $item)

#INV-{{ str_pad($item->id, 5, '0', STR_PAD_LEFT) }}

{{ number_format($item->amount, 2) }} SR

@php $statusColors = [ 'paid' => 'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400', 'pending' => 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400', 'overdue' => 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400', 'draft' => 'bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-400', ]; $statusColor = $statusColors[$item->status] ?? $statusColors['draft']; @endphp {{ $item->status }}

@if ($item->status == 'unpaid') Pay now @endif
@endforeach @if (count($payents) === 0)

No invoices found

You don't have any invoices yet.

@endif @if (count($payents) > 0)
Showing 1 to {{ count($payents) }} of {{ count($payents) }} results
@endif
@endsection