From 45f1b99a1060ee43deb6055faef1f8b16b5d80a2 Mon Sep 17 00:00:00 2001 From: polo Date: Fri, 1 Sep 2023 12:00:23 +0200 Subject: =?UTF-8?q?section=203=20bient=C3=B4t=20termin=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main_loop.php | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 src/main_loop.php (limited to 'src/main_loop.php') diff --git a/src/main_loop.php b/src/main_loop.php new file mode 100644 index 0000000..f68c251 --- /dev/null +++ b/src/main_loop.php @@ -0,0 +1,108 @@ +get()); + } + else + { + $choix_niv1 = ''; + } + + // comparaison du retour de $MenuPrincipal->get() avec les noms des entrées du même menu + + // -- SECTION 1: Clients et prospects -- + if($choix_niv1 === ZenitySetup::$menu_principal_entrees[0] || $section[0] === 1) + { + echo("choix: ". ZenitySetup::$menu_principal_entrees[0] . "\n"); + $section = newCustomer(); + } + + // -- SECTION 2: Prestations et devis -- + elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[1] || $section[0] === 2) + { + echo("choix: ". ZenitySetup::$menu_principal_entrees[1] . "\n"); + $section = newService($section[1]); // $section[1] vaut un type Clients ou null + } + + // -- SECTION 3: Modifier un enregistrement -- + elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[2] || $section[0] === 3) + { + echo("choix: " . ZenitySetup::$menu_principal_entrees[2] . "\n"); + $section = modifyData($section[1]); // $section[1] vaut un type Clients ou null + } + + // -- SECTION 4: Consulter, Imprimer un document -- + elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[3] || $section[0] === 4) // = Imprimer un document + { + echo("choix: ". ZenitySetup::$menu_principal_entrees[3] . "\n"); + $section = getOrPrintDocument(); + } + + // -- SECTION 5: Consulter/analyser les données -- + elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[4] || $section[0] === 5) + { + echo("choix: ". ZenitySetup::$menu_principal_entrees[4] . "\n"); + // quel affichage? des tableaux avec zenity? LaTeX? une page web? un autre outil servant à faire des tableaux et graphiques + } + + // -- SECTION 6: Supports de communication -- + elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[5] || $section[0] === 6) // = Communication + { + echo("choix: ". ZenitySetup::$menu_principal_entrees[5] . "\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] || $section[0] === 7) // = Base de données + { + echo("choix: ". ZenitySetup::$menu_principal_entrees[6] . "\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 + { + $main_loop = false; + } +} -- cgit v1.2.3