diff options
Diffstat (limited to 'src/sections/main_loop.php')
| -rw-r--r-- | src/sections/main_loop.php | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/sections/main_loop.php b/src/sections/main_loop.php index 7dd1af0..f68c251 100644 --- a/src/sections/main_loop.php +++ b/src/sections/main_loop.php | |||
| @@ -6,14 +6,15 @@ | |||
| 6 | require('sections/1_customer.php'); | 6 | require('sections/1_customer.php'); |
| 7 | require('sections/2_service.php'); | 7 | require('sections/2_service.php'); |
| 8 | require('sections/3_modify_data.php'); | 8 | require('sections/3_modify_data.php'); |
| 9 | require('sections/4_get_document.php'); | ||
| 9 | 10 | ||
| 10 | $main_loop = true; | 11 | $main_loop = true; |
| 11 | $returned = [0, null]; // [code de retour, éventuelles données] | 12 | $section = [0, null]; // [code de retour, éventuelles données] |
| 12 | 13 | ||
| 13 | while($main_loop) | 14 | while($main_loop) |
| 14 | { | 15 | { |
| 15 | // -- MENU PRINCIPAL (niveau 1) -- | 16 | // -- MENU PRINCIPAL (niveau 1) -- |
| 16 | if($returned[0] === 0) | 17 | if($section[0] === 0) |
| 17 | { | 18 | { |
| 18 | echo("Menu principal\n"); | 19 | echo("Menu principal\n"); |
| 19 | $MenuPrincipal = new ZenityList(ZenitySetup::$menu_principal_text, ZenitySetup::$menu_principal_entrees); | 20 | $MenuPrincipal = new ZenityList(ZenitySetup::$menu_principal_text, ZenitySetup::$menu_principal_entrees); |
| @@ -24,44 +25,45 @@ while($main_loop) | |||
| 24 | $choix_niv1 = ''; | 25 | $choix_niv1 = ''; |
| 25 | } | 26 | } |
| 26 | 27 | ||
| 27 | 28 | // comparaison du retour de $MenuPrincipal->get() avec les noms des entrées du même menu | |
| 29 | |||
| 28 | // -- SECTION 1: Clients et prospects -- | 30 | // -- SECTION 1: Clients et prospects -- |
| 29 | if($choix_niv1 === ZenitySetup::$menu_principal_entrees[0] || $returned[0] === 1) | 31 | if($choix_niv1 === ZenitySetup::$menu_principal_entrees[0] || $section[0] === 1) |
| 30 | { | 32 | { |
| 31 | echo("choix: ". ZenitySetup::$menu_principal_entrees[0] . "\n"); | 33 | echo("choix: ". ZenitySetup::$menu_principal_entrees[0] . "\n"); |
| 32 | $returned = newCustomer(); | 34 | $section = newCustomer(); |
| 33 | } | 35 | } |
| 34 | 36 | ||
| 35 | // -- SECTION 2: Prestations et devis -- | 37 | // -- SECTION 2: Prestations et devis -- |
| 36 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[1] || $returned[0] === 2) | 38 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[1] || $section[0] === 2) |
| 37 | { | 39 | { |
| 38 | echo("choix: ". ZenitySetup::$menu_principal_entrees[1] . "\n"); | 40 | echo("choix: ". ZenitySetup::$menu_principal_entrees[1] . "\n"); |
| 39 | $returned = newService($returned[1]); // $returned[1] vaut un type Clients ou null | 41 | $section = newService($section[1]); // $section[1] vaut un type Clients ou null |
| 40 | } | 42 | } |
| 41 | 43 | ||
| 42 | // -- SECTION 3: Modifier un enregistrement -- | 44 | // -- SECTION 3: Modifier un enregistrement -- |
| 43 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[2] || $returned[0] === 3) | 45 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[2] || $section[0] === 3) |
| 44 | { | 46 | { |
| 45 | echo("choix: " . ZenitySetup::$menu_principal_entrees[2] . "\n"); | 47 | echo("choix: " . ZenitySetup::$menu_principal_entrees[2] . "\n"); |
| 46 | $returned = modifyData(); | 48 | $section = modifyData($section[1]); // $section[1] vaut un type Clients ou null |
| 47 | } | 49 | } |
| 48 | 50 | ||
| 49 | // -- SECTION 4: Consulter, Imprimer un document -- | 51 | // -- SECTION 4: Consulter, Imprimer un document -- |
| 50 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[3] || $returned[0] === 4) // = Imprimer un document | 52 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[3] || $section[0] === 4) // = Imprimer un document |
| 51 | { | 53 | { |
| 52 | echo("choix: ". ZenitySetup::$menu_principal_entrees[3] . "\n"); | 54 | echo("choix: ". ZenitySetup::$menu_principal_entrees[3] . "\n"); |
| 53 | $returned = getDocument(); | 55 | $section = getOrPrintDocument(); |
| 54 | } | 56 | } |
| 55 | 57 | ||
| 56 | // -- SECTION 5: Consulter/analyser les données -- | 58 | // -- SECTION 5: Consulter/analyser les données -- |
| 57 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[4] || $returned[0] === 5) | 59 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[4] || $section[0] === 5) |
| 58 | { | 60 | { |
| 59 | echo("choix: ". ZenitySetup::$menu_principal_entrees[4] . "\n"); | 61 | echo("choix: ". ZenitySetup::$menu_principal_entrees[4] . "\n"); |
| 60 | // quel affichage? des tableaux avec zenity? LaTeX? une page web? un autre outil servant à faire des tableaux et graphiques | 62 | // quel affichage? des tableaux avec zenity? LaTeX? une page web? un autre outil servant à faire des tableaux et graphiques |
| 61 | } | 63 | } |
| 62 | 64 | ||
| 63 | // -- SECTION 6: Supports de communication -- | 65 | // -- SECTION 6: Supports de communication -- |
| 64 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[5] || $returned[0] === 6) // = Communication | 66 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[5] || $section[0] === 6) // = Communication |
| 65 | { | 67 | { |
| 66 | echo("choix: ". ZenitySetup::$menu_principal_entrees[5] . "\n"); | 68 | echo("choix: ". ZenitySetup::$menu_principal_entrees[5] . "\n"); |
| 67 | $MenuCommunication = new ZenityList(ZenitySetup::$menu_communication_text, ZenitySetup::$menu_communication_entrees); | 69 | $MenuCommunication = new ZenityList(ZenitySetup::$menu_communication_text, ZenitySetup::$menu_communication_entrees); |
| @@ -85,7 +87,7 @@ while($main_loop) | |||
| 85 | } | 87 | } |
| 86 | 88 | ||
| 87 | // -- SECTION 7: BDD -- | 89 | // -- SECTION 7: BDD -- |
| 88 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[6] || $returned[0] === 7) // = Base de données | 90 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[6] || $section[0] === 7) // = Base de données |
| 89 | { | 91 | { |
| 90 | echo("choix: ". ZenitySetup::$menu_principal_entrees[6] . "\n"); | 92 | echo("choix: ". ZenitySetup::$menu_principal_entrees[6] . "\n"); |
| 91 | if($sqlitebrowser_enable) | 93 | if($sqlitebrowser_enable) |
