@extends('layouts.app') @section('title', 'Progress Tracking') @push('head') @endpush @section('content') @php $fq = array_filter(request()->only(['project_id','milestone_status','daily_status','issue_status','date_from','date_to','q','issue_type','severity']), fn ($v) => $v !== null && $v !== ''); $exportQs = http_build_query($fq); $milestoneStatus = request('milestone_status', request('status', 'all')); @endphp
@if ($errors->any())

Please fix the following:

@endif

Progress Tracking

Milestones, site updates and project progress

Excel PDF Diary Excel Diary PDF
Clear Issue filters: type & severity apply to the issues list in reports export.

Active projects

{{ $stats['active_projects'] }}

Avg progress

{{ $stats['avg_progress'] }}%

Delayed milestones

{{ $stats['delayed_milestones'] }}

Updates today

{{ $stats['updates_today'] }}

{{-- Milestones timeline --}}

Project milestones

@if($milestones->isEmpty())

No milestones found

Add project milestones to begin tracking progress.

@else
@foreach($milestones as $m) @php $delayed = $m->isDelayed(); $st = $m->status; if ($st === 'done') { $ic = 'fa-check'; $bg = 'bg-emerald-100 text-emerald-600'; } elseif ($st === 'cancelled') { $ic = 'fa-xmark'; $bg = 'bg-slate-100 text-slate-500'; } elseif ($delayed || $st === 'delayed') { $ic = 'fa-triangle-exclamation'; $bg = 'bg-red-100 text-red-600'; } elseif ($st === 'active') { $ic = 'fa-hammer'; $bg = 'bg-blue-100 text-blue-600'; } else { $ic = 'fa-clock'; $bg = 'bg-slate-100 text-slate-400'; } @endphp
@if(!$loop->last)
@endif

{{ $m->name }}

{{ $m->project?->name }} · Planned {{ $m->planned_date?->format('M j, Y') }} @if($m->actual_date) · Actual {{ $m->actual_date->format('M j, Y') }} @endif

{{ ucfirst($st) }} @if(in_array($m->priority, ['High','Critical'], true)) {{ $m->priority }} @endif @if($delayed && $st !== 'done' && $st !== 'cancelled') At risk @endif
@if($m->description)

{{ $m->description }}

@endif
@if(in_array($st, ['pending','active','delayed'], true))
@csrf @method('PUT')
@endif Edit @if($st !== 'done' && $st !== 'cancelled') @endif
@endforeach
@endif
{{-- Project progress --}}

Project progress

@if($projects->isEmpty())
No active projects to track.
@else @foreach($projects as $p) @php $lastUp = $p->dailyUpdates->first(); $bar = 'bg-blue-500'; if ($p->progress_percentage >= 100) $bar = 'bg-emerald-500'; elseif ($p->status === 'At Risk') $bar = 'bg-red-500'; elseif ($p->status === 'On Hold') $bar = 'bg-amber-400'; elseif ($p->status === 'On Track') $bar = 'bg-emerald-500'; @endphp
{{ $p->name }}

@if($p->client?->company_name){{ $p->client->company_name }}@endif @if($p->location) · {{ $p->location }} @endif

{{ $p->progress_percentage }}%
{{ $p->status }} @if($p->due_date)Due {{ $p->due_date->format('M j, Y') }}@endif @if($lastUp)Last diary {{ $lastUp->update_date?->format('M j, Y') }}@endif
@endforeach @endif

Recent daily site updates

@if($diary->isEmpty())

No daily site updates submitted yet.

@else @foreach($diary as $d) @php $badge = match($d->status) { 'Draft' => 's', 'Submitted' => 'b', 'Reviewed' => 'v', 'Approved' => 'g', 'Rejected' => 'r', default => 's', }; @endphp @endforeach
Date Project Work Labour Status
{{ $d->update_date?->format('M j, Y') }} {{ $d->project?->name }} {{ \Illuminate\Support\Str::limit($d->work_completed, 56) }} {{ $d->labour_count }} {{ $d->status }} @if($d->issues_noted || $d->delays_noted) @endif @if(in_array($d->status, ['Submitted','Reviewed','Draft'], true))
@csrf @method('PUT')
@endif @if(!$d->isReadOnly()) @endif
@endif

Open issues & delays

@php $issuesBySev = $issues->groupBy('severity'); @endphp @if($issues->isEmpty())

No open issues or delays

Keep up the good work on site.

@else @foreach(['Critical','High','Medium','Low'] as $sev) @if($issuesBySev->has($sev))

{{ $sev }}

@foreach($issuesBySev->get($sev) as $iss)

{{ $iss->title }}

{{ $iss->severity }}

{{ $iss->project?->name }} · {{ $iss->issue_type }} · {{ $iss->status }} · Reported {{ $iss->reported_date?->format('M j, Y') }} @if($iss->impact_days !== null)· Impact {{ $iss->impact_days }}d@endif

@if(in_array($iss->status, ['Open','In Progress'], true)) @endif
@endforeach @endif @endforeach @endif
{{-- Modals --}} @endsection @push('scripts') @endpush