|
|
@ -1,4 +1,5 @@
|
|
|
|
#include "SAE.h"
|
|
|
|
#include "SAE.h"
|
|
|
|
|
|
|
|
//#include "SAEl.h"
|
|
|
|
|
|
|
|
|
|
|
|
bool motdepasseVerif(void)
|
|
|
|
bool motdepasseVerif(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -206,11 +207,14 @@ void global(void)
|
|
|
|
printf("charg\n");
|
|
|
|
printf("charg\n");
|
|
|
|
tab = chargementVille(nomFich,30,&tailleL);
|
|
|
|
tab = chargementVille(nomFich,30,&tailleL);
|
|
|
|
printf("\n");
|
|
|
|
printf("\n");
|
|
|
|
gestionMenu(tab, tailleL);*/
|
|
|
|
gestionMenu(tab, tailleL);
|
|
|
|
|
|
|
|
SauvegardeIUT(tab, tailleL)
|
|
|
|
|
|
|
|
*/
|
|
|
|
int tphys, nb;
|
|
|
|
int tphys, nb;
|
|
|
|
Candidat **tab;
|
|
|
|
Candidat **tab;
|
|
|
|
tab = chargmentCandid("candidature.txt", &tphys, &nb);
|
|
|
|
tab = chargmentCandid("candidature.txt", &tphys, &nb);
|
|
|
|
afficherCandid(tab[0]->idCandIUT);
|
|
|
|
system("clear");
|
|
|
|
|
|
|
|
afficherCandid(tab, nb);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -653,29 +657,6 @@ void triEchangeCandidDept(ChoixDept **tDept, int tailleL)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ChoixDept ** insererTDept(ChoixDept **tDept, int tailleP, int tailleL ,char dept[], int deciDept, int deciCandid)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ChoixDept **aux;
|
|
|
|
|
|
|
|
aux = tDept;
|
|
|
|
|
|
|
|
int trouve, pos;
|
|
|
|
|
|
|
|
printf("1");
|
|
|
|
|
|
|
|
if (tailleL == tailleP)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
aux = (ChoixDept **)realloc(tDept, (tailleP + 1) * sizeof(ChoixDept *));
|
|
|
|
|
|
|
|
if (aux == NULL)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("pb réalloc\n");
|
|
|
|
|
|
|
|
exit(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
printf("2");
|
|
|
|
|
|
|
|
strcpy(aux[tailleL]->departement, dept);
|
|
|
|
|
|
|
|
aux[tailleL]->decisionDept = deciDept;
|
|
|
|
|
|
|
|
aux[tailleL]->decisionCandid = deciCandid;
|
|
|
|
|
|
|
|
printf("%s %d %d", aux[tailleL]->departement, aux[tailleL]->decisionDept, aux[tailleL]->decisionCandid);
|
|
|
|
|
|
|
|
return aux;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void videTabDept(ChoixDept **tDept, int tailleP)
|
|
|
|
void videTabDept(ChoixDept **tDept, int tailleP)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ChoixDept *aux;
|
|
|
|
ChoixDept *aux;
|
|
|
@ -714,21 +695,35 @@ ListeCandid suppressionCandid(ListeCandid l, char *ville, ChoixDept **tDept, int
|
|
|
|
return l;
|
|
|
|
return l;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void afficherCandid(ListeCandid l)
|
|
|
|
void afficherCandid(Candidat **tab, int nbEle)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MaillonCandid *aux;
|
|
|
|
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
aux = l;
|
|
|
|
for (i=0; i < nbEle; i++)
|
|
|
|
while(aux != NULL)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("%s\t",aux->iutCandid);
|
|
|
|
printf("%d %s %s |%.1f %.1f %.1f %.1f|\n", tab[i]->id, tab[i]->nom, tab[i]->prenom, tab[i]->note[0], tab[i]->note[1], tab[i]->note[2], tab[i]->note[3]);
|
|
|
|
for (i = 0; i < aux->nbChoix;i++)
|
|
|
|
afficherCandidIUT(tab[i]->idCandIUT);
|
|
|
|
printf("%s %d %d\n", aux->tabDept[i]->departement, aux->tabDept[i]->decisionDept, aux->tabDept[i]->decisionCandid);
|
|
|
|
|
|
|
|
aux = aux->suiv;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
printf("\n");
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void afficherCandidIUT(ListeCandid l)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (l == NULL)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
printf("%s : %d\n", l->iutCandid,l->nbChoix);
|
|
|
|
|
|
|
|
afficherCandidDept(l->tabDept, l->nbChoix);
|
|
|
|
|
|
|
|
l=l->suiv;
|
|
|
|
|
|
|
|
return afficherCandidIUT(l);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void afficherCandidDept(ChoixDept **tab, int nbChoix)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i=0; i < nbChoix; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("|%s %d %d|", tab[i]->departement, tab[i]->decisionDept, tab[i]->decisionCandid);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
int longueur(ListeCandid l)
|
|
|
|
int longueur(ListeCandid l)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(l==NULL)
|
|
|
|
if(l==NULL)
|
|
|
@ -738,10 +733,9 @@ int longueur(ListeCandid l)
|
|
|
|
|
|
|
|
|
|
|
|
Candidat **chargmentCandid(char *nomFich, int *tphys, int *tailleL)
|
|
|
|
Candidat **chargmentCandid(char *nomFich, int *tphys, int *tailleL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int i = 0, nbIUT, nbDept;
|
|
|
|
int i = 0, j = 0, nbIUT, nbDept;
|
|
|
|
FILE *flot;
|
|
|
|
FILE *flot;
|
|
|
|
Candidat **tcandid;
|
|
|
|
Candidat **tcandid;
|
|
|
|
ChoixDept **tDept;
|
|
|
|
|
|
|
|
flot = fopen(nomFich, "r");
|
|
|
|
flot = fopen(nomFich, "r");
|
|
|
|
if (flot == NULL)
|
|
|
|
if (flot == NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -784,6 +778,7 @@ Candidat **chargmentCandid(char *nomFich, int *tphys, int *tailleL)
|
|
|
|
fclose(flot);
|
|
|
|
fclose(flot);
|
|
|
|
exit(1);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
printf("\n\n");
|
|
|
|
*(tcandid[*tailleL]) = lireCandidat(flot);
|
|
|
|
*(tcandid[*tailleL]) = lireCandidat(flot);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (tailleL == 0)
|
|
|
|
if (tailleL == 0)
|
|
|
@ -813,7 +808,7 @@ ListeCandid traiterCandidIUT(ListeCandid l, FILE *flot)
|
|
|
|
|
|
|
|
|
|
|
|
fscanf(flot, "%d", &nbDept);
|
|
|
|
fscanf(flot, "%d", &nbDept);
|
|
|
|
printf("%s |%d|\n", ville, nbDept);
|
|
|
|
printf("%s |%d|\n", ville, nbDept);
|
|
|
|
tDept = (ChoixDept **)malloc(sizeof(ChoixDept *)*nbDept);
|
|
|
|
tDept = (ChoixDept **)malloc(sizeof(ChoixDept *)*(nbDept + 5));
|
|
|
|
if(tDept == NULL)
|
|
|
|
if(tDept == NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("Pb malloc candidIUt\n");
|
|
|
|
printf("Pb malloc candidIUt\n");
|
|
|
@ -821,23 +816,37 @@ ListeCandid traiterCandidIUT(ListeCandid l, FILE *flot)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while (i < nbDept)
|
|
|
|
while (i < nbDept)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tDept = traiterCandidDept(tDept, i, nbDept, flot);
|
|
|
|
tDept[i] = traiterCandidDept(i, nbDept, flot);
|
|
|
|
i = i + 1;
|
|
|
|
i = i + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
l = insererCandid(l , ville , tDept, nbDept);
|
|
|
|
l = insererCandid(l , ville , tDept, nbDept);
|
|
|
|
return l;
|
|
|
|
return l;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ChoixDept **traiterCandidDept(ChoixDept **tDept,int tailleL, int tailleP, FILE *flot)
|
|
|
|
ChoixDept *traiterCandidDept(int tailleL, int tailleP, FILE *flot)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
ChoixDept *cD;
|
|
|
|
char dept[30];
|
|
|
|
char dept[30];
|
|
|
|
int deciDept, deciCandid;
|
|
|
|
int deciDept, deciCandid;
|
|
|
|
|
|
|
|
cD = (ChoixDept *)malloc(sizeof(ChoixDept));
|
|
|
|
|
|
|
|
if (cD == NULL)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("Pb malloc");
|
|
|
|
|
|
|
|
exit(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
fscanf(flot,"%s", dept);
|
|
|
|
fscanf(flot,"%s", dept);
|
|
|
|
fscanf(flot,"%d", &deciDept);
|
|
|
|
fscanf(flot,"%d", &deciDept);
|
|
|
|
fscanf(flot,"%d",&deciCandid);
|
|
|
|
fscanf(flot,"%d",&deciCandid);
|
|
|
|
printf("|%s %d %d|\n", dept, deciDept, deciCandid);
|
|
|
|
strcpy(cD->departement, dept);
|
|
|
|
printf("a");
|
|
|
|
cD->decisionDept = deciDept;
|
|
|
|
tDept = insererTDept(tDept, tailleP, tailleL , dept, deciDept, deciCandid);
|
|
|
|
cD->decisionCandid = deciCandid;
|
|
|
|
printf("1");
|
|
|
|
printf("|%s %d %d|\n", cD->departement, cD->decisionDept, cD->decisionCandid);
|
|
|
|
return tDept;
|
|
|
|
return cD;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void supprimerCandid(Candidat **tab, int *nbEle)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int idSup;
|
|
|
|
|
|
|
|
printf("Identifiant de la candidiature à supprimer : ");
|
|
|
|
|
|
|
|
scan
|
|
|
|
}
|
|
|
|
}
|