|
|
|
@ -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;
|
|
|
|
|
printf("Identifiant Adhérent : ");
|
|
|
|
@ -434,7 +434,9 @@ void faireActivite(int tabAdherent[], int tabPoint[],int tabCoutPoint[], int tab
|
|
|
|
|
i = recherche(tabAdherent, num, tailleLAdhe, &trouve);
|
|
|
|
|
if (trouve == 0)
|
|
|
|
|
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 : ");
|
|
|
|
|
scanf("%d", &idAct);
|
|
|
|
@ -454,6 +456,7 @@ void faireActivite(int tabAdherent[], int tabPoint[],int tabCoutPoint[], int tab
|
|
|
|
|
else{
|
|
|
|
|
tabPoint[i] = tabPoint[i] - tabCoutPoint[idAct];
|
|
|
|
|
tabNbEntree[idAct] = tabNbEntree[idAct] + 1;
|
|
|
|
|
carte[i] = 0;
|
|
|
|
|
printf("Achat effectué\n");
|
|
|
|
|
printf("Il vous reste %d point sur votre carte\n", tabPoint[i]);
|
|
|
|
|
}
|
|
|
|
@ -524,6 +527,7 @@ int Menu(void){
|
|
|
|
|
int select=0;
|
|
|
|
|
|
|
|
|
|
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("1\tAffichage des Adhérent\n");
|
|
|
|
|
printf("2\tAjouter un Adhérent\n");
|
|
|
|
@ -537,6 +541,7 @@ int Menu(void){
|
|
|
|
|
|
|
|
|
|
if (select == 16)
|
|
|
|
|
{
|
|
|
|
|
system("clear");
|
|
|
|
|
printf("\t Gestion Salle de sport / Adhérent\n\n");
|
|
|
|
|
printf("1\tAffichage des Adhérent\n");
|
|
|
|
|
printf("2\tAjouter un Adhérent\n");
|
|
|
|
@ -598,7 +603,7 @@ void GestionSalle(void){
|
|
|
|
|
clearpage();
|
|
|
|
|
}
|
|
|
|
|
if(select == 5){
|
|
|
|
|
faireActivite(tabAdhe,tabPoints,tabCoutPoint,tabNbEntree,tailleLAdhe,tailleLAct);
|
|
|
|
|
faireActivite(tabAdhe,tabPoints,tabCoutPoint,tabNbEntree,carte,tailleLAdhe,tailleLAct);
|
|
|
|
|
clearpage();
|
|
|
|
|
}
|
|
|
|
|
if(select == 6){
|
|
|
|
|