|
|
@ -233,7 +233,6 @@ void menuResponsable(VilleIUT*** tiutPointer, int* nbVilles) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void menuAdmin(VilleIUT*** tiutPointer, int* nbVilles) {
|
|
|
|
void menuAdmin(VilleIUT*** tiutPointer, int* nbVilles) {
|
|
|
|
VilleIUT** tiut = *tiutPointer;
|
|
|
|
|
|
|
|
char poubelle; // Permet de stocker les caractères aspirés en trop sur stdin lors du choix dans le menu
|
|
|
|
char poubelle; // Permet de stocker les caractères aspirés en trop sur stdin lors du choix dans le menu
|
|
|
|
int choix; // Contient le choix de l'utilisateur dans le menu
|
|
|
|
int choix; // Contient le choix de l'utilisateur dans le menu
|
|
|
|
char pass[LEN_MAX];
|
|
|
|
char pass[LEN_MAX];
|
|
|
@ -274,7 +273,7 @@ void menuAdmin(VilleIUT*** tiutPointer, int* nbVilles) {
|
|
|
|
printf("Entrez une ville : ");
|
|
|
|
printf("Entrez une ville : ");
|
|
|
|
scanf("%s", searchIUT);
|
|
|
|
scanf("%s", searchIUT);
|
|
|
|
|
|
|
|
|
|
|
|
int code = afficherListeDepartement(tiut, *nbVilles, searchIUT);
|
|
|
|
int code = afficherListeDepartement(*tiutPointer, *nbVilles, searchIUT);
|
|
|
|
|
|
|
|
|
|
|
|
if(code) {
|
|
|
|
if(code) {
|
|
|
|
printf("Quel département souhaitez-vous modifier ? : ");
|
|
|
|
printf("Quel département souhaitez-vous modifier ? : ");
|
|
|
@ -282,7 +281,7 @@ void menuAdmin(VilleIUT*** tiutPointer, int* nbVilles) {
|
|
|
|
printf("Entrez le nouveau nombre de places pour le département '%s' : ", searchDept);
|
|
|
|
printf("Entrez le nouveau nombre de places pour le département '%s' : ", searchDept);
|
|
|
|
scanf("%d", &nbPlaces);
|
|
|
|
scanf("%d", &nbPlaces);
|
|
|
|
|
|
|
|
|
|
|
|
modifierNbPlaces(tiut, *nbVilles, searchIUT, searchDept, nbPlaces);
|
|
|
|
modifierNbPlaces(*tiutPointer, *nbVilles, searchIUT, searchDept, nbPlaces);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -293,12 +292,12 @@ void menuAdmin(VilleIUT*** tiutPointer, int* nbVilles) {
|
|
|
|
printf("Entrez la ville dans laquelle vous souhaitez ajouter un département : ");
|
|
|
|
printf("Entrez la ville dans laquelle vous souhaitez ajouter un département : ");
|
|
|
|
scanf("%s", searchIUT2);
|
|
|
|
scanf("%s", searchIUT2);
|
|
|
|
|
|
|
|
|
|
|
|
int i2 = rechercherVille(tiut, *nbVilles, searchIUT2);
|
|
|
|
int i2 = rechercherVille(*tiutPointer, *nbVilles, searchIUT2);
|
|
|
|
|
|
|
|
|
|
|
|
if(i2 == -1)
|
|
|
|
if(i2 == -1)
|
|
|
|
fprintf(stderr, "\n\e[1;91mErreur: la ville '%s' n'est pas dans la liste des IUT.\e[0m\n\n", searchIUT2);
|
|
|
|
fprintf(stderr, "\n\e[1;91mErreur: la ville '%s' n'est pas dans la liste des IUT.\e[0m\n\n", searchIUT2);
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
VilleIUT* ville = tiut[i2];
|
|
|
|
VilleIUT* ville = *tiutPointer[i2];
|
|
|
|
|
|
|
|
|
|
|
|
int nbP;
|
|
|
|
int nbP;
|
|
|
|
char addDept[LEN_MAX], responsable[LEN_MAX];
|
|
|
|
char addDept[LEN_MAX], responsable[LEN_MAX];
|
|
|
@ -341,14 +340,14 @@ void menuAdmin(VilleIUT*** tiutPointer, int* nbVilles) {
|
|
|
|
printf("Entrez la ville dans laquelle vous souhaitez supprimer un département : ");
|
|
|
|
printf("Entrez la ville dans laquelle vous souhaitez supprimer un département : ");
|
|
|
|
scanf("%s", searchIUT3);
|
|
|
|
scanf("%s", searchIUT3);
|
|
|
|
|
|
|
|
|
|
|
|
int i3 = rechercherVille(tiut, *nbVilles, searchIUT3);
|
|
|
|
int i3 = rechercherVille(*tiutPointer, *nbVilles, searchIUT3);
|
|
|
|
|
|
|
|
|
|
|
|
if(i3 == -1)
|
|
|
|
if(i3 == -1)
|
|
|
|
fprintf(stderr, "\e[1;91mErreur: la ville '%s' n'est pas dans la liste des IUT.\e[0m\n\n", searchIUT3);
|
|
|
|
fprintf(stderr, "\e[1;91mErreur: la ville '%s' n'est pas dans la liste des IUT.\e[0m\n\n", searchIUT3);
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
VilleIUT* ville3 = tiut[i3];
|
|
|
|
VilleIUT* ville3 = *tiutPointer[i3];
|
|
|
|
|
|
|
|
|
|
|
|
afficherListeDepartement(tiut, *nbVilles, searchIUT3);
|
|
|
|
afficherListeDepartement(*tiutPointer, *nbVilles, searchIUT3);
|
|
|
|
|
|
|
|
|
|
|
|
char searchDept3[LEN_MAX];
|
|
|
|
char searchDept3[LEN_MAX];
|
|
|
|
printf("Quel département souhaitez-vous supprimer ? : ");
|
|
|
|
printf("Quel département souhaitez-vous supprimer ? : ");
|
|
|
@ -370,7 +369,7 @@ void menuAdmin(VilleIUT*** tiutPointer, int* nbVilles) {
|
|
|
|
printf("Dans quel IUT souhaitez-vous faire une modification ? : ");
|
|
|
|
printf("Dans quel IUT souhaitez-vous faire une modification ? : ");
|
|
|
|
scanf("%s", searchIUT5);
|
|
|
|
scanf("%s", searchIUT5);
|
|
|
|
|
|
|
|
|
|
|
|
int code5 = afficherListeDepartement(tiut, *nbVilles, searchIUT5);
|
|
|
|
int code5 = afficherListeDepartement(*tiutPointer, *nbVilles, searchIUT5);
|
|
|
|
|
|
|
|
|
|
|
|
if(code5 != -1) {
|
|
|
|
if(code5 != -1) {
|
|
|
|
printf("Quel département souhaitez-vous modifier ? : ");
|
|
|
|
printf("Quel département souhaitez-vous modifier ? : ");
|
|
|
@ -379,7 +378,7 @@ void menuAdmin(VilleIUT*** tiutPointer, int* nbVilles) {
|
|
|
|
printf("Quel est le nom du nouveau responsable : ");
|
|
|
|
printf("Quel est le nom du nouveau responsable : ");
|
|
|
|
scanf("%*c%[^\n]", nom);
|
|
|
|
scanf("%*c%[^\n]", nom);
|
|
|
|
|
|
|
|
|
|
|
|
modifierNomResponsable(tiut, *nbVilles, searchIUT5, searchDept5, nom);
|
|
|
|
modifierNomResponsable(*tiutPointer, *nbVilles, searchIUT5, searchDept5, nom);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
@ -575,11 +574,11 @@ void afficherDepartement(VilleIUT** tiut, int nbVilles, char* searchDept) {
|
|
|
|
ListeDept search = ldept;
|
|
|
|
ListeDept search = ldept;
|
|
|
|
|
|
|
|
|
|
|
|
while(search->suiv != NULL) {
|
|
|
|
while(search->suiv != NULL) {
|
|
|
|
if(strcmp(ldept->departement, searchDept) == 0) {
|
|
|
|
search = search->suiv;
|
|
|
|
|
|
|
|
if(strcmp(search->departement, searchDept) == 0) {
|
|
|
|
printf(" - %s\n", tiut[i]->ville);
|
|
|
|
printf(" - %s\n", tiut[i]->ville);
|
|
|
|
nb++;
|
|
|
|
nb++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
search = search->suiv;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -701,12 +700,12 @@ void modifierNomResponsable(VilleIUT** tiut, int nbVilles, char* searchIUT, char
|
|
|
|
ListeDept search = ldept;
|
|
|
|
ListeDept search = ldept;
|
|
|
|
|
|
|
|
|
|
|
|
while(search->suiv != NULL) {
|
|
|
|
while(search->suiv != NULL) {
|
|
|
|
|
|
|
|
search = search->suiv;
|
|
|
|
if(strcmp(search->departement, searchDept) == 0) {
|
|
|
|
if(strcmp(search->departement, searchDept) == 0) {
|
|
|
|
strcpy(search->responsable, nom);
|
|
|
|
strcpy(search->responsable, nom);
|
|
|
|
printf("\n\e[1;32mLe responsable de la formation '%s' à l'IUT '%s' est désormais '%s'.\e[0m\n\n", searchDept, searchIUT, search->responsable);
|
|
|
|
printf("\n\e[1;32mLe responsable de la formation '%s' à l'IUT '%s' est désormais '%s'.\e[0m\n\n", searchDept, searchIUT, search->responsable);
|
|
|
|
foundDept = 1;
|
|
|
|
foundDept = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
search = search->suiv;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|