ldc-crm/resources/views/bo/pages/customers/show.blade.php

128 lines
6.6 KiB
PHP

@extends('bo.layout', ['brParam' => $customerInfos])
@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">
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
<div class="d-flex align-items-start flex-row">
@can('viewAny', \App\Models\Customer::class)
<a class="btn btn-primary text-decoration-none me-2" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-toggle="tooltip"
href="{{ route('bo.customers.index') }}"
title="{{ __('Retourner sur la liste des :model', ['model' => __('models.classes.customers')]) }}">
<i class="fa-solid fa-arrow-left"></i>
</a>
@endcan
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $customerInfos])
</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('bo.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" data-bs-toggle="tooltip"
title="{{ __('Supprimer ce :model', ['model' => Str::singular(__('models.classes.customers'))]) }}">
<i class="fa-solid fa-trash"></i>
@endcan
</button>
</form>
</div>
</div>
</div>
<div class="card-body">
<div class="row justify-content-center">
<div class="col">
<div class="d-flex justify-content-between flex-md-nowrap align-items-center mb-2 flex-wrap py-0">
<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-sm table-bordered table-striped table">
<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)->isoFormat('DD\/MM\/YYYY') }}</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->label() }}</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)->isoFormat('DD\/MM\/YYYY à HH:mm') }}
</td>
@else
<td></td>
@endif
</tr>
<tr>
<td><b>{{ __('Dernière connexion') }}</b></td>
<td>{{ \Carbon\Carbon::parse($customerLogin->last_connection)->isoFormat('DD\/MM\/YYYY à HH:mm') }}
</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)->isoFormat('DD\/MM\/YYYY à HH:mm') }}</td>
</tr>
<tr>
<td><b>{{ __('Date de modification') }}</b></td>
<td>{{ \Carbon\Carbon::parse($customerInfos->updated_at)->isoFormat('DD\/MM\/YYYY à HH:mm') }}</td>
</tr>
</tbody>
</table>
</div>
</div>
@endsection