|
|
|
@ -96,6 +96,7 @@ int Chargement(VilleIUT **tV, int tmax, char *nameFile)
|
|
|
|
|
fscanf(f, "%s %d", v.ville, &v.nbDept);
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
fclose(f);
|
|
|
|
|
return i;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -343,18 +344,50 @@ void MaJnameC(VilleIUT **tV, int nb)//mise à jour du nom du chef de départemen
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Save(VilleIUT **tV, int nb)
|
|
|
|
|
void SaveEltList(FILE *fs, ListDept l)
|
|
|
|
|
{
|
|
|
|
|
fprintf(fs, "%s\t%d\t%s\n", l->departement, l->nbP, l->respAd);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Save(VilleIUT **tV, int nb)//permettra de définir la fermeture de la phase de candidatures
|
|
|
|
|
{
|
|
|
|
|
FILE *fs;
|
|
|
|
|
fs = fopen("part1.don", "w");//on réouvre le fichier originel pour y remettre les données
|
|
|
|
|
if (fs == NULL){printf("pb ouv fichier save\n");return;}
|
|
|
|
|
int cpt = 0;
|
|
|
|
|
for(cpt; cpt < nb; cpt ++)
|
|
|
|
|
{
|
|
|
|
|
printf("%s\t%d", tV[cpt]->ville, tV[cpt]->nbDept);
|
|
|
|
|
fprintf(fs, "%s\t%d\n", tV[cpt]->ville, tV[cpt]->nbDept);
|
|
|
|
|
for (int i = 0; i < tV[cpt]->nbDept; i++)
|
|
|
|
|
{
|
|
|
|
|
SaveEltList(fs, tV[cpt]->ldept);
|
|
|
|
|
tV[cpt]->ldept = tV[cpt]->ldept->suiv;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
fclose(fs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int Admin(VilleIUT **tV, int nb)
|
|
|
|
|
{
|
|
|
|
|
int reponse;
|
|
|
|
|
|
|
|
|
|
printf("*****************************************************\n");
|
|
|
|
|
printf("*---------------------Accueil-----------------------*\n");
|
|
|
|
|
printf("*-----1-modifier nombre places d'un département-----*\n");
|
|
|
|
|
printf("*--------2-créer un département dans un IUT---------*\n");
|
|
|
|
|
printf("*------3-supprimer un département dans un IUT-------*\n");
|
|
|
|
|
printf("*-----4-modifier le nom du chef de département------*\n");
|
|
|
|
|
printf("*---------5-arrêter la phase de candidatures--------*\n");
|
|
|
|
|
printf("*****************************************************\n");
|
|
|
|
|
scanf("%d", &reponse);
|
|
|
|
|
printf("%d", reponse);
|
|
|
|
|
switch(reponse)
|
|
|
|
|
{
|
|
|
|
|
case 1: MaJnbP(tV, nb); return 0;
|
|
|
|
|
case 2: createIUT(tV, nb); return 0;
|
|
|
|
|
case 3: deleteIUT(tV, nb); return 0;
|
|
|
|
|
case 4: MaJnameC(tV, nb); return 0;
|
|
|
|
|
case 5: Save(tV, nb); return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|