Mise en commun

master
Kyllian CHABANON 2 years ago
parent bff22d3979
commit 20c4097524

@ -1,130 +0,0 @@
#include "partie1.h"
void choixMenu(void)
{
int choix;
bool c = false;
while (c == false)
{
system("clear");
printf("Veuillez choisir votre menu :\n");
printf("\t1 - Menu utilisateur\n");
printf("\t2 - Menu administrateur\n");
printf("\t9 - Quitter\n");
printf("\nEntrez votre choix :\n> ");
scanf("%d", &choix);
switch (choix)
{
case 1:
c = true;
menuUtilisateur();
break;
case 2:
c = true;
menuAdministrateur();
break;
case 9:
c = true;
break;
default:
printf("Option non reconnue. Veuillez recommencer.\n");
break;
}
}
}
void menuUtilisateur(void)
{
int choix;
bool c = false;
while (c == false)
{
system("clear");
printf("Menu d'utilisateur : Que voulez-vous faire ?\n");
printf("\t1 - Voir les villes possédant un IUT\n");
printf("\t2 - Voir les départements dans chaque IUT\n");
printf("\t3 - Voir le nombre de places en première année\n");
printf("\t4 - Voir les IUT possédant un département particulier\n");
printf("\t9 - Quitter\n");
printf("\nEntrez votre choix :\n> ");
scanf("%d", &choix);
switch (choix)
{
case 1:
c = true;
// affichageVillesIUT(VilleIUT *tiut[], int nb);
break;
case 2:
c = true;
// affichageDeptIUT(VilleIUT *tiut[], int nb);
break;
case 3:
c = true;
//
break;
case 4:
c = true;
//
break;
case 9:
c = true;
return choixMenu();
default:
printf("Option non reconnue. Veuillez recommencer.\n");
break;
}
}
}
void menuAdministrateur(void)
{
int choix;
bool c = false;
while (c == false)
{
system("clear");
printf("Menu d'administrateur : Que voulez-vous faire ?\n");
printf("\t1 - Modifier le nombre de places dans un département\n");
printf("\t2 - Créer un département dans un IUT\n");
printf("\t3 - Supprimer un département d'un IUT\n");
printf("\t4 - Modifier le responsable d'un département\n");
printf("\t5 - Lancer la phase de candidature\n");
printf("\t6 - Stopper la phase de candidature\n");
printf("\t9 - Quitter\n");
printf("\nEntrez votre choix :\n> ");
scanf("%d", &choix);
switch (choix)
{
case 1:
c = true;
// modificationNbPDept(tiut, nb);
break;
case 2:
c = true;
// creationDept(tiut[], nb);
break;
case 3:
c = true;
// suppressionDept(tiut[], nb);
break;
case 4:
c = true;
// modificationRespDept(tiut, nb);
break;
case 5:
c = true;
//
break;
case 6:
c = true;
//
break;
case 9:
return choixMenu();
break;
default:
printf("Option non reconnue. Veuillez recommencer.\n");
break;
}
}
}

@ -1,5 +0,0 @@
#include <stdio.h>
void choixMenu(void);
void menuUtilisateur(void);
void menuAdministrateur(void);

@ -1,20 +0,0 @@
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include "structures.h"
#include "menus.h"
/* Fichier */
int chargementVillesIUT(VilleIUT *tiut[]);
int rechercheVille(VilleIUT *tiut[], int nb, char val[], bool *trouve);
void sauvegarde(VilleIUT *tiut[], int nb);
/* Utilisateur */
void affichageVillesIUT(VilleIUT *tiut[], int nb);
void affichageDeptIUT(VilleIUT *tiut[], int nb);
/* Administrateur */
void modificationNbPDept(VilleIUT *tiut[], int nb);
void creationDept(VilleIUT *tiut[], int nb);
int suppressionDept(VilleIUT *tiut[], int nb);
void modificationRespDept(VilleIUT *tiut[], int nb);

@ -1,34 +0,0 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct maillonDept
{
char departement[30];
int nbP;
char resp[30];
struct maillonDept *suiv;
} MaillonDept, *ListeDept;
typedef struct
{
char ville[30];
ListeDept ldept;
} VilleIUT;
ListeDept listenouv(void);
ListeDept insererEnTete(ListeDept l, char departement[], int nbP, char resp[]);
ListeDept inserer(ListeDept l, char departement[], int nbP, char resp[]);
void afficher(ListeDept l);
bool vide(ListeDept l);
void afficherDept(ListeDept l);
int rechercheDept(ListeDept l, char departement[], bool *trouve);
ListeDept supprimerEnTete(ListeDept l);
ListeDept supprimer(ListeDept l, char departement[]);
int getNbP(ListeDept l, int pos);
void setNbP(ListeDept l, int pos, int valeur);
char* getResp(ListeDept l, int pos);
void setResp(ListeDept l, int pos, char valeur[]);
char* getDept(ListeDept l, int pos);
void setResp(ListeDept l, int pos, char valeur[]);

