diff --git a/exe.exe b/exe.exe index 2cb95e5..2491003 100644 Binary files a/exe.exe and b/exe.exe differ diff --git a/header/adherent.h b/header/adherent.h index 2387f42..a7e8923 100644 --- a/header/adherent.h +++ b/header/adherent.h @@ -1,4 +1,5 @@ #include "global.h" + void help(int page); void SupprimerAdherent(int *nbAdherents, int tabNoCarte[], int tabEtatCarte[], int tabPointCarte[]); diff --git a/header/menus.h b/header/menus.h new file mode 100644 index 0000000..c1a3db0 --- /dev/null +++ b/header/menus.h @@ -0,0 +1,6 @@ +#include "global.h" + +void GestionAdherent(int tabNoCarte[], int tabEtatCarte[], int tabPointCarte[], int *nbAdherents, int taillePhysique); +int AffichageGestionAdherent(void); + + diff --git a/source/main.c b/source/main.c index ff53d57..ede799e 100644 --- a/source/main.c +++ b/source/main.c @@ -1,8 +1,11 @@ #include "../header/adherent.h" +#include "../header/menus.h" int main(void){ + #ifdef _WIN32 color + #endif int tabCarte[17] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; int tabEtat[17] = {1, 1, 1, 1, 1, 1, -2, 1, 1, 1, 1, 1, 1, 1, 1}; @@ -18,5 +21,6 @@ int main(void){ //RechargeCarte(30, tabCarte, tabEtat, tabPoint, tailleLog); //int indice = TrouverAdherent(tabCarte, tailleLog, 5, &trouve); //printf("Indice: %d\nTrouve = %d", indice, trouve); - CreerAdherent(tabCarte, tabEtat, tabPoint, &tailleLog, taillePhysique); + //CreerAdherent(tabCarte, tabEtat, tabPoint, &tailleLog, taillePhysique); + GestionAdherent(tabCarte, tabEtat, tabPoint, &tailleLog, taillePhysique); } \ No newline at end of file diff --git a/source/menus.c b/source/menus.c new file mode 100644 index 0000000..7655488 --- /dev/null +++ b/source/menus.c @@ -0,0 +1,47 @@ +#include "../header/menus.h" +#include "../header/adherent.h" + + +int AffichageGestionAdherent(void) +{ + int choix; + + clean + printf("====================================================\n"); + printf("\t\tMENU GESTION ADHERENT\n"); + printf("====================================================\n"); + + printf("\nChoix disponible :\n"); + printf("\t0. Retour au menu principal\n"); + printf("\t1. Afficher tout les adherents\n"); + printf("\t2. Creer un nouvel adherent\n"); + printf("\t3. Supprimer un adherent\n"); + + printf("\nChoix : "); + scanf("%d", &choix); + return choix; +} + +void GestionAdherent(int tabNoCarte[], int tabEtatCarte[], int tabPointCarte[], int *nbAdherents, int taillePhysique) +{ + int actif = 1; + int choix; + char trash; + + while(actif) + { + choix = AffichageGestionAdherent(); + switch(choix) + { + case 0 : actif = 0; break; + case 1 : AfficheAdherents(tabNoCarte, tabEtatCarte, tabPointCarte, *nbAdherents);break; + case 2 : CreerAdherent(tabNoCarte, tabEtatCarte, tabPointCarte, nbAdherents, taillePhysique);break; + case 3 : SupprimerAdherent(nbAdherents, tabNoCarte, tabEtatCarte, tabPointCarte);break; + default : + clean + printf("\nChoix invalide.\n"); + printf("Appuyez sur entree pour continuer..."); + scanf("%c", &trash); + } + } +} \ No newline at end of file