@extends('layouts.config_dashboard.app')

@section('content')
    <div class="container-fluid ">
        <div class="row">
            <div class="col-12">
                <div class="page-title-box">
                    <h4 class="page-title" style="font-size: 25px">Liste des Compagnies</h4>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="card">
                <div class="card-body">
                    <form style="display: inline" action="{{ route('Company.attach', $company->id) }}" method="post">
                        @csrf
                        @if ($company->step)
                            @foreach ($company->step as $step)
                                <div class="col-12 d-flex">
                                    <div class="col-6 mb-3">
                                        <label class="form-label">Etape</label>
                                        <div class="input-group flex-nowrap">
                                            <input type="text" value="{{ $step->step }}" readonly class="form-control"
                                                name="">
                                        </div>
                                    </div>
                                    <input type="hidden" value="{{ $step->id }}" class="form-control" name="step[]">

                                    <div style="margin-left: 17px !important;" class="col-4 mb-3 ">
                                        <label class="form-label">Delai :</label>
                                        <div class="input-group flex-nowrap">
                                            <input type="number" value="{{ $step->pivot->time ?? null }}"
                                                class="form-control" name="delai[]">
                                        </div>
                                    </div>
                                </div>
                            @endforeach
                        @endif
                        <button class="btn btn-success" type="submit">Affecter</button>

                    </form>
                </div>

            </div>
        </div>
    </div>
@endsection
