This commit is contained in:
jleroy2023
2024-11-20 15:48:47 +01:00
parent e6954b6ce3
commit 0ff9ac68b2
4 changed files with 15 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ class AdminController extends AbstractController
$userConnect = $token?->getUser(); $userConnect = $token?->getUser();
return $this->render('admin/user.html.twig', [ return $this->render('admin/user.html.twig', [
'profile' => $userConnect, 'profile' => $userConnect,
'participants' => $participantRepository->findAll(), 'participants' => $participantRepository->getAll(),
'controller_name' => 'AdminController', 'controller_name' => 'AdminController',
]); ]);
} }

View File

@@ -4,6 +4,7 @@ namespace App\Repository;
use App\Entity\Participant; use App\Entity\Participant;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\Tools\Pagination\Paginator;
use Doctrine\Persistence\ManagerRegistry; use Doctrine\Persistence\ManagerRegistry;
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
@@ -33,6 +34,16 @@ class ParticipantRepository extends ServiceEntityRepository
return $newProfile; return $newProfile;
} }
public function getAll(): Paginator
{
$qb = $this->createQueryBuilder('p')
->addSelect('s')
->leftJoin('p.site', 's')
->getQuery();
return new Paginator($qb);
}
// /** // /**
// * @return Participant[] Returns an array of Participant objects // * @return Participant[] Returns an array of Participant objects
// */ // */

View File

@@ -49,6 +49,7 @@
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nom</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nom</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Prénom</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Prénom</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Pseudo</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Pseudo</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Site</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Téléphone</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Téléphone</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Email</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Email</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Administrateur</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Administrateur</th>
@@ -64,6 +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.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.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.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.telephone }}</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">{{ participant.email }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900"> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">

View File

@@ -22,7 +22,7 @@
<strong>Inscriptions max :</strong> {{ sortie.nbInscriptionsMax }}<br> <strong>Inscriptions max :</strong> {{ sortie.nbInscriptionsMax }}<br>
<strong>Infos :</strong> {{ sortie.infosSortie }} <strong>Infos :</strong> {{ sortie.infosSortie }}
</p> </p>
<a href="{{ path('sortie_show', { id: sortie.idSortie }) }}" class="btn btn-primary btn-sm">Voir plus</a> <a href="#" class="btn btn-primary btn-sm">Voir plus</a>
</div> </div>
</div> </div>
</div> </div>