@ -5,17 +5,30 @@
void MenuAdministrateur ( VilleIUT * tiut [ ] , int n ) {
char departement [ 30 ] , respon [ 30 ] , Vmodif [ 31 ] ;
int choix , nbp , i , comp ;
int choix , nbp , i , comp ,Mnbp ;
VilleIUT V ;
printf ( " \n 1-Modifier place \n 2-Creer un departement \n 3-supprimer un département \n 4-Lancer et Arreter la phase de canditature \n 5-modifier nom responsable " ) ;
scanf ( " %d " , & choix ) ;
printf ( " \n 1-Modifier place \n 2-Creer un departement \n 3-supprimer un département \n 4-Lancer et Arreter la phase de canditature \n 5-modifier nom responsable : " ) ;
scanf ( " \n %d " , & choix ) ;
if ( choix = = 1 ) {
printf ( " \n Ville où se situe le departement à modifier : " ) ;
scanf ( " %s " , Vmodif ) ;
printf ( " \n departement à modifier: " ) ;
scanf ( " %s " , departement ) ;
printf ( " \n nombre de place apres modification : " ) ;
scanf ( " %d " , & Mnbp ) ;
for ( i = 0 ; i < n ; i + + ) {
comp = strcmp ( tiut [ i ] - > ville , Vmodif ) ;
if ( comp = = 0 ) {
tiut [ i ] - > ldept = ModifinbP ( tiut [ i ] - > ldept , departement , Mnbp , n ) ;
}
}
}
if ( choix = = 2 ) {
//creer departemement
printf ( " \n Ville où se situe le departement " ) ;
printf ( " \n Ville où se situe le departement : " ) ;
scanf ( " %s " , Vmodif ) ;
printf ( " \n departement a creer : " ) ;
scanf ( " %s " , departement ) ;
@ -25,14 +38,11 @@ void MenuAdministrateur(VilleIUT *tiut[],int n){
scanf ( " %s " , respon ) ;
for ( i = 0 ; i < n ; i + + ) {
comp = strcmp ( tiut [ i ] - > ville , Vmodif ) ;
comp = strcmp ( tiut [ i ] - > ville , Vmodif ) ;
if ( comp = = 0 ) {
tiut [ i ] - > ldept = Enfiler ( tiut [ i ] - > ldept , departement , nbp , respon ) ;
}
if ( comp < 0 )
printf ( " error impossible ville inexistante " ) ;
}
}
//V=Enfiler(V,departement,nbp,respon);
}
if ( choix = = 3 ) {
//supprimer departement et pauser condition pour choisir qui suppr
@ -50,7 +60,7 @@ void MenuAdministrateur(VilleIUT *tiut[],int n){
if ( choix = = 5 ) {
//modification responsable
}
affichage ( tiut , n ) ;
}
@ -69,6 +79,16 @@ ListeD suppression(ListeD ld,char *departement,char *responsable){
return ld ;
}
ListeD ModifinbP ( ListeD ld , char departement [ 30 ] , int MnbP , int n ) {
int comp , trouv , i ;
for ( i = 0 ; i < n ; i + + ) {
comp = strcmp ( ld - > departement , departement ) ;
if ( comp = = 0 )
trouv = i ;
}
if ( trouv = = 0 )
printf ( " departement non existant " ) ;
}
@ -80,7 +100,7 @@ ListeD Enfiler(ListeD ld, char departement[30], int nbP, char resp[30]) {
mN - > nbP = nbP ;
strcpy ( mN - > resp , resp ) ;
mN - > suivant = NULL ;
printf ( " \n aa " ) ;
if ( ld = = NULL ) {
ld = mN ;
} else {
@ -93,7 +113,7 @@ ListeD Enfiler(ListeD ld, char departement[30], int nbP, char resp[30]) {
}
return ld ;
}
for zfzughzguy hzh ubh hgbf
/*
VilleIUT defiler ( VilleIUT V ) {
MaillonDept * temp ;