set V1
This commit is contained in:
@@ -25,6 +25,10 @@ use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
||||
|
||||
class AdminController extends AbstractController
|
||||
{
|
||||
private ParticipantRepository $participantRepository;
|
||||
public function __construct(ParticipantRepository $participantRepository){
|
||||
$this->participantRepository = $participantRepository;
|
||||
}
|
||||
#[Route('/admin', name: 'app_admin')]
|
||||
public function index(TokenStorageInterface $tokenStorage): Response
|
||||
{
|
||||
@@ -38,13 +42,14 @@ class AdminController extends AbstractController
|
||||
|
||||
//Gestion des utilisateurs
|
||||
#[Route('/admin/user', name: 'app_adminUser')]
|
||||
public function adminUser(ParticipantRepository $participantRepository, TokenStorageInterface $tokenStorage): Response
|
||||
public function adminUser(TokenStorageInterface $tokenStorage): Response
|
||||
{
|
||||
$token = $tokenStorage->getToken();
|
||||
$userConnect = $token?->getUser();
|
||||
$participants = $this->participantRepository->findAll();
|
||||
return $this->render('admin/user.html.twig', [
|
||||
'profile' => $userConnect,
|
||||
'participants' => $participantRepository->getAll(),
|
||||
'participants' => $participants,
|
||||
'controller_name' => 'AdminController',
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -37,8 +37,8 @@ class ParticipantRepository extends ServiceEntityRepository
|
||||
public function getAll(): Paginator
|
||||
{
|
||||
$qb = $this->createQueryBuilder('p')
|
||||
->addSelect('s')
|
||||
->leftJoin('p.site', 's')
|
||||
->addSelect('site')
|
||||
->leftJoin('p.site', 'site')
|
||||
->getQuery();
|
||||
return new Paginator($qb);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.nom }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.prenom }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.pseudo }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.site.nom }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.site ? participant.site.nom : "N/A" }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.telephone }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.email }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||
@@ -93,6 +93,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{# Tableau user en attente #}
|
||||
<div class="overflow-x-auto bg-white rounded shadow mt-16">
|
||||
<table class="min-w-full bg-white divide-y divide-gray-200">
|
||||
|
||||
Reference in New Issue
Block a user