ldc-crm/resources/views/customers/show.blade.php
2021-08-02 17:22:56 +02:00

98 lines
4 KiB
PHP

@extends('layout.app')
@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">Informations du client {{ $customerInfos->firstname }} {{ $customerInfos->lastname }} - Marque {{ $customerInfos->brand->name }}</h1>
<a href="{{ route('customers') }}" class="btn btn-sm btn-primary float-right">Retour</a>
</div>
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<table class="table table-sm table-bordered table-striped">
<tbody>
<tr>
<td class="w-50"><b>Email</b></td>
<td class="w-50">{{ $customerInfos->customer->email }}</td>
</tr>
<tr>
<td><b>Prénom</b></td>
<td>{{ $customerInfos->firstname }}</td>
</tr>
<tr>
<td><b>Nom</b></td>
<td>{{ $customerInfos->lastname }}</td>
</tr>
<tr>
<td><b>Date de naissance</b></td>
<td>{{ \Carbon\Carbon::parse($customerInfos->birth_date)->format('d/m/Y') }}</td>
</tr>
<tr>
<td><b>Téléphone</b></td>
<td>{{ $customerInfos->phone }}</td>
</tr>
<tr>
<td><b>Adresse</b></td>
<td>{{ $customerInfos->address }}</td>
</tr>
<tr>
<td><b>Adresse complémentaire</b></td>
<td>{{ $customerInfos->address2 }}</td>
</tr>
<tr>
<td><b>Pays</b></td>
<td>{{ $customerInfos->country }}</td>
</tr>
<tr>
<td><b>Ville</b></td>
<td>{{ $customerInfos->city }}</td>
</tr>
<tr>
<td><b>Code postal</b></td>
<td>{{ $customerInfos->postcode }}</td>
</tr>
<tr>
<td><b>Abonné à la newsletter</b></td>
<td>{{ $customerInfos->opt_in === 1 ? "Oui" : "Non" }}</td>
</tr>
<tr>
<td><b>Date de la dernière modification de l'abonnement</b></td>
@if($customerInfos->customer->optInHistory()->orderBy('created_at', 'DESC')->exists())
<td>{{ \Carbon\Carbon::parse($customerInfos->customer->optInHistory()->orderBy('created_at', 'DESC')->first()->created_at)->format('d/m/Y à H:i') }}</td>
@else
<td></td>
@endif
</tr>
<tr>
<td><b>Dernière connexion</b></td>
<td>{{ \Carbon\Carbon::parse($customerLogin->last_connection)->format('d/m/Y à H:i') }}</td>
</tr>
<tr>
<td><b>Status du compte</b></td>
<td>{{ $customerLogin->status === 1 ? "Activé" : "Non activé" }}</td>
</tr>
<tr>
<td><b>Hashcode</b></td>
<td>{{ $customerInfos->hashcode }}</td>
</tr>
<tr>
<td><b>Date de création</b></td>
<td>{{ \Carbon\Carbon::parse($customerInfos->created_at)->format('d/m/Y à H:i') }}</td>
</tr>
<tr>
<td><b>Date de modification</b></td>
<td>{{ \Carbon\Carbon::parse($customerInfos->updated_at)->format('d/m/Y à H:i') }}</td>
</tr>
</tbody>
</table>
<form action="{{ route('customers.delete', ['customer' => $customerInfos->customer_id, 'brand' => $customerInfos->brand->id]) }}" method="POST" onsubmit="return confirm('{{ __('Êtes-vous sûr de vouloir supprimer cet utilisateur ?') }}');">
@csrf
@method('DELETE')
<input type="submit" value="{{ __('Supprimer') }}" class="btn btn-sm btn-danger">
</form>
@endsection