From f91615fc7992f3c719070dabfc4df8ff9b593f98 Mon Sep 17 00:00:00 2001 From: Kyllian Chabanon Date: Thu, 22 Dec 2022 22:03:25 +0100 Subject: [PATCH] Modifications --- Partie_1/partie1.c | 128 -------------------------------------------- Partie_1/partie1.h | 4 -- SAE.h | 5 ++ global/menus.c | 129 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 134 insertions(+), 132 deletions(-) diff --git a/Partie_1/partie1.c b/Partie_1/partie1.c index ceb13b6..2a1c44a 100755 --- a/Partie_1/partie1.c +++ b/Partie_1/partie1.c @@ -1,133 +1,5 @@ #include "partie1.h" -void choixMenu(void) -{ - int choix; - bool c = false; - while (c == false) - { - system("clear"); - printf("Veuillez choisir votre menu :\n"); - printf("\t1 - Menu utilisateur\n"); - printf("\t2 - Menu administrateur\n"); - printf("\t9 - Quitter\n"); - printf("\nChoix : "); - scanf("%d", &choix); - switch (choix) - { - case 1: - c = true; - menuUtilisateur(); - break; - case 2: - c = true; - menuAdministrateur(); - break; - case 9: - c = true; - break; - default: - printf("Option non reconnue. Veuillez recommencer.\n"); - break; - } - } -} - -void menuUtilisateur(void) -{ - int choix; - bool c = false; - while (c == false) - { - system("clear"); - printf("Menu d'utilisateur : Que voulez-vous faire ?\n"); - printf("\t1 - Voir les villes possédant un IUT\n"); - printf("\t2 - Voir les départements dans chaque IUT\n"); - printf("\t3 - Voir le nombre de places en première année\n"); - printf("\t4 - Voir les IUT possédant un département particulier\n"); - printf("\t9 - Quitter\n"); - printf("\nChoix : "); - scanf("%d", &choix); - switch (choix) - { - case 1: - c = true; - // - break; - case 2: - c = true; - // - break; - case 3: - c = true; - // - break; - case 4: - c = true; - // - break; - case 9: - c = true; - return choixMenu(); - default: - printf("Option non reconnue. Veuillez recommencer.\n"); - break; - } - } -} - -void menuAdministrateur(void) -{ - int choix; - bool c = false; - while (c == false) - { - system("clear"); - printf("Menu d'administrateur : Que voulez-vous faire ?\n"); - printf("\t1 - Modifier le nombre de places dans un département\n"); - printf("\t2 - Créer un département dans un IUT\n"); - printf("\t3 - Supprimer un département d'un IUT\n"); - printf("\t4 - Lancer la phase de candidature\n"); - printf("\t5 - Stopper la phase de candidature\n"); - printf("\t6 - Modifier le responsable d'un département\n"); - printf("\t9 - Quitter\n"); - printf("\nChoix : "); - scanf("%d", &choix); - switch (choix) - { - case 1: - c = true; - // - break; - case 2: - c = true; - // - break; - case 3: - c = true; - // - break; - case 4: - c = true; - // - break; - case 5: - c = true; - // - break; - case 6: - c = true; - // - break; - case 9: - return choixMenu(); - break; - default: - printf("Option non reconnue. Veuillez recommencer.\n"); - break; - } - } -} ListeDept listenouv(void) { diff --git a/Partie_1/partie1.h b/Partie_1/partie1.h index 67f63ba..bd4920b 100755 --- a/Partie_1/partie1.h +++ b/Partie_1/partie1.h @@ -3,10 +3,6 @@ #include "../structures/structures.h" #include -/* Menus */ -void choixMenu(void); -void menuUtilisateur(void); -void menuAdministrateur(void); /* Fichier */ int chargementVilleIUT(VilleIUT *tiut[]); diff --git a/SAE.h b/SAE.h index 5eb4017..da525b6 100755 --- a/SAE.h +++ b/SAE.h @@ -18,6 +18,11 @@ typedef struct ListeDept ldept; } VilleIUT; */ +/* Menus */ +void choixMenu(void); +void menuUtilisateur(void); +void menuAdministrateur(void); + /* Partie 3 */ /* V2 */ diff --git a/global/menus.c b/global/menus.c index 52985da..b1f4188 100755 --- a/global/menus.c +++ b/global/menus.c @@ -10,3 +10,132 @@ int MenuRespAdminDept(void) scanf("%d", &choix); return choix; } + +void choixMenu(void) +{ + int choix; + bool c = false; + while (c == false) + { + system("clear"); + printf("Veuillez choisir votre menu :\n"); + printf("\t1 - Menu utilisateur\n"); + printf("\t2 - Menu administrateur\n"); + printf("\t9 - Quitter\n"); + printf("\nChoix : "); + scanf("%d", &choix); + switch (choix) + { + case 1: + c = true; + menuUtilisateur(); + break; + case 2: + c = true; + menuAdministrateur(); + break; + case 9: + c = true; + break; + default: + printf("Option non reconnue. Veuillez recommencer.\n"); + break; + } + } +} + +void menuUtilisateur(void) +{ + int choix; + bool c = false; + while (c == false) + { + system("clear"); + printf("Menu d'utilisateur : Que voulez-vous faire ?\n"); + printf("\t1 - Voir les villes possédant un IUT\n"); + printf("\t2 - Voir les départements dans chaque IUT\n"); + printf("\t3 - Voir le nombre de places en première année\n"); + printf("\t4 - Voir les IUT possédant un département particulier\n"); + printf("\t9 - Quitter\n"); + printf("\nChoix : "); + scanf("%d", &choix); + switch (choix) + { + case 1: + c = true; + // + break; + case 2: + c = true; + // + break; + case 3: + c = true; + // + break; + case 4: + c = true; + // + break; + case 9: + c = true; + return choixMenu(); + default: + printf("Option non reconnue. Veuillez recommencer.\n"); + break; + } + } +} + +void menuAdministrateur(void) +{ + int choix; + bool c = false; + while (c == false) + { + system("clear"); + printf("Menu d'administrateur : Que voulez-vous faire ?\n"); + printf("\t1 - Modifier le nombre de places dans un département\n"); + printf("\t2 - Créer un département dans un IUT\n"); + printf("\t3 - Supprimer un département d'un IUT\n"); + printf("\t4 - Lancer la phase de candidature\n"); + printf("\t5 - Stopper la phase de candidature\n"); + printf("\t6 - Modifier le responsable d'un département\n"); + printf("\t9 - Quitter\n"); + printf("\nChoix : "); + scanf("%d", &choix); + switch (choix) + { + case 1: + c = true; + // + break; + case 2: + c = true; + // + break; + case 3: + c = true; + // + break; + case 4: + c = true; + // + break; + case 5: + c = true; + // + break; + case 6: + c = true; + // + break; + case 9: + return choixMenu(); + break; + default: + printf("Option non reconnue. Veuillez recommencer.\n"); + break; + } + } +} \ No newline at end of file