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/sections/1_customer.php | |
| parent | 9bdfb5196a2ee1cbfc403702e8d2ef88076d366f (diff) | |
| download | AppliGestionPHP-747674b450d6840ce9bd9aecd765cf31445ef8d3.tar.gz AppliGestionPHP-747674b450d6840ce9bd9aecd765cf31445ef8d3.tar.bz2 AppliGestionPHP-747674b450d6840ce9bd9aecd765cf31445ef8d3.zip | |
navigation entre sections, boucle principale, client ou prospect
Diffstat (limited to 'src/sections/1_customer.php')
| -rw-r--r-- | src/sections/1_customer.php | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/sections/1_customer.php b/src/sections/1_customer.php new file mode 100644 index 0000000..cdec448 --- /dev/null +++ b/src/sections/1_customer.php | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | <?php | ||
| 2 | // src/sections/1_customer.php | ||
| 3 | // | ||
| 4 | // -- SECTION 1: Fichier clients et propects -- | ||
| 5 | |||
| 6 | function newCustomer(): array | ||
| 7 | { | ||
| 8 | // fenêtres | ||
| 9 | $TypeDeClient = new ZenityList(ZenitySetup::$type_client_text, ZenitySetup::$type_client_entrees); | ||
| 10 | //~ $NouveauClient = new ZenityForms(ZenitySetup::$nouveau_client_text, ZenitySetup::$nouveau_client_entrees); | ||
| 11 | $FinSection1 = new ZenityList(ZenitySetup::$fin_section_1_text, ZenitySetup::$fin_section_1_entrees); | ||
| 12 | |||
| 13 | // -- partie 1: client ou prospect? -- | ||
| 14 | $Client = new Clients; | ||
| 15 | if(exec($TypeDeClient->get()) === 'Client') | ||
| 16 | { | ||
| 17 | $Client->setType('client'); | ||
| 18 | } | ||
| 19 | //~ else // | ||
| 20 | //~ { | ||
| 21 | //~ $Client->setType('prospect'); | ||
| 22 | //~ } | ||
| 23 | |||
| 24 | // -- partie 2: saisie des infos -- | ||
| 25 | if(enterCustomer($Client)) | ||
| 26 | { | ||
| 27 | // -- partie 3: on fait quoi maintenant -- | ||
| 28 | $choix_niv2 = exec($FinSection1->get()); | ||
| 29 | if($choix_niv2 === ZenitySetup::$fin_section_1_entrees[0]) | ||
| 30 | { | ||
| 31 | return [2, $Client]; // section 2: newService() | ||
| 32 | } | ||
| 33 | elseif($choix_niv2 === ZenitySetup::$fin_section_1_entrees[1]) | ||
| 34 | { | ||
| 35 | return [3, $Client]; // section 3: modifyData() | ||
| 36 | } | ||
| 37 | elseif($choix_niv2 === ZenitySetup::$fin_section_1_entrees[2]) | ||
| 38 | { | ||
| 39 | return [1, null]; // relancer section 1: newCustomer() | ||
| 40 | } | ||
| 41 | else | ||
| 42 | { | ||
| 43 | return [0, null]; // menu principal | ||
| 44 | } | ||
| 45 | } | ||
| 46 | |||
| 47 | return [0, null]; // menu principal | ||
| 48 | } | ||
