FestinHegre/templates/commandes/index.html.twig

47 lines
1.6 KiB
Twig
Raw Normal View History

2024-11-21 15:11:11 +01:00
{% extends 'base.html.twig' %}
{% block title %}Commandes index{% endblock %}
{% block stylesheets %}
2024-11-21 17:03:32 +01:00
<link rel="stylesheet" href="{{ asset('css/ControllerVues/list.css') }}"> <!-- Ajout du fichier CSS -->
2024-11-21 15:11:11 +01:00
{% endblock %}
{% block body %}
<h1>Commandes index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>DateHeure</th>
<th>Statut</th>
<th>Total</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for commande in commandes %}
<tr>
<td>{{ commande.id }}</td>
<td>{{ commande.DateHeure ? commande.DateHeure|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ commande.Statut ? 'Yes' : 'No' }}</td>
<td>{{ commande.Total }}</td>
<td>
2024-11-21 17:03:32 +01:00
<form method="post" action="{{ path('app_commandes_delete', {'id': commande.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ commande.id) }}">
<button class="btn">Delete</button>
</form>
2024-11-21 15:11:11 +01:00
<a href="{{ path('app_commandes_edit', {'id': commande.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="5">pas de commande crée</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_commandes_new') }}">Créer une nouvelle commande</a>
{% endblock %}