ldc-cocotte/resources/views/bo/orders.blade.php
2021-04-13 18:45:36 +02:00

52 lines
2.1 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>
@if (session('success'))
<span class="float-center text-success">{{ session('success') }}</span>
@endif
</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>
<a data-fancybox data-trigger="customer-info" data-type="ajax" data-src="{{ route('bo.get-customer-info', $order->customer->id) }}" data-src="#customer-info" href="javascript:;">
Infos Client
</a>
</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 --}}
<a href="{{route('bo.order-detail', $order->reference)}}" class="btn btn-sm btn-primary"><i class="fas fa-info"></i></a>
@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->reference)}}" class="btn btn-sm btn-danger"><i class="fas fa-times"></i></a>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
{{-- Popup --}}
@endsection
@section('scripts')
<script>
</script>
@endsection