|
|
|
@ -129,7 +129,7 @@ int ajouterAdherent(int tabAdhe[], int tabPoints[], int jour[], int mois[], int
|
|
|
|
|
annee[pos] = valAnnee;
|
|
|
|
|
carte[pos] = perdue;
|
|
|
|
|
nb += 1;
|
|
|
|
|
return nb;
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -164,6 +164,63 @@ int suppression(int tab[], int tabPoints[], int jour[], int mois[], int annee[],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int activerCarte(int tabAdhe[], int carte[], int tailleL, int val) {
|
|
|
|
|
int pos, trouve;
|
|
|
|
|
pos = recherche(tabAdhe,val,tailleL,&trouve);
|
|
|
|
|
if (trouve == 0) {
|
|
|
|
|
printf("La carte n'existe pas !\n");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (carte[pos] == 0) {
|
|
|
|
|
carte[pos] = 1;
|
|
|
|
|
printf("La carte a bien été activée.\n");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
carte[pos] = 0;
|
|
|
|
|
printf("La carte a bien été désactivée.\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void gestionCarte(int tabAdhe[], int tabPoints[], int jour[], int mois[], int annee[], int carte[], int tailleL) {
|
|
|
|
|
int choix, numCarte;
|
|
|
|
|
printf("Numéro de la carte : ");
|
|
|
|
|
scanf("%d",&numCarte);
|
|
|
|
|
while(1) {
|
|
|
|
|
printf("\n1 \t\t Afficher les informations sur la carte\n");
|
|
|
|
|
printf("2 \t\t Activer/Désactiver carte\n");
|
|
|
|
|
printf("3 \t\t Alimenter une carte\n");
|
|
|
|
|
printf("9 \t\t Quitter\n");
|
|
|
|
|
printf("Numéro de la carte actuelle : %d\n",numCarte);
|
|
|
|
|
scanf("%d",&choix);
|
|
|
|
|
switch(choix) {
|
|
|
|
|
case 1:
|
|
|
|
|
system("clear");
|
|
|
|
|
affichageCarte(tabAdhe,tabPoints,jour,mois,annee,carte,tailleL,numCarte);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
system("clear");
|
|
|
|
|
activerCarte(tabAdhe,carte,tailleL,numCarte);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
system("clear");
|
|
|
|
|
alimenterCarte(tabAdhe,tabPoints,tailleL);
|
|
|
|
|
break;
|
|
|
|
|
case 9:
|
|
|
|
|
system("clear");
|
|
|
|
|
return ;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void affichageTous(int tabAdhe[], int tabPoints[], int jour[], int mois[], int annee[], int carte[],int taille)
|
|
|
|
|
{
|
|
|
|
@ -176,11 +233,9 @@ void affichageTous(int tabAdhe[], int tabPoints[], int jour[], int mois[], int a
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void affichageCarte(int tabAdhe[], int tabPoints[], int jour[], int mois[], int annee[], int carte[], int nb) {
|
|
|
|
|
int carteVal, pos, trouve;
|
|
|
|
|
printf("Numéro de la carte ?\n");
|
|
|
|
|
scanf("%d",&carteVal);
|
|
|
|
|
pos = recherche(tabAdhe, carteVal, nb, &trouve);
|
|
|
|
|
void affichageCarte(int tabAdhe[], int tabPoints[], int jour[], int mois[], int annee[], int carte[], int nb, int val) {
|
|
|
|
|
int pos, trouve;
|
|
|
|
|
pos = recherche(tabAdhe, val, nb, &trouve);
|
|
|
|
|
if (trouve == 0) printf("Valeur non trouvée !\n");
|
|
|
|
|
else {
|
|
|
|
|
printf("Numéro\tPoints\tDate d'activation\t\n");
|
|
|
|
|