This commit is contained in:
Lukian 2023-11-20 17:48:40 +01:00
parent 0c6cf142a4
commit 370856ec3d
9 changed files with 68 additions and 42 deletions

View file

@ -98,7 +98,7 @@ void menuConf(ptConf confChain, ptListener listenerChain) {
ptConf px = confChain;
while (px -> next != NULL) {
printf("title : %s\nspeaker : %s\n", px -> title, px -> speaker);
printf("id : %d\ntitle : %s\nspeaker : %s\n", px -> id, px -> title, px -> speaker);
printf("%d/%d/%d\n\n",px -> day, px -> month, px -> year);
px = px -> next;
}
@ -107,7 +107,27 @@ void menuConf(ptConf confChain, ptListener listenerChain) {
break;
case 2:
{
int id, day, month, year;
char title[30];
char speaker[20];
id = findConfId(confChain);
printf("Titre de la conference : ");
scanf("%29s", &title);
printf("Nom du conferencier : ");
scanf("%19s", &speaker);
printf("Jour : ");
scanf("%d", &day);
printf("Mois : ");
scanf("%d", &month);
printf("Année : ");
scanf("%d", &year);
addConf(confChain, id, title, speaker, day, month, year);
menuConf(confChain, listenerChain);
break;
}
case 3:
break;
@ -146,7 +166,22 @@ void menuAbo(ptConf confChain, ptListener listenerChain) {
break;
case 2:
{
int id, age, level;
char name[20];
id = findListenerId(listenerChain);
printf("Nom : ");
scanf("%19s", &name);
printf("Age : ");
scanf("%d", &age);
printf("Niveau : ");
scanf("%d", &level);
addListener(listenerChain, id, name, age, level);
menuAbo(confChain, listenerChain);
break;
}
case 3:
break;
@ -163,10 +198,10 @@ void menuAbo(ptConf confChain, ptListener listenerChain) {
void menu(ptConf confChain, ptListener listenerChain)
{
char *options[] = {"1/ Gestion des conferences", "2/ Gestion des abonnes", "3/ Participer a une conference", "4/ Voir la meilleure conference", "5/ Voir la participation a une conference", "6/ Quitter"};
char *options[] = {"1/ Gestion des conferences", "2/ Gestion des abonnes", "3/ Participer a une conference", "4/ Voir la meilleure conference", "5/ Voir la participation a une conference", "6/ Sauvegarder", "7/ Quitter"};
system("cls");
drawMenu(options, 6);
goToCoords(0, 14);
drawMenu(options, 7);
goToCoords(0, 15);
printf("Que voulez-vous faire ? : ");
int choice;
scanf("%d", &choice);
@ -191,6 +226,9 @@ void menu(ptConf confChain, ptListener listenerChain)
break;
case 6:
saveConf(confChain);
saveListeners(listenerChain);
menu(confChain, listenerChain);
break;
default: