ldc-boutique-cnc/resources/views/bo/magasins/index.blade.php
2022-11-25 14:42:18 +01:00

50 lines
2.2 KiB
PHP

@extends('layouts.bo-layout')
@section('content')
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Points de retrait <small class="text-muted">Liste</small></h1>
<!-- TODO : Tester quand il y aura des produits la suppression d'une gamme qui en a -->
@if ($errors->any())
@foreach($errors->all() as $error)
<span class="float-center text-danger">{{ $error }}</span>
@endforeach
@endif
<a href="{{route('bo.magasins.create')}}" class="btn btn-primary float-right">Ajouter</a>
</div>
<table class="table">
<thead>
<th scope="col"></th>
<th scope="col">Nom</th>
<th scope="col">Email de contact</th>
<th scope="col">Email de confirmation <br>de commande</th>
<th scope="col">Adresse</th>
<th scope="col">Téléphone</th>
<th scope="col"></th>
</thead>
<tbody>
@foreach ($magasins as $magasin)
<tr>
<td></td>
<td>{{$magasin->name}}</td>
<td>{{$magasin->email_contact}}</td>
<td>{{$magasin->email_confirm}}</td>
<td>{{$magasin->address}}, {{$magasin->postcode}} {{$magasin->city}}</td>
<td>{{$magasin->phone}}</td>
<td class="text-center">
<a href="{{route('bo.magasins.edit', $magasin->id)}}" class="btn btn-sm btn-primary">Éditer</a>
<a href="{{route('bo.creneaux.settings', $magasin->id)}}" class="btn btn-sm btn-secondary">Editer Créneaux de collecte</a>
<form action="{{route('bo.magasins.destroy', $magasin->id)}}" method="POST" class="d-inline">
@method('DELETE')
@csrf
<input type="submit" class="btn btn-sm btn-danger" value="Supprimer"
onclick="return confirm('Êtes-vous sûr(e) ?')">
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
@endsection