You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
107 lines
2.5 KiB
107 lines
2.5 KiB
#include "sae.h"
|
|
#include <string.h>
|
|
#include <stdio.h>
|
|
|
|
void GereAdhérent(void)
|
|
{
|
|
int tAd[TAILLE], tage[TAILLE], tstate[TAILLE], tacti[TAILLE], tpasseoupas[TAILLE], tptsbought[TAILLE], tptsbonus[TAILLE], place, nbacti, chxacti, numAd, ret, insuf, day = 0;
|
|
char tcateg[TAILLE], nom[TAILLE], pnom[TAILLE], fnom[TAILLE], fpnom[TAILLE], bCard, member, tnom[TAILLE][15], tpnom[TAILLE][15], action, choix, recharge;
|
|
place = Fillvar(tAd, tnom, tpnom, tage, tstate, tacti, tpasseoupas, tptsbought, tptsbonus, tcateg, 500);
|
|
|
|
printf("Bienvenue ! \nMembre (M) | Création compte (C)\n");
|
|
scanf("%c%*c", &member);
|
|
while (member != 'M' && member != 'C')
|
|
{
|
|
printf("Saisir un caractère correct (Membre M ou Création C)\n");
|
|
scanf("%*c%c%*c", &member);
|
|
}
|
|
|
|
|
|
bCard = Card();//demande si carte avec client ou non
|
|
|
|
if (member == 'C')//si il y a besoin de créer un compte
|
|
{
|
|
//à voir avec evann
|
|
return;
|
|
}
|
|
|
|
if (member == 'M')//si le client est déjà membre
|
|
{
|
|
if (bCard == 'N')// si client n'a pas la carte
|
|
{
|
|
Name(nom, pnom);
|
|
|
|
puts("Recherche de la carte !");
|
|
|
|
place = FindData(nom, pnom, tnom, tpnom, tpasseoupas, tptsbought, &action, 500);
|
|
if (place == -1)
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (bCard == 'O')
|
|
{
|
|
printf("Numéro carte : \t");
|
|
scanf("%*c%d", &numAd);
|
|
ret = FindN(tAd, numAd, tpasseoupas, 500);
|
|
if (ret == -1)
|
|
{
|
|
main();
|
|
}
|
|
}
|
|
|
|
|
|
ChoiceMenu(&choix);
|
|
|
|
if (choix == 'A')
|
|
{
|
|
printf("La carte dispose de %d points.\n", tptsbought[place]);//infos sur ses points
|
|
ChoiceMenu(&choix);
|
|
}
|
|
|
|
if (choix == 'R')
|
|
{
|
|
Recharge(tptsbought, place, tcateg);
|
|
ChoiceMenu(&choix);
|
|
}
|
|
|
|
if (choix == 'C')
|
|
{
|
|
printf("Nombre d'activités souhaitées ? (max 3)\n");
|
|
scanf("%d", &nbacti);
|
|
while (nbacti < 0 || nbacti > 3)
|
|
{
|
|
printf("Nombre d'activités incorrect (max 3)\n");
|
|
scanf("%d", &nbacti);
|
|
}
|
|
|
|
chxacti = ChoiceActi(nbacti, tacti);
|
|
CheckPts(tptsbonus, tptsbought, tpasseoupas, tacti, tcateg, place, chxacti, &insuf);
|
|
if (insuf == 1)
|
|
{
|
|
printf("Nombre de points insuffisants : Recharge (R) ou Quitter (Q)");
|
|
scanf("%*c%c%*c", &recharge);
|
|
if (recharge == 'R')
|
|
{
|
|
Recharge(tptsbought, place, tcateg);
|
|
}
|
|
else
|
|
{
|
|
ChoiceMenu(&choix);
|
|
}
|
|
}
|
|
|
|
|
|
ChoiceMenu(&choix);
|
|
|
|
}
|
|
|
|
if (choix == 'Q')
|
|
{
|
|
//menuglobal()
|
|
return;
|
|
}
|
|
}
|
|
}
|