Git s'il te plait

master
Jade VAN BRABANDT 3 years ago
commit 75aecbeed7

2
.gitignore vendored

@ -36,6 +36,7 @@
*.i*86
*.x86_64
*.hex
SAE
# Debug files
*.dSYM/
@ -61,6 +62,7 @@ dkms.conf
# Icon must end with two \r
Icon
# Thumbnails
._*

BIN
SAE

Binary file not shown.

@ -60,16 +60,13 @@ int loadIUT(VilleIUT** tiut){
}
int rechercheIUT(VilleIUT* tab[],int lTab,char mot[]){
printf("CPT1\n");
/*
if(!lTab){
fprintf(stderr,"Erreur, Pas de villes enregistrées !\n");
return -1;
}
for(int i=0; i<lTab;i++){
if(tab[i]->Ville==mot) return i;
if(!strcmp(tab[i]->Ville,mot)) return i;
}
*/
return -1;
}

@ -25,6 +25,7 @@ void menuUser(VilleIUT* lvIUT[],int tlogi)
printf("4 : Rechercher les IUTs possèdant un département précis.\n");
printf("9 : Revenir à l'écran de sélection du profil.\n\n");
printf("#--------------------------------------------------------------------#\n\n");
printf("Choisissez l'action que vous voulez exécuter : ");
int act;
scanf("%d",&act);
switch(act){
@ -46,7 +47,7 @@ void menuUser(VilleIUT* lvIUT[],int tlogi)
break;
case 9:
quit=1;
break;
reset();
}
}
@ -54,14 +55,14 @@ void menuUser(VilleIUT* lvIUT[],int tlogi)
void SearchCityWithIUT(VilleIUT* lvIUT[], int tlogi)
{
for (int i=0;i<tlogi;++i) printf("%s",lvIUT[i]->Ville);
for (int i=0;i<tlogi;++i) printf("\n - %s",lvIUT[i]->Ville);
}
void DepEachIUT(VilleIUT* lvIUT[], int tlogi)
{
for (int i=0;i<tlogi;++i)
{
printf("%s :",lvIUT[i]->Ville);
printf("\n - %s :",lvIUT[i]->Ville);
MaillonDep* MaillonAct=lvIUT[i]->ldept;
while (MaillonAct!=NULL)
{
@ -215,30 +216,38 @@ void creerDep(VilleIUT* tiut[],int tlogi){
scanf("%*c%s",ville);
if(ville[0]=='Q' && ville[1]=='\0') return;
int noVille=rechercheIUT(tiut,tlogi,ville);
if(noVille<=0){
if(noVille<0){
fprintf(stderr,"\nVille non existante !\n");
return;
}
VilleIUT* v=tiut[noVille];
MaillonDep* m=v->ldept;
while(m->suivant!=NULL) m=m->suivant;
m->suivant=(MaillonDep*)malloc(sizeof(MaillonDep));
if(m->suivant==NULL){
perror("malloc");
exit(errno);
int ck=0;
if(v->ldept==NULL){
ck=1;
v->ldept=(MaillonDep*)malloc(sizeof(MaillonDep));
if(v->ldept==NULL){
perror("malloc");
exit(errno);
}
}
m=m->suivant;
printf("\n\nEntrez le nom du département à créer :");
char dep[31];
scanf("%*c%s",dep);
strcpy(m->departement,dep);
printf("\n\nEntrez le nombre de places disponibles dans le département :");
MaillonDep* m=v->ldept;
if(!ck){
while(m->suivant!=NULL) m=m->suivant;
m->suivant=(MaillonDep*)malloc(sizeof(MaillonDep));
if(m->suivant==NULL){
perror("malloc");
exit(errno);
}
m=m->suivant;
}
printf("\n\nEntrez le nom du département à créer : ");
scanf("%*c%s",m->departement);
printf("\n\nEntrez le nombre de places disponibles dans le département : ");
scanf("%d",&m->nbp);
printf("\n\nEntrez le nom du responsable de département :");
char resp[51];
scanf("%*c%s",resp);
strcpy(m->resp,resp);
printf("\n\nLe département %s a bien été ajouté à l'IUT de %s.\n",dep,ville);
printf("\n\nEntrez le nom du responsable de département : \n");
scanf("%*c");
fgets(m->resp, 51, stdin);
printf("\n\nLe département %s a bien été ajouté à l'IUT de %s.\n",m->departement,ville);
return;
}
@ -317,9 +326,7 @@ void creerIUT(VilleIUT* tiut[],int* tlogi){
char ville[31];
scanf("%*c%s",ville);
if(ville[0]=='Q' && ville[1]=='\0') return;
fprintf(stderr,"before !\n");
int noVille=rechercheIUT(tiut,*tlogi,ville);
fprintf(stderr,"end !\n");
if(noVille>0){
fprintf(stderr,"\nVille déjà existante !\n");
return;

@ -138,5 +138,5 @@ void ListeCandidat(int nbcandidat,candidat *tcandidat)
printf("Candidat non trouvé");
}
//void gestionPhaseCandidatures(); A FAIRE.*/
//void gestionPhaseCandidatures(); A FAIRE.

@ -20,12 +20,10 @@ int main(void)
case 'C':
reset();
menuUser(tiut,tlogi);
reset();
break;
case 'A':
reset();
menuAdmin(tiut,&tlogi);
reset();
break;
case 'Q':
printf("Êtes-vous sûr de vouloir quitter ? (Y pour continuer)\n\n");

Loading…
Cancel
Save