|
|
#include "Fonctions.h"
|
|
|
|
|
|
/*
|
|
|
A une séance d’une activité donnée correspond un certain nombre de
|
|
|
points.
|
|
|
Exemple :
|
|
|
Une séance de musculation : 10 points
|
|
|
Une séance d’aquagym : 15 points
|
|
|
Une séance de SPA : 12 points
|
|
|
|
|
|
A chaque entrée au centre, un adhérent peut choisir une ou plusieurs activités en même temps. Il peut
|
|
|
par exemple faire une séance de musculation suivie d’une séance de SPA, sa carte se verra débiter de
|
|
|
22 points.
|
|
|
Attribution de points lors d'un sceance qui dépende de critères socioprofessionnels (retraités, étudiants, ... AGE
|
|
|
|
|
|
Raison activation desactivation carte
|
|
|
|
|
|
Creditation obligatoire lors de creation adherent
|
|
|
|
|
|
Votre application doit pouvoir interdire à un adhérent de fréquenter le centre plus d’une fois par jour
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
void gestionMenus(void)
|
|
|
{
|
|
|
int tNoCarte[20] = {0}, tage[20] = {0}, tPointsCarte[20] = {0}, tCarteActive[20] = {0};
|
|
|
int tDate[20] = {0}, tNbActivitesJour[20] = {0};
|
|
|
int tmax = 20, nbelem, choix, pasAct;
|
|
|
char choixA;
|
|
|
nbelem = Ouverture(tNoCarte, tage, tPointsCarte, tCarteActive, tNbActivitesJour, tDate, tmax, &pasAct);
|
|
|
if (nbelem < 0)
|
|
|
{
|
|
|
printf("Erreur d'ouverture du fichier ou tableau plein !!!\n");
|
|
|
return;
|
|
|
}
|
|
|
choix = choixMenu();
|
|
|
while (choix != 8)
|
|
|
{
|
|
|
if (choix == 1)
|
|
|
{
|
|
|
choixA = choixMenuAffichage();
|
|
|
while (choixA != 'F' && choixA != 'f')
|
|
|
{
|
|
|
if (choixA == 'A' || choixA == 'a')
|
|
|
{
|
|
|
Affichage1Adherent(tNoCarte, tage, tPointsCarte, tCarteActive, nbelem);
|
|
|
}
|
|
|
if (choixA == 'B' || choixA == 'b')
|
|
|
{
|
|
|
AffichageTousAdherents(tNoCarte, tage, tPointsCarte, tCarteActive, nbelem);
|
|
|
}
|
|
|
if (choixA == 'C' || choixA == 'c')
|
|
|
{
|
|
|
AffichageNbEntreesTousJour(tNbActivitesJour, tDate, nbelem);
|
|
|
}
|
|
|
if (choixA == 'D' || choixA == 'd')
|
|
|
{
|
|
|
AffichageNbEntreesTotal(tNbActivitesJour, nbelem);
|
|
|
}
|
|
|
if (choixA == 'E' || choixA == 'e')
|
|
|
{
|
|
|
AffichageNbAdherents(nbelem);
|
|
|
}
|
|
|
choixA = choixMenuAffichage();
|
|
|
}
|
|
|
}
|
|
|
if (choix == 2)
|
|
|
{
|
|
|
nbelem = AjoutAdherent(tNoCarte, tage, tPointsCarte, tCarteActive, tmax, nbelem);
|
|
|
}
|
|
|
if (choix == 3)
|
|
|
{
|
|
|
ModificationAge(tNoCarte, tage, nbelem);
|
|
|
}
|
|
|
if (choix == 4)
|
|
|
{
|
|
|
nbelem = SupprimmerAdherent(tNoCarte, tage, tPointsCarte, tCarteActive, nbelem);
|
|
|
}
|
|
|
if (choix == 5)
|
|
|
{
|
|
|
|
|
|
AjoutPoints(tNoCarte, tPointsCarte, tCarteActive, nbelem);
|
|
|
}
|
|
|
if (choix == 6)
|
|
|
{
|
|
|
ModificationActivationCarte(tNoCarte, tCarteActive, nbelem);
|
|
|
}
|
|
|
if (choix == 7)
|
|
|
{
|
|
|
DebitActivitee(tNoCarte, tCarteActive, tNbActivitesJour, nbelem);
|
|
|
}
|
|
|
choix = choixMenu();
|
|
|
}
|
|
|
Sauvegarde(tNoCarte, tage, tPointsCarte, tCarteActive, tNbActivitesJour, tDate, nbelem);
|
|
|
exit(1);
|
|
|
} |