diff options
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 | } | ||