push des vues new + css sur les vues
This commit is contained in:
parent
3a423d53a8
commit
d86bce8a0e
@ -14,6 +14,7 @@ use Symfony\Component\Routing\Attribute\Route;
|
||||
#[Route('/clients')]
|
||||
final class ClientsController extends AbstractController
|
||||
{
|
||||
|
||||
#[Route(name: 'app_clients_index', methods: ['GET'])]
|
||||
public function index(ClientsRepository $clientsRepository): Response
|
||||
{
|
||||
@ -62,7 +63,7 @@ final class ClientsController extends AbstractController
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_clients_delete', methods: ['POST'])]
|
||||
public function delete(Request $request, Clients $client, EntityManagerInterface $entityManager): Response
|
||||
public function delete(Request $request, Clients $client, EntityManagerInterface $entityManager, int $id, ): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$client->getId(), $request->getPayload()->getString('_token'))) {
|
||||
$entityManager->remove($client);
|
||||
|
@ -9,5 +9,4 @@
|
||||
|
||||
<a href="{{ path('app_clients_index') }}">back to list</a>
|
||||
|
||||
{{ include('clients/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
|
@ -28,7 +28,10 @@
|
||||
<td>{{ client.Email }}</td>
|
||||
<td>{{ client.Telephone }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_clients_show', {'id': client.id}) }}">show</a>
|
||||
<form method="post" action="{{ path('app_clients_delete', {'id': client.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ client.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
||||
<a href="{{ path('app_clients_edit', {'id': client.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -1,38 +0,0 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Clients{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Clients</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ client.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Prenom</th>
|
||||
<td>{{ client.Prenom }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Nom</th>
|
||||
<td>{{ client.Nom }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Email</th>
|
||||
<td>{{ client.Email }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Telephone</th>
|
||||
<td>{{ client.Telephone }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_clients_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_clients_edit', {'id': client.id}) }}">edit</a>
|
||||
|
||||
{{ include('clients/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
@ -9,5 +9,5 @@
|
||||
|
||||
<a href="{{ path('app_commandes_index') }}">back to list</a>
|
||||
|
||||
{{ include('commandes/_delete_form.html.twig') }}
|
||||
|
||||
{% endblock %}
|
||||
|
@ -25,7 +25,10 @@
|
||||
<td>{{ details_commande.Quantite }}</td>
|
||||
<td>{{ details_commande.PrixUnitaire }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_details_commande_show', {'id': details_commande.id}) }}">show</a>
|
||||
<form method="post" action="{{ path('app_details_commande_delete', {'id': details_commande.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ details_commande.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
||||
<a href="{{ path('app_details_commande_edit', {'id': details_commande.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -1,30 +0,0 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}DetailsCommande{% endblock %}
|
||||
<link rel="stylesheet" href="{{ asset('css/ControllerVues/list.css') }}"> <!-- Ajout du fichier CSS -->
|
||||
{% block body %}
|
||||
<h1>DetailsCommande</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ details_commande.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Quantite</th>
|
||||
<td>{{ details_commande.Quantite }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>PrixUnitaire</th>
|
||||
<td>{{ details_commande.PrixUnitaire }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_details_commande_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_details_commande_edit', {'id': details_commande.id}) }}">edit</a>
|
||||
|
||||
{{ include('details_commande/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
@ -32,7 +32,10 @@
|
||||
<td>{{ plat.Statut ? 'Yes' : 'No' }}</td>
|
||||
<td>{{ plat.NbDeCommande }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_plats_show', {'id': plat.id}) }}">show</a>
|
||||
<form method="post" action="{{ path('app_plats_delete', {'id': plat.id}) }}" onsubmit="return confirm('êtes vous sur de supprimer ce plat?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ plat.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
||||
<a href="{{ path('app_plats_edit', {'id': plat.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -1,46 +0,0 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Plats{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Plats</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ plat.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Nom</th>
|
||||
<td>{{ plat.Nom }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Description</th>
|
||||
<td>{{ plat.Description }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Prix</th>
|
||||
<td>{{ plat.Prix }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Categorie</th>
|
||||
<td>{{ plat.Categorie }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Statut</th>
|
||||
<td>{{ plat.Statut ? 'Yes' : 'No' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Nb_de_commande</th>
|
||||
<td>{{ plat.NbDeCommande }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_plats_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_plats_edit', {'id': plat.id}) }}">edit</a>
|
||||
|
||||
{{ include('plats/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
@ -32,7 +32,10 @@
|
||||
<td>{{ reduction.DateDebut ? reduction.DateDebut|date('Y-m-d H:i:s') : '' }}</td>
|
||||
<td>{{ reduction.DateFin ? reduction.DateFin|date('Y-m-d H:i:s') : '' }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_reductions_show', {'id': reduction.id}) }}">show</a>
|
||||
<form method="post" action="{{ path('app_reductions_delete', {'id': reduction.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ reduction.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
||||
<a href="{{ path('app_reductions_edit', {'id': reduction.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -1,46 +0,0 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Reductions{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Reductions</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ reduction.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Description</th>
|
||||
<td>{{ reduction.Description }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Prix</th>
|
||||
<td>{{ reduction.Prix }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Pourcentage</th>
|
||||
<td>{{ reduction.Pourcentage }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>MontantFixe</th>
|
||||
<td>{{ reduction.MontantFixe }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>DateDebut</th>
|
||||
<td>{{ reduction.DateDebut ? reduction.DateDebut|date('Y-m-d H:i:s') : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>DateFin</th>
|
||||
<td>{{ reduction.DateFin ? reduction.DateFin|date('Y-m-d H:i:s') : '' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_reductions_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_reductions_edit', {'id': reduction.id}) }}">edit</a>
|
||||
|
||||
{{ include('reductions/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
@ -21,7 +21,10 @@
|
||||
<td>{{ reservation.DateHeure ? reservation.DateHeure|date('Y-m-d H:i:s') : '' }}</td>
|
||||
<td>{{ reservation.NbDePrsn }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_reservations_show', {'id': reservation.id}) }}">show</a>
|
||||
<form method="post" action="{{ path('app_reservations_delete', {'id': reservation.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ reservation.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
||||
<a href="{{ path('app_reservations_edit', {'id': reservation.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -1,30 +0,0 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Reservations{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Reservations</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ reservation.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>DateHeure</th>
|
||||
<td>{{ reservation.DateHeure ? reservation.DateHeure|date('Y-m-d H:i:s') : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Nb_de_prsn</th>
|
||||
<td>{{ reservation.NbDePrsn }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_reservations_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_reservations_edit', {'id': reservation.id}) }}">edit</a>
|
||||
|
||||
{{ include('reservations/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user