diff options
author | polo <ordipolo@gmx.fr> | 2023-07-22 12:29:47 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2023-07-22 12:29:47 +0200 |
commit | 747674b450d6840ce9bd9aecd765cf31445ef8d3 (patch) | |
tree | 46e47fd65c751e1951d9aa8438aea1b8c2d8aece /src/main.php | |
parent | 9bdfb5196a2ee1cbfc403702e8d2ef88076d366f (diff) | |
download | AppliGestionPHP-747674b450d6840ce9bd9aecd765cf31445ef8d3.zip |
navigation entre sections, boucle principale, client ou prospect
Diffstat (limited to 'src/main.php')
-rwxr-xr-x | src/main.php | 130 |
1 files changed, 2 insertions, 128 deletions
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 | |||
49 | 49 | ||
50 | require('Latex.php'); // générer le code LaTeX | 50 | require('Latex.php'); // générer le code LaTeX |
51 | 51 | ||
52 | require('sections/1_new_service.php'); | ||
53 | require('sections/2_quotations.php'); | ||
54 | require('sections/3_modify_service.php'); | ||
55 | 52 | ||
56 | // boucle principale | 53 | // action !! |
57 | $boucle = true; | 54 | require('sections/main_loop.php'); |
58 | $code_retour = 0; // 0 dirige vers le menu principal, 1 vers la section 1, etc | ||
59 | while($boucle) | ||
60 | { | ||
61 | // niveau 1: menu principal | ||
62 | if($code_retour === 0) | ||
63 | { | ||
64 | $MenuPrincipal = new ZenityList(ZenitySetup::$menu_principal_text, ZenitySetup::$menu_principal_entrees); | ||
65 | $choix_niv1 = exec($MenuPrincipal->get()); | ||
66 | } | ||
67 | else | ||
68 | { | ||
69 | $choix_niv1 = ''; | ||
70 | } | ||
71 | |||
72 | |||
73 | // -- SECTION 1: Nouvelle prestation -- | ||
74 | if($choix_niv1 === ZenitySetup::$menu_principal_entrees[0] || $code_retour === 1) | ||
75 | { | ||
76 | echo("choix: $choix_niv1\n"); | ||
77 | $code_retour = newService(); | ||
78 | echo "debug: main.php: hello, code retour " . $code_retour . "\n"; | ||
79 | } | ||
80 | |||
81 | // -- SECTION 2: Devis -- | ||
82 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[1] || $code_retour === 2) | ||
83 | { | ||
84 | echo("choix: $choix_niv1\n"); | ||
85 | $code_retour = modifyService(); | ||
86 | } | ||
87 | // -- SECTION 3: Modifier un enregistrement -- | ||
88 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[2] || $code_retour === 3) | ||
89 | { | ||
90 | echo("choix: $choix_niv1\n"); | ||
91 | $code_retour = modifyService(); | ||
92 | } | ||
93 | |||
94 | // -- SECTION 4: Consulter/analyser les données -- | ||
95 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[3] || $code_retour === 4) | ||
96 | { | ||
97 | echo("choix: $choix_niv1\n"); | ||
98 | // quel affichage? des tableaux avec zenity? LaTeX? une page web? un autre outil servant à faire des tableaux et graphiques | ||
99 | } | ||
100 | |||
101 | // -- SECTION 5: Imprimer -- | ||
102 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[4] || $code_retour === 5) // = Imprimer un document | ||
103 | { | ||
104 | echo("choix: $choix_niv1\n"); | ||
105 | $MenuDocuments = new ZenityList(ZenitySetup::$menu_documents_text, ZenitySetup::$menu_documents_entrees); | ||
106 | $choix_niv2 = exec($MenuDocuments->get()); | ||
107 | if($choix_niv2 === ZenitySetup::$menu_documents_entrees[0]) | ||
108 | { | ||
109 | |||
110 | } | ||
111 | elseif($choix_niv2 === ZenitySetup::$menu_documents_entrees[1]) // = Facture | ||
112 | { | ||
113 | |||
114 | } | ||
115 | elseif($choix_niv2 === ZenitySetup::$menu_documents_entrees[2]) // = Lettre avec adresse | ||
116 | { | ||
117 | |||
118 | } | ||
119 | elseif($choix_niv2 === ZenitySetup::$menu_documents_entrees[3]) // = Livre des recettes | ||
120 | { | ||
121 | |||
122 | } | ||
123 | elseif($choix_niv2 === ZenitySetup::$menu_documents_entrees[4]) // = Registre des achats | ||
124 | { | ||
125 | |||
126 | } | ||
127 | elseif($choix_niv2 === ZenitySetup::$menu_documents_entrees[5]) // = Bilan annuel | ||
128 | { | ||
129 | |||
130 | } | ||
131 | else | ||
132 | { | ||
133 | // retour menu principal | ||
134 | } | ||
135 | } | ||
136 | |||
137 | // -- SECTION 6: Supports de communication -- | ||
138 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[5] || $code_retour === 6) // = Communication | ||
139 | { | ||
140 | echo("choix: $choix_niv1\n"); | ||
141 | $MenuCommunication = new ZenityList(ZenitySetup::$menu_communication_text, ZenitySetup::$menu_communication_entrees); | ||
142 | $choix_niv2 = exec($MenuCommunication->get()); | ||
143 | if($choix_niv2 === ZenitySetup::$menu_communication_entrees[0]) // = Flyer (nécessite gimp) | ||
144 | { | ||
145 | exec(windowAppCommand($image_editor, $flyer)); | ||
146 | } | ||
147 | elseif($choix_niv2 === ZenitySetup::$menu_communication_entrees[1]) // = Carte de visite (nécessite scribus) | ||
148 | { | ||
149 | exec(windowAppCommand($publishing, $business_card)); | ||
150 | } | ||
151 | elseif($choix_niv2 === ZenitySetup::$menu_communication_entrees[2]) // = Explorateur de fichiers | ||
152 | { | ||
153 | exec(windowAppCommand($file_explorer, $pub)); | ||
154 | } | ||
155 | else | ||
156 | { | ||
157 | // retour menu principal | ||
158 | } | ||
159 | } | ||
160 | |||
161 | // -- SECTION 7: BDD -- | ||
162 | elseif($choix_niv1 === ZenitySetup::$menu_principal_entrees[6] || $code_retour === 7) // = Base de données | ||
163 | { | ||
164 | echo("choix: $choix_niv1\n"); | ||
165 | if($sqlitebrowser_enable) | ||
166 | { | ||
167 | exec(windowAppCommand(Config::$sqlite_gui, Config::$db_path)); | ||
168 | } | ||
169 | else | ||
170 | { | ||
171 | exec($x_term_command . ' ' . $sqlite_cli . ' ' . Config::$db_path); // correpond à priori à: xterm -e sqlite3 ~/ORDIPOLO/Appli_PHP/ordipolo.sqlite | ||
172 | } | ||
173 | } | ||
174 | |||
175 | // arrêt | ||
176 | else | ||
177 | { | ||
178 | $boucle = false; | ||
179 | } | ||
180 | } | ||