|
|
|
@ -23,7 +23,7 @@ void Globale(void)
|
|
|
|
|
|
|
|
|
|
//Chargement des fichiers
|
|
|
|
|
tLog = chargementLog("../donnees/log.don", &nbLog);
|
|
|
|
|
nbVilles = chargIutDon(tIut, 50, "../donnees/iut.don");
|
|
|
|
|
//nbVilles = chargIutDon(tIut, 50, "../donnees/iut.don");
|
|
|
|
|
|
|
|
|
|
//Appel du menu visiteur
|
|
|
|
|
menuVisiteur(tLog, nbLog, tIut, nbVilles);
|
|
|
|
@ -85,13 +85,13 @@ Log * chargementLog(char * nomFichier, int * nbLog)
|
|
|
|
|
return tLog;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*void test(VilleIut * tIut[], int nbVilles)
|
|
|
|
|
void test(VilleIut * tIut[], int nbVilles)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0 ; i <nbVilles ; i++)
|
|
|
|
|
{
|
|
|
|
|
printf("%s\n", tIut[i]->nom);
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Cette fonction affiche le menu des options disponibles pour un visiteur
|
|
|
|
@ -138,6 +138,85 @@ void menuVisiteur(Log * tLog, int nbLog, VilleIut *tIut[], int nbVilles)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Cette fonction affiche le menu des options disponibles pour un candidat
|
|
|
|
|
* et demande à l'utilisateur de faire son choix en appelant la fonction
|
|
|
|
|
* choixMenuCandidat. Selon le choix de l'utilisateur, la fonction appelle la fonction correspondante
|
|
|
|
|
* ou met fin à l'exécution de la fonction.
|
|
|
|
|
*/
|
|
|
|
|
void menuCandidat(Log * tLog, int nbLog, VilleIut *tIut[], int nbVilles)
|
|
|
|
|
{
|
|
|
|
|
int choix;
|
|
|
|
|
int actif = 1;
|
|
|
|
|
|
|
|
|
|
clean
|
|
|
|
|
|
|
|
|
|
while(actif)
|
|
|
|
|
{
|
|
|
|
|
choix = choixMenuCandidat();
|
|
|
|
|
clean
|
|
|
|
|
switch(choix)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
//afficher une candidature
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
//Creer une candidature
|
|
|
|
|
break;
|
|
|
|
|
case 3 :
|
|
|
|
|
//Modifier une candidature
|
|
|
|
|
break;
|
|
|
|
|
case 4 :
|
|
|
|
|
//Supprimer une candidature
|
|
|
|
|
break;
|
|
|
|
|
case 0 :
|
|
|
|
|
actif = 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
|
|
@brief affiche le menu des candidats et renvoie le choix de l'utilisateur
|
|
|
|
|
|
|
|
|
|
@return int : le choix de l'utilisateur
|
|
|
|
|
*/
|
|
|
|
|
int choixMenuCandidat(void)
|
|
|
|
|
{
|
|
|
|
|
int choix;
|
|
|
|
|
|
|
|
|
|
choix = afficherMenuCandidat();
|
|
|
|
|
while (choix < 0 || choix > 4)
|
|
|
|
|
{
|
|
|
|
|
clean
|
|
|
|
|
printf("\nChoix incorrect.\n\n");
|
|
|
|
|
choix = afficherMenuCandidat();
|
|
|
|
|
}
|
|
|
|
|
return choix;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
|
|
@brief affiche le menu pour les visiteurs et renvoie le choix de l'utilisateur
|
|
|
|
|
|
|
|
|
|
@return int : le choix de l'utilisateur
|
|
|
|
|
*/
|
|
|
|
|
int afficherMenuCandidat(void)
|
|
|
|
|
{
|
|
|
|
|
int choix;
|
|
|
|
|
|
|
|
|
|
printf("============================================================\n\t\t\tMENU CANDIDAT\n============================================================\n\n");
|
|
|
|
|
printf("\t1. Creer une candidature\n");
|
|
|
|
|
printf("\t2. Modifier une candidature\n");
|
|
|
|
|
printf("\t3. Supprimer une candidature\n");
|
|
|
|
|
printf("\t4. Gestion des candidatures\n");
|
|
|
|
|
printf("\t0. Quitter\n");
|
|
|
|
|
printf("\nChoix : ");
|
|
|
|
|
scanf("%d%*c", &choix);
|
|
|
|
|
return choix;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Affiche le menu des options disponibles pour un visiteur.
|
|
|
|
|
*
|
|
|
|
@ -157,7 +236,8 @@ void menuVisiteur(Log * tLog, int nbLog, VilleIut *tIut[], int nbVilles)
|
|
|
|
|
*
|
|
|
|
|
* @return Le choix de l'utilisateur, sous forme d'un entier
|
|
|
|
|
*/
|
|
|
|
|
int afficherMenuVisiteur(void) {
|
|
|
|
|
int afficherMenuVisiteur(void)
|
|
|
|
|
{
|
|
|
|
|
int choix;
|
|
|
|
|
|
|
|
|
|
printf("============================================================\n\t\t\tMENU VISITEUR\n============================================================\n\n");
|
|
|
|
@ -426,7 +506,11 @@ int modifieChefDept(VilleIut *tVilleIut[], int nbVilles, char ville[], char nomD
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*void afficherDeptIutDonne(VilleIut **villeIut, int nbVille)
|
|
|
|
|
{
|
|
|
|
|
afficheVillesIUT();
|
|
|
|
|
printf()
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Affiche les IUT possédant un département spécifique.
|
|
|
|
@ -485,7 +569,6 @@ void afficheVillesIUT(VilleIut **villeIut, int nbVilles)
|
|
|
|
|
printf(" \n\n\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Affiche les IUT et le nombre de places associé pour un département donné
|
|
|
|
|
*
|
|
|
|
@ -511,21 +594,8 @@ void afficheNbPlacesDep(VilleIut *tVilleIut[], int nbVilles, char nomDept[])
|
|
|
|
|
dept = dept->suiv;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int existeVille( VilleIut * tIut[], char ville[], int nbvilles )
|
|
|
|
|
{
|
|
|
|
|
int i = 0;
|
|
|
|
|
// Recherche de la ville
|
|
|
|
|
|
|
|
|
|
for ( i = 0; i < nbvilles, i ++ )
|
|
|
|
|
{
|
|
|
|
|
if ( strcmp( tIut[i] -> nom, ville ) == 0 ) return i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Affiche et gère le menu administrateur.
|
|
|
|
@ -592,6 +662,10 @@ void menuAdmin(VilleIut **villeIut, int nbVilles)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
================================================
|
|
|
|
|
Partie 2
|
|
|
|
@ -634,10 +708,11 @@ void afficherCandidats(Candidat *candidats, int nbCandidats)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ===============================================================================
|
|
|
|
|
// PARTIE 3
|
|
|
|
|
//===============================================================================
|
|
|
|
|
/*
|
|
|
|
|
================================================
|
|
|
|
|
Partie 3
|
|
|
|
|
================================================
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Permet de convertir la liste de departement des VilleIut de la partie 1
|
|
|
|
@ -694,11 +769,11 @@ ListeDeptV2 configurationDeptV2( ListeDept ldept )
|
|
|
|
|
return lDeptV2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ==============================================================================
|
|
|
|
|
// Partie 4
|
|
|
|
|
// ==============================================================================
|
|
|
|
|
/*
|
|
|
|
|
================================================
|
|
|
|
|
Partie 4
|
|
|
|
|
================================================
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Affiche une liste de candidats après l'avoir triée par ordre alphabétique
|
|
|
|
@ -796,6 +871,4 @@ ListeCandidats insertionTeteCand( ListeCandidats nvL, ListeCandidats l )
|
|
|
|
|
free( l );
|
|
|
|
|
|
|
|
|
|
return nvL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|