Tendances
This commit is contained in:
parent
bb35ba61c6
commit
e52fe7b3e2
@ -43,7 +43,7 @@ ul {
|
|||||||
}
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
padding-bottom: 20px;
|
padding-bottom: 4%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-custom {
|
.btn-custom {
|
||||||
|
@ -72,4 +72,14 @@ final class PlatsController extends AbstractController
|
|||||||
|
|
||||||
return $this->redirectToRoute('app_plats_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_plats_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[Route('/bestplats', name: 'app_plats_best', methods: ['GET'])]
|
||||||
|
public function getBest(PlatsRepository $platsRepository): Response
|
||||||
|
{
|
||||||
|
$bestplats = $platsRepository->findBestPlats();
|
||||||
|
// dd($bestplats);
|
||||||
|
return $this->render('plats/best.html.twig', [
|
||||||
|
'plat' => $bestplats,
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,4 +40,14 @@ class PlatsRepository extends ServiceEntityRepository
|
|||||||
// ->getOneOrNullResult()
|
// ->getOneOrNullResult()
|
||||||
// ;
|
// ;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
public function findBestPlats(): ?Plats
|
||||||
|
{
|
||||||
|
return $this->createQueryBuilder('p')
|
||||||
|
->orderBy('p.Nb_de_commande', 'DESC')
|
||||||
|
->setMaxResults(1)
|
||||||
|
->getQuery()
|
||||||
|
->getOneOrNullResult();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="/" class="btn-custom icon-container">
|
<a href="/plats/bestplats" class="btn-custom icon-container">
|
||||||
<i class="icon-medium"> {{ ux_icon('fluent-emoji-high-contrast:ten-oclock') }}</i>
|
<i class="icon-medium"> {{ ux_icon('fluent-emoji-high-contrast:ten-oclock') }}</i>
|
||||||
<span>Voir tendances</span>
|
<span>Voir tendances</span>
|
||||||
</a>
|
</a>
|
||||||
|
59
templates/plats/best.html.twig
Normal file
59
templates/plats/best.html.twig
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block head %}
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
|
||||||
|
<link href="https://fonts.cdnfonts.com/css/brittany-signature" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block stylesheets %}
|
||||||
|
<link rel="stylesheet" href="{{ asset('css/ControllerVues/list.css') }}"> <!-- Ajout du fichier CSS -->
|
||||||
|
<link rel="stylesheet" href="{{ asset('css/ControllerVues/edit.css') }}"> <!-- Ajout du fichier CSS -->
|
||||||
|
<link rel="stylesheet" href="{{ asset('css/Index/index.css') }}"> <!-- Ajout du fichier CSS -->
|
||||||
|
<link rel="stylesheet" href="{{ asset('css/Compte/index.css') }}"> <!-- Ajout du fichier CSS -->
|
||||||
|
<link rel="stylesheet" href="{{ asset('css/GestionUtilisateurs/GestionUtilisateurs.css') }}"> <!-- Ajout du fichier CSS -->
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block container_modal %}
|
||||||
|
|
||||||
|
<div id="container_modal">
|
||||||
|
<h1>Tendance</h1>
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<th>Nom</th>
|
||||||
|
<th>Description</th>
|
||||||
|
<th>Prix</th>
|
||||||
|
<th>Categorie</th>
|
||||||
|
<th>Statut</th>
|
||||||
|
<th>Nb_de_commande</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% if plat %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ plat.id }}</td>
|
||||||
|
<td>{{ plat.Nom }}</td>
|
||||||
|
<td>{{ plat.Description }}</td>
|
||||||
|
<td>{{ plat.Prix }}</td>
|
||||||
|
<td>{{ plat.Categorie }}</td>
|
||||||
|
<td>{{ plat.Statut ? 'Yes' : 'No' }}</td>
|
||||||
|
<td>{{ plat.NbDeCommande }}</td>
|
||||||
|
</tr>
|
||||||
|
{% else %}
|
||||||
|
<tr>
|
||||||
|
<td colspan="8">Aucun enregistrement trouvé</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user