95
SAE.h

@ -2,45 +2,48 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdbool.h> #include <stdbool.h>
#include "structures.h"
/* Menus */ /* Menus */
void choixMenu(void); void choixMenu(void);
void menuUtilisateur(void); void menuUtilisateur(void);
void menuAdministrateur(void); void menuAdministrateur(void);
/* Partie 3 */ /* Partie 1 */
ListeDept listenouv(void);
ListeDept insererEnTete(ListeDept l, char departement[], int nbP, char resp[]);
ListeDept inserer(ListeDept l, char departement[], int nbP, char resp[]);
void afficher(ListeDept l);
bool vide(ListeDept l);
void afficherDept(ListeDept l);
int rechercheDept(ListeDept l, char departement[], bool *trouve);
ListeDept supprimerEnTete(ListeDept l);
ListeDept supprimer(ListeDept l, char departement[]);
/* V2 */ int getNbP(ListeDept l, int pos);
void setNbP(ListeDept l, int pos, int valeur);
char* getResp(ListeDept l, int pos);
void setResp(ListeDept l, int pos, char valeur[]);
char* getDept(ListeDept l, int pos);
void setResp(ListeDept l, int pos, char valeur[]);
typedef struct /* Fichier */
{ int chargementVillesIUT(VilleIUT *tiut[]);
char departement[30]; int rechercheVille(VilleIUT *tiut[], int nb, char val[], bool *trouve);
int decisionAdmission; void sauvegarde(VilleIUT *tiut[], int nb);
int decisionCandidat;
} Departement;
typedef struct maillonDepartement /* Utilisateur */
{ void affichageVillesIUT(VilleIUT *tiut[], int nb);
Departement v; void affichageDeptIUT(VilleIUT *tiut[], int nb);
struct maillonDepartement *suiv;
} MaillonDepartement, *ListeDepartement;
typedef struct /* Administrateur */
{ void modificationNbPDept(VilleIUT *tiut[], int nb);
int num; void creationDept(VilleIUT *tiut[], int nb);
char nom[22]; // 20 caractere + 1 espace + 1 caractere de fin de chaine int suppressionDept(VilleIUT *tiut[], int nb);
char prenom[22]; // 20 caractere + 1 espace + 1 caractere de fin de chaine void modificationRespDept(VilleIUT *tiut[], int nb);
int tabMatiere[4];
int nbChoix;
char ville[30];
ListeDepartement ldept;
} Admission;
typedef struct maillonAdmission
{ // Partie 3
Admission v;
struct maillonAdmission *suiv;
} MaillonAdmission, *ListeAdmission;
Departement lireDpt(FILE *flot); Departement lireDpt(FILE *flot);
void afficherDpt(Departement dpt); void afficherDpt(Departement dpt);
@ -56,42 +59,6 @@ ListeAdmission MoyenneCandidats(ListeAdmission listeCandidats);
int modifNoteMinAdmis(); int modifNoteMinAdmis();
int modifNbAdmisMax(); int modifNbAdmisMax();
/* V1
typedef struct {
int num;
char nom[22]; // 20 caractere + 1 espace + 1 caractere de fin de chaine
char prenom[22]; // 20 caractere + 1 espace + 1 caractere de fin de chaine
int noteMaths;
int noteFrançais;
int noteAnglais;
int noteSpe;
int nbChoix;
char ville[30];
char departement1[20];
int decisionAdmission1;
int decisionCandidat1;
char departement2[20];
int decisionAdmission2;
int decisionCandidat2;
char departement3[20];
int decisionAdmission3;
int decisionCandidat3;
char departement4[20];
int decisionAdmission4;
int decisionCandidat4;
char departement5[20];
int decisionAdmission5;
int decisionCandidat5;
} Admission;
// Utilisation d'une file car on a pas besoins de modifier les candidats, les mettre au milieu de la file,
// on a juste besoin de les ajouter et de les supprimer, on cherche à les parcourir dans l'ordre d'arrivée
// Pour mettre d'un coté les candidats traités et de l'autre les candidats non traités
typedef struct maillonAdmission {
Admission v;
struct maillonAdmission *suiv;
} MaillonAdmission, *FileAdmission;
*/
// Authentification // Authentification
int ConnexionUtilisateur(char *login, char *mdp); int ConnexionUtilisateur(char *login, char *mdp);

