|
|
@ -87,7 +87,7 @@ int choixMenu(void)
|
|
|
|
int choixMenuAffichage(void)
|
|
|
|
int choixMenuAffichage(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int choix;
|
|
|
|
int choix;
|
|
|
|
printf("\tGestion des matières\n");
|
|
|
|
printf("\t Gestion des matières\n");
|
|
|
|
printf("1.\tAffichage des informations d'un adhérent\n");
|
|
|
|
printf("1.\tAffichage des informations d'un adhérent\n");
|
|
|
|
printf("2.\tAffichage des informations de tous les adhérents\n");
|
|
|
|
printf("2.\tAffichage des informations de tous les adhérents\n");
|
|
|
|
printf("3.\tAffichage du nombre d’entrées totale de toutes les journée\n");
|
|
|
|
printf("3.\tAffichage du nombre d’entrées totale de toutes les journée\n");
|
|
|
@ -518,6 +518,106 @@ void modificationEtat(int tNumCarte[], int tEtat[], int tailleLog)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int Sauvegarde(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int nbelem)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
FILE *flot, *jour;
|
|
|
|
|
|
|
|
flot = fopen("membres.don", "a");
|
|
|
|
|
|
|
|
jour = fopen("ActivitesJour.don", "a");
|
|
|
|
|
|
|
|
if (flot == NULL)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("Pb d'ouverture du fichier membres.don\n");
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (jour == NULL)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("Pb d'ouverture du fichier ActivitesJour.don\n");
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < (nbelem - 1); i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
fprintf(flot, "\t%d\t%d\t\t%d\t\t%d\n", tNoCarte[i], tage[i], tPointsCarte[i], tCarteActive[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (j = 0; j < (nbelem - 1); j++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
fprintf(jour, "%d\t\t%d\n", tDate[j], tNbActivitesJour[j]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
fclose(jour);
|
|
|
|
|
|
|
|
fclose(flot);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ModificationActivationCarte(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int nbelem)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int NoCarte, trouve, pas;
|
|
|
|
|
|
|
|
printf("Entrez le numéro de la carte de l'adhérent recherché : ");
|
|
|
|
|
|
|
|
scanf("%d",&NoCarte);
|
|
|
|
|
|
|
|
pas = rechercheAdherant(tNoCarte, nbelem, NoCarte, &trouve);
|
|
|
|
|
|
|
|
if(trouve == 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(tCarteActive[pas] == 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
tCarteActive[pas] = 0;
|
|
|
|
|
|
|
|
printf("La carte est desactivée.\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
tCarteActive[pas] = 1;
|
|
|
|
|
|
|
|
printf("La carte est activée.\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("Ce numéro d'adhérant n'existe pas, veuillez réessayer\n");
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DebitActivitee(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int nbelem)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int NoCarte, trouve, pas, pointsCarte;
|
|
|
|
|
|
|
|
char reponse;
|
|
|
|
|
|
|
|
printf("Entrez le numéro de la carte de l'adhérent recherché : ");
|
|
|
|
|
|
|
|
scanf("%d",&NoCarte);
|
|
|
|
|
|
|
|
pas = rechercheAdherant(tNoCarte, nbelem, NoCarte, &trouve);
|
|
|
|
|
|
|
|
if(trouve == 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(tCarteActive[pas] == 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("Voulez-vous desactiver cette carte ? (O/N)\n");
|
|
|
|
|
|
|
|
scanf("%*c%c", &reponse);
|
|
|
|
|
|
|
|
if(reponse == 'O' || reponse == 'o')
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
tCarteActive[pas] = 0;
|
|
|
|
|
|
|
|
printf("La carte est desactivée.\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("La carte est toujours active.\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("La carte est desactivée. Voulez-vous la réactiver ? (O/N)\n");
|
|
|
|
|
|
|
|
scanf("%*c%c", &reponse);
|
|
|
|
|
|
|
|
if(reponse == 'O' || reponse == 'o')
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
tCarteActive[pas] = 1;
|
|
|
|
|
|
|
|
printf("La carte est activée.\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("La carte est toujours desactivée.\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("Ce numéro d'adhérant n'existe pas, veuillez réessayer\n");
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
int Sauvegarde(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int nbelem)
|
|
|
|
int Sauvegarde(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int nbelem)
|
|
|
|
{
|
|
|
|
{
|
|
|
|