@extends('adminlte::page')
@section('title', 'Project Management')
@include('partials.ui-polish')
@php
$currentSection = $sections[$section] ?? $sections['dashboard'];
$money = fn ($value) => number_format((float) $value, 0);
$badgeThemes = [
'Active' => 'success',
'Planning' => 'warning',
'Planned' => 'secondary',
'Scheduled' => 'primary',
'On Track' => 'success',
'Watch' => 'warning',
'In Progress' => 'info',
'Due Soon' => 'warning',
'Open' => 'danger',
'Monitoring' => 'warning',
'Recorded' => 'info',
'Draft' => 'secondary',
'In Review' => 'primary',
'On Hold' => 'warning',
'Completed' => 'success',
'Closed' => 'dark',
'Cancelled' => 'danger',
];
$badge = fn ($status) => $badgeThemes[$status] ?? 'secondary';
$projectStatuses = ['Planning', 'Active', 'On Hold', 'Completed', 'Closed'];
$activityStatuses = ['Planned', 'Scheduled', 'Active', 'In Progress', 'Completed', 'On Hold', 'Cancelled'];
$donorStatuses = ['Planning', 'Active', 'On Hold', 'Completed', 'Closed'];
$workPlanStatuses = ['Planning', 'Planned', 'On Track', 'Watch', 'In Progress', 'Completed', 'On Hold', 'Cancelled'];
$editableProjects = $projects->filter(fn ($project) => ! empty($project['id']));
$editableDonors = $donors->filter(fn ($donor) => ! empty($donor['id']));
$editableBudgets = $budgets->filter(fn ($budget) => ! empty($budget['id']));
$editableWorkPlans = $workPlans->filter(fn ($plan) => ! empty($plan['id']));
$editableActivities = $activities->filter(fn ($activity) => ! empty($activity['id']));
@endphp
@section('content_header')
Project Management
{{ $currentSection['label'] }} for projects, donors, budgets, activities, M&E, and reports
@can('projects.manage')
@if($section === 'projects')
@elseif($section === 'donors')
@elseif($section === 'budgets')
@elseif($section === 'work-plans')
@elseif($section === 'activities')
@endif
@endcan
Projects
Financial Reports
Project Reports
@stop
@section('content')
@push('css')
@endpush
@if(session('status'))
{{ session('status') }}
@endif
@if($errors->any())
{{ $errors->first() }}
@endif
@if($section === 'dashboard')
| Project |
Donor |
Manager |
Status |
Budget |
Progress |
@foreach($projects as $project)
|
{{ $project['name'] }}
{{ $project['code'] }}
|
{{ $project['donor'] }} |
{{ $project['manager'] }} |
{{ $project['status'] }} |
{{ $money($project['budget']) }} |
{{ $project['progress'] }}%
{{ $money($project['spent']) }} spent
|
@endforeach
@foreach($activities as $activity)
{{ $activity['activity'] }}
{{ $activity['status'] }}
{{ $activity['project'] }} - {{ $activity['location'] }} - {{ \Illuminate\Support\Carbon::parse($activity['date'])->format('M d, Y') }}
@endforeach
@foreach($risks as $risk)
{{ $risk['title'] }}
{{ $risk['severity'] }}
{{ $risk['project'] }} - owner: {{ $risk['owner'] }}
@endforeach
@endif
@if($section === 'projects')
@can('projects.manage')
@endcan
| Code |
Project |
Donor |
Manager |
Duration |
Status |
Budget |
Progress |
@can('projects.manage')
Actions |
@endcan
@foreach($projects as $project)
| {{ $project['code'] }} |
{{ $project['name'] }} |
{{ $project['donor'] }} |
{{ $project['manager'] }} |
{{ \Illuminate\Support\Carbon::parse($project['start_date'])->format('M d, Y') }} - {{ \Illuminate\Support\Carbon::parse($project['end_date'])->format('M d, Y') }} |
{{ $project['status'] }} |
{{ $money($project['budget']) }} |
{{ $project['progress'] }}%
|
@can('projects.manage')
@if(! empty($project['id']))
@else
Demo
@endif
|
@endcan
@endforeach
@can('projects.manage')
@foreach($editableProjects as $project)
@endforeach
@endcan
@endif
@if($section === 'donors')
@can('projects.manage')
@endcan
| Donor | Portfolio | Projects | Commitment | Status | @can('projects.manage')Action | @endcan
@foreach($donors as $donor)
| {{ $donor['name'] }} |
{{ $donor['portfolio'] }} |
{{ $donor['projects'] }} |
{{ $money($donor['commitment']) }} |
{{ $donor['status'] }} |
@can('projects.manage')
@if(! empty($donor['id']))
@else
Demo
@endif
|
@endcan
@endforeach
@can('projects.manage')
@foreach($editableDonors as $donor)
@endforeach
@endcan
@endif
@if($section === 'budgets')
@can('projects.manage')
@if($editableProjects->isEmpty())
Create a saved project first, then budget lines can be assigned to it.
@else
@endif
@endcan
| Project | Budget Line | Budget | Committed | Spent | Balance | @can('projects.manage')Action | @endcan
@foreach($budgets as $budget)
@php($balance = max((float) $budget['budget'] - (float) $budget['committed'] - (float) $budget['spent'], 0))
| {{ $budget['project'] }} |
{{ $budget['line'] }} |
{{ $money($budget['budget']) }} |
{{ $money($budget['committed']) }} |
{{ $money($budget['spent']) }} |
{{ $money($balance) }} |
@can('projects.manage')
@if(! empty($budget['id']))
@else
Demo
@endif
|
@endcan
@endforeach
@can('projects.manage')
@foreach($editableBudgets as $budget)
@endforeach
@endcan
@endif
@if($section === 'work-plans')
@can('projects.manage')
@if($editableProjects->isEmpty())
Create a saved project first, then work plan milestones can be assigned to it.
@else
@endif
@endcan
| Project | Period | Milestone | Owner | Status | Progress | @can('projects.manage')Action | @endcan
@foreach($workPlans as $plan)
| {{ $plan['project'] }} |
{{ $plan['period'] }} |
{{ $plan['milestone'] }} |
{{ $plan['owner'] }} |
{{ $plan['status'] }} |
{{ $plan['progress'] }}%
|
@can('projects.manage')
@if(! empty($plan['id']))
@else
Demo
@endif
|
@endcan
@endforeach
@can('projects.manage')
@foreach($editableWorkPlans as $plan)
@endforeach
@endcan
@endif
@if($section === 'activities')
@can('projects.manage')
@if($editableProjects->isEmpty())
Create a saved project first, then activities can be assigned to it.
@else
@endif
@endcan
| Date |
Project |
Activity |
Location |
Budget Line |
Owner |
Status |
@can('projects.manage')
Actions |
@endcan
@foreach($activities as $activity)
| {{ \Illuminate\Support\Carbon::parse($activity['date'])->format('M d, Y') }} |
{{ $activity['project'] }} |
{{ $activity['activity'] }} |
{{ $activity['location'] }} |
{{ $activity['budget_line'] }} |
{{ $activity['owner'] }} |
{{ $activity['status'] }} |
@can('projects.manage')
@if(! empty($activity['id']))
@else
Demo
@endif
|
@endcan
@endforeach
@can('projects.manage')
@foreach($editableActivities as $activity)
@endforeach
@endcan
@endif
@if($section === 'team-members')
| Staff | Project | Role | Department | Allocation |
@foreach($teamMembers as $member)
|
{{ $member['name'] }}
{{ $member['code'] }}
|
{{ $member['project'] }} |
{{ $member['role'] }} |
{{ $member['department'] }} |
{{ $member['allocation'] }}% |
@endforeach
@endif
@if($section === 'timesheets')
| Project | Staff Charging Time | Hours Recorded | Status |
@foreach($timesheetSummary as $row)
| {{ $row['project'] }} |
{{ $row['staff_count'] }} |
{{ number_format((float) $row['hours'], 2) }} |
{{ $row['status'] }} |
@endforeach
@can('hrm.timesheets.manage')
Open Timesheet Module
@endcan
@endif
@if($section === 'risks-issues')
| Project | Type | Title | Owner | Severity | Status | Due Date |
@foreach($risks as $risk)
| {{ $risk['project'] }} |
{{ $risk['type'] }} |
{{ $risk['title'] }} |
{{ $risk['owner'] }} |
{{ $risk['severity'] }} |
{{ $risk['status'] }} |
{{ \Illuminate\Support\Carbon::parse($risk['due_date'])->format('M d, Y') }} |
@endforeach
@endif
@if($section === 'deliverables')
| Project | Deliverable | Owner | Due Date | Status |
@foreach($deliverables as $deliverable)
| {{ $deliverable['project'] }} |
{{ $deliverable['deliverable'] }} |
{{ $deliverable['owner'] }} |
{{ \Illuminate\Support\Carbon::parse($deliverable['due_date'])->format('M d, Y') }} |
{{ $deliverable['status'] }} |
@endforeach
@endif
@if($section === 'documents')
| Project | Document | Type | Owner | Last Updated |
@foreach($documents as $document)
| {{ $document['project'] }} |
{{ $document['document'] }} |
{{ $document['type'] }} |
{{ $document['owner'] }} |
{{ \Illuminate\Support\Carbon::parse($document['updated_at'])->format('M d, Y') }} |
@endforeach
@endif
@if($section === 'indicators')
| Project | Indicator | Target | Actual | Unit | Status |
@foreach($indicators as $indicator)
@php($achievement = $indicator['target'] > 0 ? min(($indicator['actual'] / $indicator['target']) * 100, 100) : 0)
| {{ $indicator['project'] }} |
{{ $indicator['indicator'] }} |
{{ number_format((float) $indicator['target']) }} |
{{ number_format((float) $indicator['actual']) }} |
{{ $indicator['unit'] }} |
{{ $indicator['status'] }}
|
@endforeach
@endif
@if($section === 'financial-reports')
| Project | Budget | Spent | Committed | Balance | Open Advances |
@foreach($financialReports as $report)
| {{ $report['project'] }} |
{{ $money($report['budget']) }} |
{{ $money($report['spent']) }} |
{{ $money($report['committed']) }} |
{{ $money($report['balance']) }} |
{{ $money($report['advances_open']) }} |
@endforeach
@endif
@if($section === 'project-reports')
| Report | Scope | Period | Owner | Status |
@foreach($projectReports as $report)
| {{ $report['name'] }} |
{{ $report['scope'] }} |
{{ $report['period'] }} |
{{ $report['owner'] }} |
{{ $report['status'] }} |
@endforeach
@endif
@stop