@extends('layouts.app') @section('content')
| Project Name | Units | Start Date | End Date | Project Value | Status | Actions |
|---|---|---|---|---|---|---|
| {{ $project->project_name }} | @php $units = is_array($project->unit) ? $project->unit : (is_string($project->unit) ? [$project->unit] : []); @endphp @if(count($units) > 0) @foreach($units as $unit) {{ $unit }} @endforeach @else No units assigned @endif | {{ $project->start_date->format('d/m/Y') }} | {{ $project->end_date->format('d/m/Y') }} | RM {{ number_format($project->project_value, 2) }} | @php $now = now(); $status = ''; $badgeClass = ''; if ($now < $project->start_date) { $status = 'Upcoming'; $badgeClass = 'badge-info'; } elseif ($now >= $project->start_date && $now <= $project->end_date) { $status = 'Active'; $badgeClass = 'badge-success'; } else { $status = 'Completed'; $badgeClass = 'badge-secondary'; } @endphp {{ $status }} | |
| No projects found. | ||||||