39 lines
1.6 KiB
PHP
39 lines
1.6 KiB
PHP
@extends('layouts.bo-layout')
|
|
|
|
@section('content')
|
|
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
|
<h1 class="h2">Commandes</h1>
|
|
</div>
|
|
<table class="table">
|
|
<thead>
|
|
<th scope="col">Utilisateur</th>
|
|
<th scope="col">Référence</th>
|
|
<th scope="col">Date</th>
|
|
<th scope="col">Total en €</th>
|
|
<th scope="col">Status</th>
|
|
<th></th>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($orders as $order)
|
|
<tr>
|
|
<td>{{$order->user->email}}</td>
|
|
<td>{{$order->reference}}</td>
|
|
<td>{{\Carbon\Carbon::parse($order->date)->format('d/m/Y')}}</td>
|
|
<td>{{number_format($order->total, 2, ',', ' ')}}€</td>
|
|
<td>{{$order->status->label}}</td>
|
|
<td class="text-center">
|
|
{{-- L'id du status 6 est le status "Retirée", la dernière étape d'une commande --}}
|
|
@if ($order->status_id < 6)
|
|
<a href="{{route('bo.change-order-status', $order->reference)}}" class="btn btn-sm btn-primary"><i class="fas fa-forward"></i></a>
|
|
<a href="{{route('bo.cancel-order', $order->id)}}" class="btn btn-sm btn-danger"><i class="fas fa-times"></i></a>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
@endsection
|
|
|
|
@section('scripts')
|
|
<script src="https://kit.fontawesome.com/2327d60f96.js" crossorigin="anonymous"></script>
|
|
@endsection
|