|
|
@ -59,6 +59,7 @@ bool confirmationSup(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char choix[4];
|
|
|
|
char choix[4];
|
|
|
|
while(1)
|
|
|
|
while(1)
|
|
|
|
|
|
|
|
{
|
|
|
|
printf("Êtes-vous sûr de vouloir supprimer/moddifié : ");
|
|
|
|
printf("Êtes-vous sûr de vouloir supprimer/moddifié : ");
|
|
|
|
scanf("%s", choix);
|
|
|
|
scanf("%s", choix);
|
|
|
|
if (strcmp(choix,"oui")==0)
|
|
|
|
if (strcmp(choix,"oui")==0)
|
|
|
@ -66,6 +67,7 @@ bool confirmationSup(void)
|
|
|
|
if (strcmp(choix,"non")==0)
|
|
|
|
if (strcmp(choix,"non")==0)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
printf("Erreur de sélection ! Veuillez réessayer \n");
|
|
|
|
printf("Erreur de sélection ! Veuillez réessayer \n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -117,29 +119,37 @@ void gestionMenu(VilleIUT **tiut, int nbEle)
|
|
|
|
system("clear");
|
|
|
|
system("clear");
|
|
|
|
switch(choix) {
|
|
|
|
switch(choix) {
|
|
|
|
case 1:
|
|
|
|
case 1:
|
|
|
|
//mettre a jour le nombre de places d'un département d'un iut
|
|
|
|
AffichageVille(tiut,nbEle);
|
|
|
|
clearpage();
|
|
|
|
clearpage();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
case 2:
|
|
|
|
//créer un département dans un iut
|
|
|
|
AffichageGlobalDepVille(tiut, nbEle);
|
|
|
|
clearpage();
|
|
|
|
clearpage();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
case 3:
|
|
|
|
//supprimer un département dans un iut
|
|
|
|
AffichageNbplaceDept(tiut, nbEle);
|
|
|
|
clearpage();
|
|
|
|
clearpage();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
case 4:
|
|
|
|
//gérer les phases de candidature
|
|
|
|
AffichageNbplaceDeptVille(tiut, nbEle);
|
|
|
|
clearpage();
|
|
|
|
clearpage();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
case 5:
|
|
|
|
//affichage de tout les département d'un iut
|
|
|
|
AffichageDepVille(tiut, nbEle);
|
|
|
|
|
|
|
|
clearpage();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 6:
|
|
|
|
|
|
|
|
AffichageDeptVille(tiut, nbEle);
|
|
|
|
|
|
|
|
clearpage();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 7:
|
|
|
|
|
|
|
|
AffichageGlobalIUT(tiut, nbEle);
|
|
|
|
clearpage();
|
|
|
|
clearpage();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
case 9:
|
|
|
|
choix = gestionMenuAdmin(tiut, nbEle);
|
|
|
|
choix = gestionMenuAdmin(tiut, nbEle);
|
|
|
|
if (choix == -1)
|
|
|
|
if (choix == -1)
|
|
|
|
return;
|
|
|
|
if (verifQuit()) return;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
case 10:
|
|
|
|
if (verifQuit()) return;
|
|
|
|
if (verifQuit()) return;
|
|
|
@ -160,30 +170,24 @@ int gestionMenuAdmin(VilleIUT **tiut, int nbEle)
|
|
|
|
system("clear");
|
|
|
|
system("clear");
|
|
|
|
switch(choix){
|
|
|
|
switch(choix){
|
|
|
|
case 1:
|
|
|
|
case 1:
|
|
|
|
clearpage();
|
|
|
|
MiseAJourNbPlace(tiut, nbEle);
|
|
|
|
|
|
|
|
system("clear");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
case 2:
|
|
|
|
clearpage();
|
|
|
|
creationDept(tiut, nbEle);
|
|
|
|
|
|
|
|
system("clear");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
case 3:
|
|
|
|
//affichage du nombres de places par département des iut
|
|
|
|
suppressionDept(tiut, nbEle);
|
|
|
|
clearpage();
|
|
|
|
system("clear");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
case 4:
|
|
|
|
//affichage du nombres de places par département d'un iut
|
|
|
|
//affichage du nombres de places par département d'un iut
|
|
|
|
clearpage();
|
|
|
|
clearpage();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
case 5:
|
|
|
|
//affichage de tout les département d'un iut
|
|
|
|
modifChefDept(tiut, nbEle);
|
|
|
|
clearpage();
|
|
|
|
system("clear");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 6:
|
|
|
|
|
|
|
|
//affichage de tout les iut ayant un département choisi
|
|
|
|
|
|
|
|
clearpage();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 7:
|
|
|
|
|
|
|
|
//affichage de tout les iut ayant un département choisi
|
|
|
|
|
|
|
|
clearpage();
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
case 9:
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
@ -202,10 +206,7 @@ void global(void)
|
|
|
|
printf("charg\n");
|
|
|
|
printf("charg\n");
|
|
|
|
tab = chargementVille(nomFich,30,&tailleL);
|
|
|
|
tab = chargementVille(nomFich,30,&tailleL);
|
|
|
|
printf("\n");
|
|
|
|
printf("\n");
|
|
|
|
triEchange(tab, tailleL);
|
|
|
|
gestionMenu(tab, tailleL);
|
|
|
|
creationDept(tab, tailleL);
|
|
|
|
|
|
|
|
AffichageGlobalDepVille(tab, tailleL);
|
|
|
|
|
|
|
|
SauvegarderIUT(tab, tailleL);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AffichageVille(VilleIUT **tiut, int nbEle)
|
|
|
|
void AffichageVille(VilleIUT **tiut, int nbEle)
|
|
|
@ -221,14 +222,16 @@ void AffichageVille(VilleIUT **tiut, int nbEle)
|
|
|
|
void AffichageGlobalDepVille(VilleIUT **tiut, int nbEle)
|
|
|
|
void AffichageGlobalDepVille(VilleIUT **tiut, int nbEle)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
MaillonDept *aux;
|
|
|
|
printf("\tDépartement par IUT :\n");
|
|
|
|
printf("\tDépartement par IUT :\n");
|
|
|
|
for(i=0;i<nbEle;i++)
|
|
|
|
for(i=0;i<nbEle;i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("%s :\n", tiut[i]->ville);
|
|
|
|
printf("%s :\n", tiut[i]->ville);
|
|
|
|
while(tiut[i]->idDept != NULL)
|
|
|
|
aux = tiut[i]->idDept;
|
|
|
|
|
|
|
|
while(aux != NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("|%s|\n",tiut[i]->idDept->departement);
|
|
|
|
printf("|%s|\n",aux->departement);
|
|
|
|
tiut[i]->idDept = tiut[i]->idDept->suiv;
|
|
|
|
aux = aux->suiv;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -236,13 +239,15 @@ void AffichageGlobalDepVille(VilleIUT **tiut, int nbEle)
|
|
|
|
void AffichageNbplaceDept(VilleIUT **tiut, int nbEle)
|
|
|
|
void AffichageNbplaceDept(VilleIUT **tiut, int nbEle)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int pos;
|
|
|
|
int pos;
|
|
|
|
|
|
|
|
MaillonDept *aux;
|
|
|
|
for (pos = 0; pos < nbEle; pos++)
|
|
|
|
for (pos = 0; pos < nbEle; pos++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("%s -> \t", tiut[pos]->ville);
|
|
|
|
printf("%s -> \t", tiut[pos]->ville);
|
|
|
|
while(tiut[pos]->idDept->suiv != NULL && pos < nbEle)
|
|
|
|
aux = tiut[pos]->idDept;
|
|
|
|
|
|
|
|
while(aux->suiv != NULL && pos < nbEle)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("|%s, %d places|\n\t",tiut[pos]->idDept->departement, tiut[pos]->idDept->nbPers);
|
|
|
|
printf("|%s, %d places|\n\t",aux->departement, aux->nbPers);
|
|
|
|
tiut[pos]->idDept = tiut[pos]->idDept->suiv;
|
|
|
|
aux = aux->suiv;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
printf("\n");
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -263,6 +268,8 @@ int rechVille(VilleIUT **tiut, int nbEle, char code[], int *trouve)
|
|
|
|
sup = m - 1;
|
|
|
|
sup = m - 1;
|
|
|
|
else inf = m + 1;
|
|
|
|
else inf = m + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
*trouve = 0;
|
|
|
|
|
|
|
|
return inf;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AffichageNbplaceDeptVille(VilleIUT **tiut, int nbEle)
|
|
|
|
void AffichageNbplaceDeptVille(VilleIUT **tiut, int nbEle)
|
|
|
@ -382,7 +389,7 @@ void MiseAJourNbPlace(VilleIUT **tiut, int nbEle)
|
|
|
|
aux = rechercheDept(tiut[pos]->idDept, code);
|
|
|
|
aux = rechercheDept(tiut[pos]->idDept, code);
|
|
|
|
if (aux != NULL)
|
|
|
|
if (aux != NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("Ancien nombre de places : %d",aux->nbPers);
|
|
|
|
printf("Ancien nombre de places : %d\n",aux->nbPers);
|
|
|
|
printf("Nouveau nombre de places : ", nouvNbPlace);
|
|
|
|
printf("Nouveau nombre de places : ", nouvNbPlace);
|
|
|
|
scanf("%d", &nouvNbPlace);
|
|
|
|
scanf("%d", &nouvNbPlace);
|
|
|
|
aux->nbPers = nouvNbPlace;
|
|
|
|
aux->nbPers = nouvNbPlace;
|
|
|
@ -420,10 +427,10 @@ void creationDept(VilleIUT **tiut, int nbEle)
|
|
|
|
while(1)
|
|
|
|
while(1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("Nom du Département : ");
|
|
|
|
printf("Nom du Département : ");
|
|
|
|
scanf("%s%*c", code);
|
|
|
|
scanf("%s", code);
|
|
|
|
aux = rechercheDept(tiut[pos]->idDept, code);
|
|
|
|
aux = rechercheDept(tiut[pos]->idDept, code);
|
|
|
|
if (aux != NULL)
|
|
|
|
if (aux != NULL)
|
|
|
|
printf("Département déjà existant");
|
|
|
|
printf("Département déjà existant\n");
|
|
|
|
if (aux == NULL)
|
|
|
|
if (aux == NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("Nom du Responsable du Département de %s : ",code);
|
|
|
|
printf("Nom du Responsable du Département de %s : ",code);
|
|
|
@ -494,9 +501,8 @@ void modifChefDept(VilleIUT **tiut, int nbEle)
|
|
|
|
pos = rechVille(tiut, nbEle, code, &trouve);
|
|
|
|
pos = rechVille(tiut, nbEle, code, &trouve);
|
|
|
|
if (trouve == 1)
|
|
|
|
if (trouve == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
while(1)
|
|
|
|
|
|
|
|
printf("Nom du Département : ");
|
|
|
|
printf("Nom du Département : ");
|
|
|
|
scanf("%s", code);
|
|
|
|
scanf("%s%*c", code);
|
|
|
|
aux = rechercheDept(tiut[pos]->idDept, code);
|
|
|
|
aux = rechercheDept(tiut[pos]->idDept, code);
|
|
|
|
if (aux != NULL)
|
|
|
|
if (aux != NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -504,8 +510,8 @@ void modifChefDept(VilleIUT **tiut, int nbEle)
|
|
|
|
printf("Nom du nouveau chef de département %s de %s :",aux->departement, tiut[pos]->ville);
|
|
|
|
printf("Nom du nouveau chef de département %s de %s :",aux->departement, tiut[pos]->ville);
|
|
|
|
fgets(code,30,stdin);
|
|
|
|
fgets(code,30,stdin);
|
|
|
|
code[strlen(code)-1] = '\0';
|
|
|
|
code[strlen(code)-1] = '\0';
|
|
|
|
strcpy(code, aux->responsable);
|
|
|
|
strcpy(aux->responsable, code);
|
|
|
|
printf("Chef de département : %s\n",tiut[pos]->idDept->responsable);
|
|
|
|
printf("Chef de département : %s\n",aux->responsable);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (aux == NULL)
|
|
|
|
if (aux == NULL)
|
|
|
|
printf("Ce Département n'existe pas dans l'IUT de %s \n",tiut[pos]->ville);
|
|
|
|
printf("Ce Département n'existe pas dans l'IUT de %s \n",tiut[pos]->ville);
|
|
|
|