ldc-legaulois/resources/views/bo/traceability/index.blade.php

98 lines
3.6 KiB
PHP

@extends('layouts.bo')
@section('styles')
<style>
.response-1 {
background-color: #C4E384;
}
.response-2 {
background-color: #FFDE6A;
}
.response-3 {
background-color: #C0E7F7;
}
.response-4 {
background-color: #E7374B;
}
.response-5 {
background-color: #CCCCCC;
}
.indication-type {
height: 80px;
margin-bottom: 10px;
margin-left: 0px;
margin-right: 0px;
}
</style>
@endsection
@section('content')
<div class="card">
<div class="card-header">
Tracabilités
</div>
<div class="card-body">
<form action="{{route('bo.traceability.filter')}}" method="POST">
@method('PUT')
@csrf
<div class="form-group">
<label class="col-form-label" for="date_debut">Date de début :</label>
<input class="form-control" type="date" id="date_debut" name="date_debut" value="{{$dateDebut !== null ? $dateDebut : ''}}">
<label class="col-form-label" for="date_fin">Date de fin :</label>
<input class="form-control" type="date" id="date_fin" name="date_fin" value="{{$dateFin !== null ? $dateFin : ''}}">
</div>
<div class="text-center">
<p>
<button class="btn btn-success" type="submit">Filtrer</button>
@if ($dateDebut !== null || $dateFin !== null)
<a href="{{route('bo.traceability.index')}}" class="btn btn-danger">Supprimer les filtres</a>
@else
<a href="{{route('bo.traceability.index')}}" class="btn btn-dark disabled">Supprimer les filtres</a>
@endif
</p>
</div>
</form>
<div class="container">
<p class="h5 text-center">Nombre total de requêtes : {{$c[1] + $c[2] + $c[3] + $c[4] + $c[5]}}</p>
</div>
<table class="indication-type table text-center">
@foreach ($responseType as $idType => $nomType)
<td class="response-{{$idType}} align-middle" style="width: 20%;">
<span class="h3">{{$c[$idType]}}</span>
</br><b>{{$nomType}}</b>
</td>
@endforeach
</table>
<table class="table text-center">
<thead class="thead-dark">
<tr>
<th scope="col">Date de recherche</th>
<th scope="col">Code saisi</th>
<th scope="col">Réponse</th>
</tr>
</thead>
<tbody>
@foreach($t as $traca)
<tr>
<th>{{$traca->created_at->format('d/m/Y à H:i')}}</th>
<td>{{$traca->code}}</td>
<td class="response-{{$traca->response_type}}">
@if ($traca->response_tpe !== 1)
{{$responseType[$traca->response_type]}}
@else
{{$traca->response}}
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
{{$t->links()}}
</div>
</div>
@endsection