@extends('layouts.app') @section('title', 'Project tracking · '.$project->name) @push('head') @endpush @section('content') @php $labourSum = $project->dailyUpdates->sum('labour_count'); $milestonesDone = $project->milestones->where('status', 'done')->count(); $openIss = $project->trackingIssues->whereIn('status', ['Open','In Progress'])->count(); $lastDiary = $project->dailyUpdates->first(); @endphp
@if ($errors->any())
@foreach ($errors->all() as $err)

{{ $err }}

@endforeach
@endif
Back to tracking

{{ $project->name }}

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

Progress {{ $project->progress_percentage }}% @if($project->due_date) · Due {{ $project->due_date->format('M j, Y') }} @endif

@php $ex = ['project_id' => $project->id]; @endphp PDF Excel Project

Current progress

{{ $project->progress_percentage }}%

Milestones done

{{ $milestonesDone }} / {{ $project->milestones->count() }}

Open issues

{{ $openIss }}

Last diary

{{ $lastDiary?->update_date?->format('M j, Y') ?? '—' }}

Milestone timeline

@forelse($project->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

{{ $m->name }}

{{ ucfirst($st) }}

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

@if(in_array($st, ['pending','active','delayed'], true))
@csrf @method('PUT')
@endif
@empty

No milestones for this project.

@endforelse

Daily site updates

@foreach($project->dailyUpdates as $d) @endforeach
Date Labour Status
{{ $d->update_date?->format('M j, Y') }} {{ $d->labour_count }} {{ $d->status }} @if(in_array($d->status, ['Submitted','Reviewed','Draft'], true))
@csrf @method('PUT')
@endif @if(!$d->isReadOnly()) @endif

Progress history

@forelse($project->progressSnapshots as $sn)
{{ $sn->recorded_at?->format('M j, Y H:i') }} {{ $sn->progress_percentage }}% {{ $sn->source_type }}{{ $sn->notes ? ' · '.\Illuminate\Support\Str::limit($sn->notes, 40) : '' }}
@empty

No progress snapshots yet.

@endforelse

Issues & delays

@forelse($project->trackingIssues as $iss)
{{ $iss->title }}

{{ $iss->issue_type }} · {{ $iss->severity }} · {{ $iss->status }}

@if(in_array($iss->status, ['Open','In Progress'], true)) @endif
@empty

No issues logged.

@endforelse

Site resources summary

Labour (diary totals)

Total worker-days recorded: {{ $labourSum }}

Independent of payroll; for site visibility only.

Materials issued (inventory)

Issue movements: {{ (int) ($issuesSummary->cnt ?? 0) }} lines · Qty {{ number_format((float) ($issuesSummary->qty ?? 0), 2) }}

Open inventory

Documents

Upload / browse documents
{{-- Create milestone --}} @foreach($project->milestones as $mil) @endforeach @endsection @push('scripts') @endpush