Edit Material Design Dashboard

This commit is contained in:
Mathieu Lagace
2019-08-15 19:48:41 -04:00
parent 9f85296cea
commit 1419032b64
22 changed files with 1203 additions and 5525 deletions

View File

@@ -1,112 +1,108 @@
@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="row">
<div @if ($user->id == \Auth::User()->id) class="col-md-12 col-lg-7 col-xl-8" @else class="col-sm-12" @endif>
<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 class="row">
<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">
<div class="row mt-3">
<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>
</div>
<hr>
<div class="col-md-10 offset-md-1 mt-3">
<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>
</div>
@endif
@if ($user->id == \Auth::User()->id)
<div class="col-md-12 col-lg-5 col-xl-4">
<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
</div>
@endsection
@section('breadcrumb')