@extends('back.layout.app') @section('title', config('app.name') . ' - Paramétrage des périodes') @php $breadcrumb = 'plan-media.index'; @endphp @section('content')

Paramétrage des périodes

{{-- Header proposition --}}
{{ $proposal->created_at }}

{{ $proposal->customer->name }}

@php $periodsCount = $proposal->operationsWithPeriod()->count(); $operationsCount = $proposal->operations()->count(); @endphp @if($operationsCount > 0 && $periodsCount === $operationsCount) URL du plan média disponible @else URL non disponible @if($operationsCount === 0) Aucune opération @else {{ $periodsCount }}/{{ $operationsCount }} périodes définies @endif @endif
{{ $proposal->operations->count() }} Total Offres
{{ $proposal->countSelectedPeriods() }} Périodes sélectionnées
{{-- Formulaire périodes --}}

Périodes disponibles

Définissez les périodes disponibles pour chaque plan média.
@csrf @method('PUT')
@foreach($proposal->operations as $operation) @if(!$loop->first)
@endif
{{-- En-tête opération --}}
{{ $operation->media?->name ?? '—' }} @if($operation->media?->type) {{ $operation->media->type->name }} @endif
{{-- Sélecteurs début / fin --}}
{{-- Grille des mois --}} @php $savedPeriod = !empty($operation->pivot->period) ? array_values(json_decode($operation->pivot->period, true)) : []; $savedMonths = array_column($savedPeriod, 'month'); @endphp
@foreach($period as $key => $date) @php $isChecked = in_array($date->format('Y-m'), $savedMonths); $monthIndex = array_search($date->format('Y-m'), $savedMonths); $textValue = $monthIndex !== false ? ($savedPeriod[$monthIndex]['text'] ?? '') : ''; @endphp
@endforeach
@endforeach
@endsection @push('scripts') @endpush