#include "sae.h" #include #include void main(void) { int tAd[TAILLE], tage[TAILLE], tstate[TAILLE], tacti[TAILLE], tpasseoupas[TAILLE], tptsbought[TAILLE], tptsbonus[TAILLE], place, nbacti, chxacti, numAd, ret, insuf; char tcateg[TAILLE], nom[TAILLE], pnom[TAILLE], fnom[TAILLE], fpnom[TAILLE], bCard, member, tnom[TAILLE][15], tpnom[TAILLE][15], action, choix, recharge; 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; } } }