From 09565b4e455ba831c04df21ab5afcf5a5bf4e9f9 Mon Sep 17 00:00:00 2001 From: Alix JEUDI--LEMOINE Date: Sun, 1 Jan 2023 17:01:28 +0100 Subject: [PATCH] =?UTF-8?q?Modification=20menuAdmin=20&=20menuResponsable?= =?UTF-8?q?=20+=20appels=20modifi=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/I/un.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/I/un.c b/src/I/un.c index 34145eb..e113322 100644 --- a/src/I/un.c +++ b/src/I/un.c @@ -186,7 +186,7 @@ void menuCandidat(VilleIUT*** tiutPointer, ListeCandidats* listePointer, int* nb printf("\nRetour au menu principal...\n"); } -void menuResponsable(VilleIUT*** tiutPointer, int* nbVilles) { +void menuResponsable(VilleIUT*** tiutPointer, ListeCandidats* listePointer, int* nbVilles, int* nbCandidats) { //VilleIUT** tiut = *tiutPointer; char poubelle; // Permet de stocker les caractères aspirés en trop sur stdin lors du choix dans le menu int choix; @@ -205,11 +205,11 @@ void menuResponsable(VilleIUT*** tiutPointer, int* nbVilles) { while(choix != 9){ switch (choix) { case 1: - printf("Lister les candidatures...\n"); - // TODO - break; + printf("Lister les candidatures...\n"); + // TODO + break; case 2: - printf("Traitement des candidatures...\n"); + printf("Traiter les candidatures...\n"); // TODO break; default: @@ -232,7 +232,7 @@ void menuResponsable(VilleIUT*** tiutPointer, int* nbVilles) { printf("\nRetour au menu principal...\n"); } -void menuAdmin(VilleIUT*** tiutPointer, int* nbVilles) { +void menuAdmin(VilleIUT*** tiutPointer, ListeCandidats* listePointer, int* nbVilles, int* nbCandidats) { char poubelle; // Permet de stocker les caractères aspirés en trop sur stdin lors du choix dans le menu int choix; // Contient le choix de l'utilisateur dans le menu char pass[LEN_MAX]; @@ -255,13 +255,14 @@ void menuAdmin(VilleIUT*** tiutPointer, int* nbVilles) { printf("\t3 - Supprimer un département\n\n"); printf("\t4 - Lancer/arrêter la phase de candidature\n\n"); printf("\t5 - Modifier le nom du responsable d'un département\n\n"); + printf("\t6 - Liste des candidats\n\n"); printf("\t9 - Quitter\n"); printf("---------------------------------------------------------------------\n"); if(scanf("%d", &choix) == 0) choix=0; - printf("---------------------------------------------------\n"); + printf("---------------------------------------------------------------------\n"); while(choix != 9){ switch (choix) { @@ -381,6 +382,11 @@ void menuAdmin(VilleIUT*** tiutPointer, int* nbVilles) { modifierNomResponsable(*tiutPointer, *nbVilles, searchIUT5, searchDept5, nom); } break; + case 6: + printf("Liste des candidats...\n"); + printf("\n\e[4;37mListe des candidats (triés par ordre alphabétique) :\e[0m\n\n"); + afficherListeCandidats(*listePointer, *nbCandidats); + break; default: // Permet d'aspirer les caractères en trop sur stdin (évite de répéter le message d'erreur X fois) while ((poubelle = getchar()) != '\n' && poubelle != EOF); @@ -394,6 +400,7 @@ void menuAdmin(VilleIUT*** tiutPointer, int* nbVilles) { printf("\t3 - Supprimer un département\n\n"); printf("\t4 - Lancer/arrêter la phase de candidature\n\n"); printf("\t5 - Modifier le nom du responsable d'un département\n\n"); + printf("\t6 - Liste des candidats\n\n"); printf("\t9 - Quitter\n"); printf("---------------------------------------------------------------------\n"); @@ -443,6 +450,7 @@ void menuPrincipal(/* TODO: prise en compte des status actuels du recrutement */ printf(" ╚═════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═╝╚═════╝ ╚═╝ ╚═╝ ╚═╝ \e[0m\n\n"); menuCandidat(&tiut, &liste, &nbVilles, &nbCandidats); + titreMenuPrincipal(); break; case 2: system("clear"); @@ -453,7 +461,8 @@ void menuPrincipal(/* TODO: prise en compte des status actuels du recrutement */ printf("██║ ██║██████╔╝██║ ╚═╝ ██║██║██║ ╚████║██║███████║ ██║ ██║ ██║██║ ██║ ██║ ███████╗╚██████╔╝██║ ██║\n"); printf("╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝\e[0m\n\n"); - menuAdmin(&tiut, &nbVilles); + menuAdmin(&tiut, &liste, &nbVilles, &nbCandidats); + titreMenuPrincipal(); break; case 3: system("clear"); @@ -464,7 +473,8 @@ void menuPrincipal(/* TODO: prise en compte des status actuels du recrutement */ printf("██║ ██║███████╗███████║██║ ╚██████╔╝██║ ╚████║███████║██║ ██║██████╔╝███████╗███████╗\n"); printf("╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚══════╝╚══════╝\e[0m\n\n"); - menuResponsable(&tiut, &nbVilles); + menuResponsable(&tiut, &liste, &nbVilles, &nbCandidats); + titreMenuPrincipal(); break; default: // Permet d'aspirer les caractères en trop sur stdin (évite de répéter le message d'erreur X fois) @@ -473,7 +483,6 @@ void menuPrincipal(/* TODO: prise en compte des status actuels du recrutement */ break; } - titreMenuPrincipal(); printf("--------------------------------------------\n"); printf("Vous êtes : \n"); printf("--------------------------------------------\n");