|
|
@ -106,7 +106,7 @@ int Chargement(VilleIUT **tV, int tmax, char *nameFile)
|
|
|
|
void AfficheDpmt ( MaillonDept *dpt )//Affiche un département d'une liste
|
|
|
|
void AfficheDpmt ( MaillonDept *dpt )//Affiche un département d'une liste
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( dpt == NULL) return;
|
|
|
|
if ( dpt == NULL) return;
|
|
|
|
printf("%s %d %s \n", dpt->departement, dpt->nbP, dpt->respAd);
|
|
|
|
printf("%s \t%d \t%s \n", dpt->departement, dpt->nbP, dpt->respAd);
|
|
|
|
AfficheDpmt(dpt->suiv);
|
|
|
|
AfficheDpmt(dpt->suiv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -114,7 +114,7 @@ void AfficheDpmt ( MaillonDept *dpt )//Affiche un département d'une liste
|
|
|
|
|
|
|
|
|
|
|
|
void afficheIUT (VilleIUT *iut)//Affiche un iut avec ses départements
|
|
|
|
void afficheIUT (VilleIUT *iut)//Affiche un iut avec ses départements
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf ("%s \n", iut->ville);
|
|
|
|
printf ("%s \t\n", iut->ville);
|
|
|
|
AfficheDpmt(iut->ldept);
|
|
|
|
AfficheDpmt(iut->ldept);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -124,10 +124,30 @@ void Affichetableau(VilleIUT ** TabIUT, int n )//Affiche le tableau des iuts ave
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
for ( i = 0 ; i < n ; i++ )
|
|
|
|
for ( i = 0 ; i < n ; i++ )
|
|
|
|
afficheIUT(TabIUT[i]);
|
|
|
|
if ( TabIUT[i]->nbDept > 0)
|
|
|
|
|
|
|
|
afficheIUT(TabIUT[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AffnbPdpt ( MaillonDept *dpt )//Affiche nombre de place par département d'une liste
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if ( dpt == NULL) return;
|
|
|
|
|
|
|
|
printf("%s \t%d \n", dpt->departement, dpt->nbP);
|
|
|
|
|
|
|
|
AfficheDpmt(dpt->suiv);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void affichenbPIUT (VilleIUT *iut)//Affiche nombre de place restante d'un iut avec ses départements
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf ("%s \n", iut->ville);
|
|
|
|
|
|
|
|
AffnbPdpt(iut->ldept);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AffichenbPtableau(VilleIUT ** TabIUT, int n )//Affiche le tableau de places restantes des iuts avec leurs départements
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for ( i = 0 ; i < n ; i++ )
|
|
|
|
|
|
|
|
if ( TabIUT[i]->nbDept > 0)
|
|
|
|
|
|
|
|
affichenbPIUT(TabIUT[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -373,12 +393,13 @@ int Admin(VilleIUT **tV, int nb)
|
|
|
|
int reponse;
|
|
|
|
int reponse;
|
|
|
|
|
|
|
|
|
|
|
|
printf("*****************************************************\n");
|
|
|
|
printf("*****************************************************\n");
|
|
|
|
printf("*---------------------Accueil-----------------------*\n");
|
|
|
|
printf("*------------------Adminitrateur--------------------*\n");
|
|
|
|
printf("*-----1-modifier nombre places d'un département-----*\n");
|
|
|
|
printf("*-----1-modifier nombre places d'un département-----*\n");
|
|
|
|
printf("*--------2-créer un département dans un IUT---------*\n");
|
|
|
|
printf("*--------2-créer un département dans un IUT---------*\n");
|
|
|
|
printf("*------3-supprimer 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("*-----4-modifier le nom du chef de département------*\n");
|
|
|
|
printf("*---------5-arrêter la phase de candidatures--------*\n");
|
|
|
|
printf("*---------5-arrêter la phase de candidatures--------*\n");
|
|
|
|
|
|
|
|
//printf("*--------------------6-Retour-----------------------*\n");
|
|
|
|
printf("*****************************************************\n");
|
|
|
|
printf("*****************************************************\n");
|
|
|
|
scanf("%d", &reponse);
|
|
|
|
scanf("%d", &reponse);
|
|
|
|
printf("%d", reponse);
|
|
|
|
printf("%d", reponse);
|
|
|
@ -389,5 +410,99 @@ int Admin(VilleIUT **tV, int nb)
|
|
|
|
case 3: deleteIUT(tV, nb); return 0;
|
|
|
|
case 3: deleteIUT(tV, nb); return 0;
|
|
|
|
case 4: MaJnameC(tV, nb); return 0;
|
|
|
|
case 4: MaJnameC(tV, nb); return 0;
|
|
|
|
case 5: Save(tV, nb); return 1;
|
|
|
|
case 5: Save(tV, nb); return 1;
|
|
|
|
|
|
|
|
//case 6: exit(1);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int utilisateur (VilleIUT **tV, int nb){//Onglet accueille des utilisateurs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int reponse, i;
|
|
|
|
|
|
|
|
char rdpt[20];
|
|
|
|
|
|
|
|
MaillonDept * ldepart;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printf("*****************************************************\n");
|
|
|
|
|
|
|
|
printf("*-------------------Utilisateur---------------------*\n");
|
|
|
|
|
|
|
|
printf("*------1-Affichage de toutes les informations-------*\n");
|
|
|
|
|
|
|
|
printf("*-----2-Places restantes pour la première année-----*\n");
|
|
|
|
|
|
|
|
printf("*----------3-Recherche d'un departement-------------*\n");
|
|
|
|
|
|
|
|
printf("*--------------------4-Retour-----------------------*\n");
|
|
|
|
|
|
|
|
printf("*****************************************************\n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scanf("%d", &reponse);
|
|
|
|
|
|
|
|
printf("%d", reponse);
|
|
|
|
|
|
|
|
while ( reponse == 1 || reponse == 2 || reponse == 3 || reponse == 4){
|
|
|
|
|
|
|
|
if ( reponse == 1 ){
|
|
|
|
|
|
|
|
Affichetableau(tV, nb);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( reponse == 2){
|
|
|
|
|
|
|
|
AffichenbPtableau(tV, nb);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( reponse == 3){
|
|
|
|
|
|
|
|
printf("Quel departement souhaitez vous integrer?\n");
|
|
|
|
|
|
|
|
scanf("%s", rdpt);
|
|
|
|
|
|
|
|
for ( i = 0 ; i < nb ; i++){
|
|
|
|
|
|
|
|
ldepart = recherche (tV[i]->ldept, rdpt);
|
|
|
|
|
|
|
|
AfficheDpmt(ldepart);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( reponse == 4 )
|
|
|
|
|
|
|
|
return 2;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0 ;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void test (void){ // fonction globale
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int acc, nb, nbville, repAdm, repVis;
|
|
|
|
|
|
|
|
VilleIUT *tV[200];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nbville = Chargement(tV, 200, "part1.don");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printf("*****************************************************\n");
|
|
|
|
|
|
|
|
printf("*---------------------Accueil-----------------------*\n");
|
|
|
|
|
|
|
|
printf("*-----------------1-Adminitrateur-------------------*\n");
|
|
|
|
|
|
|
|
printf("*-------------------2-Visiteur----------------------*\n");
|
|
|
|
|
|
|
|
printf("*-------------------3-Quitter-----------------------*\n");
|
|
|
|
|
|
|
|
printf("*****************************************************\n");
|
|
|
|
|
|
|
|
scanf("%d", &acc);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while ( acc == 1 || acc == 2){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (acc == 1){
|
|
|
|
|
|
|
|
repAdm = Admin (tV, nbville);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (acc == 2){
|
|
|
|
|
|
|
|
repVis = utilisateur (tV, nbville);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (repVis == 2){
|
|
|
|
|
|
|
|
acc = 3;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( acc == 3 ){
|
|
|
|
|
|
|
|
Save( tV, nb );
|
|
|
|
|
|
|
|
exit;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* SOUCIS AVEC LA FONCTION TEST, JE N'ARRIVE PAS A SORTIR DU WHILE POUR RETOURNER AU MENU PRINCIPAL
|
|
|
|
|
|
|
|
ADMIN/ VISITEUR. FONCTION RECURCIVE?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FONCTION RECHERCHE DANS TEST NE RETURN RIEN
|
|
|
|
|
|
|
|
FONCTION AFFICHAGE nbP AFFICHE QUAND MEME LE NOM DES RESPONSABLE... MAIS PAS TOUS
|
|
|
|
|
|
|
|
JE PEUX Y REVENIR DEMAIN SUR MA PARTIE, PAR CONTRE SUR TA PARTIE JE CROIS QU'IL Y A DES ERREURS
|
|
|
|
|
|
|
|
DE SEGMENTATION HESITE PAS A FAIRE RE RUN LE TRUC
|
|
|
|
|
|
|
|
*/
|