@extends('layouts.app')
@section('title', 'Chantiers')
@section('breadcrumb', 'Opérations / Chantiers')
@php
$oldFormData = [
'form_mode' => old('_form_mode', 'create'),
'id' => old('_chantier_id',''),
'nom' => old('nom', ''),
'code' => old('code', ''),
'client_id' => old('client_id', ''),
'statut' => old('statut', 'demarrage'),
'budget' => old('budget', '0'),
'date_debut' => old('date_debut', ''),
'date_fin' => old('date_fin', ''),
'notes' => old('notes', ''),
];
@endphp
@section('content')
{{-- ── PAGE HEADER ──────────────────────────────────────────── --}}
{{-- ── STATS ────────────────────────────────────────────────── --}}
{{ $stats['en_cours'] }}
En cours
{{ $stats['cloture'] }}
Clôturés
{{ $stats['sav'] }}
SAV / Maintenance
{{ $stats['pause'] }}
En pause
{{-- ── FILTRES ──────────────────────────────────────────────── --}}
{{-- ── TABLEAU ──────────────────────────────────────────────── --}}
| Code | Nom | Client | Statut |
Budget | Début | Fin | Actions |
@forelse($chantiers as $ch)
@php
$sc = ['demarrage'=>'badge-info','en_cours'=>'badge-success','pause'=>'badge-warning','cloture'=>'badge-muted','sav'=>'badge-danger'];
$chData = [
'id' => $ch->id,
'nom' => $ch->nom,
'code' => $ch->code ?? '',
'client_id' => (string)($ch->client_id ?? ''),
'statut' => $ch->statut,
'budget' => (string)$ch->budget,
'date_debut' => $ch->date_debut?->format('Y-m-d') ?? '',
'date_fin' => $ch->date_fin?->format('Y-m-d') ?? '',
'notes' => $ch->notes ?? '',
];
@endphp
{{ $ch->code }} |
{{ $ch->nom }}
|
{{ $ch->client?->nom ?? '-' }} |
{{ ucfirst(str_replace('_',' ',$ch->statut)) }} |
{{ number_format($ch->budget,3,',',' ') }} |
{{ $ch->date_debut?->format('d/m/Y') ?? '-' }} |
{{ $ch->date_fin?->format('d/m/Y') ?? '-' }} |
|
@empty
| Aucun chantier |
@endforelse
@if($chantiers->hasPages())
{{ $chantiers->links() }}
@endif
{{-- ══════════════════════════════════════════════════════════
OVERLAY
══════════════════════════════════════════════════════════ --}}
{{-- ══════════════════════════════════════════════════════════
MODAL FORMULAIRE : NOUVEAU / MODIFIER
══════════════════════════════════════════════════════════ --}}
@if($errors->isNotEmpty())
@foreach($errors->all() as $e)
{{ $e }}
@endforeach
@endif
{{-- ══════════════════════════════════════════════════════════
MODAL APERÇU / CONSULTER
══════════════════════════════════════════════════════════ --}}
{{-- ══════════════════════════════════════════════════════════
MODAL CHANGER STATUT
══════════════════════════════════════════════════════════ --}}
{{-- /x-data --}}
@endsection