|
|
|
@ -1,13 +1,13 @@
|
|
|
|
|
#include "SAE.h"
|
|
|
|
|
|
|
|
|
|
void choixMenu(ListeDept *tiut[])
|
|
|
|
|
void menu(VilleIUT *tiut[], int nbVilles)
|
|
|
|
|
{
|
|
|
|
|
int choix;
|
|
|
|
|
bool c = false;
|
|
|
|
|
while (c == false)
|
|
|
|
|
{
|
|
|
|
|
system("clear");
|
|
|
|
|
printf("Veuillez choisir votre menu :\n");
|
|
|
|
|
// system("clear");
|
|
|
|
|
printf("\n\nVeuillez choisir votre menu :\n");
|
|
|
|
|
printf("\t1 - Menu utilisateur\n");
|
|
|
|
|
printf("\t2 - Menu administrateur\n");
|
|
|
|
|
printf("\t9 - Quitter\n");
|
|
|
|
@ -16,15 +16,16 @@ void choixMenu(ListeDept *tiut[])
|
|
|
|
|
switch (choix)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
c = true;
|
|
|
|
|
menuUtilisateur(tiut);
|
|
|
|
|
c = false;
|
|
|
|
|
menuUtilisateur(tiut, nbVilles);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
c = true;
|
|
|
|
|
menuAdministrateur(tiut);
|
|
|
|
|
c = false;
|
|
|
|
|
menuAdministrateur(tiut, nbVilles);
|
|
|
|
|
break;
|
|
|
|
|
case 9:
|
|
|
|
|
c = true;
|
|
|
|
|
return;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
printf("Option non reconnue. Veuillez recommencer.\n");
|
|
|
|
@ -33,14 +34,14 @@ void choixMenu(ListeDept *tiut[])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void menuUtilisateur(ListeDept *tiut[])
|
|
|
|
|
void menuUtilisateur(VilleIUT *tiut[], int nbVilles)
|
|
|
|
|
{
|
|
|
|
|
int choix;
|
|
|
|
|
bool c = false;
|
|
|
|
|
while (c == false)
|
|
|
|
|
{
|
|
|
|
|
system("clear");
|
|
|
|
|
printf("Menu d'utilisateur : Que voulez-vous faire ?\n");
|
|
|
|
|
// system("clear");
|
|
|
|
|
printf("\n\nMenu 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");
|
|
|
|
@ -51,24 +52,24 @@ void menuUtilisateur(ListeDept *tiut[])
|
|
|
|
|
switch (choix)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
c = true;
|
|
|
|
|
// affichageVillesIUT(VilleIUT *tiut[], int nb);
|
|
|
|
|
c = false;
|
|
|
|
|
affichageVillesIUT(tiut, nbVilles);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
c = true;
|
|
|
|
|
// affichageDeptIUT(VilleIUT *tiut[], int nb);
|
|
|
|
|
c = false;
|
|
|
|
|
affichageDeptIUT(tiut, nbVilles);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
c = true;
|
|
|
|
|
c = false;
|
|
|
|
|
//
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
c = true;
|
|
|
|
|
c = false;
|
|
|
|
|
//
|
|
|
|
|
break;
|
|
|
|
|
case 9:
|
|
|
|
|
c = true;
|
|
|
|
|
return choixMenu(tiut);
|
|
|
|
|
return menu(tiut, nbVilles);
|
|
|
|
|
default:
|
|
|
|
|
printf("Option non reconnue. Veuillez recommencer.\n");
|
|
|
|
|
break;
|
|
|
|
@ -76,14 +77,14 @@ void menuUtilisateur(ListeDept *tiut[])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void menuAdministrateur(ListeDept *tiut[])
|
|
|
|
|
void menuAdministrateur(VilleIUT *tiut[], int nbVilles)
|
|
|
|
|
{
|
|
|
|
|
int choix;
|
|
|
|
|
bool c = false;
|
|
|
|
|
while (c == false)
|
|
|
|
|
{
|
|
|
|
|
system("clear");
|
|
|
|
|
printf("Menu d'administrateur : Que voulez-vous faire ?\n");
|
|
|
|
|
// system("clear");
|
|
|
|
|
printf("\n\nMenu 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");
|
|
|
|
@ -96,31 +97,32 @@ void menuAdministrateur(ListeDept *tiut[])
|
|
|
|
|
switch (choix)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
c = true;
|
|
|
|
|
// modificationNbPDept(tiut, nb);
|
|
|
|
|
c = false;
|
|
|
|
|
modificationNbPDept(tiut, nbVilles);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
c = true;
|
|
|
|
|
// creationDept(tiut[], nb);
|
|
|
|
|
c = false;
|
|
|
|
|
creationDept(tiut, nbVilles);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
c = true;
|
|
|
|
|
// suppressionDept(tiut[], nb);
|
|
|
|
|
c = false;
|
|
|
|
|
suppressionDept(tiut, nbVilles);
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
c = true;
|
|
|
|
|
// modificationRespDept(tiut, nb);
|
|
|
|
|
c = false;
|
|
|
|
|
modificationRespDept(tiut, nbVilles);
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
c = true;
|
|
|
|
|
c = false;
|
|
|
|
|
//
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
c = true;
|
|
|
|
|
c = false;
|
|
|
|
|
//
|
|
|
|
|
break;
|
|
|
|
|
case 9:
|
|
|
|
|
return choixMenu(tiut);
|
|
|
|
|
c = true;
|
|
|
|
|
return menu(tiut, nbVilles);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
printf("Option non reconnue. Veuillez recommencer.\n");
|
|
|
|
|