|
|
|
@ -28,24 +28,34 @@ VilleIUT lire(FILE * fe) {
|
|
|
|
|
return v;
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
// Partie 2
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|- décision ( admis - 1 /attente 0 default /refusé -2 )
|
|
|
|
|
|- validation candidat ( 0 default / -1 refus de ce choix / 2 accepte )
|
|
|
|
|
|
|
|
|
|
combien de fonctionnalité en combien de fonction ...
|
|
|
|
|
|
|
|
|
|
V charger fichier
|
|
|
|
|
V ajouter choix
|
|
|
|
|
V modifier choix
|
|
|
|
|
V supp choix
|
|
|
|
|
V enregistrer fichier
|
|
|
|
|
- section affichage
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
//chargement ============================================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Partie 2
|
|
|
|
|
|
|
|
|
|
//chargement ======================================================================================================================================================================
|
|
|
|
|
|
|
|
|
|
Listchoixdept listvide(void){return NULL;}
|
|
|
|
|
|
|
|
|
@ -87,7 +97,7 @@ int chargeretudiant(char nomFich[], listetuinfo *tetu[], int tmax){
|
|
|
|
|
return nbetu;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//enregistrement ========================================================================================
|
|
|
|
|
//enregistrement ========================================================================================================================================================
|
|
|
|
|
|
|
|
|
|
void enregistrementcarte(FILE *fe, Maillonchoix* carte, int nb){
|
|
|
|
|
if(carte==NULL){return;}
|
|
|
|
@ -104,7 +114,7 @@ void enregistrementinfo(FILE *fe, listetuinfo etu){
|
|
|
|
|
enregistrementcarte(fe, b, etu.nbchoix);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int enregistrementetudiant(char nomFich[], listetuinfo *tetu[], int nb){
|
|
|
|
|
int enregistrementetudiants(char nomFich[], listetuinfo *tetu[], int nb){
|
|
|
|
|
int i=0;
|
|
|
|
|
FILE *fe;
|
|
|
|
|
listetuinfo etu;
|
|
|
|
@ -119,11 +129,8 @@ int enregistrementetudiant(char nomFich[], listetuinfo *tetu[], int nb){
|
|
|
|
|
fclose(fe);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//affichage =============================================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//général fonction for ajouter modifier et supprimer ===========
|
|
|
|
|
//général fonction for ajouter modifier et supprimer ========================================================================================
|
|
|
|
|
|
|
|
|
|
void affichagedep(MaillonDept* carte){
|
|
|
|
|
if(carte==NULL){return;}
|
|
|
|
@ -186,7 +193,7 @@ int correspondcarte(char choixville[], char choixdep[], Maillonchoix* carte){
|
|
|
|
|
correspondcarte(choixville, choixdep, carte->suivant);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//ajouter ===============================================================================================
|
|
|
|
|
//ajouter =============================================================================================================================================
|
|
|
|
|
|
|
|
|
|
void choix(Maillon *tville[], int nbville, char choixville[], char choixdep[]){
|
|
|
|
|
int i, ok;
|
|
|
|
@ -232,7 +239,7 @@ int allajoutprocess(Maillon *tville[], listetuinfo etu, int nbville){
|
|
|
|
|
else{printf("\t< choix deja existant >\n");}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//modifier ==============================================================================================
|
|
|
|
|
//modifier ==============================================================================================================================================================
|
|
|
|
|
|
|
|
|
|
void choix2(Listchoixdept lcarte, char choixville[], char choixdep[]){
|
|
|
|
|
int ok;
|
|
|
|
@ -307,14 +314,14 @@ void modificationcarte(listetuinfo etu, Maillon *tville[], int nbville){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//supprimer =============================================================================================
|
|
|
|
|
//supprimer ==========================================================================================================================================
|
|
|
|
|
|
|
|
|
|
Maillonchoix suppressioncartechoix(char choixville[], char choixdep[], Maillonchoix* carte){
|
|
|
|
|
Maillonchoix* premier, tmp;
|
|
|
|
|
if(carte==NULL){exit(1);}
|
|
|
|
|
if(strcmp(carte->Ville,choixville)==0){
|
|
|
|
|
if(strcmp(choixdep,carte->dep)==0){
|
|
|
|
|
tmp=carte->suivant;
|
|
|
|
|
if(strcmp(carte.Ville,choixville)==0){
|
|
|
|
|
if(strcmp(choixdep,carte.dep)==0){
|
|
|
|
|
tmp=carte.suivant;
|
|
|
|
|
free(carte);
|
|
|
|
|
return tmp;
|
|
|
|
|
}
|
|
|
|
@ -332,19 +339,31 @@ void suppcarte(listetuinfo etu){
|
|
|
|
|
lcarte = suppressioncartechoix(choixville, choixdep, lcarte);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=======================================================================================================
|
|
|
|
|
|
|
|
|
|
//affichage =======================================================================================================================================================
|
|
|
|
|
|
|
|
|
|
void affichagecarteall(Maillonchoix* carte){
|
|
|
|
|
if(carte==NULL){return;}
|
|
|
|
|
printf("%s - %s\n décision : %d\nvalidation : %d\n", carte->Ville, carte->dep, carte->decision, carte->validation);
|
|
|
|
|
afficherchoix(carte->suivant);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// zone de test =========================================================================================
|
|
|
|
|
void affichageetu(listetuinfo etu){
|
|
|
|
|
Listchoixdept lcarte;
|
|
|
|
|
lcarte=etu.carte;
|
|
|
|
|
printf(" %d\n %s %s\n", a.numeroetu, a.nometu, a.prenometu);
|
|
|
|
|
printf(" mathématique : %d\n", a.notes[0]);
|
|
|
|
|
printf(" français : %d\n", a.notes[1]);
|
|
|
|
|
printf(" anglais : %d\n", a.notes[2]);
|
|
|
|
|
printf(" matière spé : %d\n", a.notes[3]);
|
|
|
|
|
affichagecarteall(lcarte);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//affiche uniquement les cartes (choix d'iut)
|
|
|
|
|
void affichage(Listchoixdept c){
|
|
|
|
|
if(c==NULL){printf("\n");return;}
|
|
|
|
|
printf("%s %s %d %d", c->Ville, c->dep, c->decision, c->validation);
|
|
|
|
|
if(c->suivant==NULL){affichage(c->suivant);}
|
|
|
|
|
else{
|
|
|
|
|
printf("\n -");
|
|
|
|
|
printf("\n - ");
|
|
|
|
|
affichage(c->suivant);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -352,9 +371,9 @@ void affichage(Listchoixdept c){
|
|
|
|
|
//affiche que la personne
|
|
|
|
|
void affichageetu(listetuinfo a){
|
|
|
|
|
printf(" %d\n %s %s\n", a.numeroetu, a.nometu, a.prenometu);
|
|
|
|
|
printf(" mathématique : %d\n", a.notes[0]);
|
|
|
|
|
printf(" français : %d\n", a.notes[1]);
|
|
|
|
|
printf(" anglais : %d\n", a.notes[2]);
|
|
|
|
|
printf(" mathématique : %d -", a.notes[0]);
|
|
|
|
|
printf(" français : %d -", a.notes[1]);
|
|
|
|
|
printf(" anglais : %d -", a.notes[2]);
|
|
|
|
|
printf(" matière spé : %d\n", a.notes[3]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -365,13 +384,17 @@ void affichealletu(listetuinfo *tetu[], int nb){
|
|
|
|
|
b = listvide();
|
|
|
|
|
for(j=0; j<nb; j++){
|
|
|
|
|
affichageetu(*tetu[j]);
|
|
|
|
|
printf("tout les choix : \n -");
|
|
|
|
|
printf("tout les choix :\n - ");
|
|
|
|
|
b = tetu[j]->carte;
|
|
|
|
|
affichage(b);
|
|
|
|
|
printf("\n\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=========================================================================================================================================================
|
|
|
|
|
|
|
|
|
|
// zone de test =========================================================================================
|
|
|
|
|
|
|
|
|
|
void test1(void){
|
|
|
|
|
listetuinfo *tetu[5000];
|
|
|
|
|
int nb;
|
|
|
|
@ -385,7 +408,6 @@ void test1(void){
|
|
|
|
|
|
|
|
|
|
// Partie 3
|
|
|
|
|
|
|
|
|
|
// Partie 4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -411,6 +433,138 @@ void test1(void){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Partie 4
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
V affichage coté candidat de ces infos admis ou pas
|
|
|
|
|
- valdier ça candidature refuse les autres
|
|
|
|
|
- valider met a jour le dossier candidature
|
|
|
|
|
- chaque departement peut consulter ça liste d'attente
|
|
|
|
|
- metre a jour la liste
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// coté etu=========================================================================================================
|
|
|
|
|
// affichage
|
|
|
|
|
|
|
|
|
|
void affichagedepresultat(Maillonchoix* carte){
|
|
|
|
|
if(carte==NULL){return;}
|
|
|
|
|
if(carte->decision==1){
|
|
|
|
|
printf("%s %s - admis \n", carte.Ville, carte.dep);
|
|
|
|
|
}
|
|
|
|
|
if(carte->decision==1){
|
|
|
|
|
printf("%s %s - refusé \n", carte.Ville, carte.dep);
|
|
|
|
|
}
|
|
|
|
|
if(carte->decision==1){
|
|
|
|
|
printf("%s %s - lsite d'attente \n", carte.Ville, carte.dep);
|
|
|
|
|
}
|
|
|
|
|
affichagedepresultat(carte.suivant);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// validation
|
|
|
|
|
|
|
|
|
|
void validation(char choixville[], char choixdep[], Maillonchoix* carte, int *ok, Maillonatt lplace, int nbplace, listetuinfo etu){
|
|
|
|
|
if(carte==NULL){return;}
|
|
|
|
|
if(strcmp(carte.Ville,choixville)==0){
|
|
|
|
|
if(strcmp(carte.dep,choixdep)==0){
|
|
|
|
|
if(carte.decision==1){
|
|
|
|
|
carte.validation=1;
|
|
|
|
|
*ok=1;
|
|
|
|
|
}else{printf("vous netes pas admis dans cette iut\n");*ok=-1;return;}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
validation(choixville, choixdep, carte.suivant, ok);
|
|
|
|
|
if(ok==1){
|
|
|
|
|
if(carte.decision==1){
|
|
|
|
|
carte.validation=-1;
|
|
|
|
|
miseajourindep( lplace, nbplace, etu);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void enregistrementvalidation(char choixville[], char choixdep[], Maillonchoix* carte, int *ok, char nomFich[], listetuinfo *tetu[], int nb){
|
|
|
|
|
int ok;
|
|
|
|
|
validation( choixville, choixdep, carte, &ok);
|
|
|
|
|
enregistrementetudiants( nomFich, tetu, nb);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// -> mise a jour
|
|
|
|
|
|
|
|
|
|
Maillonatt miseajourfile(Maillonatt place, int nbplace, listetuinfo etu){
|
|
|
|
|
if(place==NULL){exit(1);}
|
|
|
|
|
if(place.munc==etu.numeroetu){
|
|
|
|
|
Maillonatt temp;
|
|
|
|
|
temp=place.suivant;
|
|
|
|
|
free(place);
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
miseajourfile(place.suivant, nbplace-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int miseajouratt(Maillonatt place, int nbplace){
|
|
|
|
|
if(place==NULL){return;}
|
|
|
|
|
if(nbplace==0){return;}
|
|
|
|
|
if(place.decision==2){
|
|
|
|
|
place.decision==1;
|
|
|
|
|
}
|
|
|
|
|
miseajouratt(place.suivant, nbplace-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void miseajourindep(Maillonatt lplace, int nbplace, listetuinfo etu){
|
|
|
|
|
lpace = miseajourfile(lplace, nbplace, etu);
|
|
|
|
|
miseajouratt(lplace, nbplace);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// coté dep=============================================================================================================
|
|
|
|
|
// affichage dep
|
|
|
|
|
|
|
|
|
|
void affichageonlyadmis(Maillonatt etuatt){
|
|
|
|
|
if(etuatt==NULL){return;}
|
|
|
|
|
if(etuatt.decision==1){
|
|
|
|
|
printf("%d %s %s\n" etuatt.numc, etuatt.nom, etuatt.prenom);
|
|
|
|
|
}
|
|
|
|
|
affichageonlyadmis(etuatt.suivant);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void affichageonlyatt(Maillonatt etuatt){
|
|
|
|
|
if(etuatt==NULL){return;}
|
|
|
|
|
if(etuatt.decision==1){
|
|
|
|
|
printf("%d %s %s\n" etuatt.numc, etuatt.nom, etuatt.prenom);
|
|
|
|
|
}
|
|
|
|
|
affichageonlyatt(etuatt.suivant);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//chercher present en admission ========================================================================================
|
|
|
|
|
|
|
|
|
|
void chercheretuadmisindep(char choixnom[], char nomprenom[], Maillonatt etuatt){
|
|
|
|
|
if(etuatt==NULL){printf("erreur de recherche\n");return;}
|
|
|
|
|
if(strcmp(etuatt.nom,choixnom)==0){
|
|
|
|
|
if(strcmp(etuatt.prenom,choixprenom)==0){
|
|
|
|
|
if(etuatt.decision==1){printf("%s %s est admis\n", etuatt.nom, etuatt.prenom);return;}
|
|
|
|
|
if(etuatt.decision==2){printf("%s %s est en attente\n", etuatt.nom, etuatt.prenom);return;}
|
|
|
|
|
if(etuatt.decision==-1){printf("%s %s est refusé\n", etuatt.nom, etuatt.prenom);return;}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
chercheretuadmisindep(choixnom, choixprenom, etuatt.suivant);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Général (menu et ce qui en ai relié)
|
|
|
|
|
/*
|
|
|
|
|