blob: b0e3283f9553d9bc927943c06b1ce589f25a4688 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
<?php
// src/sections/1_customer.php
//
// -- SECTION 1: Fichier clients et propects --
function newCustomer(): array
{
// fenêtres
$TypeDeClient = new ZenityList(ZenitySetup::$type_client['text'], ZenitySetup::$type_client['entrees']);
$FinSection1 = new ZenityList(ZenitySetup::$fin_section_1['text'], ZenitySetup::$fin_section_1['entrees']);
// -- partie 1: client ou prospect? --
$Client = new Clients;
$choix_niv2 = exec($TypeDeClient->get());
if($choix_niv2 === ZenitySetup::$type_client['entrees'][0])
{
echo "choix: " . $choix_niv2 . "\n";
$Client->setType('client');
}
elseif($choix_niv2 === ZenitySetup::$type_client['entrees'][1])
{
echo "choix: " . $choix_niv2 . "\n";
$Client->setType('prospect');
}
else
{
return [0, null]; // menu principal
}
// -- partie 2: saisie des infos --
if(enterCustomer($Client))
{
// -- partie 3: on fait quoi maintenant --
$choix_niv3 = exec($FinSection1->get());
if($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][0])
{
return [2, $Client]; // section 2: newService()
}
elseif($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][1])
{
return [3, $Client]; // section 3: modifyData()
}
elseif($choix_niv3 === ZenitySetup::$fin_section_1['entrees'][2])
{
return [1, null]; // relancer section 1: newCustomer()
}
else
{
return [0, null]; // menu principal
}
}
return [0, null]; // menu principal
}
|