@extends('layouts.acorn.acorn_admin_app') @section('header_styles') @endsection @section('content') @php use Illuminate\Support\Facades\DB; @endphp
@php $isActive = true; @endphp

{{ $project->title }}

@if($project->state == 'PENDING') Pending @elseif($project->state == 'IN_PROGRESS') Inprogress @elseif($project->state == 'COMPLETED') Completed @endif
@if($project->state == 'PENDING')
@endif

Project No

{{ $project->project_no }}

Budget Allocation

{{ number_format($project->budget, 2) }}LKR

Project Duration

Start Date: {{ \Carbon\Carbon::parse($project->start_date)->format('Y-m-d') }}

Estimated End Date: {{ \Carbon\Carbon::parse($project->end_date)->format('Y-m-d') }}

Project Description

{{ $project->description }}

{{--

Administrative Remarks

{{ $project->remark ?? 'No explicit operational adjustments noted.' }}

--}}
@php $statusList = ['PENDING', 'IN_PROGRESS', 'COMPLETED']; @endphp @if($project->state == 'IN_PROGRESS')
Project Activities
@forelse($project->longTermProjectActivities as $activity) @php $totalWeight = 0; $completedWeight = 0; $totalWeight += $activity->activity_weight ?? 0; if ($activity->state === 'COMPLETED') { $completedWeight += $activity->activity_weight ?? 0; } elseif ($activity->state === 'IN_PROGRESS') { // nothing added unless completed } foreach ($activity->longTermProjectSubActivities as $sub) { $totalWeight += $sub->sub_activity_weight ?? 0; if ($sub->state === 'COMPLETED') { $completedWeight += $sub->sub_activity_weight ?? 0; } } $percentage = $totalWeight > 0 ? round(($completedWeight / $totalWeight) * 100) : 0; if ($activity->state === 'COMPLETED') { $percentage = 100; } @endphp
{{ $activity->activity_name }}
{{-- {{ $completedWeight }} --}}

{{ $activity->activity_description }}

{{ $percentage }}%
@forelse($activity->longTermProjectComments as $comment)
{{ \Carbon\Carbon::parse($comment->created_at)->format('Y-m-d H:i') }} {{ $comment->stackholder_category ?? 'EXTERNAL' }}
{{ $comment->comments }}
@empty {{--

No comments yet

--}}

@endforelse
{{--
--}}
@forelse($activity->longTermProjectSubActivities as $sub) @php $status = $sub->status ?? 'pending'; @endphp
{{ $sub->sub_activity_name }}
LKR {{ number_format($sub->cost, 2) }} @php $state = $sub->state; $stateClasses = [ 'PENDING' => 'bg-secondary-subtle text-secondary border', 'IN_PROGRESS' => 'bg-warning-subtle text-warning border', 'COMPLETED' => 'bg-success-subtle text-success border', 'DELETED' => 'bg-danger-subtle text-danger border', ]; $stateLabel = ucwords(strtolower(str_replace('_', ' ', $state))); @endphp {{ $stateLabel }}

{{ $sub->sub_activity_description }}

@if($sub->state == 'PENDING') @endif @if($sub->state == 'IN_PROGRESS') @endif
@if($sub->longTermProjectComments && $sub->longTermProjectComments->count() > 0)
@csrf
You can select multiple files. Allowed: PDF, DOC, DOCX, JPG, PNG
@endif
@empty

No sub activities available

@endforelse
@empty

No activities available

@endforelse @else
Project Not Started yet
@endif
@endsection