From b4a9a1d9be4e30c2acfb72cf1d7cda29cf403943 Mon Sep 17 00:00:00 2001 From: Yann CHAMPEAU Date: Thu, 15 Dec 2022 11:32:59 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20fonctionnalit=C3=A9s=20pour=20l'ad?= =?UTF-8?q?ministrateur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/annexe/saeAnnexe.h | 27 ++++++++++++++++++--------- src/partie1/saeP1.c | 26 ++++++++++++++++++++++++++ src/partie1/saeP1.h | 18 ++++++++++++------ src/saeMain.c | 2 ++ 4 files changed, 58 insertions(+), 15 deletions(-) diff --git a/src/annexe/saeAnnexe.h b/src/annexe/saeAnnexe.h index c11ce91..f726fc7 100644 --- a/src/annexe/saeAnnexe.h +++ b/src/annexe/saeAnnexe.h @@ -8,15 +8,6 @@ typedef struct pile } pile; typedef struct pile* Pile; -Pile creerpile(int tmax); - -void empiler(Pile p, int x); - -void afficherPileEntier(Pile p); - -int depiler(Pile p); - - //File typedef struct file { @@ -26,10 +17,28 @@ typedef struct file } file; typedef struct file* File; + + + + //Initialisation de fonctions : void menu(void); +//Fonctions relatives aux listes chaînées : // +int existe(Listedep liste, char* mot); +//----------------------------------// + +//Fonctions relatives aux piles : // +Pile creerpile(int tmax); // + // +void empiler(Pile p, int x); // + // +void afficherPileEntier(Pile p); // + // +int depiler(Pile p); // +//----------------------------------// + //Fonctions relatives aux files : // File creerfile(int tmax); // // diff --git a/src/partie1/saeP1.c b/src/partie1/saeP1.c index 13c624e..ea91554 100644 --- a/src/partie1/saeP1.c +++ b/src/partie1/saeP1.c @@ -2,6 +2,7 @@ #include #include #include "saeP1.h" +#include "../annexe/saeAnnexe.h" void menuAdmin(void){ printf("#--------------------------------------------------------------------#\n"); @@ -19,3 +20,28 @@ void menuAdmin(void){ printf("#--------------------------------------------------------------------#\n\n"); printf("Choisissez l'action que vous voulez exécuter : "); } + +void modifPlaces(VilleIUT* tiut){ + int quit=0; + printf("Entrez la ville correspondant à l'IUT à modifier (Q pour abandonner):"); + char* ville[31]; + scanf("%*c%s",&ville); + if(ville=="Q") quit=1; + while(!quit && !rechercheVille(tiut,ville)){ + printf("Entrez la ville correspondant à l'IUT à modifier (Q pour abandonner):"); + scanf("%*c%s",&ville); + if(ville=="Q") quit=1; + } + quit=0 + printf("Entrez le département à modifier (Q pour abandonner):"); + char* dep[31]; + scanf("%*c%s",&dep); + if(dep=="Q") quit=1; + while(!quit && !existe(tiut->ldept,dep)){ + printf("Entrez le département à modifier (Q pour abandonner):"); + scanf("%*c%s",&dep); + if(dep=="Q") quit=1; + } + break; + //PAS FINI +} \ No newline at end of file diff --git a/src/partie1/saeP1.h b/src/partie1/saeP1.h index 1a0c828..2fd11b8 100644 --- a/src/partie1/saeP1.h +++ b/src/partie1/saeP1.h @@ -8,10 +8,12 @@ typedef struct MaillonDep struct MaillonDep* suivant; }MaillonDep; +typedef MaillonDep* ListeDept; + typedef struct { char Ville[31]; - MaillonDep* ldept; + ListeDep ldept; }VilleIUT; //Consultant @@ -30,12 +32,16 @@ void SearchDepInIUT(); void menuAdmin(); -void ModSpotInDep(); +void modifPlaces(); + +//void creerDep(); + +//void supprimerDep(); -void CreateDepInIUT(); +//void gestionPhaseCandidatures(); -void DelDepFromAnIUT(); +//void modifNomResponsable(); -void LauchOrCancelCandidPhase(); +//Général -void ModRespNameFromDep(); \ No newline at end of file +//int rechercheVille(VilleIUT* tiut, char* ville); \ No newline at end of file diff --git a/src/saeMain.c b/src/saeMain.c index a95d35c..4498e4f 100644 --- a/src/saeMain.c +++ b/src/saeMain.c @@ -9,6 +9,8 @@ int main(void) { + VilleIUT* tiut; + loadIUT(tiut); menu(); char user; scanf("%c",&user);