diff --git a/Partie_1/menus.c b/Partie_1/menus.c deleted file mode 100644 index 62c4391..0000000 --- a/Partie_1/menus.c +++ /dev/null @@ -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; - } - } -} \ No newline at end of file diff --git a/Partie_1/menus.h b/Partie_1/menus.h deleted file mode 100644 index e9f222e..0000000 --- a/Partie_1/menus.h +++ /dev/null @@ -1,5 +0,0 @@ -#include - -void choixMenu(void); -void menuUtilisateur(void); -void menuAdministrateur(void); \ No newline at end of file diff --git a/Partie_1/partie1.h b/Partie_1/partie1.h deleted file mode 100755 index f4c82b9..0000000 --- a/Partie_1/partie1.h +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include -#include -#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); \ No newline at end of file diff --git a/Partie_1/structures.h b/Partie_1/structures.h deleted file mode 100644 index c247fe2..0000000 --- a/Partie_1/structures.h +++ /dev/null @@ -1,34 +0,0 @@ -#include -#include -#include - -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[]); \ No newline at end of file diff --git a/SAE.h b/SAE.h index 3211f99..78ad702 100755 --- a/SAE.h +++ b/SAE.h @@ -2,45 +2,48 @@ #include #include #include +#include "structures.h" /* Menus */ void choixMenu(void); void menuUtilisateur(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 -{ - char departement[30]; - int decisionAdmission; - int decisionCandidat; -} Departement; +/* Fichier */ +int chargementVillesIUT(VilleIUT *tiut[]); +int rechercheVille(VilleIUT *tiut[], int nb, char val[], bool *trouve); +void sauvegarde(VilleIUT *tiut[], int nb); -typedef struct maillonDepartement -{ - Departement v; - struct maillonDepartement *suiv; -} MaillonDepartement, *ListeDepartement; +/* Utilisateur */ +void affichageVillesIUT(VilleIUT *tiut[], int nb); +void affichageDeptIUT(VilleIUT *tiut[], int nb); -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; +/* 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); -typedef struct maillonAdmission -{ - Admission v; - struct maillonAdmission *suiv; -} MaillonAdmission, *ListeAdmission; + +// Partie 3 Departement lireDpt(FILE *flot); void afficherDpt(Departement dpt); @@ -56,42 +59,6 @@ ListeAdmission MoyenneCandidats(ListeAdmission listeCandidats); int modifNoteMinAdmis(); 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 int ConnexionUtilisateur(char *login, char *mdp); diff --git a/Partie_1/administrateur.c b/administrateur.c similarity index 99% rename from Partie_1/administrateur.c rename to administrateur.c index aebf3eb..bd19b7e 100644 --- a/Partie_1/administrateur.c +++ b/administrateur.c @@ -1,4 +1,4 @@ -#include "partie1.h" +#include "SAE.h" void modificationNbPDept(VilleIUT *tiut[], int nb) { diff --git a/Partie_1/informationsIUT.txt b/informationsIUT.txt similarity index 100% rename from Partie_1/informationsIUT.txt rename to informationsIUT.txt diff --git a/menus.c b/menus.c index b1f4188..3fbea0b 100755 --- a/menus.c +++ b/menus.c @@ -1,15 +1,4 @@ -#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; -} +#include "SAE.h" void choixMenu(void) { @@ -22,7 +11,7 @@ void choixMenu(void) printf("\t1 - Menu utilisateur\n"); printf("\t2 - Menu administrateur\n"); printf("\t9 - Quitter\n"); - printf("\nChoix : "); + printf("\nEntrez votre choix :\n> "); scanf("%d", &choix); switch (choix) { @@ -57,17 +46,17 @@ void menuUtilisateur(void) 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("\nChoix : "); + 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; @@ -98,29 +87,29 @@ void menuAdministrateur(void) 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 - Lancer la phase de candidature\n"); - printf("\t5 - Stopper la phase de candidature\n"); - printf("\t6 - Modifier le responsable d'un département\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("\nChoix : "); + 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; diff --git a/Partie_1/partie1.c b/partie1.c similarity index 99% rename from Partie_1/partie1.c rename to partie1.c index 92b0d0d..f1cc63b 100755 --- a/Partie_1/partie1.c +++ b/partie1.c @@ -1,4 +1,4 @@ -#include "partie1.h" +#include "SAE.h" /* ListeDept chargeListeDept(VilleIUT *tiut[]) diff --git a/structures.h b/structures.h new file mode 100644 index 0000000..8ffdfa8 --- /dev/null +++ b/structures.h @@ -0,0 +1,52 @@ +#include +#include +#include + +/* 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; + + diff --git a/Partie_1/structures.c b/structuresP1.c similarity index 99% rename from Partie_1/structures.c rename to structuresP1.c index bce89f9..0e02dea 100644 --- a/Partie_1/structures.c +++ b/structuresP1.c @@ -1,4 +1,4 @@ -#include "partie1.h" +#include "SAE.h" ListeDept listenouv(void) { diff --git a/Partie_1/test.c b/testP1.c similarity index 95% rename from Partie_1/test.c rename to testP1.c index c63f1e9..3e55cdc 100755 --- a/Partie_1/test.c +++ b/testP1.c @@ -1,4 +1,4 @@ -#include "partie1.h" +#include "SAE.h" int main(void) { diff --git a/Partie_1/utilisateur.c b/utilisateur.c similarity index 95% rename from Partie_1/utilisateur.c rename to utilisateur.c index 574c085..f2849dc 100644 --- a/Partie_1/utilisateur.c +++ b/utilisateur.c @@ -1,4 +1,4 @@ -#include "partie1.h" +#include "SAE.h" void affichageVillesIUT(VilleIUT *tiut[], int nb) {