From 747674b450d6840ce9bd9aecd765cf31445ef8d3 Mon Sep 17 00:00:00 2001 From: polo Date: Sat, 22 Jul 2023 12:29:47 +0200 Subject: navigation entre sections, boucle principale, client ou prospect --- src/main.php | 130 +---------------------------------------------------------- 1 file changed, 2 insertions(+), 128 deletions(-) (limited to 'src/main.php') diff --git a/src/main.php b/src/main.php index 7bf8470..a0b973b 100755 --- a/src/main.php +++ b/src/main.php @@ -49,132 +49,6 @@ 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_quotations.php'); -require('sections/3_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 - 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] || $code_retour === 1) - { - echo("choix: $choix_niv1\n"); - $code_retour = newService(); - echo "debug: main.php: hello, code retour " . $code_retour . "\n"; - } - - // -- SECTION 2: Devis -- - elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[1] || $code_retour === 2) - { - echo("choix: $choix_niv1\n"); - $code_retour = modifyService(); - } - // -- SECTION 3: Modifier un enregistrement -- - elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[2] || $code_retour === 3) - { - echo("choix: $choix_niv1\n"); - $code_retour = modifyService(); - } - - // -- SECTION 4: Consulter/analyser les données -- - elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[3] || $code_retour === 4) - { - echo("choix: $choix_niv1\n"); - // quel affichage? des tableaux avec zenity? LaTeX? une page web? un autre outil servant à faire des tableaux et graphiques - } - - // -- SECTION 5: Imprimer -- - elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[4] || $code_retour === 5) // = Imprimer un document - { - echo("choix: $choix_niv1\n"); - $MenuDocuments = new ZenityList(ZenitySetup::$menu_documents_text, ZenitySetup::$menu_documents_entrees); - $choix_niv2 = exec($MenuDocuments->get()); - if($choix_niv2 === ZenitySetup::$menu_documents_entrees[0]) - { - - } - elseif($choix_niv2 === ZenitySetup::$menu_documents_entrees[1]) // = Facture - { - - } - elseif($choix_niv2 === ZenitySetup::$menu_documents_entrees[2]) // = Lettre avec adresse - { - - } - elseif($choix_niv2 === ZenitySetup::$menu_documents_entrees[3]) // = Livre des recettes - { - - } - elseif($choix_niv2 === ZenitySetup::$menu_documents_entrees[4]) // = Registre des achats - { - - } - elseif($choix_niv2 === ZenitySetup::$menu_documents_entrees[5]) // = Bilan annuel - { - - } - else - { - // retour menu principal - } - } - - // -- SECTION 6: Supports de communication -- - elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[5] || $code_retour === 6) // = Communication - { - echo("choix: $choix_niv1\n"); - $MenuCommunication = new ZenityList(ZenitySetup::$menu_communication_text, ZenitySetup::$menu_communication_entrees); - $choix_niv2 = exec($MenuCommunication->get()); - if($choix_niv2 === ZenitySetup::$menu_communication_entrees[0]) // = Flyer (nécessite gimp) - { - exec(windowAppCommand($image_editor, $flyer)); - } - elseif($choix_niv2 === ZenitySetup::$menu_communication_entrees[1]) // = Carte de visite (nécessite scribus) - { - exec(windowAppCommand($publishing, $business_card)); - } - elseif($choix_niv2 === ZenitySetup::$menu_communication_entrees[2]) // = Explorateur de fichiers - { - exec(windowAppCommand($file_explorer, $pub)); - } - else - { - // retour menu principal - } - } - - // -- SECTION 7: BDD -- - elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[6] || $code_retour === 7) // = Base de données - { - echo("choix: $choix_niv1\n"); - if($sqlitebrowser_enable) - { - exec(windowAppCommand(Config::$sqlite_gui, Config::$db_path)); - } - else - { - exec($x_term_command . ' ' . $sqlite_cli . ' ' . Config::$db_path); // correpond à priori à: xterm -e sqlite3 ~/ORDIPOLO/Appli_PHP/ordipolo.sqlite - } - } - - // arrêt - else - { - $boucle = false; - } -} +// action !! +require('sections/main_loop.php'); -- cgit v1.2.3