ldc-crm/resources/views/customers/show.blade.php
2023-06-26 09:24:29 +02:00

128 lines
6 KiB
PHP

@extends('layouts.app')
@section('title', sprintf('%s - %s', __('models.classes.customers'), Str::ucfirst(__('aperçu'))))
@section('description', __('Aperçu d\'un :model', ['model' => __('models.classes.customers')]))
@section('metaIndex', 'noindex,nofollow')
@section('breadcrumb', request()->route()->getName())
@section('content')
<div class="card border-0">
<div class="card-header bg-light">
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center">
<div class="d-flex flex-row align-items-start">
@can('viewAny', \App\Models\Customer::class)
<a href="{{ route('customers.index') }}"
class="btn btn-primary text-decoration-none me-2"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="{{ __('Retourner sur la liste des :model', ['model' => __('models.classes.customers')]) }}"
data-bs-toggle="tooltip">
<i class="fa-solid fa-arrow-left"></i>
</a>
@endcan
@include('breadcrumbs.breadcrumb-body')
</div>
<div class="col-12 col-md-4 d-flex justify-content-center justify-content-md-end align-items-center">
<form id="customerDelete"
action="{{ route('customers.delete', ['customer' => $customerInfos->customer_id, 'brand' => $customerInfos->brand_id]) }}"
method="POST">
@csrf
@method('DELETE')
@can('delete', \App\Models\Customer::class)
<button class="btn btn-danger"
title="{{ __('Supprimer ce :model', ['model' => Str::singular(__('models.classes.customers'))]) }}"
data-bs-toggle="tooltip">
<i class="fa-solid fa-trash"></i>
@endcan
</button>
</form>
</div>
</div>
</div>
<div class="card-body bg-white">
<div class="row justify-content-center">
<div class="col">
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center py-0 mb-2">
<h1 class="h2">{{ __('Informations du client') }} {{ $customerInfos->firstname }} {{ $customerInfos->lastname }} - {{ Str::singular(__('models.classes.brands')) }} {{ $customerInfos->brand->name }}</h1>
</div>
</div>
</div>
<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 ? "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 ? "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>
</div>
</div>
@endsection