From 527603107d8b423fa68a299bf3fe714707a18398 Mon Sep 17 00:00:00 2001 From: "nicolas.blondeau" Date: Thu, 12 Jan 2023 22:47:52 +0100 Subject: [PATCH] =?UTF-8?q?Toutes=20les=20fonctions=20utilisateur=20sont?= =?UTF-8?q?=20d=C3=A8s=20maintenant=20fonctionnelles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iut.h | 1 + utilisateurIut.c | 32 +++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/iut.h b/iut.h index a1c0354..a1e2cc9 100644 --- a/iut.h +++ b/iut.h @@ -52,6 +52,7 @@ typedef enum {faux,vrai}Booleen; int rechercheIUT(VilleIUT *tiut[],int n); int rechercheDept(VilleIUT *tiut[], int n); int recherchePlaces(VilleIUT *tiut[], int n); + int rechercheMixed(VilleIUT *tiut[], int n); //Menu administrateur : void MenuAdministrateur(VilleIUT *tiut[],int n); diff --git a/utilisateurIut.c b/utilisateurIut.c index 88db3c1..a3d9575 100644 --- a/utilisateurIut.c +++ b/utilisateurIut.c @@ -19,7 +19,7 @@ void MenuUtilisateur(VilleIUT *tiut[], int n){ succes = recherchePlaces(tiut, n); } if(choix==4){ - // + succes = rechercheMixed(tiut, n); } if(choix==5){ return; @@ -89,3 +89,33 @@ int recherchePlaces(VilleIUT *tiut[], int n){ } return 1; } + +int rechercheMixed(VilleIUT *tiut[], int n){ + char rech[31], rech2[31]; + int i, trouve = 0, j = 0; + ListeD ld; + printf("\nEntrez le nom d'une ville : "); + scanf("%s%*c", &rech); + printf("\nEntrez le nom du département souhaité : "); + scanf("%s%*c", &rech2); + for(i=0;ildept; + if(strcmp(tiut[i]->ville, rech)==0){ + while(ld!=NULL){ + if(strcmp(ld->departement, rech2)==0){ + printf("\nÀ %s :\n", tiut[i]->ville); + printf("%s\t", ld->departement); + printf("Nombre de places : %d\n",ld->nbP); + printf("Responsable : %s\n",ld->resp); + trouve = 1; + } + else if(i==n-1) + printf("\nAucun département trouvé.\n"); + ld = ld->suivant; + } + } + else if(i==n-1) + printf("\nAucun département trouvé pour la ville correspondante.\n"); + } + return 1; +} \ No newline at end of file