#include #include #include #include "iut.h" void MenuAdministrateur(VilleIUT *tiut[],int n){ char departement[30],respon[30]; int choix,nbp; VilleIUT V; printf("\n1-Modifier place\n2-Creer un departement\n3-supprimer un département\n4-Lancer et Arreter la phase de canditature\n5-modifier nom responsable"); scanf("%d",&choix); if(choix==1){ //modification nbP } if(choix==2){ //creer departemement printf("\ndepartement :"); scanf("%s",departement); printf("\nnombre de place :"); scanf("%d",&nbp); printf("\nresponsable :"); scanf("%s",respon); //V=Enfiler(V,departement,nbp,respon); } if(choix==3){ //supprimer departement et pauser condition pour choisir qui suppr printf("\ndepartement :"); scanf("%s",departement); printf("\nresponsable :"); scanf("%s",respon); // *resultat=recherche(V.Ville,departement,respon); //m=suppression(m,departement,respon); affichage(tiut, n); } if(choix==4){ //Lancer et arreter phase de canditature } if(choix==5){ //modification responsable } } ListeD suppressionTete(ListeD ld){ ListeD ldsvt; ldsvt=ld->suivant; free(ld); return ldsvt; } ListeD suppression(ListeD ld,char *departement,char *responsable){ if(ld==NULL) return ld; if(strcmp(ld->departement,departement) ==0 && strcmp(ld->resp,responsable) ==0) return suppressionTete(ld); ld->suivant=suppression(ld->suivant,departement,responsable); return ld; } /* VilleIUT Enfiler(VilleIUT V, char *departement, int nbP,char *resp){ MaillonDept *m; m=(MaillonDept*)malloc(sizeof(MaillonDept)); if(m==NULL){printf("pb ouv malloc");exit(1);} strcpy(m->departement, departement); m->nbP=nbP; strcpy(m->resp,resp); m->suivant=NULL; if(testVide(V)){ V.Ville=m; V.Idept=m; } else{ V.Idept->suivant=m; V.Idept=m; } return V; } VilleIUT defiler(VilleIUT V){ MaillonDept *temp; if(testVide(V)){ printf("testVide"); return V; } temp=V.Ville; V.Ville=temp->suivant; free(temp); if(V.Ville==NULL) V.Idept=NULL; return V; } */