From dde1d7d16470cc70de5e3049f48819a5aea70cef Mon Sep 17 00:00:00 2001 From: allaurent13 Date: Thu, 29 Dec 2022 15:57:56 +0000 Subject: [PATCH] =?UTF-8?q?toute=20les=20fonction=20d'utilisateur=20son=20?= =?UTF-8?q?r=C3=A9aliser=20(pas=20encore=20test=C3=A9)=20des=20modificatio?= =?UTF-8?q?ns=20surement=20=C3=A0=20faire=20sur=20la=20structure(utilis?= =?UTF-8?q?=C3=A9=20des=20fonction=20appart=20surement)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SAE.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- SAEl.c | 2 +- 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/SAE.c b/SAE.c index 9392128..f4ffd9d 100644 --- a/SAE.c +++ b/SAE.c @@ -81,6 +81,7 @@ int menuUtilisateurAffiche(void) printf("4 - Consultation du nombre de places pour un Département dans un IUT\n"); printf("5 - Consultation des départements dans un IUT\n"); printf("6 - Consultation de tout les IUT ayant un département choisi\n"); + printf("7 - Consultation de toute les informations des Département par IUT"); printf("\n\n9 - Connexion mode Administrateur\n"); printf("\n\n10 - Quitter\n"); printf("####################################################\n"); @@ -159,11 +160,11 @@ int gestionMenuAdmin(void) system("clear"); switch(choix){ case 1: - //fonction recherche et affichage iut dans une ville donnée + AffichageVille(tiut, nbEle); clearpage(); break; case 2: - //affichage de tout les département par iut + AffichageGlobalDepVille(tiut, nbEle); clearpage(); break; case 3: @@ -182,6 +183,10 @@ int gestionMenuAdmin(void) //affichage de tout les iut ayant un département choisi clearpage(); break; + case 7: + //affichage de tout les iut ayant un département choisi + clearpage(); + break; case 9: return 0; case 10: @@ -343,6 +348,18 @@ void AffichageDeptVille(VilleIUT **tiut, int nbEle) } } +void AffichageGlobalIUT(VilleIUT **tiut, int nbEle) +{ + int pos = 0; + while(pos < nbEle) + { + printf("Ville : %s\n",tiut[pos]->Ville); + affichageListeDept(tiut[pos]->idDept); + pos = pos + 1; + printf("\n"); + } +} + void MiseAJourNbPlace(VilleIUT **tiut, int nbEle) { ListeDept *aux; @@ -450,6 +467,45 @@ void suppressionDept(VilleIUT **tiut, int nbEle) } } +void modifChefDept(VilleIUT **tiut, int nbEle) +{ + char code[30]; + int trouve, pos, nbP; + while(1) + { + printf("Dans quel IUT voulez-vous modifier le chef de département : "); + scanf("%s", code); + pos = rechVille(tiut, nbEle, code, &trouve); + if (trouve == 1) + { + printf("Nom du Département : "); + scanf("%s", code); + if (recherche(tiut[pos]->idDept, code)) + { + + while(tiut[pos]->idDept->suiv != NULL) + { + if(strcmp(tiut[pos]->idDept->departement, code) == 1) + { + printf("Nom de l'ancien chef de département %s de %s : %s\n",tiut[pos]->idDept->departement, tiut[pos]->ville,tiut[pos]->idDept->resp); + printf("nom du nouveau chef de département %s de %s :",tiut[pos]->idDept->departement, tiut[pos]->ville); + fgets(code,30,stdin); + code[strlen(code)-1] = "\0"; + tiut[pos]->idDept->resp = code; + printf("Chef de département : %s\n",tiut[pos]->idDept->resp); + } + } + } + if (!recherche(tiut[pos]->idDept, code)) + printf("Ce Département n'existe pas dans l'IUT de %s \n",tiut[pos]->ville); + if (!verifSelection()) + break; + + } + + } +} + void clearpage(void) { char entre; diff --git a/SAEl.c b/SAEl.c index bb1ebca..06dda21 100644 --- a/SAEl.c +++ b/SAEl.c @@ -181,7 +181,7 @@ ListeDept inserer(ListeDept l, char *dept, char *nom, int nbP) // return cpt; // } -bool recherche(ListeDept l, char code[]) +bool rechercheDept(ListeDept l, char code[]) { if (l == NULL) return false;