From ad3aaa3147810d94e36e5abd3807c70e3cd75d7f Mon Sep 17 00:00:00 2001 From: Yann CHAMPEAU Date: Tue, 3 Jan 2023 11:58:17 +0100 Subject: [PATCH] =?UTF-8?q?R=C3=A9glage=20de=20probl=C3=A8mes=20divers.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Etudiants.bin | 1 + Makefile | 6 +++++- src/Makefile | 7 ++----- src/annexe/saeAnnexe.c | 3 ++- src/partie1/saeP1.c | 10 +++++----- src/partie2/saeP2.c | 4 ++-- src/partie2/saeP2.h | 3 ++- src/saeMain.c | 39 ++++++++++++++++++++++++--------------- 8 files changed, 43 insertions(+), 30 deletions(-) create mode 120000 Etudiants.bin diff --git a/Etudiants.bin b/Etudiants.bin new file mode 120000 index 0000000..aabe1e1 --- /dev/null +++ b/Etudiants.bin @@ -0,0 +1 @@ +src/DataBase/Etudiants.bin \ No newline at end of file diff --git a/Makefile b/Makefile index d65dfa5..83674d5 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,13 @@ PHONY : clean doc all -all : prog +all : prog EXE prog : make -C src all +EXE : + rm -f SAE + gcc -o SAE src/saeMain.o src/annexe/saeAnnexe.o src/partie1/saeP1.o src/partie2/saeP2.o src/partie3/saeP3.o src/partie4/saeP4.o + doc : make -C src doc diff --git a/src/Makefile b/src/Makefile index cbe6040..4d3a4aa 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,4 @@ -all : SAE +all : saeMain.o lib .PHONY : all doc clean @@ -9,9 +9,6 @@ lib : annexe/saeAnnexe.o partie1/saeP1.o partie2/saeP2.o partie3/saeP3.o partie4 make -C partie3 all make -C partie4 all -SAE : saeMain.o lib - gcc -o ../SAE saeMain.o annexe/saeAnnexe.o partie1/saeP1.o partie2/saeP2.o partie3/saeP3.o partie4/saeP4.o - saeMain.o : saeMain.c gcc -Wall -c saeMain.c @@ -27,4 +24,4 @@ clean : make -C partie1 clean make -C partie2 clean make -C partie3 clean - make -C partie4 clean \ No newline at end of file + make -C partie4 clean diff --git a/src/annexe/saeAnnexe.c b/src/annexe/saeAnnexe.c index 1006507..4641c10 100644 --- a/src/annexe/saeAnnexe.c +++ b/src/annexe/saeAnnexe.c @@ -13,7 +13,8 @@ void menu(void){ printf("#--------------------------------------------------------------------#\n\n"); printf("Codes pour accéder aux différents profils :\n\n"); printf("C : Consultation.\n"); - printf("A : Administrateur.\n\n"); + printf("A : Administrateur.\n"); + printf("Q : Quitter.\n\n"); printf("#--------------------------------------------------------------------#\n\n"); printf("Choisissez votre session : "); } diff --git a/src/partie1/saeP1.c b/src/partie1/saeP1.c index e9de19f..405d46a 100644 --- a/src/partie1/saeP1.c +++ b/src/partie1/saeP1.c @@ -8,7 +8,7 @@ //Partie Consultant. -void MenuUser(VilleIUT* lvIUT[],int tlogi) +void menuUser(VilleIUT* lvIUT[],int tlogi) { int intUserEntry=0; printf("#--------------------------------------------------------------------#\n"); @@ -167,7 +167,7 @@ void modifPlaces(VilleIUT* tiut[],int tlogi){ printf("\n\nEntrez le département à modifier:"); char dep[31]; scanf("%*c%s",&dep); - if(!existeDep(tiut->ldept,dep)){ + if(!existeDep(v->ldept,dep)){ fprintf(stderr,"\nDépartement non existant !\n"); return; } @@ -228,7 +228,7 @@ void supprimerDep(VilleIUT* tiut[],int tlogi){ printf("\n\nEntrez le département à supprimer:"); char dep[31]; scanf("%*c%s",&dep); - if(!existeDep(tiut->ldept,dep)){ + if(!existeDep(v->ldept,dep)){ fprintf(stderr,"\nDépartement non existant !\n"); return; } @@ -268,7 +268,7 @@ void modifNomResponsable(VilleIUT* tiut[],int tlogi){ printf("\n\nEntrez le département à modifier:"); char dep[31]; scanf("%*c%s",&dep); - if(!existeDep(tiut->ldept,dep)){ + if(!existeDep(v->ldept,dep)){ fprintf(stderr,"\nDépartement non existant !\n"); return; } @@ -280,4 +280,4 @@ void modifNomResponsable(VilleIUT* tiut[],int tlogi){ strcpy(m->resp,nom); printf("\n\nLe nom du responsable du département %s de l'IUT de %s a bien été changé pour %s.\n",dep,ville,nom); return; -} \ No newline at end of file +} diff --git a/src/partie2/saeP2.c b/src/partie2/saeP2.c index 1cfa471..80d3175 100644 --- a/src/partie2/saeP2.c +++ b/src/partie2/saeP2.c @@ -3,7 +3,7 @@ #include #include "saeP2.h" - +/* candidat* LoadCandid(void) { //J'ouvre le fichier @@ -110,4 +110,4 @@ void RechercheCandidat(int ID, int nbcandidat, int tmax,candidat *tcand) } -//void gestionPhaseCandidatures(); A FAIRE. \ No newline at end of file +//void gestionPhaseCandidatures(); A FAIRE.*/ diff --git a/src/partie2/saeP2.h b/src/partie2/saeP2.h index 2cbcd60..1409b29 100644 --- a/src/partie2/saeP2.h +++ b/src/partie2/saeP2.h @@ -1,3 +1,4 @@ +/* typedef struct { char ville[31]; @@ -17,4 +18,4 @@ typedef struct candidat* LoadCandid(void); -//void gestionPhaseCandidatures(); A FAIRE. \ No newline at end of file +//void gestionPhaseCandidatures(); A FAIRE.*/ diff --git a/src/saeMain.c b/src/saeMain.c index 7e69780..0afd953 100644 --- a/src/saeMain.c +++ b/src/saeMain.c @@ -9,22 +9,31 @@ int main(void) { + system("clear"); VilleIUT* tiut[36529]; - int tlogi=loadIUT(tiut); - menu(); - char user; - scanf("%c",&user); - switch(user){ - case 'C': - reset(); - menuUser(tiut,tlogi); - reset(); - break; - case 'A': - reset(); - menuAdmin(tiut,tlogi); - reset(); + int tlogi=loadIUT(tiut), quit=0; + while(!quit){ + menu(); + char user, confirmation; + scanf("%c",&user); + switch(user){ + case 'C': + reset(); + menuUser(tiut,tlogi); + reset(); + break; + case 'A': + reset(); + menuAdmin(tiut,tlogi); + reset(); + break; + case 'Q': + printf("Êtes-vous sûr de vouloir quitter ? (Y pour continuer)\n\n"); + scanf("%*c%c",&confirmation); + if(confirmation=='Y') quit=1; + system("clear"); + } } //save(); return 0; -} \ No newline at end of file +}