Welcome to your Dashboard
Please use the dropdown selector menu inside the toolbar interface directly above to populate project data fields.
{{ $project->title }}
{{-- Active Long-Term Profile --}}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.' }}
Project Activities
@forelse($project->longTermProjectActivities as $activity) @php $totalWeight = 0; $completedWeight = 0; // 1. Activity weight $totalWeight += $activity->activity_weight ?? 0; if ($activity->state === 'COMPLETED') { $completedWeight += $activity->activity_weight ?? 0; } elseif ($activity->state === 'IN_PROGRESS') { // nothing added unless completed } // 2. Sub activities weight foreach ($activity->longTermProjectSubActivities as $sub) { $totalWeight += $sub->sub_activity_weight ?? 0; if ($sub->state === 'COMPLETED') { $completedWeight += $sub->sub_activity_weight ?? 0; } } // echo '';
// print_r($totalWeight);
// echo '';
// 3. Final percentage
$percentage = $totalWeight > 0
? round(($completedWeight / $totalWeight) * 100)
: 0;
// 4. Force full completion
if ($activity->state === 'COMPLETED') {
$percentage = 100;
}
@endphp
{{ $activity->activity_name }}
{{-- {{ $completedWeight }} --}}{{ $activity->activity_description }}
No comments yet
--}} @endforelse{{ $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 }}
No sub comments
@endforelseUploaded Documents
No sub activities available
@endforelseNo activities found for this project.
@endforelse