Commit final

master
Louis LABORIE 3 years ago
parent c06a65ff2d
commit 95583a921a

@ -1,6 +1,6 @@
2 18 29 10 2022 1 2 18 29 10 2022 1
14 25 14 5 2007 1 14 25 14 5 2007 1
16 10 16 8 2004 1 16 10 16 8 2004 1
23 10 5 7 1000 1 23 10 5 7 2021 1
56 6 7 1 2015 0 56 6 13 11 2017 0
69 17 14 7 2016 1 69 17 14 8 2016 1

Binary file not shown.

@ -426,7 +426,7 @@ void modifActivite(int tabCoutPoint[],int tailleL )
} }
} }
void faireActivite(int tabAdherent[], int tabPoint[],int tabCoutPoint[], int tabNbEntree[], int tailleLAdhe, int tailleLAct) void faireActivite(int tabAdherent[], int tabPoint[],int tabCoutPoint[], int tabNbEntree[],int carte[], int tailleLAdhe, int tailleLAct)
{ {
int num, idAct, i, trouve; int num, idAct, i, trouve;
printf("Identifiant Adhérent : "); printf("Identifiant Adhérent : ");
@ -434,7 +434,9 @@ void faireActivite(int tabAdherent[], int tabPoint[],int tabCoutPoint[], int tab
i = recherche(tabAdherent, num, tailleLAdhe, &trouve); i = recherche(tabAdherent, num, tailleLAdhe, &trouve);
if (trouve == 0) if (trouve == 0)
printf("Identifiant Adhérent pas existant\n"); printf("Identifiant Adhérent pas existant\n");
else if (carte[i] == 0)
printf("Vous ne pouvez pas refaire d'activité");
if (trouve == 1 && carte[i] == 1)
{ {
printf("Numéro d'activité que vous voulez pratiquer : "); printf("Numéro d'activité que vous voulez pratiquer : ");
scanf("%d", &idAct); scanf("%d", &idAct);
@ -454,6 +456,7 @@ void faireActivite(int tabAdherent[], int tabPoint[],int tabCoutPoint[], int tab
else{ else{
tabPoint[i] = tabPoint[i] - tabCoutPoint[idAct]; tabPoint[i] = tabPoint[i] - tabCoutPoint[idAct];
tabNbEntree[idAct] = tabNbEntree[idAct] + 1; tabNbEntree[idAct] = tabNbEntree[idAct] + 1;
carte[i] = 0;
printf("Achat effectué\n"); printf("Achat effectué\n");
printf("Il vous reste %d point sur votre carte\n", tabPoint[i]); printf("Il vous reste %d point sur votre carte\n", tabPoint[i]);
} }
@ -524,6 +527,7 @@ int Menu(void){
int select=0; int select=0;
while((select < 1 || select > 5) && select != 15 && select != 16 && (select < 6 || select > 10 ) && select != 20){ while((select < 1 || select > 5) && select != 15 && select != 16 && (select < 6 || select > 10 ) && select != 20){
system("clear");
printf("\t Gestion Salle de sport / Adhérent\n\n"); printf("\t Gestion Salle de sport / Adhérent\n\n");
printf("1\tAffichage des Adhérent\n"); printf("1\tAffichage des Adhérent\n");
printf("2\tAjouter un Adhérent\n"); printf("2\tAjouter un Adhérent\n");
@ -537,6 +541,7 @@ int Menu(void){
if (select == 16) if (select == 16)
{ {
system("clear");
printf("\t Gestion Salle de sport / Adhérent\n\n"); printf("\t Gestion Salle de sport / Adhérent\n\n");
printf("1\tAffichage des Adhérent\n"); printf("1\tAffichage des Adhérent\n");
printf("2\tAjouter un Adhérent\n"); printf("2\tAjouter un Adhérent\n");
@ -598,7 +603,7 @@ void GestionSalle(void){
clearpage(); clearpage();
} }
if(select == 5){ if(select == 5){
faireActivite(tabAdhe,tabPoints,tabCoutPoint,tabNbEntree,tailleLAdhe,tailleLAct); faireActivite(tabAdhe,tabPoints,tabCoutPoint,tabNbEntree,carte,tailleLAdhe,tailleLAct);
clearpage(); clearpage();
} }
if(select == 6){ if(select == 6){

@ -192,7 +192,7 @@ void suppActivite(int tabCoutPoint[], int tabNbEntree[],int tailleL);
* @param tailleLAdhe taille logique des adhérents * @param tailleLAdhe taille logique des adhérents
* @param tailleLAct taille logique des activités * @param tailleLAct taille logique des activités
*/ */
void faireActivite(int tabAdherent[], int tabPoint[],int tabCoutPoint[], int tabNbEntree[], int tailleLAdhe, int tailleLAct); void faireActivite(int tabAdherent[], int tabPoint[],int tabCoutPoint[], int tabNbEntree[],int carte[], int tailleLAdhe, int tailleLAct);
/** /**
* @brief Permet de sauvegarder les données des tableaux passés en paramètre dans le fichier 'adherent.txt' * @brief Permet de sauvegarder les données des tableaux passés en paramètre dans le fichier 'adherent.txt'
* *

Loading…
Cancel
Save