Files
c-cms-legacy/resources/views/admin/user/profil.blade.php
2019-08-04 09:56:40 -04:00

136 lines
5.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@extends('layouts.admin.main')
@section('content')
<div @if ($user->id == \Auth::User()->id) class="col-md-12 col-lg-9" @else class="col-sm-12" @endif>
<div class="card">
<div class="card-body">
@if (session('status'))
<div class="sufee-alert alert with-close alert-success alert-dismissible fade show">
<span class="badge badge-pill badge-success">Félicitation</span>
{{session('status')}}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
@endif
<div class="col-sm-6">
<div class="mx-auto d-block">
<img class="rounded-circle mx-auto d-block" src="/assets/admin/images/avatar/user-{{\Auth::User()->avatar}}.jpg" alt="Card image cap" style="height:12rem">
<h5 class="text-sm-center mt-2 mb-1">{{\Auth::User()->fullname()}}</h5>
<div class="location text-sm-center"><i class="fa fa-id-card-o" aria-hidden="true"></i> {{\App\Rank::find(\Auth::User()->rank)->name}}</div>
</div>
</div>
<div class="col-sm-6 text-center">
<br>
<div class="col-md-12">
<p>{{\App\Rank::find($user->job)->name}}</p>
<hr>
</div>
<div class="col-md-6">
<p>
Genre<br>
@if ($user->sexe == "m")
<i class="fa fa-mars fa-2x" aria-hidden="true" style="color:#0080FF"></i>
@elseif($user->sexe == "f")
<i class="fa fa-venus fa-2x" aria-hidden="true" style="color:#FE2EF7"></i>
@else
<i class="fa fa-genderless fa-2x" aria-hidden="true"></i>
@endif
</p>
</div>
<div class="col-md-6">
<p>
Age<br>
@if ($user->age != "Inconnu")
{{$user->age}} ans
@else
Inconnu
@endif
</p>
</div>
<div class="col-md-12">
<p>Téléphone<br>
@if ($user->telephone != "Inconnu")
@php
$data = '+'.$user->telephone;
if(preg_match( '/^\+\d(\d{3})(\d{3})(\d{4})$/',$data,$matches))
{
$result = $matches[1] . '-' .$matches[2] . '-' . $matches[3];
echo $result;
}
@endphp
@else
Inconnu
@endif
</p>
</div>
<div class="col-md-12">
<p>Adresse<br>
{{$user->adress}}
</p>
</div>
</div>
<hr>
<div class="col-md-10 offset-md-1">
<p class="text-center">Dernières activitées de l'utilisateur</p>
<table class="table table-striped">
<thead class="thead-default">
<tr>
<th>Horodatage</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@foreach ($user->logs()->take(6)->get() as $log)
<tr>
<td scope="row">{{$log->created_at}}</td>
<td>{{$log->action}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@if ($user->id == \Auth::User()->id)
<div class="col-md-12 col-lg-3">
<div class="card">
<div class="card-body">
<a name="changepsw" id="changepsw" class="btn btn-warning btn-block" href="/admin/profil/password" role="button">Modifier mon mot de passe</a>
<a name="changepsw" id="changepsw" class="btn btn-secondary btn-block" href="/admin/profil/avatar" role="button">Modifier ma photo de profil</a>
<a name="changepsw" id="changepsw" class="btn btn-secondary btn-block" href="/admin/profil/phone" role="button">Modifier mon numéro de téléphone</a>
<a name="changepsw" id="changepsw" class="btn btn-secondary btn-block" href="/admin/profil/adress" role="button">Modifier mon adresse</a>
<a name="changepsw" id="changepsw" class="btn btn-primary btn-block" href="/admin/profil/preference" role="button">Modifier mes préférences</a>
<a name="changepsw" id="changepsw" class="btn btn-danger btn-block" href="/logout" role="button">Déconnexion</a>
</div>
</div>
</div>
@endif
@endsection
@section('breadcrumb')
<div class="breadcrumbs">
<div class="col-sm-4">
<div class="page-header float-left">
<div class="page-title">
<h1>Profil d'utilisateur</h1>
</div>
</div>
</div>
<div class="col-sm-8">
<div class="page-header float-right">
<div class="page-title">
<ol class="breadcrumb text-right">
<li class="active">Utilisateur/Profil</li>
</ol>
</div>
</div>
</div>
</div>
@endsection
@section('scripts')
@endsection