@ -1,4 +1,4 @@
#include "partie1.h" #include "SAE.h"
void modificationNbPDept(VilleIUT *tiut[], int nb) void modificationNbPDept(VilleIUT *tiut[], int nb)
{ {

@ -1,15 +1,4 @@
#include "../SAE.h" #include "SAE.h"
int MenuRespAdminDept(void)
{
int choix;
printf("\nMenu des Responsables d'Admission des Candidatures\n");
printf("1. Modifier la note minimum des refus\n");
printf("2. Modifier le nombre d'admis max");
printf("3. Trier la liste d'attente");
scanf("%d", &choix);
return choix;
}
void choixMenu(void) void choixMenu(void)
{ {
@ -22,7 +11,7 @@ void choixMenu(void)
printf("\t1 - Menu utilisateur\n"); printf("\t1 - Menu utilisateur\n");
printf("\t2 - Menu administrateur\n"); printf("\t2 - Menu administrateur\n");
printf("\t9 - Quitter\n"); printf("\t9 - Quitter\n");
printf("\nChoix : "); printf("\nEntrez votre choix :\n> ");
scanf("%d", &choix); scanf("%d", &choix);
switch (choix) switch (choix)
{ {
@ -57,17 +46,17 @@ void menuUtilisateur(void)
printf("\t3 - Voir le nombre de places en première année\n"); printf("\t3 - Voir le nombre de places en première année\n");
printf("\t4 - Voir les IUT possédant un département particulier\n"); printf("\t4 - Voir les IUT possédant un département particulier\n");
printf("\t9 - Quitter\n"); printf("\t9 - Quitter\n");
printf("\nChoix : "); printf("\nEntrez votre choix :\n> ");
scanf("%d", &choix); scanf("%d", &choix);
switch (choix) switch (choix)
{ {
case 1: case 1:
c = true; c = true;
// // affichageVillesIUT(VilleIUT *tiut[], int nb);
break; break;
case 2: case 2:
c = true; c = true;
// // affichageDeptIUT(VilleIUT *tiut[], int nb);
break; break;
case 3: case 3:
c = true; c = true;
@ -98,29 +87,29 @@ void menuAdministrateur(void)
printf("\t1 - Modifier le nombre de places dans un département\n"); printf("\t1 - Modifier le nombre de places dans un département\n");
printf("\t2 - Créer un département dans un IUT\n"); printf("\t2 - Créer un département dans un IUT\n");
printf("\t3 - Supprimer un département d'un IUT\n"); printf("\t3 - Supprimer un département d'un IUT\n");
printf("\t4 - Lancer la phase de candidature\n"); printf("\t4 - Modifier le responsable d'un département\n");
printf("\t5 - Stopper la phase de candidature\n"); printf("\t5 - Lancer la phase de candidature\n");
printf("\t6 - Modifier le responsable d'un département\n"); printf("\t6 - Stopper la phase de candidature\n");
printf("\t9 - Quitter\n"); printf("\t9 - Quitter\n");
printf("\nChoix : "); printf("\nEntrez votre choix :\n> ");
scanf("%d", &choix); scanf("%d", &choix);
switch (choix) switch (choix)
{ {
case 1: case 1:
c = true; c = true;
// // modificationNbPDept(tiut, nb);
break; break;
case 2: case 2:
c = true; c = true;
// // creationDept(tiut[], nb);
break; break;
case 3: case 3:
c = true; c = true;
// // suppressionDept(tiut[], nb);
break; break;
case 4: case 4:
c = true; c = true;
// // modificationRespDept(tiut, nb);
break; break;
case 5: case 5:
c = true; c = true;

@ -1,4 +1,4 @@
#include "partie1.h" #include "SAE.h"
/* /*
ListeDept chargeListeDept(VilleIUT *tiut[]) ListeDept chargeListeDept(VilleIUT *tiut[])

@ -0,0 +1,52 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
/* Partie 1 */
typedef struct maillonDept
{
char departement[30];
int nbP;
char resp[30];
struct maillonDept *suiv;
} MaillonDept, *ListeDept;
typedef struct
{
char ville[30];
ListeDept ldept;
} VilleIUT;
/* Partie 3 */
typedef struct
{
char departement[30];
int decisionAdmission;
int decisionCandidat;
} Departement;
typedef struct maillonDepartement
{
Departement v;
struct maillonDepartement *suiv;
} MaillonDepartement, *ListeDepartement;
typedef struct
{
int num;
char nom[22]; // 20 caractere + 1 espace + 1 caractere de fin de chaine
char prenom[22]; // 20 caractere + 1 espace + 1 caractere de fin de chaine
int tabMatiere[4];
int nbChoix;
char ville[30];
ListeDepartement ldept;
} Admission;
typedef struct maillonAdmission
{
Admission v;
struct maillonAdmission *suiv;
} MaillonAdmission, *ListeAdmission;

@ -1,4 +1,4 @@
#include "partie1.h" #include "SAE.h"
ListeDept listenouv(void) ListeDept listenouv(void)
{ {

@ -1,4 +1,4 @@
#include "partie1.h" #include "SAE.h"
int main(void) int main(void)
{ {

@ -1,4 +1,4 @@
#include "partie1.h" #include "SAE.h"
void affichageVillesIUT(VilleIUT *tiut[], int nb) void affichageVillesIUT(VilleIUT *tiut[], int nb)
{ {
Loading…
Cancel
Save