@extends('layouts.app') @section('page-pretitle', __('Management')) @section('page-title', __('Project Details')) @section('content')

{{ $project->ref_no ?? '-'}}

@if ($project->is_registration) Registered @endif
{{-- Download All as PDF --}}
@php $previousUrl = url()->previous(); $bookmarkUrl = route('bookmark.index'); @endphp {{ __('Back') }}

{{ __('Project Description') }}

{{ $project->description }}

{{ __('Client') }}

{{ $project->client }}

{{ __('Scope') }}

{{ $project->scope->name ?? __('N/A') }}

{{ __('Project Type') }}

{{ $project->project_type->name ?? __('-') }}

{{ __('Project Phase') }}

{{ $project->project_phase->name ?? __('-') }}

{{ __('Received Year') }}

{{ $project->received_year ?? __('-') }}

{{ __('Start Date') }}

{{ $project->start_date ? $project->start_date->format('d-m-Y') : __('-') }}

{{ __('End Date') }}

{{ $project->end_date ? $project->end_date->format('d-m-Y') : __('-') }}

{{ __('Assignees') }}

@if ($project->assignees->isEmpty())

{{ __('No Assignees') }}

@else
@foreach ($project->assignees as $assignee)
{{ $assignee->name }}
@endforeach
@endif

{{ __('Submission Types') }}

@php function getStatusClass($statusName) { return match (strtolower($statusName)) { 'in progress' => 'badge bg-blue-lt', 'pending' => 'badge bg-red-lt', 'completed' => 'badge bg-green-lt', 'need review' => 'badge bg-yellow-lt', 'not yet submitted' => 'badge bg-cyan-lt', default => 'badge bg-secondary-lt', }; } @endphp @if ($project->submissionTypes->isEmpty())

{{ __('No Submission Types') }}

@else
@foreach($project->submissionTypes as $submissionType) @if($submissionType->pivot)

{{ strtoupper($submissionType->name) }}

  • {{ __('Date:') }} {{ $submissionType->pivot->submission_date ? \Carbon\Carbon::parse($submissionType->pivot->submission_date)->format('d-m-Y') : __('-') }}
  • {{ __('File No / ID:') }} {{ $submissionType->pivot->file_no ?? __('-') }}
  • {{ __('Status:') }} @php $statusName = $submissionType->pivot->status_id ? $statuses->firstWhere('id', $submissionType->pivot->status_id)?->name : null; @endphp @if($statusName) {{ Str::title($statusName) }} @else {{ __('-') }} @endif
  • {{ __('Remarks:') }} {{ $submissionType->pivot->remarks ?? __('-') }}
@endif @endforeach
@endif

{{ __('Remarks') }}

{{ $project->remarks ?? __('No Remark') }}

{{-- Project Timeline Table --}}

{{ __('Timeline') }}

@php // Fetch and order timelines $timelines = $project->timelines; @endphp @if($timelines->isEmpty())

{{ __('No Timeline') }}

@else
@foreach($timelines as $timeline) @endforeach
{{ __('Date') }} {{ __('Remark') }}
@if ($timeline->timeline_date) {{ \Carbon\Carbon::parse($timeline->timeline_date)->format('d M Y') }} @else - @endif
{{ $timeline->remark }}
@endif
@push('styles') @endpush {{-- Images --}}

Uploaded Images

@php $images = $project->documents->filter(fn($doc) => Str::endsWith($doc->path, ['jpg', 'jpeg', 'png']))->values(); @endphp @if($images->isEmpty())

No images uploaded

@else @foreach($images->chunk(4) as $row) @endforeach @endif
{{-- Other Files --}}

Uploaded Files

@php // Only non-image files $files = $project->documents->filter(function($doc) { return Str::endsWith($doc->path, ['pdf', 'docx', 'txt', 'xls', 'xlsx', 'zip']); }); @endphp @if($files->isEmpty())

No files uploaded

@else
    @php $fileNumber = 1; @endphp @foreach ($files as $doc)
  1. {{ $fileNumber++ }}.
    {{-- File Icons --}} @if (Str::endsWith($doc->path, 'pdf')) @elseif (Str::endsWith($doc->path, ['docx', 'doc'])) @elseif (Str::endsWith($doc->path, ['xls', 'xlsx'])) @elseif (Str::endsWith($doc->path, 'zip')) @else @endif

    {{ $doc->original_name }}

  2. @endforeach
@endif
{{-- sidebar off canvas for important notes --}}
License & Renewal
@if ($project->notes->count())
    @foreach ($project->notes->sortBy('notes_duedate') as $note) @php $dueDate = \Carbon\Carbon::parse($note->notes_duedate); $isDueToday = $dueDate->isToday(); $isPastDue = $dueDate->isPast() && !$isDueToday; $isUrgent = $isDueToday || $isPastDue; // $cardBgClass = $isUrgent ? 'bg-danger-subtle' : ''; @endphp
  • @if ($isUrgent)
    @endif

    {{ ucfirst($note->notes) }}

    Due by {{ $dueDate->format('d M Y') }}
  • @endforeach
@else

No license & renewal found for this project.

@endif
@endsection