diff --git a/Candidat.c b/Candidat.c index 64e0101..ff0f886 100644 --- a/Candidat.c +++ b/Candidat.c @@ -97,7 +97,12 @@ int chargementcandidat(Candidat *tcandidat[],int tmax){ void MenuCandidat(Candidat *tcandidat[],VilleIUT *tiut[],int nc){ int Achoix, choix, i, j, comp, comp1, numero, place; char Ncandidat[30], PNcandidat[30], departement[30], newdepart[30], Vmodif[30], Ville[30]; - printf("\n0-Revenir au menu\t1-Etudiant\t2-departement\n:"); + printf("\n >--------------------------------------------------<\n"); + printf("\n\t0 - Revenir au menu"); + printf("\n\t1 - Étudiant"); + printf("\n\t2 - Département\n"); + printf("\n >--------------------------------------------------<\n"); + printf("\n\tVotre choix : "); scanf("\n%d",&Achoix); while(Achoix>0 && Achoix<3){ while(Achoix==1){ diff --git a/adminIut.c b/adminIut.c index 88e39d5..f847671 100644 --- a/adminIut.c +++ b/adminIut.c @@ -5,37 +5,58 @@ void MenuAdministrateur(VilleIUT *tiut[],int n){ char departement[30], respon[30], Vmodif[31],tVille[31], tdepartemnt[30], AouD; - int choix, nbp, i, j, comp, Mnbp,good=0,reussi=0; + int choix = 1, nbp, i, j, codeRet, Mnbp,good=0,reussi=0; VilleIUT V; - - printf("\n0-Revenir au menu\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("\n%d",&choix); while(choix>0 && choix<6){ + printf("\n >--------------------------------------------------------<\n"); + printf("\n\t0 - Revenir au menu"); + printf("\n\t1 - Modifier une place"); + printf("\n\t2 - Créer un département"); + printf("\n\t3 - Supprimer un département"); + printf("\n\t4 - Lancer et arrêter la phase de canditature"); + printf("\n\t5 - Modifier le nom d'un responsable"); + printf("\n\t6 - Afficher différents tableaux, FONCTION DE DEV UNIQUEMENT, A SUPPRIMER\n"); + printf("\n >--------------------------------------------------------<\n"); + printf("\n\tVotre choix : "); + scanf("\n%d",&choix); + system("cls"); + system("clear"); if(choix==1){ - printf("\nVille où se situe le departement à modifier :"); - scanf("%s",Vmodif); - printf("\ndepartement à modifier:"); - scanf("%s",departement); - for(i=0;iville, Vmodif); - if(comp==0){ - for(j=0;jnbDep;j++){ - if(strcmp(tiut[i]->ldept->departement, departement) == 0 && tiut[i]->ldept->AouD == 'D'){ - printf("%c",tiut[i]->ldept->AouD ); - printf("pb departement arret phase de candidature\n"); - good=1; - } - } - if(good==0){ - printf("\nnombre de place apres modification :"); - scanf("%d",&Mnbp); - tiut[i]->ldept=ModifinbP(tiut[i]->ldept,departement,Mnbp,n); - reussi=1; - } + char rech[31]; + int trouve = 0; + printf("\nEntrez le nom d'une ville ou d'un IUT : "); + scanf("%s%*c", &rech); + for(i=0;iville, rech)==0){ + printf("\nIUT trouvé à %s !\n", rech); + trouve = 1; + codeRet = 0; + } + else if(i==n-1){ + printf("\nIl n'y pas d'IUT dans votre ville.\n"); + codeRet = 1; } } - if(reussi==0) - printf("pb erreur syntaxe\n"); + //BUG CODE ICI -> RECHERCHE NON FONCTIONNELLE AVEC DEPARTEMENT, VOIR LIEN AVEC VILLE POUR TROUVER... + if(codeRet==0){ + printf("\nDépartement à modifier : "); + scanf("%s",departement); + for(j=0;jnbDep;j++){ + if(strcmp(tiut[i]->ldept->departement, departement) == 0 && tiut[i]->ldept->AouD == 'D'){ + printf("%c",tiut[i]->ldept->AouD ); + printf("Problème, phase de candidature à l'arrêt pour ce département.\n"); + good=1; + } + } + if(good==0){ + printf("\nNombre de place après modification : "); + scanf("%d",&Mnbp); + tiut[i]->ldept=ModifinbP(tiut[i]->ldept,departement,Mnbp,n); + reussi=1; + } + if(reussi==0) + printf("\nProblème, erreur de syntaxe\n"); + } } if(choix==2){ //creer departemement @@ -48,8 +69,7 @@ void MenuAdministrateur(VilleIUT *tiut[],int n){ printf("\nnom du responsable :"); scanf("%s",respon); for(i=0;iville, Vmodif); - if(comp==0){ + if(strcmp(tiut[i]->ville, Vmodif)){ tiut[i]->ldept=Enfiler(tiut[i]->ldept,departement,nbp,respon); tiut[i]->nbDep=tiut[i]->nbDep+1; reussi=1; @@ -65,8 +85,7 @@ void MenuAdministrateur(VilleIUT *tiut[],int n){ printf("\ndepartement :"); scanf("%s",departement); for(i=0;iville, Vmodif); - if(comp==0){ + if(strcmp(tiut[i]->ville, Vmodif)){ tiut[i]->ldept=suppression(tiut[i]->ldept,departement); tiut[i]->nbDep=tiut[i]->nbDep-1; reussi=1; @@ -84,8 +103,7 @@ void MenuAdministrateur(VilleIUT *tiut[],int n){ printf("\nPour Activer taper A pour desactiver taper D :"); scanf("%c%*c",&AouD); for(i=0;iville, Vmodif); - if(comp==0){ + if(strcmp(tiut[i]->ville, Vmodif)){ tiut[i]->ldept=ModifiAouD(tiut[i]->ldept,departement,AouD,n); reussi=1; } @@ -102,18 +120,20 @@ void MenuAdministrateur(VilleIUT *tiut[],int n){ printf("\nnom du responsable :"); scanf("%s",respon); for(i=0;iville, Vmodif); - if(comp==0){ + if(strcmp(tiut[i]->ville, Vmodif)){ tiut[i]->ldept=ModifiRespon(tiut[i]->ldept,departement,respon,n); reussi=1; - } + } } if(reussi==0) printf("pb erreur syntaxe\n"); } - affichage(tiut, n); - printf("\nVoulez-vous choisir une autre fonction ? Sinon taper 0 pour valider : "); - scanf("%d%*c",&choix); + if(choix==6){ + //Fonction servant au développement du programme, fonction de test uniquement, à supprimer peut-être. + affichage(tiut, n); + char a[50]; + scanf("%c%*c", a); + } } } diff --git a/testIut.c b/testIut.c index dea3f81..e8e38f0 100644 --- a/testIut.c +++ b/testIut.c @@ -19,6 +19,7 @@ int main(){ printf("\n\tNombre de villes : %d\t",n); nc=chargementcandidat(tcandidat ,200); printf("Nombre de candidat : %d\n",nc); + printf("\n==============================================================\n"); while(rootChoice==1){/* printf("\t\tTableau Ville et departement\n"); printf("\nNombre de villes : %d\n",n); @@ -48,7 +49,9 @@ int main(){ MenuAdministrateur(tiut, n); } if(choix==3){ - printf("\nMenu Candidat"); + //Menu Candidat + system("cls"); + system("clear"); MenuCandidat(tcandidat, tiut, nc); } if(choix==4){ diff --git a/utilisateurIut.c b/utilisateurIut.c index 038d8dd..64bd6a4 100644 --- a/utilisateurIut.c +++ b/utilisateurIut.c @@ -15,6 +15,8 @@ void MenuUtilisateur(VilleIUT *tiut[], int n){ printf("\n >--------------------------------------------------<\n"); printf("\n\tVotre choix : "); scanf("%d%*c",&choix); + system("cls"); + system("clear"); if(choix==1){ //Recherche de tel IUT succes = rechercheIUT(tiut, n); @@ -58,10 +60,11 @@ int rechercheIUT(VilleIUT *tiut[], int n){ int rechercheDept(VilleIUT *tiut[], int n){ char rech[31]; int i, trouve = 0, j = 0; - ListeD ld = tiut[i]->ldept; + ListeD ld; printf("\nEntrez le nom d'une ville : "); scanf("%s%*c", &rech); for(i=0;ildept; if(strcmp(tiut[i]->ville, rech)==0){ printf("\nListe des départements :\n\n"); while(ld!=NULL){ @@ -124,5 +127,6 @@ int rechercheMixed(VilleIUT *tiut[], int n){ else if(i==n-1) printf("\nAucun département trouvé pour la ville correspondante.\n"); } + printf("\n"); return 1; } \ No newline at end of file