From 945af9fda5146405ab9903d4d268bcb2fe95da25 Mon Sep 17 00:00:00 2001 From: polo Date: Tue, 10 Jan 2023 13:08:54 +0100 Subject: enregistrement section 1 --- src/main.php | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'src/main.php') diff --git a/src/main.php b/src/main.php index 12715f3..0a8ae09 100755 --- a/src/main.php +++ b/src/main.php @@ -43,38 +43,49 @@ require('view/ZenitySetup.php'); // texte dans les fenêtres ET instanciation (u require('Latex.php'); // générer le code LaTeX require('sections/1_new_service.php'); - +require('sections/2_modify_service.php'); // boucle principale $boucle = true; +$code_retour = 0; // 0 dirige vers le menu principal, 1 vers la section 1, etc while($boucle) { // niveau 1: menu principal - $MenuPrincipal = new ZenityList(ZenitySetup::$menu_principal_text, ZenitySetup::$menu_principal_entrees); - $choix_niv1 = exec($MenuPrincipal->get()); + if($code_retour === 0) + { + $MenuPrincipal = new ZenityList(ZenitySetup::$menu_principal_text, ZenitySetup::$menu_principal_entrees); + $choix_niv1 = exec($MenuPrincipal->get()); + } + else + { + $choix_niv1 = ''; + } + // -- SECTION 1: Nouvelle prestation -- - if($choix_niv1 === ZenitySetup::$menu_principal_entrees[0]) + if($choix_niv1 === ZenitySetup::$menu_principal_entrees[0] || $code_retour === 1) { echo("choix: $choix_niv1\n"); - newService(); + $code_retour = newService(); + echo "hello, code retour: " . $code_retour . "\n"; } // -- SECTION 2: Modifier un enregistrement -- - elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[1]) + elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[1] || $code_retour === 2) { echo("choix: $choix_niv1\n"); + $code_retour = modifyService(); } - // -- SECTION 3: Fichier clients -- - elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[2]) + // -- SECTION 3: Consulter/analyser les données -- + elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[2] || $code_retour === 3) { echo("choix: $choix_niv1\n"); - // quel affichage? un grand tableau avec zenity? une page web? un document LaTeX? + // quel affichage? des tableaux avec zenity? LaTeX? une page web? un autre outil servant à faire des tableaux et graphiques } - // -- SECTION 4: documents à imprimer -- - elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[3]) // = Créer/imprimer un document + // -- SECTION 4: Imprimer -- + elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[3] || $code_retour === 4) // = Imprimer un document { echo("choix: $choix_niv1\n"); $MenuDocuments = new ZenityList(ZenitySetup::$menu_documents_text, ZenitySetup::$menu_documents_entrees); @@ -110,7 +121,7 @@ while($boucle) } // -- SECTION 5: Supports de communication -- - elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[4]) // = Communication + elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[4] || $code_retour === 5) // = Communication { echo("choix: $choix_niv1\n"); $MenuCommunication = new ZenityList(ZenitySetup::$menu_communication_text, ZenitySetup::$menu_communication_entrees); @@ -134,7 +145,7 @@ while($boucle) } // -- SECTION 6: BDD -- - elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[5]) // = Base de données + elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[5] || $code_retour === 6) // = Base de données { echo("choix: $choix_niv1\n"); if($sqlitebrowser_enable) -- cgit v1.2.3