Toutes les fonctions utilisateur sont dès maintenant fonctionnelles

master
Nicolas BLONDEAU 2 years ago
parent d413a2ca76
commit 527603107d

@ -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);

@ -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;i<n && trouve!=1;i++){
ld = tiut[i]->ldept;
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;
}
Loading…
Cancel
Save