diff --git a/header/sae.h b/header/sae.h index 32b4604..efeafb7 100644 --- a/header/sae.h +++ b/header/sae.h @@ -131,8 +131,8 @@ void afficheNbPlacesDep(VilleIut *tiut[], int nbVilles, char nomDept[]); int existeVille( VilleIut *tiut[], char ville[], int nbvilles ); void menuAdmin(VilleIut *tiut[], int nbVilles); -void afficherCandidat(Candidat candidat); -void afficherCandidats(Candidat *candidats, int nbCandidats); +void afficherUnCandidat(Candidat candidat); +void afficherCandidats(Candidat **candidats, int nbCandidats); int creerCandid(Candidat tCand[], int nbCandidats); ListeDeptV2 configurationDeptV2( ListeDept ldept ); diff --git a/source/sae.c b/source/sae.c index e20dcf4..535eb96 100644 --- a/source/sae.c +++ b/source/sae.c @@ -701,22 +701,27 @@ void menuAdmin(VilleIut **villeIut, int nbVilles) * @brief Affiche les informations d'un candidat * @param candidat Le candidat à afficher */ -/* void afficherCandidat(Candidat candidat) + void afficherUnCandidat(Candidat candidat) { - printf("Numéro du candidat : %d\n", candidat.numero); - printf("Nom : %s\n", candidat.nom); - printf("Prénom : %s\n", candidat.prenom); - printf("Notes : %.2f %.2f %.2f %.2f\n", candidat.notes[0], candidat.notes[1], candidat.notes[2], candidat.notes[3]); - printf("Nombre de choix : %d\n", candidat.nbChoix); - for (int i = 0; i < candidat.nbChoix; i++) + int c = 1; + printf("Candidat numero %7d ", candidat.numero); + printf(" | Nom : %10s | ", candidat.nom); + printf(" Prenom : %10s | ", candidat.prenom); + printf(" | Notes : %2f %2f %2f %2f | ", candidat.notes[0], candidat.notes[1], candidat.notes[2], candidat.notes[3]); + printf(" Nombre de choix : %d\n\n", candidat.nbChoix); + + printf(" \n Choix du candidat :\n"); + printf( " -------------------\n\n"); + + while ( candidat.lchoix != NULL ) { - printf("Choix %d :\n", i + 1); - printf(" Ville : %s\n", candidat.choix[i].ville); - printf(" Département : %s\n", candidat.choix[i].departement); - printf(" Décision du département : %d\n", candidat.choix[i].decisionDepartement); - printf(" Validation : %d\n", candidat.choix[i].validationCandidat); + printf(" %d.) Iut : %10s ; departement : %10s ; decision Departement : %d ; validation candidat : %d\n", + candidat.lchoix -> ville, candidat.lchoix -> departement, candidat.lchoix -> decisionDepartement, + candidat.lchoix -> validationCandidat); } -} */ + + printf(" \n\n"); +} /** * @brief Affiche la liste des candidats @@ -724,68 +729,67 @@ void menuAdmin(VilleIut **villeIut, int nbVilles) * @param candidats Le tableau de candidats à afficher * @param nbCandidats Le nombre de candidats dans le tableau */ -/*void afficherCandidats(Candidat *candidats, int nbCandidats) +void afficherCandidats(Candidat **candidats, int nbCandidats) { for (int i = 0; i < nbCandidats; i++) - { - printf("\nCandidat %d :\n", i + 1); - afficherCandidat(candidats[i]); - } + printf("\nCandidat numero %8d | Nom : %10s | Prenom : %10s \n", candidats[i] -> numero, + candidats[i] -> nom, candidats[i] -> prenom); } -int creerCandid(Candidat tCand[], int nbCandidats) -{ - int i=0; - Candidat c; - printf("Rentrez le numéro du candidat :"); - scanf("%d%*c",&c.numero); - while(i